Bug 18587

Summary: CSS3 content:inherit doesn't work
Product: WebKit Reporter: Anantha Keesara <anantha>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ahmad.saleem792, ap, bfulgham, emacemac7, emilio, hyatt, mitz, nicholas, rniwa, robert, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Windows XP   
URL: http://www.hixie.ch/tests/adhoc/css/inheritance/content/001.xml
Attachments:
Description Flags
First pass at content: inherit mitz: review-

Description Anantha Keesara 2008-04-18 10:42:14 PDT
Steps –
Go to the URL http://www.hixie.ch/tests/adhoc/css/inheritance/content/001.xml

Issue - Test can not displayed " PASSES" Which is CSS inherited.

Expected - IT should display "PASSED".

Other browsers:
     IE 7 : not OK, xml code seen.
     FF 3.0b4: OK.
     Opera 9.26 Build 8835 :OK.
     Safari 3.1: not OK


Nightly tested: r31446
Comment 1 Eric Seidel (no email) 2008-04-18 10:54:05 PDT
Wow.  That's wild that you can inherit CSS generated content.  I imagine this isn't hard to fix.  Probably just a single line tweak to CSSStyleSelector.
Comment 2 Anantha Keesara 2008-04-18 11:23:09 PDT
one more tese: http://www.hixie.ch/tests/adhoc/css/inheritance/content/002.xml
Comment 3 Eric Seidel (no email) 2008-04-22 01:22:08 PDT
I have a partial patch.  And no, it's not a single line tweak. ;)
Comment 4 Eric Seidel (no email) 2008-04-23 00:17:28 PDT
Created attachment 20764 [details]
First pass at content: inherit

 LayoutTests/ChangeLog                              |   11 +++
 LayoutTests/hixie/README                           |    3 +
 .../hixie/adhoc/css/inheritance/content/001.xml    |   15 +++++
 .../hixie/adhoc/css/inheritance/content/002.xml    |   18 ++++++
 WebCore/ChangeLog                                  |   34 ++++++++++
 WebCore/css/CSSStyleSelector.cpp                   |   12 +---
 WebCore/html/HTMLBRElement.cpp                     |    2 +-
 WebCore/html/HTMLFrameSetElement.cpp               |    4 +-
 WebCore/html/HTMLImageElement.cpp                  |    2 +-
 WebCore/html/HTMLLegendElement.cpp                 |    2 +-
 WebCore/rendering/RenderContainer.cpp              |    2 +-
 WebCore/rendering/RenderObject.cpp                 |    2 +-
 WebCore/rendering/RenderStyle.cpp                  |   65 ++++++++++++++++----
 WebCore/rendering/RenderStyle.h                    |   18 ++++--
 14 files changed, 157 insertions(+), 33 deletions(-)
Comment 5 mitz 2008-04-28 16:09:54 PDT
Comment on attachment 20764 [details]
First pass at content: inherit

Unless I'm missing something:
1) This patch will make 'content' inherit by default.
2) 'content' should not inherit by default (i.e. only when 'content: inherit' is specified).

Flip back to r? if I got this wrong.
Comment 6 mitz 2008-04-28 16:16:44 PDT
(In reply to comment #5)
> Flip back to r? if I got this wrong.

Actually don't flip back to r? since the patch is also missing -expected.txt files.
Comment 7 Nicholas Wilson 2010-04-12 10:08:49 PDT
Please, do not commit this. It is a big mistake in behaviour.

CSS3 Generated Content is in a very incomplete form, with a lot missing. CSS2 GenCon has reasonably consistent implementations of the core features across browsers, but many, many differences as well.

In short, regarding CSS2: this patch is a regression on CSS2 compliance, which we are still a little way from in the details and proper handling of corner cases. FF and others are similarly patchy in CSS2 GenCon, so do not copy them if unsure about behaviour.

Regarding CSS3: the spec is rough, with lots of holes. It is changing rapidly. The test case by Hixie was last updated in 2001, and since then CSS3 has had content inherit removed entirely.

Could close as dup of bug 13097 anyway.
Comment 8 Ahmad Saleem 2022-09-02 14:45:35 PDT
I am able to reproduce this bug in Safari Technology Preview 152 and Chrome Canary 107 using test case from URL and it does not show "PASSED" but in case of Firefox Nightly 106, it does show "PASSED" in green text. Thanks!
Comment 9 Radar WebKit Bug Importer 2022-09-02 15:13:16 PDT
<rdar://problem/99506248>