-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented support for fallback values in CSS attr(): `attr(<attr-name>, <attr-fallback>)` Full syntax supported as of this rev: `[namespace? `|`]? ident [`,` fallback]?` Spec: https://drafts.csswg.org/css-values-5/#attr-notation Also added a new WPT reftest for attr fallback without a type, and some new attr serialization WPTs (namespace and fallback). Differential Revision: https://phabricator.services.mozilla.com/D176801 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1448248 gecko-commit: a14395d9ad06c9f7462430341d4c7874020a58d0 gecko-reviewers: emilio
- Loading branch information
1 parent
9e1de77
commit 1446864
Showing
3 changed files
with
80 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<!DOCTYPE html> | ||
<style> | ||
#one::after { | ||
content: "Fallback value"; | ||
} | ||
|
||
#two::after { | ||
content: "Not fallback value"; | ||
} | ||
|
||
#three::after { | ||
content: ""; | ||
} | ||
|
||
#four::after { | ||
content: ""; | ||
} | ||
|
||
#five::after { | ||
content: ""; | ||
} | ||
|
||
#six::after { | ||
content: ""; | ||
} | ||
</style> | ||
|
||
<div id="one"></div> | ||
<div id="two"></div> | ||
<div id="three"></div> | ||
<div id="four"></div> | ||
<div id="five"></div> | ||
<div id="six"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<!DOCTYPE html> | ||
<link rel="help" href="https://drafts.csswg.org/css-values-5/#attr-notation"> | ||
<link rel="match" href="attr-notype-fallback-ref.html"> | ||
<style> | ||
#one::after { | ||
content: attr(does-not-exist, "Fallback value"); | ||
} | ||
|
||
#two::after { | ||
content: attr(does-exist, "Fallback value"); | ||
} | ||
|
||
#three::after { | ||
content: attr(does-not-exist, invalid); | ||
} | ||
|
||
#four::after { | ||
content: attr(does-exist, invalid); | ||
} | ||
|
||
#five::after { | ||
content: attr(does-exist, "Fallback value"); | ||
} | ||
|
||
#six::after { | ||
content: attr(does-exist, "Fallback value"); | ||
} | ||
</style> | ||
|
||
<div id="one"></div> | ||
<div id="two" does-exist="Not fallback value"></div> | ||
<div id="three"></div> | ||
<div id="four" does-exist="Not fallback value"></div> | ||
<div id="five" does-exist=""></div> | ||
<div id="six" does-exist></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters