| 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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 element.ry()->currentValue()->value(lengthContext)); | 372 element.ry()->currentValue()->value(lengthContext)); |
| 373 } else if (isSVGCircleElement(*svgElement)) { | 373 } else if (isSVGCircleElement(*svgElement)) { |
| 374 SVGCircleElement& element = toSVGCircleElement(*svgElement); | 374 SVGCircleElement& element = toSVGCircleElement(*svgElement); |
| 375 writeNameValuePair(ts, "cx", | 375 writeNameValuePair(ts, "cx", |
| 376 element.cx()->currentValue()->value(lengthContext)); | 376 element.cx()->currentValue()->value(lengthContext)); |
| 377 writeNameValuePair(ts, "cy", | 377 writeNameValuePair(ts, "cy", |
| 378 element.cy()->currentValue()->value(lengthContext)); | 378 element.cy()->currentValue()->value(lengthContext)); |
| 379 writeNameValuePair(ts, "r", | 379 writeNameValuePair(ts, "r", |
| 380 element.r()->currentValue()->value(lengthContext)); | 380 element.r()->currentValue()->value(lengthContext)); |
| 381 } else if (isSVGPolyElement(*svgElement)) { | 381 } else if (isSVGPolyElement(*svgElement)) { |
| 382 writeNameAndQuotedValue(ts, "points", toSVGPolyElement(*svgElement) | 382 writeNameAndQuotedValue(ts, "points", |
| 383 .points() | 383 toSVGPolyElement(*svgElement) |
| 384 ->currentValue() | 384 .points() |
| 385 ->valueAsString()); | 385 ->currentValue() |
| 386 ->valueAsString()); |
| 386 } else if (isSVGPathElement(*svgElement)) { | 387 } else if (isSVGPathElement(*svgElement)) { |
| 387 writeNameAndQuotedValue( | 388 writeNameAndQuotedValue( |
| 388 ts, "data", | 389 ts, "data", |
| 389 toSVGPathElement(*svgElement).path()->currentValue()->valueAsString()); | 390 toSVGPathElement(*svgElement).path()->currentValue()->valueAsString()); |
| 390 } else { | 391 } else { |
| 391 ASSERT_NOT_REACHED(); | 392 ASSERT_NOT_REACHED(); |
| 392 } | 393 } |
| 393 return ts; | 394 return ts; |
| 394 } | 395 } |
| 395 | 396 |
| 396 static TextStream& operator<<(TextStream& ts, const LayoutSVGRoot& root) { | 397 static TextStream& operator<<(TextStream& ts, const LayoutSVGRoot& root) { |
| 397 ts << " " << root.frameRect(); | 398 ts << " " << root.frameRect(); |
| 398 writeStyle(ts, root); | 399 writeStyle(ts, root); |
| 399 return ts; | 400 return ts; |
| 400 } | 401 } |
| 401 | 402 |
| 402 static void writeLayoutSVGTextBox(TextStream& ts, const LayoutSVGText& text) { | 403 static void writeLayoutSVGTextBox(TextStream& ts, const LayoutSVGText& text) { |
| 403 SVGRootInlineBox* box = toSVGRootInlineBox(text.firstRootBox()); | 404 SVGRootInlineBox* box = toSVGRootInlineBox(text.firstRootBox()); |
| 404 if (!box) | 405 if (!box) |
| 405 return; | 406 return; |
| 406 | 407 |
| 407 // FIXME: Remove this hack, once the new text layout engine is completly | 408 // FIXME: Remove this hack, once the new text layout engine is completly |
| 408 // landed. We want to preserve the old layout test results for now. | 409 // landed. We want to preserve the old layout test results for now. |
| 409 ts << " contains 1 chunk(s)"; | 410 ts << " contains 1 chunk(s)"; |
| 410 | 411 |
| 411 if (text.parent() && (text.parent()->resolveColor(CSSPropertyColor) != | 412 if (text.parent() && |
| 412 text.resolveColor(CSSPropertyColor))) { | 413 (text.parent()->resolveColor(CSSPropertyColor) != |
| 414 text.resolveColor(CSSPropertyColor))) { |
| 413 writeNameValuePair( | 415 writeNameValuePair( |
| 414 ts, "color", | 416 ts, "color", |
| 415 text.resolveColor(CSSPropertyColor).nameForLayoutTreeAsText()); | 417 text.resolveColor(CSSPropertyColor).nameForLayoutTreeAsText()); |
| 416 } | 418 } |
| 417 } | 419 } |
| 418 | 420 |
| 419 static inline void writeSVGInlineTextBox(TextStream& ts, | 421 static inline void writeSVGInlineTextBox(TextStream& ts, |
| 420 SVGInlineTextBox* textBox, | 422 SVGInlineTextBox* textBox, |
| 421 int indent) { | 423 int indent) { |
| 422 Vector<SVGTextFragment>& fragments = textBox->textFragments(); | 424 Vector<SVGTextFragment>& fragments = textBox->textFragments(); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 ts << " height " << fragment.height; | 468 ts << " height " << fragment.height; |
| 467 else | 469 else |
| 468 ts << " width " << fragment.width; | 470 ts << " width " << fragment.width; |
| 469 | 471 |
| 470 if (!textBox->isLeftToRightDirection() || textBox->dirOverride()) { | 472 if (!textBox->isLeftToRightDirection() || textBox->dirOverride()) { |
| 471 ts << (textBox->isLeftToRightDirection() ? " LTR" : " RTL"); | 473 ts << (textBox->isLeftToRightDirection() ? " LTR" : " RTL"); |
| 472 if (textBox->dirOverride()) | 474 if (textBox->dirOverride()) |
| 473 ts << " override"; | 475 ts << " override"; |
| 474 } | 476 } |
| 475 | 477 |
| 476 ts << ": " << quoteAndEscapeNonPrintables( | 478 ts << ": " |
| 477 text.substring(fragment.characterOffset, fragment.length)) | 479 << quoteAndEscapeNonPrintables( |
| 480 text.substring(fragment.characterOffset, fragment.length)) |
| 478 << "\n"; | 481 << "\n"; |
| 479 } | 482 } |
| 480 } | 483 } |
| 481 | 484 |
| 482 static inline void writeSVGInlineTextBoxes(TextStream& ts, | 485 static inline void writeSVGInlineTextBoxes(TextStream& ts, |
| 483 const LayoutText& text, | 486 const LayoutText& text, |
| 484 int indent) { | 487 int indent) { |
| 485 for (InlineTextBox* box = text.firstTextBox(); box; | 488 for (InlineTextBox* box = text.firstTextBox(); box; |
| 486 box = box->nextTextBox()) { | 489 box = box->nextTextBox()) { |
| 487 if (!box->isSVGInlineTextBox()) | 490 if (!box->isSVGInlineTextBox()) |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 762 ts << " "; | 765 ts << " "; |
| 763 writeStandardPrefix(ts, *filter, 0); | 766 writeStandardPrefix(ts, *filter, 0); |
| 764 ts << " " << filter->resourceBoundingBox(&object) << "\n"; | 767 ts << " " << filter->resourceBoundingBox(&object) << "\n"; |
| 765 } | 768 } |
| 766 } | 769 } |
| 767 } | 770 } |
| 768 } | 771 } |
| 769 } | 772 } |
| 770 | 773 |
| 771 } // namespace blink | 774 } // namespace blink |
| OLD | NEW |