Title: [148320] branches/safari-536.30-branch

Diff

Modified: branches/safari-536.30-branch/LayoutTests/ChangeLog (148319 => 148320)


--- branches/safari-536.30-branch/LayoutTests/ChangeLog	2013-04-13 00:03:56 UTC (rev 148319)
+++ branches/safari-536.30-branch/LayoutTests/ChangeLog	2013-04-13 00:09:23 UTC (rev 148320)
@@ -1,3 +1,17 @@
+2013-04-12  Ryosuke Niwa  <[email protected]>
+
+        Merge 117463.
+
+    2012-05-17  Caio Marcelo de Oliveira Filho  <[email protected]>
+
+            [Qt] REGRESSION(101967): It made editing/style/iframe-onload-crash-mac.html timeout
+            https://bugs.webkit.org/show_bug.cgi?id=73802
+
+            Reviewed by Ryosuke Niwa.
+
+            * platform/qt/Skipped: Unskipped. Note that it is still skipped for wk2 because
+            setEditingBehavior is not implemented for WebKitTestRunner yet.
+
 2013-04-12  Lucas Forschler  <[email protected]>
 
         Merge r138692

Modified: branches/safari-536.30-branch/LayoutTests/platform/qt/Skipped (148319 => 148320)


--- branches/safari-536.30-branch/LayoutTests/platform/qt/Skipped	2013-04-13 00:03:56 UTC (rev 148319)
+++ branches/safari-536.30-branch/LayoutTests/platform/qt/Skipped	2013-04-13 00:09:23 UTC (rev 148320)
@@ -2464,10 +2464,6 @@
 # https://bugs.webkit.org/show_bug.cgi?id=73660
 fast/forms/select/listbox-in-multi-column.html
 
-# [Qt] REGRESSION(101967): It made editing/style/iframe-onload-crash-mac.html timeout
-# https://bugs.webkit.org/show_bug.cgi?id=73802
-editing/style/iframe-onload-crash-mac.html
-
 # [Qt] fails fast/inline/nested-text-descendants.html
 # https://bugs.webkit.org/show_bug.cgi?id=75321
 fast/inline/nested-text-descendants.html

Modified: branches/safari-536.30-branch/Source/WebCore/ChangeLog (148319 => 148320)


--- branches/safari-536.30-branch/Source/WebCore/ChangeLog	2013-04-13 00:03:56 UTC (rev 148319)
+++ branches/safari-536.30-branch/Source/WebCore/ChangeLog	2013-04-13 00:09:23 UTC (rev 148320)
@@ -1,3 +1,44 @@
+2013-04-12  Ryosuke Niwa  <[email protected]>
+
+        Merge 117463.
+
+    2012-05-17  Caio Marcelo de Oliveira Filho  <[email protected]>
+
+            [Qt] REGRESSION(101967): It made editing/style/iframe-onload-crash-mac.html timeout
+            https://bugs.webkit.org/show_bug.cgi?id=73802
+
+            Reviewed by Ryosuke Niwa.
+
+            Timeout was caused by an infinite in the outer loop of
+            pushDownInlineStyleAroundNode(). The outer loop variable 'current' should point at the
+            node containing 'targetNode'. The inner loop traverse the children of 'current'
+            and discover the children that contains 'targetNode'.
+
+            However, before the inner loop, we call removeInlineStyleFromElement() that can
+            potentially remove the 'current' node from the tree, moving its children to
+            'current' former parent. For that reason 'child' and 'lastChild' are collected
+            before this call.
+
+            The tricky part is that changing the 'current' children parent, we might trigger
+            further side-effects, that can remove either 'child' or 'lastChild' from the tree
+            too. The infinite loop was due to 'child' being off the document, so it's
+            nextSibling() is 0, and we go another run of outer loop without changing
+            'current' because the 'targetNode' wasn't in the first child that inner loop
+            couldn't reach.
+
+            When testing Qt on Mac, there was also a crash in RenderTextControl when the font
+            family was empty, this patch fixes it as well.
+
+            * editing/ApplyStyleCommand.cpp:
+            (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode): Use NodeVector
+            instead of relying on first/last child being valid after
+            removeInlineStyleFromElement() is called. Skip the child if it has no parent,
+            this is an indication that it was removed from the tree.
+
+            * rendering/RenderTextControl.cpp:
+            (WebCore::RenderTextControl::hasValidAvgCharWidth): Empty AtomicStrings aren't
+            supported by HashSet, so we have to early return in this case.
+
 2013-04-12  Lucas Forschler  <[email protected]>
 
         Merge r138654

Modified: branches/safari-536.30-branch/Source/WebCore/editing/ApplyStyleCommand.cpp (148319 => 148320)


--- branches/safari-536.30-branch/Source/WebCore/editing/ApplyStyleCommand.cpp	2013-04-13 00:03:56 UTC (rev 148319)
+++ branches/safari-536.30-branch/Source/WebCore/editing/ApplyStyleCommand.cpp	2013-04-13 00:09:23 UTC (rev 148320)
@@ -977,8 +977,8 @@
     while (current != targetNode) {
         ASSERT(current);
         ASSERT(current->contains(targetNode));
-        Node* child = current->firstChild();
-        Node* lastChild = current->lastChild();
+        NodeVector currentChildren;
+        getChildNodes(current, currentChildren);
         RefPtr<StyledElement> styledElement;
         if (current->isStyledElement() && isStyledInlineElementToRemove(static_cast<Element*>(current))) {
             styledElement = static_cast<StyledElement*>(current);
@@ -991,9 +991,10 @@
 
         // The inner loop will go through children on each level
         // FIXME: we should aggregate inline child elements together so that we don't wrap each child separately.
-        while (child) {
-            Node* nextChild = child->nextSibling();
-
+        for (size_t i = 0; i < currentChildren.size(); ++i) {
+            Node* child = currentChildren[i].get();
+            if (!child->parentNode())
+                continue;
             if (!child->contains(targetNode) && elementsToPushDown.size()) {
                 for (size_t i = 0; i < elementsToPushDown.size(); i++) {
                     RefPtr<Element> wrapper = elementsToPushDown[i]->cloneElementWithoutChildren();
@@ -1011,10 +1012,6 @@
             // When reached targetNode, stop the outer loop upon the completion of the current inner loop
             if (child == targetNode || child->contains(targetNode))
                 current = child;
-
-            if (child == lastChild || child->contains(lastChild))
-                break;
-            child = nextChild;
         }
     }
 }

Modified: branches/safari-536.30-branch/Source/WebCore/rendering/RenderTextControl.cpp (148319 => 148320)


--- branches/safari-536.30-branch/Source/WebCore/rendering/RenderTextControl.cpp	2013-04-13 00:03:56 UTC (rev 148319)
+++ branches/safari-536.30-branch/Source/WebCore/rendering/RenderTextControl.cpp	2013-04-13 00:09:23 UTC (rev 148320)
@@ -208,6 +208,9 @@
 {
     static HashSet<AtomicString>* fontFamiliesWithInvalidCharWidthMap = 0;
 
+    if (family.isEmpty())
+        return false;
+
     if (!fontFamiliesWithInvalidCharWidthMap) {
         fontFamiliesWithInvalidCharWidthMap = new HashSet<AtomicString>;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to