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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBox.h

Issue 2536453002: Rename some functions about layout locations (Closed)
Patch Set: Rebase Created 4 years 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 LayoutSize size() const { return m_frameRect.size(); } 320 LayoutSize size() const { return m_frameRect.size(); }
321 IntSize pixelSnappedSize() const { return m_frameRect.pixelSnappedSize(); } 321 IntSize pixelSnappedSize() const { return m_frameRect.pixelSnappedSize(); }
322 322
323 void setLocation(const LayoutPoint& location) { 323 void setLocation(const LayoutPoint& location) {
324 if (location == m_frameRect.location()) 324 if (location == m_frameRect.location())
325 return; 325 return;
326 m_frameRect.setLocation(location); 326 m_frameRect.setLocation(location);
327 frameRectChanged(); 327 frameRectChanged();
328 } 328 }
329 329
330 // The ancestor box that this object's location and topLeftLocation are 330 // The ancestor box that this object's location and physicalLocation are
331 // relative to. 331 // relative to.
332 virtual LayoutBox* locationContainer() const; 332 virtual LayoutBox* locationContainer() const;
333 333
334 // FIXME: Currently scrollbars are using int geometry and positioned based on 334 // FIXME: Currently scrollbars are using int geometry and positioned based on
335 // pixelSnappedBorderBoxRect whose size may change when location changes 335 // pixelSnappedBorderBoxRect whose size may change when location changes
336 // because of pixel snapping. This function is used to change location of the 336 // because of pixel snapping. This function is used to change location of the
337 // LayoutBox outside of LayoutBox::layout(). Will remove when we use 337 // LayoutBox outside of LayoutBox::layout(). Will remove when we use
338 // LayoutUnits for scrollbars. 338 // LayoutUnits for scrollbars.
339 void setLocationAndUpdateOverflowControlsIfNeeded(const LayoutPoint&); 339 void setLocationAndUpdateOverflowControlsIfNeeded(const LayoutPoint&);
340 340
(...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after
1172 flipForWritingMode(const FloatPoint& position) const { 1172 flipForWritingMode(const FloatPoint& position) const {
1173 if (!UNLIKELY(hasFlippedBlocksWritingMode())) 1173 if (!UNLIKELY(hasFlippedBlocksWritingMode()))
1174 return position; 1174 return position;
1175 return FloatPoint(m_frameRect.width() - position.x(), position.y()); 1175 return FloatPoint(m_frameRect.width() - position.x(), position.y());
1176 } 1176 }
1177 void flipForWritingMode(FloatRect& rect) const { 1177 void flipForWritingMode(FloatRect& rect) const {
1178 if (!UNLIKELY(hasFlippedBlocksWritingMode())) 1178 if (!UNLIKELY(hasFlippedBlocksWritingMode()))
1179 return; 1179 return;
1180 rect.setX(m_frameRect.width() - rect.maxX()); 1180 rect.setX(m_frameRect.width() - rect.maxX());
1181 } 1181 }
1182 // These represent your location relative to your container as a physical 1182
1183 // offset. In layout related methods you almost always want the logical 1183 // Passing |container| causes flipped-block flipping w.r.t. that container,
1184 // location (e.g. x() and y()). Passing |container| causes flipped-block 1184 // or containingBlock() otherwise.
1185 // flipping w.r.t. that container, or containingBlock() otherwise. 1185 LayoutPoint physicalLocation(
1186 LayoutPoint topLeftLocation(
1187 const LayoutBox* flippedBlocksContainer = nullptr) const; 1186 const LayoutBox* flippedBlocksContainer = nullptr) const;
1188 LayoutSize topLeftLocationOffset() const { 1187 LayoutSize physicalLocationOffset() const {
1189 return toLayoutSize(topLeftLocation()); 1188 return toLayoutSize(physicalLocation());
1190 } 1189 }
1191 1190
1192 LayoutRect logicalVisualOverflowRectForPropagation( 1191 LayoutRect logicalVisualOverflowRectForPropagation(
1193 const ComputedStyle&) const; 1192 const ComputedStyle&) const;
1194 LayoutRect visualOverflowRectForPropagation(const ComputedStyle&) const; 1193 LayoutRect visualOverflowRectForPropagation(const ComputedStyle&) const;
1195 LayoutRect logicalLayoutOverflowRectForPropagation( 1194 LayoutRect logicalLayoutOverflowRectForPropagation(
1196 const ComputedStyle&) const; 1195 const ComputedStyle&) const;
1197 LayoutRect layoutOverflowRectForPropagation(const ComputedStyle&) const; 1196 LayoutRect layoutOverflowRectForPropagation(const ComputedStyle&) const;
1198 1197
1199 bool hasOverflowModel() const { return m_overflow.get(); } 1198 bool hasOverflowModel() const { return m_overflow.get(); }
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
1623 1622
1624 inline bool LayoutBox::isForcedFragmentainerBreakValue(EBreak breakValue) { 1623 inline bool LayoutBox::isForcedFragmentainerBreakValue(EBreak breakValue) {
1625 return breakValue == BreakColumn || breakValue == BreakLeft || 1624 return breakValue == BreakColumn || breakValue == BreakLeft ||
1626 breakValue == BreakPage || breakValue == BreakRecto || 1625 breakValue == BreakPage || breakValue == BreakRecto ||
1627 breakValue == BreakRight || breakValue == BreakVerso; 1626 breakValue == BreakRight || breakValue == BreakVerso;
1628 } 1627 }
1629 1628
1630 } // namespace blink 1629 } // namespace blink
1631 1630
1632 #endif // LayoutBox_h 1631 #endif // LayoutBox_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698