Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2262)

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBox.h

Issue 2695963005: WIP: redirect some LayoutBox methods to ng fragments
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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) {

Powered by Google App Engine
This is Rietveld 408576698