[Webkit-unassigned] [Bug 27522] Creating list clears background color

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 21 08:49:42 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=27522





--- Comment #9 from Enrica Casucci <enrica at apple.com>  2010-01-21 08:49:41 PST ---
(From update of attachment 47104)
> diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
> index f230799..6286626 100644
> --- a/LayoutTests/ChangeLog
> +++ b/LayoutTests/ChangeLog
> @@ -1,3 +1,15 @@
> +2010-01-21  Tony Chang  <tony at chromium.org>
> +
> +        Reviewed by NOBODY (OOPS!).
> +
> +        https://bugs.webkit.org/show_bug.cgi?id=27522
> +        Preserve background color when creating a list.
> +
> +        * editing/execCommand/insert-list-preserve-bgcolor-expected.txt: Added.
> +        * editing/execCommand/insert-list-preserve-bgcolor.html: Added.
> +        * editing/inserting/5994480-2-expected.txt:
> +        * platform/mac/editing/pasteboard/select-element-1-expected.txt:
> +
>  2010-01-20  Daniel Bates  <dbates at webkit.org>
>  
>          Unreviewed. Add failing test fast/css/button-height.html
> diff --git a/LayoutTests/editing/execCommand/insert-list-preserve-bgcolor-expected.txt b/LayoutTests/editing/execCommand/insert-list-preserve-bgcolor-expected.txt
> new file mode 100644
> index 0000000..a7236fa
> --- /dev/null
> +++ b/LayoutTests/editing/execCommand/insert-list-preserve-bgcolor-expected.txt
> @@ -0,0 +1,3 @@
> +this should have a yellow background
> +
> +<ul><li><span class="Apple-style-span" style="background-color: rgb(255, 255, 0); ">this should have a yellow background</span></li></ul>
> diff --git a/LayoutTests/editing/execCommand/insert-list-preserve-bgcolor.html b/LayoutTests/editing/execCommand/insert-list-preserve-bgcolor.html
> new file mode 100644
> index 0000000..f64442c
> --- /dev/null
> +++ b/LayoutTests/editing/execCommand/insert-list-preserve-bgcolor.html
> @@ -0,0 +1,14 @@
> +<body contentEditable='true'>
> +<p id="paragraph"><span style='background-color: yellow;'>this should have a yellow background</span></p>
> +<p id="results"></p>
> +</body>
> +<script src="../editing.js"></script>
> +<script>
> +  if (window.layoutTestController)
> +      layoutTestController.dumpAsText();
> +  var p = document.getElementById("paragraph");
> +  setSelectionCommand(p, 0, p, 0);
> +  execExtendSelectionForwardBySentenceCommand();
> +  document.execCommand("insertunorderedlist");
> +  document.getElementById("results").innerText = p.innerHTML;
> +</script>
> diff --git a/LayoutTests/editing/inserting/5994480-2-expected.txt b/LayoutTests/editing/inserting/5994480-2-expected.txt
> index 224592b..5a360f2 100644
> --- a/LayoutTests/editing/inserting/5994480-2-expected.txt
> +++ b/LayoutTests/editing/inserting/5994480-2-expected.txt
> @@ -1 +1 @@
> -<font class="Apple-style-span" face="'Lucida Grande'" size="3"><span class="Apple-style-span" style="font-size: 11px;"><br></span></font>
> +<font class="Apple-style-span" face="'Lucida Grande'" size="3"><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); font-size: 11px;"><br></span></font>
> diff --git a/LayoutTests/platform/mac/editing/pasteboard/select-element-1-expected.txt b/LayoutTests/platform/mac/editing/pasteboard/select-element-1-expected.txt
> index 30d1d13..510acfb 100644
> --- a/LayoutTests/platform/mac/editing/pasteboard/select-element-1-expected.txt
> +++ b/LayoutTests/platform/mac/editing/pasteboard/select-element-1-expected.txt
> @@ -30,7 +30,7 @@ layer at (0,0) size 800x600
>            text run at (253,0) width 220: "All the options should be included."
>        RenderBlock {DIV} at (0,34) size 784x13
>          RenderInline {FONT} at (0,0) size 0x18
> -          RenderInline {SPAN} at (0,0) size 0x13
> +          RenderInline {SPAN} at (0,0) size 0x13 [bgcolor=#FFFFFF]
>              RenderBR {BR} at (0,0) size 0x13
>        RenderBlock {DIV} at (0,47) size 784x22
>          RenderMenuList {SELECT} at (2,2) size 62x18 [bgcolor=#FFFFFF]
> diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
> index 47f3eb2..873b8b0 100644
> --- a/WebCore/ChangeLog
> +++ b/WebCore/ChangeLog
> @@ -1,3 +1,16 @@
> +2010-01-21  Tony Chang  <tony at chromium.org>
> +
> +        Reviewed by NOBODY (OOPS!).
> +
> +        https://bugs.webkit.org/show_bug.cgi?id=27522
> +        Preserve background color when creating a list.
> +
> +        Test: editing/execCommand/insert-list-preserve-bgcolor.html
> +
> +        * editing/ApplyStyleCommand.cpp:
> +        (WebCore::):
> +        (WebCore::editingStyleAtPosition):
> +
>  2010-01-20  Fumitoshi Ukai  <ukai at chromium.org>
>  
>          Reviewed by Alexey Proskuryakov.
> diff --git a/WebCore/editing/ApplyStyleCommand.cpp b/WebCore/editing/ApplyStyleCommand.cpp
> index 7a8f025..93d9310 100644
> --- a/WebCore/editing/ApplyStyleCommand.cpp
> +++ b/WebCore/editing/ApplyStyleCommand.cpp
> @@ -388,6 +388,7 @@ RefPtr<CSSMutableStyleDeclaration> getPropertiesNotInComputedStyle(CSSStyleDecla
>  // FIXME: The current editingStyleProperties contains all inheritableProperties but we may not need to preserve all inheritable properties
>  static const int editingStyleProperties[] = {
>      // CSS inheritable properties
> +    CSSPropertyBackgroundColor,
>      CSSPropertyBorderCollapse,
>      CSSPropertyColor,
>      CSSPropertyFontFamily,
This is not the correct fix and will have unwanted side effects. We had the
equivalent bug for Indent command.Take a look at
https://bugs.webkit.org/show_bug.cgi?id=29697 and also to
https://bugs.webkit.org/show_bug.cgi?id=29740 to see how the style gets
preserved.I did a lot of work in this area and I'll be happy to provide more
context if you want.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list