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

Unified Diff: third_party/WebKit/Source/core/layout/README.md

Issue 2539713004: Update layout location documentation to reflect renames. (Closed)
Patch Set: Feedback. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/line/InlineBox.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/README.md
diff --git a/third_party/WebKit/Source/core/layout/README.md b/third_party/WebKit/Source/core/layout/README.md
index 4cdf2f0b60212fb25e0e5e295d2d77a349df3093..0100895ccb7a7437af1344d411d9111595651386 100644
--- a/third_party/WebKit/Source/core/layout/README.md
+++ b/third_party/WebKit/Source/core/layout/README.md
@@ -212,7 +212,7 @@ making sure to incorporate coverage for all writing modes when appropriate.
Values are generally transformed into flipped block-flow coordinates via a set
of methods on the involved layout objects. See in particular
-`flipForWritingMode()`, `flipForWritingModeForChild()`, and `topLeftLocation()`.
+`flipForWritingMode()`, `flipForWritingModeForChild()`.
`InlineBox::flipForWritingMode()` variants flip the input value within the
inline box's containing block.
@@ -225,9 +225,21 @@ the referenced box, offsetting for the specified child box's current x-position
and width. This is useful for a common pattern wherein we build up a point
location starting with the current location of the (child) box.
-`LayoutBox::topLeftLocation()` performs flipping as needed. If the containing
-block is not passed to the method, looking it up requires walking up the layout
-tree, which can be expensive.
+For `LayoutBox` and `InlineBox` classes and subclasses:
+
+* `physicalLocation()` returns the physical location of a box or inline in the
+containing block. `(0,0)` is the top-left corner of the containing
+block. Flipping is performed on the values as needed. For `LayoutBox`, if the
+containing block is not passed to `physicalLocation()`, looking it up requires
+walking up the layout tree, which can be
+expensive. `InlineBox::physicalLocation()` is expensive only if the `InlineBox`
+is in flipped block-flow writing mode.
+* `location()` returns the location of a box or inline in the "physical
+coordinates with flipped block-flow direction" coordinate space. `(0,0)` is the
+top-left corner of the containing block for `writing-mode` in normal blocks
+direction (`horizontal-tb` and `vertical-lr`), and is the top-right corner of
+the containing block for `writing-mode` in flipped block-flow direction
+(`vertical-rl`).
Note there are two primary similar, but slightly different, methods regarding
finding the containing block for an element:
@@ -237,7 +249,7 @@ defined by CSS.
* `LayoutObject::containingBlock()` which returns the enclosing non-anonymous
block for an element. If the containing block is a relatively positioned inline,
it returns that inline's enclosing non-anonymous block. This is the one used by
-`topLeftLocation()`.
+`physicalLocation()`.
There are other containing block methods in `LayoutObject` for special purposes
such as fixed position, absolute position, and paint invalidation. Code will
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/line/InlineBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698