Commit e4a13a8b authored by Mason Freed's avatar Mason Freed Committed by Commit Bot

Add console warning for invalid declarative shadowroot attribute

Fixed: 1063153
Change-Id: Ia9060c5d7fd0ae0ec10a9014cbf9bc1cbf0df1bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2122246
Commit-Queue: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: default avatarKouhei Ueno <kouhei@chromium.org>
Auto-Submit: Mason Freed <masonfreed@chromium.org>
Cr-Commit-Position: refs/heads/master@{#755160}
parent a8273564
...@@ -843,7 +843,7 @@ CreateElementFlags HTMLConstructionSite::GetCreateElementFlags() const { ...@@ -843,7 +843,7 @@ CreateElementFlags HTMLConstructionSite::GetCreateElementFlags() const {
: CreateElementFlags::ByParser(); : CreateElementFlags::ByParser();
} }
inline Document& HTMLConstructionSite::OwnerDocumentForCurrentNode() { Document& HTMLConstructionSite::OwnerDocumentForCurrentNode() {
if (auto* template_element = DynamicTo<HTMLTemplateElement>(*CurrentNode())) if (auto* template_element = DynamicTo<HTMLTemplateElement>(*CurrentNode()))
return template_element->content()->GetDocument(); return template_element->content()->GetDocument();
return CurrentNode()->GetDocument(); return CurrentNode()->GetDocument();
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include "third_party/blink/renderer/core/html/parser/html_token.h" #include "third_party/blink/renderer/core/html/parser/html_token.h"
#include "third_party/blink/renderer/core/html/parser/html_tokenizer.h" #include "third_party/blink/renderer/core/html/parser/html_tokenizer.h"
#include "third_party/blink/renderer/core/html_names.h" #include "third_party/blink/renderer/core/html_names.h"
#include "third_party/blink/renderer/core/inspector/console_message.h"
#include "third_party/blink/renderer/core/mathml_names.h" #include "third_party/blink/renderer/core/mathml_names.h"
#include "third_party/blink/renderer/core/svg_names.h" #include "third_party/blink/renderer/core/svg_names.h"
#include "third_party/blink/renderer/core/xlink_names.h" #include "third_party/blink/renderer/core/xlink_names.h"
...@@ -944,8 +945,13 @@ bool HTMLTreeBuilder::ProcessTemplateEndTag(AtomicHTMLToken* token) { ...@@ -944,8 +945,13 @@ bool HTMLTreeBuilder::ProcessTemplateEndTag(AtomicHTMLToken* token) {
manual_slotting ? SlotAssignmentMode::kManual manual_slotting ? SlotAssignmentMode::kManual
: SlotAssignmentMode::kAuto); : SlotAssignmentMode::kAuto);
} else { } else {
// TODO(1063153): Add a console warning here. tree_.OwnerDocumentForCurrentNode().AddConsoleMessage(
LOG(ERROR) << "Invalid shadowroot value " << shadow_mode; MakeGarbageCollected<ConsoleMessage>(
mojom::blink::ConsoleMessageSource::kOther,
mojom::blink::ConsoleMessageLevel::kWarning,
"Invalid declarative shadowroot attribute value \"" +
shadow_mode +
"\". Valid values include \"open\" and \"closed\"."));
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment