Commit ada1a56e authored by Kent Tamura's avatar Kent Tamura Committed by Commit Bot

Change the level of Selection.addRange failure message.

Error -> Warning.

Bug: 697443
Change-Id: Ib4e88bb64cd5f1a533ae88306c47e91ca0606085
Reviewed-on: https://chromium-review.googlesource.com/c/1337216Reviewed-by: default avatarYoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#608284}
parent 6d58bff2
CONSOLE ERROR: line 29: The given range isn't in document.
CONSOLE WARNING: line 29: addRange(): The given range isn't in document.
CONSOLE WARNING: line 46: Element.createShadowRoot is deprecated and will be removed in M73, around March 2019. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 for more details.
Test error handling of Selection.addRange().
......
......@@ -624,7 +624,7 @@ void DOMSelection::addRange(Range* new_range) {
return;
if (!new_range->IsConnected()) {
AddConsoleError("The given range isn't in document.");
AddConsoleWarning("addRange(): The given range isn't in document.");
return;
}
......@@ -832,10 +832,11 @@ bool DOMSelection::IsValidForPosition(Node* node) const {
node->isConnected();
}
void DOMSelection::AddConsoleError(const String& message) {
if (tree_scope_)
tree_scope_->GetDocument().AddConsoleMessage(
ConsoleMessage::Create(kJSMessageSource, kErrorMessageLevel, message));
void DOMSelection::AddConsoleWarning(const String& message) {
if (tree_scope_) {
tree_scope_->GetDocument().AddConsoleMessage(ConsoleMessage::Create(
kJSMessageSource, kWarningMessageLevel, message));
}
}
void DOMSelection::Trace(blink::Visitor* visitor) {
......
......@@ -122,7 +122,7 @@ class CORE_EXPORT DOMSelection final : public ScriptWrappable,
bool IsValidForPosition(Node*) const;
void AddConsoleError(const String& message);
void AddConsoleWarning(const String& message);
Range* PrimaryRangeOrNull() const;
EphemeralRange CreateRangeFromSelectionEditor() const;
......
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