| 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 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2007, 2008 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. All rights reserved. | 5 * Copyright (C) 2009 Google, Inc. All rights reserved. |
| 6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> | 6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> |
| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 updateCachedBoundaries(); | 67 updateCachedBoundaries(); |
| 68 m_needsBoundariesUpdate = false; | 68 m_needsBoundariesUpdate = false; |
| 69 | 69 |
| 70 // If our bounds changed, notify the parents. | 70 // If our bounds changed, notify the parents. |
| 71 RenderSVGModelObject::setNeedsBoundariesUpdate(); | 71 RenderSVGModelObject::setNeedsBoundariesUpdate(); |
| 72 } | 72 } |
| 73 | 73 |
| 74 clearNeedsLayout(); | 74 clearNeedsLayout(); |
| 75 } | 75 } |
| 76 | 76 |
| 77 void RenderSVGContainer::addChild(RenderObject* child, RenderObject* beforeChild
) | 77 void RenderSVGContainer::addChild(LayoutObject* child, LayoutObject* beforeChild
) |
| 78 { | 78 { |
| 79 RenderSVGModelObject::addChild(child, beforeChild); | 79 RenderSVGModelObject::addChild(child, beforeChild); |
| 80 SVGResourcesCache::clientWasAddedToTree(child, child->style()); | 80 SVGResourcesCache::clientWasAddedToTree(child, child->style()); |
| 81 | 81 |
| 82 bool shouldIsolateDescendants = (child->isBlendingAllowed() && child->style(
)->hasBlendMode()) || child->hasNonIsolatedBlendingDescendants(); | 82 bool shouldIsolateDescendants = (child->isBlendingAllowed() && child->style(
)->hasBlendMode()) || child->hasNonIsolatedBlendingDescendants(); |
| 83 if (shouldIsolateDescendants) | 83 if (shouldIsolateDescendants) |
| 84 descendantIsolationRequirementsChanged(DescendantIsolationRequired); | 84 descendantIsolationRequirementsChanged(DescendantIsolationRequired); |
| 85 } | 85 } |
| 86 | 86 |
| 87 void RenderSVGContainer::removeChild(RenderObject* child) | 87 void RenderSVGContainer::removeChild(LayoutObject* child) |
| 88 { | 88 { |
| 89 SVGResourcesCache::clientWillBeRemovedFromTree(child); | 89 SVGResourcesCache::clientWillBeRemovedFromTree(child); |
| 90 RenderSVGModelObject::removeChild(child); | 90 RenderSVGModelObject::removeChild(child); |
| 91 | 91 |
| 92 bool hadNonIsolatedDescendants = (child->isBlendingAllowed() && child->style
()->hasBlendMode()) || child->hasNonIsolatedBlendingDescendants(); | 92 bool hadNonIsolatedDescendants = (child->isBlendingAllowed() && child->style
()->hasBlendMode()) || child->hasNonIsolatedBlendingDescendants(); |
| 93 if (hadNonIsolatedDescendants) | 93 if (hadNonIsolatedDescendants) |
| 94 descendantIsolationRequirementsChanged(DescendantIsolationNeedsUpdate); | 94 descendantIsolationRequirementsChanged(DescendantIsolationNeedsUpdate); |
| 95 } | 95 } |
| 96 | 96 |
| 97 bool RenderSVGContainer::selfWillPaint() | 97 bool RenderSVGContainer::selfWillPaint() |
| 98 { | 98 { |
| 99 SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(
this); | 99 SVGResources* resources = SVGResourcesCache::cachedResourcesForLayoutObject(
this); |
| 100 return resources && resources->filter(); | 100 return resources && resources->filter(); |
| 101 } | 101 } |
| 102 | 102 |
| 103 void RenderSVGContainer::styleDidChange(StyleDifference diff, const RenderStyle*
oldStyle) | 103 void RenderSVGContainer::styleDidChange(StyleDifference diff, const RenderStyle*
oldStyle) |
| 104 { | 104 { |
| 105 RenderSVGModelObject::styleDidChange(diff, oldStyle); | 105 RenderSVGModelObject::styleDidChange(diff, oldStyle); |
| 106 | 106 |
| 107 bool hadIsolation = oldStyle && !isSVGHiddenContainer() && SVGRenderSupport:
:willIsolateBlendingDescendantsForStyle(oldStyle); | 107 bool hadIsolation = oldStyle && !isSVGHiddenContainer() && SVGRenderSupport:
:willIsolateBlendingDescendantsForStyle(oldStyle); |
| 108 bool isolationChanged = hadIsolation == !SVGRenderSupport::willIsolateBlendi
ngDescendantsForObject(this); | 108 bool isolationChanged = hadIsolation == !SVGRenderSupport::willIsolateBlendi
ngDescendantsForObject(this); |
| 109 | 109 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 bool RenderSVGContainer::nodeAtFloatPoint(const HitTestRequest& request, HitTest
Result& result, const FloatPoint& pointInParent, HitTestAction hitTestAction) | 163 bool RenderSVGContainer::nodeAtFloatPoint(const HitTestRequest& request, HitTest
Result& result, const FloatPoint& pointInParent, HitTestAction hitTestAction) |
| 164 { | 164 { |
| 165 // Give RenderSVGViewportContainer a chance to apply its viewport clip | 165 // Give RenderSVGViewportContainer a chance to apply its viewport clip |
| 166 if (!pointIsInsideViewportClip(pointInParent)) | 166 if (!pointIsInsideViewportClip(pointInParent)) |
| 167 return false; | 167 return false; |
| 168 | 168 |
| 169 FloatPoint localPoint; | 169 FloatPoint localPoint; |
| 170 if (!SVGRenderSupport::transformToUserSpaceAndCheckClipping(this, localToPar
entTransform(), pointInParent, localPoint)) | 170 if (!SVGRenderSupport::transformToUserSpaceAndCheckClipping(this, localToPar
entTransform(), pointInParent, localPoint)) |
| 171 return false; | 171 return false; |
| 172 | 172 |
| 173 for (RenderObject* child = lastChild(); child; child = child->previousSiblin
g()) { | 173 for (LayoutObject* child = lastChild(); child; child = child->previousSiblin
g()) { |
| 174 if (child->nodeAtFloatPoint(request, result, localPoint, hitTestAction))
{ | 174 if (child->nodeAtFloatPoint(request, result, localPoint, hitTestAction))
{ |
| 175 updateHitTestResult(result, roundedLayoutPoint(localPoint)); | 175 updateHitTestResult(result, roundedLayoutPoint(localPoint)); |
| 176 return true; | 176 return true; |
| 177 } | 177 } |
| 178 } | 178 } |
| 179 | 179 |
| 180 // pointer-events=boundingBox makes it possible for containers to be direct
targets | 180 // pointer-events=boundingBox makes it possible for containers to be direct
targets |
| 181 if (style()->pointerEvents() == PE_BOUNDINGBOX) { | 181 if (style()->pointerEvents() == PE_BOUNDINGBOX) { |
| 182 ASSERT(isObjectBoundingBoxValid()); | 182 ASSERT(isObjectBoundingBoxValid()); |
| 183 if (objectBoundingBox().contains(localPoint)) { | 183 if (objectBoundingBox().contains(localPoint)) { |
| 184 updateHitTestResult(result, roundedLayoutPoint(localPoint)); | 184 updateHitTestResult(result, roundedLayoutPoint(localPoint)); |
| 185 return true; | 185 return true; |
| 186 } | 186 } |
| 187 } | 187 } |
| 188 // 16.4: "If there are no graphics elements whose relevant graphics content
is under the pointer (i.e., there is no target element), the event is not dispat
ched." | 188 // 16.4: "If there are no graphics elements whose relevant graphics content
is under the pointer (i.e., there is no target element), the event is not dispat
ched." |
| 189 return false; | 189 return false; |
| 190 } | 190 } |
| 191 | 191 |
| 192 } | 192 } |
| OLD | NEW |