зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1253476 - Move IsRendered to Element; r=emilio
And update the GitHub issue link at the same time since #3947 was duped to #1837. Differential Revision: https://phabricator.services.mozilla.com/D30326 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
cb3c791020
Коммит
7980decbd6
|
@ -1407,6 +1407,14 @@ class Element : public FragmentOrElement {
|
||||||
return HasServoData() && Servo_Element_IsDisplayContents(this);
|
return HasServoData() && Servo_Element_IsDisplayContents(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* https://html.spec.whatwg.org/#being-rendered
|
||||||
|
*
|
||||||
|
* With a gotcha for display contents:
|
||||||
|
* https://github.com/whatwg/html/issues/1837
|
||||||
|
*/
|
||||||
|
bool IsRendered() const { return GetPrimaryFrame() || IsDisplayContents(); }
|
||||||
|
|
||||||
const nsAttrValue* GetParsedAttr(const nsAtom* aAttr) const {
|
const nsAttrValue* GetParsedAttr(const nsAtom* aAttr) const {
|
||||||
return mAttrs.GetAttr(aAttr);
|
return mAttrs.GetAttr(aAttr);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2653,14 +2653,6 @@ nsresult nsGenericHTMLElement::NewURIFromString(const nsAString& aURISpec,
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#being-rendered
|
|
||||||
//
|
|
||||||
// With a gotcha for display contents:
|
|
||||||
// https://github.com/whatwg/html/issues/3947
|
|
||||||
static bool IsRendered(const Element& aElement) {
|
|
||||||
return aElement.GetPrimaryFrame() || aElement.IsDisplayContents();
|
|
||||||
}
|
|
||||||
|
|
||||||
void nsGenericHTMLElement::GetInnerText(mozilla::dom::DOMString& aValue,
|
void nsGenericHTMLElement::GetInnerText(mozilla::dom::DOMString& aValue,
|
||||||
mozilla::ErrorResult& aError) {
|
mozilla::ErrorResult& aError) {
|
||||||
// innerText depends on layout. For example, white space processing is
|
// innerText depends on layout. For example, white space processing is
|
||||||
|
@ -2715,7 +2707,7 @@ void nsGenericHTMLElement::GetInnerText(mozilla::dom::DOMString& aValue,
|
||||||
doc->FlushPendingNotifications(FlushType::Layout);
|
doc->FlushPendingNotifications(FlushType::Layout);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IsRendered(*this)) {
|
if (!IsRendered()) {
|
||||||
GetTextContentInternal(aValue, aError);
|
GetTextContentInternal(aValue, aError);
|
||||||
} else {
|
} else {
|
||||||
nsRange::GetInnerTextNoFlush(aValue, aError, this);
|
nsRange::GetInnerTextNoFlush(aValue, aError, this);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче