Title: [150702] trunk/Source/WebCore
Revision
150702
Author
[email protected]
Date
2013-05-25 20:29:12 -0700 (Sat, 25 May 2013)

Log Message

Don't instantiate ChildNodeLists just to get a child count.
<http://webkit.org/b/116776>

Reviewed by Ryosuke Niwa.

Use ContainerNode::childNodeCount() instead of Node::childNodes()->length().

* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::mergeEndWithNextIfIdentical):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (150701 => 150702)


--- trunk/Source/WebCore/ChangeLog	2013-05-26 02:57:51 UTC (rev 150701)
+++ trunk/Source/WebCore/ChangeLog	2013-05-26 03:29:12 UTC (rev 150702)
@@ -1,5 +1,17 @@
 2013-05-25  Andreas Kling  <[email protected]>
 
+        Don't instantiate ChildNodeLists just to get a child count.
+        <http://webkit.org/b/116776>
+
+        Reviewed by Ryosuke Niwa.
+
+        Use ContainerNode::childNodeCount() instead of Node::childNodes()->length().
+
+        * editing/ApplyStyleCommand.cpp:
+        (WebCore::ApplyStyleCommand::mergeEndWithNextIfIdentical):
+
+2013-05-25  Andreas Kling  <[email protected]>
+
         PluginDocument::pluginNode() should be pluginElement() instead.
         <http://webkit.org/b/116774>
 

Modified: trunk/Source/WebCore/editing/ApplyStyleCommand.cpp (150701 => 150702)


--- trunk/Source/WebCore/editing/ApplyStyleCommand.cpp	2013-05-26 02:57:51 UTC (rev 150701)
+++ trunk/Source/WebCore/editing/ApplyStyleCommand.cpp	2013-05-26 03:29:12 UTC (rev 150702)
@@ -1304,7 +1304,7 @@
         if (offsetIsBeforeLastNodeOffset(endOffset, endNode))
             return false;
 
-        unsigned parentLastOffset = end.deprecatedNode()->parentNode()->childNodes()->length() - 1;
+        unsigned parentLastOffset = end.deprecatedNode()->parentNode()->childNodeCount() - 1;
         if (end.deprecatedNode()->nextSibling())
             return false;
 
@@ -1324,7 +1324,7 @@
         mergeIdenticalElements(element, nextElement);
 
         bool shouldUpdateStart = start.containerNode() == endNode;
-        int endOffset = nextChild ? nextChild->nodeIndex() : nextElement->childNodes()->length();
+        int endOffset = nextChild ? nextChild->nodeIndex() : nextElement->childNodeCount();
         updateStartEnd(shouldUpdateStart ? Position(nextElement, start.offsetInContainerNode(), Position::PositionIsOffsetInAnchor) : start,
                        Position(nextElement, endOffset, Position::PositionIsOffsetInAnchor));
         return true;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to