Reviewed by John
authorkocienda <kocienda@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Aug 2004 21:34:02 +0000 (21:34 +0000)
committerkocienda <kocienda@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Aug 2004 21:34:02 +0000 (21:34 +0000)
        Fix for this bug:

        <rdar://problem/3775214> BR elements cause unnecessary spans to be added when applying style

        * khtml/editing/htmlediting_impl.cpp:
        (khtml::ApplyStyleCommandImpl::doApply): BR elements can be grouped more liberally with other nodes
        now in the iteration when attempting to find nodes that can be styled together with one span.
        * layout-tests/editing/style/style-3690704-fix-expected.txt: Updated with new results after
        bug fix.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@7366 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog-2005-08-23
WebCore/khtml/editing/htmlediting_impl.cpp

index 31afadd3938a78764694b1a78885e0667a17c135..b421cb3571d7c6aaddceda5a4f616915d6678fea 100644 (file)
@@ -1,3 +1,17 @@
+2004-08-25  Ken Kocienda  <kocienda@apple.com>
+
+        Reviewed by John
+
+        Fix for this bug:
+        
+        <rdar://problem/3775214> BR elements cause unnecessary spans to be added when applying style
+
+        * khtml/editing/htmlediting_impl.cpp:
+        (khtml::ApplyStyleCommandImpl::doApply): BR elements can be grouped more liberally with other nodes
+        now in the iteration when attempting to find nodes that can be styled together with one span.
+        * layout-tests/editing/style/style-3690704-fix-expected.txt: Updated with new results after
+        bug fix.
+
 2004-08-25  Ken Kocienda  <kocienda@apple.com>
 
         Reviewed by John
index 74548607a043ac25f35fc1dbf96c78fb038e2d2f..b11305d1d7bf09ca5058aa504f74a2c505484849 100644 (file)
@@ -726,7 +726,7 @@ void ApplyStyleCommandImpl::doApply()
                     // the current group.
                     if (node == end.node() || 
                         runStart->parentNode() != next->parentNode() || 
-                        next->isHTMLElement() || 
+                        (next->isHTMLElement() && next->id() != ID_BR) || 
                         (next->renderer() && !next->renderer()->isInline()))
                         break;
                     node = next;