⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 201604 in webkit


Ignore:
Timestamp:
Jun 2, 2016, 11:40:02 AM (10 years ago)
Author:
commit-queue@webkit.org
Message:

SVG content renders in incorrect vertical position when padding-left is not specified
https://bugs.webkit.org/show_bug.cgi?id=158234

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2016-06-02
Reviewed by Darin Adler.

Source/WebCore:

Fix the optimization in RenderSVGRoot::buildLocalToBorderBoxTransform().
Use LayoutSize::isZero() instead of LayoutSize::isEmpty() to decide whether
there is borderAndPadding applied or not.

Test: svg/custom/svg-root-padding-individual.html

  • rendering/svg/RenderSVGRoot.cpp:

(WebCore::RenderSVGRoot::buildLocalToBorderBoxTransform):

LayoutTests:

Make sure the SVG root element is positioned correctly when either the sum
of its (leftPadding + rightPadding) or the sum of its (topPadding + bottomPadding)
is equal to zero.

  • svg/custom/svg-root-padding-individual-expected.html: Added.
  • svg/custom/svg-root-padding-individual.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r201601 r201604  
     12016-06-02  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        SVG content renders in incorrect vertical position when padding-left is not specified
     4        https://bugs.webkit.org/show_bug.cgi?id=158234
     5
     6        Reviewed by Darin Adler.
     7
     8        Make sure the SVG root element is positioned correctly when either the sum
     9        of its (leftPadding + rightPadding) or the sum of its (topPadding + bottomPadding)
     10        is equal to zero.
     11
     12        * svg/custom/svg-root-padding-individual-expected.html: Added.
     13        * svg/custom/svg-root-padding-individual.html: Added.
     14
    1152016-06-02  Adam Bergkvist  <adam.bergkvist@ericsson.com>
    216
  • trunk/Source/WebCore/ChangeLog

    r201603 r201604  
     12016-06-02  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        SVG content renders in incorrect vertical position when padding-left is not specified
     4        https://bugs.webkit.org/show_bug.cgi?id=158234
     5
     6        Reviewed by Darin Adler.
     7
     8        Fix the optimization in RenderSVGRoot::buildLocalToBorderBoxTransform().
     9        Use LayoutSize::isZero() instead of LayoutSize::isEmpty() to decide whether
     10        there is borderAndPadding applied or not.
     11
     12        Test: svg/custom/svg-root-padding-individual.html
     13
     14        * rendering/svg/RenderSVGRoot.cpp:
     15        (WebCore::RenderSVGRoot::buildLocalToBorderBoxTransform):
     16
    1172016-06-02  Brady Eidson  <beidson@apple.com>
    218
  • trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp

    r201040 r201604  
    332332    LayoutSize borderAndPadding(borderLeft() + paddingLeft(), borderTop() + paddingTop());
    333333    m_localToBorderBoxTransform = svgSVGElement().viewBoxToViewTransform(contentWidth() / scale, contentHeight() / scale);
    334     if (borderAndPadding.isEmpty() && scale == 1 && translate == SVGPoint::zero())
     334    if (borderAndPadding.isZero() && scale == 1 && translate == SVGPoint::zero())
    335335        return;
    336336    m_localToBorderBoxTransform = AffineTransform(scale, 0, 0, scale, borderAndPadding.width() + translate.x(), borderAndPadding.height() + translate.y()) * m_localToBorderBoxTransform;
Note: See TracChangeset for help on using the changeset viewer.