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

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

Issue 2166923004: Fix Ruby visual rects in flipped blocks writing mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Back to patch 1 with updated test and comments. Created 4 years, 4 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 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 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 2076 matching lines...) Expand 10 before | Expand all | Expand 10 after
2087 // include a scale. 2087 // include a scale.
2088 rect = LayoutRect(layer()->transform()->mapRect(enclosingIntRect(rect))) ; 2088 rect = LayoutRect(layer()->transform()->mapRect(enclosingIntRect(rect))) ;
2089 } 2089 }
2090 LayoutPoint topLeft = rect.location(); 2090 LayoutPoint topLeft = rect.location();
2091 if (container->isBox()) { 2091 if (container->isBox()) {
2092 topLeft.moveBy(topLeftLocation(toLayoutBox(container))); 2092 topLeft.moveBy(topLeftLocation(toLayoutBox(container)));
2093 // If the row is the ancestor, however, add its offset back in. In effec t, this passes from the joint <td> / <tr> 2093 // If the row is the ancestor, however, add its offset back in. In effec t, this passes from the joint <td> / <tr>
2094 // coordinate space to the parent space, then back to <tr> / <td>. 2094 // coordinate space to the parent space, then back to <tr> / <td>.
2095 if (tableRowContainer) 2095 if (tableRowContainer)
2096 topLeft.moveBy(-tableRowContainer->topLeftLocation(toLayoutBox(conta iner))); 2096 topLeft.moveBy(-tableRowContainer->topLeftLocation(toLayoutBox(conta iner)));
2097 } else if (container->isRuby()) {
2098 // TODO(wkorman): Generalize Ruby specialization and/or document more cl early.
2099 // See the accompanying specialization in LayoutInline::mapToVisualRectI nAncestorSpace.
2100 topLeft.moveBy(topLeftLocation());
2097 } else { 2101 } else {
2098 topLeft.moveBy(location()); 2102 topLeft.moveBy(location());
2099 } 2103 }
2100 2104
2101 const ComputedStyle& styleToUse = styleRef(); 2105 const ComputedStyle& styleToUse = styleRef();
2102 EPosition position = styleToUse.position(); 2106 EPosition position = styleToUse.position();
2103 if (position == AbsolutePosition && container->isInFlowPositioned() && conta iner->isLayoutInline()) { 2107 if (position == AbsolutePosition && container->isInFlowPositioned() && conta iner->isLayoutInline()) {
2104 topLeft += toLayoutInline(container)->offsetForInFlowPositionedInline(*t his); 2108 topLeft += toLayoutInline(container)->offsetForInFlowPositionedInline(*t his);
2105 } else if (styleToUse.hasInFlowPosition() && layer()) { 2109 } else if (styleToUse.hasInFlowPosition() && layer()) {
2106 // Apply the relative position offset when invalidating a rectangle. Th e layer 2110 // Apply the relative position offset when invalidating a rectangle. Th e layer
(...skipping 2845 matching lines...) Expand 10 before | Expand all | Expand 10 after
4952 m_rareData->m_snapAreas->remove(&snapArea); 4956 m_rareData->m_snapAreas->remove(&snapArea);
4953 } 4957 }
4954 } 4958 }
4955 4959
4956 SnapAreaSet* LayoutBox::snapAreas() const 4960 SnapAreaSet* LayoutBox::snapAreas() const
4957 { 4961 {
4958 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr; 4962 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr;
4959 } 4963 }
4960 4964
4961 } // namespace blink 4965 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698