mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-08 00:07:30 +09:00
HTML - implement the labels attribute (follow up)
This commit is contained in:
parent
5b24f05ce7
commit
b9e802f497
20 changed files with 87 additions and 77 deletions
|
|
@ -1919,26 +1919,26 @@ XULDocument::StartLayout(void)
|
|||
|
||||
/* static */
|
||||
bool
|
||||
XULDocument::MatchAttribute(nsIContent* aContent,
|
||||
XULDocument::MatchAttribute(Element* aElement,
|
||||
int32_t aNamespaceID,
|
||||
nsIAtom* aAttrName,
|
||||
void* aData)
|
||||
{
|
||||
NS_PRECONDITION(aContent, "Must have content node to work with!");
|
||||
NS_PRECONDITION(aElement, "Must have content node to work with!");
|
||||
nsString* attrValue = static_cast<nsString*>(aData);
|
||||
if (aNamespaceID != kNameSpaceID_Unknown &&
|
||||
aNamespaceID != kNameSpaceID_Wildcard) {
|
||||
return attrValue->EqualsLiteral("*") ?
|
||||
aContent->HasAttr(aNamespaceID, aAttrName) :
|
||||
aContent->AttrValueIs(aNamespaceID, aAttrName, *attrValue,
|
||||
aElement->HasAttr(aNamespaceID, aAttrName) :
|
||||
aElement->AttrValueIs(aNamespaceID, aAttrName, *attrValue,
|
||||
eCaseMatters);
|
||||
}
|
||||
|
||||
// Qualified name match. This takes more work.
|
||||
|
||||
uint32_t count = aContent->GetAttrCount();
|
||||
uint32_t count = aElement->GetAttrCount();
|
||||
for (uint32_t i = 0; i < count; ++i) {
|
||||
const nsAttrName* name = aContent->GetAttrNameAt(i);
|
||||
const nsAttrName* name = aElement->GetAttrNameAt(i);
|
||||
bool nameMatch;
|
||||
if (name->IsAtom()) {
|
||||
nameMatch = name->Atom() == aAttrName;
|
||||
|
|
@ -1950,7 +1950,7 @@ XULDocument::MatchAttribute(nsIContent* aContent,
|
|||
|
||||
if (nameMatch) {
|
||||
return attrValue->EqualsLiteral("*") ||
|
||||
aContent->AttrValueIs(name->NamespaceID(), name->LocalName(),
|
||||
aElement->AttrValueIs(name->NamespaceID(), name->LocalName(),
|
||||
*attrValue, eCaseMatters);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue