Title: [205443] releases/WebKitGTK/webkit-2.12
Revision
205443
Author
carlo...@webkit.org
Date
2016-09-05 02:33:03 -0700 (Mon, 05 Sep 2016)

Log Message

Merge r205374 - ASSERTION FAILED: !m_committedWidth in WebCore::LineWidth::fitBelowFloats
https://bugs.webkit.org/show_bug.cgi?id=149462
<rdar://problem/27710841>

Reviewed by David Hyatt.

Source/WebCore:

In certain cases (multiple spans on the same line with negativ marings), the LineWidth::m_committedWidth > 0
check is not sufficient to decide if some content has already been committed to the current line.
This patch adds a flag to indicate if we ever committed to the current line.

Test: fast/text/assert-when-text-with-negative-margin-sibling-does-not-fit.html

* rendering/line/BreakingContext.h:
(WebCore::BreakingContext::handleText):
* rendering/line/LineWidth.h:
(WebCore::LineWidth::hasCommitted):

LayoutTests:

* fast/text/assert-when-text-with-negative-margin-sibling-does-not-fit-expected.txt: Added.
* fast/text/assert-when-text-with-negative-margin-sibling-does-not-fit.html: Added.

Modified Paths

Added Paths

Diff

Modified: releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog (205442 => 205443)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog	2016-09-05 09:27:31 UTC (rev 205442)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog	2016-09-05 09:33:03 UTC (rev 205443)
@@ -1,3 +1,14 @@
+2016-09-02  Zalan Bujtas  <za...@apple.com>
+
+        ASSERTION FAILED: !m_committedWidth in WebCore::LineWidth::fitBelowFloats
+        https://bugs.webkit.org/show_bug.cgi?id=149462
+        <rdar://problem/27710841>
+
+        Reviewed by David Hyatt.
+
+        * fast/text/assert-when-text-with-negative-margin-sibling-does-not-fit-expected.txt: Added.
+        * fast/text/assert-when-text-with-negative-margin-sibling-does-not-fit.html: Added.
+
 2016-08-31  Zalan Bujtas  <za...@apple.com>
 
         ASSERTION FAILED: !flow->layer() && !flow->isInlineElementContinuation() in WebCore::RenderBlock::addContinuationWithOutline

Added: releases/WebKitGTK/webkit-2.12/LayoutTests/fast/text/assert-when-text-with-negative-margin-sibling-does-not-fit-expected.txt (0 => 205443)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/fast/text/assert-when-text-with-negative-margin-sibling-does-not-fit-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/fast/text/assert-when-text-with-negative-margin-sibling-does-not-fit-expected.txt	2016-09-05 09:33:03 UTC (rev 205443)
@@ -0,0 +1,2 @@
+PASS if no assert in debug.
+foobarfo b

Added: releases/WebKitGTK/webkit-2.12/LayoutTests/fast/text/assert-when-text-with-negative-margin-sibling-does-not-fit.html (0 => 205443)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/fast/text/assert-when-text-with-negative-margin-sibling-does-not-fit.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/fast/text/assert-when-text-with-negative-margin-sibling-does-not-fit.html	2016-09-05 09:33:03 UTC (rev 205443)
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that inline does not assert when its composite state changes.</title>
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+</script>
+<style>
+div {
+    max-width: 1px;
+}
+
+.title {
+    margin-right: -60px;
+}
+</style>
+</head>
+<body>
+PASS if no assert in debug.
+<div><span><span class="title">foobar</span><span>fo b</span></span></div>
+</body>
+<html>

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog (205442 => 205443)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog	2016-09-05 09:27:31 UTC (rev 205442)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog	2016-09-05 09:33:03 UTC (rev 205443)
@@ -1,3 +1,22 @@
+2016-09-02  Zalan Bujtas  <za...@apple.com>
+
+        ASSERTION FAILED: !m_committedWidth in WebCore::LineWidth::fitBelowFloats
+        https://bugs.webkit.org/show_bug.cgi?id=149462
+        <rdar://problem/27710841>
+
+        Reviewed by David Hyatt.
+
+        In certain cases (multiple spans on the same line with negativ marings), the LineWidth::m_committedWidth > 0
+        check is not sufficient to decide if some content has already been committed to the current line.
+        This patch adds a flag to indicate if we ever committed to the current line. 
+
+        Test: fast/text/assert-when-text-with-negative-margin-sibling-does-not-fit.html
+
+        * rendering/line/BreakingContext.h:
+        (WebCore::BreakingContext::handleText):
+        * rendering/line/LineWidth.h:
+        (WebCore::LineWidth::hasCommitted):
+
 2016-08-31  Zalan Bujtas  <za...@apple.com>
 
         ASSERTION FAILED: !flow->layer() && !flow->isInlineElementContinuation() in WebCore::RenderBlock::addContinuationWithOutline

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/line/BreakingContext.h (205442 => 205443)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/line/BreakingContext.h	2016-09-05 09:27:31 UTC (rev 205442)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/line/BreakingContext.h	2016-09-05 09:33:03 UTC (rev 205443)
@@ -559,9 +559,9 @@
             m_ignoringSpaces = true;
         }
         if (downcast<RenderListMarker>(*m_current.renderer()).isInside())
-            m_width.addUncommittedReplacedWidth(replacedLogicalWidth);
+            m_width.addUncommittedWidth(replacedLogicalWidth);
     } else
-        m_width.addUncommittedReplacedWidth(replacedLogicalWidth);
+        m_width.addUncommittedWidth(replacedLogicalWidth);
     if (is<RenderRubyRun>(*m_current.renderer())) {
         m_width.applyOverhang(downcast<RenderRubyRun>(m_current.renderer()), m_lastObject, m_nextObject);
         downcast<RenderRubyRun>(m_current.renderer())->updatePriorContextFromCachedBreakIterator(m_renderTextInfo.lineBreakIterator);
@@ -747,7 +747,7 @@
     float charWidth = 0;
     bool breakNBSP = m_autoWrap && m_currentStyle->nbspMode() == SPACE;
     // Auto-wrapping text should wrap in the middle of a word only if it could not wrap before the word,
-    // which is only possible if the word is the first thing on the line, that is, if |w| is zero.
+    // which is only possible if the word is the first thing on the line.
     bool breakWords = m_currentStyle->breakWords() && ((m_autoWrap && !m_width.hasCommitted()) || m_currWS == PRE);
     bool midWordBreak = false;
     bool breakAll = m_currentStyle->wordBreak() == BreakAllWordBreak && m_autoWrap;

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/line/LineWidth.cpp (205442 => 205443)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/line/LineWidth.cpp	2016-09-05 09:27:31 UTC (rev 205442)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/line/LineWidth.cpp	2016-09-05 09:33:03 UTC (rev 205443)
@@ -37,14 +37,6 @@
 
 LineWidth::LineWidth(RenderBlockFlow& block, bool isFirstLine, IndentTextOrNot shouldIndentText)
     : m_block(block)
-    , m_uncommittedWidth(0)
-    , m_committedWidth(0)
-    , m_overhangWidth(0)
-    , m_trailingWhitespaceWidth(0)
-    , m_trailingCollapsedWhitespaceWidth(0)
-    , m_left(0)
-    , m_right(0)
-    , m_availableWidth(0)
     , m_isFirstLine(isFirstLine)
     , m_shouldIndentText(shouldIndentText)
 {
@@ -136,10 +128,7 @@
 {
     m_committedWidth += m_uncommittedWidth;
     m_uncommittedWidth = 0;
-    if (m_hasUncommittedReplaced) {
-        m_hasCommittedReplaced = true;
-        m_hasUncommittedReplaced = false;
-    }
+    m_hasCommitted = true;
 }
 
 void LineWidth::applyOverhang(RenderRubyRun* rubyRun, RenderObject* startRenderer, RenderObject* endRenderer)

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/line/LineWidth.h (205442 => 205443)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/line/LineWidth.h	2016-09-05 09:27:31 UTC (rev 205442)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/line/LineWidth.h	2016-09-05 09:33:03 UTC (rev 205443)
@@ -59,7 +59,7 @@
     float availableWidth() const { return m_availableWidth; }
     float logicalLeftOffset() const { return m_left; }
     
-    bool hasCommitted() const { return m_committedWidth > 0 || m_hasCommittedReplaced; }
+    bool hasCommitted() const { return m_hasCommitted; }
 
     void updateAvailableWidth(LayoutUnit minimumHeight = 0);
     void shrinkAvailableWidthForNewFloatIfNeeded(const FloatingObject&);
@@ -67,11 +67,6 @@
     {
         m_uncommittedWidth += delta;
     }
-    void addUncommittedReplacedWidth(float delta)
-    {
-        addUncommittedWidth(delta);
-        m_hasUncommittedReplaced = true;
-    }
     void commit();
     void applyOverhang(RenderRubyRun*, RenderObject* startRenderer, RenderObject* endRenderer);
     void fitBelowFloats(bool isFirstLine = false);
@@ -87,17 +82,16 @@
 #endif
 
     RenderBlockFlow& m_block;
-    float m_uncommittedWidth;
-    float m_committedWidth;
-    float m_overhangWidth; // The amount by which |m_availableWidth| has been inflated to account for possible contraction due to ruby overhang.
-    float m_trailingWhitespaceWidth;
-    float m_trailingCollapsedWhitespaceWidth;
-    float m_left;
-    float m_right;
-    float m_availableWidth;
-    bool m_isFirstLine;
-    bool m_hasUncommittedReplaced { false };
-    bool m_hasCommittedReplaced { false };
+    float m_uncommittedWidth { 0 };
+    float m_committedWidth { 0 };
+    float m_overhangWidth { 0 }; // The amount by which |m_availableWidth| has been inflated to account for possible contraction due to ruby overhang.
+    float m_trailingWhitespaceWidth { 0 };
+    float m_trailingCollapsedWhitespaceWidth { 0 };
+    float m_left { 0 };
+    float m_right { 0 };
+    float m_availableWidth { 0 };
+    bool m_isFirstLine { true };
+    bool m_hasCommitted { false };
     IndentTextOrNot m_shouldIndentText;
 };
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to