Title: [167878] trunk/Source/WebCore
Revision
167878
Author
[email protected]
Date
2014-04-28 01:16:15 -0700 (Mon, 28 Apr 2014)

Log Message

std::bitset<>::test() does unnecessary bounds checks on CSSPropertyID bitsets
https://bugs.webkit.org/show_bug.cgi?id=131685

Patch by Zan Dobersek <[email protected]> on 2014-04-28
Reviewed by Darin Adler.

Use std::bitset<>::operator[]() instead of std::bitset<>::test() to avoid
bounds checks which are not necessary as long as a CSSPropertyID value is used.

* css/CSSParser.cpp:
(WebCore::filterProperties):
* css/StyleProperties.cpp:
(WebCore::StyleProperties::asText):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::CascadedProperties::hasProperty):
(WebCore::StyleResolver::CascadedProperties::set):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (167877 => 167878)


--- trunk/Source/WebCore/ChangeLog	2014-04-28 08:12:08 UTC (rev 167877)
+++ trunk/Source/WebCore/ChangeLog	2014-04-28 08:16:15 UTC (rev 167878)
@@ -23,6 +23,21 @@
 
         Reviewed by Martin Robinson.
 
+        Improve coding style according to review comments, that I forgot
+        to do before landing previous commit.
+
+        * bindings/gobject/WebKitDOMCustom.cpp:
+        (webkit_dom_text_track_get_kind):
+        (webkit_dom_text_track_get_mode):
+        (webkit_dom_text_track_set_mode):
+
+2014-04-28  Carlos Garcia Campos  <[email protected]>
+
+        [GTK] TextTrack kind and mode attributes are enums since r166180
+        https://bugs.webkit.org/show_bug.cgi?id=132228
+
+        Reviewed by Martin Robinson.
+
         We don't support enum values yet in GObject DOM bindings, but they
         are internally strings anyway, so we can keep the old
         implementations using strings as custom functions until we

Modified: trunk/Source/WebCore/bindings/gobject/WebKitDOMCustom.cpp (167877 => 167878)


--- trunk/Source/WebCore/bindings/gobject/WebKitDOMCustom.cpp	2014-04-28 08:12:08 UTC (rev 167877)
+++ trunk/Source/WebCore/bindings/gobject/WebKitDOMCustom.cpp	2014-04-28 08:16:15 UTC (rev 167878)
@@ -70,8 +70,7 @@
     WebCore::JSMainThreadNullState state;
     g_return_val_if_fail(WEBKIT_DOM_IS_TEXT_TRACK(self), 0);
     WebCore::TextTrack* item = WebKit::core(self);
-    gchar* result = convertToUTF8String(item->kind());
-    return result;
+    return convertToUTF8String(item->kind());
 #else
     WEBKIT_WARN_FEATURE_NOT_PRESENT("Video Track")
     return 0;
@@ -84,8 +83,7 @@
     WebCore::JSMainThreadNullState state;
     g_return_val_if_fail(WEBKIT_DOM_IS_TEXT_TRACK(self), 0);
     WebCore::TextTrack* item = WebKit::core(self);
-    gchar* result = convertToUTF8String(item->mode());
-    return result;
+    return convertToUTF8String(item->mode());
 #else
     WEBKIT_WARN_FEATURE_NOT_PRESENT("Video Track")
     return 0;
@@ -98,9 +96,7 @@
     WebCore::JSMainThreadNullState state;
     g_return_if_fail(WEBKIT_DOM_IS_TEXT_TRACK(self));
     g_return_if_fail(value);
-    WebCore::TextTrack* item = WebKit::core(self);
-    WTF::String convertedValue = WTF::String::fromUTF8(value);
-    item->setMode(convertedValue);
+    WebKit::core(self)->setMode(WTF::String::fromUTF8(value));
 #else
     WEBKIT_WARN_FEATURE_NOT_PRESENT("Video Track")
 #endif /* ENABLE(VIDEO_TRACK) */
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to