From a67087fae87ccc6dd60503c2c845f5cd7b24d192 Mon Sep 17 00:00:00 2001 From: Ryan Nematz Date: Fri, 24 Jun 2016 05:05:39 -0400 Subject: [PATCH] cursor:none and content:none --- layout/style/nsCSSParser.cpp | 6 ++++-- layout/style/nsRuleNode.cpp | 5 +++-- rzTests/rz3-test.css | 8 ++++++++ rzTests/rz3-test.htm | 5 +++++ widget/src/windows/nsWindow.cpp | 4 +++- 5 files changed, 23 insertions(+), 5 deletions(-) diff --git a/layout/style/nsCSSParser.cpp b/layout/style/nsCSSParser.cpp index 50e55cd6..e1a4ecf0 100644 --- a/layout/style/nsCSSParser.cpp +++ b/layout/style/nsCSSParser.cpp @@ -5210,7 +5210,8 @@ PRBool CSSParserImpl::ParseContent(nsresult& aErrorCode) // XXX Rewrite to make it look more like ParseCursor or ParseCounterData? nsCSSValue value; if (ParseVariant(aErrorCode, value, - VARIANT_CONTENT | VARIANT_INHERIT | VARIANT_NORMAL, + VARIANT_CONTENT | VARIANT_INHERIT | VARIANT_NORMAL | + VARIANT_NONE, nsCSSProps::kContentKTable)) { nsCSSValueList* listHead = new nsCSSValueList(); nsCSSValueList* list = listHead; @@ -5229,7 +5230,8 @@ PRBool CSSParserImpl::ParseContent(nsresult& aErrorCode) } if (eCSSUnit_Inherit == value.GetUnit() || eCSSUnit_Initial == value.GetUnit() || - eCSSUnit_Normal == value.GetUnit()) { + eCSSUnit_Normal == value.GetUnit() || + eCSSUnit_None == value.GetUnit()) { // This only matters the first time through the loop. return PR_FALSE; } diff --git a/layout/style/nsRuleNode.cpp b/layout/style/nsRuleNode.cpp index 2441434e..4b0f22d0 100644 --- a/layout/style/nsRuleNode.cpp +++ b/layout/style/nsRuleNode.cpp @@ -4186,14 +4186,15 @@ nsRuleNode::ComputeContentData(nsStyleStruct* aStartStruct, parentContent = parentContext->GetStyleContent(); PRBool inherited = aInherited; - // content: [string, url, counter, attr, enum]+, normal, inherit + // content: [string, url, counter, attr, enum]+, normal, none, inherit PRUint32 count; nsAutoString buffer; nsCSSValueList* contentValue = contentData.mContent; if (contentValue) { if (eCSSUnit_Normal == contentValue->mValue.GetUnit() || + eCSSUnit_None == contentValue->mValue.GetUnit() || eCSSUnit_Initial == contentValue->mValue.GetUnit()) { - // "normal" and "initial" both mean no content + // "normal", "none", and "initial" all mean no content content->AllocateContents(0); } else if (eCSSUnit_Inherit == contentValue->mValue.GetUnit()) { diff --git a/rzTests/rz3-test.css b/rzTests/rz3-test.css index d8e3fca5..76692b0e 100644 --- a/rzTests/rz3-test.css +++ b/rzTests/rz3-test.css @@ -1,4 +1,12 @@ /* RetroZilla 3.0 Test Page Stylesheet */ #bug346690 { cursor: none; +} + +.bug378535:before { + content: "Read this - "; +} + +.bug378535#hometown:before { + content: none; } \ No newline at end of file diff --git a/rzTests/rz3-test.htm b/rzTests/rz3-test.htm index 99c31372..25852eb0 100644 --- a/rzTests/rz3-test.htm +++ b/rzTests/rz3-test.htm @@ -14,5 +14,10 @@

cursor:none


+

content:none (bug 378535)

+

My name is Donald

+

I live in Ducksburg

+ +
\ No newline at end of file diff --git a/widget/src/windows/nsWindow.cpp b/widget/src/windows/nsWindow.cpp index ae9040a8..80958c9a 100644 --- a/widget/src/windows/nsWindow.cpp +++ b/widget/src/windows/nsWindow.cpp @@ -2777,7 +2777,9 @@ NS_METHOD nsWindow::SetCursor(nsCursor aCursor) case eCursor_ew_resize: newCursor = ::LoadCursor(NULL, IDC_SIZEWE); break; - + case eCursor_none: + newCursor = ::LoadCursor(nsToolkit::mDllInstance, MAKEINTRESOURCE(IDC_NONE)); + break; default: NS_ERROR("Invalid cursor type"); break;