Changeset 167542 in webkit
- Timestamp:
- Apr 19, 2014 12:47:27 PM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r167541 r167542 1 2014-04-19 Darin Adler <darin@apple.com> 2 3 Telephone number detection should respect its setting consistently 4 https://bugs.webkit.org/show_bug.cgi?id=131893 5 rdar://problem/16597639 6 7 Reviewed by Tim Horton. 8 9 * editing/Editor.cpp: 10 (WebCore::Editor::respondToChangedSelection): Only start the timer 11 if shouldDetectTelephoneNumbers returns true. 12 (WebCore::Editor::shouldDetectTelephoneNumbers): Added. Calls both 13 isTelephoneNumberParsingEnabled and TelephoneNumberDetector::isSupported. 14 (WebCore::Editor::scanSelectionForTelephoneNumbers): Use 15 shouldDetectTelephoneNumbers. 16 (WebCore::Editor::clearDataDetectedTelephoneNumbers): Use document() 17 instead of m_frame.document(). 18 19 * editing/Editor.h: Added declaration of shouldDetectTelephoneNumbers. 20 1 21 2014-04-19 Andrei Bucur <abucur@adobe.com> 2 22 -
trunk/Source/WebCore/editing/Editor.cpp
r167169 r167542 3325 3325 3326 3326 #if ENABLE(TELEPHONE_NUMBER_DETECTION) && !PLATFORM(IOS) 3327 m_telephoneNumberDetectionUpdateTimer.startOneShot(0); 3327 if (shouldDetectTelephoneNumbers()) 3328 m_telephoneNumberDetectionUpdateTimer.startOneShot(0); 3328 3329 #endif 3329 3330 … … 3341 3342 3342 3343 #if ENABLE(TELEPHONE_NUMBER_DETECTION) && !PLATFORM(IOS) 3344 3345 bool Editor::shouldDetectTelephoneNumbers() 3346 { 3347 if (!m_frame.document()) 3348 return false; 3349 return document().isTelephoneNumberParsingEnabled() && TelephoneNumberDetector::isSupported(); 3350 } 3351 3343 3352 void Editor::scanSelectionForTelephoneNumbers(Timer<Editor>&) 3344 3353 { 3345 if (!TelephoneNumberDetector::isSupported()) 3346 return; 3347 3348 if (!m_frame.document()) 3349 return; 3350 3351 clearDataDetectedTelephoneNumbers(); 3354 if (!shouldDetectTelephoneNumbers()) 3355 return; 3352 3356 3353 3357 Vector<RefPtr<Range>> markedRanges; … … 3410 3414 void Editor::clearDataDetectedTelephoneNumbers() 3411 3415 { 3412 m_frame.document()->markers().removeMarkers(DocumentMarker::TelephoneNumber);3416 document().markers().removeMarkers(DocumentMarker::TelephoneNumber); 3413 3417 3414 3418 // FIXME: Do other UI cleanup here once we have other UI. 3415 3419 } 3420 3416 3421 #endif // ENABLE(TELEPHONE_NUMBER_DETECTION) && !PLATFORM(IOS) 3417 3422 -
trunk/Source/WebCore/editing/Editor.h
r167148 r167542 508 508 509 509 #if ENABLE(TELEPHONE_NUMBER_DETECTION) && !PLATFORM(IOS) 510 bool shouldDetectTelephoneNumbers(); 510 511 void scanSelectionForTelephoneNumbers(Timer<Editor>&); 511 512 void scanRangeForTelephoneNumbers(Range&, const StringView&, Vector<RefPtr<Range>>& markedRanges);
Note: See TracChangeset
for help on using the changeset viewer.