[webkit-dev] adding support for css3 line-break property to -webkit-line-break

Glenn Adams glenn at skynav.com
Wed Sep 5 17:40:52 PDT 2012

Bug 89235 [1] notes lack of support for the CSS3 Text module's line-break
property. I have prepared a patch to add support for the values expressed
by this property to the existing -webkit-line-break property, as a
preliminary step before the CSSWG agrees to unprefixed usage of CSS3 Text

I have prepared two wiki pages [2][3] describing the approach I took in
this patch, as well as discussing the current implementation of the
property and the effects of supporting the new CSS3 keywords.

The basic approach taken by the patch is to make use of customized ICU
rules in WebCore/platform/text/TextBreakIteratorICU.cpp, where the employed
rule set is tailored according to the author supplied line break mode. If
the author does not specify -webkit-line-break that is not 'auto' or
'after-white-space' or if the locale (i.e., @lang) is not a CJK language,
then the new logic is bypassed so no performance impact or semantic change
applies relative to current usage.

A number of new reftests (128) are provided in the patch to fully test this
new functionality. At present. EWS reports passes on all platforms except
cr-linux, which apparently uses a modified copy of ICU. I have added 27
IMAGE results to LayoutTests/platform/chromium/TestExpectations as a
temporary work around until a fix is put in place.

The only significant backwards compatibility issue in accepting this patch
is that -webkit-line-break will use 'auto' as its initial (default) value,
rather than the prior 'normal' value, which has slightly different
semantics in CSS3 Text. This change could affect pages that expect
getComputedStyle('-webkit-line-break') to return 'normal' in the absence of
an explicit property. See the discussion in [4] for further info.



[1] https://bugs.webkit.org/show_bug.cgi?id=89235
[2] https://trac.webkit.org/wiki/LineBreaking
[3] https://trac.webkit.org/wiki/LineBreakingCSS3Mapping
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20120906/6b7f2222/attachment.html>

More information about the webkit-dev mailing list