WebKit Bugzilla
Attachment 346251 Details for
Bug 188188
: [LFC] Add FormattingContext::mapToAncestor geometry mapping function
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188188-20180731203828.patch (text/plain), 5.01 KB, created by
zalan
on 2018-07-31 20:38:28 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2018-07-31 20:38:28 PDT
Size:
5.01 KB
patch
obsolete
>Subversion Revision: 234439 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 9ad8a32841897586bc5d5c8296fed381069e8e95..be4ef6394c07bce2a7801421c75a632355da4a8d 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,17 @@ >+2018-07-31 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC] Add FormattingContext::mapToAncestor geometry mapping function >+ https://bugs.webkit.org/show_bug.cgi?id=188188 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * layout/FormattingContext.cpp: >+ (WebCore::Layout::FormattingContext::mapToAncestor): >+ * layout/FormattingContext.h: >+ * layout/displaytree/DisplayBox.cpp: >+ (WebCore::Display::Box::clone const): >+ * layout/displaytree/DisplayBox.h: >+ > 2018-07-31 Wenson Hsieh <wenson_hsieh@apple.com> > > [iOS] Spelling suggestions cannot be selected in focused form controls when zoomed in >diff --git a/Source/WebCore/layout/FormattingContext.cpp b/Source/WebCore/layout/FormattingContext.cpp >index f9604ead705979013023326942040f2a92652fce..71a3ba06a582393289e7c081322f3b328a6c801c 100644 >--- a/Source/WebCore/layout/FormattingContext.cpp >+++ b/Source/WebCore/layout/FormattingContext.cpp >@@ -142,6 +142,28 @@ void FormattingContext::layoutOutOfFlowDescendants(LayoutContext& layoutContext, > LOG_WITH_STREAM(FormattingContextLayout, stream << "End: layout out-of-flow descendants -> context: " << &layoutContext << " root: " << &root()); > } > >+Display::Box FormattingContext::mapToAncestor(const LayoutContext& layoutContext, const Box& layoutBox, const Container& ancestor) >+{ >+ ASSERT(layoutBox.isDescendantOf(ancestor)); >+ >+ auto* displayBox = layoutContext.displayBoxForLayoutBox(layoutBox); >+ ASSERT(displayBox); >+ auto topLeft = displayBox->topLeft(); >+ >+ auto* containingBlock = layoutBox.containingBlock(); >+ for (; containingBlock && containingBlock != &ancestor; containingBlock = containingBlock->containingBlock()) >+ topLeft.moveBy(layoutContext.displayBoxForLayoutBox(*containingBlock)->topLeft()); >+ >+ if (!containingBlock) { >+ ASSERT_NOT_REACHED(); >+ return displayBox->clone(); >+ } >+ >+ auto mappedDisplayBox = displayBox->clone(); >+ mappedDisplayBox.setTopLeft(topLeft); >+ return mappedDisplayBox; >+} >+ > #ifndef NDEBUG > void FormattingContext::validateGeometryConstraintsAfterLayout(const LayoutContext& layoutContext) const > { >diff --git a/Source/WebCore/layout/FormattingContext.h b/Source/WebCore/layout/FormattingContext.h >index 3b5b855331fa64a1986543e899aa89b27980b91c..ce201cff64d443684cb33c12ee8551d2152dc33a 100644 >--- a/Source/WebCore/layout/FormattingContext.h >+++ b/Source/WebCore/layout/FormattingContext.h >@@ -59,6 +59,8 @@ public: > }; > virtual InstrinsicWidthConstraints instrinsicWidthConstraints(LayoutContext&, const Box&) const = 0; > >+ static Display::Box mapToAncestor(const LayoutContext&, const Box&, const Container& ancestor); >+ > protected: > struct LayoutPair { > const Box& layoutBox; >diff --git a/Source/WebCore/layout/displaytree/DisplayBox.cpp b/Source/WebCore/layout/displaytree/DisplayBox.cpp >index 74c09d4b2c479858fefc8c56da580358f5e95323..4f1cb134ce1c207011eef3a2580f79374d1d6fed 100644 >--- a/Source/WebCore/layout/displaytree/DisplayBox.cpp >+++ b/Source/WebCore/layout/displaytree/DisplayBox.cpp >@@ -115,6 +115,32 @@ Box::Rect Box::contentBox() const > return contentBox; > } > >+Box Box::clone() const >+{ >+ Box box; >+ box.m_style = m_style; >+ >+ box.m_topLeft = m_topLeft; >+ box.m_contentWidth = m_contentWidth; >+ box.m_contentHeight = m_contentHeight; >+ box.m_verticalNonCollapsedMargin = m_verticalNonCollapsedMargin; >+ box.m_margin = m_margin; >+ box.m_border = m_border; >+ box.m_padding = m_padding; >+ >+#if !ASSERT_DISABLED >+ box.m_hasValidHorizontalMargin = m_hasValidHorizontalMargin; >+ box.m_hasValidVerticalMargin = m_hasValidVerticalMargin; >+ box.m_hasValidVerticalNonCollapsedMargin = m_hasValidVerticalNonCollapsedMargin; >+ box.m_hasValidBorder = m_hasValidBorder; >+ box.m_hasValidPadding = m_hasValidPadding; >+ box.m_hasValidContentHeight = m_hasValidContentHeight; >+ box.m_hasValidContentWidth = m_hasValidContentWidth; >+#endif >+ >+ return box; >+} >+ > } > } > >diff --git a/Source/WebCore/layout/displaytree/DisplayBox.h b/Source/WebCore/layout/displaytree/DisplayBox.h >index 59cc771a48bcfce2120c1a4aee79c9dcc785ae91..30c75c10441a8ae0ba70697dfabf860756dd5609 100644 >--- a/Source/WebCore/layout/displaytree/DisplayBox.h >+++ b/Source/WebCore/layout/displaytree/DisplayBox.h >@@ -158,10 +158,14 @@ public: > Rect paddingBox() const; > Rect contentBox() const; > >+ Box clone() const; >+ > private: >+ Box() = default; > Box(const RenderStyle&); > > struct Style { >+ Style() = default; > Style(const RenderStyle&); > > BoxSizing boxSizing { BoxSizing::ContentBox }; >@@ -199,7 +203,7 @@ private: > void setHasValidContentWidth() { m_hasValidContentWidth = true; } > #endif > >- const Style m_style; >+ Style m_style; > > LayoutPoint m_topLeft; > LayoutUnit m_contentWidth;
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+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188188
:
346142
|
346143
| 346251 |
346277