mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Bug 591341 - Add color keywords for default text and background colors. r=dbaron
This commit is contained in:
parent
76d5e4370d
commit
821b553af9
@ -235,10 +235,12 @@ static inline mozilla::css::Side operator++(mozilla::css::Side& side, int) {
|
||||
#endif
|
||||
|
||||
// See nsStyleColor
|
||||
#define NS_COLOR_MOZ_HYPERLINKTEXT -1
|
||||
#define NS_COLOR_MOZ_VISITEDHYPERLINKTEXT -2
|
||||
#define NS_COLOR_MOZ_ACTIVEHYPERLINKTEXT -3
|
||||
#define NS_COLOR_CURRENTCOLOR -4
|
||||
#define NS_COLOR_CURRENTCOLOR -1
|
||||
#define NS_COLOR_MOZ_DEFAULT_COLOR -2
|
||||
#define NS_COLOR_MOZ_DEFAULT_BACKGROUND_COLOR -3
|
||||
#define NS_COLOR_MOZ_HYPERLINKTEXT -4
|
||||
#define NS_COLOR_MOZ_VISITEDHYPERLINKTEXT -5
|
||||
#define NS_COLOR_MOZ_ACTIVEHYPERLINKTEXT -6
|
||||
|
||||
// See nsStyleBackground
|
||||
#define NS_STYLE_BG_ATTACHMENT_SCROLL 0
|
||||
|
@ -0,0 +1,9 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>-moz-default-background-color and -moz-default-color (bug 591341); reference</title>
|
||||
</head>
|
||||
<body>
|
||||
Test -moz-default-background-color and -moz-default-color (bug 591341).
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>-moz-default-background-color and -moz-default-color (bug 591341)</title>
|
||||
<style type="text/css">
|
||||
body {
|
||||
color: green;
|
||||
color: -moz-default-color;
|
||||
background-color: red;
|
||||
background-color: -moz-default-background-color;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
Test -moz-default-background-color and -moz-default-color (bug 591341).
|
||||
</body>
|
||||
</html>
|
@ -108,6 +108,9 @@ fails-if(!Android) == background-size-zoom-repeat.html background-size-zoom-repe
|
||||
fails == background-size-no-intrinsic-width-image.html background-size-no-intrinsic-width-image-ref.html
|
||||
fails == background-size-no-intrinsic-height-image.html background-size-no-intrinsic-height-image-ref.html
|
||||
|
||||
# -moz-default-background-color and -moz-default-color (bug 591341)
|
||||
== background-moz-default-background-color.html background-moz-default-background-color-ref.html
|
||||
|
||||
== fixed-bg-with-transform-outside-viewport-1.html fixed-bg-with-transform-outside-viewport-ref.html
|
||||
|
||||
HTTP == root-background-1.html root-background-ref.html
|
||||
|
@ -88,6 +88,8 @@ CSS_KEY(-moz-combobox, _moz_combobox)
|
||||
CSS_KEY(-moz-comboboxtext, _moz_comboboxtext)
|
||||
CSS_KEY(-moz-block-height, _moz_block_height)
|
||||
CSS_KEY(-moz-deck, _moz_deck)
|
||||
CSS_KEY(-moz-default-background-color, _moz_default_background_color)
|
||||
CSS_KEY(-moz-default-color, _moz_default_color)
|
||||
CSS_KEY(-moz-desktop, _moz_desktop)
|
||||
CSS_KEY(-moz-devanagari, _moz_devanagari)
|
||||
CSS_KEY(-moz-dialog, _moz_dialog)
|
||||
|
@ -734,6 +734,8 @@ const PRInt32 nsCSSProps::kColorKTable[] = {
|
||||
eCSSKeyword__moz_eventreerow, nsILookAndFeel::eColor__moz_eventreerow,
|
||||
eCSSKeyword__moz_field, nsILookAndFeel::eColor__moz_field,
|
||||
eCSSKeyword__moz_fieldtext, nsILookAndFeel::eColor__moz_fieldtext,
|
||||
eCSSKeyword__moz_default_background_color, NS_COLOR_MOZ_DEFAULT_BACKGROUND_COLOR,
|
||||
eCSSKeyword__moz_default_color, NS_COLOR_MOZ_DEFAULT_COLOR,
|
||||
eCSSKeyword__moz_dialog, nsILookAndFeel::eColor__moz_dialog,
|
||||
eCSSKeyword__moz_dialogtext, nsILookAndFeel::eColor__moz_dialogtext,
|
||||
eCSSKeyword__moz_dragtargetzone, nsILookAndFeel::eColor__moz_dragtargetzone,
|
||||
|
@ -759,6 +759,12 @@ static PRBool SetColor(const nsCSSValue& aValue, const nscolor aParentColor,
|
||||
aCanStoreInRuleTree = PR_FALSE;
|
||||
aResult = aContext->GetStyleColor()->mColor;
|
||||
break;
|
||||
case NS_COLOR_MOZ_DEFAULT_COLOR:
|
||||
aResult = aPresContext->DefaultColor();
|
||||
break;
|
||||
case NS_COLOR_MOZ_DEFAULT_BACKGROUND_COLOR:
|
||||
aResult = aPresContext->DefaultBackgroundColor();
|
||||
break;
|
||||
default:
|
||||
NS_NOTREACHED("Should never have an unknown negative colorID.");
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user