WebKit Bugzilla
Attachment 341631 Details for
Bug 186122
: [LFC] Add quirks mode setter/getting to LayoutContext
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186122-20180530183127.patch (text/plain), 4.72 KB, created by
zalan
on 2018-05-30 18:31:28 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2018-05-30 18:31:28 PDT
Size:
4.72 KB
patch
obsolete
>Subversion Revision: 232291 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index e6b63ec7c0870b927d492af14f7c2677878e9eed..ab650d2d361a042d252c8aaa31b9a1dd18986944 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,16 @@ >+2018-05-30 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC] Add quirks mode setter/getting to LayoutContext >+ https://bugs.webkit.org/show_bug.cgi?id=186122 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * layout/LayoutContext.h: >+ (WebCore::Layout::LayoutContext::setInQuirksMode): >+ (WebCore::Layout::LayoutContext::inQuirksMode const): >+ * page/FrameViewLayoutContext.cpp: >+ (WebCore::layoutUsingFormattingContext): >+ > 2018-05-30 Zalan Bujtas <zalan@apple.com> > > [LFC] Miscellaneous fixes to get closer to geometry correctness >diff --git a/Source/WebCore/layout/LayoutContext.h b/Source/WebCore/layout/LayoutContext.h >index d02b6e549646e1c2815a7b8ccad68b2bd6bdf3ce..d83bc08aa407fca4b1696f36c734a26b0304c0eb 100644 >--- a/Source/WebCore/layout/LayoutContext.h >+++ b/Source/WebCore/layout/LayoutContext.h >@@ -63,6 +63,7 @@ public: > void initializeRoot(const Container&, const LayoutSize&); > void updateLayout(); > void styleChanged(const Box&, StyleDiff); >+ void setInQuirksMode(bool inQuirksMode) { m_inQuirksMode = inQuirksMode; } > > enum class UpdateType { > Overflow = 1 << 0, >@@ -80,6 +81,7 @@ public: > Display::Box& createDisplayBox(const Box&); > Display::Box* displayBoxForLayoutBox(const Box& layoutBox) const { return m_layoutToDisplayBox.get(&layoutBox); } > >+ bool inQuirksMode() const { return m_inQuirksMode; } > // For testing purposes only > void verifyAndOutputMismatchingLayoutTree(const RenderView&) const; > >@@ -88,6 +90,7 @@ private: > HashSet<const Container*> m_formattingContextRootListForLayout; > HashMap<const Box*, std::unique_ptr<FormattingState>> m_formattingStates; > HashMap<const Box*, std::unique_ptr<Display::Box>> m_layoutToDisplayBox; >+ bool m_inQuirksMode { false }; > }; > > } >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp b/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >index 94bc292009842c8f9831e5417a795277c7b8c588..388f248144db85ec959767016283f0a69a570a5f 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >@@ -33,12 +33,12 @@ > namespace WebCore { > namespace Layout { > >-static bool isStretchedToViewport(const Box& layoutBox) >+static bool isStretchedToViewport(const LayoutContext& layoutContext, const Box& layoutBox) > { > ASSERT(layoutBox.isInFlow()); > // In quirks mode, body and html stretch to the viewport. >- // if (!layoutBox.document().inQuirksMode()) >- // return false; >+ if (!layoutContext.inQuirksMode()) >+ return false; > > if (!layoutBox.isDocumentBox() || !layoutBox.isBodyBox()) > return false; >@@ -107,7 +107,7 @@ LayoutUnit BlockFormattingContext::Geometry::inFlowNonReplacedHeight(LayoutConte > }; > > auto computedHeight = compute(); >- if (!isStretchedToViewport(layoutBox)) >+ if (!isStretchedToViewport(layoutContext, layoutBox)) > return computedHeight; > auto initialContainingBlockHeight = layoutContext.displayBoxForLayoutBox(initialContainingBlock(layoutBox))->contentBox().height(); > return std::max(computedHeight, initialContainingBlockHeight); >@@ -147,7 +147,7 @@ LayoutUnit BlockFormattingContext::Geometry::inFlowNonReplacedWidth(LayoutContex > }; > > auto computedWidth = compute(); >- if (!isStretchedToViewport(layoutBox)) >+ if (!isStretchedToViewport(layoutContext, layoutBox)) > return computedWidth; > auto initialContainingBlockWidth = layoutContext.displayBoxForLayoutBox(initialContainingBlock(layoutBox))->contentBox().width(); > return std::max(computedWidth, initialContainingBlockWidth); >diff --git a/Source/WebCore/page/FrameViewLayoutContext.cpp b/Source/WebCore/page/FrameViewLayoutContext.cpp >index 6b331acf0af0ddf8339a5f3cce2b079edbcb3560..14193c4ae8be97de711136e1c04a9d105cbec782 100644 >--- a/Source/WebCore/page/FrameViewLayoutContext.cpp >+++ b/Source/WebCore/page/FrameViewLayoutContext.cpp >@@ -57,6 +57,7 @@ static void layoutUsingFormattingContext(const RenderView& renderView) > auto initialContainingBlock = Layout::TreeBuilder::createLayoutTree(renderView); > auto layoutContext = std::make_unique<Layout::LayoutContext>(); > layoutContext->initializeRoot(*initialContainingBlock, renderView.size()); >+ layoutContext->setInQuirksMode(renderView.document().inQuirksMode()); > layoutContext->updateLayout(); > layoutContext->verifyAndOutputMismatchingLayoutTree(renderView); > }
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
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186122
: 341631