WebKit Bugzilla
Attachment 339028 Details for
Bug 185091
: [LFC] Add FormattingContext::computeWidth/computeHeight logic.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185091-20180427142903.patch (text/plain), 7.33 KB, created by
zalan
on 2018-04-27 14:29:03 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2018-04-27 14:29:03 PDT
Size:
7.33 KB
patch
obsolete
>Subversion Revision: 231108 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 7d99846b09e828719ba00103ca32dcaf8aa80cd2..7bb507f017fc4bf2dfc923b0f354527c6790b73a 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,31 @@ >+2018-04-27 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC] Add FormattingContext::computeWidth/computeHeight logic. >+ https://bugs.webkit.org/show_bug.cgi?id=185091 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Inflow width and height can't really be computed without knowing the exact context. >+ >+ * layout/FormattingContext.cpp: >+ (WebCore::Layout::FormattingContext::computeWidth const): >+ (WebCore::Layout::FormattingContext::computeHeight const): >+ (WebCore::Layout::FormattingContext::computeOutOfFlowWidth const): >+ (WebCore::Layout::FormattingContext::computeFloatingWidth const): >+ (WebCore::Layout::FormattingContext::computeOutOfFlowHeight const): >+ (WebCore::Layout::FormattingContext::computeFloatingHeight const): >+ * layout/FormattingContext.h: >+ * layout/blockformatting/BlockFormattingContext.cpp: >+ (WebCore::Layout::BlockFormattingContext::computeInFlowWidth const): >+ (WebCore::Layout::BlockFormattingContext::computeInFlowHeight const): >+ (WebCore::Layout::BlockFormattingContext::computeWidth const): Deleted. >+ (WebCore::Layout::BlockFormattingContext::computeHeight const): Deleted. >+ * layout/blockformatting/BlockFormattingContext.h: >+ * layout/inlineformatting/InlineFormattingContext.cpp: >+ (WebCore::Layout::InlineFormattingContext::computeInFlowWidth const): >+ (WebCore::Layout::InlineFormattingContext::computeInFlowHeight const): >+ * layout/inlineformatting/InlineFormattingContext.h: >+ > 2018-04-27 Zalan Bujtas <zalan@apple.com> > > [LFC] Implement BlockFormattingContext::layout logic and its dependencies >diff --git a/Source/WebCore/layout/FormattingContext.cpp b/Source/WebCore/layout/FormattingContext.cpp >index 9840a3fb240e10438d57bfef08fcc5a360a3e915..a81fa536178a7d1c3b706608860c1a91e46ed944 100644 >--- a/Source/WebCore/layout/FormattingContext.cpp >+++ b/Source/WebCore/layout/FormattingContext.cpp >@@ -28,6 +28,7 @@ > > #if ENABLE(LAYOUT_FORMATTING_CONTEXT) > >+#include "LayoutBox.h" > #include <wtf/IsoMallocInlines.h> > > namespace WebCore { >@@ -57,11 +58,37 @@ void FormattingContext::computeOutOfFlowPosition(const Box&) const > { > } > >-void FormattingContext::computeWidth(const Box&) const >+void FormattingContext::computeWidth(const Box& layoutBox) const > { >+ if (layoutBox.isOutOfFlowPositioned()) >+ return computeOutOfFlowWidth(layoutBox); >+ if (layoutBox.isFloatingPositioned()) >+ return computeFloatingWidth(layoutBox); >+ return computeInFlowWidth(layoutBox); > } > >-void FormattingContext::computeHeight(const Box&) const >+void FormattingContext::computeHeight(const Box& layoutBox) const >+{ >+ if (layoutBox.isOutOfFlowPositioned()) >+ return computeOutOfFlowHeight(layoutBox); >+ if (layoutBox.isFloatingPositioned()) >+ return computeFloatingHeight(layoutBox); >+ return computeInFlowHeight(layoutBox); >+} >+ >+void FormattingContext::computeOutOfFlowWidth(const Box&) const >+{ >+} >+ >+void FormattingContext::computeFloatingWidth(const Box&) const >+{ >+} >+ >+void FormattingContext::computeOutOfFlowHeight(const Box&) const >+{ >+} >+ >+void FormattingContext::computeFloatingHeight(const Box&) const > { > } > >diff --git a/Source/WebCore/layout/FormattingContext.h b/Source/WebCore/layout/FormattingContext.h >index c6c146143df5b7385e7a9e447495cf21ede6526a..3a4f5704e15e2b21474afdb531ce41acfc918e98 100644 >--- a/Source/WebCore/layout/FormattingContext.h >+++ b/Source/WebCore/layout/FormattingContext.h >@@ -62,6 +62,14 @@ protected: > virtual void computeWidth(const Box&) const; > virtual void computeHeight(const Box&) const; > >+ virtual void computeOutOfFlowWidth(const Box&) const; >+ virtual void computeFloatingWidth(const Box&) const; >+ virtual void computeInFlowWidth(const Box&) const = 0; >+ >+ virtual void computeOutOfFlowHeight(const Box&) const; >+ virtual void computeFloatingHeight(const Box&) const; >+ virtual void computeInFlowHeight(const Box&) const = 0; >+ > virtual LayoutUnit marginTop(const Box&) const; > virtual LayoutUnit marginLeft(const Box&) const; > virtual LayoutUnit marginBottom(const Box&) const; >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp b/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >index b57f1e7df247e579b17b9077e59c402bb6a5ad64..080942667ff571ac713a4b3d2cbea5709442e92c 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >@@ -120,11 +120,11 @@ void BlockFormattingContext::computeStaticPosition(const Box&) const > { > } > >-void BlockFormattingContext::computeWidth(const Box&) const >+void BlockFormattingContext::computeInFlowWidth(const Box&) const > { > } > >-void BlockFormattingContext::computeHeight(const Box&) const >+void BlockFormattingContext::computeInFlowHeight(const Box&) const > { > } > >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContext.h b/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >index aade5a6556a36f4ffc56ff1b52fa660777f74aea..efbac24373a57b8dd0926cd91c511c613016e638 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >@@ -51,9 +51,8 @@ public: > > protected: > void computeStaticPosition(const Box&) const override; >- >- void computeWidth(const Box&) const override; >- void computeHeight(const Box&) const override; >+ void computeInFlowWidth(const Box&) const override; >+ void computeInFlowHeight(const Box&) const override; > > LayoutUnit marginTop(const Box&) const override; > LayoutUnit marginBottom(const Box&) const override; >diff --git a/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp b/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp >index 2235266b707a20b166405219d9cb64c3eae256aa..50aa1c904f97b987b488b6d4f2ca76fde78e7b29 100644 >--- a/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp >+++ b/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp >@@ -66,6 +66,14 @@ Ref<FloatingState> InlineFormattingContext::createOrFindFloatingState() const > return formattingState.floatingState(); > } > >+void InlineFormattingContext::computeInFlowWidth(const Box&) const >+{ >+} >+ >+void InlineFormattingContext::computeInFlowHeight(const Box&) const >+{ >+} >+ > } > } > >diff --git a/Source/WebCore/layout/inlineformatting/InlineFormattingContext.h b/Source/WebCore/layout/inlineformatting/InlineFormattingContext.h >index f2587f40fc6de60da3a6f7aac05f83f46a7c5436..aa5c379d79a15c68465522ea8e8d468b6021d120 100644 >--- a/Source/WebCore/layout/inlineformatting/InlineFormattingContext.h >+++ b/Source/WebCore/layout/inlineformatting/InlineFormattingContext.h >@@ -46,6 +46,11 @@ public: > void layout(LayoutContext&, FormattingState&) const override; > std::unique_ptr<FormattingState> createFormattingState(Ref<FloatingState>&&) const override; > Ref<FloatingState> createOrFindFloatingState() const override; >+ >+private: >+ void computeInFlowWidth(const Box&) const override; >+ void computeInFlowHeight(const Box&) const override; >+ > }; > > }
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 185091
: 339028