Summary: | offsetTop/offsetLeft return the wrong values for horizontal-bt/vertical-rl writing modes | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Ojan Vafai <ojan> | ||||
Component: | Layout and Rendering | Assignee: | Ojan Vafai <ojan> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | ap, hyatt, shinyak, simon.fraser, tony | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Ojan Vafai
2011-09-16 19:42:13 PDT
Created attachment 108888 [details]
Patch
Comment on attachment 108888 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=108888&action=review r=me, but you can rename xFlippedForWritingMode and yFlippedForWritingMode to left() and top(). If you want to go further we could rename locationIncludingFlipping() to topLeftLocation() and locationOffsetIncludingFlipping() to topLeftLocationOffset(). I'd add copious warnings in the header too that these represent your location relative to your container as a physical offset, and that this is rarely what you want in layout() methods. > Source/WebCore/rendering/RenderBox.h:53 > + LayoutUnit yFlippedForWritingMode() const { return locationIncludingFlipping().y(); } > + LayoutUnit xFlippedForWritingMode() const { return locationIncludingFlipping().x(); } Rename these to left() and top(). Committed r96152: <http://trac.webkit.org/changeset/96152> |