OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2007, 2008, 2009 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2007, 2008, 2009 Rob Buis <buis@kde.org> |
4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> |
5 * Copyright (C) 2009 Google, Inc. | 5 * Copyright (C) 2009 Google, Inc. |
6 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 // If the box is decorated or is overflowing, extend it to include the borde
r-box and overflow. | 330 // If the box is decorated or is overflowing, extend it to include the borde
r-box and overflow. |
331 if (m_hasBoxDecorationBackground || hasOverflowModel()) { | 331 if (m_hasBoxDecorationBackground || hasOverflowModel()) { |
332 // The selectionRect can project outside of the overflowRect, so take th
eir union | 332 // The selectionRect can project outside of the overflowRect, so take th
eir union |
333 // for paint invalidation to avoid selection painting glitches. | 333 // for paint invalidation to avoid selection painting glitches. |
334 LayoutRect decoratedPaintInvalidationRect = unionRect(localSelectionRect
(), visualOverflowRect()); | 334 LayoutRect decoratedPaintInvalidationRect = unionRect(localSelectionRect
(), visualOverflowRect()); |
335 paintInvalidationRect.unite(decoratedPaintInvalidationRect); | 335 paintInvalidationRect.unite(decoratedPaintInvalidationRect); |
336 } | 336 } |
337 | 337 |
338 // Compute the paint invalidation rect in the parent coordinate space. | 338 // Compute the paint invalidation rect in the parent coordinate space. |
339 LayoutRect rect(enclosingIntRect(paintInvalidationRect)); | 339 LayoutRect rect(enclosingIntRect(paintInvalidationRect)); |
340 LayoutReplaced::mapToVisibleRectInContainerSpace(paintInvalidationContainer,
rect, paintInvalidationState); | 340 LayoutReplaced::mapToVisibleRectInAncestorSpace(paintInvalidationContainer,
rect, paintInvalidationState); |
341 return rect; | 341 return rect; |
342 } | 342 } |
343 | 343 |
344 void LayoutSVGRoot::mapToVisibleRectInContainerSpace(const LayoutBoxModelObject*
paintInvalidationContainer, LayoutRect& rect, const PaintInvalidationState* pai
ntInvalidationState) const | 344 void LayoutSVGRoot::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject*
ancestor, LayoutRect& rect, const PaintInvalidationState* paintInvalidationState
) const |
345 { | 345 { |
346 // Note that we don't apply the border-box transform here - it's assumed | 346 // Note that we don't apply the border-box transform here - it's assumed |
347 // that whoever called us has done that already. | 347 // that whoever called us has done that already. |
348 | 348 |
349 // Apply initial viewport clip | 349 // Apply initial viewport clip |
350 if (shouldApplyViewportClip()) | 350 if (shouldApplyViewportClip()) |
351 rect.intersect(LayoutRect(pixelSnappedBorderBoxRect())); | 351 rect.intersect(LayoutRect(pixelSnappedBorderBoxRect())); |
352 | 352 |
353 LayoutReplaced::mapToVisibleRectInContainerSpace(paintInvalidationContainer,
rect, paintInvalidationState); | 353 LayoutReplaced::mapToVisibleRectInAncestorSpace(ancestor, rect, paintInvalid
ationState); |
354 } | 354 } |
355 | 355 |
356 // This method expects local CSS box coordinates. | 356 // This method expects local CSS box coordinates. |
357 // Callers with local SVG viewport coordinates should first apply the localToBor
derBoxTransform | 357 // Callers with local SVG viewport coordinates should first apply the localToBor
derBoxTransform |
358 // to convert from SVG viewport coordinates to local CSS box coordinates. | 358 // to convert from SVG viewport coordinates to local CSS box coordinates. |
359 void LayoutSVGRoot::mapLocalToContainer(const LayoutBoxModelObject* paintInvalid
ationContainer, TransformState& transformState, MapCoordinatesFlags mode, bool*
wasFixed, const PaintInvalidationState* paintInvalidationState) const | 359 void LayoutSVGRoot::mapLocalToAncestor(const LayoutBoxModelObject* ancestor, Tra
nsformState& transformState, MapCoordinatesFlags mode, bool* wasFixed, const Pai
ntInvalidationState* paintInvalidationState) const |
360 { | 360 { |
361 ASSERT(mode & ~IsFixed); // We should have no fixed content in the SVG layou
t tree. | 361 ASSERT(mode & ~IsFixed); // We should have no fixed content in the SVG layou
t tree. |
362 | 362 |
363 LayoutReplaced::mapLocalToContainer(paintInvalidationContainer, transformSta
te, mode | ApplyContainerFlip, wasFixed, paintInvalidationState); | 363 LayoutReplaced::mapLocalToAncestor(ancestor, transformState, mode | ApplyCon
tainerFlip, wasFixed, paintInvalidationState); |
364 } | 364 } |
365 | 365 |
366 const LayoutObject* LayoutSVGRoot::pushMappingToContainer(const LayoutBoxModelOb
ject* ancestorToStopAt, LayoutGeometryMap& geometryMap) const | 366 const LayoutObject* LayoutSVGRoot::pushMappingToContainer(const LayoutBoxModelOb
ject* ancestorToStopAt, LayoutGeometryMap& geometryMap) const |
367 { | 367 { |
368 return LayoutReplaced::pushMappingToContainer(ancestorToStopAt, geometryMap)
; | 368 return LayoutReplaced::pushMappingToContainer(ancestorToStopAt, geometryMap)
; |
369 } | 369 } |
370 | 370 |
371 void LayoutSVGRoot::updateCachedBoundaries() | 371 void LayoutSVGRoot::updateCachedBoundaries() |
372 { | 372 { |
373 SVGLayoutSupport::computeContainerBoundingBoxes(this, m_objectBoundingBox, m
_objectBoundingBoxValid, m_strokeBoundingBox, m_paintInvalidationBoundingBox); | 373 SVGLayoutSupport::computeContainerBoundingBoxes(this, m_objectBoundingBox, m
_objectBoundingBoxValid, m_strokeBoundingBox, m_paintInvalidationBoundingBox); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 updateHitTestResult(result, pointInBorderBox); | 409 updateHitTestResult(result, pointInBorderBox); |
410 if (!result.addNodeToListBasedTestResult(node(), locationInContainer
, boundsRect)) | 410 if (!result.addNodeToListBasedTestResult(node(), locationInContainer
, boundsRect)) |
411 return true; | 411 return true; |
412 } | 412 } |
413 } | 413 } |
414 | 414 |
415 return false; | 415 return false; |
416 } | 416 } |
417 | 417 |
418 } | 418 } |
OLD | NEW |