void ShadowRoot::recalcStyle(StyleRecalcChange change) { // ShadowRoot doesn't support custom callbacks. ASSERT(!hasCustomStyleCallbacks()); StyleResolverParentScope parentScope(*this); if (styleChangeType() >= SubtreeStyleChange) change = Force; if (change < Force && hasRareData() && childNeedsStyleRecalc()) checkForChildrenAdjacentRuleChanges(); // There's no style to update so just calling recalcStyle means we're updated. clearNeedsStyleRecalc(); // FIXME: This doesn't handle :hover + div properly like Element::recalcStyle does. Text* lastTextNode = 0; for (Node* child = lastChild(); child; child = child->previousSibling()) { if (child->isTextNode()) { toText(child)->recalcTextStyle(change, lastTextNode); lastTextNode = toText(child); } else if (child->isElementNode()) { if (child->shouldCallRecalcStyle(change)) toElement(child)->recalcStyle(change, lastTextNode); if (child->renderer()) lastTextNode = 0; } } clearChildNeedsStyleRecalc(); }
void ShadowRoot::recalcStyle(StyleRecalcChange change) { // ShadowRoot doesn't support custom callbacks. ASSERT(!hasCustomStyleCallbacks()); StyleResolverParentScope parentScope(*this); if (styleChangeType() >= SubtreeStyleChange) change = Force; // There's no style to update so just calling recalcStyle means we're updated. clearNeedsStyleRecalc(); recalcChildStyle(change); clearChildNeedsStyleRecalc(); }
END_REGISTER_ANIMATED_PROPERTIES inline SVGUseElement::SVGUseElement(Document& document, bool wasInsertedByParser) : SVGGraphicsElement(SVGNames::useTag, document) , m_x(LengthModeWidth) , m_y(LengthModeHeight) , m_width(LengthModeWidth) , m_height(LengthModeHeight) , m_wasInsertedByParser(wasInsertedByParser) , m_haveFiredLoadEvent(false) , m_needsShadowTreeRecreation(false) , m_svgLoadEventTimer(this, &SVGElement::svgLoadEventTimerFired) { ASSERT(hasCustomStyleCallbacks()); ScriptWrappable::init(this); registerAnimatedPropertiesForSVGUseElement(); }
inline SVGUseElement::SVGUseElement(Document& document) : SVGGraphicsElement(SVGNames::useTag, document) , SVGURIReference(this) , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(SVGLengthMode::Width))) , m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(SVGLengthMode::Height))) , m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::create(SVGLengthMode::Width))) , m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::create(SVGLengthMode::Height))) , m_haveFiredLoadEvent(false) , m_needsShadowTreeRecreation(false) { ASSERT(hasCustomStyleCallbacks()); addToPropertyMap(m_x); addToPropertyMap(m_y); addToPropertyMap(m_width); addToPropertyMap(m_height); }
END_REGISTER_ANIMATED_PROPERTIES inline SVGUseElement::SVGUseElement(const QualifiedName& tagName, Document* document, bool wasInsertedByParser) : SVGStyledTransformableElement(tagName, document) , m_x(LengthModeWidth) , m_y(LengthModeHeight) , m_width(LengthModeWidth) , m_height(LengthModeHeight) , m_wasInsertedByParser(wasInsertedByParser) , m_haveFiredLoadEvent(false) , m_needsShadowTreeRecreation(false) , m_svgLoadEventTimer(this, &SVGElement::svgLoadEventTimerFired) { ASSERT(hasCustomStyleCallbacks()); ASSERT(hasTagName(SVGNames::useTag)); registerAnimatedPropertiesForSVGUseElement(); }
void ShadowRoot::recalcStyle(StyleRecalcChange change) { // ShadowRoot doesn't support custom callbacks. DCHECK(!hasCustomStyleCallbacks()); StyleSharingDepthScope sharingScope(*this); if (getStyleChangeType() >= SubtreeStyleChange) change = Force; // There's no style to update so just calling recalcStyle means we're updated. clearNeedsStyleRecalc(); clearNeedsReattachLayoutTree(); recalcDescendantStyles(change); clearChildNeedsStyleRecalc(); clearChildNeedsReattachLayoutTree(); }
void ShadowRoot::recalcStyle(StyleChange change) { // ShadowRoot doesn't support custom callbacks. ASSERT(!hasCustomStyleCallbacks()); StyleResolver* styleResolver = document()->styleResolver(); styleResolver->pushParentShadowRoot(this); for (Node* child = firstChild(); child; child = child->nextSibling()) { if (child->isElementNode()) toElement(child)->recalcStyle(change); else if (child->isTextNode()) toText(child)->recalcTextStyle(change); } styleResolver->popParentShadowRoot(this); clearNeedsStyleRecalc(); clearChildNeedsStyleRecalc(); }