| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2007, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2005, 2007, 2009 Apple Inc. All rights reserved. |
| 3 * (C) 2005 Rob Buis <buis@kde.org> | 3 * (C) 2005 Rob Buis <buis@kde.org> |
| 4 * (C) 2006 Alexander Kellett <lypanov@kde.org> | 4 * (C) 2006 Alexander Kellett <lypanov@kde.org> |
| 5 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 5 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 6 * | 6 * |
| 7 * Redistribution and use in source and binary forms, with or without | 7 * Redistribution and use in source and binary forms, with or without |
| 8 * modification, are permitted provided that the following conditions | 8 * modification, are permitted provided that the following conditions |
| 9 * are met: | 9 * are met: |
| 10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
| (...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 ts << " [offset=" << stopElement->offset()->currentValue()->value() << "] [c
olor=" << stopElement->stopColorIncludingOpacity() << "]\n"; | 632 ts << " [offset=" << stopElement->offset()->currentValue()->value() << "] [c
olor=" << stopElement->stopColorIncludingOpacity() << "]\n"; |
| 633 } | 633 } |
| 634 | 634 |
| 635 void writeResources(TextStream& ts, const LayoutObject& object, int indent) | 635 void writeResources(TextStream& ts, const LayoutObject& object, int indent) |
| 636 { | 636 { |
| 637 const ComputedStyle& style = object.styleRef(); | 637 const ComputedStyle& style = object.styleRef(); |
| 638 const SVGComputedStyle& svgStyle = style.svgStyle(); | 638 const SVGComputedStyle& svgStyle = style.svgStyle(); |
| 639 | 639 |
| 640 // FIXME: We want to use SVGResourcesCache to determine which resources are
present, instead of quering the resource <-> id cache. | 640 // FIXME: We want to use SVGResourcesCache to determine which resources are
present, instead of quering the resource <-> id cache. |
| 641 // For now leave the DRT output as is, but later on we should change this so
cycles are properly ignored in the DRT output. | 641 // For now leave the DRT output as is, but later on we should change this so
cycles are properly ignored in the DRT output. |
| 642 LayoutObject& layoutObject = const_cast<LayoutObject&>(object); | |
| 643 if (!svgStyle.maskerResource().isEmpty()) { | 642 if (!svgStyle.maskerResource().isEmpty()) { |
| 644 if (LayoutSVGResourceMasker* masker = getLayoutSVGResourceById<LayoutSVG
ResourceMasker>(object.document(), svgStyle.maskerResource())) { | 643 if (LayoutSVGResourceMasker* masker = getLayoutSVGResourceById<LayoutSVG
ResourceMasker>(object.document(), svgStyle.maskerResource())) { |
| 645 writeIndent(ts, indent); | 644 writeIndent(ts, indent); |
| 646 ts << " "; | 645 ts << " "; |
| 647 writeNameAndQuotedValue(ts, "masker", svgStyle.maskerResource()); | 646 writeNameAndQuotedValue(ts, "masker", svgStyle.maskerResource()); |
| 648 ts << " "; | 647 ts << " "; |
| 649 writeStandardPrefix(ts, *masker, 0); | 648 writeStandardPrefix(ts, *masker, 0); |
| 650 ts << " " << masker->resourceBoundingBox(&layoutObject) << "\n"; | 649 ts << " " << masker->resourceBoundingBox(&object) << "\n"; |
| 651 } | 650 } |
| 652 } | 651 } |
| 653 if (!svgStyle.clipperResource().isEmpty()) { | 652 if (!svgStyle.clipperResource().isEmpty()) { |
| 654 if (LayoutSVGResourceClipper* clipper = getLayoutSVGResourceById<LayoutS
VGResourceClipper>(object.document(), svgStyle.clipperResource())) { | 653 if (LayoutSVGResourceClipper* clipper = getLayoutSVGResourceById<LayoutS
VGResourceClipper>(object.document(), svgStyle.clipperResource())) { |
| 655 writeIndent(ts, indent); | 654 writeIndent(ts, indent); |
| 656 ts << " "; | 655 ts << " "; |
| 657 writeNameAndQuotedValue(ts, "clipPath", svgStyle.clipperResource()); | 656 writeNameAndQuotedValue(ts, "clipPath", svgStyle.clipperResource()); |
| 658 ts << " "; | 657 ts << " "; |
| 659 writeStandardPrefix(ts, *clipper, 0); | 658 writeStandardPrefix(ts, *clipper, 0); |
| 660 ts << " " << clipper->resourceBoundingBox(&layoutObject) << "\n"; | 659 ts << " " << clipper->resourceBoundingBox(object.objectBoundingBox()
) << "\n"; |
| 661 } | 660 } |
| 662 } | 661 } |
| 663 if (style.hasFilter()) { | 662 if (style.hasFilter()) { |
| 664 const FilterOperations& filterOperations = style.filter(); | 663 const FilterOperations& filterOperations = style.filter(); |
| 665 if (filterOperations.size() == 1) { | 664 if (filterOperations.size() == 1) { |
| 666 const FilterOperation& filterOperation = *filterOperations.at(0); | 665 const FilterOperation& filterOperation = *filterOperations.at(0); |
| 667 if (filterOperation.type() == FilterOperation::REFERENCE) { | 666 if (filterOperation.type() == FilterOperation::REFERENCE) { |
| 668 const auto& referenceFilterOperation = toReferenceFilterOperatio
n(filterOperation); | 667 const auto& referenceFilterOperation = toReferenceFilterOperatio
n(filterOperation); |
| 669 AtomicString id = SVGURIReference::fragmentIdentifierFromIRIStri
ng(referenceFilterOperation.url(), object.document()); | 668 AtomicString id = SVGURIReference::fragmentIdentifierFromIRIStri
ng(referenceFilterOperation.url(), object.document()); |
| 670 if (LayoutSVGResourceFilter* filter = getLayoutSVGResourceById<L
ayoutSVGResourceFilter>(object.document(), id)) { | 669 if (LayoutSVGResourceFilter* filter = getLayoutSVGResourceById<L
ayoutSVGResourceFilter>(object.document(), id)) { |
| 671 writeIndent(ts, indent); | 670 writeIndent(ts, indent); |
| 672 ts << " "; | 671 ts << " "; |
| 673 writeNameAndQuotedValue(ts, "filter", id); | 672 writeNameAndQuotedValue(ts, "filter", id); |
| 674 ts << " "; | 673 ts << " "; |
| 675 writeStandardPrefix(ts, *filter, 0); | 674 writeStandardPrefix(ts, *filter, 0); |
| 676 ts << " " << filter->resourceBoundingBox(&layoutObject) << "
\n"; | 675 ts << " " << filter->resourceBoundingBox(&object) << "\n"; |
| 677 } | 676 } |
| 678 } | 677 } |
| 679 } | 678 } |
| 680 } | 679 } |
| 681 } | 680 } |
| 682 | 681 |
| 683 } // namespace blink | 682 } // namespace blink |
| OLD | NEW |