WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED CONFIGURATION CHANGED
Bug 52360
No line break at zero-width spaces (ZWSP) if ZWSP is placed between tags
https://bugs.webkit.org/show_bug.cgi?id=52360
Summary
No line break at zero-width spaces (ZWSP) if ZWSP is placed between tags
hikingfan
Reported
2011-01-13 00:57:47 PST
Overview: WebKit doesn't seem to break lines at text nodes with only ZWSPs surrounded by inline elements. Steps to reproduce: 1. Create a div element (specify a width if you want) 2. Create two spans that will each fit in the div, but not next to each other and contain no spaces. 3. Separate these spans with a ZWSP (​) Actual result: No line-break is inserted, they appear in the same line. The text runs out of the box. Expected result: The two spans appear in separate lines. Build Date & Platform: 08 January 2011, Mac OS X 10.6.6 Additional Information: See the attachment for a small page reproducing the bug.
Attachments
A small page that reproduces the bug
(1.31 KB, text/html)
2011-01-13 00:58 PST
,
hikingfan
no flags
Details
Patch
(4.22 KB, patch)
2011-02-07 20:33 PST
,
Emil A Eklund
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
hikingfan
Comment 1
2011-01-13 00:58:32 PST
Created
attachment 78782
[details]
A small page that reproduces the bug
Emil A Eklund
Comment 2
2011-02-07 20:33:52 PST
Created
attachment 81573
[details]
Patch
Eric Seidel (no email)
Comment 3
2011-02-07 23:26:31 PST
Looks reasonable to me.
Eric Seidel (no email)
Comment 4
2011-02-07 23:26:57 PST
What do other browsers do? what spec covers this? Please mention such in the ChangeLog. Otherwise this looks ready to land.
mitz
Comment 5
2011-02-07 23:34:00 PST
Regardless of whether this is a desirable change, you can’t patch findNextLineBreak() and not make the corresponding change to RenderText::trimmedPrefWidths() or you’d incorrect min preferred widths.
Emil A Eklund
Comment 6
2011-02-17 15:02:30 PST
This isn't covered by any of the html specifications as far as I can tell. It is seems inconsistent to have different line breaking behavior in text and between inline elements though. Both Gecko and IE wrap inline elements on zwsp. mitz: Thanks for pointing that out, I was unsure whether I should change that and erred (incorrectly) on the side of caution. Are there any other things I need to look out for?
Emil A Eklund
Comment 7
2011-02-17 15:03:06 PST
Comment on
attachment 81573
[details]
Patch Marking patch as obsolete, will upload a new one addressing mitz's comments.
Tom Humphrey
Comment 8
2011-09-23 07:33:08 PDT
As well as zero-width spaces, maybe also consider splitting on other space types (hair, thin, em, en). Although the html 4 spec only recognises ZWSP as white-space (see
http://www.w3.org/TR/html401/struct/text.html#h-9.1
), handling the other types of space similarly seems harmless and would match the behaviour of Firefox and IE and would also make for consistency between the handling of space between inline elements and text (text already breaks on all of these).
Ahmad Saleem
Comment 9
2022-09-10 15:30:04 PDT
This patch has not landed while trying to search for bug ID on GitHub Webkit but this is not reproducible bug and does not cause the text to go outside of container and all browsers (Safari 15.6.1, Safari Technology Preview 153, Chrome Canary 107 and Firefox Nightly 106) render this same and does not lead the text going outside of div container. Is the patch still needed or HTML5 Parser updates eliminated this bug? Appreciate if someone can comment and update the status accordingly. Thanks!
Alexey Proskuryakov
Comment 10
2022-09-11 13:20:56 PDT
Marking as resolved, as this doesn't reproduce any more.
zalan
Comment 11
2022-09-11 14:30:28 PDT
This is an IFC progression. Content still fails with legacy line layout.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug