OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) | 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) |
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) | 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) |
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. | 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. |
6 * All rights reserved. | 6 * All rights reserved. |
7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> |
9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
10 * (http://www.torchmobile.com/) | 10 * (http://www.torchmobile.com/) |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 AdjustStyleForEditing(style); | 483 AdjustStyleForEditing(style); |
484 | 484 |
485 bool is_svg_element = element && element->IsSVGElement(); | 485 bool is_svg_element = element && element->IsSVGElement(); |
486 if (is_svg_element) { | 486 if (is_svg_element) { |
487 // display: contents computes to inline for replaced elements and form | 487 // display: contents computes to inline for replaced elements and form |
488 // controls, and isn't specified for other kinds of SVG content[1], so let's | 488 // controls, and isn't specified for other kinds of SVG content[1], so let's |
489 // just do the same here for all other SVG elements. | 489 // just do the same here for all other SVG elements. |
490 // | 490 // |
491 // If we wouldn't do this, then we'd need to ensure that display: contents | 491 // If we wouldn't do this, then we'd need to ensure that display: contents |
492 // doesn't prevent SVG elements from generating a LayoutObject in | 492 // doesn't prevent SVG elements from generating a LayoutObject in |
493 // SVGElement::layoutObjectIsNeeded. | 493 // SVGElement::LayoutObjectIsNeeded. |
494 // | 494 // |
495 // [1]: https://www.w3.org/TR/SVG/painting.html#DisplayProperty | 495 // [1]: https://www.w3.org/TR/SVG/painting.html#DisplayProperty |
496 if (style.Display() == EDisplay::kContents) | 496 if (style.Display() == EDisplay::kContents) |
497 style.SetDisplay(EDisplay::kInline); | 497 style.SetDisplay(EDisplay::kInline); |
498 | 498 |
499 // Only the root <svg> element in an SVG document fragment tree honors css | 499 // Only the root <svg> element in an SVG document fragment tree honors css |
500 // position. | 500 // position. |
501 if (!(isSVGSVGElement(*element) && element->parentNode() && | 501 if (!(isSVGSVGElement(*element) && element->parentNode() && |
502 !element->parentNode()->IsSVGElement())) | 502 !element->parentNode()->IsSVGElement())) |
503 style.SetPosition(ComputedStyle::InitialPosition()); | 503 style.SetPosition(ComputedStyle::InitialPosition()); |
504 | 504 |
505 // SVG text layout code expects us to be a block-level style element. | 505 // SVG text layout code expects us to be a block-level style element. |
506 if ((isSVGForeignObjectElement(*element) || isSVGTextElement(*element)) && | 506 if ((isSVGForeignObjectElement(*element) || isSVGTextElement(*element)) && |
507 style.IsDisplayInlineType()) | 507 style.IsDisplayInlineType()) |
508 style.SetDisplay(EDisplay::kBlock); | 508 style.SetDisplay(EDisplay::kBlock); |
509 | 509 |
510 // Columns don't apply to svg text elements. | 510 // Columns don't apply to svg text elements. |
511 if (isSVGTextElement(*element)) | 511 if (isSVGTextElement(*element)) |
512 style.ClearMultiCol(); | 512 style.ClearMultiCol(); |
513 } | 513 } |
514 AdjustStyleForAlignment(style, layout_parent_style); | 514 AdjustStyleForAlignment(style, layout_parent_style); |
515 } | 515 } |
516 | 516 |
517 } // namespace blink | 517 } // namespace blink |
OLD | NEW |