Title: [231909] trunk/Source/WebCore
- Revision
- 231909
- Author
- za...@apple.com
- Date
- 2018-05-17 10:54:57 -0700 (Thu, 17 May 2018)
Log Message
[LFC] Introduce DisplayBox::Style
https://bugs.webkit.org/show_bug.cgi?id=185733
Reviewed by Antti Koivisto.
This is the collection of computed style data needed to paint/hittest the display boxtree.
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::createDisplayBox):
* layout/displaytree/DisplayBox.cpp:
(WebCore::Display::Box::Box):
(WebCore::Display::Box::Style::Style):
(WebCore::Display::Box::borderBox const):
(WebCore::Display::Box::contentBox const):
* layout/displaytree/DisplayBox.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (231908 => 231909)
--- trunk/Source/WebCore/ChangeLog 2018-05-17 17:07:46 UTC (rev 231908)
+++ trunk/Source/WebCore/ChangeLog 2018-05-17 17:54:57 UTC (rev 231909)
@@ -1,3 +1,21 @@
+2018-05-17 Zalan Bujtas <za...@apple.com>
+
+ [LFC] Introduce DisplayBox::Style
+ https://bugs.webkit.org/show_bug.cgi?id=185733
+
+ Reviewed by Antti Koivisto.
+
+ This is the collection of computed style data needed to paint/hittest the display boxtree.
+
+ * layout/LayoutContext.cpp:
+ (WebCore::Layout::LayoutContext::createDisplayBox):
+ * layout/displaytree/DisplayBox.cpp:
+ (WebCore::Display::Box::Box):
+ (WebCore::Display::Box::Style::Style):
+ (WebCore::Display::Box::borderBox const):
+ (WebCore::Display::Box::contentBox const):
+ * layout/displaytree/DisplayBox.h:
+
2018-05-17 Antoine Quint <grao...@apple.com>
[modern-media-controls] AirPlaySupport should be disabled by default
Modified: trunk/Source/WebCore/layout/LayoutContext.cpp (231908 => 231909)
--- trunk/Source/WebCore/layout/LayoutContext.cpp 2018-05-17 17:07:46 UTC (rev 231908)
+++ trunk/Source/WebCore/layout/LayoutContext.cpp 2018-05-17 17:54:57 UTC (rev 231909)
@@ -64,7 +64,7 @@
Display::Box& LayoutContext::createDisplayBox(const Box& layoutBox)
{
- std::unique_ptr<Display::Box> displayBox(new Display::Box(layoutBox.style().boxSizing()));
+ std::unique_ptr<Display::Box> displayBox(new Display::Box(layoutBox.style()));
auto* displayBoxPtr = displayBox.get();
m_layoutToDisplayBox.add(&layoutBox, WTFMove(displayBox));
return *displayBoxPtr;
Modified: trunk/Source/WebCore/layout/displaytree/DisplayBox.cpp (231908 => 231909)
--- trunk/Source/WebCore/layout/displaytree/DisplayBox.cpp 2018-05-17 17:07:46 UTC (rev 231908)
+++ trunk/Source/WebCore/layout/displaytree/DisplayBox.cpp 2018-05-17 17:54:57 UTC (rev 231909)
@@ -28,6 +28,7 @@
#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
+#include "RenderStyle.h"
#include <wtf/IsoMallocInlines.h>
namespace WebCore {
@@ -35,8 +36,8 @@
WTF_MAKE_ISO_ALLOCATED_IMPL(Box);
-Box::Box(EBoxSizing boxSizing)
- : m_boxSizing(boxSizing)
+Box::Box(const RenderStyle& style)
+ : m_style(style)
{
}
@@ -44,6 +45,12 @@
{
}
+Box::Style::Style(const RenderStyle& style)
+ : boxSizing(style.boxSizing())
+{
+
+}
+
LayoutRect Box::marginBox() const
{
ASSERT(m_hasValidMargin);
@@ -59,7 +66,7 @@
LayoutRect Box::borderBox() const
{
- if (m_boxSizing == BORDER_BOX)
+ if (m_style.boxSizing == BORDER_BOX)
return LayoutRect( { }, size());
// Width is content box.
@@ -85,7 +92,7 @@
LayoutRect Box::contentBox() const
{
- if (m_boxSizing == CONTENT_BOX)
+ if (m_style.boxSizing == CONTENT_BOX)
return LayoutRect(LayoutPoint(0, 0), size());
// Width is border box.
Modified: trunk/Source/WebCore/layout/displaytree/DisplayBox.h (231908 => 231909)
--- trunk/Source/WebCore/layout/displaytree/DisplayBox.h 2018-05-17 17:07:46 UTC (rev 231908)
+++ trunk/Source/WebCore/layout/displaytree/DisplayBox.h 2018-05-17 17:54:57 UTC (rev 231909)
@@ -35,6 +35,8 @@
namespace WebCore {
+class RenderStyle;
+
namespace Layout {
class BlockFormattingContext;
class FormattingContext;
@@ -87,8 +89,14 @@
LayoutRect contentBox() const;
private:
- Box(EBoxSizing);
+ Box(const RenderStyle&);
+ struct Style {
+ Style(const RenderStyle&);
+
+ EBoxSizing boxSizing { CONTENT_BOX };
+ };
+
void setRect(const LayoutRect&);
void setTopLeft(const LayoutPoint&);
void setTop(LayoutUnit);
@@ -125,6 +133,8 @@
void setHasValidPadding();
#endif
+ const Style m_style;
+
LayoutRect m_rect;
LayoutUnit m_marginTop;
@@ -142,8 +152,6 @@
LayoutUnit m_paddingBottom;
LayoutUnit m_paddingRight;
- EBoxSizing m_boxSizing { CONTENT_BOX };
-
#if !ASSERT_DISABLED
bool m_hasValidTop { false };
bool m_hasValidLeft { false };
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes