https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/layout/LayoutTable.h?rcl=47398b276b2be5d18308f7b38fb9ee333dc5580f&l=300 LayoutTable::Padding{Start|End} round the result, but LayoutTable::Padding{Top|Left|Right|Bottom} don't. This causes PaddingStart() != PaddingLeft() in horizontal mode which is incorrect.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/7d51399398db180fe1a7a83a95820e56a9fac755 commit 7d51399398db180fe1a7a83a95820e56a9fac755 Author: Xianzhu Wang <wangxianzhu@chromium.org> Date: Thu Jun 29 18:28:49 2017 Devirtualize LayoutBoxModelObject logical orientation border/margin/padding accessors Previously, almost all border/margin/padding accessors in LayoutBoxModelObject were virtual. A subclass needed to override all accessors of a set, or otherwise these accessors would be inconsistent. Even if a subclass overrode all accessors, it was still hard to keep them consistent. For example, LayoutTable overrode PaddingLeft() etc. to return zero when there are collapsed borders, while it also overrode PaddingStart() and PaddingEnd() with different logic, causing sometimes PaddingLeft() != PaddingStart() in horizontal writing-mode. Devirtualize the logical orientation accessors and base them on the virtual physical accessors to ensure consistence. Also reduce duplicated code about physical/logical orientation conversion by using WritingModeUtils.h. BUG= 737324 Change-Id: I1f7bfdc7665ab86df2b3344b34aff113cccb3c67 Reviewed-on: https://chromium-review.googlesource.com/551106 Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org> Reviewed-by: David Grogan <dgrogan@chromium.org> Cr-Commit-Position: refs/heads/master@{#483432} [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/LayoutTests/fast/sub-pixel/input-caret-on-subpixel-bound-expected.html [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/LayoutTests/fast/table/table-in-table-percent-width-collapsing-border-expected.png [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/LayoutTests/fast/table/table-in-table-percent-width-collapsing-border-quirks-mode-expected.png [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.png [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.txt [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-2-expected.png [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-2-expected.txt [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.png [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.txt [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.png [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.txt [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/LayoutTests/platform/linux/tables/mozilla_expected_failures/bugs/bug89315-expected.png [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/LayoutTests/platform/mac-mac10.9/tables/mozilla_expected_failures/bugs/bug89315-expected.png [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.png [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.txt [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-through-object-with-absolute-size-2-expected.png [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-through-object-with-absolute-size-2-expected.txt [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.png [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.txt [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.png [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.txt [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/LayoutTests/platform/mac/tables/mozilla_expected_failures/bugs/bug89315-expected.png [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.png [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.txt [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-svg-through-object-with-absolute-size-2-expected.png [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-svg-through-object-with-absolute-size-2-expected.txt [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.png [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.txt [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.png [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.txt [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/LayoutTests/platform/win/tables/mozilla_expected_failures/bugs/bug89315-expected.png [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/Source/core/html/HTMLElement.h [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/Source/core/layout/LayoutBox.h [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.h [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/Source/core/layout/LayoutInline.cpp [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/Source/core/layout/LayoutInline.h [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/Source/core/layout/LayoutScrollbarPart.h [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/Source/core/layout/LayoutTable.cpp [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/Source/core/layout/LayoutTable.h [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/Source/core/layout/LayoutTableCell.cpp [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/Source/core/layout/LayoutTableCell.h [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/Source/core/layout/LayoutTableTest.cpp [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/Source/core/layout/shapes/ShapeOutsideInfo.cpp [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/Source/core/page/ChromeClient.h [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/Source/platform/geometry/LayoutRectOutsets.cpp [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/Source/platform/geometry/LayoutRectOutsets.h [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/Source/platform/geometry/LayoutRectOutsetsTest.cpp [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/Source/platform/text/WritingModeUtils.h [modify] https://crrev.com/7d51399398db180fe1a7a83a95820e56a9fac755/third_party/WebKit/Source/platform/text/WritingModeUtilsTest.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/27d732d9364e1f139dafdbacc813318b5a9a852f commit 27d732d9364e1f139dafdbacc813318b5a9a852f Author: Xianzhu Wang <wangxianzhu@chromium.org> Date: Fri Aug 18 23:18:12 2017 Reland Devirtualize LayoutBoxModelObject logical orientation border/margin/padding accessors This relands commit 7d51399398db180fe1a7a83a95820e56a9fac755 which was reverted because of performance regression ( crbug.com/739111 ). Now we have switched to clang on Windows. Tried on perf try bots and the CL seemed to no longer cause regressions (see perf try results of patchsets 1 and 2 in https://chromium-review.googlesource.com/c/619603). ---------------------------------------------------------------------------- Previously, almost all border/margin/padding accessors in LayoutBoxModelObject were virtual. A subclass needed to override all accessors of a set, or otherwise these accessors would be inconsistent. Even if a subclass overrode all accessors, it was still hard to keep them consistent. For example, LayoutTable overrode PaddingLeft() etc. to return zero when there are collapsed borders, while it also overrode PaddingStart() and PaddingEnd() with different logic, causing sometimes PaddingLeft() != PaddingStart() in horizontal writing-mode. Devirtualize the logical orientation accessors and base them on the virtual physical accessors to ensure consistence. Also reduce duplicated code about physical/logical orientation conversion by using WritingModeUtils.h. BUG= 737324 TBR=pdr@chromium.org Change-Id: I7264901fb26426689d05427893bbf709ea5046ac Reviewed-on: https://chromium-review.googlesource.com/619603 Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org> Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org> Cr-Commit-Position: refs/heads/master@{#495736} [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/LayoutTests/fast/sub-pixel/input-caret-on-subpixel-bound-expected.html [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/LayoutTests/fast/table/table-in-table-percent-width-collapsing-border-expected.png [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/LayoutTests/fast/table/table-in-table-percent-width-collapsing-border-quirks-mode-expected.png [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.png [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.txt [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-2-expected.png [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-2-expected.txt [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.png [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.txt [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.png [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/LayoutTests/platform/linux/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.txt [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/LayoutTests/platform/linux/tables/mozilla_expected_failures/bugs/bug89315-expected.png [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/LayoutTests/platform/mac-mac10.9/tables/mozilla_expected_failures/bugs/bug89315-expected.png [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.png [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.txt [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-through-object-with-absolute-size-2-expected.png [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-through-object-with-absolute-size-2-expected.txt [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.png [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.txt [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.png [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.txt [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/LayoutTests/platform/mac/tables/mozilla_expected_failures/bugs/bug89315-expected.png [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.png [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.txt [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-svg-through-object-with-absolute-size-2-expected.png [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-svg-through-object-with-absolute-size-2-expected.txt [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.png [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.txt [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.png [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.txt [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/LayoutTests/platform/win/tables/mozilla_expected_failures/bugs/bug89315-expected.png [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/Source/core/html/HTMLElement.h [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/Source/core/layout/LayoutBox.h [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.h [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/Source/core/layout/LayoutInline.cpp [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/Source/core/layout/LayoutInline.h [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/Source/core/layout/LayoutScrollbarPart.h [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/Source/core/layout/LayoutTable.cpp [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/Source/core/layout/LayoutTable.h [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/Source/core/layout/LayoutTableCell.cpp [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/Source/core/layout/LayoutTableCell.h [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/Source/core/layout/LayoutTableTest.cpp [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/Source/core/layout/shapes/ShapeOutsideInfo.cpp [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/Source/core/page/ChromeClient.h [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/Source/platform/geometry/LayoutRectOutsets.cpp [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/Source/platform/geometry/LayoutRectOutsets.h [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/Source/platform/geometry/LayoutRectOutsetsTest.cpp [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/Source/platform/text/WritingModeUtils.h [modify] https://crrev.com/27d732d9364e1f139dafdbacc813318b5a9a852f/third_party/WebKit/Source/platform/text/WritingModeUtilsTest.cpp
Comment 1 by bugdroid1@chromium.org
, Jun 29 2017