Changeset 150724 in webkit
- Timestamp:
- May 26, 2013 3:35:55 PM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 2 deleted
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r150676 r150724 1 2013-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 1 10 2013-05-24 Benjamin Poulain <bpoulain@apple.com> 2 11 -
trunk/Source/WTF/wtf/FeatureDefines.h
r150652 r150724 303 303 #endif 304 304 305 #if !defined(ENABLE_CALENDAR_PICKER)306 #define ENABLE_CALENDAR_PICKER 0307 #endif308 309 305 #if !defined(ENABLE_CANVAS_PATH) 310 306 #define ENABLE_CANVAS_PATH 1 -
trunk/Source/WebCore/ChangeLog
r150722 r150724 1 2013-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 1 30 2013-05-26 Andreas Kling <akling@apple.com> 2 31 -
trunk/Source/WebCore/css/html.css
r147261 r150724 925 925 #endif // defined(ENABLE_INPUT_TYPE_COLOR) && ENABLE_INPUT_TYPE_COLOR 926 926 927 #if defined(ENABLE_CALENDAR_PICKER) && ENABLE_CALENDAR_PICKER928 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_PICKER940 941 927 select { 942 928 -webkit-appearance: menulist; -
trunk/Source/WebCore/platform/text/LocaleICU.cpp
r142988 r150724 56 56 , m_didCreateDecimalFormat(false) 57 57 , m_didCreateShortDateFormat(false) 58 #if ENABLE(CALENDAR_PICKER)59 , m_firstDayOfWeek(0)60 #endif61 58 #if ENABLE(DATE_AND_TIME_INPUT_TYPES) 62 59 , m_mediumTimeFormat(0) … … 199 196 #endif 200 197 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 #endif233 234 198 #if ENABLE(DATE_AND_TIME_INPUT_TYPES) 235 199 static PassOwnPtr<Vector<String> > createFallbackMonthLabels() … … 253 217 m_monthLabels = createFallbackMonthLabels(); 254 218 return *m_monthLabels; 255 }256 #endif257 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;275 219 } 276 220 #endif -
trunk/Source/WebCore/platform/text/LocaleICU.h
r142988 r150724 50 50 virtual ~LocaleICU(); 51 51 52 #if ENABLE(CALENDAR_PICKER)53 virtual const Vector<String>& weekDayShortLabels() OVERRIDE;54 virtual unsigned firstDayOfWeek() OVERRIDE;55 virtual bool isRTL() OVERRIDE;56 #endif57 52 #if ENABLE(DATE_AND_TIME_INPUT_TYPES) 58 53 virtual String dateFormat() OVERRIDE; … … 82 77 UDateFormat* openDateFormat(UDateFormatStyle timeStyle, UDateFormatStyle dateStyle) const; 83 78 84 #if ENABLE(CALENDAR_PICKER)85 void initializeCalendar();86 #endif87 88 79 #if ENABLE(DATE_AND_TIME_INPUT_TYPES) 89 80 PassOwnPtr<Vector<String> > createLabelVector(const UDateFormat*, UDateFormatSymbolType, int32_t startIndex, int32_t size); … … 97 88 bool m_didCreateShortDateFormat; 98 89 99 #if ENABLE(CALENDAR_PICKER)100 OwnPtr<Vector<String> > m_weekDayShortLabels;101 unsigned m_firstDayOfWeek;102 #endif103 90 #if ENABLE(DATE_AND_TIME_INPUT_TYPES) 104 91 OwnPtr<Vector<String> > m_monthLabels; -
trunk/Source/WebCore/platform/text/PlatformLocale.h
r142988 r150724 112 112 #endif 113 113 114 #if ENABLE(CALENDAR_PICKER)115 // Returns a vector of string of which size is 7. The first item is a116 // localized short string of Monday, and the last item is a localized117 // 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 this124 // object.125 virtual bool isRTL() = 0;126 #endif127 128 114 #if ENABLE(DATE_AND_TIME_INPUT_TYPES) 129 115 enum FormatType { FormatTypeUnspecified, FormatTypeShort, FormatTypeMedium }; -
trunk/Source/WebCore/platform/text/mac/LocaleMac.h
r142988 r150724 52 52 ~LocaleMac(); 53 53 54 #if ENABLE(CALENDAR_PICKER)55 virtual const Vector<String>& weekDayShortLabels() OVERRIDE;56 virtual unsigned firstDayOfWeek() OVERRIDE;57 virtual bool isRTL() OVERRIDE;58 #endif59 60 54 #if ENABLE(DATE_AND_TIME_INPUT_TYPES) 61 55 virtual String dateFormat() OVERRIDE; … … 80 74 RetainPtr<NSLocale> m_locale; 81 75 RetainPtr<NSCalendar> m_gregorianCalendar; 82 #if ENABLE(CALENDAR_PICKER)83 Vector<String> m_weekDayShortLabels;84 #endif85 76 #if ENABLE(DATE_AND_TIME_INPUT_TYPES) 86 77 Vector<String> m_monthLabels; -
trunk/Source/WebCore/platform/text/mac/LocaleMac.mm
r149255 r150724 131 131 return m_monthLabels; 132 132 } 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 169 134 RetainPtr<NSDateFormatter> LocaleMac::timeFormatter() 170 135 { -
trunk/Source/WebCore/platform/text/win/LocaleWin.cpp
r147869 r150724 157 157 , m_didInitializeNumberData(false) 158 158 { 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 #endif166 159 } 167 160 … … 359 352 } 360 353 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, // Sunday368 LOCALE_SABBREVDAYNAME1, // Monday369 LOCALE_SABBREVDAYNAME2,370 LOCALE_SABBREVDAYNAME3,371 LOCALE_SABBREVDAYNAME4,372 LOCALE_SABBREVDAYNAME5,373 LOCALE_SABBREVDAYNAME6374 };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 #endif390 391 354 #if ENABLE(DATE_AND_TIME_INPUT_TYPES) 392 355 const Vector<String>& LocaleWin::monthLabels() … … 395 358 return m_monthLabels; 396 359 } 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 419 361 String LocaleWin::dateFormat() 420 362 { -
trunk/Source/WebCore/platform/text/win/LocaleWin.h
r142988 r150724 47 47 static PassOwnPtr<LocaleWin> create(LCID); 48 48 ~LocaleWin(); 49 #if ENABLE(CALENDAR_PICKER)50 virtual const Vector<String>& weekDayShortLabels() OVERRIDE;51 virtual unsigned firstDayOfWeek() OVERRIDE;52 virtual bool isRTL() OVERRIDE;53 #endif54 49 #if ENABLE(DATE_AND_TIME_INPUT_TYPES) 55 50 virtual String dateFormat() OVERRIDE; … … 75 70 void ensureShortMonthLabels(); 76 71 void ensureMonthLabels(); 77 #if ENABLE(CALENDAR_PICKER)78 void ensureWeekDayShortLabels();79 #endif80 72 // Locale function: 81 73 virtual void initializeLocaleData() OVERRIDE; … … 94 86 Vector<String> m_timeAMPMLabels; 95 87 #endif 96 #if ENABLE(CALENDAR_PICKER)97 Vector<String> m_weekDayShortLabels;98 unsigned m_firstDayOfWeek;99 #endif100 88 bool m_didInitializeNumberData; 101 89 }; -
trunk/Source/WebKit/blackberry/ChangeLog
r150712 r150724 1 2013-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 1 11 2013-05-26 Andreas Kling <akling@apple.com> 2 12 -
trunk/Source/WebKit/blackberry/WebCoreSupport/AboutDataEnableFeatures.in
r150652 r150724 15 15 BYTECODE_COMMENTS 16 16 CACHE_PARTITIONING 17 CALENDAR_PICKER18 17 CANVAS_PATH 19 18 CANVAS_PROXY
Note: See TracChangeset
for help on using the changeset viewer.