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

Unified Diff: third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp

Issue 1805283002: [SPv2] Fix paint offset computation for LayoutTableCell in property tree builder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
index 20b440299a1d9f0efc16e798a2e6cac37a9547f1..e19a8a7664ae6e8dc2a07a34b99d5ab1fd8453aa 100644
--- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
@@ -107,7 +107,6 @@ static void deriveBorderBoxFromContainerContext(const LayoutObject& object, Pain
const LayoutBoxModelObject& boxModelObject = toLayoutBoxModelObject(object);
- // TODO(trchen): There is some insanity going on with tables. Double check results.
switch (object.styleRef().position()) {
case StaticPosition:
break;
@@ -130,8 +129,17 @@ static void deriveBorderBoxFromContainerContext(const LayoutObject& object, Pain
default:
ASSERT_NOT_REACHED();
}
- if (boxModelObject.isBox())
+ if (boxModelObject.isBox()) {
context.paintOffset += toLayoutBox(boxModelObject).locationOffset();
+ // This is a weird quirk that table cells paint as children of table rows,
+ // but their location have the row's location baked-in.
+ // Similar adjustment is done in LayoutTableCell::offsetFromContainer().
+ if (boxModelObject.isTableCell()) {
+ LayoutObject* parentRow = boxModelObject.parent();
+ ASSERT(parentRow && parentRow->isTableRow());
+ context.paintOffset -= toLayoutBox(parentRow)->locationOffset();
+ }
+ }
}
static PassRefPtr<TransformPaintPropertyNode> createPaintOffsetTranslationIfNeeded(const LayoutObject& object, PaintPropertyTreeBuilderContext& context)
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698