WebKit Bugzilla
Attachment 338878 Details for
Bug 185031
: [LFC] Formatting contexts should take const Box&
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185031-20180426091739.patch (text/plain), 7.51 KB, created by
zalan
on 2018-04-26 09:17:39 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2018-04-26 09:17:39 PDT
Size:
7.51 KB
patch
obsolete
>Subversion Revision: 231045 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index b34bbf1774a792f0270ad08f06ec22ee7dea98aa..7c707b9991cf41a3dbc51a3fd27d88b28db32f16 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,28 @@ >+2018-04-26 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC] Formatting contexts should take const Box& >+ https://bugs.webkit.org/show_bug.cgi?id=185031 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ The formatting root boxes are supposed to be all const. The only reason why >+ they are not is because WeakPtr<> does not support const objects yet. >+ Use const_cast instead (remove it when WeakPtr<> gains const support). >+ >+ * layout/FormattingContext.cpp: >+ (WebCore::Layout::FormattingContext::FormattingContext): >+ * layout/FormattingContext.h: >+ * layout/LayoutContext.cpp: >+ (WebCore::Layout::LayoutContext::LayoutContext): >+ (WebCore::Layout::LayoutContext::formattingContext): >+ * layout/LayoutContext.h: >+ * layout/blockformatting/BlockFormattingContext.cpp: >+ (WebCore::Layout::BlockFormattingContext::BlockFormattingContext): >+ * layout/blockformatting/BlockFormattingContext.h: >+ * layout/inlineformatting/InlineFormattingContext.cpp: >+ (WebCore::Layout::InlineFormattingContext::InlineFormattingContext): >+ * layout/inlineformatting/InlineFormattingContext.h: >+ > 2018-04-26 Per Arne Vollan <pvollan@apple.com> > > Add lazy initialization of caption display mode for videos. >diff --git a/Source/WebCore/layout/FormattingContext.cpp b/Source/WebCore/layout/FormattingContext.cpp >index 9855bad4295e7a9b5c8bdf5f2c87d3f41b14d4ec..87ef299c648401410d37301b62fbcfd32d75c257 100644 >--- a/Source/WebCore/layout/FormattingContext.cpp >+++ b/Source/WebCore/layout/FormattingContext.cpp >@@ -35,8 +35,8 @@ namespace Layout { > > WTF_MAKE_ISO_ALLOCATED_IMPL(FormattingContext); > >-FormattingContext::FormattingContext(Box& formattingContextRoot) >- : m_root(makeWeakPtr(formattingContextRoot)) >+FormattingContext::FormattingContext(const Box& formattingContextRoot) >+ : m_root(makeWeakPtr(const_cast<Box&>(formattingContextRoot))) > { > } > >diff --git a/Source/WebCore/layout/FormattingContext.h b/Source/WebCore/layout/FormattingContext.h >index e86cff92d2775a3057774837b294f04ee7f81d51..38c5a4ae0f804550b10a8e47fd3f73fab90c692b 100644 >--- a/Source/WebCore/layout/FormattingContext.h >+++ b/Source/WebCore/layout/FormattingContext.h >@@ -41,7 +41,7 @@ class Box; > class FormattingContext { > WTF_MAKE_ISO_ALLOCATED(FormattingContext); > public: >- FormattingContext(Box& formattingContextRoot); >+ FormattingContext(const Box& formattingContextRoot); > virtual ~FormattingContext(); > > virtual void layout(FormattingState&) = 0; >diff --git a/Source/WebCore/layout/LayoutContext.cpp b/Source/WebCore/layout/LayoutContext.cpp >index 938dd2b085dce73fefb960dd2d911f2e52a35791..2e363a498e0cd45bb758e1e909bb95afa2990a34 100644 >--- a/Source/WebCore/layout/LayoutContext.cpp >+++ b/Source/WebCore/layout/LayoutContext.cpp >@@ -40,8 +40,8 @@ namespace Layout { > > WTF_MAKE_ISO_ALLOCATED_IMPL(LayoutContext); > >-LayoutContext::LayoutContext(Box& root) >- : m_root(makeWeakPtr(root)) >+LayoutContext::LayoutContext(const Box& root) >+ : m_root(makeWeakPtr(const_cast<Box&>(root))) > { > } > >@@ -59,7 +59,7 @@ FormattingState& LayoutContext::formattingState(const FormattingContext& context > }).iterator->value; > } > >-std::unique_ptr<FormattingContext> LayoutContext::formattingContext(Box& formattingContextRoot) >+std::unique_ptr<FormattingContext> LayoutContext::formattingContext(const Box& formattingContextRoot) > { > if (formattingContextRoot.establishesBlockFormattingContext()) > return std::make_unique<BlockFormattingContext>(formattingContextRoot); >diff --git a/Source/WebCore/layout/LayoutContext.h b/Source/WebCore/layout/LayoutContext.h >index 15007d60a621aa64a0aa9ab4b3d3885f6945a5de..838b527be3cf9aee51cc37db2e8e3c0e5f0b51f2 100644 >--- a/Source/WebCore/layout/LayoutContext.h >+++ b/Source/WebCore/layout/LayoutContext.h >@@ -50,7 +50,7 @@ class StyleDiff; > class LayoutContext { > WTF_MAKE_ISO_ALLOCATED(LayoutContext); > public: >- LayoutContext(Box& root); >+ LayoutContext(const Box& root); > > void updateLayout(); > >@@ -62,7 +62,7 @@ public: > > private: > FormattingState& formattingState(const FormattingContext&); >- std::unique_ptr<FormattingContext> formattingContext(Box& formattingContextRoot); >+ std::unique_ptr<FormattingContext> formattingContext(const Box& formattingContextRoot); > > WeakPtr<Box> m_root; > HashMap<const Box*, std::unique_ptr<FormattingState>> m_formattingStates; >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp b/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >index d37e1814bbede6d7737dbd0115fccd75f61d1ced..70f77393f549dd45d710aeef30c847081ea710e7 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >@@ -36,7 +36,7 @@ namespace Layout { > > WTF_MAKE_ISO_ALLOCATED_IMPL(BlockFormattingContext); > >-BlockFormattingContext::BlockFormattingContext(Box& formattingContextRoot) >+BlockFormattingContext::BlockFormattingContext(const Box& formattingContextRoot) > : FormattingContext(formattingContextRoot) > { > } >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContext.h b/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >index f12e7e762d53341ea26ccde7a1d81be9c9fdbbfa..b45940ecc160b75437b06840592d4196037e2c09 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >@@ -43,7 +43,7 @@ class Box; > class BlockFormattingContext : public FormattingContext { > WTF_MAKE_ISO_ALLOCATED(BlockFormattingContext); > public: >- BlockFormattingContext(Box& formattingContextRoot); >+ BlockFormattingContext(const Box& formattingContextRoot); > > void layout(FormattingState&) override; > std::unique_ptr<FormattingState> formattingState() const override; >diff --git a/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp b/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp >index 7d1b76403d9cb43977f35d917bc718d244bb5af6..db7008a10bb5f2adf30144d9e43558ce1af7216a 100644 >--- a/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp >+++ b/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp >@@ -36,7 +36,7 @@ namespace Layout { > > WTF_MAKE_ISO_ALLOCATED_IMPL(InlineFormattingContext); > >-InlineFormattingContext::InlineFormattingContext(Box& formattingContextRoot) >+InlineFormattingContext::InlineFormattingContext(const Box& formattingContextRoot) > : FormattingContext(formattingContextRoot) > { > } >diff --git a/Source/WebCore/layout/inlineformatting/InlineFormattingContext.h b/Source/WebCore/layout/inlineformatting/InlineFormattingContext.h >index 6026060e9ec4e787f230501649a2dbe898d27125..6686e9b39182c11c5fa88ce985e0cc4870e322d7 100644 >--- a/Source/WebCore/layout/inlineformatting/InlineFormattingContext.h >+++ b/Source/WebCore/layout/inlineformatting/InlineFormattingContext.h >@@ -41,7 +41,7 @@ class InlineFormattingState; > class InlineFormattingContext : public FormattingContext { > WTF_MAKE_ISO_ALLOCATED(InlineFormattingContext); > public: >- InlineFormattingContext(Box& formattingContextRoot); >+ InlineFormattingContext(const Box& formattingContextRoot); > > void layout(FormattingState&) override; > std::unique_ptr<FormattingState> formattingState() 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 185031
: 338878 |
338896