319315386fd111586b5ad2ef9a7765f963d75ce5
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-08-18  Filip Pizlo  <fpizlo@apple.com>
2
3         Unreviewed, fix the cairo build.
4
5         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
6
7 2015-08-17  Filip Pizlo  <fpizlo@apple.com>
8
9         Replace all remaining uses of WTF::Mutex with WTF::Lock
10         https://bugs.webkit.org/show_bug.cgi?id=148089
11
12         Reviewed by Geoffrey Garen.
13
14         No new tests because no new behavior.
15
16         * Modules/webaudio/AsyncAudioDecoder.cpp:
17         (WebCore::AsyncAudioDecoder::AsyncAudioDecoder):
18         (WebCore::AsyncAudioDecoder::runLoop):
19         * Modules/webaudio/AsyncAudioDecoder.h:
20         * Modules/webaudio/AudioContext.h:
21         * Modules/webaudio/MediaStreamAudioSource.cpp:
22         (WebCore::MediaStreamAudioSource::addAudioConsumer):
23         (WebCore::MediaStreamAudioSource::removeAudioConsumer):
24         (WebCore::MediaStreamAudioSource::setAudioFormat):
25         (WebCore::MediaStreamAudioSource::consumeAudio):
26         * Modules/webaudio/MediaStreamAudioSource.h:
27         * Modules/webdatabase/Database.cpp:
28         (WebCore::Database::close):
29         (WebCore::Database::runTransaction):
30         (WebCore::Database::inProgressTransactionCompleted):
31         (WebCore::Database::hasPendingTransaction):
32         * Modules/webdatabase/Database.h:
33         * Modules/webdatabase/DatabaseTask.cpp:
34         (WebCore::DatabaseTaskSynchronizer::taskCompleted):
35         * Modules/webdatabase/DatabaseTask.h:
36         * Modules/webdatabase/DatabaseThread.cpp:
37         (WebCore::DatabaseThread::start):
38         (WebCore::DatabaseThread::databaseThread):
39         * Modules/webdatabase/DatabaseThread.h:
40         * Modules/webdatabase/DatabaseTracker.cpp:
41         (WebCore::DatabaseTracker::setDatabaseDirectoryPath):
42         (WebCore::DatabaseTracker::canEstablishDatabase):
43         (WebCore::DatabaseTracker::retryCanEstablishDatabase):
44         (WebCore::DatabaseTracker::hasEntryForOrigin):
45         (WebCore::DatabaseTracker::getMaxSizeForDatabase):
46         (WebCore::DatabaseTracker::closeAllDatabases):
47         (WebCore::DatabaseTracker::fullPathForDatabase):
48         (WebCore::DatabaseTracker::origins):
49         (WebCore::DatabaseTracker::databaseNamesForOrigin):
50         (WebCore::DatabaseTracker::detailsForNameAndOrigin):
51         (WebCore::DatabaseTracker::setDatabaseDetails):
52         (WebCore::DatabaseTracker::doneCreatingDatabase):
53         (WebCore::DatabaseTracker::addOpenDatabase):
54         (WebCore::DatabaseTracker::removeOpenDatabase):
55         (WebCore::DatabaseTracker::getOpenDatabases):
56         (WebCore::DatabaseTracker::originLockFor):
57         (WebCore::DatabaseTracker::quotaForOrigin):
58         (WebCore::DatabaseTracker::setQuota):
59         (WebCore::DatabaseTracker::deleteOrigin):
60         (WebCore::DatabaseTracker::deleteDatabase):
61         (WebCore::DatabaseTracker::deleteDatabaseFile):
62         (WebCore::DatabaseTracker::removeDeletedOpenedDatabases):
63         (WebCore::DatabaseTracker::deleteDatabaseFileIfEmpty):
64         (WebCore::DatabaseTracker::openDatabaseMutex):
65         (WebCore::DatabaseTracker::setClient):
66         (WebCore::notificationMutex):
67         (WebCore::DatabaseTracker::scheduleNotifyDatabaseChanged):
68         (WebCore::DatabaseTracker::notifyDatabasesChanged):
69         * Modules/webdatabase/DatabaseTracker.h:
70         * Modules/webdatabase/OriginLock.h:
71         * Modules/webdatabase/SQLCallbackWrapper.h:
72         (WebCore::SQLCallbackWrapper::clear):
73         (WebCore::SQLCallbackWrapper::unwrap):
74         (WebCore::SQLCallbackWrapper::hasCallback):
75         * Modules/webdatabase/SQLTransactionBackend.cpp:
76         (WebCore::SQLTransactionBackend::doCleanup):
77         (WebCore::SQLTransactionBackend::enqueueStatementBackend):
78         (WebCore::SQLTransactionBackend::getNextStatement):
79         * Modules/webdatabase/SQLTransactionBackend.h:
80         * bindings/js/WorkerScriptController.cpp:
81         (WebCore::WorkerScriptController::scheduleExecutionTermination):
82         (WebCore::WorkerScriptController::isExecutionTerminating):
83         * bindings/js/WorkerScriptController.h:
84         * dom/default/PlatformMessagePortChannel.cpp:
85         (WebCore::MessagePortChannel::postMessageToRemote):
86         (WebCore::MessagePortChannel::tryGetMessageFromRemote):
87         (WebCore::MessagePortChannel::isConnectedTo):
88         (WebCore::MessagePortChannel::hasPendingActivity):
89         (WebCore::MessagePortChannel::locallyEntangledPort):
90         (WebCore::PlatformMessagePortChannel::setRemotePort):
91         (WebCore::PlatformMessagePortChannel::entangledChannel):
92         (WebCore::PlatformMessagePortChannel::closeInternal):
93         * dom/default/PlatformMessagePortChannel.h:
94         * loader/icon/IconDatabase.cpp:
95         (WebCore::IconDatabase::removeAllIcons):
96         (WebCore::IconDatabase::synchronousIconForPageURL):
97         (WebCore::IconDatabase::synchronousNativeIconForPageURL):
98         (WebCore::IconDatabase::synchronousIconURLForPageURL):
99         (WebCore::IconDatabase::retainIconForPageURL):
100         (WebCore::IconDatabase::performRetainIconForPageURL):
101         (WebCore::IconDatabase::releaseIconForPageURL):
102         (WebCore::IconDatabase::performReleaseIconForPageURL):
103         (WebCore::IconDatabase::setIconDataForIconURL):
104         (WebCore::IconDatabase::setIconURLForPageURL):
105         (WebCore::IconDatabase::synchronousLoadDecisionForIconURL):
106         (WebCore::IconDatabase::synchronousIconDataKnownForIconURL):
107         (WebCore::IconDatabase::pageURLMappingCount):
108         (WebCore::IconDatabase::retainedPageURLCount):
109         (WebCore::IconDatabase::iconRecordCount):
110         (WebCore::IconDatabase::iconRecordCountWithData):
111         (WebCore::IconDatabase::wakeSyncThread):
112         (WebCore::IconDatabase::scheduleOrDeferSyncTimer):
113         (WebCore::IconDatabase::isOpenBesidesMainThreadCallbacks):
114         (WebCore::IconDatabase::databasePath):
115         (WebCore::IconDatabase::getOrCreatePageURLRecord):
116         (WebCore::IconDatabase::iconDatabaseSyncThread):
117         (WebCore::IconDatabase::performOpenInitialization):
118         (WebCore::IconDatabase::performURLImport):
119         (WebCore::IconDatabase::syncThreadMainLoop):
120         (WebCore::IconDatabase::performPendingRetainAndReleaseOperations):
121         (WebCore::IconDatabase::readFromDatabase):
122         (WebCore::IconDatabase::writeToDatabase):
123         (WebCore::IconDatabase::pruneUnretainedIcons):
124         (WebCore::IconDatabase::cleanupSyncThread):
125         * loader/icon/IconDatabase.h:
126         * page/scrolling/ScrollingTree.cpp:
127         (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
128         (WebCore::ScrollingTree::commitNewTreeState):
129         (WebCore::ScrollingTree::setMainFramePinState):
130         (WebCore::ScrollingTree::mainFrameScrollPosition):
131         (WebCore::ScrollingTree::setMainFrameScrollPosition):
132         (WebCore::ScrollingTree::isPointInNonFastScrollableRegion):
133         (WebCore::ScrollingTree::isRubberBandInProgress):
134         (WebCore::ScrollingTree::setMainFrameIsRubberBanding):
135         (WebCore::ScrollingTree::isScrollSnapInProgress):
136         (WebCore::ScrollingTree::setMainFrameIsScrollSnapping):
137         (WebCore::ScrollingTree::setCanRubberBandState):
138         (WebCore::ScrollingTree::rubberBandsAtLeft):
139         (WebCore::ScrollingTree::rubberBandsAtRight):
140         (WebCore::ScrollingTree::rubberBandsAtBottom):
141         (WebCore::ScrollingTree::rubberBandsAtTop):
142         (WebCore::ScrollingTree::setScrollPinningBehavior):
143         (WebCore::ScrollingTree::scrollPinningBehavior):
144         (WebCore::ScrollingTree::willWheelEventStartSwipeGesture):
145         (WebCore::ScrollingTree::latchedNode):
146         (WebCore::ScrollingTree::setLatchedNode):
147         (WebCore::ScrollingTree::clearLatchedNode):
148         * page/scrolling/ScrollingTree.h:
149         * platform/MemoryPressureHandler.h:
150         * platform/audio/HRTFDatabaseLoader.cpp:
151         (WebCore::HRTFDatabaseLoader::loadAsynchronously):
152         (WebCore::HRTFDatabaseLoader::waitForLoaderThreadCompletion):
153         * platform/audio/HRTFDatabaseLoader.h:
154         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
155         (WebCore::MemoryPressureHandler::setReceivedMemoryPressure):
156         (WebCore::MemoryPressureHandler::clearMemoryPressure):
157         (WebCore::MemoryPressureHandler::shouldWaitForMemoryClearMessage):
158         (WebCore::MemoryPressureHandler::respondToMemoryPressureIfNeeded):
159         * platform/graphics/DisplayRefreshMonitor.cpp:
160         (WebCore::DisplayRefreshMonitor::displayDidRefresh):
161         * platform/graphics/DisplayRefreshMonitor.h:
162         (WebCore::DisplayRefreshMonitor::setMonotonicAnimationStartTime):
163         (WebCore::DisplayRefreshMonitor::mutex):
164         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
165         (WebCore::MediaPlayerPrivateAVFoundation::setDelayCallbacks):
166         (WebCore::MediaPlayerPrivateAVFoundation::clearMainThreadPendingFlag):
167         (WebCore::MediaPlayerPrivateAVFoundation::dispatchNotification):
168         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
169         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
170         (WebCore::AVFWrapper::callbackContext):
171         (WebCore::AVFWrapper::~AVFWrapper):
172         (WebCore::AVFWrapper::mapLock):
173         (WebCore::AVFWrapper::addToMap):
174         (WebCore::AVFWrapper::removeFromMap):
175         (WebCore::AVFWrapper::periodicTimeObserverCallback):
176         (WebCore::AVFWrapper::processNotification):
177         (WebCore::AVFWrapper::loadPlayableCompletionCallback):
178         (WebCore::AVFWrapper::loadMetadataCompletionCallback):
179         (WebCore::AVFWrapper::seekCompletedCallback):
180         (WebCore::AVFWrapper::processCue):
181         (WebCore::AVFWrapper::legibleOutputCallback):
182         (WebCore::AVFWrapper::processShouldWaitForLoadingOfResource):
183         (WebCore::AVFWrapper::resourceLoaderShouldWaitForLoadingOfRequestedResource):
184         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
185         (WebCore::InbandTextTrackPrivateGStreamer::handleSample):
186         (WebCore::InbandTextTrackPrivateGStreamer::notifyTrackOfSample):
187         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
188         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
189         (WebCore::TrackPrivateBaseGStreamer::tagsChanged):
190         (WebCore::TrackPrivateBaseGStreamer::notifyTrackOfTagsChanged):
191         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
192         * platform/graphics/mac/DisplayRefreshMonitorMac.cpp:
193         (WebCore::DisplayRefreshMonitorMac::requestRefreshCallback):
194         (WebCore::DisplayRefreshMonitorMac::displayLinkFired):
195         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
196         (WebCore::MediaPlayerPrivateMediaFoundation::addListener):
197         (WebCore::MediaPlayerPrivateMediaFoundation::removeListener):
198         (WebCore::MediaPlayerPrivateMediaFoundation::notifyDeleted):
199         (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::Invoke):
200         (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::onMediaPlayerDeleted):
201         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
202         * platform/ios/LegacyTileCache.h:
203         * platform/ios/LegacyTileCache.mm:
204         (WebCore::LegacyTileCache::setTilesOpaque):
205         (WebCore::LegacyTileCache::doLayoutTiles):
206         (WebCore::LegacyTileCache::setCurrentScale):
207         (WebCore::LegacyTileCache::commitScaleChange):
208         (WebCore::LegacyTileCache::layoutTilesNow):
209         (WebCore::LegacyTileCache::layoutTilesNowForRect):
210         (WebCore::LegacyTileCache::removeAllNonVisibleTiles):
211         (WebCore::LegacyTileCache::removeAllTiles):
212         (WebCore::LegacyTileCache::removeForegroundTiles):
213         (WebCore::LegacyTileCache::setContentReplacementImage):
214         (WebCore::LegacyTileCache::contentReplacementImage):
215         (WebCore::LegacyTileCache::tileCreationTimerFired):
216         (WebCore::LegacyTileCache::setNeedsDisplayInRect):
217         (WebCore::LegacyTileCache::updateTilingMode):
218         (WebCore::LegacyTileCache::setTilingMode):
219         (WebCore::LegacyTileCache::doPendingRepaints):
220         (WebCore::LegacyTileCache::flushSavedDisplayRects):
221         (WebCore::LegacyTileCache::prepareToDraw):
222         * platform/ios/LegacyTileLayerPool.h:
223         * platform/ios/LegacyTileLayerPool.mm:
224         (WebCore::LegacyTileLayerPool::addLayer):
225         (WebCore::LegacyTileLayerPool::takeLayerWithSize):
226         (WebCore::LegacyTileLayerPool::setCapacity):
227         (WebCore::LegacyTileLayerPool::prune):
228         (WebCore::LegacyTileLayerPool::drain):
229         * platform/network/curl/CurlDownload.cpp:
230         (WebCore::CurlDownloadManager::add):
231         (WebCore::CurlDownloadManager::remove):
232         (WebCore::CurlDownloadManager::getActiveDownloadCount):
233         (WebCore::CurlDownloadManager::getPendingDownloadCount):
234         (WebCore::CurlDownloadManager::stopThreadIfIdle):
235         (WebCore::CurlDownloadManager::updateHandleList):
236         (WebCore::CurlDownload::~CurlDownload):
237         (WebCore::CurlDownload::init):
238         (WebCore::CurlDownload::getTempPath):
239         (WebCore::CurlDownload::getUrl):
240         (WebCore::CurlDownload::getResponse):
241         (WebCore::CurlDownload::closeFile):
242         (WebCore::CurlDownload::didReceiveHeader):
243         (WebCore::CurlDownload::didReceiveData):
244         (WebCore::CurlDownload::didFail):
245         * platform/network/curl/CurlDownload.h:
246         * platform/network/curl/ResourceHandleManager.cpp:
247         (WebCore::cookieJarPath):
248         (WebCore::sharedResourceMutex):
249         (WebCore::curl_lock_callback):
250         (WebCore::curl_unlock_callback):
251         * platform/network/ios/QuickLook.mm:
252         (WebCore::QLDirectoryAttributes):
253         (qlPreviewConverterDictionaryMutex):
254         (WebCore::addQLPreviewConverterWithFileForURL):
255         (WebCore::qlPreviewConverterUTIForURL):
256         (WebCore::removeQLPreviewConverterForURL):
257         (WebCore::safeQLURLForDocumentURLAndResourceURL):
258         * platform/sql/SQLiteDatabase.cpp:
259         (WebCore::SQLiteDatabase::close):
260         (WebCore::SQLiteDatabase::maximumSize):
261         (WebCore::SQLiteDatabase::setMaximumSize):
262         (WebCore::SQLiteDatabase::pageSize):
263         (WebCore::SQLiteDatabase::freeSpaceSize):
264         (WebCore::SQLiteDatabase::totalSize):
265         (WebCore::SQLiteDatabase::runIncrementalVacuumCommand):
266         (WebCore::SQLiteDatabase::setAuthorizer):
267         * platform/sql/SQLiteDatabase.h:
268         (WebCore::SQLiteDatabase::databaseMutex):
269         * platform/sql/SQLiteStatement.cpp:
270         (WebCore::SQLiteStatement::prepare):
271         (WebCore::SQLiteStatement::step):
272         * workers/WorkerThread.cpp:
273         (WebCore::WorkerThread::start):
274         (WebCore::WorkerThread::workerThread):
275         (WebCore::WorkerThread::stop):
276         * workers/WorkerThread.h:
277
278 2015-08-18  Myles C. Maxfield  <mmaxfield@apple.com>
279
280         [Cocoa] Honor the 'trak' table by opting in via text-rendering: optimizeLegibility
281         https://bugs.webkit.org/show_bug.cgi?id=148119
282         <rdar://problem/22291561>
283
284         Reviewed by Tim Horton.
285
286         When the author has opted in by specifying "text-rendering: optimizeLegibility;", we should
287         honor the font's 'trak' table. We do this by specifying kCTFontOpticalSizeAttribute at font
288         creation time, and by using CTFontGetAdvancesForGlyphs() instead of
289         CGFontGetGlyphAdvancesForStyle().
290
291         Test: fast/text/trak-optimizeLegibility.html
292
293         * platform/graphics/FontCache.h:
294         (WebCore::FontDescriptionKey::makeFlagKey): Make our caches sensitive to TextRenderingMode.
295         * platform/graphics/FontPlatformData.cpp:
296         (WebCore::FontPlatformData::FontPlatformData): Add a TextRenderingMode member variable.
297         (WebCore::FontPlatformData::operator=): Update to consult with the new member.
298         * platform/graphics/FontPlatformData.h:
299         (WebCore::FontPlatformData::textRenderingMode): Getter.
300         * platform/graphics/cocoa/FontCacheCoreText.cpp:
301         (WebCore::preparePlatformFont): Specify kCTFontOpticalSizeAttribute.
302         (WebCore::applyFontFeatureSettings): Deleted.
303         * platform/graphics/cocoa/FontCocoa.mm:
304         (WebCore::canUseFastGlyphAdvanceGetter): Use CTFontGetAdvancesForGlyphs() if we are
305         optimizeLegibility.
306         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
307         (WebCore::FontPlatformData::FontPlatformData): Pass the TextRenderingMode around.
308         * platform/graphics/ios/FontCacheIOS.mm:
309         (WebCore::FontCache::getSystemFontFallbackForCharacters): Update to call renamed function.
310         (WebCore::FontCache::createFontPlatformData): Ditto.
311         * platform/graphics/mac/FontCacheMac.mm:
312         (WebCore::fontWithFamily): Ditto.
313         (WebCore::FontCache::systemFallbackForCharacters): Ditto.
314         (WebCore::FontCache::createFontPlatformData): Ditto.
315         * platform/graphics/mac/FontCustomPlatformData.cpp:
316         (WebCore::FontCustomPlatformData::fontPlatformData): Ditto.
317         * platform/spi/cocoa/CoreTextSPI.h:
318         * rendering/RenderThemeIOS.mm:
319         (WebCore::RenderThemeIOS::updateCachedSystemFontDescription): Ditto.
320
321 2015-08-18  Chris Dumez  <cdumez@apple.com>
322
323         Make our bindings' GetOwnPropertySlot() behave according to specification
324         https://bugs.webkit.org/show_bug.cgi?id=148092
325
326         Reviewed by Geoffrey Garen.
327
328         Make our bindings' GetOwnPropertySlot() behave according to
329         specification. In particular, our bindings use to do:
330         1. Indexed getter
331         2. Check static properties
332         3. Prototype check
333         4. Named getter
334         5. Check own properties
335
336         According to the specification [1][2], we should do:
337         - If the interface has [OverrideBuiltins]:
338             1. Indexed getter
339             2. Named getter
340             3. Static / own properties
341         - Otherwise:
342             1. Indexed getter
343             2. Static / own properties
344             3. Prototype check
345             4. Named getter
346
347         This patch adds support for the [OverrideBuiltins] IDL extended
348         attribute [3] and aligns our bindings implementation with the Web IDL
349         specification weither that IDL extended attribute is present or
350         not.
351         
352         [1] https://heycam.github.io/webidl/#getownproperty-guts
353         [2] https://heycam.github.io/webidl/#dfn-named-property-visibility
354         [3] https://heycam.github.io/webidl/#OverrideBuiltins
355
356         Performance:
357         - PerformanceTests/Bindings/childNodes-traversal.html: ~Same
358         - PerformanceTests/Bindings/children-traversal.html: +104% :)
359
360         No new tests, covered by:
361         fast/dom/htmlcollection-getownproperty.html
362         fast/dom/collection-length-should-not-be-overridden.html
363         fast/forms/input-named-action-overrides-action-attribute.html
364
365         * bindings/js/JSHTMLCollectionCustom.cpp:
366         (WebCore::JSHTMLCollection::nameGetter):
367         Add assertions to make sure we don't use HTMLCollection's namedGetter()
368         for HTMLFormControlsCollection / HTMLOptionsCollection subclasses.
369         We should use the subclasses' namedGetter() instead.
370
371         * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
372         (WebCore::JSHTMLOptionsCollection::canGetItemsForName):
373         (WebCore::JSHTMLOptionsCollection::nameGetter):
374         Add code for handling named getter requests on
375         HTMLOptionsCollection.
376
377         * bindings/js/JSNodeListCustom.cpp:
378         (WebCore::JSNodeList::canGetItemsForName):
379         (WebCore::JSNodeList::nameGetter):
380         Refactor custom code for the NodeList named getter, now that the
381         IDL interface is using [CustomNamedGetter] instead of
382         [JSCustomGetOwnPropertySlotAndDescriptor].
383
384         * bindings/scripts/CodeGeneratorJS.pm:
385         (GenerateGetOwnPropertySlotBody):
386         (GenerateHeaderContentHeader): Deleted.
387         - Add support for the [OverrideBuiltins] IDL extended attribute and
388         update the generated getOwnPropertySlot() methods to match the
389         Web IDL specification.
390         - Also drop the JSC::HasImpureGetOwnPropertySlot flag for interfaces
391         that have a named getter but NOT the [OverrideBuiltins] IDL extended
392         attribute. Without [OverrideBuiltins], named properties can no longer
393         shadow own properties so we no longer need to mark GetOwnPropertySlot
394         as impure. This allows caching of properties.
395
396         * bindings/scripts/IDLAttributes.txt:
397         Add [OverrideBuiltins] IDL extended attribute [3].
398
399         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
400         (WebCore::JSTestActiveDOMObject::getOwnPropertySlot):
401         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
402         (WebCore::JSTestCustomNamedGetter::getOwnPropertySlot):
403         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
404         (WebCore::JSTestEventTarget::getOwnPropertySlot):
405         * bindings/scripts/test/JS/JSTestException.cpp:
406         (WebCore::JSTestException::getOwnPropertySlot):
407         * bindings/scripts/test/JS/JSTestInterface.cpp:
408         (WebCore::JSTestInterface::getOwnPropertySlot):
409         * bindings/scripts/test/JS/JSTestObj.cpp:
410         (WebCore::JSTestObj::getOwnPropertySlot):
411         Rebaseline the bindings tests as their getOwnPropertySlot() method
412         is now different.
413
414         * bindings/scripts/test/GObject/WebKitDOMTestOverrideBuiltins.cpp: Added.
415         * bindings/scripts/test/GObject/WebKitDOMTestOverrideBuiltins.h: Added.
416         * bindings/scripts/test/GObject/WebKitDOMTestOverrideBuiltinsPrivate.h: Added.
417         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp: Added.
418         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h: Added.
419         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
420         * bindings/scripts/test/ObjC/DOMTestOverrideBuiltins.h: Added.
421         * bindings/scripts/test/ObjC/DOMTestOverrideBuiltins.mm: Added.
422         * bindings/scripts/test/ObjC/DOMTestOverrideBuiltinsInternal.h: Added.
423         * bindings/scripts/test/TestOverrideBuiltins.idl: Added.
424         Add bindings test coverage for the new [OverrideBuiltins] IDL extended
425         attribute [3].
426
427         * dom/DOMStringMap.idl:
428         Add [OverrideBuiltins] IDL extended attribute to match the specification:
429         https://html.spec.whatwg.org/multipage/infrastructure.html#domstringmap
430
431         * dom/NodeList.idl:
432         Use CustomNamedGetter IDL extended attribute instead of
433         JSCustomGetOwnPropertySlotAndDescriptor as NodeList merely implements
434         a custom named getter. This makes sure that the order in which the
435         named getter is called is correct as per the Web IDL specification.
436
437         * html/HTMLDocument.idl:
438         Add [OverrideBuiltins] IDL extended attribute to match the specification:
439         https://html.spec.whatwg.org/multipage/dom.html#the-document-object
440
441         * html/HTMLFormElement.idl:
442         Add [OverrideBuiltins] IDL extended attribute to match the specification:
443         https://html.spec.whatwg.org/multipage/forms.html#the-form-element
444
445         * html/HTMLOptionsCollection.idl:
446         Add missing 'getter' in front of the named getter, as the per the HTML
447         specification. Without this, HTMLOptionsCollection would not be
448         recognized as a named properties object, which means that we would not
449         check the HTMLOptionsCollection prototype before querying the named
450         getter on HTMLCollection. This used to work because the bindings
451         generator was hard-coding the prototype check for every HTML*Collection
452         IDL interface. In this patch, we generalized the check to every
453         interface that has a named getter.
454
455 2015-08-18  Per Arne Vollan  <peavo@outlook.com>
456
457         [Win] Popup menu displayed at incorrect position when page is scrolled and device scale factor != 1.
458         https://bugs.webkit.org/show_bug.cgi?id=148130
459
460         Reviewed by Alex Christensen.
461
462         Scale WebView coordinates with device scale factor.
463
464         * platform/win/PopupMenuWin.cpp:
465         (WebCore::PopupMenuWin::calculatePositionAndSize):
466
467 2015-08-18  Javier Fernandez  <jfernandez@igalia.com>
468
469         [CSS Grid Layout] Do not stretch always grid items with auto width
470         https://bugs.webkit.org/show_bug.cgi?id=148069
471
472         Reviewed by Darin Adler.
473
474         We assumed that any grid item with 'auto' width will be stretched
475         to fill all the available space in its grid area. We assumed this
476         because grid area acts as item's container.
477
478         However, Grid Layout specification states on its Alignment section
479         that items will be stretched by default, unless either
480         justify-self or align-self compute to a value other than stretch
481         or margins are auto. In those cases, grid items will auto-size to
482         fit their contents.
483
484         Tests:
485         fast/css-grid-layout/grid-align-justify-stretch.html
486         fast/css-grid-layout/grid-item-auto-margins-and-stretch.html
487         fast/css-grid-layout/grid-items-should-not-be-stretched-when-height-or-width-or-margin-change.html
488
489         * rendering/RenderBox.cpp:
490         (WebCore::RenderBox::computeLogicalWidthInRegion):
491         * rendering/RenderGrid.cpp:
492         (WebCore::RenderGrid::layoutGridItems):
493         (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded):
494         (WebCore::RenderGrid::needToStretchChildLogicalHeight): Deleted.
495         * rendering/RenderGrid.h:
496
497 2015-08-18  Xabier Rodriguez Calvar  <calvaris@igalia.com>
498
499         [Streams API] Update implementation with the latest spec
500         https://bugs.webkit.org/show_bug.cgi?id=147978
501
502         Reviewed by Darin Adler.
503
504         Changed the way the read and closed promises are resolved and the stream is released when an even closes or
505         errors the stream.
506
507         Current tests suffice after changing the order of the promise resolution according to the new spec.
508
509         * Modules/streams/ReadableStream.cpp:
510         (WebCore::ReadableStream::releaseReader): Changed how the promises are resolved.
511         (WebCore::ReadableStream::changeStateToErrored): Changed how the promises are resolved and manually releasing
512         the stream instead of calling releaseReader according to the spec.
513
514 2015-08-17  Zalan Bujtas  <zalan@apple.com>
515
516         Outline with auto style leaves bits behind when the the box is moved.
517         https://bugs.webkit.org/show_bug.cgi?id=148100
518
519         Reviewed by Simon Fraser.
520
521         We paint the focus ring when 'outline-style: auto' is present, however
522         we don't take the focus ring width into account when the repaint rect
523         is computed.
524
525         Tests: fast/repaint/outline-with1px-auto-repaint-rect.html
526                fast/repaint/outline-with2px-auto-repaint-rect.html
527                fast/repaint/outline-with3px-auto-repaint-rect.html
528
529         * rendering/RenderObject.cpp:
530         (WebCore::RenderObject::adjustRectForOutlineAndShadow):
531         * rendering/RenderThemeMac.h:
532         * rendering/RenderThemeMac.mm:
533         (WebCore::RenderThemeMac::platformFocusRingMaxWidth): Deleted. : 0 as focus ring width is incorrect.
534         The reason why r169699 fixed the failing cases was because they all had outline width < 3 (but no auto outline style).
535         The correct fix is to check if the style requires focus ring painting and use the RenderTheme::platformFocusRingMaxWidth
536         accordingly.
537
538 2015-08-17  Myles C. Maxfield  <mmaxfield@apple.com>
539
540         [Cocoa] Address post-commit review
541         https://bugs.webkit.org/show_bug.cgi?id=147864
542
543         Reviewed by Darin Adler.
544
545         Create helper functions to cast between NSFont*s and CTFontRefs.
546
547         No new tests because there is no behavior change.
548
549         * platform/graphics/FontPlatformData.h:
550         (WebCore::toCTFont):
551         (WebCore::toNSFont):
552         * platform/graphics/cocoa/FontCacheCoreText.cpp:
553         * platform/graphics/cocoa/FontCocoa.mm:
554         (WebCore::Font::platformCreateScaledFont):
555         (WebCore::Font::compositeFontReferenceFont):
556         * platform/graphics/mac/FontCacheMac.mm:
557         (WebCore::FontCache::platformPurgeInactiveFontData):
558         (WebCore::lookupCTFont):
559         (WebCore::FontCache::systemFallbackForCharacters):
560         (WebCore::FontCache::createFontPlatformData):
561         * platform/mac/DragImageMac.mm:
562         (WebCore::fontFromNSFont):
563         (WebCore::widthWithFont):
564         (WebCore::drawAtPoint):
565         * platform/spi/mac/NSFontSPI.h:
566
567 2015-08-17  Alex Christensen  <achristensen@webkit.org>
568
569         WinCairo build fix after r188566
570
571         * platform/graphics/win/FontPlatformDataCairoWin.cpp:
572         (WebCore::FontPlatformData::FontPlatformData):
573         Remove reference to removed m_isCompositeFontReference.
574
575 2015-08-17  Alex Christensen  <achristensen@webkit.org>
576
577         Add const to content extension parser
578         https://bugs.webkit.org/show_bug.cgi?id=148044
579
580         Reviewed by Benjamin Poulain.
581
582         * contentextensions/ContentExtensionParser.cpp:
583         (WebCore::ContentExtensions::containsOnlyASCIIWithNoUppercase):
584         (WebCore::ContentExtensions::getDomainList):
585         (WebCore::ContentExtensions::getTypeFlags):
586         (WebCore::ContentExtensions::loadTrigger):
587         (WebCore::ContentExtensions::loadAction):
588         (WebCore::ContentExtensions::loadRule):
589         (WebCore::ContentExtensions::loadEncodedRules):
590         Add const.  No change in behavior.
591
592 2015-08-17  Myles C. Maxfield  <mmaxfield@apple.com>
593
594         [OS X] Remove support for composite fonts
595         https://bugs.webkit.org/show_bug.cgi?id=147920
596
597         Reviewed by Dan Bernstein.
598
599         Composite fonts were first introduced in [1]. These composite fonts are extremely rare
600         because:
601         1. None of the preinstalled fonts on either OS X nor iOS are composite fonts,
602         2. WebKit does not support loading web fonts from composite font files, and
603         3. WebKit's support only ever existed on OS X (none of the other ports).
604
605         In fact, no one I've consulted with has ever seen any of these fonts used in the wild.
606         The fonts also require a fundamentally broken code path, and add complexity to WebKit.
607
608         [1] https://bugs.webkit.org/attachment.cgi?id=134923&action=review
609
610         No new tests.
611
612         * platform/graphics/Font.h:
613         * platform/graphics/FontPlatformData.cpp:
614         (WebCore::FontPlatformData::FontPlatformData): Deleted.
615         (WebCore::FontPlatformData::operator=): Deleted.
616         * platform/graphics/FontPlatformData.h:
617         (WebCore::FontPlatformData::isCompositeFontReference): Deleted.
618         (WebCore::FontPlatformData::operator==): Deleted.
619         * platform/graphics/cocoa/FontCocoa.mm:
620         (WebCore::Font::compositeFontReferenceFont): Deleted.
621         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
622         (WebCore::FontPlatformData::FontPlatformData): Deleted.
623         (WebCore::FontPlatformData::setFont): Deleted.
624         * platform/graphics/mac/GlyphPageMac.cpp:
625         (WebCore::shouldUseCoreText):
626         (WebCore::GlyphPage::fill):
627
628 2015-08-17  Tim Horton  <timothy_horton@apple.com>
629
630         Some functions on DictionaryLookup.h should just be generic functions elsewhere
631         https://bugs.webkit.org/show_bug.cgi?id=138567
632
633         Reviewed by Dean Jackson.
634
635         No new tests, just refactoring.
636
637         * dom/Range.cpp:
638         (WebCore::Range::contains):
639         * dom/Range.h:
640         Add a Range::contains(VisiblePosition).
641         It's simpler than the old thing from DictionaryLookup.mm, but does the same thing.
642         It's so simple that it doesn't necessarily need to exist, but it seems useful.
643
644         * editing/VisiblePosition.cpp:
645         (WebCore::makeRange):
646         nullptrs
647
648         * editing/mac/DictionaryLookup.h:
649         * editing/mac/DictionaryLookup.mm:
650         (WebCore::selectionContainsPosition):
651         (WebCore::rangeForDictionaryLookupAtHitTestResult):
652         (WebCore::isPositionInRange): Deleted.
653         (WebCore::shouldUseSelection): Deleted.
654         Move isPositionInRange to Range.
655         Rename shouldUseSelection to what it really means.
656         I didn't move selectionContainsPosition to VisibleSelection because it
657         only handles Range selections, not any of the ohers, and thus isn't
658         generic enough to put there.
659
660 2015-08-17  Alex Christensen  <achristensen@webkit.org>
661
662         [Win CMake] Allow WebKitLibraries directory to be set from the command line
663         https://bugs.webkit.org/show_bug.cgi?id=148112
664
665         Reviewed by Brent Fulgham.
666
667         * PlatformAppleWin.cmake:
668         * PlatformWinCairo.cmake:
669         Don't use an environment variable for WEBKIT_LIBRARIES_DIR.  
670
671 2015-08-17  Myles C. Maxfield  <mmaxfield@apple.com>
672
673         [OS X] Migrate off of CTFontSetRenderingParameters()
674         https://bugs.webkit.org/show_bug.cgi?id=148113
675
676         Reviewed by Lucas Forschler.
677
678         Instead, use CTFontSetRenderingStyle().
679
680         No new tests because there is no behavior change.
681
682         * platform/spi/cocoa/CoreTextSPI.h:
683
684 2015-08-17  Alex Christensen  <achristensen@webkit.org>
685
686         Build Debug Suffix on Windows with CMake
687         https://bugs.webkit.org/show_bug.cgi?id=148083
688
689         Reviewed by Brent Fulgham.
690
691         * CMakeLists.txt:
692         * PlatformAppleWin.cmake:
693         * PlatformWin.cmake:
694         Add DEBUG_SUFFIX
695
696 2015-08-17  Myles C. Maxfield  <mmaxfield@apple.com>
697
698         Implement IntegerHasher
699         https://bugs.webkit.org/show_bug.cgi?id=147866
700
701         Reviewed by Darin Adler and Anders Carlsson.
702
703         Rename StringHasher.h to Hasher.
704
705         No new tests because there is no behavior difference.
706
707         * contentextensions/DFAMinimizer.cpp: Use new #include.
708         * contentextensions/HashableActionList.h: Ditto.
709         * platform/graphics/FontFeatureSettings.cpp:
710         (WebCore::FontFeatureSettings::hash): Use new IntegerHasher class.
711         (WebCore::FontFeature::hash): Deleted.
712         * platform/graphics/FontFeatureSettings.h: Remove unnecessary function.
713         * platform/graphics/Gradient.cpp: Use new #include.
714         * platform/graphics/WidthCache.h: Ditto.
715
716 2015-08-17  Chris Dumez  <cdumez@apple.com>
717
718         Log actual PageCache retrieval success rate using diagnostic logging
719         https://bugs.webkit.org/show_bug.cgi?id=147937
720
721         Reviewed by Antti Koivisto.
722
723         Log actual PageCache retrieval success rate using diagnostic logging.
724         Previously, we would only log how successful we are at saving entries
725         into the cache, which is not the most interesting metric.
726
727         * history/PageCache.cpp:
728         (WebCore::canCachePage):
729         * loader/FrameLoader.cpp:
730         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
731         * page/DiagnosticLoggingKeys.cpp:
732         (WebCore::DiagnosticLoggingKeys::canCacheKey):
733         * page/DiagnosticLoggingKeys.h:
734
735 2015-08-17  Alex Christensen  <achristensen@webkit.org>
736
737         Move some commands from ./CMakeLists.txt to Source/cmake
738         https://bugs.webkit.org/show_bug.cgi?id=148003
739
740         Reviewed by Brent Fulgham.
741
742         * CMakeLists.txt:
743         Added commands needed to build WebCore by itself.
744
745 2015-08-17  Alex Christensen  <achristensen@webkit.org>
746
747         Remove unused multisampling check
748         https://bugs.webkit.org/show_bug.cgi?id=148030
749
750         Reviewed by Dean Jackson.
751
752         No change in behavior.
753         Extensions3DOpenGLCommon.m_maySupportMultisampling is always true.
754
755         * platform/graphics/Extensions3D.h:
756         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
757         (WebCore::Extensions3DOpenGLCommon::Extensions3DOpenGLCommon):
758         * platform/graphics/opengl/Extensions3DOpenGLCommon.h:
759         (WebCore::Extensions3DOpenGLCommon::isImagination):
760         (WebCore::Extensions3DOpenGLCommon::vendor):
761         (WebCore::Extensions3DOpenGLCommon::requiresBuiltInFunctionEmulation):
762         (WebCore::Extensions3DOpenGLCommon::requiresRestrictedMaximumTextureSize):
763         (WebCore::Extensions3DOpenGLCommon::maySupportMultisampling): Deleted.
764         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
765         (WebCore::GraphicsContext3D::validateDepthStencil):
766
767 2015-08-17  Andy Estes  <aestes@apple.com>
768
769         REGRESSION (r188486): Crash in SubresourceLoader::didReceiveResponse() when TemporaryChange goes out of scope
770         https://bugs.webkit.org/show_bug.cgi?id=148082
771
772         Reviewed by Alexey Proskuryakov.
773
774         Covered by existing tests run under ASan or Guard Malloc.
775
776         * loader/SubresourceLoader.cpp:
777         (WebCore::SubresourceLoader::didReceiveResponse): Ensure that callingDidReceiveResponse is destroyed while the
778         SubresourceLoader is still alive by declaring it after protect.
779
780 2015-08-17  Simon Fraser  <simon.fraser@apple.com>
781
782         will-change should sometimes trigger compositing
783         https://bugs.webkit.org/show_bug.cgi?id=148072
784
785         Reviewed by Tim Horton.
786         
787         Implement the compositing side-effects of will-change, if any of the
788         following properties are specified:
789             opacity
790             filter (as -webkit-filter)
791             backdrop-filter (as -webkit-backdrop-filter)
792             transform (on transformable elements only)
793
794         Tests: compositing/layer-creation/will-change-change.html
795                compositing/layer-creation/will-change-layer-creation.html
796
797         * inspector/InspectorLayerTreeAgent.cpp:
798         (WebCore::InspectorLayerTreeAgent::reasonsForCompositingLayer): Tell the inspector
799         about will-change.
800         * rendering/RenderElement.cpp:
801         (WebCore::RenderElement::adjustStyleDifference): Need to trigger a recomposite if
802         will-change includes a compositing trigger property. This gets called before and
803         after setting the style, so this checks both states.
804         (WebCore::RenderElement::shouldWillChangeCreateStackingContext):
805         * rendering/RenderElement.h:
806         (WebCore::RenderElement::willChangeCreatesStackingContext): Helper function that
807         RenderInline uses to determine if it needs to create a RenderLayer, since RenderInline
808         doesn't get automatic layer RenderLayers as a side effect of having non-auto z-index
809         in the style.
810         * rendering/RenderInline.h: Need to trigger a RenderLayer if will-change includes
811         a property that applies to inlines.
812         * rendering/RenderLayerCompositor.cpp:
813         (WebCore::RenderLayerCompositor::requiresCompositingLayer): Call requiresCompositingForWillChange().
814         (WebCore::RenderLayerCompositor::requiresOwnBackingStore): Call requiresCompositingForWillChange().
815         (WebCore::RenderLayerCompositor::reasonsForCompositing): Include requiresCompositingForWillChange().
816         (WebCore::RenderLayerCompositor::requiresCompositingForWillChange): If will-change contains a
817         property that would trigger compositing on this element, return true.
818         * rendering/RenderLayerCompositor.h:
819         * rendering/style/RenderStyle.cpp:
820         (WebCore::RenderStyle::changeRequiresLayout): Set ContextSensitivePropertyWillChange in
821         changedContextSensitiveProperties if will-change changes.
822         * rendering/style/RenderStyle.h: Rename for clarity.
823         * rendering/style/RenderStyleConstants.h: Add ContextSensitivePropertyWillChange.
824         * rendering/style/WillChangeData.cpp:
825         (WebCore::propertyCreatesStackingContext): Subset of properties that create stacking
826         context on any element.
827         (WebCore::propertyCreatesStackingContextOnBoxesOnly): Additional properties that
828         create stacking context on boxes.
829         (WebCore::propertyTriggersCompositing): Properties that trigger compositing on
830         any element.
831         (WebCore::propertyTriggersCompositingOnBoxesOnly): Additional properties that
832         trigger compositing on boxes.
833         (WebCore::WillChangeData::addFeature): As features are added, manage a set of
834         flags to know if they trigger stacking context or compositing, on inlines and boxes.
835         (WebCore::WillChangeData::createsStackingContext): Deleted.
836         * rendering/style/WillChangeData.h:
837         (WebCore::WillChangeData::canCreateStackingContext):
838         (WebCore::WillChangeData::canCreateStackingContextOnInline):
839         (WebCore::WillChangeData::canTriggerCompositing):
840         (WebCore::WillChangeData::canTriggerCompositingOnInline):
841
842 2015-08-17  Timothy Horton  <timothy_horton@apple.com>
843
844         Holes for find matches that span multiple lines are completely wrong
845         https://bugs.webkit.org/show_bug.cgi?id=148065
846         <rdar://problem/5305002>
847
848         Reviewed by Simon Fraser.
849
850         Test: fast/text/mark-matches-broken-line-rendering.html
851
852         Two big problems with find holes:
853             - RenderedDocumentMarker only has one rect, but a marker can be painted
854               by multiple text runs, each with their own rendered rect
855             - paintTextMatchMarker does std::max((unsigned)a, (unsigned)0), which is
856               obviously an overflow problem/not going to work if a is negative
857
858         The combination of these issues causes the holes for find matches to be
859         very broken: text that isn't part of the match is highlighted, and some
860         text that is part of the match isn't highlighted.
861
862         To fix, make RenderedDocumentMarker support multiple rects, and use signed
863         math (like paintDocumentMarker already did) when computing positions in paintTextMatchMarker.
864
865         * dom/DocumentMarkerController.cpp:
866         (WebCore::DocumentMarkerController::addTextMatchMarker):
867         (WebCore::DocumentMarkerController::renderedRectsForMarkers):
868         * dom/RenderedDocumentMarker.h:
869         (WebCore::RenderedDocumentMarker::RenderedDocumentMarker):
870         (WebCore::RenderedDocumentMarker::isRendered):
871         (WebCore::RenderedDocumentMarker::contains):
872         (WebCore::RenderedDocumentMarker::addRenderedRect):
873         (WebCore::RenderedDocumentMarker::renderedRects):
874         (WebCore::RenderedDocumentMarker::invalidate):
875         (WebCore::RenderedDocumentMarker::setRenderedRect): Deleted.
876         (WebCore::RenderedDocumentMarker::renderedRect): Deleted.
877         (WebCore::RenderedDocumentMarker::invalidMarkerRect): Deleted.
878         * rendering/InlineTextBox.cpp:
879         (WebCore::InlineTextBox::paintDocumentMarker):
880         (WebCore::InlineTextBox::paintTextMatchMarker):
881         (WebCore::InlineTextBox::computeRectForReplacementMarker):
882         * rendering/svg/SVGInlineFlowBox.cpp:
883         (WebCore::SVGInlineFlowBox::computeTextMatchMarkerRectForRenderer):
884
885 2015-08-17  Timothy Horton  <timothy_horton@apple.com>
886
887         Adopt shrink-wrapping for TextIndicators on Mac
888         https://bugs.webkit.org/show_bug.cgi?id=148064
889
890         Reviewed by Beth Dakin.
891
892         Instead of indicating the bounding rect when there are multiple text rects,
893         use shrink-wrapping for TextIndicatorWindow (on Mac), like we do on iOS.
894
895         * bindings/objc/DOM.mm:
896         (-[DOMNode getPreviewSnapshotImage:andRects:]):
897         Make getPreviewSnapshotImage use the same options that iOS WebKit2 uses.
898         This fixes a regression from r188420 where iOS WebKit1 TextIndicators lost
899         all of the relevant (previously hardcoded inside TextIndicator) options.
900
901         * page/TextIndicator.cpp:
902         (WebCore::TextIndicator::createWithRange):
903         (WebCore::TextIndicator::createWithSelectionInFrame):
904         (WebCore::initializeIndicator):
905         Don't keep indicatesCurrentSelection in TextIndicatorData. Instead,
906         just pass it through to initializeIndicator. Add a flag which stops us
907         from zeroing out the margin if indicatesCurrentSelection is true.
908         Move default margins into TextIndicator so they can be applied to the stored rects
909         just like on iOS, instead of trying to apply them later like we used to on Mac.
910
911         * page/TextIndicator.h:
912         (WebCore::TextIndicator::indicatesCurrentSelection): Deleted.
913         * page/mac/TextIndicatorWindow.h:
914         * page/mac/TextIndicatorWindow.mm:
915         (-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]):
916         (WebCore::TextIndicatorWindow::setTextIndicator):
917         (outsetIndicatorRectIncludingShadow): Deleted.
918         (textIndicatorsForTextRectsOverlap): Deleted.
919         Make use of pathsWithShrinkWrappedRects for TextIndicatorWindow, instead
920         of just smushing all intersecting rects together. Use the computed path
921         for the shadows and to mask the yellow highlight and snapshot layer.
922
923         * platform/graphics/PathUtilities.cpp:
924         (WebCore::PathUtilities::pathsWithShrinkWrappedRects):
925         (WebCore::PathUtilities::pathWithShrinkWrappedRects):
926         * platform/graphics/PathUtilities.h:
927         Make it possible to retrieve each non-intersecting path individually, instead
928         of just a single giant Path, so that TextIndicatorWindow can make separate
929         layers for each one (so they can bounce separately).
930
931 2015-08-17  Simon Fraser  <simon.fraser@apple.com>
932
933         Remove some includes from Node.cpp
934         https://bugs.webkit.org/show_bug.cgi?id=148000
935
936         Reviewed by Anders Carlsson.
937
938         No need for these includes.
939
940         * dom/Node.cpp:
941
942 2015-08-17  Chris Dumez  <cdumez@apple.com>
943
944         Accessing HTMLCollection.length is slow
945         https://bugs.webkit.org/show_bug.cgi?id=148039
946
947         Reviewed by Ryosuke Niwa.
948
949         Accessing was HTMLCollection.length is slow, much slower than accessing
950         NodeList.length. The reason is that HTMLCollection's bindings code is
951         slightly different. In particular, HTMLCollection's GetOwnPropertySlot()
952         has an extra check to see if the PropertyName is available on the
953         prototype before doing:
954         1. Check static properties (getStaticValueSlotEntryWithoutCaching())
955         2. Indexed getter
956         3. Named getter
957         4. Check own properties (getStaticValueSlot())
958
959         This means that everytime the JavaScript was accessing HTMLCollection.length
960         or HTMLCollection[index], we would check if length / index was present on the
961         prototype before calling HTMLCollection::length() / HTMLCollection::item(i).
962         The prototype check is fairly expensive and was making traversing an
963         HTMLCollection much slower than traversing a NodeList.
964
965         In this patch, I refactored GetOwnPropertySlot() to do:
966         1. Indexed getter
967         2. Check static properties
968         3. Prototype check
969         4. Named getter
970         5. Check own properties
971
972         This way, the prototype check is no longer slowing down HTMLCollection
973         traversal. What matters is that we do the prototype check *before* calling
974         the named getter as we don't want named properties to mask properties on
975         the prototype.
976
977         Note that this patch takes the minimal approach to get the performance win
978         while limiting the risk of breakage. Indeed, the current behavior still
979         does not match the WebIDL specification, which seems to indicate the order
980         should be:
981         1. Indexed getter
982         2. Check static / own properties
983         3. Prototype check
984         4. Named getter
985
986         Once we match the specification, I believe we will be able to drop the
987         JSC::HasImpureGetOwnPropertySlot flag on HTMLCollection, which currently
988         makes HTMLCollection.length not cacheable. Right now, I believe we still
989         need this flag because named properties can still mask own properties.
990
991         Performance:
992         /Bindings/childNodes-traversal: 5597.54 +/- 0.7% -> 5572.10 +/- 0.4%
993         /Bindings/children-traversal: 3852.61 +/- 0.3% -> 4731.03 +/- 0.3% (~23% better)
994
995         Test: fast/dom/htmlcollection-getownproperty.html
996
997         * bindings/scripts/CodeGeneratorJS.pm:
998         (GenerateGetOwnPropertySlotBody):
999         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1000         (WebCore::JSTestEventTarget::getOwnPropertySlot):
1001
1002 2015-08-17  Jinyoung Hur  <hur.ims@navercorp.com>
1003
1004         Fix possible EGL and GLX makeCurrent problem of GLPlatformContext and GLPlatformSurface
1005         https://bugs.webkit.org/show_bug.cgi?id=147695
1006
1007         Reviewed by Gyuyoung Kim.
1008
1009         GLPLatformContext::makeCurrent is implemented to do no-op when it thinks, comparing with a static
1010         variable declared in GLPlatformContext.cpp, there is no changes. This can lead to not-working 
1011         makeCurrent when other part of codes, e.g., Cairo-gl, change EGL or GLX current context by calling
1012         something like eglMakeCurrent. So modify GLPLatformContext::makeCurrent to use the return value of
1013         eglGetCurrentContext or glXGetCurrentContext as a comparing target rather than a static variable.
1014         In addition, GLPlatformSurface::isCurrentDrawable is also modified to use eglGetCurrentSurface or
1015         glXGetCurrentDrawable rather than a static variable.
1016
1017         There are no tests because already existing GL tests will verify this change.
1018
1019         * platform/graphics/opengl/GLPlatformContext.cpp:
1020         (WebCore::GLPlatformContext::makeCurrent):
1021         (WebCore::GLPlatformContext::releaseCurrent):
1022         (WebCore::GLCurrentContextWrapper::GLCurrentContextWrapper): Deleted.
1023         (WebCore::GLPlatformContext::~GLPlatformContext): Deleted.
1024         (WebCore::GLPlatformContext::isCurrentContext): Deleted.
1025         (WebCore::GLPlatformContext::getCurrent): Deleted.
1026         * platform/graphics/opengl/GLPlatformContext.h:
1027         * platform/graphics/opengl/GLPlatformSurface.cpp:
1028         (WebCore::GLPlatformSurface::~GLPlatformSurface): Deleted.
1029         (WebCore::GLPlatformSurface::isCurrentDrawable): Deleted.
1030         (WebCore::GLPlatformSurface::onMakeCurrent): Deleted.
1031         (WebCore::GLPlatformSurface::destroy): Deleted.
1032         * platform/graphics/opengl/GLPlatformSurface.h:
1033         * platform/graphics/surfaces/egl/EGLSurface.cpp:
1034         (WebCore::EGLTransportSurface::isCurrentDrawable):
1035         (WebCore::EGLOffScreenSurface::isCurrentDrawable):
1036         * platform/graphics/surfaces/egl/EGLSurface.h:
1037         * platform/graphics/surfaces/glx/GLXSurface.cpp:
1038         (WebCore::GLXTransportSurface::isCurrentContext):
1039         (WebCore::GLXOffScreenSurface::isCurrentContext):
1040         * platform/graphics/surfaces/glx/GLXSurface.h:
1041
1042 2015-08-15  Chris Dumez  <cdumez@apple.com>
1043
1044         Refactor HTMLCollection to be as fast as CachedLiveNodeList
1045         https://bugs.webkit.org/show_bug.cgi?id=147979
1046
1047         Reviewed by Ryosuke Niwa and Antti Koivisto.
1048
1049         Refactor HTMLCollection to be as fast as CachedLiveNodeList. This is in
1050         preparation of having getElementsByTagName*() / getElementsByClassName()
1051         return an HTMLCollection instead of a NodeList, as per the
1052         specification. Chrome and Firefox already match the specification in
1053         this case.
1054
1055         Traversing an HTMLCollection was slow because of all the extra
1056         branching it had compared to CachedLiveNodeList. To address the issue,
1057         this patch introduces a new templated CachedHTMLCollection subclass,
1058         which behaves in a similar way as CachedLiveNodeList. The 2 template
1059         parameters are:
1060         1. The type of the subclass of CachedHTMLCollection, so we can call
1061            elementMatches() directly on the subclass, without needed any
1062            virtual function call or switch statement. This is the same approach
1063            as in CachedLiveNodeList.
1064         2. The type of tree traversal used (Descendants, ChildrenOnly,
1065            CustomForwardOnly). Unlike LiveNodeList, HTMLCollection needs to
1066            support these 3 types of tree traversal. These were causing extra
1067            branching for every item() call. We are now able to choose the right
1068            type of traversal for the CachedHTMLCollection at compile time.
1069
1070         * WebCore.xcodeproj/project.pbxproj:
1071         Add new files to the Project.
1072
1073         * dom/ContainerNode.cpp:
1074         (WebCore::ContainerNode::children):
1075         (WebCore::ContainerNode::cachedHTMLCollection): Deleted.
1076         * dom/ContainerNode.h:
1077         Drop ContainerNode::ensureCachedHTMLCollection() and use
1078         NodeListsNodeData::addCachedCollection() directly at call sites
1079         instead. We need access to the CollectionType at build-time so
1080         we can resolve the CollectionTraversalType parameter for the
1081         GenericCachedHTMLCollection using CollectionTypeTraits.
1082
1083         * dom/Document.cpp:
1084         * dom/Document.h:
1085         Update ensureCachedCollection() so the CollectionType is now a template
1086         parameter instead of a method argument. We need to know the
1087         CollectionType at build time to construct the GenericCachedHTMLCollection.
1088
1089         * dom/ElementChildIterator.h:
1090         (WebCore::ElementChildIterator<ElementType>::operator):
1091         (WebCore::ElementChildConstIterator<ElementType>::operator):
1092         Add support for decrementing an ElementChildIterator, for consistency
1093         with ElementDescendantIterator. We need this to support backward
1094         traversal in CachedHTMLCollections that use the 'ChildrenOnly' type
1095         of traversal.
1096
1097         * dom/LiveNodeList.h:
1098         (WebCore::CachedLiveNodeList<NodeListType>::collectionBegin):
1099         (WebCore::CachedLiveNodeList<NodeListType>::collectionLast):
1100         (WebCore::CachedLiveNodeList<NodeListType>::collectionTraverseForward):
1101         (WebCore::CachedLiveNodeList<NodeListType>::collectionTraverseBackward):
1102         Move traversal implementation to CollectionTraversal.h, so it can be
1103         shared with achedHTMLCollection.h.
1104
1105         * html/CachedHTMLCollection.h: Added.
1106         (WebCore::traversalType>::CachedHTMLCollection):
1107         (WebCore::traversalType>::~CachedHTMLCollection):
1108         (WebCore::traversalType>::CachedHTMLCollection::memoryCost):
1109         (WebCore::traversalType>::collectionCanTraverseBackward):
1110         (WebCore::traversalType>::collectionTraverseForward):
1111         (WebCore::traversalType>::collectionTraverseBackward):
1112         (WebCore::traversalType>::willValidateIndexCache):
1113         (WebCore::traversalType>::length):
1114         (WebCore::traversalType>::item):
1115         (WebCore::traversalType>::invalidateCache):
1116         (WebCore::traversalType>::elementMatches):
1117         (WebCore::nameShouldBeVisibleInDocumentAll):
1118         (WebCore::traversalType>::namedItem):
1119
1120         * html/CollectionTraversal.h: Added.
1121         Add new template class that provide the collection traversal code
1122         needed by CollectionIndexCache. It has template specializations for
1123         all 3 types of traversal: Descendants, ChildrenOnly, and
1124         CustomForwardOnly.
1125
1126         * html/CollectionType.h:
1127         Add CollectionTypeTraits traits so we can resolve the
1128         CollectionTraversalType used by a specific CollectionType at
1129         compile-time. This is needed for the second template parameter of
1130         CachedHTMLCollection.
1131
1132         * html/GenericCachedHTMLCollection.cpp: Added.
1133         (WebCore::GenericCachedHTMLCollection<traversalType>::elementMatches):
1134         * html/GenericCachedHTMLCollection.h: Added.
1135         Add CachedHTMLCollection subclass is the generic one used for all
1136         CollectionTypes that do not have their own subclass (e.g. NodeChildren).
1137         This has an elementMatches() method with a switch() statement handling
1138         all these CollectionTypes. Those are not normally not performance
1139         sensitive.
1140
1141         * html/HTMLAllCollection.cpp:
1142         (WebCore::HTMLAllCollection::HTMLAllCollection):
1143         * html/HTMLAllCollection.h:
1144         Subclass CachedHTMLCollection instead of HTMLCollection. Also provide
1145         an elementMatches() method that simply returns true as we want to
1146         match all elements.
1147
1148         * html/HTMLCollection.cpp:
1149         (WebCore::HTMLCollection::HTMLCollection):
1150         Move CollectionIndexCache member to the subclass and drop the 2 other
1151         members as they are replaced with the CollectionTraversalType template
1152         parameter of CachedHTMLCollection.
1153
1154         (WebCore::HTMLCollection::~HTMLCollection):
1155         Move Document::unregisterCollection() call to ~CachedHTMLCollection()
1156         as we needed to check if the CollectionIndexCache was valid first.
1157
1158         (WebCore::HTMLCollection::updateNamedElementCache):
1159         Move part of the implementation to the CachedHTMLCollection subclass
1160         as it needs to know about the type of traversal and it needs to be
1161         able to call elementMatches().
1162
1163         * html/HTMLCollection.h:
1164         (WebCore::HTMLCollection::rootNode):
1165         Inline for performance reasons and consistency with CachedLiveNodeList.
1166
1167         (WebCore::HTMLCollection::memoryCost):
1168         Make virtual and move part of the implementation to the
1169         CachedHTMLCollection subclass to compute the cost of the
1170         CollectionIndexCache.
1171
1172         (WebCore::HTMLCollection::invalidateCache):
1173         Move part of the implementation to the subclass to invalidate the
1174         CollectionIndexCache.
1175
1176         * html/HTMLFieldSetElement.cpp:
1177         (WebCore::HTMLFieldSetElement::elements):
1178
1179         * html/HTMLFormControlsCollection.cpp:
1180         * html/HTMLFormControlsCollection.h:
1181         Subclass CachedHTMLCollection instead of HTMLCollection.
1182         customElementAfter() no longer needs to be virtual as it
1183         is called directly by CachedHTMLCollection on the subclass.
1184
1185         * html/HTMLFormElement.cpp:
1186         (WebCore::HTMLFormElement::elements):
1187         * html/HTMLMapElement.cpp:
1188         (WebCore::HTMLMapElement::areas):
1189         Call NodeListsNodeData::addCachedCollection() directly.
1190
1191         * html/HTMLNameCollection.cpp:
1192         * html/HTMLNameCollection.h:
1193         Subclass CachedHTMLCollection instead of HTMLCollection.
1194
1195         * html/HTMLOptionsCollection.cpp:
1196         * html/HTMLOptionsCollection.h:
1197         Subclass CachedHTMLCollection instead of HTMLCollection.
1198
1199         * html/HTMLSelectElement.cpp:
1200         (WebCore::HTMLSelectElement::selectedOptions):
1201         (WebCore::HTMLSelectElement::options):
1202         * html/HTMLTableElement.cpp:
1203         (WebCore::HTMLTableElement::rows):
1204         (WebCore::HTMLTableElement::tBodies):
1205         * html/HTMLTableRowElement.cpp:
1206         (WebCore::HTMLTableRowElement::cells):
1207         Call NodeListsNodeData::addCachedCollection() directly.
1208
1209         * html/HTMLTableRowsCollection.cpp:
1210         * html/HTMLTableRowsCollection.h:
1211         Subclass CachedHTMLCollection instead of HTMLCollection.
1212         customElementAfter() no longer needs to be virtual as it
1213         is called directly by CachedHTMLCollection on the subclass.
1214
1215         * html/HTMLTableSectionElement.cpp:
1216         (WebCore::HTMLTableSectionElement::rows):
1217         Call NodeListsNodeData::addCachedCollection() directly.
1218
1219 2015-08-15  Timothy Horton  <timothy_horton@apple.com>
1220
1221         REGRESSION (r168327): ImageDocuments with margins zoom to the wrong position when clicked
1222         https://bugs.webkit.org/show_bug.cgi?id=148063
1223
1224         Reviewed by Simon Fraser.
1225
1226         No new test because it doesn't seem possible to click on a window.open'd ImageDocument.
1227
1228         * html/ImageDocument.cpp:
1229         (WebCore::ImageEventListener::handleEvent):
1230         Use <img>-relative coordinates, not document-relative coordinates,
1231         because after r168327, the image can be centered.
1232
1233 2015-08-15  Simon Fraser  <simon.fraser@apple.com>
1234
1235         Have will-change create stacking context when necessary
1236         https://bugs.webkit.org/show_bug.cgi?id=148060
1237
1238         Reviewed by Zalan Bujtas.
1239         
1240         If will-change includes a property whose non-initial value can create
1241         stacking context, create stacking context for that element.
1242
1243         Test: fast/css/will-change/will-change-creates-stacking-context.html
1244
1245         * css/StyleResolver.cpp:
1246         (WebCore::StyleResolver::adjustRenderStyle):
1247         * rendering/style/RenderStyle.h: Add willChangeCreatesStackingContext(),
1248         which on most cases is a fast, inlined 'return false'. Otherwise ask
1249         the WillChangeData.
1250         * rendering/style/WillChangeData.cpp:
1251         (WebCore::propertyCreatesStackingContext):
1252         (WebCore::WillChangeData::createsStackingContext):
1253         * rendering/style/WillChangeData.h:
1254
1255 2015-08-15  Commit Queue  <commit-queue@webkit.org>
1256
1257         Unreviewed, rolling out r188508.
1258         https://bugs.webkit.org/show_bug.cgi?id=148058
1259
1260         Caused 10 tests to crash (Requested by smfr on #webkit).
1261
1262         Reverted changeset:
1263
1264         "Refactor HTMLCollection to be as fast as CachedLiveNodeList"
1265         https://bugs.webkit.org/show_bug.cgi?id=147979
1266         http://trac.webkit.org/changeset/188508
1267
1268 2015-08-14  Simon Fraser  <simon.fraser@apple.com>
1269
1270         Implement parsing for CSS will-change
1271         https://bugs.webkit.org/show_bug.cgi?id=148052
1272
1273         Reviewed by Dean Jackson.
1274         
1275         Syntax is
1276             will-change: auto | <animateable-feature>#
1277         where
1278             <animateable-feature> = scroll-position | contents | <custom-ident>
1279             
1280         To support this, add WillChangeData which stores a vector of "feature"
1281         and CSS property squished into 16 bits. This is stored in rareNonInheritedData.
1282         If null or an empty list, the property value is 'auto'. The list preserves
1283         unknown properties.
1284
1285         Test: fast/css/will-change-parsing.html
1286
1287         * CMakeLists.txt:
1288         * WebCore.vcxproj/WebCore.vcxproj:
1289         * WebCore.vcxproj/WebCore.vcxproj.filters:
1290         * WebCore.xcodeproj/project.pbxproj:
1291         * css/CSSComputedStyleDeclaration.cpp:
1292         (WebCore::getWillChangePropertyValue):
1293         (WebCore::ComputedStyleExtractor::propertyValue):
1294         * css/CSSParser.cpp:
1295         (WebCore::CSSParser::parseValue):
1296         (WebCore::isValidGridPositionCustomIdent): Renamed from isValidCustomIdent(),
1297         since it's grid-specific.
1298         (WebCore::CSSParser::parseIntegerOrCustomIdentFromGridPosition):
1299         (WebCore::valueIsCSSKeyword): Returns true for the "CSS-wide" keywords like
1300         "initial", "inherit" and "default".
1301         (WebCore::CSSParser::parseFontFamily):
1302         (WebCore::isValidWillChangeAnimatableFeature):
1303         (WebCore::CSSParser::parseWillChange):
1304         (WebCore::isValidCustomIdent): Deleted.
1305         * css/CSSParser.h:
1306         * css/CSSPrimitiveValue.h:
1307         (WebCore::CSSPrimitiveValue::isPropertyID): New utility function.
1308         * css/CSSPropertyNames.in:
1309         * css/CSSValueKeywords.in:
1310         * css/StyleBuilderCustom.h:
1311         (WebCore::StyleBuilderCustom::applyValueWillChange):
1312         * rendering/style/RenderStyle.cpp:
1313         (WebCore::RenderStyle::setWillChange):
1314         * rendering/style/RenderStyle.h:
1315         * rendering/style/StyleAllInOne.cpp:
1316         * rendering/style/StyleRareNonInheritedData.cpp:
1317         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
1318         (WebCore::StyleRareNonInheritedData::operator==):
1319         (WebCore::StyleRareNonInheritedData::willChangeDataEquivalent):
1320         * rendering/style/StyleRareNonInheritedData.h:
1321         * rendering/style/WillChangeData.cpp: Added.
1322         (WebCore::WillChangeData::operator==):
1323         (WebCore::WillChangeData::containsScrollPosition):
1324         (WebCore::WillChangeData::containsContents):
1325         (WebCore::WillChangeData::containsProperty):
1326         (WebCore::WillChangeData::addFeature):
1327         (WebCore::WillChangeData::featureAt):
1328         * rendering/style/WillChangeData.h: Added.
1329         (WebCore::WillChangeData::create):
1330         (WebCore::WillChangeData::operator!=):
1331         (WebCore::WillChangeData::isAuto):
1332         (WebCore::WillChangeData::numFeatures):
1333         (WebCore::WillChangeData::WillChangeData):
1334         (WebCore::WillChangeData::AnimatableFeature::feature):
1335         (WebCore::WillChangeData::AnimatableFeature::property):
1336         (WebCore::WillChangeData::AnimatableFeature::featurePropertyPair):
1337         (WebCore::WillChangeData::AnimatableFeature::AnimatableFeature):
1338         (WebCore::WillChangeData::AnimatableFeature::operator==):
1339
1340 2015-08-15  Wenson Hsieh  <wenson_hsieh@apple.com>
1341
1342         Build fix after r188510
1343
1344         * platform/mac/ThemeMac.mm:
1345         (WebCore::paintToggleButton): Pass a raw pointer to drawCellOrFocusRingWithViewIntoContext.
1346
1347 2015-08-15  Wenson Hsieh  <wenson_hsieh@apple.com>
1348
1349         Search fields should scale when rendering while zoomed
1350         https://bugs.webkit.org/show_bug.cgi?id=147867
1351
1352         Reviewed by Daniel Bates.
1353
1354         When rendering zoomed search fields, draw to an image buffer instead of drawing directly into the context. This
1355         allows us to scale the image buffer up before rendering. Also refactors common logic used to draw both selects
1356         (paintMenuList) and search fields into the new private method paintCellAndSetFocusedElementNeedsRepaintIfNecessary.
1357
1358         * rendering/RenderThemeMac.h: Changed drawCellOrFocusRingWithViewIntoContext to take a raw pointer.
1359         * rendering/RenderThemeMac.mm:
1360         (WebCore::paintToggleButton): Passes a raw pointer to drawCellOrFocusRingWithViewIntoContext.
1361         (WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext): Changed to take a raw pointer.
1362         * rendering/RenderThemeMac.h:
1363         * rendering/RenderThemeMac.mm:
1364         (WebCore::RenderThemeMac::paintMenuList): Refactored to use paintCellAndSetFocusedElementNeedsRepaintIfNecessary.
1365         (WebCore::RenderThemeMac::paintCellAndSetFocusedElementNeedsRepaintIfNecessary): Contains logic common to painting
1366             both selects and search fields.
1367         (WebCore::RenderThemeMac::paintSearchField): Use ThemeMac::drawCellOrFocusRingWithViewIntoContext
1368             to render search fields, utilizing an offscreen image buffer only when necessary.
1369
1370 2015-08-14  Chris Dumez  <cdumez@apple.com>
1371
1372         Refactor HTMLCollection to be as fast as CachedLiveNodeList
1373         https://bugs.webkit.org/show_bug.cgi?id=147979
1374
1375         Reviewed by Ryosuke Niwa.
1376
1377         Refactor HTMLCollection to be as fast as CachedLiveNodeList. This is in
1378         preparation of having getElementsByTagName*() / getElementsByClassName()
1379         return an HTMLCollection instead of a NodeList, as per the
1380         specification. Chrome and Firefox already match the specification in
1381         this case.
1382
1383         Traversing an HTMLCollection was slow because of all the extra
1384         branching it had compared to CachedLiveNodeList. To address the issue,
1385         this patch introduces a new templated CachedHTMLCollection subclass,
1386         which behaves in a similar way as CachedLiveNodeList. The 2 template
1387         parameters are:
1388         1. The type of the subclass of CachedHTMLCollection, so we can call
1389            elementMatches() directly on the subclass, without needed any
1390            virtual function call or switch statement. This is the same approach
1391            as in CachedLiveNodeList.
1392         2. The type of tree traversal used (Descendants, ChildrenOnly,
1393            CustomForwardOnly). Unlike LiveNodeList, HTMLCollection needs to
1394            support these 3 types of tree traversal. These were causing extra
1395            branching for every item() call. We are now able to choose the right
1396            type of traversal for the CachedHTMLCollection at compile time.
1397
1398         * WebCore.xcodeproj/project.pbxproj:
1399         Add new files to the Project.
1400
1401         * dom/ContainerNode.cpp:
1402         (WebCore::ContainerNode::children):
1403         (WebCore::ContainerNode::cachedHTMLCollection): Deleted.
1404         * dom/ContainerNode.h:
1405         Drop ContainerNode::ensureCachedHTMLCollection() and use
1406         NodeListsNodeData::addCachedCollection() directly at call sites
1407         instead. We need access to the CollectionType at build-time so
1408         we can resolve the CollectionTraversalType parameter for the
1409         GenericCachedHTMLCollection using CollectionTypeTraits.
1410
1411         * dom/Document.cpp:
1412         * dom/Document.h:
1413         Update ensureCachedCollection() so the CollectionType is now a template
1414         parameter instead of a method argument. We need to know the
1415         CollectionType at build time to construct the GenericCachedHTMLCollection.
1416
1417         * dom/ElementChildIterator.h:
1418         (WebCore::ElementChildIterator<ElementType>::operator):
1419         (WebCore::ElementChildConstIterator<ElementType>::operator):
1420         Add support for decrementing an ElementChildIterator, for consistency
1421         with ElementDescendantIterator. We need this to support backward
1422         traversal in CachedHTMLCollections that use the 'ChildrenOnly' type
1423         of traversal.
1424
1425         * dom/LiveNodeList.h:
1426         (WebCore::CachedLiveNodeList<NodeListType>::collectionBegin):
1427         (WebCore::CachedLiveNodeList<NodeListType>::collectionLast):
1428         (WebCore::CachedLiveNodeList<NodeListType>::collectionTraverseForward):
1429         (WebCore::CachedLiveNodeList<NodeListType>::collectionTraverseBackward):
1430         Move traversal implementation to CollectionTraversal.h, so it can be
1431         shared with achedHTMLCollection.h.
1432
1433         * html/CachedHTMLCollection.h: Added.
1434         (WebCore::traversalType>::CachedHTMLCollection):
1435         (WebCore::traversalType>::~CachedHTMLCollection):
1436         (WebCore::traversalType>::CachedHTMLCollection::memoryCost):
1437         (WebCore::traversalType>::collectionCanTraverseBackward):
1438         (WebCore::traversalType>::collectionTraverseForward):
1439         (WebCore::traversalType>::collectionTraverseBackward):
1440         (WebCore::traversalType>::willValidateIndexCache):
1441         (WebCore::traversalType>::length):
1442         (WebCore::traversalType>::item):
1443         (WebCore::traversalType>::invalidateCache):
1444         (WebCore::traversalType>::elementMatches):
1445         (WebCore::nameShouldBeVisibleInDocumentAll):
1446         (WebCore::traversalType>::namedItem):
1447
1448         * html/CollectionTraversal.h: Added.
1449         Add new template class that provide the collection traversal code
1450         needed by CollectionIndexCache. It has template specializations for
1451         all 3 types of traversal: Descendants, ChildrenOnly, and
1452         CustomForwardOnly.
1453
1454         * html/CollectionType.h:
1455         Add CollectionTypeTraits traits so we can resolve the
1456         CollectionTraversalType used by a specific CollectionType at
1457         compile-time. This is needed for the second template parameter of
1458         CachedHTMLCollection.
1459
1460         * html/GenericCachedHTMLCollection.cpp: Added.
1461         (WebCore::GenericCachedHTMLCollection<traversalType>::elementMatches):
1462         * html/GenericCachedHTMLCollection.h: Added.
1463         Add CachedHTMLCollection subclass is the generic one used for all
1464         CollectionTypes that do not have their own subclass (e.g. NodeChildren).
1465         This has an elementMatches() method with a switch() statement handling
1466         all these CollectionTypes. Those are not normally not performance
1467         sensitive.
1468
1469         * html/HTMLAllCollection.cpp:
1470         (WebCore::HTMLAllCollection::HTMLAllCollection):
1471         * html/HTMLAllCollection.h:
1472         Subclass CachedHTMLCollection instead of HTMLCollection. Also provide
1473         an elementMatches() method that simply returns true as we want to
1474         match all elements.
1475
1476         * html/HTMLCollection.cpp:
1477         (WebCore::HTMLCollection::HTMLCollection):
1478         Move CollectionIndexCache member to the subclass and drop the 2 other
1479         members as they are replaced with the CollectionTraversalType template
1480         parameter of CachedHTMLCollection.
1481
1482         (WebCore::HTMLCollection::~HTMLCollection):
1483         Move Document::unregisterCollection() call to ~CachedHTMLCollection()
1484         as we needed to check if the CollectionIndexCache was valid first.
1485
1486         (WebCore::HTMLCollection::updateNamedElementCache):
1487         Move part of the implementation to the CachedHTMLCollection subclass
1488         as it needs to know about the type of traversal and it needs to be
1489         able to call elementMatches().
1490
1491         * html/HTMLCollection.h:
1492         (WebCore::HTMLCollection::rootNode):
1493         Inline for performance reasons and consistency with CachedLiveNodeList.
1494
1495         (WebCore::HTMLCollection::memoryCost):
1496         Make virtual and move part of the implementation to the
1497         CachedHTMLCollection subclass to compute the cost of the
1498         CollectionIndexCache.
1499
1500         (WebCore::HTMLCollection::invalidateCache):
1501         Move part of the implementation to the subclass to invalidate the
1502         CollectionIndexCache.
1503
1504         * html/HTMLFieldSetElement.cpp:
1505         (WebCore::HTMLFieldSetElement::elements):
1506
1507         * html/HTMLFormControlsCollection.cpp:
1508         * html/HTMLFormControlsCollection.h:
1509         Subclass CachedHTMLCollection instead of HTMLCollection.
1510         customElementAfter() no longer needs to be virtual as it
1511         is called directly by CachedHTMLCollection on the subclass.
1512
1513         * html/HTMLFormElement.cpp:
1514         (WebCore::HTMLFormElement::elements):
1515         * html/HTMLMapElement.cpp:
1516         (WebCore::HTMLMapElement::areas):
1517         Call NodeListsNodeData::addCachedCollection() directly.
1518
1519         * html/HTMLNameCollection.cpp:
1520         * html/HTMLNameCollection.h:
1521         Subclass CachedHTMLCollection instead of HTMLCollection.
1522
1523         * html/HTMLOptionsCollection.cpp:
1524         * html/HTMLOptionsCollection.h:
1525         Subclass CachedHTMLCollection instead of HTMLCollection.
1526
1527         * html/HTMLSelectElement.cpp:
1528         (WebCore::HTMLSelectElement::selectedOptions):
1529         (WebCore::HTMLSelectElement::options):
1530         * html/HTMLTableElement.cpp:
1531         (WebCore::HTMLTableElement::rows):
1532         (WebCore::HTMLTableElement::tBodies):
1533         * html/HTMLTableRowElement.cpp:
1534         (WebCore::HTMLTableRowElement::cells):
1535         Call NodeListsNodeData::addCachedCollection() directly.
1536
1537         * html/HTMLTableRowsCollection.cpp:
1538         * html/HTMLTableRowsCollection.h:
1539         Subclass CachedHTMLCollection instead of HTMLCollection.
1540         customElementAfter() no longer needs to be virtual as it
1541         is called directly by CachedHTMLCollection on the subclass.
1542
1543         * html/HTMLTableSectionElement.cpp:
1544         (WebCore::HTMLTableSectionElement::rows):
1545         Call NodeListsNodeData::addCachedCollection() directly.
1546
1547 2015-08-14  Matthew Daiter  <mdaiter@apple.com>
1548
1549         Implementing enumerateDevices
1550         https://bugs.webkit.org/show_bug.cgi?id=146426
1551         <rdar://problem/21599847>
1552
1553         Reviewed by Eric Carlson.
1554
1555         * CMakeLists.txt:
1556         * Modules/mediastream/MediaDeviceInfo.idl:
1557         * Modules/mediastream/UserMediaRequest.cpp:
1558         (WebCore::UserMediaRequest::enumerateDevices):
1559         * WebCore.xcodeproj/project.pbxproj:
1560         * platform/mediastream/MediaDevicesPrivate.cpp:
1561         (WebCore::MediaDevicesPrivate::create):
1562         (WebCore::MediaDevicesPrivate::MediaDevicesPrivate):
1563         (WebCore::MediaDevicesPrivate::didCompleteRequest):
1564         (WebCore::MediaDevicesPrivate::availableMediaDevices):
1565         * platform/mediastream/MediaDevicesPrivate.h:
1566         (WebCore::MediaDevicesPrivate::~MediaDevicesPrivate):
1567         (WebCore::MediaDevicesPrivate::capturedDevices):
1568
1569 2015-08-13  Andy Estes  <aestes@apple.com>
1570
1571         [Cocoa] Downloads do not start if policy decision is made asynchronously
1572         https://bugs.webkit.org/show_bug.cgi?id=147985
1573
1574         Reviewed by Brady Eidson.
1575
1576         It's only possible to convert a NSURLConnection to a download while the connection delegate's
1577         -connection:didReceiveResponse: is being called. However, WebKit clients can decide content policy
1578         asynchronously. If a client chooses to download a response asynchronously, we can no longer convert the
1579         connection to a download, so we should start a new download instead.
1580
1581         New API test: _WKDownload.AsynchronousDownloadPolicy
1582
1583         * dom/Document.cpp: Updated to include SubresourceLoader.h.
1584         * loader/DocumentLoader.cpp:
1585         (WebCore::DocumentLoader::mainResourceLoader): Updated to return a SubresourceLoader.
1586         (WebCore::DocumentLoader::continueAfterContentPolicy): Cast mainResourceLoader() to a ResourceLoader since
1587         didFail() is private in SubresourceLoader.
1588         * loader/DocumentLoader.h:
1589         * loader/SubresourceLoader.cpp:
1590         (WebCore::SubresourceLoader::SubresourceLoader): Initialized m_callingDidReceiveResponse to false.
1591         (WebCore::SubresourceLoader::didReceiveResponse): Used TemporaryChange<> to set m_callingDidReceiveResponse to true.
1592         * loader/SubresourceLoader.h:
1593         * loader/appcache/ApplicationCacheHost.cpp: Updated to include SubresourceLoader.h.
1594         * loader/mac/DocumentLoaderMac.cpp: Ditto.
1595
1596 2015-08-14  Zalan Bujtas  <zalan@apple.com>
1597
1598         RenderBlock::simplifiedLayout should pop LayoutStateMaintainer when early returns.
1599         https://bugs.webkit.org/show_bug.cgi?id=148031
1600
1601         Reviewed by Simon Fraser.
1602
1603         LayoutStateMaintainer push/pop calls need to be balanced to ensure layout consistency.
1604
1605         Unable to make a test case for this.
1606
1607         * rendering/RenderBlock.cpp:
1608         (WebCore::RenderBlock::simplifiedLayout):
1609         * rendering/RenderView.h:
1610         (WebCore::LayoutStateMaintainer::~LayoutStateMaintainer): ASSERT the state properly.
1611         (WebCore::LayoutStateMaintainer::push):
1612         (WebCore::LayoutStateMaintainer::pop):
1613         (WebCore::LayoutStateMaintainer::didPush):
1614         (WebCore::LayoutStateMaintainer::LayoutStateMaintainer): Deleted.
1615
1616 2015-08-14  Simon Fraser  <simon.fraser@apple.com>
1617
1618         Remove a few includes from RenderObject.h
1619         https://bugs.webkit.org/show_bug.cgi?id=148007
1620
1621         Reviewed by Tim Horton.
1622
1623         Shrink down the RenderObject.h includes a little.
1624
1625         * rendering/RenderElement.h:
1626         * rendering/RenderObject.h:
1627         * rendering/RenderText.h:
1628
1629 2015-08-14  Tim Horton  <timothy_horton@apple.com>
1630
1631         Fix the Mavericks build.
1632
1633         * platform/spi/mac/LookupSPI.h:
1634
1635 2015-08-14  Tim Horton  <timothy_horton@apple.com>
1636
1637         Fix the build.
1638
1639         * platform/spi/mac/LookupSPI.h:
1640
1641 2015-08-14  Philippe Normand  <pnormand@igalia.com>
1642
1643         [GStreamer] Handle missing plugins better at runtime
1644         https://bugs.webkit.org/show_bug.cgi?id=146999
1645
1646         Reviewed by Carlos Garcia Campos.
1647
1648         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1649         (WebCore::MediaPlayerPrivateGStreamer::createAudioSink): Warn the
1650         user if autoaudiosink wasn't found at runtime. In that case
1651         playbin will try to be smart by itself, hopefully. Also moved a
1652         couple GST_WARNING calls to WARN_MEDIA_MESSAGE.
1653         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Use
1654         WARN_MEDIA_MESSAGE here as well.
1655
1656 2015-08-13  Antti Koivisto  <antti@apple.com>
1657
1658         Cover memory cache subresource validation policy with cache tests
1659         https://bugs.webkit.org/show_bug.cgi?id=147830
1660
1661         Reviewed by Alexey Proskuryakov.
1662
1663         Existing tests under http/tests/cache/disk-cache currently cover disk and XHR memory cache validation behaviors.
1664         They can be extended to cover the regular subresource policy too.
1665
1666         Add window.internals API to disable CachedRawResource validation behavior. This makes XHR validate like
1667         other resources and allows existing tests (that use XHR) to cover normal subresource policy .
1668
1669         Test results reveal some bugs. For example subresources in memory cache don't respect Vary header.
1670
1671         It is generally bad that we have a separate XHR-and-main-resource validation policy in memory cache. Network cache
1672         doesn't have one.
1673
1674         * loader/FrameLoader.cpp:
1675         (WebCore::FrameLoader::clearTestingOverrides):
1676         (WebCore::FrameLoader::applyShouldOpenExternalURLsPolicyToNewDocumentLoader):
1677         * loader/FrameLoader.h:
1678         (WebCore::FrameLoader::setOverrideCachePolicyForTesting):
1679         (WebCore::FrameLoader::setOverrideResourceLoadPriorityForTesting):
1680         (WebCore::FrameLoader::setStrictRawResourceValidationPolicyDisabledForTesting):
1681         (WebCore::FrameLoader::isStrictRawResourceValidationPolicyDisabledForTesting):
1682         (WebCore::FrameLoader::provisionalLoadErrorBeingHandledURL):
1683         * loader/cache/CachedRawResource.h:
1684         * loader/cache/CachedResource.h:
1685         (WebCore::CachedResource::setLoadFinishTime):
1686         (WebCore::CachedResource::loadFinishTime):
1687         (WebCore::CachedResource::canReuse): Deleted.
1688
1689             Made canReuse non-virtual and removed it from the base. Only CachedRawResource has implementation.
1690
1691         * loader/cache/CachedResourceLoader.cpp:
1692         (WebCore::CachedResourceLoader::determineRevalidationPolicy):
1693         * testing/Internals.cpp:
1694         (WebCore::Internals::setOverrideResourceLoadPriority):
1695         (WebCore::Internals::setStrictRawResourceValidationPolicyDisabled):
1696         (WebCore::Internals::clearMemoryCache):
1697         * testing/Internals.h:
1698
1699 2015-08-13  Tim Horton  <timothy_horton@apple.com>
1700
1701         Performing a Lookup on wrapped text puts the popover arrow in the wrong place (off to the right)
1702         https://bugs.webkit.org/show_bug.cgi?id=148012
1703         <rdar://problem/19238094>
1704
1705         Reviewed by Simon Fraser.
1706
1707         * platform/spi/mac/LookupSPI.h:
1708         Add some SPI.
1709
1710 2015-08-13  Simon Fraser  <simon.fraser@apple.com>
1711
1712         Another Windows build fix.
1713
1714         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1715
1716 2015-08-13  Simon Fraser  <simon.fraser@apple.com>
1717
1718         Try to fix Windows build after r188430.
1719
1720         * platform/graphics/ca/win/PlatformCALayerWin.h:
1721
1722 2015-08-13  Simon Fraser  <simon.fraser@apple.com>
1723
1724         Generated files don't all need to include ScriptExecutionContext.h
1725         https://bugs.webkit.org/show_bug.cgi?id=148011
1726
1727         Reviewed by Alexey Proskuryakov.
1728         
1729         Generated files which are not callbacks or constructors do not need to include
1730         ScriptExecutionContext.h.
1731
1732         * bindings/scripts/CodeGeneratorJS.pm:
1733         (GenerateImplementation): Deleted.
1734         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1735         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1736         * bindings/scripts/test/JS/JSTestException.cpp:
1737         * bindings/scripts/test/JS/JSTestInterface.cpp:
1738         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
1739         * bindings/scripts/test/JS/JSTestObj.cpp:
1740         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1741         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1742         * bindings/scripts/test/JS/JSattribute.cpp:
1743
1744 2015-08-13  Commit Queue  <commit-queue@webkit.org>
1745
1746         Unreviewed, rolling out r188428.
1747         https://bugs.webkit.org/show_bug.cgi?id=148015
1748
1749         broke cmake build (Requested by alexchristensen on #webkit).
1750
1751         Reverted changeset:
1752
1753         "Move some commands from ./CMakeLists.txt to Source/cmake"
1754         https://bugs.webkit.org/show_bug.cgi?id=148003
1755         http://trac.webkit.org/changeset/188428
1756
1757 2015-08-13  Zalan Bujtas  <zalan@apple.com>
1758
1759         Remove pixelSnapped* functions from RenderBoxModelObject/RenderBox.
1760         https://bugs.webkit.org/show_bug.cgi?id=147982
1761
1762         Reviewed by Simon Fraser.
1763
1764         RenderBoxModelObject/RenderBox::pixelSnapped* functions are misleading.
1765         They all round to integral values, while the rest of the pixel snapping
1766         functions round to device pixels.
1767         This patch moves integral rounding to the callers. (Note that they all will eventually
1768         go away as we convert additional modules to subpixel rendering (tables, scrolling etc).)
1769
1770         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1771         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1772         * dom/Element.cpp:
1773         (WebCore::Element::offsetLeft):
1774         (WebCore::Element::offsetTop):
1775         (WebCore::Element::offsetWidth):
1776         (WebCore::Element::offsetHeight):
1777         (WebCore::Element::clientWidth):
1778         (WebCore::Element::clientHeight):
1779         * dom/Position.cpp:
1780         (WebCore::Position::hasRenderedNonAnonymousDescendantsWithHeight):
1781         * html/HTMLImageElement.cpp:
1782         (WebCore::HTMLImageElement::width):
1783         (WebCore::HTMLImageElement::height):
1784         * html/shadow/SpinButtonElement.cpp:
1785         (WebCore::SpinButtonElement::defaultEventHandler):
1786         * inspector/InspectorOverlay.cpp:
1787         (WebCore::buildObjectForElementData):
1788         * page/FrameView.cpp:
1789         (WebCore::FrameView::applyPaginationToViewport):
1790         (WebCore::FrameView::calculateScrollbarModesForLayout):
1791         (WebCore::FrameView::calculateExtendedBackgroundMode):
1792         (WebCore::FrameView::qualifiesAsVisuallyNonEmpty):
1793         * page/PrintContext.cpp:
1794         (WebCore::PrintContext::pageNumberForElement):
1795         * platform/graphics/LayoutRect.h:
1796         (WebCore::LayoutRect::pixelSnappedSize): Deleted.
1797         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1798         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
1799         * rendering/RenderBox.cpp:
1800         (WebCore::RenderBox::pixelSnappedClientWidth): Deleted.
1801         (WebCore::RenderBox::pixelSnappedClientHeight): Deleted.
1802         (WebCore::RenderBox::pixelSnappedOffsetWidth): Deleted.
1803         (WebCore::RenderBox::pixelSnappedOffsetHeight): Deleted.
1804         * rendering/RenderBox.h:
1805         (WebCore::RenderBox::pixelSnappedLogicalHeight): Deleted.
1806         (WebCore::RenderBox::pixelSnappedLogicalWidth): Deleted.
1807         (WebCore::RenderBox::pixelSnappedSize): Deleted.
1808         (WebCore::RenderBox::pixelSnappedBorderBoxRect): Deleted.
1809         * rendering/RenderBoxModelObject.cpp:
1810         (WebCore::RenderBoxModelObject::pixelSnappedOffsetWidth): Deleted.
1811         (WebCore::RenderBoxModelObject::pixelSnappedOffsetHeight): Deleted.
1812         * rendering/RenderBoxModelObject.h:
1813         (WebCore::RenderBoxModelObject::pixelSnappedOffsetLeft): Deleted.
1814         (WebCore::RenderBoxModelObject::pixelSnappedOffsetTop): Deleted.
1815         * rendering/RenderFileUploadControl.cpp:
1816         (WebCore::nodeWidth):
1817         (WebCore::nodeHeight):
1818         (WebCore::RenderFileUploadControl::maxFilenameWidth):
1819         * rendering/RenderLayer.cpp:
1820         (WebCore::RenderLayer::updateLayerPosition):
1821         (WebCore::RenderLayer::perspectiveTransform):
1822         (WebCore::RenderLayer::clampScrollOffset):
1823         (WebCore::RenderLayer::visibleSize):
1824         (WebCore::RenderLayer::positionOverflowControls):
1825         (WebCore::RenderLayer::hasHorizontalOverflow):
1826         (WebCore::RenderLayer::hasVerticalOverflow):
1827         (WebCore::RenderLayer::updateScrollbarsAfterLayout):
1828         (WebCore::RenderLayer::overflowControlsIntersectRect):
1829         (WebCore::RenderLayer::isPointInResizeControl):
1830         * rendering/RenderLayerBacking.cpp:
1831         (WebCore::RenderLayerBacking::updateGeometry):
1832         (WebCore::RenderLayerBacking::positionOverflowControlsLayers):
1833         (WebCore::RenderLayerBacking::startAnimation):
1834         (WebCore::RenderLayerBacking::startTransition):
1835         * rendering/RenderLayerBacking.h:
1836         * rendering/RenderListBox.cpp:
1837         (WebCore::RenderListBox::scrollWidth):
1838         (WebCore::RenderListBox::scrollHeight):
1839         * rendering/RenderMediaControlElements.cpp:
1840         (WebCore::RenderMediaVolumeSliderContainer::layout):
1841         * rendering/RenderScrollbar.cpp:
1842         (WebCore::RenderScrollbar::buttonRect):
1843         * rendering/RenderTable.cpp:
1844         (WebCore::RenderTable::addOverflowFromChildren):
1845         * rendering/RenderTableCell.cpp:
1846         (WebCore::RenderTableCell::computeIntrinsicPadding):
1847         (WebCore::RenderTableCell::paintCollapsedBorders):
1848         (WebCore::RenderTableCell::paintBackgroundsBehindCell):
1849         (WebCore::RenderTableCell::paintBoxDecorations):
1850         (WebCore::RenderTableCell::paintMask):
1851         * rendering/RenderTableCell.h:
1852         (WebCore::RenderTableCell::logicalHeightForRowSizing):
1853         * rendering/RenderTheme.cpp:
1854         (WebCore::RenderTheme::volumeSliderOffsetFromMuteButton):
1855         * rendering/RenderTheme.h:
1856         * rendering/RenderThemeMac.mm:
1857         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
1858         (WebCore::RenderThemeMac::paintSearchFieldResultsDecorationPart):
1859         (WebCore::RenderThemeMac::paintSearchFieldResultsButton):
1860         * rendering/RenderTreeAsText.cpp:
1861         (WebCore::write):
1862         * rendering/mathml/RenderMathMLFraction.cpp:
1863         (WebCore::RenderMathMLFraction::paint):
1864         * rendering/mathml/RenderMathMLRoot.cpp:
1865         (WebCore::RenderMathMLRoot::paint):
1866         * rendering/svg/RenderSVGRoot.cpp:
1867         (WebCore::RenderSVGRoot::paintReplaced):
1868         (WebCore::RenderSVGRoot::computeFloatRectForRepaint):
1869
1870 2015-08-13  Simon Fraser  <simon.fraser@apple.com>
1871
1872         Minor GraphicsLayer.h/PlatformCALayer.h cleanup
1873         https://bugs.webkit.org/show_bug.cgi?id=148009
1874
1875         Reviewed by Tim Horton.
1876
1877         Remove some #includes.
1878
1879         * platform/graphics/GraphicsLayer.h:
1880         * platform/graphics/ca/PlatformCALayer.h:
1881
1882 2015-08-13  Alex Christensen  <achristensen@webkit.org>
1883
1884         Move some commands from ./CMakeLists.txt to Source/cmake
1885         https://bugs.webkit.org/show_bug.cgi?id=148003
1886
1887         Reviewed by Brent Fulgham.
1888
1889         * CMakeLists.txt:
1890         Added commands needed to build WebCore by itself.
1891
1892 2015-08-13  Tim Horton  <timothy_horton@apple.com>
1893
1894         Refactor and improve TextIndicator to prepare for tests
1895         https://bugs.webkit.org/show_bug.cgi?id=147622
1896
1897         Reviewed by Simon Fraser.
1898
1899         No new tests because they're coming soon!
1900
1901         * page/TextIndicator.cpp:
1902         (WebCore::TextIndicator::TextIndicator):
1903         (WebCore::TextIndicator::~TextIndicator):
1904         (WebCore::TextIndicator::createWithRange):
1905         (WebCore::TextIndicator::createWithSelectionInFrame):
1906         (WebCore::hasNonInlineOrReplacedElements):
1907         (WebCore::snapshotOptionsForTextIndicatorOptions):
1908         (WebCore::takeSnapshot):
1909         (WebCore::takeSnapshots):
1910         (WebCore::initializeIndicator):
1911         (WebCore::snapshotSelectionWithHighlight): Deleted.
1912         (WebCore::TextIndicator::wantsBounce): Deleted.
1913         (WebCore::TextIndicator::wantsContentCrossfade): Deleted.
1914         (WebCore::TextIndicator::wantsFadeIn): Deleted.
1915         (WebCore::TextIndicator::wantsManualAnimation): Deleted.
1916         * page/TextIndicator.h:
1917         (WebCore::TextIndicator::indicatesCurrentSelection):
1918         (WebCore::TextIndicator::setWantsMargin): Deleted.
1919         (WebCore::TextIndicator::wantsMargin): Deleted.
1920         Rename wantsMargin to indicatesCurrentSelection. It's really about whether
1921         the TextIndicator indicates the existing selection, and the Mac presentation
1922         just uses that to determine whether or not to show a margin, but that
1923         margin has nothing to do with the cross-platform TextIndicator code.
1924
1925         Move most of the snapshotting and rect gathering code to initializeTextIndicator, and call it
1926         from both ::createWithRange and ::createWithSelectionInFrame, instead of calling
1927         ::createWithSelectionInFrame from ::createWithRange after setting the selection.
1928         This way, the range passed into ::createWithRange is preserved for use in initializeTextIndicator,
1929         instead of round-tripping through selection code, which can change it (e.g. in the case
1930         of user-select: none; elements).
1931
1932         Add TextIndicatorOptions, which allow callers to adjust the behavior of TextIndicator
1933         instead of having #if PLATFORM(X) strewn throughout TextIndicator.
1934
1935         Add an option which was previously implemented at the iOS-specific callsites,
1936         TextIndicatorOptionUseBoundingRectAndPaintAllContentForComplexRanges,
1937         which falls back to indicating a bounding rect and not doing a range-only paint
1938         if the given range includes any non-inline elements or any replaced elements.
1939         This makes it so that we do something reasonable-looking for very complex ranges,
1940         like article links on the New York Times, which include multiple disparate paragraphs
1941         of text and one or more images, and also so that indicating a range that only
1942         includes an image does something fairly reasonable.
1943
1944         Move presentation-specific functions (wantsBounce, wantsContentCrossfade, etc.)
1945         to TextIndicatorWindow. Ideally TextIndicatorPresentationTransition would also move,
1946         but that is a fairly large and complicated change that should be made separately.
1947
1948         * page/mac/TextIndicatorWindow.h:
1949         * page/mac/TextIndicatorWindow.mm:
1950         (indicatorWantsBounce):
1951         (indicatorWantsContentCrossfade):
1952         (indicatorWantsFadeIn):
1953         (indicatorWantsManualAnimation):
1954         (-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]):
1955         (-[WebTextIndicatorView _animationDuration]):
1956         (-[WebTextIndicatorView present]):
1957         (WebCore::TextIndicatorWindow::~TextIndicatorWindow):
1958         (WebCore::TextIndicatorWindow::clearTextIndicator):
1959         (WebCore::TextIndicatorWindow::setTextIndicator):
1960         Rename TextIndicatorDismissalAnimation to TextIndicatorWindowDismissalAnimation,
1961         and TextIndicatorLifetime to TextIndicatorWindowLifetime, because
1962         they are TextIndicatorWindow specific.
1963
1964         * accessibility/AccessibilityRenderObject.cpp:
1965         (WebCore::AccessibilityRenderObject::boundsForVisiblePositionRange):
1966         * bindings/objc/DOM.mm:
1967         (-[DOMNode getPreviewSnapshotImage:andRects:]):
1968         (-[DOMRange boundingBox]):
1969         (-[DOMRange textRects]):
1970         * dom/DocumentMarkerController.cpp:
1971         (WebCore::DocumentMarkerController::addTextMatchMarker):
1972         * dom/Node.cpp:
1973         (WebCore::Node::textRects):
1974         * dom/Range.cpp:
1975         (WebCore::Range::intersectsNode):
1976         (WebCore::Range::absoluteBoundingBox):
1977         (WebCore::Range::absoluteTextRects):
1978         (WebCore::Range::absoluteTextQuads):
1979         (WebCore::Range::getClientRects):
1980         (WebCore::Range::getBoundingClientRect):
1981         (WebCore::Range::getBorderAndTextQuads):
1982         (WebCore::Range::boundingRectInternal):
1983         (WebCore::Range::absoluteBoundingRect):
1984         (WebCore::Range::boundingBox): Deleted.
1985         (WebCore::Range::textRects): Deleted.
1986         (WebCore::Range::textQuads): Deleted.
1987         (WebCore::Range::boundingRect): Deleted.
1988         * dom/Range.h:
1989         * editing/AlternativeTextController.cpp:
1990         (WebCore::AlternativeTextController::rootViewRectForRange):
1991         * editing/Editor.cpp:
1992         (WebCore::Editor::findStringAndScrollToVisible):
1993         * editing/FrameSelection.cpp:
1994         (WebCore::FrameSelection::getClippedVisibleTextRectangles):
1995         * editing/mac/DataDetection.mm:
1996         (WebCore::DataDetection::detectItemAroundHitTestResult):
1997         * rendering/RenderObject.cpp:
1998         (WebCore::RenderObject::absoluteBoundingBoxRectForRange):
1999         Rename various Range methods to make it clear whether they return absolute or client rects.
2000
2001 2015-08-13  Jer Noble  <jer.noble@apple.com>
2002
2003         Don't short circuit seeking
2004         https://bugs.webkit.org/show_bug.cgi?id=147892
2005
2006         Reviewed by Eric Carlson.
2007
2008         When two seekWithTolerance() requests come in before the first is acted upon in seekTask(),
2009         the second will result in a "no seek required" conditional, because the new "currentTime" is
2010         assumed to be the destination time of the first seek.
2011
2012         When cancelling a pending seek, first replace the "now" value with the "now" value from the
2013         replaced seek, thus preserving the original currentTime across all replacement seeks.
2014
2015         Drive-by fix: some added logging causes occasional crashes, due to the underlying object being
2016         accessed having been deleted.
2017
2018         * html/HTMLMediaElement.cpp:
2019         (WebCore::HTMLMediaElement::seekWithTolerance):
2020         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2021         (WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime):
2022
2023 2015-08-13  Brent Fulgham  <bfulgham@apple.com>
2024
2025         Prospective Mac/iOS build fix after the last Windows build fix.
2026
2027         * page/CaptionUserPreferences.cpp:
2028         * page/UserContentController.cpp:
2029
2030 2015-08-13  Brent Fulgham  <bfulgham@apple.com>
2031
2032         [Win] More build fixes.
2033
2034         * dom/make_event_factory.pl:
2035         (generateImplementation):
2036         * page/CaptionUserPreferences.cpp:
2037         * page/PageGroup.cpp:
2038         * page/UserContentController.cpp:
2039
2040 2015-08-13  Wenson Hsieh  <wenson_hsieh@apple.com>
2041
2042         A focused node should not be assisted when handling touch events synchronously
2043         https://bugs.webkit.org/show_bug.cgi?id=147836
2044         <rdar://problem/22204108>
2045
2046         Reviewed by Enrica Casucci.
2047
2048         Makes interaction with touch handlers no longer assist the currently focused element in the
2049         general case. Added plumbing to reassist a currently focused node when dispatching touch events,
2050         so that an input that programmatically focuses itself and prevents default on a touch event will
2051         be properly assisted when it has been programmatically focused (either through Javascript or the
2052         autofocus attribute) prior to receiving the touch event. This patch also removes the now
2053         unnecessary special-casing of the Gmail settings app that currently makes the keyboard deploy
2054         upon autofocus.
2055
2056         * dom/Element.cpp:
2057         (WebCore::Element::focus): Notifies the chrome client that the element has refocused before
2058             returning early.
2059         * page/ChromeClient.h: Refocusing an element does nothing by default.
2060         * platform/RuntimeApplicationChecksIOS.h: Removed special casing for Gmail Add Account.
2061         * platform/RuntimeApplicationChecksIOS.mm: See above.
2062         (WebCore::applicationIsGmailAddAccountOnIOS): See above.
2063
2064 2015-08-13  Brent Fulgham  <bfulgham@apple.com>
2065
2066         [Win] Unreviewed build fix.
2067
2068         * accessibility/AXObjectCache.cpp: Add missing 'DataLog.h' include.
2069
2070 2015-08-13 Wenson Hsieh  <wenson_hsieh@apple.com>
2071
2072         Selects should scale when rendering while zoomed
2073         https://bugs.webkit.org/show_bug.cgi?id=147868
2074
2075         Reviewed by Daniel Bates.
2076
2077         When rendering zoomed <select> elements, draw to an image buffer instead of drawing directly
2078         into the context. This allows us to scale the image buffer up before rendering.
2079
2080         * rendering/RenderThemeMac.mm:
2081         (WebCore::RenderThemeMac::paintMenuList): Use ThemeMac::drawCellOrFocusRingWithViewIntoContext
2082             to render search fields, utilizing an offscreen image buffer only when necessary.
2083
2084 2015-08-13  Alex Christensen  <achristensen@webkit.org>
2085
2086         [Win] Unreviewed build fix after r188388.
2087
2088         * bindings/js/JSWebGLRenderingContextCustom.cpp:
2089         * dom/EventFactory.h:
2090         * rendering/RenderThemeWin.cpp:
2091         Strange things happen when you change including headers.  This fixed my local build.
2092
2093 2015-08-13  Geoffrey Garen  <ggaren@apple.com>
2094
2095         Standardize on the phrase "delete code"
2096         https://bugs.webkit.org/show_bug.cgi?id=147984
2097
2098         Reviewed by Mark Lam.
2099
2100         Use "delete" when we talk about throwing away code, as opposed to
2101         "invalidate" or "discard".
2102
2103         * bindings/js/GCController.cpp:
2104         (WebCore::GCController::setJavaScriptGarbageCollectorTimerEnabled):
2105         (WebCore::GCController::deleteAllCode):
2106         (WebCore::GCController::discardAllCompiledCode): Deleted.
2107         * bindings/js/GCController.h:
2108         * platform/MemoryPressureHandler.cpp:
2109         (WebCore::MemoryPressureHandler::releaseCriticalMemory):
2110
2111 2015-08-13  Eric Carlson  <eric.carlson@apple.com>
2112
2113         Don't short circuit seeking
2114         https://bugs.webkit.org/show_bug.cgi?id=147892
2115
2116         Reviewed by Jer Noble.
2117
2118         Test: media/video-seek-to-current-time.html
2119
2120         * html/HTMLMediaElement.cpp:
2121         (WebCore::HTMLMediaElement::prepareForLoad): Call clearSeeking.
2122         (WebCore::HTMLMediaElement::fastSeek): Add logging.
2123         (WebCore::HTMLMediaElement::seekWithTolerance): Add logging. Set m_pendingSeekType.
2124         (WebCore::HTMLMediaElement::seekTask):  Call clearSeeking. Don't short circuit a
2125           if the current or pending seek is a fast seek. Set m_seeking to true immediately
2126           before calling media engine as it may have been cleared before the seek task
2127           queue ran.
2128         (WebCore::HTMLMediaElement::clearSeeking): New.
2129         * html/HTMLMediaElement.h:
2130         * html/HTMLMediaElementEnums.h:
2131
2132         * platform/GenericTaskQueue.h:
2133         (WebCore::GenericTaskQueue::enqueueTask): Clear m_pendingTasks.
2134
2135         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
2136         (WebCore::MediaPlayerPrivateAVFoundation::seekWithTolerance): Don't return early
2137           when asked to seek to the current time.
2138         (WebCore::MediaPlayerPrivateAVFoundation::invalidateCachedDuration): Remove some 
2139           extremely noisy logging.
2140
2141         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2142         (WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime): Add logging.
2143
2144 2015-08-13  Simon Fraser  <simon.fraser@apple.com>
2145
2146         FilterOperation.h should not include FilterEffect.h
2147         https://bugs.webkit.org/show_bug.cgi?id=147970
2148
2149         Reviewed by Daniel Bates.
2150
2151         FilterEffect.h pulls in lots of JSC goop via runtime/Uint8ClampedArray.h,
2152         so move its include to FilterOperation.cpp.
2153         
2154         Causes include bloat because FilterOperation.h is pulled in via RenderStyle.h.
2155
2156         * platform/graphics/filters/FilterOperation.cpp:
2157         (WebCore::ReferenceFilterOperation::setFilterEffect):
2158         * platform/graphics/filters/FilterOperation.h:
2159         (WebCore::ReferenceFilterOperation::setFilterEffect): Deleted.
2160
2161 2015-08-13  Simon Fraser  <simon.fraser@apple.com>
2162
2163         ScriptExecutionContext.h pulls in all the JSC headers
2164         https://bugs.webkit.org/show_bug.cgi?id=147969
2165
2166         Reviewed by Alexey Proskuryakov.
2167
2168         ScriptExecutionContext.h included ScheduledAction.h, which pulled in all the
2169         JSC headers via JSDOMBinding.h. There was no need for this #include, so remove
2170         it and fix the fallout.
2171
2172         * Modules/webdatabase/DatabaseTracker.cpp:
2173         * Modules/webdatabase/SQLTransaction.h:
2174         * bindings/js/JSWebGLRenderingContextCustom.cpp:
2175         * contentextensions/ContentExtensionStyleSheet.cpp:
2176         * dom/ScriptExecutionContext.h:
2177         * html/FTPDirectoryDocument.cpp:
2178         * html/canvas/WebGLRenderingContext.cpp:
2179         * html/parser/HTMLTreeBuilder.h:
2180
2181 2015-08-12  Anders Carlsson  <andersca@apple.com>
2182
2183         Use WTF::Optional in WindowFeatures
2184         https://bugs.webkit.org/show_bug.cgi?id=147956
2185
2186         Reviewed by Sam Weinig.
2187
2188         * loader/FrameLoader.cpp:
2189         (WebCore::createWindow):
2190         * page/WindowFeatures.cpp:
2191         (WebCore::WindowFeatures::WindowFeatures):
2192         (WebCore::WindowFeatures::setWindowFeature):
2193         (WebCore::WindowFeatures::boolFeature):
2194         (WebCore::WindowFeatures::floatFeature):
2195         (WebCore::WindowFeatures::parseDialogFeatures):
2196         * page/WindowFeatures.h:
2197         (WebCore::WindowFeatures::WindowFeatures):
2198
2199 2015-08-13  Matthew Daiter  <mdaiter@apple.com>
2200
2201         UserMediaRequest should supply IDs of devices selected by user
2202         https://bugs.webkit.org/show_bug.cgi?id=147263
2203         <rdar://problem/21983345>
2204
2205         Reviewed by Jer Noble.
2206
2207         * Modules/mediastream/UserMediaRequest.cpp:
2208         (WebCore::UserMediaRequest::userMediaAccessGranted):
2209         * Modules/mediastream/UserMediaRequest.h:
2210         * platform/mock/UserMediaClientMock.h:
2211
2212 2015-08-12  Carlos Garcia Campos  <cgarcia@igalia.com>
2213
2214         [Cairo] Improve image quality when using newer versions of cairo/pixman
2215         https://bugs.webkit.org/show_bug.cgi?id=147826
2216
2217         Reviewed by Martin Robinson.
2218
2219         Since cairo 1.14 the image filters changed a bit:
2220
2221          - CAIRO_FILTER_GOOD uses a box filter when downscaling if the
2222            scale factor is less than 0.75, otherwise it uses a filter
2223            equivalent to CAIRO_FILTER_BILINEAR.
2224          - CAIRO_FILTER_BEST uses always a Catmull-Rom filter.
2225
2226         We are currently using CAIRO_FILTER_BILINEAR for medium, high and
2227         default interpolation levels. We could use CAIRO_FILTER_GOOD for
2228         medium and default, and CAIRO_FILTER_BEST for high. This will not
2229         have any effect in previous versions of cairo because before 1.14
2230         CAIRO_FILTER_GOOD, CAIRO_FILTER_BILINEAR and CAIRO_FILTER_BEST had
2231         the same implementation in pixman.
2232
2233         * platform/graphics/cairo/PlatformContextCairo.cpp:
2234         (WebCore::PlatformContextCairo::drawSurfaceToContext):
2235
2236 2015-08-12  Myles C. Maxfield  <mmaxfield@apple.com>
2237
2238         [Cocoa] [CJK-configured device] System font has vertical punctuation
2239         https://bugs.webkit.org/show_bug.cgi?id=147964
2240         <rdar://problem/22256660>
2241
2242         Reviewed by Dean Jackson.
2243
2244         GlyphPage::fill() has multiple code paths to accomplish its goal. It uses the shouldUseCoreText() helper
2245         function to determine which one of the paths should be taken. However, not all of the code paths in
2246         GlyphPage::fill() are able of handling all situations. Indeed, the CoreText code paths in GlyphPage::fill()
2247         are only able to handle the situations which shouldUseCoreText() returns true for. This happens in the
2248         following cases:
2249
2250         1. If the font is a composite font
2251         2. If the font is used for text-combine
2252         3. If the font has vertical glyphs
2253
2254         In r187693, I added one more case to this list: If the font is the system font. However, I failed to add
2255         the necessary support to GlyphPage::fill() for this case. Becasue of this, we just happened to fall into
2256         the case of vertical fonts (just by coincidence), which causes us to use
2257         CTFontGetVerticalGlyphsForCharacters() instead of CTFontGetGlyphsForCharacters().
2258
2259         The solution is to adopt the same behavior we were using before r187693. Back then, we were using
2260         CGFontGetGlyphsForUnichars(), which always returned horizontal glyphs. We should simply adopt this same
2261         behavior, except in the Core Text case. Therefore, this patch is just a simple check to see if we are
2262         using the system font when determining which Core Text function to use.
2263
2264         Test: fast/text/system-font-punctuation.html
2265
2266         * platform/graphics/FontDescription.h:
2267         (WebCore::FontDescription::setWidthVariant):
2268         * platform/graphics/FontPlatformData.h:
2269         (WebCore::FontPlatformData::isForTextCombine):
2270         * platform/graphics/mac/GlyphPageMac.cpp:
2271         (WebCore::shouldUseCoreText):
2272         (WebCore::GlyphPage::fill):
2273         * rendering/RenderCombineText.cpp:
2274         (WebCore::RenderCombineText::combineText):
2275
2276 2015-08-12  Jinyoung Hur  <hur.ims@navercorp.com>
2277
2278         [WinCairo] Turn on WOFF font
2279         https://bugs.webkit.org/show_bug.cgi?id=147878
2280
2281         WOFF is already usable in Windows Cairo. Just turn it on.
2282
2283         Reviewed by Myles C. Maxfield.
2284
2285         Test: fast\css\font-face-woff.html
2286
2287         * platform/graphics/win/FontCustomPlatformDataCairo.cpp:
2288         (WebCore::FontCustomPlatformData::supportsFormat):
2289
2290 2015-08-12  Brent Fulgham  <bfulgham@apple.com>
2291
2292         Move RenderBox-specific Scroll Snap code from RenderElement to RenderBox
2293         https://bugs.webkit.org/show_bug.cgi?id=147963
2294
2295         Reviewed by Simon Fraser.
2296
2297         No new tests: No change in functionality.
2298
2299         * rendering/RenderBox.cpp:
2300         (WebCore::RenderBox::styleWillChange): Remove RenderBox-specific code.
2301         (WebCore::RenderBox::willBeRemovedFromTree): Ditto.
2302         * rendering/RenderBox.h:
2303         * rendering/RenderElement.cpp:
2304         (WebCore::RenderElement::styleWillChange): Move code from RenderElement to
2305         handle Scroll Snap Points.
2306         (WebCore::RenderElement::willBeRemovedFromTree): Added new override to handle
2307         scroll-snap point logic.
2308
2309 2015-08-12  Antti Koivisto  <antti@apple.com>
2310
2311         CachedResource leak in validation code
2312         https://bugs.webkit.org/show_bug.cgi?id=147941
2313
2314         Reviewed by Chris Dumez.
2315
2316         While adding test coverage I discovered a way to hit ASSERT(!resource->m_proxyResource) in CachedResource::setResourceToRevalidate.
2317         I think this ends up leaking a resource too.
2318
2319         Test: http/tests/cache/recursive-validation.html
2320
2321         * loader/cache/CachedRawResource.cpp:
2322         (WebCore::CachedRawResource::didAddClient):
2323
2324             Tighten the condition.
2325
2326         * loader/cache/CachedResource.cpp:
2327         (WebCore::CachedResource::setResourceToRevalidate):
2328         (WebCore::CachedResource::clearResourceToRevalidate):
2329
2330             Replace workaround for this bug with an assert.
2331
2332         * loader/cache/CachedResource.h:
2333         (WebCore::CachedResource::validationInProgress):
2334         (WebCore::CachedResource::validationCompleting):
2335         (WebCore::CachedResource::didSendData):
2336         * loader/cache/CachedResourceLoader.cpp:
2337         (WebCore::CachedResourceLoader::revalidateResource):
2338         (WebCore::CachedResourceLoader::determineRevalidationPolicy):
2339
2340             Fix the bug by using (instead of revalidating) resource that we are just finishing revalidating.
2341             This can happen when a succesful revalidation synchronously triggers another load for the same resource.
2342
2343 2015-08-12  Matthew Daiter  <mdaiter@apple.com>
2344
2345         Need to add stubs to enumerateDevices
2346         https://bugs.webkit.org/show_bug.cgi?id=147903
2347
2348         Reviewed by Eric Carlson.
2349
2350         * Modules/mediastream/MediaDevices.cpp:
2351         (WebCore::MediaDevices::enumerateDevices):
2352         * Modules/mediastream/MediaDevices.h:
2353         * Modules/mediastream/UserMediaRequest.cpp:
2354         (WebCore::UserMediaRequest::enumerateDevices):
2355         * Modules/mediastream/UserMediaRequest.h:
2356
2357 2015-08-12  Matt Rajca  <mrajca@apple.com>
2358
2359         Fixed the Release build when MEDIA_SESSION is enabled.
2360
2361         * testing/Internals.cpp:
2362         (WebCore::interruptingCategoryFromString):
2363
2364 2015-08-07  Matt Rajca  <mrajca@apple.com>
2365
2366         Media Session: notify the UI process when media controls are enabled/disabled
2367         https://bugs.webkit.org/show_bug.cgi?id=147802
2368
2369         Reviewed by Eric Carlson.
2370
2371         * Modules/mediasession/MediaRemoteControls.cpp:
2372         (WebCore::MediaRemoteControls::MediaRemoteControls): Keep track of the parent session.
2373         (WebCore::MediaRemoteControls::~MediaRemoteControls): Removed unnecessary line.
2374         (WebCore::MediaRemoteControls::setPreviousTrackEnabled): Tell the session a control was enabled/disabled.
2375         (WebCore::MediaRemoteControls::setNextTrackEnabled): Tell the session a control was enabled/disabled.
2376         * Modules/mediasession/MediaRemoteControls.h:
2377         (WebCore::MediaRemoteControls::create):
2378         (WebCore::MediaRemoteControls::setPreviousTrackEnabled): Moved to implementation file.
2379         (WebCore::MediaRemoteControls::setNextTrackEnabled): Moved to implementation file.
2380         * Modules/mediasession/MediaSession.cpp:
2381         (WebCore::MediaSession::MediaSession): Keep track of the remote controls' parent session.
2382         (WebCore::MediaSession::controlIsEnabledDidChange): Propagate the new media state to the UI process.
2383         * Modules/mediasession/MediaSession.h:
2384         * dom/Document.cpp:
2385         (WebCore::Document::updateIsPlayingMedia): Include whether we can skip to the previous/next track.
2386         * page/MediaProducer.h:
2387
2388 2015-08-12  Alex Christensen  <achristensen@webkit.org>
2389
2390         Fix Debug CMake builds on Windows
2391         https://bugs.webkit.org/show_bug.cgi?id=147940
2392
2393         Reviewed by Chris Dumez.
2394
2395         * PlatformWin.cmake:
2396         Copy localized strings to the WebKit.resources directory.
2397
2398 2015-08-12  Alex Christensen  <achristensen@webkit.org>
2399
2400         Unreviewed build fix after r188339.
2401
2402         * bindings/js/GCController.cpp:
2403         (WebCore::GCController::garbageCollectOnAlternateThreadForDebugging):
2404         (WebCore::GCController::setJavaScriptGarbageCollectorTimerEnabled):
2405         (WebCore::GCController::releaseExecutableMemory): Deleted.
2406         * bindings/js/GCController.h:
2407         Commit WebCore part of patch.
2408
2409 2015-08-12  Brent Fulgham  <bfulgham@apple.com>
2410
2411         REGRESSION(r185606): ASSERT in WebCore::RenderElement::styleWillChange
2412         https://bugs.webkit.org/show_bug.cgi?id=147596
2413         <rdar://problem/21963355>
2414
2415         Reviewed by Jon Honeycutt.
2416
2417         Only add (or remove) a RenderElement from the container of RenderBoxes with
2418         scroll snap coordinates if the element actually is a RenderBox.
2419
2420         Tested by css3/scroll-snap/improper-snap-points-crash.html.
2421
2422         * rendering/RenderElement.cpp:
2423         (WebCore::RenderElement::styleWillChange):
2424         (WebCore::RenderElement::willBeRemovedFromTree):
2425
2426 2015-08-12  Devin Rousso  <drousso@apple.com>
2427
2428         Web Inspector: Implement selector highlighting for iOS
2429         https://bugs.webkit.org/show_bug.cgi?id=147919
2430
2431         Reviewed by Timothy Hatcher.
2432
2433         * inspector/InspectorOverlay.cpp:
2434         (WebCore::InspectorOverlay::getHighlight):
2435         If the current highlight is a nodeList, generate highlights for each node in the list and
2436         return the concatenated value of those highlights.
2437
2438 2015-08-12  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2439
2440         Remove promise attribute specific handling from binding generator
2441         https://bugs.webkit.org/show_bug.cgi?id=147828
2442
2443         Reviewed by Darin Adler.
2444
2445         Reverting http://trac.webkit.org/changeset/184643, as CachedAttribute is used instead.
2446
2447         * bindings/scripts/CodeGeneratorJS.pm:
2448         (GenerateHeader): Deleted.
2449         * bindings/scripts/test/JS/JSTestObj.cpp:
2450         (WebCore::jsTestObjConstructor): Deleted.
2451         (WebCore::setJSTestObjConstructorStaticStringAttr): Deleted.
2452         * bindings/scripts/test/JS/JSTestObj.h:
2453         * bindings/scripts/test/ObjC/DOMTestObj.h:
2454         * bindings/scripts/test/ObjC/DOMTestObj.mm:
2455         (-[DOMTestObj voidMethod]): Deleted.
2456         (-[DOMTestObj voidMethodWithArgs:strArg:objArg:]): Deleted.
2457         * bindings/scripts/test/TestObj.idl:
2458
2459 2015-08-12  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2460
2461         XHR.setRequestHeader should remove trailing and leading whitespaces from the header value
2462         https://bugs.webkit.org/show_bug.cgi?id=147445
2463
2464         Reviewed by Darin Adler.
2465
2466         Covered by added and modifed tests.
2467
2468         * platform/network/HTTPParsers.h:
2469         (WebCore::isHTTPSpace):
2470         (WebCore::stripLeadingAndTrailingHTTPSpaces):
2471         * xml/XMLHttpRequest.cpp:
2472         (WebCore::XMLHttpRequest::setRequestHeader): strip trailing and leading whitespace before testing for header value validity and storing.
2473
2474 2015-08-11  Carlos Garcia Campos  <cgarcia@igalia.com>
2475
2476         NetworkProcess: DNS prefetch happens in the Web Process
2477         https://bugs.webkit.org/show_bug.cgi?id=147824
2478
2479         Reviewed by Alexey Proskuryakov.
2480
2481         Use FrameLoaderClient to do the DNS prefetch.
2482
2483         * html/HTMLAnchorElement.cpp:
2484         (WebCore::HTMLAnchorElement::parseAttribute):
2485         * loader/FrameLoaderClient.h:
2486         * loader/LinkLoader.cpp:
2487         (WebCore::LinkLoader::loadLink):
2488         * page/Chrome.cpp:
2489         (WebCore::Chrome::mouseDidMoveOverElement):
2490
2491 2015-08-11  Mark Lam  <mark.lam@apple.com>
2492
2493         Implementation JavaScript watchdog using WTF::WorkQueue.
2494         https://bugs.webkit.org/show_bug.cgi?id=147107
2495
2496         Reviewed by Geoffrey Garen.
2497
2498         No new tests because we're not introducing any behavior change to WebCore here.
2499         We're only #include'ing Watchdog.h directly instead of going through VM.h.
2500
2501         * ForwardingHeaders/runtime/Watchdog.h: Added.
2502         * PlatformEfl.cmake:
2503         * WebCore.vcxproj/WebCore.vcxproj:
2504         * WebCore.vcxproj/WebCore.vcxproj.filters:
2505         * bindings/js/JSEventListener.cpp:
2506         * bindings/js/WorkerScriptController.cpp:
2507
2508 2015-08-11  Simon Fraser  <simon.fraser@apple.com>
2509
2510         [iOS WK2] ASSERT(!m_properties.backingStore || owner()) sometimes on zooming
2511         https://bugs.webkit.org/show_bug.cgi?id=147854
2512
2513         Reviewed by Tim Horton.
2514
2515         When destroying a TileGrid, the container layer remains alive by virtue of being
2516         in the layer tree, and it and its tiles get visited during layer tree transaction
2517         building but we assert because we've cleared the owner on the tile layers.
2518
2519         The real bug is that TileController doesn't tell GraphicsLayerCA when the custom
2520         sublayers change. Make this possible via a new PlatformCALayerClient function,
2521         and make TileController use this when rearranging its tile grids.
2522
2523         * platform/graphics/ca/GraphicsLayerCA.cpp:
2524         (WebCore::GraphicsLayerCA::platformCALayerCustomSublayersChanged):
2525         (WebCore::GraphicsLayerCA::updateContentsScale): No need to explicitly set
2526         the ChildrenChanged flag now.
2527         * platform/graphics/ca/GraphicsLayerCA.h:
2528         * platform/graphics/ca/PlatformCALayerClient.h:
2529         (WebCore::PlatformCALayerClient::platformCALayerCustomSublayersChanged):
2530         (WebCore::PlatformCALayerClient::platformCALayerLayerDidDisplay):
2531         * platform/graphics/ca/TileController.cpp:
2532         (WebCore::TileController::setNeedsDisplay):
2533         (WebCore::TileController::setContentsScale):
2534         (WebCore::TileController::setZoomedOutContentsScale):
2535         (WebCore::TileController::revalidateTiles):
2536         (WebCore::TileController::clearZoomedOutTileGrid):
2537         (WebCore::TileController::tileGridsChanged):
2538         (WebCore::TileController::tileRevalidationTimerFired):
2539         * platform/graphics/ca/TileController.h:
2540         * platform/graphics/ca/TileGrid.h: Default param.
2541
2542 2015-08-11  Zalan Bujtas  <zalan@apple.com>
2543
2544         Disconnect LayoutStateDisabler logic and RenderView pointer.
2545         https://bugs.webkit.org/show_bug.cgi?id=147906
2546
2547         Reviewed by Simon Fraser.
2548
2549         LayoutStateDisabler should disable layout state unconditionally.
2550         The only place where it was actually conditional was the subtree layout branch.
2551         Create a dedicated SubtreeLayoutStateMaintainer to manage the subtree layout case.
2552
2553         No change in behaviour.
2554
2555         * page/FrameView.cpp:
2556         (WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer):
2557         (WebCore::SubtreeLayoutStateMaintainer::~SubtreeLayoutStateMaintainer):
2558         (WebCore::FrameView::layout):
2559         * rendering/RenderBlock.cpp:
2560         (WebCore::RenderBlock::updateFirstLetterStyle):
2561         (WebCore::RenderBlock::updateFirstLetter):
2562         * rendering/RenderBlockFlow.cpp:
2563         (WebCore::RenderBlockFlow::repaintOverhangingFloats):
2564         * rendering/RenderFlowThread.cpp:
2565         (WebCore::RenderFlowThread::repaintRectangleInRegions):
2566         * rendering/RenderListBox.cpp:
2567         (WebCore::RenderListBox::layout):
2568         * rendering/RenderListItem.cpp:
2569         (WebCore::RenderListItem::insertOrMoveMarkerRendererIfNeeded):
2570         * rendering/RenderMediaControlElements.cpp:
2571         (WebCore::RenderMediaVolumeSliderContainer::layout):
2572         (WebCore::RenderMediaControlTimelineContainer::layout):
2573         (WebCore::RenderTextTrackContainerElement::layout):
2574         * rendering/RenderMultiColumnFlowThread.cpp:
2575         (WebCore::RenderMultiColumnFlowThread::populate):
2576         (WebCore::RenderMultiColumnFlowThread::evacuateAndDestroy):
2577         * rendering/RenderView.h:
2578         (WebCore::LayoutStateDisabler::LayoutStateDisabler):
2579         (WebCore::LayoutStateDisabler::~LayoutStateDisabler):
2580         * rendering/svg/RenderSVGRoot.cpp:
2581         (WebCore::RenderSVGRoot::layout):
2582
2583 2015-08-11  Simon Fraser  <simon.fraser@apple.com>
2584
2585         Fix ViewportConfiguration dumping.
2586         
2587         ViewportConfiguration::dump() was dumping parameters.width as parameters.initialScale.
2588
2589         * page/ViewportConfiguration.cpp:
2590         (WebCore::ViewportConfigurationTextStream::operator<<):
2591
2592 2015-08-11  Myles C. Maxfield  <mmaxfield@apple.com>
2593
2594         [font-features] Map OpenType feature tags to TrueType feature selectors
2595         https://bugs.webkit.org/show_bug.cgi?id=147819
2596
2597         Reviewed by Dean Jackson.
2598
2599         Allow uses of font-feature-settings even on TrueType fonts.
2600
2601         Test: css3/font-feature-settings-preinstalled-fonts.html
2602
2603         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2604         (WebCore::appendRawTrueTypeFeature):
2605         (WebCore::appendTrueTypeFeature):
2606
2607 2015-08-11  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2608
2609         Reduce use of PassRefPtr in WebCore/css
2610         https://bugs.webkit.org/show_bug.cgi?id=147821
2611
2612         Reviewed by Daniel Bates.
2613
2614         Use RefPtr when returning nullptr or RefPtr, if not, use Ref.
2615
2616         * css/CSSBasicShapes.cpp:
2617         (WebCore::buildSerializablePositionOffset):
2618         (WebCore::CSSBasicShapeCircle::cssText):
2619         (WebCore::CSSBasicShapeEllipse::cssText):
2620         * css/CSSBasicShapes.h:
2621         * css/CSSCalculationValue.cpp:
2622         (WebCore::determineCategory):
2623         (WebCore::CSSCalcExpressionNodeParser::parseCalc):
2624         (WebCore::createBlendHalf):
2625         (WebCore::createCSS):
2626         * css/CSSCanvasValue.cpp:
2627         (WebCore::CSSCanvasValue::image):
2628         * css/CSSCanvasValue.h:
2629         * css/CSSComputedStyleDeclaration.cpp:
2630         (WebCore::positionOffsetValue):
2631         (WebCore::ComputedStyleExtractor::currentColorOrValidColor):
2632         (WebCore::ComputedStyleExtractor::getFontSizeCSSValuePreferringKeyword):
2633         (WebCore::counterToCSSValue):
2634         (WebCore::zoomAdjustedPaddingOrMarginPixelValue):
2635         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
2636         (WebCore::computeRenderStyleForProperty):
2637         (WebCore::valueForItemPositionWithOverflowAlignment):
2638         (WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
2639         (WebCore::ComputedStyleExtractor::propertyValue):
2640         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForShorthandProperties):
2641         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForSidesShorthand):
2642         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForGridShorthand):
2643         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValueInternal):
2644         (WebCore::ComputedStyleExtractor::getBackgroundShorthandValue):
2645         * css/CSSComputedStyleDeclaration.h:
2646         * css/CSSCrossfadeValue.cpp:
2647         (WebCore::CSSCrossfadeValue::image):
2648         (WebCore::CSSCrossfadeValue::blend):
2649         * css/CSSCrossfadeValue.h:
2650         * css/CSSFilterImageValue.cpp:
2651         (WebCore::CSSFilterImageValue::image):
2652         * css/CSSFilterImageValue.h:
2653         * css/CSSGradientValue.cpp:
2654         (WebCore::CSSGradientValue::image):
2655         (WebCore::CSSGradientValue::gradientWithStylesResolved):
2656         (WebCore::CSSLinearGradientValue::createGradient):
2657         (WebCore::CSSRadialGradientValue::createGradient):
2658         * css/CSSGradientValue.h:
2659         * css/CSSImageSetValue.cpp:
2660         (WebCore::CSSImageSetValue::cloneForCSSOM):
2661         * css/CSSImageSetValue.h:
2662         * css/CSSImageValue.cpp:
2663         (WebCore::CSSImageValue::cloneForCSSOM):
2664         * css/CSSImageValue.h:
2665         * css/CSSParser.cpp:
2666         (WebCore::CSSParser::parseRule):
2667         (WebCore::CSSParser::parseKeyframeRule):
2668         (WebCore::CSSParser::parseFontFaceValue):
2669         (WebCore::CSSParser::parseValidPrimitive):
2670         (WebCore::CSSParser::parseContentDistributionOverflowPosition):
2671         (WebCore::CSSParser::parseAttr):
2672         (WebCore::CSSParser::parseBackgroundColor):
2673         (WebCore::CSSParser::parsePositionX):
2674         (WebCore::CSSParser::parsePositionY):
2675         (WebCore::CSSParser::parseFillPositionComponent):
2676         (WebCore::CSSParser::parseFillSize):
2677         (WebCore::CSSParser::parseAnimationDelay):
2678         (WebCore::CSSParser::parseAnimationDirection):
2679         (WebCore::CSSParser::parseAnimationDuration):
2680         (WebCore::CSSParser::parseAnimationFillMode):
2681         (WebCore::CSSParser::parseAnimationIterationCount):
2682         (WebCore::CSSParser::parseAnimationName):
2683         (WebCore::CSSParser::parseAnimationPlayState):
2684         (WebCore::CSSParser::parseAnimationTrigger):
2685         (WebCore::CSSParser::parseAnimationProperty):
2686         (WebCore::CSSParser::parseAnimationTimingFunction):
2687         (WebCore::CSSParser::parseGridPosition):
2688         (WebCore::gridMissingGridPositionValue):
2689         (WebCore::CSSParser::parseGridTrackList):
2690         (WebCore::CSSParser::parseGridTrackSize):
2691         (WebCore::CSSParser::parseGridBreadth):
2692         (WebCore::CSSParser::parseGridAutoFlow):
2693         (WebCore::CSSParser::parseGridTemplateAreas):
2694         (WebCore::CSSParser::parseCounterContent):
2695         (WebCore::CSSParser::parseInsetRoundedCorners):
2696         (WebCore::CSSParser::parseBasicShapeInset):
2697         (WebCore::CSSParser::parseShapeRadius):
2698         (WebCore::CSSParser::parseBasicShapeCircle):
2699         (WebCore::CSSParser::parseBasicShapeEllipse):
2700         (WebCore::CSSParser::parseBasicShapePolygon):
2701         (WebCore::CSSParser::parseBasicShapeAndOrBox):
2702         (WebCore::CSSParser::parseShapeProperty):
2703         (WebCore::CSSParser::parseClipPath):
2704         (WebCore::CSSParser::parseBasicShape):
2705         (WebCore::CSSParser::parseFontFamily):
2706         (WebCore::CSSParser::parseColor):
2707         (WebCore::CSSParser::parseShadow):
2708         (WebCore::CSSParser::parseImageResolution):
2709         (WebCore::CSSParser::parseImageSet):
2710         (WebCore::CSSParser::parseTransform):
2711         (WebCore::CSSParser::parseTransformValue):
2712         (WebCore::CSSParser::parseBuiltinFilterArguments):
2713         (WebCore::CSSParser::parseTextIndent):
2714         (WebCore::CSSParser::createImportRule):
2715         (WebCore::CSSParser::createMediaRule):
2716         (WebCore::CSSParser::createEmptyMediaRule):
2717         (WebCore::CSSParser::createSupportsRule):
2718         (WebCore::CSSParser::popSupportsRuleData):
2719         (WebCore::CSSParser::createKeyframesRule):
2720         (WebCore::CSSParser::createStyleRule):
2721         (WebCore::CSSParser::createFontFaceRule):
2722         (WebCore::CSSParser::createPageRule):
2723         (WebCore::CSSParser::createRegionRule):
2724         (WebCore::CSSParser::createKeyframe):
2725         * css/CSSParser.h:
2726         * css/CSSPrimitiveValue.cpp:
2727         (WebCore::CSSPrimitiveValue::cloneForCSSOM):
2728         * css/CSSPrimitiveValue.h:
2729         * css/CSSStyleDeclaration.h:
2730         * css/CSSStyleSheet.cpp:
2731         (WebCore::CSSStyleSheet::rules):
2732         (WebCore::CSSStyleSheet::cssRules):
2733         * css/CSSStyleSheet.h:
2734         * css/CSSToStyleMap.cpp:
2735         (WebCore::CSSToStyleMap::styleImage):
2736         * css/CSSToStyleMap.h:
2737         * css/CSSValue.cpp:
2738         (WebCore::CSSValue::cloneForCSSOM):
2739         * css/CSSValue.h:
2740         * css/CSSValueList.cpp:
2741         (WebCore::CSSValueList::cloneForCSSOM):
2742         * css/CSSValueList.h:
2743         * css/MediaList.h:
2744         (WebCore::MediaQuerySet::copy):
2745         * css/MediaQueryMatcher.cpp:
2746         (WebCore::MediaQueryMatcher::matchMedia):
2747         * css/MediaQueryMatcher.h:
2748         * css/PropertySetCSSStyleDeclaration.cpp:
2749         (WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValue):
2750         (WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValueInternal):
2751         * css/PropertySetCSSStyleDeclaration.h:
2752         * css/RGBColor.cpp:
2753         (WebCore::RGBColor::red):
2754         (WebCore::RGBColor::green):
2755         (WebCore::RGBColor::blue):
2756         (WebCore::RGBColor::alpha):
2757         * css/RGBColor.h:
2758         * css/SVGCSSComputedStyleDeclaration.cpp:
2759         (WebCore::glyphOrientationToCSSPrimitiveValue):
2760         (WebCore::strokeDashArrayToCSSValueList):
2761         (WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor):
2762         (WebCore::ComputedStyleExtractor::svgPropertyValue):
2763         * css/SVGCSSParser.cpp:
2764         (WebCore::CSSParser::parseSVGStrokeDasharray):
2765         (WebCore::CSSParser::parseSVGPaint):
2766         (WebCore::CSSParser::parseSVGColor):
2767         (WebCore::CSSParser::parsePaintOrder):
2768         * css/WebKitCSSFilterValue.cpp:
2769         (WebCore::WebKitCSSFilterValue::cloneForCSSOM):
2770         * css/WebKitCSSFilterValue.h:
2771         * css/WebKitCSSMatrix.cpp:
2772         (WebCore::WebKitCSSMatrix::multiply):
2773         (WebCore::WebKitCSSMatrix::inverse):
2774         (WebCore::WebKitCSSMatrix::translate):
2775         (WebCore::WebKitCSSMatrix::scale):
2776         (WebCore::WebKitCSSMatrix::rotate):
2777         (WebCore::WebKitCSSMatrix::rotateAxisAngle):
2778         (WebCore::WebKitCSSMatrix::skewX):
2779         (WebCore::WebKitCSSMatrix::skewY):
2780         * css/WebKitCSSMatrix.h:
2781         * css/WebKitCSSTransformValue.cpp:
2782         (WebCore::WebKitCSSTransformValue::cloneForCSSOM):
2783         * css/WebKitCSSTransformValue.h:
2784
2785 2015-08-11  Sam Weinig  <sam@webkit.org>
2786
2787         Move CountQueuingStrategy and related to files to their correct place in the Xcode project
2788         https://bugs.webkit.org/show_bug.cgi?id=147901
2789
2790         Reviewed by Anders Carlsson.
2791
2792         * WebCore.xcodeproj/project.pbxproj:
2793
2794 2015-08-11  Zalan Bujtas  <zalan@apple.com>
2795
2796         Use more references in FrameView.
2797         https://bugs.webkit.org/show_bug.cgi?id=147899
2798
2799         Reviewed by Simon Fraser.
2800
2801         No change in functionality.
2802
2803         * page/FrameView.cpp:
2804         (WebCore::FrameView::flushCompositingStateForThisFrame):
2805         (WebCore::FrameView::flushCompositingStateIncludingSubframes):
2806         (WebCore::FrameView::addSlowRepaintObject):
2807         (WebCore::FrameView::scrollElementToRect):
2808         * page/FrameView.h:
2809         * rendering/RenderObject.cpp:
2810         (WebCore::RenderObject::willBeDestroyed):
2811         * rendering/RenderScrollbarPart.cpp:
2812         (WebCore::RenderScrollbarPart::imageChanged):
2813         * testing/Internals.cpp:
2814         (WebCore::Internals::scrollElementToRect):
2815
2816 2015-08-11  Zalan Bujtas  <zalan@apple.com>
2817
2818         Invalid FrameView::m_viewportRenderer after layout is finished.
2819         https://bugs.webkit.org/show_bug.cgi?id=147848
2820         rdar://problem/22205197
2821
2822         Reviewed by Simon Fraser.
2823
2824         We cache the current viewport renderer (FrameView::m_viewportRenderer) right before layout.
2825         It gets dereferenced later when layout is finished to update the overflow status.
2826         If the viewport renderer gets destroyed during layout, we end up with a dangling pointer.
2827         This patch replaces the pointer caching with type caching (none, body, document).
2828
2829         Unable to construct a test case.
2830
2831 2015-08-11  Brent Fulgham  <bfulgham@apple.com>
2832
2833         [Win] Switch Windows build to Visual Studio 2015
2834         https://bugs.webkit.org/show_bug.cgi?id=147887
2835         <rdar://problem/22235098>
2836
2837         Reviewed by Alex Christensen.
2838
2839         Update Visual Studio project file settings to use the current Visual
2840         Studio and compiler. Continue targeting binaries to run on our minimum
2841         supported configuration of Windows 7.
2842
2843         No change in behavior, so no new tests.
2844
2845         * WebCore.vcxproj/WebCore.vcxproj:
2846         * WebCore.vcxproj/WebCoreGenerated.vcxproj:
2847         * WebCore.vcxproj/WebCoreTestSupport.vcxproj:
2848
2849 2015-08-11  Said Abou-Hallawa  <sabouhallawa@apple.com>
2850
2851         feMorphology is not rendered correctly on Retina display
2852         https://bugs.webkit.org/show_bug.cgi?id=147589
2853
2854         Reviewed by Dean Jackson.
2855
2856         The result ImageBuffer of any FilterEffect is already scaled up for 2x
2857         display. The FEMorphology needs to fix its painting data dimension and
2858         radius by multiplying them by the filter scale factor.
2859  
2860         Test: fast/hidpi/filters-morphology.html
2861
2862         * platform/graphics/filters/FEMorphology.cpp:
2863         (WebCore::FEMorphology::platformApplySoftware):
2864
2865 2015-08-11  Myles C. Maxfield  <mmaxfield@apple.com>
2866
2867         [iOS] Arabic letter Yeh is drawn in LastResort
2868         https://bugs.webkit.org/show_bug.cgi?id=147862
2869         <rdar://problem/22202935>
2870
2871         Reviewed by Darin Adler.
2872
2873         In order to perform font fallback, we must know which fonts support which characters. We
2874         perform this check by asking each font to map a sequence of codepoints to glyphs, and
2875         any glyphs which end up with a 0 value are unsupported by the font.
2876
2877         One of the mechanisms that we use to do this is to combine the code points into a string,
2878         and tell Core Text to lay out the string. However, this is fundamentally a different
2879         operation than the one we are trying to perform. Strings combine adjacent codepoints into
2880         grapheme clusters, and CoreText operates on these. However, we are trying to gain
2881         information regarding codepoints, not grapheme clusters.
2882
2883         Instead of taking this string-based approach, we should try harder to use Core Text
2884         functions which operate on ordered collections of characters, rather than strings. In
2885         particular, CTFontGetGlyphsForCharacters() and CTFontGetVerticalGlyphsForCharacters()
2886         have the behavior we want where any unmapped characters end up with a 0 value glyph.
2887
2888         Previously, we were only using the result of those functions if they were successfully
2889         able to map their entire input. However, given the fact that we can degrade gracefully
2890         in the case of a partial mapping, we shouldn't need to bail completely to the
2891         string-based approach should a partial mapping occur.
2892
2893         At some point we should delete the string-based approach entirely. However, this path
2894         is still explicitly used for composite fonts. Fixing that use case is out of scope
2895         for this patch.
2896
2897         Test: fast/text/arabic-glyph-cache-fill-combine.html
2898
2899         * platform/graphics/mac/GlyphPageMac.cpp:
2900         (WebCore::GlyphPage::fill):
2901
2902 2015-08-11  Chris Dumez  <cdumez@apple.com>
2903
2904         The 'length' property on interface objects should be configurable
2905         https://bugs.webkit.org/show_bug.cgi?id=147858
2906
2907         Reviewed by Daniel Bates.
2908
2909         Make the 'length' property configurable on interface objects to comply
2910         with the Web IDL specification [1] and to align our behavior with
2911         Firefox 38 and Chrome 44.
2912
2913         This behavior is also covered by the following W3C test suite:
2914         http://w3c-test.org/dom/interfaces.html
2915
2916         [1] http://heycam.github.io/webidl/#es-interface-call (17 July 2015)
2917
2918         Test: fast/dom/length-property-configurable.html
2919
2920         * bindings/scripts/CodeGeneratorJS.pm:
2921         (GenerateConstructorHelperMethods):
2922         Make the 'length' property configurable on interface objects.
2923
2924         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2925         (WebCore::JSTestActiveDOMObjectConstructor::finishCreation):
2926         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
2927         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::finishCreation):
2928         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
2929         (WebCore::JSTestCustomNamedGetterConstructor::finishCreation):
2930         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2931         (WebCore::JSTestEventConstructorConstructor::finishCreation):
2932         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2933         (WebCore::JSTestEventTargetConstructor::finishCreation):
2934         * bindings/scripts/test/JS/JSTestException.cpp:
2935         (WebCore::JSTestExceptionConstructor::finishCreation):
2936         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2937         (WebCore::JSTestGenerateIsReachableConstructor::finishCreation):
2938         * bindings/scripts/test/JS/JSTestInterface.cpp:
2939         (WebCore::JSTestInterfaceConstructor::finishCreation):
2940         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2941         (WebCore::JSTestMediaQueryListListenerConstructor::finishCreation):
2942         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2943         (WebCore::JSTestNamedConstructorConstructor::finishCreation):
2944         (WebCore::JSTestNamedConstructorNamedConstructor::finishCreation):
2945         * bindings/scripts/test/JS/JSTestNode.cpp:
2946         (WebCore::JSTestNodeConstructor::finishCreation):
2947         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
2948         (WebCore::JSTestNondeterministicConstructor::finishCreation):
2949         * bindings/scripts/test/JS/JSTestObj.cpp:
2950         (WebCore::JSTestObjConstructor::finishCreation):
2951         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2952         (WebCore::JSTestOverloadedConstructorsConstructor::finishCreation):
2953         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2954         (WebCore::JSTestSerializedScriptValueInterfaceConstructor::finishCreation):
2955         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2956         (WebCore::JSTestTypedefsConstructor::finishCreation):
2957         * bindings/scripts/test/JS/JSattribute.cpp:
2958         (WebCore::JSattributeConstructor::finishCreation):
2959         * bindings/scripts/test/JS/JSreadonly.cpp:
2960         (WebCore::JSreadonlyConstructor::finishCreation):
2961         Rebaseline bindings tests.
2962
2963 2015-08-11  Per Arne Vollan  <peavo@outlook.com>
2964
2965         [Win] Popup menus have incorrect placement when device scale factor != 1.
2966         https://bugs.webkit.org/show_bug.cgi?id=147880
2967
2968         Reviewed by Brent Fulgham.
2969
2970         We need to take the device scaling factor into account when calculating
2971         the position and size of the popup menu.
2972
2973         * platform/win/PopupMenuWin.cpp:
2974         (WebCore::PopupMenuWin::calculatePositionAndSize):
2975
2976 2015-08-11  Chris Dumez  <cdumez@apple.com>
2977
2978         [WebIDL] All interface objects must have a property named "name"
2979         https://bugs.webkit.org/show_bug.cgi?id=147865
2980
2981         Reviewed by Darin Adler.
2982
2983         As per the Web IDL specification, all interface objects must have a
2984         property named "name" with attributes
2985         { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }
2986         whose value is the identifier of the corresponding interface:
2987         http://heycam.github.io/webidl/#es-interface-call
2988         http://heycam.github.io/webidl/#named-constructors
2989
2990         Previously, our interface objects had no such property, this patch
2991         addresses the problem.
2992
2993         Both Firefox 38 and Chrome 44 comply with the Web IDL specification
2994         here.
2995
2996         Test: fast/dom/interface-name-property.html
2997
2998         * bindings/scripts/CodeGeneratorJS.pm:
2999         (GenerateConstructorHelperMethods):
3000
3001         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3002         (WebCore::JSTestActiveDOMObjectConstructor::finishCreation):
3003         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
3004         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::finishCreation):
3005         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
3006         (WebCore::JSTestCustomNamedGetterConstructor::finishCreation):
3007         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3008         (WebCore::JSTestEventConstructorConstructor::finishCreation):
3009         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3010         (WebCore::JSTestEventTargetConstructor::finishCreation):
3011         * bindings/scripts/test/JS/JSTestException.cpp:
3012         (WebCore::JSTestExceptionConstructor::finishCreation):
3013         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3014         (WebCore::JSTestGenerateIsReachableConstructor::finishCreation):
3015         * bindings/scripts/test/JS/JSTestInterface.cpp:
3016         (WebCore::JSTestInterfaceConstructor::finishCreation):
3017         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3018         (WebCore::JSTestMediaQueryListListenerConstructor::finishCreation):
3019         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3020         (WebCore::JSTestNamedConstructorConstructor::finishCreation):
3021         (WebCore::JSTestNamedConstructorNamedConstructor::finishCreation):
3022         * bindings/scripts/test/JS/JSTestNode.cpp:
3023         (WebCore::JSTestNodeConstructor::finishCreation):
3024         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
3025         (WebCore::JSTestNondeterministicConstructor::finishCreation):
3026         * bindings/scripts/test/JS/JSTestObj.cpp:
3027         (WebCore::JSTestObjConstructor::finishCreation):
3028         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3029         (WebCore::JSTestOverloadedConstructorsConstructor::finishCreation):
3030         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3031         (WebCore::JSTestSerializedScriptValueInterfaceConstructor::finishCreation):
3032         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3033         (WebCore::JSTestTypedefsConstructor::finishCreation):
3034         * bindings/scripts/test/JS/JSattribute.cpp:
3035         (WebCore::JSattributeConstructor::finishCreation):
3036         * bindings/scripts/test/JS/JSreadonly.cpp:
3037         (WebCore::JSreadonlyConstructor::finishCreation):
3038         Rebaseline bindings tests.
3039
3040 2015-08-11  Ting-Wei Lan  <lantw44@gmail.com>
3041
3042         Fix debug build when optimization is enabled
3043         https://bugs.webkit.org/show_bug.cgi?id=147816
3044
3045         Reviewed by Alexey Proskuryakov.
3046
3047         No new tests because this is only a build fix.
3048
3049         * editing/InsertNodeBeforeCommand.cpp:
3050
3051 2015-08-11  Chris Dumez  <cdumez@apple.com>
3052
3053         Unreviewed, rebaseline bindings tests after r188252.
3054
3055         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3056         (WebCore::JSTestActiveDOMObjectConstructor::finishCreation):
3057         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
3058         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::finishCreation):
3059         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
3060         (WebCore::JSTestCustomNamedGetterConstructor::finishCreation):
3061         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3062         (WebCore::JSTestEventConstructorConstructor::finishCreation):
3063         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3064         (WebCore::JSTestEventTargetConstructor::finishCreation):
3065         * bindings/scripts/test/JS/JSTestException.cpp:
3066         (WebCore::JSTestExceptionConstructor::finishCreation):
3067         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3068         (WebCore::JSTestGenerateIsReachableConstructor::finishCreation):
3069         * bindings/scripts/test/JS/JSTestInterface.cpp:
3070         (WebCore::JSTestInterfaceConstructor::finishCreation):
3071         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3072         (WebCore::JSTestMediaQueryListListenerConstructor::finishCreation):
3073         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3074         (WebCore::JSTestNamedConstructorConstructor::finishCreation):
3075         (WebCore::JSTestNamedConstructorNamedConstructor::finishCreation):
3076         * bindings/scripts/test/JS/JSTestNode.cpp:
3077         (WebCore::JSTestNodeConstructor::finishCreation):
3078         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
3079         (WebCore::JSTestNondeterministicConstructor::finishCreation):
3080         * bindings/scripts/test/JS/JSTestObj.cpp:
3081         (WebCore::JSTestObjConstructor::finishCreation):
3082         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3083         (WebCore::JSTestOverloadedConstructorsConstructor::finishCreation):
3084         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3085         (WebCore::JSTestSerializedScriptValueInterfaceConstructor::finishCreation):
3086         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3087         (WebCore::JSTestTypedefsConstructor::finishCreation):
3088         * bindings/scripts/test/JS/JSattribute.cpp:
3089         (WebCore::JSattributeConstructor::finishCreation):
3090         * bindings/scripts/test/JS/JSreadonly.cpp:
3091         (WebCore::JSreadonlyConstructor::finishCreation):
3092
3093 2015-08-10  Chris Dumez  <cdumez@apple.com>
3094
3095         The 'prototype' property on interface objects should not be enumerable
3096         https://bugs.webkit.org/show_bug.cgi?id=147861
3097
3098         Reviewed by Darin Adler.
3099
3100         1. Make the 'prototype' property not enumerable on interface object to
3101            comply with the Web IDL specification [1] and to align our behavior
3102            with Firefox 38 and Chrome 44.
3103
3104         2. Also update the 'prototype' property on named constructors to have the
3105            following attributes:
3106            { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }
3107
3108            Previously, all these were true in WebKit. The new behavior complies
3109            with the Web IDL specification [2] and aligns our behavior with
3110            Firefox 38. On Chrome 44, the attributes are as follows:
3111            { [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: false }
3112
3113         This behavior is also covered by the following W3C test suite:
3114         http://w3c-test.org/dom/interfaces.html
3115
3116         [1] http://heycam.github.io/webidl/#interface-object
3117         [2] http://heycam.github.io/webidl/#named-constructors
3118
3119         Test: fast/dom/prototype-property-not-enumerable.html
3120
3121         * bindings/scripts/CodeGeneratorJS.pm:
3122         (GenerateConstructorHelperMethods):
3123
3124 2015-08-10  Alex Christensen  <achristensen@webkit.org>
3125
3126         Build fix after r188239.
3127
3128         * PlatformWinCairo.cmake:
3129         MediaPlayerPrivateMediaFoundation is needed on WinCairo with video properly enabled.
3130
3131 2015-08-10  Myles C. Maxfield  <mmaxfield@apple.com>
3132
3133         Post-review fixup after r188195
3134         https://bugs.webkit.org/show_bug.cgi?id=147806
3135
3136         Unreviewed.
3137
3138         Covered by fast/text/crash-obscure-text.html.
3139
3140         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
3141         (WebCore::FontPlatformData::objectForEqualityCheck):
3142
3143 2015-08-10  Alex Christensen  <achristensen@webkit.org>
3144
3145         Build TestWebKitAPI with CMake on Windows
3146         https://bugs.webkit.org/show_bug.cgi?id=147851
3147
3148         Reviewed by Chris Dumez.
3149
3150         * PlatformWin.cmake:
3151         Remove RenderThemeWin.cpp which is included in RenderingAllInOne.cpp.
3152         * WebCorePrefix.h:
3153         Include cmakeconfig.h before wtf/Platform.h like we do in JavaScriptCore's config.h to avoid warnings and redefining ENABLE_*  macros.
3154
3155 2015-08-10  Matthew Daiter  <mdaiter@apple.com>
3156
3157         HTMLMediaElement needs way to find MediaDeviceInfo
3158         https://bugs.webkit.org/show_bug.cgi?id=147842
3159
3160         Reviewed by Jer Noble.
3161
3162         * html/HTMLMediaElement.cpp:
3163         (WebCore::HTMLMediaElement::mediaPlayerMediaDeviceIdentifierStorageDirectory):
3164         * html/HTMLMediaElement.h:
3165         * page/Settings.h:
3166         (WebCore::Settings::setMediaDeviceIdentifierStorageDirectory):
3167         (WebCore::Settings::mediaDeviceIdentifierStorageDirectory):
3168         * platform/graphics/MediaPlayer.h:
3169         (WebCore::MediaPlayerClient::mediaPlayerMediaDeviceIdentifierStorageDirectory):
3170
3171 2015-08-10  Chris Dumez  <cdumez@apple.com>
3172
3173         Simplify code for making Page-cacheability decision
3174         https://bugs.webkit.org/show_bug.cgi?id=147829
3175
3176         Reviewed by Antti Koivisto.
3177
3178         Simplify code for making Page-cacheability decision by merging logging
3179         code and decision making code. Having the same checks in two places was
3180         redundant and error-prone as we needed to keep them in sync.
3181
3182         Also get rid of failure reason enum values as those have not been used
3183         in a while.
3184
3185         * history/PageCache.cpp:
3186         (WebCore::canCacheFrame):
3187         (WebCore::canCachePage):
3188         (WebCore::PageCache::canCache):
3189         (WebCore::logPageCacheFailureDiagnosticMessage): Deleted.
3190         (WebCore::PageCache::singleton): Deleted.
3191         (WebCore::PageCache::setMaxSize): Deleted.
3192         (WebCore::PageCache::frameCount): Deleted.
3193         (WebCore::PageCache::markPagesForVisitedLinkStyleRecalc): Deleted.
3194         (WebCore::PageCache::markPagesForFullStyleRecalc): Deleted.
3195         (WebCore::PageCache::markPagesForDeviceOrPageScaleChanged): Deleted.
3196         (WebCore::PageCache::markPagesForContentsSizeChanged): Deleted.
3197         (WebCore::PageCache::markPagesForCaptionPreferencesChanged): Deleted.
3198         (WebCore::pruningReasonToDiagnosticLoggingKey): Deleted.
3199         * page/DiagnosticLoggingKeys.cpp:
3200         (WebCore::DiagnosticLoggingKeys::isDisabledKey):
3201         (WebCore::DiagnosticLoggingKeys::redirectKey):
3202         (WebCore::DiagnosticLoggingKeys::replaceKey):
3203         (WebCore::DiagnosticLoggingKeys::sourceKey):
3204         (WebCore::DiagnosticLoggingKeys::underMemoryPressureKey):
3205         (WebCore::DiagnosticLoggingKeys::reloadFromOriginKey): Deleted.
3206         * page/DiagnosticLoggingKeys.h:
3207
3208 2015-08-10  Devin Rousso  <drousso@apple.com>
3209
3210         Web Inspector: [iOS] Allow inspector to retrieve a list of system fonts
3211         https://bugs.webkit.org/show_bug.cgi?id=147033
3212
3213         Reviewed by Joseph Pecoraro.
3214
3215         Implement systemFontFamilies for iOS.
3216
3217         * platform/graphics/ios/FontCacheIOS.mm:
3218         (WebCore::FontCache::systemFontFamilies):
3219
3220 2015-08-10  Devin Rousso  <drousso@apple.com>
3221
3222         Web Inspector: Invalid selectors can be applied to the stylesheet
3223         https://bugs.webkit.org/show_bug.cgi?id=147230
3224
3225         Reviewed by Timothy Hatcher.
3226
3227         * inspector/InspectorStyleSheet.cpp:
3228         (WebCore::isValidSelectorListString):
3229         (WebCore::InspectorStyleSheet::setRuleSelector):
3230         Now checks to see that the supplied selector is valid before trying to commit it to the rule.
3231         (WebCore::InspectorStyleSheet::addRule):
3232         (WebCore::checkStyleRuleSelector): Deleted.
3233
3234 2015-08-10  James Craig  <jcraig@apple.com>
3235
3236         AX: Address follow-up comments in bug 145684
3237         https://bugs.webkit.org/show_bug.cgi?id=147817
3238
3239         Reviewed by Dean Jackson.
3240
3241         Minor cleanup and style updates requested by Dean.
3242         Updated Existing Test Expectations.
3243
3244         * Modules/mediacontrols/mediaControlsApple.css:
3245         (video::-webkit-media-show-controls):
3246         * Modules/mediacontrols/mediaControlsiOS.css:
3247         (video::-webkit-media-show-controls):
3248
3249 2015-08-07  Antti Koivisto  <antti@apple.com>
3250
3251         Expand network cache tests to cover memory cache behavior
3252         https://bugs.webkit.org/show_bug.cgi?id=147783
3253
3254         Reviewed by Alexey Proskuryakov.
3255
3256         To support testing, include memory cache as a possible source type to XHR responses.
3257
3258         * loader/ResourceLoader.cpp:
3259         (WebCore::logResourceResponseSource):
3260         * loader/cache/CachedRawResource.cpp:
3261         (WebCore::CachedRawResource::didAddClient):
3262         * loader/cache/CachedResource.h:
3263         (WebCore::CachedResource::revalidationInProgress):
3264         * platform/network/ResourceResponseBase.h:
3265         * testing/Internals.cpp:
3266         (WebCore::Internals::xhrResponseSource):
3267
3268 2015-08-10  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3269
3270         Compile warning (-Wsign-compare) on 32-bits at WebCore/platform/FileSystem.cpp
3271         https://bugs.webkit.org/show_bug.cgi?id=146414
3272
3273         Reviewed by Darin Adler.
3274
3275         No behavioral changes.
3276
3277         * platform/FileSystem.cpp:
3278         (WebCore::MappedFileData::MappedFileData): Making use of convertSafely.
3279         * platform/posix/SharedBufferPOSIX.cpp:
3280         (WebCore::SharedBuffer::createFromReadingFile): Making use of convertSafely.
3281
3282 2015-08-10  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3283
3284         [Streams API] ReadableStreamReader closed promise should use CachedAttribute
3285         https://bugs.webkit.org/show_bug.cgi?id=147487
3286
3287         Reviewed by Darin Adler.
3288
3289         Covered by existing tests.
3290
3291         * Modules/streams/ReadableStreamReader.idl: Made closed a CachedAttribute.
3292         * bindings/js/JSReadableStreamReaderCustom.cpp:
3293         (WebCore::JSReadableStreamReader::closed): Updated according CachedAttribute specific field.
3294
3295 2015-08-09  Hunseop Jeong  <hs85.jeong@samsung.com>
3296
3297         [EFL] Use the non-overlay scrollbar
3298         https://bugs.webkit.org/show_bug.cgi?id=147725
3299
3300         Reviewed by Gyuyoung Kim.
3301
3302         No new tests because there is no behavior change.
3303
3304         * platform/efl/ScrollbarThemeEfl.cpp:
3305         (WebCore::ScrollbarThemeEfl::usesOverlayScrollbars):
3306         Changed the condition of the 'usesOverlayScrollbars' to use the
3307         setting value.
3308         * platform/efl/ScrollbarThemeEfl.h:
3309
3310 2015-08-09  Chris Dumez  <cdumez@apple.com>
3311
3312         Page cache doesn't work for pages actively using Geolocation
3313         https://bugs.webkit.org/show_bug.cgi?id=147785
3314         <rdar://problem/11147901>
3315
3316         Reviewed by Darin Adler.
3317
3318         Allow pages actively using Geolocation into the PageCache.
3319
3320         Tests: fast/history/page-cache-geolocation-active-oneshot.html
3321                fast/history/page-cache-geolocation-active-watcher.html
3322
3323         * Modules/geolocation/Geolocation.cpp:
3324         (WebCore::Geolocation::canSuspendForPageCache):
3325         (WebCore::Geolocation::suspend): Deleted.
3326         * history/PageCache.cpp:
3327
3328 2015-08-09  Nan Wang  <n_wang@apple.com>
3329
3330         AX: CSS table display styles can cause malformed, inaccessible AXTables to be exposed to the AX tree
3331         https://bugs.webkit.org/show_bug.cgi?id=136415
3332         <rdar://problem/22026625>
3333
3334         Reviewed by Chris Fleizach.
3335
3336         Applying CSS display styles to tables can end up inserting anonymous RenderTableRows, which is not handled well by the 
3337         accessibility code, which treats these as the actual rows. We can address this by diving deeper into anonymous nodes 
3338         and finding the real rows and cells we want. In addition, another thing also causing malformed tables is that "grid" 
3339         roles are being exposed as AXGrid instead of AXTable.
3340
3341         Test: accessibility/mac/malformed-table.html
3342
3343         * accessibility/AccessibilityARIAGrid.cpp:
3344         (WebCore::AccessibilityARIAGrid::addRowDescendant):
3345         * accessibility/AccessibilityTable.cpp:
3346         (WebCore::AccessibilityTable::addChildren):
3347         (WebCore::AccessibilityTable::addTableCellChild):
3348         (WebCore::AccessibilityTable::addChildrenFromSection):
3349         * accessibility/AccessibilityTable.h:
3350         * accessibility/AccessibilityTableCell.cpp:
3351         (WebCore::AccessibilityTableCell::parentTable):
3352         (WebCore::AccessibilityTableCell::rowIndexRange):
3353         * accessibility/AccessibilityTableRow.cpp:
3354         (WebCore::AccessibilityTableRow::parentTable):
3355         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3356         (createAccessibilityRoleMap):
3357
3358 2015-08-08  Darin Adler  <darin@apple.com>
3359
3360         Remove -webkit-color-correction CSS property
3361         https://bugs.webkit.org/show_bug.cgi?id=147812
3362
3363         Reviewed by Maciej Stachowiak.
3364
3365         Covered by existing tests.
3366
3367         I am doing some general cleanup of handling of color spaces in WebKit.
3368         This removes the obsolete web-visible property that allowed clients to
3369         get color correction on older Apple platforms where we chose not to do
3370         it all the time for performance reasons. Currently, it has no effect on
3371         any supported platform.
3372
3373         Now that this property is removed, a website can detect that it's not
3374         there if it uses getComputedStyle, but I don't expect this to have
3375         significant compatibility fallout. It's harmless to continue using the
3376         property in legacy content or websites that have not been updated, since
3377         unknown property names are ignored and it had no effect before anyway.
3378
3379         * css/CSSComputedStyleDeclaration.cpp: Removed
3380         CSSPropertyWebkitColorCorrection from the list of computed properties.
3381         (WebCore::ComputedStyleExtractor::propertyValue): Removed the
3382         CSSPropertyWebkitColorCorrection case.
3383
3384         * css/CSSParser.cpp:
3385         (WebCore::isValidKeywordPropertyAndValue): Removed the
3386         CSSPropertyWebkitColorCorrection case.
3387         (WebCore::isKeywordPropertyID): Ditto.
3388         (WebCore::CSSParser::parseValue): Ditto.
3389
3390         * css/CSSPrimitiveValueMappings.h:
3391         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Deleted the overload
3392         of this that converts a ColorSpace to a CSSPrimitiveValue.
3393         (WebCore::CSSPrimitiveValue::operator ColorSpace): Deleted.
3394
3395         * css/CSSPropertyNames.in: Removed -webkit-color-correction.
3396
3397         * css/CSSValueKeywords.in: Removed the -webkit-color-correction section,
3398         which contained sRGB.
3399
3400         * css/SVGCSSValueKeywords.in: Uncommented sRGB now that it's not shared
3401         with -webkit-color-correction.
3402
3403         * rendering/style/RenderStyle.h: Removed setColorSpace and initialColorSpace.
3404         Kept colorSpace around for now, but it simply returns ColorSpaceSRGB.
3405         This prevents us from needing to touch every single call site that passes
3406         the color space in to functions in the platform graphics abstraction.
3407         We'll touch most of those call sites when we change Color to include the
3408         color space and eventually we can delete this.
3409
3410         * rendering/style/StyleRareInheritedData.cpp: Deleted colorSpace.
3411         (WebCore::StyleRareInheritedData::StyleRareInheritedData): Deleted
3412         code to initialize colorSpace and to copy colorSpace.
3413         (WebCore::StyleRareInheritedData::operator==): Deleted code to compare
3414         colorSpace.
3415
3416 2015-08-09  Eric Carlson  <eric.carlson@apple.com>
3417
3418         [Mac] Always require ExternalDeviceAutoPlayCandidate flag to AirPlay automatically
3419         https://bugs.webkit.org/show_bug.cgi?id=147801
3420
3421         Reviewed by Dean Jackson.
3422
3423         Test: http/tests/media/video-media-document-disposition-download.html
3424
3425         * Modules/mediasession/WebMediaSessionManager.cpp:
3426         (WebCore::WebMediaSessionManager::configurePlaybackTargetClients): Don't tell the last element
3427           to begin playing to the target unless the ExternalDeviceAutoPlayCandidate flag is set and 
3428           it is not currently playing.
3429
3430 2015-08-09  Myles C. Maxfield  <mmaxfield@apple.com>
3431
3432         Crash in ComplexTextController when laying out obscure text
3433         https://bugs.webkit.org/show_bug.cgi?id=147806
3434         <rdar://problem/22102378>
3435
3436         Reviewed by Darin Adler.
3437
3438         CTFontDescriptorCopyAttribute(fontDescriptor.get(), kCTFontReferenceURLAttribute) can return nullptr.
3439
3440         Test: fast/text/crash-obscure-text.html
3441
3442         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
3443         (WebCore::safeCFEqual):
3444         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
3445
3446 2015-08-08  Dean Jackson  <dino@apple.com>
3447
3448         Remove the webkit prefix from CanvasRenderingContext2D imageSmoothingEnabled
3449         https://bugs.webkit.org/show_bug.cgi?id=147803
3450         <rdar://problem/22200553>
3451
3452         Reviewed by Sam Weinig.
3453
3454         Rename webkitImageSmoothingEnabled to imageSmoothingEnabled.
3455
3456         Updated existing tests, and made sure that the prefixed version is
3457         identical to the standard version.
3458
3459         * html/canvas/CanvasRenderingContext2D.cpp:
3460         (WebCore::CanvasRenderingContext2D::imageSmoothingEnabled): Renamed from webkitImageSmoothingEnabled.
3461         (WebCore::CanvasRenderingContext2D::setImageSmoothingEnabled): Renamed from setWebkitImageSmoothingEnabled.
3462         (WebCore::CanvasRenderingContext2D::webkitImageSmoothingEnabled): Deleted.
3463         (WebCore::CanvasRenderingContext2D::setWebkitImageSmoothingEnabled): Deleted.
3464         * html/canvas/CanvasRenderingContext2D.h: Rename the methods.
3465         * html/canvas/CanvasRenderingContext2D.idl: Add the non-prefixed form, and mark is as the
3466         implementation of the prefixed form.
3467
3468 2015-08-09  Andreas Kling  <akling@apple.com>
3469
3470         Ref-ify some functions that always succeed in constructing Documents.
3471         <https://webkit.org/b/147552>
3472
3473         Reviewed by Sam Weinig.
3474
3475         Update some functions involved in the construction of new Document objects
3476         to codify that they always construct objects.
3477
3478         Bonus: DOMImplementation::createCSSStyleSheet().
3479
3480         * dom/DOMImplementation.cpp:
3481         (WebCore::DOMImplementation::createCSSStyleSheet):
3482         (WebCore::DOMImplementation::createHTMLDocument):
3483         (WebCore::DOMImplementation::createDocument):
3484         * dom/DOMImplementation.h:
3485         * loader/DocumentWriter.cpp:
3486         (WebCore::DocumentWriter::createDocument):
3487         (WebCore::DocumentWriter::begin):
3488         * loader/DocumentWriter.h:
3489         * xml/DOMParser.cpp:
3490         (WebCore::DOMParser::parseFromString):
3491         * xml/DOMParser.h:
3492         * xml/XSLTProcessor.cpp:
3493         (WebCore::XSLTProcessor::createDocumentFromSource):
3494         * xml/XSLTProcessor.h:
3495
3496 2015-08-08  Commit Queue  <commit-queue@webkit.org>
3497
3498         Unreviewed, rolling out r179871.
3499         https://bugs.webkit.org/show_bug.cgi?id=147810
3500
3501         Breaks product images on http://www.apple.com/shop/buy-
3502         mac/macbook (Requested by smfr on #webkit).
3503
3504         Reverted changeset:
3505
3506         "Render: properly update body's background image"
3507         https://bugs.webkit.org/show_bug.cgi?id=140183
3508         http://trac.webkit.org/changeset/179871
3509
3510 2015-08-07  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3511
3512         Reduce uses of PassRefPtr in bindings
3513         https://bugs.webkit.org/show_bug.cgi?id=147781
3514
3515         Reviewed by Chris Dumez.
3516
3517         Use RefPtr when function can return null or an instance. If not, Ref is used.
3518
3519         * bindings/gobject/GObjectNodeFilterCondition.h:
3520         * bindings/gobject/GObjectXPathNSResolver.h:
3521         * bindings/gobject/WebKitDOMNodeFilter.cpp:
3522         (WebKit::core):
3523         * bindings/gobject/WebKitDOMNodeFilterPrivate.h:
3524         * bindings/gobject/WebKitDOMXPathNSResolver.cpp:
3525         (WebKit::core):
3526         * bindings/gobject/WebKitDOMXPathNSResolverPrivate.h:
3527         * bindings/js/CallbackFunction.h:
3528         (WebCore::createFunctionOnlyCallback):
3529         * bindings/js/Dictionary.h:
3530         (WebCore::Dictionary::getEventListener):
3531         * bindings/js/IDBBindingUtilities.cpp:
3532         (WebCore::createIDBKeyFromValue):
3533         (WebCore::internalCreateIDBKeyFromScriptValueAndKeyPath):
3534         (WebCore::createIDBKeyFromScriptValueAndKeyPath):
3535         (WebCore::scriptValueToIDBKey):
3536         * bindings/js/IDBBindingUtilities.h:
3537         * bindings/js/JSDOMBinding.h:
3538         (WebCore::toInt8Array):
3539         (WebCore::toInt16Array):
3540         (WebCore::toInt32Array):
3541         (WebCore::toUint8Array):
3542         (WebCore::toUint8ClampedArray):
3543         (WebCore::toUint16Array):
3544         (WebCore::toUint32Array):
3545         (WebCore::toFloat32Array):
3546         (WebCore::toFloat64Array):
3547         * bindings/js/JSDOMStringListCustom.cpp:
3548         (WebCore::JSDOMStringList::toWrapped):
3549         * bindings/js/JSDeviceMotionEventCustom.cpp:
3550         (WebCore::readAccelerationArgument):
3551         (WebCore::readRotationRateArgument):
3552         * bindings/js/JSErrorHandler.h:
3553         (WebCore::createJSErrorHandler):
3554         * bindings/js/JSGeolocationCustom.cpp:
3555         (WebCore::createPositionOptions):
3556         * bindings/js/JSNodeCustom.cpp:
3557         * bindings/js/JSNodeFilterCustom.cpp:
3558         (WebCore::JSNodeFilter::toWrapped):
3559         * bindings/js/ScriptController.cpp:
3560         (WebCore::ScriptController::createWorld):
3561         (WebCore::ScriptController::createRootObject):
3562         (WebCore::ScriptController::createScriptInstanceForWidget):
3563         * bindings/js/ScriptController.h:
3564         * bindings/js/ScriptControllerMac.mm:
3565         (WebCore::ScriptController::createScriptInstanceForWidget):
3566         * bindings/js/SerializedScriptValue.cpp:
3567         (WebCore::SerializedScriptValue::create):
3568         * bindings/js/SerializedScriptValue.h:
3569         * bindings/objc/DOMUIKitExtensions.mm:
3570         (-[DOMNode rangeOfContainingParagraph]):
3571         * bindings/objc/ObjCNodeFilterCondition.h:
3572         * bindings/scripts/CodeGeneratorJS.pm:
3573         (GenerateHeader):
3574
3575 2015-08-07  Myles C. Maxfield  <mmaxfield@apple.com>
3576
3577         [OS X] Remove dead code from FontCache::createFontPlatformData()
3578         https://bugs.webkit.org/show_bug.cgi?id=147804
3579
3580         Reviewed by Zalan Bujtas.
3581
3582         CTFontCreateForCSS() always returns the best font.
3583
3584         No new tests because there is no behavior change.
3585
3586         * platform/graphics/mac/FontCacheMac.mm:
3587         (WebCore::fontWithFamily):
3588
3589 2015-08-07  Zalan Bujtas  <zalan@apple.com>
3590
3591         Move painting functions from RenderObject to RenderElement.
3592         https://bugs.webkit.org/show_bug.cgi?id=147764
3593
3594         Reviewed by Simon Fraser.
3595
3596         Ideally they should live in RenderBoxModelObject, but the current SVG architecture makes is difficult
3597         to move them there.
3598
3599         No change in functionality.
3600
3601         * platform/graphics/FloatRect.h:
3602         (WebCore::FloatRect::FloatRect):
3603         * rendering/RenderBoxModelObject.cpp:
3604         (WebCore::RenderBoxModelObject::paintOneBorderSide):
3605         * rendering/RenderElement.cpp:
3606         (WebCore::RenderElement::drawLineForBoxSide):
3607         (WebCore::RenderElement::paintFocusRing):
3608         (WebCore::RenderElement::paintOutline):
3609         * rendering/RenderElement.h:
3610         * rendering/RenderInline.cpp:
3611         (WebCore::RenderInline::paintOutline):
3612         (WebCore::RenderInline::paintOutlineForLine):
3613         * rendering/RenderMultiColumnSet.cpp:
3614         (WebCore::RenderMultiColumnSet::paintColumnRules):
3615         * rendering/RenderObject.cpp:
3616         (WebCore::RenderObject::drawLineForBoxSide): Deleted.
3617         (WebCore::RenderObject::paintFocusRing): Deleted.
3618         (WebCore::RenderObject::paintOutline): Deleted.
3619         * rendering/RenderObject.h:
3620         * rendering/RenderTableCell.cpp:
3621         (WebCore::RenderTableCell::paintCollapsedBorders):
3622         * rendering/RenderTableSection.cpp:
3623         (WebCore::RenderTableSection::paintRowGroupBorder):
3624         * rendering/RenderTheme.h:
3625         (WebCore::RenderTheme::paintMenuListButtonDecorations):
3626         * rendering/RenderThemeIOS.h:
3627         * rendering/RenderThemeIOS.mm:
3628         (WebCore::RenderThemeIOS::paintMenuListButtonDecorations):
3629         * rendering/RenderThemeMac.h:
3630         * rendering/RenderThemeMac.mm:
3631         (WebCore::RenderThemeMac::paintMenuListButtonDecorations):
3632
3633 2015-08-07  James Craig  <jcraig@apple.com>
3634
3635         REGRESSION(r184722) AX: WebKit video playback toolbar removed from DOM; no longer accessible to VoiceOver
3636         https://bugs.webkit.org/show_bug.cgi?id=145684
3637
3638         Reviewed by Dean Jackson.
3639
3640         Updated Apple Video controls to add an invisible but focusable button that allows VoiceOver 
3641         users (and when unblocked, keyboard users) to re-display the video controls.
3642
3643         Test: media/video-controls-show-on-kb-or-ax-event.html
3644
3645         * English.lproj/mediaControlsLocalizedStrings.js:
3646         * Modules/mediacontrols/mediaControlsApple.css:
3647         (audio::-webkit-media-show-controls):
3648         (video::-webkit-media-show-controls):
3649         * Modules/mediacontrols/mediaControlsApple.js:
3650         (Controller.prototype.createControls):
3651         (Controller.prototype.handleFullscreenChange):
3652         (Controller.prototype.handleShowControlsClick):
3653         (Controller.prototype.handleWrapperMouseMove):
3654         (Controller.prototype.updateForShowingControls):
3655         (Controller.prototype.showControls):
3656         (Controller.prototype.hideControls):
3657         (Controller.prototype.setNeedsUpdateForDisplayedWidth):
3658         * Modules/mediacontrols/mediaControlsiOS.css:
3659         (audio::-webkit-media-show-controls):
3660         (video::-webkit-media-show-controls):
3661
3662 2015-08-07  Alex Christensen  <achristensen@webkit.org>
3663
3664         Build more testing binaries with CMake on Windows
3665         https://bugs.webkit.org/show_bug.cgi?id=147799
3666
3667         Reviewed by Brent Fulgham.
3668
3669         * CMakeLists.txt:
3670         MockCDM.cpp needs to be part of WebCoreTestSupport, not WebCore.
3671         * PlatformWin.cmake:
3672         Added files needed for AppleWin port.
3673
3674 2015-08-07  Anders Carlsson  <andersca@apple.com>
3675
3676         Being moving away from using SQLTransactionStateMachine in SQLTransactionBackend
3677         https://bugs.webkit.org/show_bug.cgi?id=147798
3678
3679         Reviewed by Geoffrey Garen.
3680
3681         This is the first step towards getting rid of the state machine so we can ultimately merge SQLTransactionBackend
3682         into SQLTransaction.
3683
3684         Instead of having the state machine run our functions, just run them ourselves where we can. For states that need
3685         to be handled in the frontend, call SQLTransaction::requestTransitToState explicitly.
3686
3687         * Modules/webdatabase/SQLTransactionBackend.cpp:
3688         (WebCore::SQLTransactionBackend::stateFunctionFor):
3689         (WebCore::SQLTransactionBackend::lockAcquired):
3690         (WebCore::SQLTransactionBackend::openTransactionAndPreflight):
3691         (WebCore::SQLTransactionBackend::runStatements):
3692         (WebCore::SQLTransactionBackend::runCurrentStatement):
3693         (WebCore::SQLTransactionBackend::handleCurrentStatementError):
3694         (WebCore::SQLTransactionBackend::handleTransactionError):
3695         (WebCore::SQLTransactionBackend::postflightAndCommit):
3696         (WebCore::SQLTransactionBackend::runCurrentStatementAndGetNextState): Deleted.
3697         (WebCore::SQLTransactionBackend::nextStateForCurrentStatementError): Deleted.
3698         (WebCore::SQLTransactionBackend::nextStateForTransactionError): Deleted.
3699         (WebCore::SQLTransactionBackend::sendToFrontendState): Deleted.
3700         * Modules/webdatabase/SQLTransactionBackend.h:
3701
3702 2015-08-07  Filip Pizlo  <fpizlo@apple.com>
3703
3704         Lightweight locks should be adaptive
3705         https://bugs.webkit.org/show_bug.cgi?id=147545
3706
3707         Reviewed by Geoffrey Garen.
3708
3709         * bindings/objc/WebScriptObject.mm:
3710         (WebCore::getJSWrapper):
3711         (WebCore::addJSWrapper):
3712         (WebCore::removeJSWrapper):
3713         (WebCore::removeJSWrapperIfRetainCountOne):
3714         * platform/audio/mac/CARingBuffer.cpp:
3715         (WebCore::CARingBuffer::setCurrentFrameBounds):
3716         (WebCore::CARingBuffer::getCurrentFrameBounds):
3717         * platform/audio/mac/CARingBuffer.h:
3718         * platform/ios/wak/WAKWindow.mm:
3719         (-[WAKWindow setExposedScrollViewRect:]):
3720         (-[WAKWindow exposedScrollViewRect]):
3721
3722 2015-08-07  Myles C. Maxfield  <mmaxfield@apple.com>
3723
3724         Post-review comments on r188146
3725         https://bugs.webkit.org/show_bug.cgi?id=147793
3726
3727         Reviewed by Daniel Bates.
3728
3729         No new tests because there is no behavior change.
3730
3731         * platform/graphics/FontCache.h:
3732         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3733         (WebCore::appendTrueTypeFeature):
3734         (WebCore::appendOpenTypeFeature):
3735         (WebCore::applyFontFeatureSettings):
3736         * platform/graphics/ios/FontCacheIOS.mm:
3737         (WebCore::FontCache::getSystemFontFallbackForCharacters):
3738         (WebCore::FontCache::createFontPlatformData):
3739         * platform/graphics/mac/FontCacheMac.mm:
3740         (WebCore::fontWithFamily):
3741         (WebCore::FontCache::systemFallbackForCharacters):
3742         * platform/graphics/mac/FontCustomPlatformData.cpp:
3743         (WebCore::FontCustomPlatformData::fontPlatformData):
3744         * rendering/RenderThemeIOS.mm:
3745         (WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
3746
3747 2015-08-07  Myles C. Maxfield  <mmaxfield@apple.com>
3748
3749         [Cocoa] Font fallback is not language-sensitive
3750         https://bugs.webkit.org/show_bug.cgi?id=147390
3751
3752         Reviewed by Dean Jackson.
3753
3754         We need to make our font fallback code sensitive to locale.
3755
3756         This patch rolls r187729 back in. However, only particular versions of iOS and OS X are
3757         performant enough to enable this language-sensitivity.
3758
3759         This patch also applies to iOS.
3760
3761         Test: fast/text/fallback-language-han.html
3762
3763         * platform/graphics/mac/FontCacheMac.mm:
3764         (WebCore::lookupCTFont):
3765         (WebCore::FontCache::systemFallbackForCharacters):
3766         * platform/graphics/mac/FontCacheIOS.mm:
3767         (WebCore::FontCache::systemFallbackForCharacters):
3768
3769 2015-08-07  Zalan Bujtas  <zalan@apple.com>
3770
3771         RenderTheme::volumeSliderOffsetFromMuteButton should take const& RenderBox.
3772         https://bugs.webkit.org/show_bug.cgi?id=147731
3773
3774         Reviewed by Simon Fraser.
3775
3776         No change in functionality.
3777
3778         * rendering/RenderMediaControlElements.cpp:
3779         (WebCore::RenderMediaVolumeSliderContainer::layout):
3780         * rendering/RenderMediaControls.cpp:
3781         (WebCore::RenderMediaControls::volumeSliderOffsetFromMuteButton): Deleted.
3782         * rendering/RenderMediaControls.h:
3783         * rendering/RenderTheme.cpp:
3784         (WebCore::RenderTheme::volumeSliderOffsetFromMuteButton):
3785         * rendering/RenderTheme.h:
3786
3787 2015-08-07  Zalan Bujtas  <zalan@apple.com>
3788
3789         Replace RenderObject::isRooted() logic with isDescendantOf().
3790         https://bugs.webkit.org/show_bug.cgi?id=147788
3791
3792         Reviewed by Simon Fraser.
3793
3794         And some related cleanups.
3795
3796         No change in functionality.
3797
3798         * page/FrameView.cpp:
3799         (WebCore::FrameView::scheduleRelayoutOfSubtree):
3800         (WebCore::FrameView::extendedBackgroundRectForPainting):
3801         * rendering/RenderBox.cpp:
3802         (WebCore::RenderBox::paintRootBoxFillLayers):
3803         * rendering/RenderElement.cpp:
3804         (WebCore::shouldRepaintForImageAnimation):
3805         * rendering/RenderObject.cpp:
3806         (WebCore::RenderObject::isDescendantOf):
3807         (WebCore::scheduleRelayoutForSubtree):
3808         (WebCore::RenderObject::repaint):
3809         (WebCore::RenderObject::repaintRectangle):
3810         (WebCore::RenderObject::repaintSlowRepaintObject):
3811         (WebCore::RenderObject::isRooted):
3812         * rendering/RenderObject.h:
3813         * rendering/RenderView.cpp:
3814         (WebCore::RenderView::unextendedBackgroundRect):
3815         (WebCore::RenderView::backgroundRect):
3816         * rendering/RenderView.h:
3817
3818 2015-08-07  Zalan Bujtas  <zalan@apple.com>
3819
3820         Subtree layout code should use RenderElement.
3821         https://bugs.webkit.org/show_bug.cgi?id=147694
3822
3823         Reviewed by Simon Fraser.
3824
3825         Subtree layout will never begin at a RenderText, so tighten up
3826         the code to operate on RenderElements instead of RenderObjects.
3827         (This patch is based on webkit.org/b/126878)
3828
3829         No change in functionality.
3830
3831         * inspector/InspectorTimelineAgent.cpp:
3832         (WebCore::InspectorTimelineAgent::willLayout):
3833         * page/FrameView.cpp:
3834         (WebCore::FrameView::FrameView): Deleted.
3835         (WebCore::FrameView::layoutRoot): Deleted.
3836         * page/FrameView.h:
3837         * rendering/RenderBox.cpp:
3838         (WebCore::RenderBox::computeLogicalWidthInRegion):
3839         * rendering/RenderElement.cpp:
3840         (WebCore::RenderElement::clearLayoutRootIfNeeded):
3841         (WebCore::RenderElement::willBeDestroyed):
3842         * rendering/RenderElement.h:
3843         * rendering/RenderObject.cpp:
3844         (WebCore::RenderObject::clearLayoutRootIfNeeded): Deleted.
3845         (WebCore::RenderObject::willBeDestroyed): Deleted.
3846         * rendering/RenderObject.h:
3847
3848 2015-08-07  Wenson Hsieh  <wenson_hsieh@apple.com>
3849
3850         Temporarily allow programmatic input assistance for adding Gmail account
3851         https://bugs.webkit.org/show_bug.cgi?id=147792
3852
3853         Reviewed by Enrica Casucci.
3854         <rdar://problem/22126518>
3855
3856         Temporary fix for keyboard input sliding out and immediately back in upon user interaction
3857         in the Gmail 2-factor authentication page.
3858
3859         * platform/RuntimeApplicationChecksIOS.h:
3860         * platform/RuntimeApplicationChecksIOS.mm:
3861         (WebCore::applicationIsGmailAddAccountOnIOS): Added bundle ID for Gmail settings.
3862
3863 2015-08-07  Andy Estes  <aestes@apple.com>
3864
3865         Crash when following a Google search link to Twitter with Limit Adult Content enabled
3866         https://bugs.webkit.org/show_bug.cgi?id=147651
3867
3868         Reviewed by Brady Eidson.
3869
3870         When a loaded CachedRawResource gets a new client, it synthesizes the callbacks that the new client would have
3871         received while the resource was loading. Unlike a real network load, it synthesizes these callbacks in a single
3872         run loop iteration. When DocumentLoader receives a redirect, and finds substitute data in the app cache for the
3873         redirect URL, it schedules a timer that removes DocumentLoader as a client of the CachedRawResource then
3874         synthesizes its own set of CachedRawResourceClient callbacks. But since CachedRawResource has already delivered
3875         client callbacks before the app cache timer fires, DocumentLoader unexpectedly ends up getting two sets of
3876         client callbacks and badness ensues.
3877
3878         The fix is to let CachedRawResource detect if a redirect will trigger the client to load substitute data. If so,
3879         stop delivering client callbacks.
3880
3881         Layout test to follow.
3882
3883         * loader/DocumentLoader.cpp:
3884         (WebCore::DocumentLoader::syntheticRedirectReceived): If there is valid substitute data, do not continue.
3885         * loader/DocumentLoader.h:
3886         * loader/cache/CachedRawResource.cpp: Returned early if syntheticRedirectReceived() said not to continue.
3887         (WebCore::CachedRawResource::didAddClient):
3888         * loader/cache/CachedRawResourceClient.h:
3889         (WebCore::CachedRawResourceClient::syntheticRedirectReceived):
3890
3891 2015-08-06  Dean Jackson  <dino@apple.com>
3892
3893         Shadows don't draw on fillText when using a gradient fill
3894         https://bugs.webkit.org/show_bug.cgi?id=147758
3895         <rdar://problem/20860912>
3896
3897         Reviewed by Myles Maxfield.
3898
3899         Since we use a mask to render a pattern or gradient
3900         into text, any shadow was being clipped out. Change
3901         this to draw the shadow before the mask + fill operation,
3902         using a technique similar to text-shadow.
3903
3904         Test: fast/canvas/gradient-text-with-shadow.html
3905
3906         * html/canvas/CanvasRenderingContext2D.cpp:
3907         (WebCore::CanvasRenderingContext2D::drawTextInternal): Get the current shadow
3908         style, paint the text with a transformed shadow offset so that we only
3909         see the shadow and not the text, then combine with the existing pattern/gradient
3910         fill.
3911
3912 2015-08-07  Myles C. Maxfield  <mmaxfield@apple.com>
3913
3914         Implement font-feature-settings
3915         https://bugs.webkit.org/show_bug.cgi?id=147722
3916
3917         Reviewed by Simon Fraser.
3918
3919         Fonts with features are simply modeled as new font objects. Font
3920         feature information is contained within FontDescription, and our
3921         caches are correctly sensitive to this information. Therefore,
3922         we just need to make our font lookup code honor the request to
3923         use certain features.
3924
3925         This patch creates a file, FontCacheCoreText.cpp, which will be the
3926         new home of all shared OS X / iOS FontCache code. Over time, I will
3927         be moving more and more source into this file, until there is
3928         nothing left of FontCacheMac.mm and FontCacheIOS.mm. For now, the
3929         only function in this file is the code which applies font features.
3930
3931         Test: css3/font-feature-settings-preinstalled-fonts.html
3932
3933         * WebCore.xcodeproj/project.pbxproj: Add FontCacheCoreText.cpp.
3934         * platform/graphics/FontCache.h:
3935         * platform/graphics/cocoa/FontCacheCoreText.cpp: Added.
3936         (WebCore::appendTrueTypeFeature): What the name says.
3937         (WebCore::appendOpenTypeFeature): Ditto.
3938         (WebCore::applyFontFeatureSettings): Ditto.
3939         * platform/graphics/ios/FontCacheIOS.mm:
3940         (WebCore::FontCache::getSystemFontFallbackForCharacters): Call
3941         applyFontFeatureSettings().
3942         (WebCore::FontCache::createFontPlatformData): Ditto.
3943         * platform/graphics/mac/FontCacheMac.mm:
3944         (WebCore::fontWithFamily): Ditto.
3945         (WebCore::FontCache::systemFallbackForCharacters): Ditto.
3946         (WebCore::FontCache::createFontPlatformData): Ditto.
3947         * platform/graphics/mac/FontCustomPlatformData.cpp:
3948         (WebCore::FontCustomPlatformData::fontPlatformData): Ditto.
3949         * rendering/RenderThemeIOS.mm:
3950         (WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
3951         Ditto.
3952
3953 2015-08-07  Commit Queue  <commit-queue@webkit.org>
3954
3955         Unreviewed, rolling out r187907.
3956         https://bugs.webkit.org/show_bug.cgi?id=147789
3957
3958         taking a different approach to the fix (Requested by estes on
3959         #webkit).
3960
3961         Reverted changeset:
3962
3963         "Crash when following a Google search link to Twitter with
3964         Limit Adult Content enabled."
3965         https://bugs.webkit.org/show_bug.cgi?id=147651
3966         http://trac.webkit.org/changeset/187907
3967
3968 2015-08-07  Alex Christensen  <achristensen@webkit.org>
3969
3970         Fix WinCairo build after r188130.
3971
3972         * platform/graphics/win/FontCustomPlatformDataCairo.cpp:
3973         (WebCore::FontCustomPlatformData::~FontCustomPlatformData):
3974         (WebCore::FontCustomPlatformData::fontPlatformData):
3975         I forgot the parameter name.
3976
3977 2015-08-07  Alex Christensen  <achristensen@webkit.org>
3978
3979         Fix WinCairo build after r188130.
3980
3981         * platform/graphics/win/FontCustomPlatformDataCairo.cpp:
3982         (WebCore::FontCustomPlatformData::~FontCustomPlatformData):
3983         (WebCore::FontCustomPlatformData::fontPlatformData):
3984         Update fontPlatformData parameters.
3985
3986 2015-08-07  Daniel Bates  <dabates@apple.com>
3987
3988         Attempt to fix the Windows build after <http://trac.webkit.org/changeset/188130>
3989         (https://bugs.webkit.org/show_bug.cgi?id=147775)
3990
3991         Include header FontDescription.h.
3992
3993         * platform/graphics/win/FontCustomPlatformData.cpp:
3994         * platform/graphics/win/FontCustomPlatformDataCairo.cpp:
3995
3996 2015-08-07  Myles C. Maxfield  <mmaxfield@apple.com>
3997
3998         Allow FontCustomPlatformData to consult with FontDescription
3999         https://bugs.webkit.org/show_bug.cgi?id=147775
4000
4001         Reviewed by Zalan Bujtas.
4002
4003         In order to implement font-feature-settings, web fonts need to be
4004         able to consult with the set of active font features. Rather than
4005         add yet another argument to all the functions in this flow, this
4006         patch passes around a reference to the FontDescription itself instead
4007         of copies of constituent members of it.
4008
4009         No new tests because there is no behavior change.
4010
4011         * css/CSSFontFaceSource.cpp:
4012         (WebCore::CSSFontFaceSource::font):
4013         * loader/cache/CachedFont.cpp:
4014         (WebCore::CachedFont::createFont):
4015         (WebCore::CachedFont::platformDataFromCustomData):
4016         * loader/cache/CachedFont.h:
4017         * loader/cache/CachedSVGFont.cpp:
4018         (WebCore::CachedSVGFont::platformDataFromCustomData):
4019         * loader/cache/CachedSVGFont.h:
4020         * platform/graphics/cairo/FontCustomPlatformData.h:
4021         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
4022         (WebCore::FontCustomPlatformData::fontPlatformData):
4023         * platform/graphics/freetype/FontPlatformData.h:
4024         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
4025         (WebCore::FontPlatformData::FontPlatformData):
4026         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
4027         (WebCore::Font::platformCreateScaledFont):
4028         * platform/graphics/mac/FontCustomPlatformData.cpp:
4029         (WebCore::FontCustomPlatformData::fontPlatformData):
4030         * platform/graphics/mac/FontCustomPlatformData.h:
4031         * platform/graphics/win/FontCustomPlatformData.cpp:
4032         (WebCore::FontCustomPlatformData::fontPlatformData):