-
zimmermann@webkit.org authored
Reviewed by Dirk Schulze. SVG text chunk concept needs to be integrated in the InlineBox structure https://bugs.webkit.org/show_bug.cgi?id=45533 Begin rewriting the SVG text layout code. As first step move the text chunk concept right into the inline box structure. This obsoletes the whole text chunk part concept (see SVGTextChunkLayoutInfo.h for details), and will soon simplify the whole layout code a lot. Previously we hacked around the fact that a single InlineTextBox could contain multiple text chunks For example: <text x="20 30 40">ABC</text> only led to the creation of one InlineTextBox containing three chunks. When painting such an InlineTextBox, we had to do nasty hacks (same for text selection etc.) This is finally fixed by incorporating the knownledge about text chunks into the line layout algorithm. Note, this has no impact on HTML at all, no worries. It's even required to do it this way as BiDi reordering shouldn't happen across text chunks. These are only the first bits, and currently slows down text layouting. Follow-up patches will remove the old layout algorithm, and will rely on the stored SVGTextLayoutAttributes in the RenerSVGInlineText renderers (instead of computing again). * Android.mk: Add rendering/svg/SVGTextLayoutAttributes.* & rendering/svg/SVGTextLayoutBuilder.* to build. * CMakeLists.txt: Ditto. * GNUmakefile.am: Ditto. * WebCore.gyp/WebCore.gyp: Ditto. * WebCore.gypi: Ditto. * WebCore.pro: Ditto. * WebCore.vcproj/WebCore.vcproj: Ditto. * WebCore.vcproj/WebCoreCommon.vsprops: Ditto. (Recognize new rendering/svg directory.) * WebCore.vcproj/copyForwardingHeaders.cmd: Ditto. (Copy forwarding headers from rendering/svg directory.) * WebCore.xcodeproj/project.pbxproj: Ditto. * rendering/RenderBlockLineLayout.cpp: This is the key of the new concept, take text chunks into account when building the InlineBox structure. (WebCore::RenderBlock::findNextLineBreak): Split midpointState, if we encounter the beginning of a new text chunk. * rendering/RenderObject.h: (WebCore::RenderObject::isSVGInline): New method, which will be used to identify RenderSVGInline objects. * rendering/RenderSVGInline.h: (WebCore::RenderSVGInline::isSVGInline): Return true. * rendering/RenderSVGInlineText.cpp: (WebCore::RenderSVGInlineText::linesBoundingBox): Overriden, to simplify the calculations for SVG. (WebCore::RenderSVGInlineText::characterStartsNewTextChunk): Determines wheter the given position starts a new text chunk. * rendering/RenderSVGInlineText.h: (WebCore::RenderSVGInlineText::storeLayoutAttributes): Stores the layout attributes calculated in the text layout process (will be used everywhere in follow-up patches). * rendering/RenderSVGText.cpp: (WebCore::RenderSVGText::layout): Invoke SVGTextLayoutBuilder before creating the inline box tree, so we can decide which characters start new text chunks. * rendering/RenderText.h: Made linesBoundingBox() virtual so RenderSVGInlineText can override it. * rendering/svg: Added. * rendering/svg/SVGTextLayoutAttributes.cpp: Added. Holds x/y/dx/dy/rotate values and all kerning/ligature information used during layout. * rendering/svg/SVGTextLayoutAttributes.h: Added. * rendering/svg/SVGTextLayoutBuilder.cpp: Added. * rendering/svg/SVGTextLayoutBuilder.h: Added. 2010-09-10 Nikolas Zimmermann <nzimmermann@rim.com> Reviewed by Dirk Schulze. SVG text chunk concept needs to be integrated in the InlineBox structure https://bugs.webkit.org/show_bug.cgi?id=45533 Updated all tests containing text chunks, to reflect the fact that more SVGInlineTextBoxes are created now. All 'startOffset' dumps now begin at 0, indicating that there's only one chunk contained in a single SVGInlineTextBox. These dumps will be removed in follow-up patches, as they don't make any sense anymore in the new concept. * platform/gtk/svg/text/select-x-list-1-expected.txt: * platform/gtk/svg/text/select-x-list-2-expected.txt: * platform/gtk/svg/text/select-x-list-3-expected.txt: * platform/gtk/svg/text/select-x-list-4-expected.txt: * platform/gtk/svg/text/select-x-list-with-tspans-1-expected.txt: * platform/gtk/svg/text/select-x-list-with-tspans-2-expected.txt: * platform/gtk/svg/text/select-x-list-with-tspans-3-expected.txt: * platform/gtk/svg/text/select-x-list-with-tspans-4-expected.txt: * platform/mac/svg/W3C-SVG-1.1/animate-elem-40-t-expected.txt: * platform/mac/svg/W3C-SVG-1.1/text-text-04-t-expected.txt: * platform/mac/svg/W3C-SVG-1.1/text-text-05-t-expected.txt: * platform/mac/svg/W3C-SVG-1.1/text-text-06-t-expected.txt: * platform/mac/svg/W3C-SVG-1.1/text-text-07-t-expected.txt: * platform/mac/svg/W3C-SVG-1.1/text-tspan-01-b-expected.txt: * platform/mac/svg/batik/text/textAnchor2-expected.txt: * platform/mac/svg/batik/text/textAnchor3-expected.txt: * platform/mac/svg/batik/text/textLayout-expected.txt: * platform/mac/svg/batik/text/textLayout2-expected.txt: * platform/mac/svg/batik/text/textOnPathSpaces-expected.txt: * platform/mac/svg/batik/text/textPosition-expected.txt: * platform/mac/svg/batik/text/textPosition2-expected.txt: * platform/mac/svg/custom/text-letter-spacing-expected.txt: * platform/mac/svg/custom/text-x-dx-lists-expected.txt: * platform/mac/svg/custom/text-x-override-in-tspan-child-expected.txt: * platform/mac/svg/text/select-x-list-1-expected.txt: * platform/mac/svg/text/select-x-list-2-expected.txt: * platform/mac/svg/text/select-x-list-3-expected.txt: * platform/mac/svg/text/select-x-list-4-expected.txt: * platform/mac/svg/text/select-x-list-with-tspans-1-expected.txt: * platform/mac/svg/text/select-x-list-with-tspans-2-expected.txt: * platform/mac/svg/text/select-x-list-with-tspans-3-expected.txt: * platform/mac/svg/text/select-x-list-with-tspans-4-expected.txt: * platform/mac/svg/text/text-text-04-t-expected.txt: * platform/mac/svg/text/text-text-05-t-expected.txt: * platform/mac/svg/text/text-text-06-t-expected.txt: * platform/mac/svg/text/text-text-07-t-expected.txt: * platform/mac/svg/text/text-tspan-01-b-expected.txt: * svg/custom/glyph-transformation-with-hkern-expected.txt: * platform/qt/svg/text/select-x-list-1-expected.txt: * platform/qt/svg/text/select-x-list-2-expected.txt: * platform/qt/svg/text/select-x-list-3-expected.txt: * platform/qt/svg/text/select-x-list-4-expected.txt: * platform/qt/svg/text/select-x-list-with-tspans-1-expected.txt: * platform/qt/svg/text/select-x-list-with-tspans-2-expected.txt: * platform/qt/svg/text/select-x-list-with-tspans-3-expected.txt: * platform/qt/svg/text/select-x-list-with-tspans-4-expected.txt: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67200 268f45cc-cd09-0410-ab3c-d52691b4dbfc
6e96afd5