Fix orphan needsLayout state in RenderTextControlSingleLine
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Aug 2013 01:44:51 +0000 (01:44 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Aug 2013 01:44:51 +0000 (01:44 +0000)
https://bugs.webkit.org/show_bug.cgi?id=119726

Reviewed by Kent Tamura.

Merge https://chromium.googlesource.com/chromium/blink/+/c0aec52ef348b2be0c882f8646fe3cf537831f59

We should mark the renderer for containerElement, which wraps innerTextElement and innerBlockElement
in cases of input[type=search] and input[type=number], dirty.

* rendering/RenderTextControlSingleLine.cpp:
(WebCore::setNeedsLayoutOnAncestors):
(WebCore::RenderTextControlSingleLine::layout):

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

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderTextControlSingleLine.cpp

index 57ad74eda02b43a5b53a9f9c1ec77c804755dfa6..493d80fdf8fe62578f367483ecd5e3fe3244736c 100644 (file)
@@ -1,3 +1,19 @@
+2013-08-12  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Fix orphan needsLayout state in RenderTextControlSingleLine
+        https://bugs.webkit.org/show_bug.cgi?id=119726
+
+        Reviewed by Kent Tamura.
+
+        Merge https://chromium.googlesource.com/chromium/blink/+/c0aec52ef348b2be0c882f8646fe3cf537831f59
+
+        We should mark the renderer for containerElement, which wraps innerTextElement and innerBlockElement
+        in cases of input[type=search] and input[type=number], dirty.
+
+        * rendering/RenderTextControlSingleLine.cpp:
+        (WebCore::setNeedsLayoutOnAncestors):
+        (WebCore::RenderTextControlSingleLine::layout):
+
 2013-08-13  Sam Weinig  <sam@webkit.org>
 
         [Re-land] Cleanup MediaQueryListListener
index 0257be9a409a81e2e35085d5d9e1790b18297015..af5bc1d7263953556528ef36d6ce1887c14b315f 100644 (file)
@@ -98,6 +98,15 @@ LayoutUnit RenderTextControlSingleLine::computeLogicalHeightLimit() const
     return containerElement() ? contentLogicalHeight() : logicalHeight();
 }
 
+static void setNeedsLayoutOnAncestors(RenderObject* start, RenderObject* ancestor)
+{
+    ASSERT(start != ancestor);
+    for (RenderObject* renderer = start; renderer != ancestor; renderer = renderer->parent()) {
+        ASSERT(renderer);
+        renderer->setNeedsLayout(true, MarkOnlyThis);
+    }
+}
+
 void RenderTextControlSingleLine::layout()
 {
     StackStats::LayoutCheckPoint layoutCheckPoint;
@@ -119,11 +128,11 @@ void RenderTextControlSingleLine::layout()
     // To ensure consistency between layouts, we need to reset any conditionally overriden height.
     if (innerTextRenderer && !innerTextRenderer->style()->logicalHeight().isAuto()) {
         innerTextRenderer->style()->setLogicalHeight(Length(Auto));
-        innerTextRenderer->setNeedsLayout(true, MarkOnlyThis);
+        setNeedsLayoutOnAncestors(innerTextRenderer, this);
     }
     if (innerBlockRenderer && !innerBlockRenderer->style()->logicalHeight().isAuto()) {
         innerBlockRenderer->style()->setLogicalHeight(Length(Auto));
-        innerBlockRenderer->setNeedsLayout(true, MarkOnlyThis);
+        setNeedsLayoutOnAncestors(innerBlockRenderer, this);
     }
 
     RenderBlock::layoutBlock(false);