#include "config.h"
#include "core/dom/ShadowTreeStyleSheetCollection.h"
-#include "HTMLNames.h"
+#include "core/HTMLNames.h"
#include "core/css/CSSStyleSheet.h"
#include "core/css/resolver/StyleResolver.h"
#include "core/dom/Element.h"
#include "core/dom/shadow/ShadowRoot.h"
#include "core/html/HTMLStyleElement.h"
-namespace WebCore {
+namespace blink {
using namespace HTMLNames;
}
}
-bool ShadowTreeStyleSheetCollection::updateActiveStyleSheets(StyleEngine* engine, StyleResolverUpdateMode updateMode)
+void ShadowTreeStyleSheetCollection::updateActiveStyleSheets(StyleEngine* engine, StyleResolverUpdateMode updateMode)
{
StyleSheetCollection collection;
collectStyleSheets(engine, collection);
analyzeStyleSheetChange(updateMode, collection, change);
if (StyleResolver* styleResolver = engine->resolver()) {
- // FIXME: We might have already had styles in child treescope. In this case, we cannot use buildScopedStyleTreeInDocumentOrder.
- // Need to change "false" to some valid condition.
- styleResolver->setBuildScopedStyleTreeInDocumentOrder(false);
if (change.styleResolverUpdateType != Additive) {
// We should not destroy StyleResolver when we find any stylesheet update in a shadow tree.
// In this case, we will reset rulesets created from style elements in the shadow tree.
- resetAllRuleSetsInTreeScope(styleResolver);
+ styleResolver->resetAuthorStyle(treeScope());
styleResolver->removePendingAuthorStyleSheets(m_activeAuthorStyleSheets);
styleResolver->lazyAppendAuthorStyleSheets(0, collection.activeAuthorStyleSheets());
} else {
}
}
if (change.requiresFullStyleRecalc)
- toShadowRoot(m_treeScope.rootNode()).host()->setNeedsStyleRecalc(SubtreeStyleChange);
+ toShadowRoot(treeScope().rootNode()).host()->setNeedsStyleRecalc(SubtreeStyleChange);
- m_scopingNodesForStyleScoped.didRemoveScopingNodes();
collection.swap(*this);
updateUsesRemUnits();
-
- return change.requiresFullStyleRecalc;
}
}