mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 183646 ::-moz-selection does not work in form controls (input[type=text], input[type=password], textarea) r=dbaron
This commit is contained in:
parent
9dc08b1cf0
commit
ec0f459b5b
@ -3128,12 +3128,17 @@ nsTextPaintStyle::InitCommonColors()
|
||||
}
|
||||
|
||||
static nsIContent*
|
||||
FindElementAncestor(nsINode* aNode)
|
||||
FindElementAncestorForMozSelection(nsIContent* aContent)
|
||||
{
|
||||
while (aNode && !aNode->IsNodeOfType(nsINode::eELEMENT)) {
|
||||
aNode = aNode->GetParent();
|
||||
NS_ENSURE_TRUE(aContent, nsnull);
|
||||
while (aContent && aContent->IsInNativeAnonymousSubtree()) {
|
||||
aContent = aContent->GetBindingParent();
|
||||
}
|
||||
return static_cast<nsIContent*>(aNode);
|
||||
NS_ASSERTION(aContent, "aContent isn't in non-anonymous tree?");
|
||||
while (aContent && !aContent->IsNodeOfType(nsINode::eELEMENT)) {
|
||||
aContent = aContent->GetParent();
|
||||
}
|
||||
return aContent;
|
||||
}
|
||||
|
||||
PRBool
|
||||
@ -3155,7 +3160,8 @@ nsTextPaintStyle::InitSelectionColors()
|
||||
mInitSelectionColors = PR_TRUE;
|
||||
|
||||
nsIFrame* nonGeneratedAncestor = nsLayoutUtils::GetNonGeneratedAncestor(mFrame);
|
||||
nsIContent* selectionContent = FindElementAncestor(nonGeneratedAncestor->GetContent());
|
||||
nsIContent* selectionContent =
|
||||
FindElementAncestorForMozSelection(nonGeneratedAncestor->GetContent());
|
||||
|
||||
if (selectionContent &&
|
||||
selectionStatus == nsISelectionController::SELECTION_ON) {
|
||||
|
@ -0,0 +1,13 @@
|
||||
<html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
input {
|
||||
color: white;
|
||||
background-color: green;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body onload="document.getElementById('i').select();">
|
||||
<input value="text" id="i">
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,17 @@
|
||||
<html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
input {
|
||||
color: white;
|
||||
background-color: green;
|
||||
}
|
||||
input::-moz-selection {
|
||||
color: red;
|
||||
background-color: blue;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body onload="document.getElementById('i').select();">
|
||||
<input value="text" id="i">
|
||||
</body>
|
||||
</html>
|
@ -24,3 +24,4 @@
|
||||
== extend-3i.html extend-3-ref.html
|
||||
== extend-4a.html extend-4-ref.html
|
||||
== extend-4b.html extend-4-ref.html
|
||||
!= pseudo-element-of-native-anonymous.html pseudo-element-of-native-anonymous-ref.html
|
||||
|
Loading…
Reference in New Issue
Block a user