Title: [241774] trunk
- Revision
- 241774
- Author
- [email protected]
- Date
- 2019-02-19 14:33:43 -0800 (Tue, 19 Feb 2019)
Log Message
[LFC][Floats] Remove redundant intersecting logic
https://bugs.webkit.org/show_bug.cgi?id=194804
Reviewed by Antti Koivisto.
Source/WebCore:
floatAvoider.overflowsContainingBlock() check already (and properly) takes care of the far left/right case (see comment).
* layout/floats/FloatingContext.cpp:
(WebCore::Layout::FloatingContext::floatingPosition const):
(WebCore::Layout::FloatingPair::intersects const):
Tools:
* LayoutReloaded/misc/LFC-passing-tests.txt:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (241773 => 241774)
--- trunk/Source/WebCore/ChangeLog 2019-02-19 22:28:03 UTC (rev 241773)
+++ trunk/Source/WebCore/ChangeLog 2019-02-19 22:33:43 UTC (rev 241774)
@@ -1,3 +1,16 @@
+2019-02-19 Zalan Bujtas <[email protected]>
+
+ [LFC][Floats] Remove redundant intersecting logic
+ https://bugs.webkit.org/show_bug.cgi?id=194804
+
+ Reviewed by Antti Koivisto.
+
+ floatAvoider.overflowsContainingBlock() check already (and properly) takes care of the far left/right case (see comment).
+
+ * layout/floats/FloatingContext.cpp:
+ (WebCore::Layout::FloatingContext::floatingPosition const):
+ (WebCore::Layout::FloatingPair::intersects const):
+
2019-02-19 Commit Queue <[email protected]>
Unreviewed, rolling out r241722.
Modified: trunk/Source/WebCore/layout/floats/FloatingContext.cpp (241773 => 241774)
--- trunk/Source/WebCore/layout/floats/FloatingContext.cpp 2019-02-19 22:28:03 UTC (rev 241773)
+++ trunk/Source/WebCore/layout/floats/FloatingContext.cpp 2019-02-19 22:33:43 UTC (rev 241774)
@@ -277,7 +277,8 @@
floatAvoider.setVerticalConstraint(floats.verticalConstraint());
// Ensure that the float avoider
- // 1. does not overflow its containing block with the current horiztonal constraints
+ // 1. does not "overflow" its containing block with the current horiztonal constraints. It simply means that the float avoider's
+ // containing block could push the candidate position beyond the current float horizontally (too far to the left/right)
// 2. avoids floats on both sides.
if (!floatAvoider.overflowsContainingBlock() && !floats.intersects(floatAvoider.rect()))
return;
@@ -318,33 +319,14 @@
return &m_floats[*m_rightIndex];
}
-bool FloatingPair::intersects(const Display::Box::Rect& candidateRect) const
+bool FloatingPair::intersects(const Display::Box::Rect& floatAvoiderRect) const
{
- auto intersects = [&](const FloatingState::FloatItem* floating, Float floatingType) {
- if (!floating)
- return false;
-
- auto marginRect = floating->rectWithMargin();
- // Before intersecting, check if the candidate position is too far to the left/right.
- // The new float's containing block could push the candidate position beyond the current float horizontally.
- if ((floatingType == Float::Left && candidateRect.left() < marginRect.right())
- || (floatingType == Float::Right && candidateRect.right() > marginRect.left()))
- return true;
- return marginRect.intersects(candidateRect);
+ auto intersects = [&](auto* floating) {
+ return floating ? floating->rectWithMargin().intersects(floatAvoiderRect) : false;
};
- if (!m_leftIndex && !m_rightIndex) {
- ASSERT_NOT_REACHED();
- return false;
- }
-
- if (intersects(left(), Float::Left))
- return true;
-
- if (intersects(right(), Float::Right))
- return true;
-
- return false;
+ ASSERT(m_leftIndex || m_rightIndex);
+ return intersects(left()) || intersects(right());
}
bool FloatingPair::operator ==(const FloatingPair& other) const
Modified: trunk/Tools/ChangeLog (241773 => 241774)
--- trunk/Tools/ChangeLog 2019-02-19 22:28:03 UTC (rev 241773)
+++ trunk/Tools/ChangeLog 2019-02-19 22:33:43 UTC (rev 241774)
@@ -1,3 +1,12 @@
+2019-02-19 Zalan Bujtas <[email protected]>
+
+ [LFC][Floats] Remove redundant intersecting logic
+ https://bugs.webkit.org/show_bug.cgi?id=194804
+
+ Reviewed by Antti Koivisto.
+
+ * LayoutReloaded/misc/LFC-passing-tests.txt:
+
2019-02-19 Dean Jackson <[email protected]>
Clean-up output from generate-xcfilelists so it can be filtered
Modified: trunk/Tools/LayoutReloaded/misc/LFC-passing-tests.txt (241773 => 241774)
--- trunk/Tools/LayoutReloaded/misc/LFC-passing-tests.txt 2019-02-19 22:28:03 UTC (rev 241773)
+++ trunk/Tools/LayoutReloaded/misc/LFC-passing-tests.txt 2019-02-19 22:33:43 UTC (rev 241774)
@@ -843,6 +843,7 @@
css2.1/20110323/float-replaced-width-005.htm
css2.1/20110323/float-replaced-width-006.htm
css2.1/20110323/float-replaced-width-011.htm
+css2.1/20110323/floats-wrap-top-below-bfc-002l.htm
css2.1/20110323/floats-001.html
css2.1/20110323/floats-102.html
css2.1/20110323/inline-block-non-replaced-width-001.htm
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes