WebKit Bugzilla
Attachment 362363 Details for
Bug 194804
: [LFC][Floats] Remove redundant intersecting logic
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194804-20190218185724.patch (text/plain), 4.64 KB, created by
zalan
on 2019-02-18 18:57:27 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2019-02-18 18:57:27 PST
Size:
4.64 KB
patch
obsolete
>Subversion Revision: 241647 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index f9678c312dac2f5ca9fca7e80374351f177f51b3..3956e9e9c58e30c4728435a872155e406c1b404e 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,16 @@ >+2019-02-18 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC][Floats] Remove redundant intersecting logic >+ https://bugs.webkit.org/show_bug.cgi?id=194804 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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-16 Zalan Bujtas <zalan@apple.com> > > [LFC][BFC] Add support for block replaced intrinsic width. >diff --git a/Source/WebCore/layout/floats/FloatingContext.cpp b/Source/WebCore/layout/floats/FloatingContext.cpp >index 57564d63b9a062cca967012629114c8634ea670c..97cd83a4d38a79619271effc7fbc978ff62d847f 100644 >--- a/Source/WebCore/layout/floats/FloatingContext.cpp >+++ b/Source/WebCore/layout/floats/FloatingContext.cpp >@@ -277,7 +277,8 @@ void FloatingContext::floatingPosition(FloatAvoider& floatAvoider) const > 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 @@ const FloatingState::FloatItem* FloatingPair::right() const > 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 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 6c089559a6fcded6b69a00c3f887aec514233f07..d1fbb7f2dac399eededa4d4ae6a18eb8524099ab 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,12 @@ >+2019-02-18 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC][Floats] Remove redundant intersecting logic >+ https://bugs.webkit.org/show_bug.cgi?id=194804 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * LayoutReloaded/misc/LFC-passing-tests.txt: >+ > 2019-02-16 Zalan Bujtas <zalan@apple.com> > > [LFC][BFC] Add support for block replaced intrinsic width. >diff --git a/Tools/LayoutReloaded/misc/LFC-passing-tests.txt b/Tools/LayoutReloaded/misc/LFC-passing-tests.txt >index 0728a2397cd7c0e3a880e5cf86e1e46e55a0ca4d..87fb88848edb9fc1f05f1c888a535d9c873b834b 100644 >--- a/Tools/LayoutReloaded/misc/LFC-passing-tests.txt >+++ b/Tools/LayoutReloaded/misc/LFC-passing-tests.txt >@@ -834,6 +834,7 @@ css2.1/20110323/float-replaced-width-004.htm > 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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
koivisto
:
review+
ews-watchlist
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194804
: 362363 |
362366