[Webkit-unassigned] [Bug 119719] New: Suppress zero-length text SVG inline renderers

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Aug 12 20:27:37 PDT 2013


           Summary: Suppress zero-length text SVG inline renderers
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: NEW
          Keywords: BlinkMergeCandidate
          Severity: Normal
          Priority: P2
         Component: SVG
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: rniwa at webkit.org
                CC: zimmermann at kde.org, krit at webkit.org, jonlee at apple.com,
                    pdr at google.com, thorton at apple.com

Consider merging https://chromium.googlesource.com/chromium/blink/+/e4c158a33d34264796abfa683d0413568dfdcde0

The SVG text layout functions assert non-zero metrics for SVG inline text (see
SVGTextLayoutEngine::layoutTextOnLineOrPath, for example). Normally, we don't
instantiate renderers for zero-length inline text (see
Text::textRendererIsNeeded), but the RenderSVGInlineText constructor performs
whitespace filtering to support xml:space semantics
(http://www.w3.org/TR/SVG/struct.html#LangSpaceAttrs) and can end up with empty
text while still passing the non-zero length test in Text::textRendererIsNeeded
(for example a single newline gets deleted when xml:space="default").

Enter RenderText::positionLineBox() which attempts to fix things up by removing
zero length inline boxes. But removing boxes at this point is bad for business
because it invalidates (marks as dirty and clears computed metrics) parent
boxes and sibling boxes during layout, and throws subsequent computations off.

The patch adds isChildAllowed()-based validation for SVG inline text. This prevents zero-len-text
renderers from being inserted into the tree in the first place.

Most test result diffs are zero-lenght DRT RenderSVGInlineText variance, but
some reveal prior issues:

* svg/W3C-SVG-1.1/text-align-08-b-diffs.html has incorrect results checked in
  (one text group is missing due to this bug).
* svg/dom/altGlyph-dom.xhtml(altGlyph-dom.js) also has incorrect results
  hardcoded in.
* svg/animations/length-list-animation.svg is failing miserably without this
  patch, but the failure is only visible when testing manually because the
  reference SVG is failing in the same manner.

Also removing a redundant test in SVGTextLayoutEngine::currentVisualCharacterMetrics(): the while loop condition handles that case in an equivalent manner.

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the webkit-unassigned mailing list