Title: [124109] branches/safari-536.26-branch

Diff

Modified: branches/safari-536.26-branch/LayoutTests/ChangeLog (124108 => 124109)


--- branches/safari-536.26-branch/LayoutTests/ChangeLog	2012-07-30 23:06:57 UTC (rev 124108)
+++ branches/safari-536.26-branch/LayoutTests/ChangeLog	2012-07-30 23:09:49 UTC (rev 124109)
@@ -1,5 +1,19 @@
 2012-07-30  Lucas Forschler  <lforsch...@apple.com>
 
+    Merge 119227
+
+    2012-06-01  Dan Bernstein  <m...@apple.com>
+
+            Layout not updated after setting -webkit-line-clamp to none
+            https://bugs.webkit.org/show_bug.cgi?id=88049
+
+            Reviewed by Abhishek Arya.
+
+            * fast/flexbox/line-clamp-removed-dynamically-expected.html: Added.
+            * fast/flexbox/line-clamp-removed-dynamically.html: Added.
+
+2012-07-30  Lucas Forschler  <lforsch...@apple.com>
+
     Merge 119184
 
     2012-05-31  Tom Sepez  <tse...@chromium.org>

Copied: branches/safari-536.26-branch/LayoutTests/fast/flexbox/line-clamp-removed-dynamically-expected.html (from rev 119227, trunk/LayoutTests/fast/flexbox/line-clamp-removed-dynamically-expected.html) (0 => 124109)


--- branches/safari-536.26-branch/LayoutTests/fast/flexbox/line-clamp-removed-dynamically-expected.html	                        (rev 0)
+++ branches/safari-536.26-branch/LayoutTests/fast/flexbox/line-clamp-removed-dynamically-expected.html	2012-07-30 23:09:49 UTC (rev 124109)
@@ -0,0 +1,10 @@
+<div id="target" style="
+    display: -webkit-box;
+    -webkit-box-orient: vertical;
+    overflow: hidden;
+    width: 100px;
+">
+    <div>
+        Unless this sentence is truncated after two lines, PASS.
+    </div>
+</div>

Copied: branches/safari-536.26-branch/LayoutTests/fast/flexbox/line-clamp-removed-dynamically.html (from rev 119227, trunk/LayoutTests/fast/flexbox/line-clamp-removed-dynamically.html) (0 => 124109)


--- branches/safari-536.26-branch/LayoutTests/fast/flexbox/line-clamp-removed-dynamically.html	                        (rev 0)
+++ branches/safari-536.26-branch/LayoutTests/fast/flexbox/line-clamp-removed-dynamically.html	2012-07-30 23:09:49 UTC (rev 124109)
@@ -0,0 +1,15 @@
+<div id="target" style="
+    display: -webkit-box;
+    -webkit-box-orient: vertical;
+    overflow: hidden;
+    -webkit-line-clamp: 2;
+    width: 100px;
+">
+    <div>
+        Unless this sentence is truncated after two lines, PASS.
+    </div>
+</div>
+<script>
+    document.body.offsetTop;
+    target.style.removeProperty("-webkit-line-clamp");
+</script>

Modified: branches/safari-536.26-branch/Source/WebCore/ChangeLog (124108 => 124109)


--- branches/safari-536.26-branch/Source/WebCore/ChangeLog	2012-07-30 23:06:57 UTC (rev 124108)
+++ branches/safari-536.26-branch/Source/WebCore/ChangeLog	2012-07-30 23:09:49 UTC (rev 124109)
@@ -1,5 +1,25 @@
 2012-07-30  Lucas Forschler  <lforsch...@apple.com>
 
+    Merge 119227
+
+    2012-06-01  Dan Bernstein  <m...@apple.com>
+
+            Layout not updated after setting -webkit-line-clamp to none
+            https://bugs.webkit.org/show_bug.cgi?id=88049
+
+            Reviewed by Abhishek Arya.
+
+            Test: fast/flexbox/line-clamp-removed-dynamically.html
+
+            * rendering/RenderDeprecatedFlexibleBox.cpp:
+            (WebCore::RenderDeprecatedFlexibleBox::styleWillChange): Added. Calls clearLineClamp if
+            line-clamp will change to none.
+            (WebCore::RenderDeprecatedFlexibleBox::clearLineClamp): Added. Marks possibly-clamped
+            children for layout and clears truncation from blocks.
+            * rendering/RenderDeprecatedFlexibleBox.h:
+
+2012-07-30  Lucas Forschler  <lforsch...@apple.com>
+
     Merge 119184
 
     2012-05-31  Tom Sepez  <tse...@chromium.org>

Modified: branches/safari-536.26-branch/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp (124108 => 124109)


--- branches/safari-536.26-branch/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp	2012-07-30 23:06:57 UTC (rev 124108)
+++ branches/safari-536.26-branch/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp	2012-07-30 23:09:49 UTC (rev 124109)
@@ -150,6 +150,15 @@
     return child->isPositioned() || child->style()->visibility() == COLLAPSE;
 }
 
+void RenderDeprecatedFlexibleBox::styleWillChange(StyleDifference diff, const RenderStyle* newStyle)
+{
+    RenderStyle* oldStyle = style();
+    if (oldStyle && !oldStyle->lineClamp().isNone() && newStyle->lineClamp().isNone())
+        clearLineClamp();
+
+    RenderBlock::styleWillChange(diff, newStyle);
+}
+
 void RenderDeprecatedFlexibleBox::calcHorizontalPrefWidths()
 {
     for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) {
@@ -975,6 +984,25 @@
     }
 }
 
+void RenderDeprecatedFlexibleBox::clearLineClamp()
+{
+    FlexBoxIterator iterator(this);
+    for (RenderBox* child = iterator.first(); child; child = iterator.next()) {
+        if (childDoesNotAffectWidthOrFlexing(child))
+            continue;
+
+        if ((child->isReplaced() && (child->style()->width().isPercent() || child->style()->height().isPercent()))
+            || (child->style()->height().isAuto() && child->isBlockFlow())) {
+            child->setChildNeedsLayout(true);
+
+            if (child->isRenderBlock()) {
+                toRenderBlock(child)->markPositionedObjectsForLayout();
+                toRenderBlock(child)->clearTruncation();
+            }
+        }
+    }
+}
+
 void RenderDeprecatedFlexibleBox::placeChild(RenderBox* child, const LayoutPoint& location)
 {
     LayoutRect oldRect = child->frameRect();

Modified: branches/safari-536.26-branch/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.h (124108 => 124109)


--- branches/safari-536.26-branch/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.h	2012-07-30 23:06:57 UTC (rev 124108)
+++ branches/safari-536.26-branch/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.h	2012-07-30 23:09:49 UTC (rev 124109)
@@ -40,6 +40,8 @@
     void calcHorizontalPrefWidths();
     void calcVerticalPrefWidths();
 
+    virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle) OVERRIDE;
+
     virtual void layoutBlock(bool relayoutChildren, LayoutUnit pageHeight = 0);
     void layoutHorizontalBox(bool relayoutChildren);
     void layoutVerticalBox(bool relayoutChildren);
@@ -65,6 +67,7 @@
 
 private:
     void applyLineClamp(FlexBoxIterator&, bool relayoutChildren);
+    void clearLineClamp();
 };
 
 } // namespace WebCore
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to