Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/LayoutBox.h |
| diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.h b/third_party/WebKit/Source/core/layout/LayoutBox.h |
| index 1aa640e967d31c4f6b217095bf7f7266029a45d4..2547c66ca997ee1744a0d283740a3bdd85b010e1 100644 |
| --- a/third_party/WebKit/Source/core/layout/LayoutBox.h |
| +++ b/third_party/WebKit/Source/core/layout/LayoutBox.h |
| @@ -24,6 +24,7 @@ |
| #define LayoutBox_h |
| #include "core/CoreExport.h" |
| +#include "core/layout/ng/ng_physical_box_fragment.h" |
| #include "core/layout/LayoutBoxModelObject.h" |
| #include "core/layout/OverflowModel.h" |
| #include "platform/scroll/ScrollTypes.h" |
| @@ -204,7 +205,12 @@ class CORE_EXPORT LayoutBox : public LayoutBoxModelObject { |
| LayoutBox* firstChildBox() const; |
| LayoutBox* firstInFlowChildBox() const; |
| LayoutBox* lastChildBox() const; |
| - |
| + private: |
| + RefPtr<NGPhysicalBoxFragment> m_ngPhysicalBoxFragment; |
| + public: |
| + void setNGPhysicalFragment(RefPtr<NGPhysicalBoxFragment> fragment) { |
| + m_ngPhysicalBoxFragment = fragment; |
| + } |
| int pixelSnappedWidth() const { return m_frameRect.pixelSnappedWidth(); } |
| int pixelSnappedHeight() const { return m_frameRect.pixelSnappedHeight(); } |
| @@ -212,6 +218,7 @@ class CORE_EXPORT LayoutBox : public LayoutBoxModelObject { |
| if (x == m_frameRect.x()) |
| return; |
| m_frameRect.setX(x); |
| +// m_ngPhysicalBoxFragment->setX(x); |
|
ikilpatrick
2017/02/16 18:24:20
yeah so this is what i had in mind, I'd delete m_f
dgrogan
2017/02/16 18:54:09
What should I do about layout calling location() (
|
| locationChanged(); |
| } |
| void setY(LayoutUnit y) { |
| @@ -313,11 +320,22 @@ class CORE_EXPORT LayoutBox : public LayoutBoxModelObject { |
| setWidth(size); |
| } |
| - LayoutPoint location() const { return m_frameRect.location(); } |
| + LayoutPoint location() const { |
| + if (m_ngPhysicalBoxFragment) { |
|
dgrogan
2017/02/16 03:16:00
location() is called during layout before NGFragme
|
| + DCHECK(m_frameRect.location() == m_ngPhysicalBoxFragment->Location()); |
| + } |
| + return m_frameRect.location(); |
| + } |
| + |
| LayoutSize locationOffset() const { |
| return LayoutSize(m_frameRect.x(), m_frameRect.y()); |
| } |
| - LayoutSize size() const { return m_frameRect.size(); } |
| + LayoutSize size() const { |
| + if (m_ngPhysicalBoxFragment) { |
| + DCHECK(m_frameRect.size() == m_ngPhysicalBoxFragment->LegacySize()); |
| + } |
| + return m_frameRect.size(); |
| + } |
| IntSize pixelSnappedSize() const { return m_frameRect.pixelSnappedSize(); } |
| void setLocation(const LayoutPoint& location) { |