Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Unified Diff: third_party/WebKit/Source/core/css/CSSDefaultStyleSheets.cpp

Issue 2466243002: Add a UA style, "display: contents", for <slot> (Closed)
Patch Set: updatae Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/css/CSSDefaultStyleSheets.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSDefaultStyleSheets.cpp b/third_party/WebKit/Source/core/css/CSSDefaultStyleSheets.cpp
index 1a2b48ee9bd2eb370ddb8d62904f4f479509865d..77fb48b80f86360cf8573b64070b75660cbd1d1e 100644
--- a/third_party/WebKit/Source/core/css/CSSDefaultStyleSheets.cpp
+++ b/third_party/WebKit/Source/core/css/CSSDefaultStyleSheets.cpp
@@ -37,6 +37,7 @@
#include "core/dom/Fullscreen.h"
#include "core/html/HTMLAnchorElement.h"
#include "core/html/HTMLHtmlElement.h"
+#include "core/html/HTMLSlotElement.h"
#include "core/layout/LayoutTheme.h"
#include "platform/PlatformResourceLoader.h"
#include "wtf/LeakAnnotations.h"
@@ -159,6 +160,15 @@ bool CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement(
changedDefaultStyle = true;
}
+ if (isHTMLSlotElement(element) &&
+ RuntimeEnabledFeatures::cssDisplayContentsEnabled() &&
+ !m_slotStyleSheet) {
kochi 2016/11/01 06:43:13 If the reason for having a separate UA stylesheet
rune 2016/11/01 07:38:17 I think we might as well add it to html.css. When
+ m_slotStyleSheet = parseUASheet(loadResourceAsASCIIString("slot.css"));
+ m_defaultStyle->addRulesFromSheet(slotStyleSheet(), screenEval());
+ m_defaultPrintStyle->addRulesFromSheet(slotStyleSheet(), printEval());
+ changedDefaultStyle = true;
+ }
+
ASSERT(!m_defaultStyle->features().hasIdsInSelectors());
ASSERT(m_defaultStyle->features().siblingRules.isEmpty());
return changedDefaultStyle;
@@ -189,6 +199,7 @@ DEFINE_TRACE(CSSDefaultStyleSheets) {
visitor->trace(m_mathmlStyleSheet);
visitor->trace(m_mediaControlsStyleSheet);
visitor->trace(m_fullscreenStyleSheet);
+ visitor->trace(m_slotStyleSheet);
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698