Changeset 150724 in webkit


Ignore:
Timestamp:
May 26, 2013 3:35:55 PM (11 years ago)
Author:
tkent@chromium.org
Message:

Remove ENABLE_CALENDAR_PICKER
https://bugs.webkit.org/show_bug.cgi?id=116795

Reviewed by Ryosuke Niwa.

Source/WebCore:

This feature was used only by Chromium port.

  • Resources/pagepopups/calendarPicker.css: Removed.
  • Resources/pagepopups/calendarPicker.js: Removed.
  • css/html.css:
  • platform/text/LocaleICU.cpp:

(WebCore::LocaleICU::LocaleICU):
(WebCore):

  • platform/text/LocaleICU.h:

(LocaleICU):

  • platform/text/PlatformLocale.h:

(Locale):

  • platform/text/mac/LocaleMac.h:

(LocaleMac):

  • platform/text/mac/LocaleMac.mm:

(WebCore::LocaleMac::monthLabels):

  • platform/text/win/LocaleWin.cpp:

(WebCore::LocaleWin::LocaleWin):
(WebCore::LocaleWin::monthLabels):

  • platform/text/win/LocaleWin.h:

(LocaleWin):

Source/WebKit/blackberry:

  • WebCoreSupport/AboutDataEnableFeatures.in:

The list was wrong. Blackberry port doesn't use CALENDAR_PICKER code.

Source/WTF:

  • wtf/FeatureDefines.h:
Location:
trunk/Source
Files:
2 deleted
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r150676 r150724  
     12013-05-26  Kent Tamura  <tkent@chromium.org>
     2
     3        Remove ENABLE_CALENDAR_PICKER
     4        https://bugs.webkit.org/show_bug.cgi?id=116795
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        * wtf/FeatureDefines.h:
     9
    1102013-05-24  Benjamin Poulain  <bpoulain@apple.com>
    211
  • trunk/Source/WTF/wtf/FeatureDefines.h

    r150652 r150724  
    303303#endif
    304304
    305 #if !defined(ENABLE_CALENDAR_PICKER)
    306 #define ENABLE_CALENDAR_PICKER 0
    307 #endif
    308 
    309305#if !defined(ENABLE_CANVAS_PATH)
    310306#define ENABLE_CANVAS_PATH 1
  • trunk/Source/WebCore/ChangeLog

    r150722 r150724  
     12013-05-26  Kent Tamura  <tkent@chromium.org>
     2
     3        Remove ENABLE_CALENDAR_PICKER
     4        https://bugs.webkit.org/show_bug.cgi?id=116795
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        This feature was used only by Chromium port.
     9
     10        * Resources/pagepopups/calendarPicker.css: Removed.
     11        * Resources/pagepopups/calendarPicker.js: Removed.
     12        * css/html.css:
     13        * platform/text/LocaleICU.cpp:
     14        (WebCore::LocaleICU::LocaleICU):
     15        (WebCore):
     16        * platform/text/LocaleICU.h:
     17        (LocaleICU):
     18        * platform/text/PlatformLocale.h:
     19        (Locale):
     20        * platform/text/mac/LocaleMac.h:
     21        (LocaleMac):
     22        * platform/text/mac/LocaleMac.mm:
     23        (WebCore::LocaleMac::monthLabels):
     24        * platform/text/win/LocaleWin.cpp:
     25        (WebCore::LocaleWin::LocaleWin):
     26        (WebCore::LocaleWin::monthLabels):
     27        * platform/text/win/LocaleWin.h:
     28        (LocaleWin):
     29
    1302013-05-26  Andreas Kling  <akling@apple.com>
    231
  • trunk/Source/WebCore/css/html.css

    r147261 r150724  
    925925#endif // defined(ENABLE_INPUT_TYPE_COLOR) && ENABLE_INPUT_TYPE_COLOR
    926926
    927 #if defined(ENABLE_CALENDAR_PICKER) && ENABLE_CALENDAR_PICKER
    928 input::-webkit-calendar-picker-indicator {
    929     display: inline-block;
    930     width: 0.66em;
    931     height: 0.66em;
    932     padding: 0.17em 0.34em;
    933     -webkit-user-modify: read-only !important;
    934 }
    935 
    936 input::-webkit-calendar-picker-indicator:hover {
    937     background-color: #eee;
    938 }
    939 #endif // ENABLE_CALENDAR_PICKER
    940 
    941927select {
    942928    -webkit-appearance: menulist;
  • trunk/Source/WebCore/platform/text/LocaleICU.cpp

    r142988 r150724  
    5656    , m_didCreateDecimalFormat(false)
    5757    , m_didCreateShortDateFormat(false)
    58 #if ENABLE(CALENDAR_PICKER)
    59     , m_firstDayOfWeek(0)
    60 #endif
    6158#if ENABLE(DATE_AND_TIME_INPUT_TYPES)
    6259    , m_mediumTimeFormat(0)
     
    199196#endif
    200197
    201 #if ENABLE(CALENDAR_PICKER)
    202 static PassOwnPtr<Vector<String> > createFallbackWeekDayShortLabels()
    203 {
    204     OwnPtr<Vector<String> > labels = adoptPtr(new Vector<String>());
    205     labels->reserveCapacity(7);
    206     labels->append("Sun");
    207     labels->append("Mon");
    208     labels->append("Tue");
    209     labels->append("Wed");
    210     labels->append("Thu");
    211     labels->append("Fri");
    212     labels->append("Sat");
    213     return labels.release();
    214 }
    215 
    216 void LocaleICU::initializeCalendar()
    217 {
    218     if (m_weekDayShortLabels)
    219         return;
    220 
    221     if (!initializeShortDateFormat()) {
    222         m_firstDayOfWeek = 0;
    223         m_weekDayShortLabels = createFallbackWeekDayShortLabels();
    224         return;
    225     }
    226     m_firstDayOfWeek = ucal_getAttribute(udat_getCalendar(m_shortDateFormat), UCAL_FIRST_DAY_OF_WEEK) - UCAL_SUNDAY;
    227 
    228     m_weekDayShortLabels = createLabelVector(m_shortDateFormat, UDAT_SHORT_WEEKDAYS, UCAL_SUNDAY, 7);
    229     if (!m_weekDayShortLabels)
    230         m_weekDayShortLabels = createFallbackWeekDayShortLabels();
    231 }
    232 #endif
    233 
    234198#if ENABLE(DATE_AND_TIME_INPUT_TYPES)
    235199static PassOwnPtr<Vector<String> > createFallbackMonthLabels()
     
    253217    m_monthLabels = createFallbackMonthLabels();
    254218    return *m_monthLabels;
    255 }
    256 #endif
    257 
    258 #if ENABLE(CALENDAR_PICKER)
    259 const Vector<String>& LocaleICU::weekDayShortLabels()
    260 {
    261     initializeCalendar();
    262     return *m_weekDayShortLabels;
    263 }
    264 
    265 unsigned LocaleICU::firstDayOfWeek()
    266 {
    267     initializeCalendar();
    268     return m_firstDayOfWeek;
    269 }
    270 
    271 bool LocaleICU::isRTL()
    272 {
    273     UErrorCode status = U_ZERO_ERROR;
    274     return uloc_getCharacterOrientation(m_locale.data(), &status) == ULOC_LAYOUT_RTL;
    275219}
    276220#endif
  • trunk/Source/WebCore/platform/text/LocaleICU.h

    r142988 r150724  
    5050    virtual ~LocaleICU();
    5151
    52 #if ENABLE(CALENDAR_PICKER)
    53     virtual const Vector<String>& weekDayShortLabels() OVERRIDE;
    54     virtual unsigned firstDayOfWeek() OVERRIDE;
    55     virtual bool isRTL() OVERRIDE;
    56 #endif
    5752#if ENABLE(DATE_AND_TIME_INPUT_TYPES)
    5853    virtual String dateFormat() OVERRIDE;
     
    8277    UDateFormat* openDateFormat(UDateFormatStyle timeStyle, UDateFormatStyle dateStyle) const;
    8378
    84 #if ENABLE(CALENDAR_PICKER)
    85     void initializeCalendar();
    86 #endif
    87 
    8879#if ENABLE(DATE_AND_TIME_INPUT_TYPES)
    8980    PassOwnPtr<Vector<String> > createLabelVector(const UDateFormat*, UDateFormatSymbolType, int32_t startIndex, int32_t size);
     
    9788    bool m_didCreateShortDateFormat;
    9889
    99 #if ENABLE(CALENDAR_PICKER)
    100     OwnPtr<Vector<String> > m_weekDayShortLabels;
    101     unsigned m_firstDayOfWeek;
    102 #endif
    10390#if ENABLE(DATE_AND_TIME_INPUT_TYPES)
    10491    OwnPtr<Vector<String> > m_monthLabels;
  • trunk/Source/WebCore/platform/text/PlatformLocale.h

    r142988 r150724  
    112112#endif
    113113
    114 #if ENABLE(CALENDAR_PICKER)
    115     // Returns a vector of string of which size is 7. The first item is a
    116     // localized short string of Monday, and the last item is a localized
    117     // short string of Saturday. These strings should be short.
    118     virtual const Vector<String>& weekDayShortLabels() = 0;
    119 
    120     // The first day of a week. 0 is Sunday, and 6 is Saturday.
    121     virtual unsigned firstDayOfWeek() = 0;
    122 
    123     // Returns true if people use right-to-left writing in the locale for this
    124     // object.
    125     virtual bool isRTL() = 0;
    126 #endif
    127 
    128114#if ENABLE(DATE_AND_TIME_INPUT_TYPES)
    129115    enum FormatType { FormatTypeUnspecified, FormatTypeShort, FormatTypeMedium };
  • trunk/Source/WebCore/platform/text/mac/LocaleMac.h

    r142988 r150724  
    5252    ~LocaleMac();
    5353
    54 #if ENABLE(CALENDAR_PICKER)
    55     virtual const Vector<String>& weekDayShortLabels() OVERRIDE;
    56     virtual unsigned firstDayOfWeek() OVERRIDE;
    57     virtual bool isRTL() OVERRIDE;
    58 #endif
    59 
    6054#if ENABLE(DATE_AND_TIME_INPUT_TYPES)
    6155    virtual String dateFormat() OVERRIDE;
     
    8074    RetainPtr<NSLocale> m_locale;
    8175    RetainPtr<NSCalendar> m_gregorianCalendar;
    82 #if ENABLE(CALENDAR_PICKER)
    83     Vector<String> m_weekDayShortLabels;
    84 #endif
    8576#if ENABLE(DATE_AND_TIME_INPUT_TYPES)
    8677    Vector<String> m_monthLabels;
  • trunk/Source/WebCore/platform/text/mac/LocaleMac.mm

    r149255 r150724  
    131131    return m_monthLabels;
    132132}
    133 #endif
    134 
    135 #if ENABLE(CALENDAR_PICKER)
    136 const Vector<String>& LocaleMac::weekDayShortLabels()
    137 {
    138     if (!m_weekDayShortLabels.isEmpty())
    139         return m_weekDayShortLabels;
    140     m_weekDayShortLabels.reserveCapacity(7);
    141     NSArray *array = [shortDateFormatter().get() shortWeekdaySymbols];
    142     if ([array count] == 7) {
    143         for (unsigned i = 0; i < 7; ++i)
    144             m_weekDayShortLabels.append(String([array objectAtIndex:i]));
    145         return m_weekDayShortLabels;
    146     }
    147     for (unsigned i = 0; i < WTF_ARRAY_LENGTH(WTF::weekdayName); ++i) {
    148         // weekdayName starts with Monday.
    149         m_weekDayShortLabels.append(WTF::weekdayName[(i + 6) % 7]);
    150     }
    151     return m_weekDayShortLabels;
    152 }
    153 
    154 unsigned LocaleMac::firstDayOfWeek()
    155 {
    156     // The document for NSCalendar - firstWeekday doesn't have an explanation of
    157     // firstWeekday value. We can guess it by the document of NSDateComponents -
    158     // weekDay, so it can be 1 through 7 and 1 is Sunday.
    159     return [m_gregorianCalendar.get() firstWeekday] - 1;
    160 }
    161 
    162 bool LocaleMac::isRTL()
    163 {
    164     return NSLocaleLanguageDirectionRightToLeft == [NSLocale characterDirectionForLanguage:[NSLocale canonicalLanguageIdentifierFromString:[m_locale.get() localeIdentifier]]];
    165 }
    166 #endif
    167 
    168 #if ENABLE(DATE_AND_TIME_INPUT_TYPES)
     133
    169134RetainPtr<NSDateFormatter> LocaleMac::timeFormatter()
    170135{
  • trunk/Source/WebCore/platform/text/win/LocaleWin.cpp

    r147869 r150724  
    157157    , m_didInitializeNumberData(false)
    158158{
    159 #if ENABLE(CALENDAR_PICKER)
    160     DWORD value = 0;
    161     getLocaleInfo(LOCALE_IFIRSTDAYOFWEEK, value);
    162     // 0:Monday, ..., 6:Sunday.
    163     // We need 1 for Monday, 0 for Sunday.
    164     m_firstDayOfWeek = (value + 1) % 7;
    165 #endif
    166159}
    167160
     
    359352}
    360353
    361 #if ENABLE(CALENDAR_PICKER)
    362 void LocaleWin::ensureWeekDayShortLabels()
    363 {
    364     if (!m_weekDayShortLabels.isEmpty())
    365         return;
    366     const LCTYPE types[7] = {
    367         LOCALE_SABBREVDAYNAME7, // Sunday
    368         LOCALE_SABBREVDAYNAME1, // Monday
    369         LOCALE_SABBREVDAYNAME2,
    370         LOCALE_SABBREVDAYNAME3,
    371         LOCALE_SABBREVDAYNAME4,
    372         LOCALE_SABBREVDAYNAME5,
    373         LOCALE_SABBREVDAYNAME6
    374     };
    375     m_weekDayShortLabels.reserveCapacity(WTF_ARRAY_LENGTH(types));
    376     for (unsigned i = 0; i < WTF_ARRAY_LENGTH(types); ++i) {
    377         m_weekDayShortLabels.append(getLocaleInfoString(types[i]));
    378         if (m_weekDayShortLabels.last().isEmpty()) {
    379             m_weekDayShortLabels.shrink(0);
    380             m_weekDayShortLabels.reserveCapacity(WTF_ARRAY_LENGTH(WTF::weekdayName));
    381             for (unsigned w = 0; w < WTF_ARRAY_LENGTH(WTF::weekdayName); ++w) {
    382                 // weekdayName starts with Monday.
    383                 m_weekDayShortLabels.append(WTF::weekdayName[(w + 6) % 7]);
    384             }
    385             return;
    386         }
    387     }
    388 }
    389 #endif
    390 
    391354#if ENABLE(DATE_AND_TIME_INPUT_TYPES)
    392355const Vector<String>& LocaleWin::monthLabels()
     
    395358    return m_monthLabels;
    396359}
    397 #endif
    398 
    399 #if ENABLE(CALENDAR_PICKER)
    400 const Vector<String>& LocaleWin::weekDayShortLabels()
    401 {
    402     ensureWeekDayShortLabels();
    403     return m_weekDayShortLabels;
    404 }
    405 
    406 unsigned LocaleWin::firstDayOfWeek()
    407 {
    408     return m_firstDayOfWeek;
    409 }
    410 
    411 bool LocaleWin::isRTL()
    412 {
    413     WTF::Unicode::Direction dir = WTF::Unicode::direction(monthLabels()[0][0]);
    414     return dir == WTF::Unicode::RightToLeft || dir == WTF::Unicode::RightToLeftArabic;
    415 }
    416 #endif
    417 
    418 #if ENABLE(DATE_AND_TIME_INPUT_TYPES)
     360
    419361String LocaleWin::dateFormat()
    420362{
  • trunk/Source/WebCore/platform/text/win/LocaleWin.h

    r142988 r150724  
    4747    static PassOwnPtr<LocaleWin> create(LCID);
    4848    ~LocaleWin();
    49 #if ENABLE(CALENDAR_PICKER)
    50     virtual const Vector<String>& weekDayShortLabels() OVERRIDE;
    51     virtual unsigned firstDayOfWeek() OVERRIDE;
    52     virtual bool isRTL() OVERRIDE;
    53 #endif
    5449#if ENABLE(DATE_AND_TIME_INPUT_TYPES)
    5550    virtual String dateFormat() OVERRIDE;
     
    7570    void ensureShortMonthLabels();
    7671    void ensureMonthLabels();
    77 #if ENABLE(CALENDAR_PICKER)
    78     void ensureWeekDayShortLabels();
    79 #endif
    8072    // Locale function:
    8173    virtual void initializeLocaleData() OVERRIDE;
     
    9486    Vector<String> m_timeAMPMLabels;
    9587#endif
    96 #if ENABLE(CALENDAR_PICKER)
    97     Vector<String> m_weekDayShortLabels;
    98     unsigned m_firstDayOfWeek;
    99 #endif
    10088    bool m_didInitializeNumberData;
    10189};
  • trunk/Source/WebKit/blackberry/ChangeLog

    r150712 r150724  
     12013-05-26  Kent Tamura  <tkent@chromium.org>
     2
     3        Remove ENABLE_CALENDAR_PICKER
     4        https://bugs.webkit.org/show_bug.cgi?id=116795
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        * WebCoreSupport/AboutDataEnableFeatures.in:
     9        The list was wrong. Blackberry port doesn't use CALENDAR_PICKER code.
     10
    1112013-05-26  Andreas Kling  <akling@apple.com>
    212
  • trunk/Source/WebKit/blackberry/WebCoreSupport/AboutDataEnableFeatures.in

    r150652 r150724  
    1515BYTECODE_COMMENTS
    1616CACHE_PARTITIONING
    17 CALENDAR_PICKER
    1817CANVAS_PATH
    1918CANVAS_PROXY
Note: See TracChangeset for help on using the changeset viewer.