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

Unified Diff: Source/modules/notifications/Notification.cpp

Issue 1110223002: Use and add layout tests for BCP 47 language tag syntax validation. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 8 months 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: Source/modules/notifications/Notification.cpp
diff --git a/Source/modules/notifications/Notification.cpp b/Source/modules/notifications/Notification.cpp
index 227238ee3de57445545df040d126cc92a36323a5..a2d4c6f7bf8680f4ce306d15415779559fd813ef 100644
--- a/Source/modules/notifications/Notification.cpp
+++ b/Source/modules/notifications/Notification.cpp
@@ -96,7 +96,10 @@ Notification* Notification::create(ExecutionContext* context, const String& titl
notification->setBody(options.body());
notification->setTag(options.tag());
- notification->setLang(options.lang());
+
+ if (Platform::current()->isValidLocaleSyntax(options.lang()))
+ notification->setLang(options.lang());
+
notification->setDir(options.dir());
notification->setVibrate(NavigatorVibration::sanitizeVibrationPattern(options.vibrate()));
notification->setSilent(options.silent());
« no previous file with comments | « Source/modules/mediasource/TrackDefault.cpp ('k') | Source/modules/notifications/ServiceWorkerRegistrationNotifications.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698