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

Unified Diff: third_party/WebKit/Source/core/html/forms/RadioButtonGroupScope.cpp

Issue 2502763004: INPUT element: Deprecate case-insensitive matching for radio button group names. (Closed)
Patch Set: a 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
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameConsole.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/forms/RadioButtonGroupScope.cpp
diff --git a/third_party/WebKit/Source/core/html/forms/RadioButtonGroupScope.cpp b/third_party/WebKit/Source/core/html/forms/RadioButtonGroupScope.cpp
index 73b2271d731cebd4f833f4079b97ce72129d74fe..75a93886b5cfb3fd8908f71393e3ba5ee66e5687 100644
--- a/third_party/WebKit/Source/core/html/forms/RadioButtonGroupScope.cpp
+++ b/third_party/WebKit/Source/core/html/forms/RadioButtonGroupScope.cpp
@@ -21,11 +21,30 @@
#include "core/html/forms/RadioButtonGroupScope.h"
#include "core/InputTypeNames.h"
+#include "core/frame/Deprecation.h"
+#include "core/frame/FrameConsole.h"
+#include "core/frame/LocalFrame.h"
#include "core/html/HTMLInputElement.h"
+#include "core/inspector/ConsoleMessage.h"
#include "wtf/HashMap.h"
namespace blink {
+namespace {
+
+void addSingletonDeprecationMessage(const LocalFrame* frame,
+ UseCounter::Feature feature,
+ const AtomicString& name1,
+ const AtomicString& name2) {
+ if (!frame)
+ return;
+ frame->console().addSingletonMessage(ConsoleMessage::create(
+ DeprecationMessageSource, WarningMessageLevel,
+ Deprecation::deprecationMessage(feature) + " Comparing name=" + name1 +
+ " and name=" + name2));
+}
+}
+
class RadioButtonGroup : public GarbageCollected<RadioButtonGroup> {
public:
static RadioButtonGroup* create();
@@ -218,15 +237,18 @@ void RadioButtonGroupScope::addButton(HTMLInputElement* element) {
if (!keyValue->value) {
keyValue->value = RadioButtonGroup::create();
} else {
- if (keyValue->key == element->name())
+ if (keyValue->key == element->name()) {
UseCounter::count(element->document(),
UseCounter::RadioNameMatchingStrict);
- else if (equalIgnoringASCIICase(keyValue->key, element->name()))
- UseCounter::count(element->document(),
- UseCounter::RadioNameMatchingASCIICaseless);
- else
- UseCounter::count(element->document(),
- UseCounter::RadioNameMatchingCaseFolding);
+ } else if (equalIgnoringASCIICase(keyValue->key, element->name())) {
+ addSingletonDeprecationMessage(element->document().frame(),
+ UseCounter::RadioNameMatchingASCIICaseless,
+ keyValue->key, element->name());
+ } else {
+ addSingletonDeprecationMessage(element->document().frame(),
+ UseCounter::RadioNameMatchingCaseFolding,
+ keyValue->key, element->name());
+ }
}
keyValue->value->add(element);
}
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameConsole.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698