Last Comment Bug 145419 - dynamically added ::first-letter and ::first-line rules not applied
: dynamically added ::first-letter and ::first-line rules not applied
Status: NEW
: css1, testcase
Product: Core
Classification: Components
Component: CSS Parsing and Computation (show other bugs)
: Trunk
: All All
: P3 normal with 4 votes (vote)
: Future
Assigned To: Nobody; OK to take it and work on it
:
: Jet Villegas (:jet)
Mentors:
: 1062621 (view as bug list)
Depends on: 8253 23604
Blocks: 1106759
  Show dependency treegraph
 
Reported: 2002-05-18 00:16 PDT by Daniel Dawson
Modified: 2015-02-01 19:09 PST (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
HTML file linking to default and alternate stylesheets (948 bytes, text/html)
2002-05-18 00:19 PDT, Daniel Dawson
no flags Details
Default stylesheet (version 1) for attachment 84145 (65 bytes, text/css)
2002-05-18 00:22 PDT, Daniel Dawson
no flags Details
Default stylesheet (version 2) for attachment 84145 (135 bytes, text/css)
2002-05-18 00:23 PDT, Daniel Dawson
no flags Details
Alternate stylesheet for attachment 84145 (131 bytes, text/css)
2002-05-18 00:24 PDT, Daniel Dawson
no flags Details
testcase with correct links to the style sheets (1.38 KB, text/html)
2002-05-28 12:03 PDT, Madhur Bhatia
no flags Details

Description Daniel Dawson 2002-05-18 00:16:44 PDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0rc1) Gecko/20020417
BuildID:    2002041711

If an alternate stylesheet specifies a rule using the :first-letter or
:first-line pseudo-element, but no rule in the default stylesheet matches the
same pseudo, the former rule is ignored for that element.

For instance, if the default stylesheet says the first letter of a given
paragraph should be green, and the alternate stylesheet says red, both are
honored, but if the "green" rule is missing, both are rendered using the
inherited value.


Reproducible: Always
Steps to Reproduce:
1. View any page that does not specify a style rule for a given
:first-letter or :first-line pseudo-element in its default stylesheet but does
specify such a rule in an alternate stylesheet
2. Use the View > Use Style menu to switch to the alternate stylesheet


Actual Results:  The rule in the alternate stylesheet is ignored.

Expected Results:  The rule in the alternate stylesheet should be applied; the
default stylesheet should not affect alternate stylesheets.
Comment 1 Daniel Dawson 2002-05-18 00:19:24 PDT
Created attachment 84145 [details]
HTML file linking to default and alternate stylesheets
Comment 2 Daniel Dawson 2002-05-18 00:22:20 PDT
Created attachment 84146 [details]
Default stylesheet (version 1) for attachment 84145 [details]

(Re)name to default.css to test.
Comment 3 Daniel Dawson 2002-05-18 00:23:31 PDT
Created attachment 84147 [details]
Default stylesheet (version 2) for attachment 84145 [details]

(Re)name to default.css to test.
Comment 4 Daniel Dawson 2002-05-18 00:24:35 PDT
Created attachment 84148 [details]
Alternate stylesheet for attachment 84145 [details]

Name it alternate.css to test.
Comment 5 John P Baker 2002-05-18 14:14:09 PDT
This looks remarkably like bug 126072 although that is
about :before and :after pseudo classes
Comment 6 Daniel Dawson 2002-05-20 11:49:29 PDT
Hmm. Not only are they remarkably alike, it looks like they're one and the same.
(Both caused by a general problem with pseudo-elements.) Would it be appropriate
to call this a dup?
Comment 7 David Baron :dbaron: ⌚️UTC-10 2002-05-20 12:14:31 PDT
No.
Comment 8 Madhur Bhatia 2002-05-28 12:03:02 PDT
Created attachment 85283 [details]
testcase with correct links to the style sheets

this testcase uses 
- attachment 84146 [details] for default-1 stylesheet
- attachment 84147 [details] for default-2 stylesheet
- attachment 84148 [details] for Alternate stylesheet
Comment 9 Madhur Bhatia 2002-05-28 12:14:26 PDT
I see the bug on linux, win2000 and macOS 9.1.

Confirming the bug.

Repeating reporter's comment : 
"If an alternate stylesheet specifies a rule using the :first-letter or
:first-line pseudo-element, but no rule in the default stylesheet matches the
same pseudo, the former rule is ignored for that element."

Comment 10 David Baron :dbaron: ⌚️UTC-10 2002-09-17 20:00:15 PDT
This may be the same problem as bug 23604.
Comment 11 Boris Zbarsky [:bz] (still a bit busy) 2014-09-04 06:24:13 PDT
*** Bug 1062621 has been marked as a duplicate of this bug. ***
Comment 12 haelwenn.monnier 2015-02-01 19:09:36 PST
When inverting Default-1 and Default-2 it works fine. Maybe It’s because it wasn’t defined before…

Note You need to log in before you can comment on or make changes to this bug.