Changeset 114101 in webkit


Ignore:
Timestamp:
Apr 13, 2012 2:15:27 AM (12 years ago)
Author:
tkent@chromium.org
Message:

Add a runtime flag for <input type=date>
https://bugs.webkit.org/show_bug.cgi?id=83853

Reviewed by Adam Barth.

Source/WebCore:

  • bindings/generic/RuntimeEnabledFeatures.cpp:
  • bindings/generic/RuntimeEnabledFeatures.h:

(WebCore::RuntimeEnabledFeatures::inputTypeDateEnabled): Added.
(WebCore::RuntimeEnabledFeatures::setInputTypeDateEnabled): Added.

  • html/InputType.cpp:

(WebCore::createInputTypeFactoryMap):
Don't register type=date if !RuntimeEnabledFeatures::inputTypeDateEnabled()

Source/WebKit/chromium:

  • public/WebRuntimeFeatures.h:

(WebRuntimeFeatures): Add enableInputTypeDate() and isInputTypeDateEnabled().

  • src/WebRuntimeFeatures.cpp:

(WebKit::WebRuntimeFeatures::enableInputTypeDate): Added.
(WebKit::WebRuntimeFeatures::isInputTypeDateEnabled): Added.

Location:
trunk/Source
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r114098 r114101  
     12012-04-13  Kent Tamura  <tkent@chromium.org>
     2
     3        Add a runtime flag for <input type=date>
     4        https://bugs.webkit.org/show_bug.cgi?id=83853
     5
     6        Reviewed by Adam Barth.
     7
     8        * bindings/generic/RuntimeEnabledFeatures.cpp:
     9        * bindings/generic/RuntimeEnabledFeatures.h:
     10        (WebCore::RuntimeEnabledFeatures::inputTypeDateEnabled): Added.
     11        (WebCore::RuntimeEnabledFeatures::setInputTypeDateEnabled): Added.
     12        * html/InputType.cpp:
     13        (WebCore::createInputTypeFactoryMap):
     14        Don't register type=date if !RuntimeEnabledFeatures::inputTypeDateEnabled()
     15
    1162012-04-13  Adam Barth  <abarth@webkit.org>
    217
  • trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp

    r114020 r114101  
    198198#endif
    199199
     200#if ENABLE(INPUT_TYPE_DATE)
     201bool RuntimeEnabledFeatures::isInputTypeDateEnabled = true;
     202#endif
     203
    200204} // namespace WebCore
  • trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h

    r114020 r114101  
    229229#endif
    230230
     231#if ENABLE(INPUT_TYPE_DATE)
     232    static bool inputTypeDateEnabled() { return isInputTypeDateEnabled; }
     233    static void setInputTypeDateEnabled(bool isEnabled) { isInputTypeDateEnabled = isEnabled; }
     234#endif
     235
    231236private:
    232237    // Never instantiate.
     
    301306    static bool isStyleScopedEnabled;
    302307#endif
     308
     309#if ENABLE(INPUT_TYPE_DATE)
     310    static bool isInputTypeDateEnabled;
     311#endif
    303312};
    304313
  • trunk/Source/WebCore/html/InputType.cpp

    r113972 r114101  
    5656#include "RenderObject.h"
    5757#include "ResetInputType.h"
     58#include "RuntimeEnabledFeatures.h"
    5859#include "SearchInputType.h"
    5960#include "ShadowRoot.h"
     
    8788#endif
    8889#if ENABLE(INPUT_TYPE_DATE)
    89     map->add(InputTypeNames::date(), DateInputType::create);
     90    if (RuntimeEnabledFeatures::inputTypeDateEnabled())
     91        map->add(InputTypeNames::date(), DateInputType::create);
    9092#endif
    9193#if ENABLE(INPUT_TYPE_DATETIME)
  • trunk/Source/WebKit/chromium/ChangeLog

    r114094 r114101  
     12012-04-13  Kent Tamura  <tkent@chromium.org>
     2
     3        Add a runtime flag for <input type=date>
     4        https://bugs.webkit.org/show_bug.cgi?id=83853
     5
     6        Reviewed by Adam Barth.
     7
     8        * public/WebRuntimeFeatures.h:
     9        (WebRuntimeFeatures): Add enableInputTypeDate() and isInputTypeDateEnabled().
     10        * src/WebRuntimeFeatures.cpp:
     11        (WebKit::WebRuntimeFeatures::enableInputTypeDate): Added.
     12        (WebKit::WebRuntimeFeatures::isInputTypeDateEnabled): Added.
     13
    1142012-04-13  Sheriff Bot  <webkit.review.bot@gmail.com>
    215
  • trunk/Source/WebKit/chromium/public/WebRuntimeFeatures.h

    r113736 r114101  
    134134    WEBKIT_EXPORT static bool isStyleScopedEnabled();
    135135
     136    WEBKIT_EXPORT static void enableInputTypeDate(bool);
     137    WEBKIT_EXPORT static bool isInputTypeDateEnabled();
     138
    136139private:
    137140    WebRuntimeFeatures();
  • trunk/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp

    r113875 r114101  
    503503}
    504504
     505void WebRuntimeFeatures::enableInputTypeDate(bool enable)
     506{
     507#if ENABLE(INPUT_TYPE_DATE)
     508    RuntimeEnabledFeatures::setInputTypeDateEnabled(enable);
     509#else
     510    UNUSED_PARAM(enable);
     511#endif
     512}
     513
     514bool WebRuntimeFeatures::isInputTypeDateEnabled()
     515{
     516#if ENABLE(INPUT_TYPE_DATE)
     517    return RuntimeEnabledFeatures::inputTypeDateEnabled();
     518#else
     519    return false;
     520#endif
     521}
    505522
    506523} // namespace WebKit
Note: See TracChangeset for help on using the changeset viewer.