| 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 14 matching lines...) Expand all Loading... |
| 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 */ | 27 */ |
| 28 | 28 |
| 29 #include "config.h" | 29 #include "config.h" |
| 30 | 30 |
| 31 #include "core/layout/svg/SVGLayoutTreeAsText.h" | 31 #include "core/layout/svg/SVGLayoutTreeAsText.h" |
| 32 | 32 |
| 33 #include "core/layout/LayoutTreeAsText.h" | 33 #include "core/layout/LayoutTreeAsText.h" |
| 34 #include "core/layout/line/InlineTextBox.h" | 34 #include "core/layout/line/InlineTextBox.h" |
| 35 #include "core/layout/svg/LayoutSVGGradientStop.h" |
| 35 #include "core/layout/svg/LayoutSVGImage.h" | 36 #include "core/layout/svg/LayoutSVGImage.h" |
| 36 #include "core/layout/svg/LayoutSVGInlineText.h" | 37 #include "core/layout/svg/LayoutSVGInlineText.h" |
| 37 #include "core/layout/svg/LayoutSVGResourceClipper.h" | 38 #include "core/layout/svg/LayoutSVGResourceClipper.h" |
| 38 #include "core/layout/svg/LayoutSVGResourceFilter.h" | 39 #include "core/layout/svg/LayoutSVGResourceFilter.h" |
| 39 #include "core/layout/svg/LayoutSVGResourceLinearGradient.h" | 40 #include "core/layout/svg/LayoutSVGResourceLinearGradient.h" |
| 40 #include "core/layout/svg/LayoutSVGResourceMarker.h" | 41 #include "core/layout/svg/LayoutSVGResourceMarker.h" |
| 41 #include "core/layout/svg/LayoutSVGResourceMasker.h" | 42 #include "core/layout/svg/LayoutSVGResourceMasker.h" |
| 42 #include "core/layout/svg/LayoutSVGResourcePattern.h" | 43 #include "core/layout/svg/LayoutSVGResourcePattern.h" |
| 43 #include "core/layout/svg/LayoutSVGResourceRadialGradient.h" | 44 #include "core/layout/svg/LayoutSVGResourceRadialGradient.h" |
| 45 #include "core/layout/svg/LayoutSVGRoot.h" |
| 44 #include "core/layout/svg/LayoutSVGShape.h" | 46 #include "core/layout/svg/LayoutSVGShape.h" |
| 45 #include "core/layout/svg/LayoutSVGText.h" | 47 #include "core/layout/svg/LayoutSVGText.h" |
| 46 #include "core/layout/svg/line/SVGInlineTextBox.h" | 48 #include "core/layout/svg/line/SVGInlineTextBox.h" |
| 47 #include "core/layout/svg/line/SVGRootInlineBox.h" | 49 #include "core/layout/svg/line/SVGRootInlineBox.h" |
| 48 #include "core/rendering/svg/RenderSVGGradientStop.h" | |
| 49 #include "core/rendering/svg/RenderSVGRoot.h" | |
| 50 #include "core/svg/LinearGradientAttributes.h" | 50 #include "core/svg/LinearGradientAttributes.h" |
| 51 #include "core/svg/PatternAttributes.h" | 51 #include "core/svg/PatternAttributes.h" |
| 52 #include "core/svg/RadialGradientAttributes.h" | 52 #include "core/svg/RadialGradientAttributes.h" |
| 53 #include "core/svg/SVGCircleElement.h" | 53 #include "core/svg/SVGCircleElement.h" |
| 54 #include "core/svg/SVGEllipseElement.h" | 54 #include "core/svg/SVGEllipseElement.h" |
| 55 #include "core/svg/SVGLineElement.h" | 55 #include "core/svg/SVGLineElement.h" |
| 56 #include "core/svg/SVGLinearGradientElement.h" | 56 #include "core/svg/SVGLinearGradientElement.h" |
| 57 #include "core/svg/SVGPathElement.h" | 57 #include "core/svg/SVGPathElement.h" |
| 58 #include "core/svg/SVGPathUtilities.h" | 58 #include "core/svg/SVGPathUtilities.h" |
| 59 #include "core/svg/SVGPatternElement.h" | 59 #include "core/svg/SVGPatternElement.h" |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 String pathString; | 372 String pathString; |
| 373 // FIXME: We should switch to UnalteredParsing here - this will affect t
he path dumping output of dozens of tests. | 373 // FIXME: We should switch to UnalteredParsing here - this will affect t
he path dumping output of dozens of tests. |
| 374 buildStringFromByteStream(*toSVGPathElement(*svgElement).pathByteStream(
), pathString, NormalizedParsing); | 374 buildStringFromByteStream(*toSVGPathElement(*svgElement).pathByteStream(
), pathString, NormalizedParsing); |
| 375 writeNameAndQuotedValue(ts, "data", pathString); | 375 writeNameAndQuotedValue(ts, "data", pathString); |
| 376 } else { | 376 } else { |
| 377 ASSERT_NOT_REACHED(); | 377 ASSERT_NOT_REACHED(); |
| 378 } | 378 } |
| 379 return ts; | 379 return ts; |
| 380 } | 380 } |
| 381 | 381 |
| 382 static TextStream& operator<<(TextStream& ts, const RenderSVGRoot& root) | 382 static TextStream& operator<<(TextStream& ts, const LayoutSVGRoot& root) |
| 383 { | 383 { |
| 384 return writePositionAndStyle(ts, root); | 384 return writePositionAndStyle(ts, root); |
| 385 } | 385 } |
| 386 | 386 |
| 387 static void writeLayoutSVGTextBox(TextStream& ts, const LayoutSVGText& text) | 387 static void writeLayoutSVGTextBox(TextStream& ts, const LayoutSVGText& text) |
| 388 { | 388 { |
| 389 SVGRootInlineBox* box = toSVGRootInlineBox(text.firstRootBox()); | 389 SVGRootInlineBox* box = toSVGRootInlineBox(text.firstRootBox()); |
| 390 if (!box) | 390 if (!box) |
| 391 return; | 391 return; |
| 392 | 392 |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 // Currently LayoutSVGResourceFilterPrimitive has no meaningful output. | 584 // Currently LayoutSVGResourceFilterPrimitive has no meaningful output. |
| 585 if (container.isSVGResourceFilterPrimitive()) | 585 if (container.isSVGResourceFilterPrimitive()) |
| 586 return; | 586 return; |
| 587 writeStandardPrefix(ts, container, indent); | 587 writeStandardPrefix(ts, container, indent); |
| 588 writePositionAndStyle(ts, container); | 588 writePositionAndStyle(ts, container); |
| 589 ts << "\n"; | 589 ts << "\n"; |
| 590 writeResources(ts, container, indent); | 590 writeResources(ts, container, indent); |
| 591 writeChildren(ts, container, indent); | 591 writeChildren(ts, container, indent); |
| 592 } | 592 } |
| 593 | 593 |
| 594 void write(TextStream& ts, const RenderSVGRoot& root, int indent) | 594 void write(TextStream& ts, const LayoutSVGRoot& root, int indent) |
| 595 { | 595 { |
| 596 writeStandardPrefix(ts, root, indent); | 596 writeStandardPrefix(ts, root, indent); |
| 597 ts << root << "\n"; | 597 ts << root << "\n"; |
| 598 writeChildren(ts, root, indent); | 598 writeChildren(ts, root, indent); |
| 599 } | 599 } |
| 600 | 600 |
| 601 void writeSVGText(TextStream& ts, const LayoutSVGText& text, int indent) | 601 void writeSVGText(TextStream& ts, const LayoutSVGText& text, int indent) |
| 602 { | 602 { |
| 603 writeStandardPrefix(ts, text, indent); | 603 writeStandardPrefix(ts, text, indent); |
| 604 writeLayoutSVGTextBox(ts, text); | 604 writeLayoutSVGTextBox(ts, text); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 623 writeResources(ts, image, indent); | 623 writeResources(ts, image, indent); |
| 624 } | 624 } |
| 625 | 625 |
| 626 void write(TextStream& ts, const LayoutSVGShape& shape, int indent) | 626 void write(TextStream& ts, const LayoutSVGShape& shape, int indent) |
| 627 { | 627 { |
| 628 writeStandardPrefix(ts, shape, indent); | 628 writeStandardPrefix(ts, shape, indent); |
| 629 ts << shape << "\n"; | 629 ts << shape << "\n"; |
| 630 writeResources(ts, shape, indent); | 630 writeResources(ts, shape, indent); |
| 631 } | 631 } |
| 632 | 632 |
| 633 void writeSVGGradientStop(TextStream& ts, const RenderSVGGradientStop& stop, int
indent) | 633 void writeSVGGradientStop(TextStream& ts, const LayoutSVGGradientStop& stop, int
indent) |
| 634 { | 634 { |
| 635 writeStandardPrefix(ts, stop, indent); | 635 writeStandardPrefix(ts, stop, indent); |
| 636 | 636 |
| 637 SVGStopElement* stopElement = toSVGStopElement(stop.node()); | 637 SVGStopElement* stopElement = toSVGStopElement(stop.node()); |
| 638 ASSERT(stopElement); | 638 ASSERT(stopElement); |
| 639 ASSERT(stop.style()); | 639 ASSERT(stop.style()); |
| 640 | 640 |
| 641 ts << " [offset=" << stopElement->offset()->currentValue()->value() << "] [c
olor=" << stopElement->stopColorIncludingOpacity() << "]\n"; | 641 ts << " [offset=" << stopElement->offset()->currentValue()->value() << "] [c
olor=" << stopElement->stopColorIncludingOpacity() << "]\n"; |
| 642 } | 642 } |
| 643 | 643 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 ts << " "; | 675 ts << " "; |
| 676 writeNameAndQuotedValue(ts, "filter", svgStyle.filterResource()); | 676 writeNameAndQuotedValue(ts, "filter", svgStyle.filterResource()); |
| 677 ts << " "; | 677 ts << " "; |
| 678 writeStandardPrefix(ts, *filter, 0); | 678 writeStandardPrefix(ts, *filter, 0); |
| 679 ts << " " << filter->resourceBoundingBox(&renderer) << "\n"; | 679 ts << " " << filter->resourceBoundingBox(&renderer) << "\n"; |
| 680 } | 680 } |
| 681 } | 681 } |
| 682 } | 682 } |
| 683 | 683 |
| 684 } // namespace blink | 684 } // namespace blink |
| OLD | NEW |