Bug 17938 - CSS2.1: Underlines, overlines, and line-throughs should not be applied for no text elements like images
Summary: CSS2.1: Underlines, overlines, and line-throughs should not be applied for no...
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL: http://www.w3.org/Style/CSS/Test/CSS2...
Depends on:
Reported: 2008-03-18 23:30 PDT by Christian Lindemer
Modified: 2022-06-21 13:42 PDT (History)
7 users (show)

See Also:

Safari 15.5 matches with other browsers (1.35 MB, image/png)
2022-06-21 13:11 PDT, Ahmad Saleem
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Lindemer 2008-03-18 23:30:21 PDT
The text-decoration property does not properly span child elements as tested at the noted URL.  Instead, the text-decoration is "broken" by the child element and resumes when the text itself resumes.  The appropriate test case is the ninth of the linked URL.
Comment 1 Robert Blaut 2008-03-19 02:04:49 PDT
Per CSS 2.1 spec: "Underlines, overlines, and line-throughs are applied only to text (including white space, letter spacing, and word spacing): margins, borders, and padding are skipped. If an element contains no text, user agents must refrain from rendering these text decorations on the element. For example, images will not be underlined." [http://www.w3.org/TR/CSS21/text.html#decoration]

So the provided test case is rendered properly by Webkit, but... only in quirks mode (the CSS1 test is rendered in quirks mode)! In standards mode Webkit renders it incorrectly per CSS 2.1 specification, but follows other browsers like Firefox and Opera. 

Check this test case for standards behavior:  http://www.w3.org/Style/CSS/Test/CSS2.1/current/html4/t1504-c543-txt-decor-00-d-g.htm

I found Mozilla bug: https://bugzilla.mozilla.org/show_bug.cgi?id=403524 on this issue. I think we should consider as David Baron said changing our behavior to follow CSS 2.1 spec. I think that the current specification correctly describes text-decoration behavior. I can't see the sense in underlining images.
Comment 2 Dave Hyatt 2008-03-19 02:08:33 PDT
Yeah this changed from 2 to 2.1.  I think basically our entire strict mode path is obsolete now.
Comment 3 Ahmad Saleem 2022-06-21 13:11:31 PDT
Created attachment 460380 [details]
Safari 15.5 matches with other browsers

Based on attached test case in URL - all browsers match each other across all test cases (lines) as shown in the attached screenshots.

Tested browsers - Safari 15.5 on macOS 12.4, Firefox Nightly 103 and Chrome Canary 105

I am not clear on web-spec but since it is consistent across all browsers for Test 9 as mentioned in Comment 09, can it be considered as "RESOLVED CONFIGURATION CHANGED"? Thanks!
Comment 4 Ryosuke Niwa 2022-06-21 13:42:14 PDT
Yup, config changed.