OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008 Rob Buis <buis@kde.org> | 2 * Copyright (C) 2007, 2008 Rob Buis <buis@kde.org> |
3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> | 3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@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 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. | 7 * Copyright (C) Research In Motion Limited 2009-2010. 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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 } | 363 } |
364 | 364 |
365 bool SVGLayoutSupport::hasFilterResource(const LayoutObject& object) | 365 bool SVGLayoutSupport::hasFilterResource(const LayoutObject& object) |
366 { | 366 { |
367 SVGResources* resources = SVGResourcesCache::cachedResourcesForLayoutObject(
&object); | 367 SVGResources* resources = SVGResourcesCache::cachedResourcesForLayoutObject(
&object); |
368 return resources && resources->filter(); | 368 return resources && resources->filter(); |
369 } | 369 } |
370 | 370 |
371 bool SVGLayoutSupport::pointInClippingArea(const LayoutObject& object, const Flo
atPoint& point) | 371 bool SVGLayoutSupport::pointInClippingArea(const LayoutObject& object, const Flo
atPoint& point) |
372 { | 372 { |
373 ClipPathOperation* clipPathOperation = object.styleRef().svgStyle().clipPath
(); | 373 ClipPathOperation* clipPathOperation = object.styleRef().clipPath(); |
374 if (!clipPathOperation) | 374 if (!clipPathOperation) |
375 return true; | 375 return true; |
376 if (clipPathOperation->type() == ClipPathOperation::SHAPE) { | 376 if (clipPathOperation->type() == ClipPathOperation::SHAPE) { |
377 ShapeClipPathOperation& clipPath = toShapeClipPathOperation(*clipPathOpe
ration); | 377 ShapeClipPathOperation& clipPath = toShapeClipPathOperation(*clipPathOpe
ration); |
378 return clipPath.path(object.objectBoundingBox()).contains(point); | 378 return clipPath.path(object.objectBoundingBox()).contains(point); |
379 } | 379 } |
380 DCHECK_EQ(clipPathOperation->type(), ClipPathOperation::REFERENCE); | 380 DCHECK_EQ(clipPathOperation->type(), ClipPathOperation::REFERENCE); |
381 SVGResources* resources = SVGResourcesCache::cachedResourcesForLayoutObject(
&object); | 381 SVGResources* resources = SVGResourcesCache::cachedResourcesForLayoutObject(
&object); |
382 if (!resources || !resources->clipper()) | 382 if (!resources || !resources->clipper()) |
383 return true; | 383 return true; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 ASSERT(object->isText()); | 430 ASSERT(object->isText()); |
431 // <br> is marked as text, but is not handled by the SVG layout code-path. | 431 // <br> is marked as text, but is not handled by the SVG layout code-path. |
432 return object->isSVGInlineText() && !toLayoutSVGInlineText(object)->hasEmpty
Text(); | 432 return object->isSVGInlineText() && !toLayoutSVGInlineText(object)->hasEmpty
Text(); |
433 } | 433 } |
434 | 434 |
435 bool SVGLayoutSupport::willIsolateBlendingDescendantsForStyle(const ComputedStyl
e& style) | 435 bool SVGLayoutSupport::willIsolateBlendingDescendantsForStyle(const ComputedStyl
e& style) |
436 { | 436 { |
437 const SVGComputedStyle& svgStyle = style.svgStyle(); | 437 const SVGComputedStyle& svgStyle = style.svgStyle(); |
438 | 438 |
439 return style.hasIsolation() || style.opacity() < 1 || style.hasBlendMode() | 439 return style.hasIsolation() || style.opacity() < 1 || style.hasBlendMode() |
440 || style.hasFilter() || svgStyle.hasMasker() || svgStyle.clipPath(); | 440 || style.hasFilter() || svgStyle.hasMasker() || style.clipPath(); |
441 } | 441 } |
442 | 442 |
443 bool SVGLayoutSupport::willIsolateBlendingDescendantsForObject(const LayoutObjec
t* object) | 443 bool SVGLayoutSupport::willIsolateBlendingDescendantsForObject(const LayoutObjec
t* object) |
444 { | 444 { |
445 if (object->isSVGHiddenContainer()) | 445 if (object->isSVGHiddenContainer()) |
446 return false; | 446 return false; |
447 if (!object->isSVGRoot() && !object->isSVGContainer()) | 447 if (!object->isSVGRoot() && !object->isSVGContainer()) |
448 return false; | 448 return false; |
449 return willIsolateBlendingDescendantsForStyle(object->styleRef()); | 449 return willIsolateBlendingDescendantsForStyle(object->styleRef()); |
450 } | 450 } |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 | 576 |
577 return closestText; | 577 return closestText; |
578 } | 578 } |
579 | 579 |
580 LayoutObject* SVGLayoutSupport::findClosestLayoutSVGText(LayoutObject* layoutObj
ect, const FloatPoint& point) | 580 LayoutObject* SVGLayoutSupport::findClosestLayoutSVGText(LayoutObject* layoutObj
ect, const FloatPoint& point) |
581 { | 581 { |
582 return searchTreeForFindClosestLayoutSVGText(layoutObject, point).candidateL
ayoutObject; | 582 return searchTreeForFindClosestLayoutSVGText(layoutObject, point).candidateL
ayoutObject; |
583 } | 583 } |
584 | 584 |
585 } // namespace blink | 585 } // namespace blink |
OLD | NEW |