зеркало из https://github.com/mozilla/gecko-dev.git
Bug 686581 - Implement -moz-is-resource-document media query. r=roc
This commit is contained in:
Родитель
8b5c8e5ecf
Коммит
24bda5455f
|
@ -1902,6 +1902,7 @@ GK_ATOM(_moz_maemo_classic, "-moz-maemo-classic")
|
|||
GK_ATOM(_moz_menubar_drag, "-moz-menubar-drag")
|
||||
GK_ATOM(_moz_device_pixel_ratio, "-moz-device-pixel-ratio")
|
||||
GK_ATOM(_moz_device_orientation, "-moz-device-orientation")
|
||||
GK_ATOM(_moz_is_resource_document, "-moz-is-resource-document")
|
||||
|
||||
#ifdef ACCESSIBILITY
|
||||
GK_ATOM(anonid, "anonid")
|
||||
|
|
|
@ -194,6 +194,15 @@ GetDeviceOrientation(nsPresContext* aPresContext, const nsMediaFeature*,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
static nsresult
|
||||
GetIsResourceDocument(nsPresContext* aPresContext, const nsMediaFeature*,
|
||||
nsCSSValue& aResult)
|
||||
{
|
||||
nsIDocument* doc = aPresContext->Document();
|
||||
aResult.SetIntValue(doc && doc->IsResourceDoc() ? 1 : 0, eCSSUnit_Integer);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Helper for two features below
|
||||
static nsresult
|
||||
MakeArray(const nsSize& aSize, nsCSSValue& aResult)
|
||||
|
@ -460,6 +469,13 @@ nsMediaFeatures::features[] = {
|
|||
{ kOrientationKeywords },
|
||||
GetDeviceOrientation
|
||||
},
|
||||
{
|
||||
&nsGkAtoms::_moz_is_resource_document,
|
||||
nsMediaFeature::eMinMaxNotAllowed,
|
||||
nsMediaFeature::eBoolInteger,
|
||||
{ nsnull },
|
||||
GetIsResourceDocument
|
||||
},
|
||||
{
|
||||
&nsGkAtoms::_moz_scrollbar_start_backward,
|
||||
nsMediaFeature::eMinMaxNotAllowed,
|
||||
|
|
Загрузка…
Ссылка в новой задаче