Bug 51172

Summary: Implement @-webkit-document CSS rule for use in user stylesheets
Product: WebKit Reporter: Mathias Bynens <mathias>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: UNCONFIRMED    
Severity: Normal CC: ap, bfulgham, hyatt, jason.barnabe, kenwfoyjr, mathias, mitz, mkterra, peter, pf, ronan, syoichi, tony, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
URL: https://developer.mozilla.org/en/CSS/@-moz-document

Mathias Bynens
Reported 2010-12-16 02:35:49 PST
Something similar to @-moz-document <https://developer.mozilla.org/en/CSS/@-moz-document> would make it *much* easier to write and use custom user stylesheets. Also see <http://lists.w3.org/Archives/Public/www-style/2004Aug/0135>.
Attachments
Alexey Proskuryakov
Comment 1 2010-12-16 12:04:00 PST
Pasting from the provided URL: The @-moz-document rule is a Gecko-specific at-rule that restricts the style rules contained within it based on the URL of the document. It is designed primarily for user style sheets. @-moz-document url(http://www.w3.org/), url-prefix(http://www.w3.org/Style/), domain(mozilla.org) { /* CSS rules here apply to: + The page "http://www.w3.org/". + Any page whose URL begins with "http://www.w3.org/Style/" + Any page whose URL's host is "mozilla.org" or ends with ".mozilla.org" */ /* make the above-mentioned pages really ugly */ body { color: purple; background: yellow; } }
mkterra
Comment 2 2010-12-16 15:13:50 PST
If at all possible, supporting @-moz-document itself would be vastly preferable. That way, existing styles will work without users having to wait for updates, and authors won't have to maintain two superficially-different versions for Gecko and Webkit.
Peter Beverloo
Comment 3 2010-12-17 00:39:27 PST
They're called vendor prefixes for a reason. While it would indeed benefit convenience for using user-stylesheets, I'd consider it a bad thing to support another vendor's prefix.
Ronan Jouchet
Comment 4 2011-05-16 06:25:35 PDT
FYI, someone created a userscript that partially does the job: http://code.google.com/p/chromium/issues/detail?id=2393#c63 This doesn't mean this bug is fixed, but it can be used as a workaround in the meantime.
Mathias Bynens
Comment 5 2011-09-06 11:05:57 PDT
This is now included in the CSS Conditional Rules Module Level 3 draft: http://www.w3.org/TR/css3-conditional/#at-document
Alexey Proskuryakov
Comment 6 2012-01-02 23:15:09 PST
*** Bug 75456 has been marked as a duplicate of this bug. ***
Radar WebKit Bug Importer
Comment 7 2022-07-12 14:05:13 PDT
Note You need to log in before you can comment on or make changes to this bug.