| OLD | NEW |
| 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) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
| 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) | 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. |
| 7 * Copyright (C) 2009 Google Inc. All rights reserved. | 7 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
| 9 * | 9 * |
| 10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
| (...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1024 IntRect result = rects[0]; | 1024 IntRect result = rects[0]; |
| 1025 for (size_t i = 1; i < n; ++i) | 1025 for (size_t i = 1; i < n; ++i) |
| 1026 result.unite(rects[i]); | 1026 result.unite(rects[i]); |
| 1027 return result; | 1027 return result; |
| 1028 } | 1028 } |
| 1029 | 1029 |
| 1030 IntRect LayoutObject::absoluteElementBoundingBoxRect() const | 1030 IntRect LayoutObject::absoluteElementBoundingBoxRect() const |
| 1031 { | 1031 { |
| 1032 Vector<LayoutRect> rects; | 1032 Vector<LayoutRect> rects; |
| 1033 const LayoutBoxModelObject* container = enclosingLayer()->layoutObject(); | 1033 const LayoutBoxModelObject* container = enclosingLayer()->layoutObject(); |
| 1034 addElementVisualOverflowRects(rects, LayoutPoint(localToContainerPoint(Float
Point(), container))); | 1034 addElementVisualOverflowRects(rects, LayoutPoint(localToAncestorPoint(FloatP
oint(), container))); |
| 1035 return container->localToAbsoluteQuad(FloatQuad(FloatRect(unionRect(rects)))
).enclosingBoundingBox(); | 1035 return container->localToAbsoluteQuad(FloatQuad(FloatRect(unionRect(rects)))
).enclosingBoundingBox(); |
| 1036 } | 1036 } |
| 1037 | 1037 |
| 1038 FloatRect LayoutObject::absoluteBoundingBoxRectForRange(const Range* range) | 1038 FloatRect LayoutObject::absoluteBoundingBoxRectForRange(const Range* range) |
| 1039 { | 1039 { |
| 1040 if (!range || !range->startContainer()) | 1040 if (!range || !range->startContainer()) |
| 1041 return FloatRect(); | 1041 return FloatRect(); |
| 1042 | 1042 |
| 1043 range->ownerDocument().updateLayout(); | 1043 range->ownerDocument().updateLayout(); |
| 1044 | 1044 |
| (...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1580 { | 1580 { |
| 1581 return clippedOverflowRectForPaintInvalidation(view()); | 1581 return clippedOverflowRectForPaintInvalidation(view()); |
| 1582 } | 1582 } |
| 1583 | 1583 |
| 1584 LayoutRect LayoutObject::clippedOverflowRectForPaintInvalidation(const LayoutBox
ModelObject*, const PaintInvalidationState*) const | 1584 LayoutRect LayoutObject::clippedOverflowRectForPaintInvalidation(const LayoutBox
ModelObject*, const PaintInvalidationState*) const |
| 1585 { | 1585 { |
| 1586 ASSERT_NOT_REACHED(); | 1586 ASSERT_NOT_REACHED(); |
| 1587 return LayoutRect(); | 1587 return LayoutRect(); |
| 1588 } | 1588 } |
| 1589 | 1589 |
| 1590 void LayoutObject::mapToVisibleRectInContainerSpace(const LayoutBoxModelObject*
paintInvalidationContainer, LayoutRect& rect, const PaintInvalidationState* pain
tInvalidationState) const | 1590 void LayoutObject::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* a
ncestor, LayoutRect& rect, const PaintInvalidationState* paintInvalidationState)
const |
| 1591 { | 1591 { |
| 1592 if (paintInvalidationContainer == this) | 1592 if (ancestor == this) |
| 1593 return; | 1593 return; |
| 1594 | 1594 |
| 1595 if (paintInvalidationState && paintInvalidationState->canMapToContainer(pain
tInvalidationContainer)) { | 1595 if (paintInvalidationState && paintInvalidationState->canMapToContainer(ance
stor)) { |
| 1596 rect.move(paintInvalidationState->paintOffset()); | 1596 rect.move(paintInvalidationState->paintOffset()); |
| 1597 if (paintInvalidationState->isClipped()) | 1597 if (paintInvalidationState->isClipped()) |
| 1598 rect.intersect(paintInvalidationState->clipRect()); | 1598 rect.intersect(paintInvalidationState->clipRect()); |
| 1599 return; | 1599 return; |
| 1600 } | 1600 } |
| 1601 | 1601 |
| 1602 if (LayoutObject* o = parent()) { | 1602 if (LayoutObject* parent = this->parent()) { |
| 1603 if (o->hasOverflowClip()) { | 1603 if (parent->hasOverflowClip()) { |
| 1604 LayoutBox* boxParent = toLayoutBox(o); | 1604 LayoutBox* parentBox = toLayoutBox(parent); |
| 1605 if (o == paintInvalidationContainer) | 1605 parentBox->mapScrollingContentsRectToBoxSpace(rect); |
| 1606 boxParent->applyCachedScrollOffsetForPaintInvalidation(rect); | 1606 if (parent != ancestor) |
| 1607 else | 1607 parentBox->applyOverflowClip(rect); |
| 1608 boxParent->applyCachedClipAndScrollOffsetForPaintInvalidation(re
ct); | |
| 1609 if (rect.isEmpty()) | 1608 if (rect.isEmpty()) |
| 1610 return; | 1609 return; |
| 1611 } | 1610 } |
| 1612 | 1611 |
| 1613 o->mapToVisibleRectInContainerSpace(paintInvalidationContainer, rect, pa
intInvalidationState); | 1612 parent->mapToVisibleRectInAncestorSpace(ancestor, rect, paintInvalidatio
nState); |
| 1614 } | 1613 } |
| 1615 } | 1614 } |
| 1616 | 1615 |
| 1617 void LayoutObject::dirtyLinesFromChangedChild(LayoutObject*) | 1616 void LayoutObject::dirtyLinesFromChangedChild(LayoutObject*) |
| 1618 { | 1617 { |
| 1619 } | 1618 } |
| 1620 | 1619 |
| 1621 #ifndef NDEBUG | 1620 #ifndef NDEBUG |
| 1622 | 1621 |
| 1623 void LayoutObject::showTreeForThis() const | 1622 void LayoutObject::showTreeForThis() const |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2135 } | 2134 } |
| 2136 | 2135 |
| 2137 LayoutRect LayoutObject::viewRect() const | 2136 LayoutRect LayoutObject::viewRect() const |
| 2138 { | 2137 { |
| 2139 return view()->viewRect(); | 2138 return view()->viewRect(); |
| 2140 } | 2139 } |
| 2141 | 2140 |
| 2142 FloatPoint LayoutObject::localToAbsolute(const FloatPoint& localPoint, MapCoordi
natesFlags mode) const | 2141 FloatPoint LayoutObject::localToAbsolute(const FloatPoint& localPoint, MapCoordi
natesFlags mode) const |
| 2143 { | 2142 { |
| 2144 TransformState transformState(TransformState::ApplyTransformDirection, local
Point); | 2143 TransformState transformState(TransformState::ApplyTransformDirection, local
Point); |
| 2145 mapLocalToContainer(0, transformState, mode | ApplyContainerFlip); | 2144 mapLocalToAncestor(0, transformState, mode | ApplyContainerFlip); |
| 2146 transformState.flatten(); | 2145 transformState.flatten(); |
| 2147 | 2146 |
| 2148 return transformState.lastPlanarPoint(); | 2147 return transformState.lastPlanarPoint(); |
| 2149 } | 2148 } |
| 2150 | 2149 |
| 2151 FloatPoint LayoutObject::absoluteToLocal(const FloatPoint& containerPoint, MapCo
ordinatesFlags mode) const | 2150 FloatPoint LayoutObject::absoluteToLocal(const FloatPoint& containerPoint, MapCo
ordinatesFlags mode) const |
| 2152 { | 2151 { |
| 2153 TransformState transformState(TransformState::UnapplyInverseTransformDirecti
on, containerPoint); | 2152 TransformState transformState(TransformState::UnapplyInverseTransformDirecti
on, containerPoint); |
| 2154 mapAbsoluteToLocalPoint(mode, transformState); | 2153 mapAbsoluteToLocalPoint(mode, transformState); |
| 2155 transformState.flatten(); | 2154 transformState.flatten(); |
| 2156 | 2155 |
| 2157 return transformState.lastPlanarPoint(); | 2156 return transformState.lastPlanarPoint(); |
| 2158 } | 2157 } |
| 2159 | 2158 |
| 2160 FloatQuad LayoutObject::absoluteToLocalQuad(const FloatQuad& quad, MapCoordinate
sFlags mode) const | 2159 FloatQuad LayoutObject::absoluteToLocalQuad(const FloatQuad& quad, MapCoordinate
sFlags mode) const |
| 2161 { | 2160 { |
| 2162 TransformState transformState(TransformState::UnapplyInverseTransformDirecti
on, quad.boundingBox().center(), quad); | 2161 TransformState transformState(TransformState::UnapplyInverseTransformDirecti
on, quad.boundingBox().center(), quad); |
| 2163 mapAbsoluteToLocalPoint(mode, transformState); | 2162 mapAbsoluteToLocalPoint(mode, transformState); |
| 2164 transformState.flatten(); | 2163 transformState.flatten(); |
| 2165 return transformState.lastPlanarQuad(); | 2164 return transformState.lastPlanarQuad(); |
| 2166 } | 2165 } |
| 2167 | 2166 |
| 2168 void LayoutObject::mapLocalToContainer(const LayoutBoxModelObject* paintInvalida
tionContainer, TransformState& transformState, MapCoordinatesFlags mode, bool* w
asFixed, const PaintInvalidationState* paintInvalidationState) const | 2167 void LayoutObject::mapLocalToAncestor(const LayoutBoxModelObject* ancestor, Tran
sformState& transformState, MapCoordinatesFlags mode, bool* wasFixed, const Pain
tInvalidationState* paintInvalidationState) const |
| 2169 { | 2168 { |
| 2170 if (paintInvalidationContainer == this) | 2169 if (ancestor == this) |
| 2171 return; | 2170 return; |
| 2172 | 2171 |
| 2173 LayoutObject* o = parent(); | 2172 LayoutObject* o = parent(); |
| 2174 if (!o) | 2173 if (!o) |
| 2175 return; | 2174 return; |
| 2176 | 2175 |
| 2177 // FIXME: this should call offsetFromContainer to share code, but I'm not su
re it's ever called. | 2176 // FIXME: this should call offsetFromContainer to share code, but I'm not su
re it's ever called. |
| 2178 LayoutPoint centerPoint = roundedLayoutPoint(transformState.mappedPoint()); | 2177 LayoutPoint centerPoint = roundedLayoutPoint(transformState.mappedPoint()); |
| 2179 if (mode & ApplyContainerFlip && o->isBox()) { | 2178 if (mode & ApplyContainerFlip && o->isBox()) { |
| 2180 if (o->style()->isFlippedBlocksWritingMode()) | 2179 if (o->style()->isFlippedBlocksWritingMode()) |
| 2181 transformState.move(toLayoutBox(o)->flipForWritingMode(roundedLayout
Point(transformState.mappedPoint())) - centerPoint); | 2180 transformState.move(toLayoutBox(o)->flipForWritingMode(roundedLayout
Point(transformState.mappedPoint())) - centerPoint); |
| 2182 mode &= ~ApplyContainerFlip; | 2181 mode &= ~ApplyContainerFlip; |
| 2183 } | 2182 } |
| 2184 | 2183 |
| 2185 transformState.move(o->columnOffset(roundedLayoutPoint(transformState.mapped
Point()))); | 2184 transformState.move(o->columnOffset(roundedLayoutPoint(transformState.mapped
Point()))); |
| 2186 | 2185 |
| 2187 if (o->hasOverflowClip()) | 2186 if (o->hasOverflowClip()) |
| 2188 transformState.move(-toLayoutBox(o)->scrolledContentOffset()); | 2187 transformState.move(-toLayoutBox(o)->scrolledContentOffset()); |
| 2189 | 2188 |
| 2190 o->mapLocalToContainer(paintInvalidationContainer, transformState, mode, was
Fixed, paintInvalidationState); | 2189 o->mapLocalToAncestor(ancestor, transformState, mode, wasFixed, paintInvalid
ationState); |
| 2191 } | 2190 } |
| 2192 | 2191 |
| 2193 const LayoutObject* LayoutObject::pushMappingToContainer(const LayoutBoxModelObj
ect* ancestorToStopAt, LayoutGeometryMap& geometryMap) const | 2192 const LayoutObject* LayoutObject::pushMappingToContainer(const LayoutBoxModelObj
ect* ancestorToStopAt, LayoutGeometryMap& geometryMap) const |
| 2194 { | 2193 { |
| 2195 ASSERT_NOT_REACHED(); | 2194 ASSERT_NOT_REACHED(); |
| 2196 return nullptr; | 2195 return nullptr; |
| 2197 } | 2196 } |
| 2198 | 2197 |
| 2199 void LayoutObject::mapAbsoluteToLocalPoint(MapCoordinatesFlags mode, TransformSt
ate& transformState) const | 2198 void LayoutObject::mapAbsoluteToLocalPoint(MapCoordinatesFlags mode, TransformSt
ate& transformState) const |
| 2200 { | 2199 { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 2228 | 2227 |
| 2229 TransformationMatrix perspectiveMatrix; | 2228 TransformationMatrix perspectiveMatrix; |
| 2230 perspectiveMatrix.applyPerspective(containerObject->style()->perspective
()); | 2229 perspectiveMatrix.applyPerspective(containerObject->style()->perspective
()); |
| 2231 | 2230 |
| 2232 transform.translateRight3d(-perspectiveOrigin.x(), -perspectiveOrigin.y(
), 0); | 2231 transform.translateRight3d(-perspectiveOrigin.x(), -perspectiveOrigin.y(
), 0); |
| 2233 transform = perspectiveMatrix * transform; | 2232 transform = perspectiveMatrix * transform; |
| 2234 transform.translateRight3d(perspectiveOrigin.x(), perspectiveOrigin.y(),
0); | 2233 transform.translateRight3d(perspectiveOrigin.x(), perspectiveOrigin.y(),
0); |
| 2235 } | 2234 } |
| 2236 } | 2235 } |
| 2237 | 2236 |
| 2238 FloatQuad LayoutObject::localToContainerQuad(const FloatQuad& localQuad, const L
ayoutBoxModelObject* paintInvalidationContainer, MapCoordinatesFlags mode, bool*
wasFixed) const | 2237 FloatQuad LayoutObject::localToAncestorQuad(const FloatQuad& localQuad, const La
youtBoxModelObject* ancestor, MapCoordinatesFlags mode, bool* wasFixed) const |
| 2239 { | 2238 { |
| 2240 // Track the point at the center of the quad's bounding box. As mapLocalToCo
ntainer() calls offsetFromContainer(), | 2239 // Track the point at the center of the quad's bounding box. As mapLocalToAn
cestor() calls offsetFromContainer(), |
| 2241 // it will use that point as the reference point to decide which column's tr
ansform to apply in multiple-column blocks. | 2240 // it will use that point as the reference point to decide which column's tr
ansform to apply in multiple-column blocks. |
| 2242 TransformState transformState(TransformState::ApplyTransformDirection, local
Quad.boundingBox().center(), localQuad); | 2241 TransformState transformState(TransformState::ApplyTransformDirection, local
Quad.boundingBox().center(), localQuad); |
| 2243 mapLocalToContainer(paintInvalidationContainer, transformState, mode | Apply
ContainerFlip | UseTransforms, wasFixed); | 2242 mapLocalToAncestor(ancestor, transformState, mode | ApplyContainerFlip | Use
Transforms, wasFixed); |
| 2244 transformState.flatten(); | 2243 transformState.flatten(); |
| 2245 | 2244 |
| 2246 return transformState.lastPlanarQuad(); | 2245 return transformState.lastPlanarQuad(); |
| 2247 } | 2246 } |
| 2248 | 2247 |
| 2249 FloatPoint LayoutObject::localToContainerPoint(const FloatPoint& localPoint, con
st LayoutBoxModelObject* paintInvalidationContainer, MapCoordinatesFlags mode, b
ool* wasFixed, const PaintInvalidationState* paintInvalidationState) const | 2248 FloatPoint LayoutObject::localToAncestorPoint(const FloatPoint& localPoint, cons
t LayoutBoxModelObject* ancestor, MapCoordinatesFlags mode, bool* wasFixed, cons
t PaintInvalidationState* paintInvalidationState) const |
| 2250 { | 2249 { |
| 2251 TransformState transformState(TransformState::ApplyTransformDirection, local
Point); | 2250 TransformState transformState(TransformState::ApplyTransformDirection, local
Point); |
| 2252 mapLocalToContainer(paintInvalidationContainer, transformState, mode | Apply
ContainerFlip | UseTransforms, wasFixed, paintInvalidationState); | 2251 mapLocalToAncestor(ancestor, transformState, mode | ApplyContainerFlip | Use
Transforms, wasFixed, paintInvalidationState); |
| 2253 transformState.flatten(); | 2252 transformState.flatten(); |
| 2254 | 2253 |
| 2255 return transformState.lastPlanarPoint(); | 2254 return transformState.lastPlanarPoint(); |
| 2256 } | 2255 } |
| 2257 | 2256 |
| 2258 void LayoutObject::localToContainerRects(Vector<LayoutRect>& rects, const Layout
BoxModelObject* paintInvalidationContainer, const LayoutPoint& preOffset, const
LayoutPoint& postOffset) const | 2257 void LayoutObject::localToAncestorRects(Vector<LayoutRect>& rects, const LayoutB
oxModelObject* ancestor, const LayoutPoint& preOffset, const LayoutPoint& postOf
fset) const |
| 2259 { | 2258 { |
| 2260 for (size_t i = 0; i < rects.size(); ++i) { | 2259 for (size_t i = 0; i < rects.size(); ++i) { |
| 2261 LayoutRect& rect = rects[i]; | 2260 LayoutRect& rect = rects[i]; |
| 2262 rect.moveBy(preOffset); | 2261 rect.moveBy(preOffset); |
| 2263 FloatQuad containerQuad = localToContainerQuad(FloatQuad(FloatRect(rect)
), paintInvalidationContainer); | 2262 FloatQuad containerQuad = localToAncestorQuad(FloatQuad(FloatRect(rect))
, ancestor); |
| 2264 LayoutRect containerRect = LayoutRect(containerQuad.boundingBox()); | 2263 LayoutRect containerRect = LayoutRect(containerQuad.boundingBox()); |
| 2265 if (containerRect.isEmpty()) { | 2264 if (containerRect.isEmpty()) { |
| 2266 rects.remove(i--); | 2265 rects.remove(i--); |
| 2267 continue; | 2266 continue; |
| 2268 } | 2267 } |
| 2269 containerRect.moveBy(postOffset); | 2268 containerRect.moveBy(postOffset); |
| 2270 rects[i] = containerRect; | 2269 rects[i] = containerRect; |
| 2271 } | 2270 } |
| 2272 } | 2271 } |
| 2273 | 2272 |
| 2274 FloatPoint LayoutObject::localToInvalidationBackingPoint(const LayoutPoint& loca
lPoint, PaintLayer** backingLayer) | 2273 FloatPoint LayoutObject::localToInvalidationBackingPoint(const LayoutPoint& loca
lPoint, PaintLayer** backingLayer) |
| 2275 { | 2274 { |
| 2276 const LayoutBoxModelObject& paintInvalidationContainer = containerForPaintIn
validation(); | 2275 const LayoutBoxModelObject& paintInvalidationContainer = containerForPaintIn
validation(); |
| 2277 ASSERT(paintInvalidationContainer.layer()); | 2276 ASSERT(paintInvalidationContainer.layer()); |
| 2278 | 2277 |
| 2279 if (backingLayer) | 2278 if (backingLayer) |
| 2280 *backingLayer = paintInvalidationContainer.layer(); | 2279 *backingLayer = paintInvalidationContainer.layer(); |
| 2281 FloatPoint containerPoint = localToContainerPoint(FloatPoint(localPoint), &p
aintInvalidationContainer, TraverseDocumentBoundaries); | 2280 FloatPoint containerPoint = localToAncestorPoint(FloatPoint(localPoint), &pa
intInvalidationContainer, TraverseDocumentBoundaries); |
| 2282 | 2281 |
| 2283 // A layoutObject can have no invalidation backing if it is from a detached
frame, | 2282 // A layoutObject can have no invalidation backing if it is from a detached
frame, |
| 2284 // or when forced compositing is disabled. | 2283 // or when forced compositing is disabled. |
| 2285 if (paintInvalidationContainer.layer()->compositingState() == NotComposited) | 2284 if (paintInvalidationContainer.layer()->compositingState() == NotComposited) |
| 2286 return containerPoint; | 2285 return containerPoint; |
| 2287 | 2286 |
| 2288 PaintLayer::mapPointToPaintBackingCoordinates(&paintInvalidationContainer, c
ontainerPoint); | 2287 PaintLayer::mapPointToPaintBackingCoordinates(&paintInvalidationContainer, c
ontainerPoint); |
| 2289 return containerPoint; | 2288 return containerPoint; |
| 2290 } | 2289 } |
| 2291 | 2290 |
| 2292 LayoutSize LayoutObject::offsetFromContainer(const LayoutObject* o, const Layout
Point& point, bool* offsetDependsOnPoint) const | 2291 LayoutSize LayoutObject::offsetFromContainer(const LayoutObject* o, const Layout
Point& point, bool* offsetDependsOnPoint) const |
| 2293 { | 2292 { |
| 2294 ASSERT(o == container()); | 2293 ASSERT(o == container()); |
| 2295 | 2294 |
| 2296 LayoutSize offset = o->columnOffset(point); | 2295 LayoutSize offset = o->columnOffset(point); |
| 2297 | 2296 |
| 2298 if (o->hasOverflowClip()) | 2297 if (o->hasOverflowClip()) |
| 2299 offset -= toLayoutBox(o)->scrolledContentOffset(); | 2298 offset -= toLayoutBox(o)->scrolledContentOffset(); |
| 2300 | 2299 |
| 2301 if (offsetDependsOnPoint) | 2300 if (offsetDependsOnPoint) |
| 2302 *offsetDependsOnPoint = o->isLayoutFlowThread(); | 2301 *offsetDependsOnPoint = o->isLayoutFlowThread(); |
| 2303 | 2302 |
| 2304 return offset; | 2303 return offset; |
| 2305 } | 2304 } |
| 2306 | 2305 |
| 2307 LayoutSize LayoutObject::offsetFromAncestorContainer(const LayoutObject* contain
er) const | 2306 LayoutSize LayoutObject::offsetFromAncestorContainer(const LayoutObject* ancesto
rContainer) const |
| 2308 { | 2307 { |
| 2309 if (container == this) | 2308 if (ancestorContainer == this) |
| 2310 return LayoutSize(); | 2309 return LayoutSize(); |
| 2311 | 2310 |
| 2312 LayoutSize offset; | 2311 LayoutSize offset; |
| 2313 LayoutPoint referencePoint; | 2312 LayoutPoint referencePoint; |
| 2314 const LayoutObject* currContainer = this; | 2313 const LayoutObject* currContainer = this; |
| 2315 do { | 2314 do { |
| 2316 const LayoutObject* nextContainer = currContainer->container(); | 2315 const LayoutObject* nextContainer = currContainer->container(); |
| 2317 ASSERT(nextContainer); // This means we reached the top without finding
container. | 2316 ASSERT(nextContainer); // This means we reached the top without finding
container. |
| 2318 if (!nextContainer) | 2317 if (!nextContainer) |
| 2319 break; | 2318 break; |
| 2320 ASSERT(!currContainer->hasTransformRelatedProperty()); | 2319 ASSERT(!currContainer->hasTransformRelatedProperty()); |
| 2321 LayoutSize currentOffset = currContainer->offsetFromContainer(nextContai
ner, referencePoint); | 2320 LayoutSize currentOffset = currContainer->offsetFromContainer(nextContai
ner, referencePoint); |
| 2322 offset += currentOffset; | 2321 offset += currentOffset; |
| 2323 referencePoint.move(currentOffset); | 2322 referencePoint.move(currentOffset); |
| 2324 currContainer = nextContainer; | 2323 currContainer = nextContainer; |
| 2325 } while (currContainer != container); | 2324 } while (currContainer != ancestorContainer); |
| 2326 | 2325 |
| 2327 return offset; | 2326 return offset; |
| 2328 } | 2327 } |
| 2329 | 2328 |
| 2330 LayoutRect LayoutObject::localCaretRect(InlineBox*, int, LayoutUnit* extraWidthT
oEndOfLine) | 2329 LayoutRect LayoutObject::localCaretRect(InlineBox*, int, LayoutUnit* extraWidthT
oEndOfLine) |
| 2331 { | 2330 { |
| 2332 if (extraWidthToEndOfLine) | 2331 if (extraWidthToEndOfLine) |
| 2333 *extraWidthToEndOfLine = 0; | 2332 *extraWidthToEndOfLine = 0; |
| 2334 | 2333 |
| 2335 return LayoutRect(); | 2334 return LayoutRect(); |
| (...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3518 const blink::LayoutObject* root = object1; | 3517 const blink::LayoutObject* root = object1; |
| 3519 while (root->parent()) | 3518 while (root->parent()) |
| 3520 root = root->parent(); | 3519 root = root->parent(); |
| 3521 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3520 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
| 3522 } else { | 3521 } else { |
| 3523 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); | 3522 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); |
| 3524 } | 3523 } |
| 3525 } | 3524 } |
| 3526 | 3525 |
| 3527 #endif | 3526 #endif |
| OLD | NEW |