Bug 51172
Summary: | Implement @-webkit-document CSS rule for use in user stylesheets | ||
---|---|---|---|
Product: | WebKit | Reporter: | Mathias Bynens <mathias> |
Component: | CSS | Assignee: | 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
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 | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Alexey Proskuryakov
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
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
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
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
This is now included in the CSS Conditional Rules Module Level 3 draft: http://www.w3.org/TR/css3-conditional/#at-document
Alexey Proskuryakov
*** Bug 75456 has been marked as a duplicate of this bug. ***
Radar WebKit Bug Importer
<rdar://problem/96909164>