cursor:none and content:none

This commit is contained in:
Ryan Nematz 2016-06-24 05:05:39 -04:00
parent 70a63e3fce
commit a67087fae8
5 changed files with 23 additions and 5 deletions

View File

@ -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;
}

View File

@ -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()) {

View File

@ -1,4 +1,12 @@
/* RetroZilla 3.0 Test Page Stylesheet */
#bug346690 {
cursor: none;
}
.bug378535:before {
content: "Read this - ";
}
.bug378535#hometown:before {
content: none;
}

View File

@ -14,5 +14,10 @@
<h3>cursor:none</h3>
<img src="test-image.gif" id="bug346690">
<hr>
<h2>content:none (bug 378535)</h2>
<p class="bug378535">My name is Donald</p>
<p class="bug378535" id="hometown">I live in Ducksburg</p>
<hr>
</body>
</html>

View File

@ -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;