Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(497)

Side by Side Diff: Source/core/layout/svg/SVGLayoutTreeAsText.cpp

Issue 1033943002: Rename LayoutStyle to papayawhip (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: ensureComputedStyle Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/layout/svg/SVGLayoutSupport.cpp ('k') | Source/core/layout/svg/SVGPathData.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 else if (paintServerContainer->resourceType() == LinearGradientResourceType) 263 else if (paintServerContainer->resourceType() == LinearGradientResourceType)
264 ts << "[type=LINEAR-GRADIENT]"; 264 ts << "[type=LINEAR-GRADIENT]";
265 else if (paintServerContainer->resourceType() == RadialGradientResourceType) 265 else if (paintServerContainer->resourceType() == RadialGradientResourceType)
266 ts << "[type=RADIAL-GRADIENT]"; 266 ts << "[type=RADIAL-GRADIENT]";
267 267
268 ts << " [id=\"" << element->getIdAttribute() << "\"]"; 268 ts << " [id=\"" << element->getIdAttribute() << "\"]";
269 } 269 }
270 270
271 static void writeStyle(TextStream& ts, const LayoutObject& object) 271 static void writeStyle(TextStream& ts, const LayoutObject& object)
272 { 272 {
273 const LayoutStyle& style = object.styleRef(); 273 const ComputedStyle& style = object.styleRef();
274 const SVGLayoutStyle& svgStyle = style.svgStyle(); 274 const SVGComputedStyle& svgStyle = style.svgStyle();
275 275
276 if (!object.localTransform().isIdentity()) 276 if (!object.localTransform().isIdentity())
277 writeNameValuePair(ts, "transform", object.localTransform()); 277 writeNameValuePair(ts, "transform", object.localTransform());
278 writeIfNotDefault(ts, "image rendering", style.imageRendering(), LayoutStyle ::initialImageRendering()); 278 writeIfNotDefault(ts, "image rendering", style.imageRendering(), ComputedSty le::initialImageRendering());
279 writeIfNotDefault(ts, "opacity", style.opacity(), LayoutStyle::initialOpacit y()); 279 writeIfNotDefault(ts, "opacity", style.opacity(), ComputedStyle::initialOpac ity());
280 if (object.isSVGShape()) { 280 if (object.isSVGShape()) {
281 const LayoutSVGShape& shape = static_cast<const LayoutSVGShape&>(object) ; 281 const LayoutSVGShape& shape = static_cast<const LayoutSVGShape&>(object) ;
282 ASSERT(shape.element()); 282 ASSERT(shape.element());
283 283
284 SVGPaintDescription strokePaintDescription = LayoutSVGResourcePaintServe r::requestPaintDescription(shape, shape.styleRef(), ApplyToStrokeMode); 284 SVGPaintDescription strokePaintDescription = LayoutSVGResourcePaintServe r::requestPaintDescription(shape, shape.styleRef(), ApplyToStrokeMode);
285 if (strokePaintDescription.isValid) { 285 if (strokePaintDescription.isValid) {
286 TextStreamSeparator s(" "); 286 TextStreamSeparator s(" ");
287 ts << " [stroke={" << s; 287 ts << " [stroke={" << s;
288 writeSVGPaintingResource(ts, strokePaintDescription); 288 writeSVGPaintingResource(ts, strokePaintDescription);
289 289
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 } 394 }
395 395
396 static inline void writeSVGInlineTextBox(TextStream& ts, SVGInlineTextBox* textB ox, int indent) 396 static inline void writeSVGInlineTextBox(TextStream& ts, SVGInlineTextBox* textB ox, int indent)
397 { 397 {
398 Vector<SVGTextFragment>& fragments = textBox->textFragments(); 398 Vector<SVGTextFragment>& fragments = textBox->textFragments();
399 if (fragments.isEmpty()) 399 if (fragments.isEmpty())
400 return; 400 return;
401 401
402 LayoutSVGInlineText& textLayoutObject = toLayoutSVGInlineText(textBox->layou tObject()); 402 LayoutSVGInlineText& textLayoutObject = toLayoutSVGInlineText(textBox->layou tObject());
403 403
404 const SVGLayoutStyle& svgStyle = textLayoutObject.style()->svgStyle(); 404 const SVGComputedStyle& svgStyle = textLayoutObject.style()->svgStyle();
405 String text = textBox->layoutObject().text(); 405 String text = textBox->layoutObject().text();
406 406
407 unsigned fragmentsSize = fragments.size(); 407 unsigned fragmentsSize = fragments.size();
408 for (unsigned i = 0; i < fragmentsSize; ++i) { 408 for (unsigned i = 0; i < fragmentsSize; ++i) {
409 SVGTextFragment& fragment = fragments.at(i); 409 SVGTextFragment& fragment = fragments.at(i);
410 writeIndent(ts, indent + 1); 410 writeIndent(ts, indent + 1);
411 411
412 unsigned startOffset = fragment.characterOffset; 412 unsigned startOffset = fragment.characterOffset;
413 unsigned endOffset = fragment.characterOffset + fragment.length; 413 unsigned endOffset = fragment.characterOffset + fragment.length;
414 414
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 630
631 SVGStopElement* stopElement = toSVGStopElement(stop.node()); 631 SVGStopElement* stopElement = toSVGStopElement(stop.node());
632 ASSERT(stopElement); 632 ASSERT(stopElement);
633 ASSERT(stop.style()); 633 ASSERT(stop.style());
634 634
635 ts << " [offset=" << stopElement->offset()->currentValue()->value() << "] [c olor=" << stopElement->stopColorIncludingOpacity() << "]\n"; 635 ts << " [offset=" << stopElement->offset()->currentValue()->value() << "] [c olor=" << stopElement->stopColorIncludingOpacity() << "]\n";
636 } 636 }
637 637
638 void writeResources(TextStream& ts, const LayoutObject& object, int indent) 638 void writeResources(TextStream& ts, const LayoutObject& object, int indent)
639 { 639 {
640 const LayoutStyle& style = object.styleRef(); 640 const ComputedStyle& style = object.styleRef();
641 const SVGLayoutStyle& svgStyle = style.svgStyle(); 641 const SVGComputedStyle& svgStyle = style.svgStyle();
642 642
643 // FIXME: We want to use SVGResourcesCache to determine which resources are present, instead of quering the resource <-> id cache. 643 // FIXME: We want to use SVGResourcesCache to determine which resources are present, instead of quering the resource <-> id cache.
644 // For now leave the DRT output as is, but later on we should change this so cycles are properly ignored in the DRT output. 644 // For now leave the DRT output as is, but later on we should change this so cycles are properly ignored in the DRT output.
645 LayoutObject& layoutObject = const_cast<LayoutObject&>(object); 645 LayoutObject& layoutObject = const_cast<LayoutObject&>(object);
646 if (!svgStyle.maskerResource().isEmpty()) { 646 if (!svgStyle.maskerResource().isEmpty()) {
647 if (LayoutSVGResourceMasker* masker = getLayoutSVGResourceById<LayoutSVG ResourceMasker>(object.document(), svgStyle.maskerResource())) { 647 if (LayoutSVGResourceMasker* masker = getLayoutSVGResourceById<LayoutSVG ResourceMasker>(object.document(), svgStyle.maskerResource())) {
648 writeIndent(ts, indent); 648 writeIndent(ts, indent);
649 ts << " "; 649 ts << " ";
650 writeNameAndQuotedValue(ts, "masker", svgStyle.maskerResource()); 650 writeNameAndQuotedValue(ts, "masker", svgStyle.maskerResource());
651 ts << " "; 651 ts << " ";
(...skipping 17 matching lines...) Expand all
669 ts << " "; 669 ts << " ";
670 writeNameAndQuotedValue(ts, "filter", svgStyle.filterResource()); 670 writeNameAndQuotedValue(ts, "filter", svgStyle.filterResource());
671 ts << " "; 671 ts << " ";
672 writeStandardPrefix(ts, *filter, 0); 672 writeStandardPrefix(ts, *filter, 0);
673 ts << " " << filter->resourceBoundingBox(&layoutObject) << "\n"; 673 ts << " " << filter->resourceBoundingBox(&layoutObject) << "\n";
674 } 674 }
675 } 675 }
676 } 676 }
677 677
678 } // namespace blink 678 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/svg/SVGLayoutSupport.cpp ('k') | Source/core/layout/svg/SVGPathData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698