Unreviewed, attempt to fix iOS build after r188860
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-08-24  Wenson Hsieh  <wenson_hsieh@apple.com>
2
3         Unreviewed, attempt to fix iOS build after r188860
4
5         * page/WheelEventDeltaFilter.cpp:
6         (WebCore::WheelEventDeltaFilter::isFilteringDeltas): Moved implementation out of header.
7         (WebCore::WheelEventDeltaFilter::filteredDelta): Moved implementation out of header.
8         * page/WheelEventDeltaFilter.h:
9         (WebCore::WheelEventDeltaFilter::isFilteringDeltas): Deleted.
10         (WebCore::WheelEventDeltaFilter::filteredDelta): Deleted.
11
12 2015-08-21  Anders Carlsson  <andersca@apple.com>
13
14         Remove unused return values from SQLTransaction state functions
15         https://bugs.webkit.org/show_bug.cgi?id=148344
16
17         Reviewed by Tim Horton.
18
19         * Modules/webdatabase/SQLTransaction.cpp:
20         (WebCore::SQLTransaction::deliverTransactionCallback):
21         (WebCore::SQLTransaction::deliverTransactionErrorCallback):
22         (WebCore::SQLTransaction::deliverStatementCallback):
23         (WebCore::SQLTransaction::deliverQuotaIncreaseCallback):
24         (WebCore::SQLTransaction::deliverSuccessCallback):
25         (WebCore::SQLTransaction::unreachableState):
26         * Modules/webdatabase/SQLTransaction.h:
27         * Modules/webdatabase/SQLTransactionBackend.cpp:
28         (WebCore::SQLTransactionBackend::acquireLock):
29         (WebCore::SQLTransactionBackend::openTransactionAndPreflight):
30         (WebCore::SQLTransactionBackend::runStatements):
31         (WebCore::SQLTransactionBackend::cleanupAndTerminate):
32         (WebCore::SQLTransactionBackend::cleanupAfterTransactionErrorCallback):
33         (WebCore::SQLTransactionBackend::unreachableState):
34         * Modules/webdatabase/SQLTransactionBackend.h:
35         * Modules/webdatabase/SQLTransactionStateMachine.h:
36         (WebCore::SQLTransactionStateMachine<T>::runStateMachine):
37
38 2015-08-24  Wenson Hsieh  <wenson_hsieh@apple.com>
39
40         Unreviewed, fix build after r188860
41
42         * page/mac/WheelEventDeltaFilterMac.mm:
43         (WebCore::WheelEventDeltaFilterMac::updateFromDelta): Convert argument explicitly to an NSPoint.
44
45 2015-08-24  Wenson Hsieh  <wenson_hsieh@apple.com>
46
47         Use _NSScrollingPredominantAxisFilter for wheel event filtering on Mac
48         https://bugs.webkit.org/show_bug.cgi?id=147320
49
50         Reviewed by Simon Fraser.
51
52         Refactored to use a predominant axis filter instead of a predominant axis tracker. This allows us to
53         employ AppKit's _NSScrollingPredominantAxisFilter when possible, and use the wheel event delta tracker
54         as a fallback. Here, we refactor EventHandler to use the new filters for overflow scrolling and replace
55         the MainFrame's WheelEventDeltaTracker with an appropriate type of WheelEventDeltaFilter.
56
57         In the case where an _NSScrollingPredominantAxisFilter is unavailable, the platform-invariant wheel
58         event delta filter simply uses the existing wheel event delta tracker to compute the current predominant
59         axis. It uses the predominant axis to determine which axis (if any) should have its delta zeroed out.
60
61         This patch also introduces NSScrollingInputFilterSPI.h, which either imports the internal input filter
62         header from AppKit or declares relevant interfaces and functions.
63
64         No new tests, since this change does not add new functionality.
65
66         * CMakeLists.txt: Add page/WheelEventDeltaFilter.cpp.
67         * WebCore.vcxproj/WebCore.vcxproj: Add WheelEventDeltaFilter.cpp and WheelEventDeltaFilter.h.
68         * WebCore.vcxproj/WebCore.vcxproj.filters: Add WheelEventDeltaFilter.cpp and WheelEventDeltaFilter.h.
69         * WebCore.xcodeproj/project.pbxproj: Add WheelEventDeltaFilter.cpp, WheelEventDeltaFilter.h, and their Mac counterparts.
70         * page/EventHandler.cpp:
71         (WebCore::didScrollInScrollableArea): Refactored to no longer handle axes separately.
72         (WebCore::handleWheelEventInAppropriateEnclosingBox): Ditto.
73         (WebCore::EventHandler::platformRecordWheelEvent): Refactored to update the wheel delta filter.
74         (WebCore::EventHandler::clearLatchedState): Ditto.
75         (WebCore::EventHandler::defaultWheelEventHandler): Refactored to use wheel delta filters. No longer splits wheel events
76                 and handles them on separate axes.
77         (WebCore::didScrollInScrollableAreaForSingleAxis): Deleted.
78         (WebCore::handleWheelEventInAppropriateEnclosingBoxForSingleAxis): Deleted.
79         * page/EventHandler.h:
80         * page/MainFrame.cpp:
81         (WebCore::MainFrame::MainFrame): Initializes the appropriate type of WheelEventDeltaFilter.
82         * page/MainFrame.h:
83         * page/WheelEventDeltaFilter.cpp: Added.
84         (WebCore::WheelEventDeltaFilter::WheelEventDeltaFilter):
85         (WebCore::WheelEventDeltaFilter::~WheelEventDeltaFilter):
86         (WebCore::WheelEventDeltaFilter::create):
87         (WebCore::BasicWheelEventDeltaFilter::BasicWheelEventDeltaFilter):
88         (WebCore::BasicWheelEventDeltaFilter::updateFromDelta):
89         (WebCore::BasicWheelEventDeltaFilter::beginFilteringDeltas):
90         (WebCore::BasicWheelEventDeltaFilter::endFilteringDeltas):
91         (WebCore::deltaIsPredominantlyVertical):
92         (WebCore::BasicWheelEventDeltaFilter::dominantScrollGestureDirection):
93         * page/WheelEventDeltaFilter.h: Refactored WheelEventDeltaTracker logic to work as a filter instead.
94         * page/mac/EventHandlerMac.mm:
95         (WebCore::EventHandler::platformPrepareForWheelEvents): Refactored to use wheel delta filters.
96         (WebCore::EventHandler::platformRecordWheelEvent): Ditto.
97         * page/mac/WheelEventDeltaFilterMac.h: Wraps the new _NSScrollingPredominantAxisFilter.
98         * page/mac/WheelEventDeltaFilterMac.mm: Added.
99         (WebCore::WheelEventDeltaFilterMac::WheelEventDeltaFilterMac):
100         (WebCore::WheelEventDeltaFilterMac::beginFilteringDeltas):
101         (WebCore::WheelEventDeltaFilterMac::updateFromDelta):
102         (WebCore::WheelEventDeltaFilterMac::endFilteringDeltas):
103         * platform/PlatformWheelEvent.h:
104         (WebCore::PlatformWheelEvent::copyWithDeltas): Used to create a copy of the platform wheel event with filtered deltas.
105         (WebCore::PlatformWheelEvent::copyIgnoringHorizontalDelta): Deleted. No longer necessary, since we won't be handling wheel
106                 events on separate axes.
107         (WebCore::PlatformWheelEvent::copyIgnoringVerticalDelta): Ditto.
108         * platform/spi/mac/NSScrollingInputFilterSPI.h: Added.
109
110 2015-08-24  Michael Catanzaro  <mcatanzaro@igalia.com>
111
112         Unreviewed, fix typo in a comment ("unsused" -> "unused")
113
114         * bindings/scripts/CodeGeneratorGObject.pm:
115         (GenerateFunction):
116
117 2015-08-24  Carlos Garcia Campos  <cgarcia@igalia.com>
118
119         Unreviewed. Fix cairo performance regression introduced in r188379.
120
121         A missing break in a switch was making us to use High image
122         interpolation quality by default.
123
124         * platform/graphics/cairo/PlatformContextCairo.cpp:
125         (WebCore::PlatformContextCairo::drawSurfaceToContext): Add the
126         missing break.
127
128 2015-08-24  Carlos Garcia Campos  <cgarcia@igalia.com>
129
130         Unreviewed. Fix GObject DOM bindings API break test after r188809.
131
132         element.getElementsByTagName and element.getElementsByClassName
133         were also changed in r188809 to return an HTMLCollection. The
134         build didn't fail because we don't use those in our tests, but the
135         API breaks need to be fixed too.
136
137         * bindings/gobject/WebKitDOMDeprecated.cpp:
138         (webkit_dom_element_get_elements_by_tag_name):
139         (webkit_dom_element_get_elements_by_tag_name_ns):
140         (webkit_dom_element_get_elements_by_class_name):
141         * bindings/gobject/WebKitDOMDeprecated.h:
142         * bindings/gobject/WebKitDOMDeprecated.symbols:
143         * bindings/gobject/webkitdom.symbols:
144         * bindings/scripts/CodeGeneratorGObject.pm:
145         (GetEffectiveFunctionName):
146
147 2015-08-24  Carlos Garcia Campos  <cgarcia@igalia.com>
148
149         Unreviewed. Fix GObject DOM bindings API break test after r188735.
150
151         document.getElementsByClassName returns an HTMLCollection since
152         r188735. So, rename it as
153         webkit_dom_document_get_elements_by_class_name_as_html_collection,
154         and deprecate the old method returning a NodeList.
155
156         * bindings/gobject/WebKitDOMDeprecated.cpp:
157         (webkit_dom_document_get_elements_by_class_name): Use the
158         implementation returning a NodeList.
159         * bindings/gobject/WebKitDOMDeprecated.h:
160         * bindings/gobject/WebKitDOMDeprecated.symbols: Add new symbols.
161         * bindings/gobject/webkitdom.symbols: Ditto.
162         * bindings/scripts/CodeGeneratorGObject.pm:
163         (GetEffectiveFunctionName): Also check getElementsByClassName.
164
165 2015-08-24  Carlos Garcia Campos  <cgarcia@igalia.com>
166
167         Unreviewed. Fix GTK+ build after r188711.
168
169         Since r188711 document.createNodeIterator and
170         document.createTreeWalker, don't raise exceptions anymore. Keep
171         the GError parameter even if it's ignored to not break the API
172         compatibility.
173
174         * bindings/scripts/CodeGeneratorGObject.pm:
175         (FunctionUsedToRaiseException):
176         (GenerateFunction):
177
178 2015-08-24  Carlos Garcia Campos  <cgarcia@igalia.com>
179
180         Unreviewed. Fix GTK+ build after r188809.
181
182         document.getElementsByTagName returns an HTMLCollection since
183         r188809. So, rename it as
184         webkit_dom_document_get_elements_by_tag_name_as_html_collection,
185         and deprecate the old methods returning a NodeList.
186
187         * bindings/gobject/WebKitDOMDeprecated.cpp:
188         (webkit_dom_document_get_elements_by_tag_name): Use the
189         implementation returning a NodeList.
190         (webkit_dom_document_get_elements_by_tag_name_ns): Ditto.
191         * bindings/gobject/WebKitDOMDeprecated.h:
192         * bindings/gobject/WebKitDOMDeprecated.symbols: Add new symbols.
193         * bindings/gobject/webkitdom.symbols: Ditto.
194         * bindings/scripts/CodeGeneratorGObject.pm:
195         (GetEffectiveFunctionName): Bring back this method, now that we
196         have deprecated API again and add the checks for
197         getElementsByTagName methods.
198         (GenerateFunction): Use GetEffectiveFunctionName().
199
200 2015-08-24  Myles C. Maxfield  <mmaxfield@apple.com>
201
202         @font-face related cleanup
203         https://bugs.webkit.org/show_bug.cgi?id=148355
204
205         Reviewed by Darin Adler.
206
207         This patch cleans up much of our code related to web fonts. In general, it
208         migrates to using C++ for-each style loops, uses Ref instead of RefPtr when
209         things can't be nullptr, migrates to C++ Rvalue-references instead of
210         PassRefPtr, and refactors CSSFontSelector::addFontFaceRule() to use helper
211         functions.
212
213         No new tests because there is no behavior change.
214
215         * css/CSSFontFace.cpp:
216         (WebCore::CSSFontFace::fontLoaded): Use a C++ for-each loop.
217         * css/CSSFontFace.h:
218         (WebCore::CSSFontFace::create): Use C++ Rvalue-references instead of
219         PassRefPtr.
220         (WebCore::CSSFontFace::CSSFontFace): Ditto.
221         * css/CSSFontSelector.cpp:
222         (WebCore::computeTraitsMask): Migrated a chunk of
223         CSSFontSelector::addFontFaceRule() into this helper function.
224         (WebCore::createFontFace): Ditto.
225         (WebCore::familyNameFromPrimitive): Ditto.
226         (WebCore::CSSFontSelector::addFontFaceRule): Call the newly-created helper
227         functions. In addition, migrate to Refs instead of RefPtrs.
228         (WebCore::compareFontFaces): Migrate to references instead of pointers.
229         (WebCore::CSSFontSelector::getFontFace): Migrate to Refs instead of
230         RefPtrs. Also use C++ for-each loops.
231         * css/CSSFontSelector.h:
232         * css/CSSSegmentedFontFace.cpp:
233         (WebCore::CSSSegmentedFontFace::~CSSSegmentedFontFace): Use C++ for-each
234         loops.
235         (WebCore::CSSSegmentedFontFace::isValid): Ditto.
236         (WebCore::CSSSegmentedFontFace::appendFontFace): Migrate to Rvalue-
237         references instead of PassRefPtr.
238         * css/CSSSegmentedFontFace.h:
239         * platform/graphics/FontCache.h:
240         * platform/graphics/cocoa/FontCacheCoreText.cpp:
241         (WebCore::FontCache::getTraitsInFamily): Return the result instead of being
242         passed an out parameter.
243         * platform/graphics/freetype/FontCacheFreeType.cpp:
244         (WebCore::FontCache::getTraitsInFamily): Ditto.
245         * platform/graphics/win/FontCacheWin.cpp:
246         (WebCore::traitsInFamilyEnumProc): Ditto.
247         (WebCore::FontCache::getTraitsInFamily): Ditto.
248
249 2015-08-23  Andy Estes  <aestes@apple.com>
250
251         [Content Filtering] REGRESSION (r182356): Provisional URL is incorrect in didReceiveServerRedirectForProvisionalLoadForFrame when Content Filtering is enabled
252         https://bugs.webkit.org/show_bug.cgi?id=147872
253         rdar://problem/22044000
254
255         Reviewed by Dan Bernstein.
256
257         Passed the ResourceLoader request URL to dispatchDidReceiveServerRedirectForProvisionalLoad().
258
259         New API test: ContentFiltering.ServerRedirect
260
261         * WebCore.xcodeproj/project.pbxproj:
262         * loader/EmptyClients.h:
263         * loader/FrameLoaderClient.h: Added a URL argument to dispatchDidReceiveServerRedirectForProvisionalLoad().
264         * loader/ResourceLoader.cpp:
265         (WebCore::ResourceLoader::willSendRequestInternal): Passed the request URL to dispatchDidReceiveServerRedirectForProvisionalLoad().
266         * testing/Internals.cpp:
267         (WebCore::Internals::Internals): Stopped calling MockContentFilter::ensureInstalled().
268         * testing/MockContentFilterSettings.cpp:
269         (WebCore::MockContentFilterSettings::setEnabled): Called MockContentFilter::ensureInstalled() to ensure the
270         mock is installed whenever the filter is enabled.
271         * testing/MockContentFilterSettings.h: Exported member functions used by TestWebKitAPI.
272
273 2015-08-23  Geoffrey Garen  <ggaren@apple.com>
274
275         Unreviewed, rolling back in r188803.
276
277         "Debugger's VM should never be null"
278         https://bugs.webkit.org/show_bug.cgi?id=148341
279         http://trac.webkit.org/changeset/188803
280
281         * bindings/js/WorkerScriptDebugServer.cpp:
282         (WebCore::WorkerScriptDebugServer::WorkerScriptDebugServer):
283         (WebCore::WorkerScriptDebugServer::recompileAllJSFunctions):
284         (WebCore::WorkerScriptDebugServer::runEventLoopWhilePaused):
285         * inspector/PageScriptDebugServer.cpp:
286         (WebCore::PageScriptDebugServer::PageScriptDebugServer):
287         (WebCore::PageScriptDebugServer::recompileAllJSFunctions):
288         (WebCore::PageScriptDebugServer::didPause):
289         (WebCore::PageScriptDebugServer::runEventLoopWhilePaused):
290
291 2015-08-23  Antti Koivisto  <antti@apple.com>
292
293         Remove SVGFrameLoaderClient and dataProtocolFrameLoader
294         https://bugs.webkit.org/show_bug.cgi?id=148370
295
296         Reviewed by Darin Adler.
297
298         With data protocol handled internally in WebKit these are no longer needed.
299
300         This mostly reverts code changes from http://trac.webkit.org/179626 keeping the tests.
301
302         * loader/FrameLoaderClient.h:
303         * loader/ResourceLoader.cpp:
304         (WebCore::ResourceLoader::loadDataURL):
305         (WebCore::ResourceLoader::setDataBufferingPolicy):
306         (WebCore::ResourceLoader::dataProtocolFrameLoader): Deleted.
307         * loader/ResourceLoader.h:
308         (WebCore::ResourceLoader::documentLoader):
309         (WebCore::ResourceLoader::originalRequest):
310         * loader/cache/CachedImage.cpp:
311         (WebCore::CachedImage::finishLoading):
312         * svg/graphics/SVGImage.cpp:
313         (WebCore::SVGImage::dataChanged):
314         * svg/graphics/SVGImage.h:
315         * svg/graphics/SVGImageClients.h:
316
317 2015-08-22  Chris Dumez  <cdumez@apple.com>
318
319         NodeList should not have a named getter
320         https://bugs.webkit.org/show_bug.cgi?id=148117
321
322         Reviewed by Darin Adler.
323
324         Drop the named property getter on NodeList to match the specification:
325         https://dom.spec.whatwg.org/#interface-nodelist
326
327         This change could be a bit risky but:
328         1. Firefox and IE never had this named property getter on NodeList.
329         2. Chrome successfuly dropped this named property getter in early 2014:
330            https://src.chromium.org/viewvc/blink?revision=166356&view=revision
331         3. Our named property getter on NodeList is only partly functional:
332            It only matches by 'id' attribute, not by 'name' attribute.
333         4. Our APIs that were wrongly returning a NodeList instead of an
334            HTMLCollection (getElementsByTagName() / getElementsByClassName())
335            have been fixed in r188735 and r188809. HTMLCollection does have
336            a named property getter.
337         5. This named getter adds code complexity.
338
339         * bindings/js/JSNodeListCustom.cpp:
340         (WebCore::createWrapper): Deleted.
341         * dom/ChildNodeList.cpp:
342         (WebCore::ChildNodeList::invalidateCache): Deleted.
343         * dom/ChildNodeList.h:
344         * dom/LiveNodeList.cpp:
345         * dom/LiveNodeList.h:
346         * dom/NodeList.h:
347         * dom/NodeList.idl:
348         * dom/StaticNodeList.cpp:
349         (WebCore::StaticElementList::length): Deleted.
350         (WebCore::StaticElementList::item): Deleted.
351         * dom/StaticNodeList.h:
352         * html/HTMLCollection.h:
353
354 2015-08-22  Andreas Kling  <akling@apple.com>
355
356         [JSC] Static hash tables should be 100% compile-time constant.
357         <https://webkit.org/b/148359>
358
359         Reviewed by Michael Saboff.
360
361         Adjust WebCore bindings generator for new JSC::HashTable layout
362         and rebaseline the bindings tests for that change.
363
364         * bindings/scripts/CodeGeneratorJS.pm:
365         (GenerateHashTable):
366         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
367         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
368         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
369         * bindings/scripts/test/JS/JSTestException.cpp:
370         * bindings/scripts/test/JS/JSTestInterface.cpp:
371         * bindings/scripts/test/JS/JSTestObj.cpp:
372         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
373         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
374
375 2015-08-22  Michael Catanzaro  <mcatanzaro@igalia.com>
376
377         Unreviewed, fix build without ENABLE_CSS_GRID_LAYOUT after r188582
378
379         * rendering/RenderBox.cpp:
380         (WebCore::RenderBox::computeLogicalWidthInRegion):
381
382 2015-08-22  Zalan Bujtas  <zalan@apple.com>
383
384         Page::renderTreeSize() does not include anonymous renderers.
385         https://bugs.webkit.org/show_bug.cgi?id=148352
386
387         Reviewed by Andreas Kling.
388
389         Anonymous renderes take the document as their node. Instead
390         of checking whether the node is the document, we could just check
391         if the RenderView is available.
392
393         * rendering/RenderObject.cpp:
394         (WebCore::RenderObject::RenderObject):
395         (WebCore::RenderObject::~RenderObject):
396         * rendering/RenderView.cpp:
397         (WebCore::RenderView::RenderView): Deleted.
398         * rendering/RenderView.h: Include the RenderView in render tree size as well.
399
400 2015-08-22  Antti Koivisto  <antti@apple.com>
401
402         Decode data URLs in web process
403         https://bugs.webkit.org/show_bug.cgi?id=148128
404
405         Reviewed by Darin Adler.
406
407         We currenly send data URLs to networking layer for decoding. This involves a long and slow roundtrip through IPC and API layers.
408
409         * WebCore.xcodeproj/project.pbxproj:
410         * loader/ResourceLoadScheduler.cpp:
411         (WebCore::ResourceLoadScheduler::maybeLoadQuickLookResource): Deleted.
412
413             Remove this awkward interface for WebKit2.
414
415         * loader/ResourceLoadScheduler.h:
416         * loader/ResourceLoader.cpp:
417         (WebCore::ResourceLoader::start):
418         (WebCore::ResourceLoader::loadDataURL):
419
420             Load using DataURLDecoder.
421
422         * loader/ResourceLoader.h:
423
424             Make start() public and export it so it can be called directly from WebKit2.
425
426         * platform/network/DataURLDecoder.cpp: Added.
427         (WebCore::DataURLDecoder::decodeQueue):
428         (WebCore::DataURLDecoder::DecodeTask::DecodeTask):
429         (WebCore::DataURLDecoder::createDecodeTask):
430
431             Parse data URL metadata and initialize the decode task.
432
433         (WebCore::DataURLDecoder::decodeBase64):
434         (WebCore::DataURLDecoder::decodeEscaped):
435         (WebCore::DataURLDecoder::decode):
436
437             Asynchronously decode in a concurrent distpatch queue.
438
439         * platform/network/DataURLDecoder.h: Added.
440         * platform/network/ios/QuickLook.h:
441         * platform/text/DecodeEscapeSequences.h:
442         (WebCore::URLEscapeSequence::findEndOfRun):
443         (WebCore::URLEscapeSequence::decodeRun):
444
445             Factor buffer generation to a function.
446
447         (WebCore::decodeEscapeSequences):
448         (WebCore::decodeURLEscapeSequencesAsData):
449
450             Add decode function that produces bytes instead of a String.
451
452 2015-08-21  Commit Queue  <commit-queue@webkit.org>
453
454         Unreviewed, rolling out r188792 and r188803.
455         https://bugs.webkit.org/show_bug.cgi?id=148347
456
457         broke lots of tests, ggaren is going to investigate and reland
458         (Requested by thorton on #webkit).
459
460         Reverted changesets:
461
462         "Unify code paths for manually deleting all code"
463         https://bugs.webkit.org/show_bug.cgi?id=148280
464         http://trac.webkit.org/changeset/188792
465
466         "Debugger's VM should never be null"
467         https://bugs.webkit.org/show_bug.cgi?id=148341
468         http://trac.webkit.org/changeset/188803
469
470 2015-08-21  Chris Dumez  <cdumez@apple.com>
471
472         document.getElementsByTagName should return an HTMLCollection
473         https://bugs.webkit.org/show_bug.cgi?id=110611
474
475         Reviewed by Darin Adler.
476
477         Update getElementsByTagName*() to return an HTMLCollection as per
478         the specification:
479         - https://dom.spec.whatwg.org/#interface-document
480         - https://dom.spec.whatwg.org/#interface-element
481
482         Firefox, Chrome and IE all match the specification but WebKit was
483         returning a NodeList.
484
485         Performance:
486         DOM/get-elements-by-tag-name-traversal-uncached.html is ~4.5% faster.
487
488         Test: fast/dom/getElementsByTagName-return-type.html
489
490         * CMakeLists.txt:
491         * WebCore.vcxproj/WebCore.vcxproj:
492         * WebCore.vcxproj/WebCore.vcxproj.filters:
493         * WebCore.xcodeproj/project.pbxproj:
494         Rename TagNodeList.* to TagCollection.*
495
496         * accessibility/AccessibilityRenderObject.cpp:
497         (WebCore::AccessibilityRenderObject::addRadioButtonGroupMembers):
498         Update the function to use descendantsOfType<>() instead of
499         getElementsByTagName(). The code is both shorter and more efficient.
500
501         * dom/ContainerNode.cpp:
502         (WebCore::ContainerNode::getElementsByTagName):
503         (WebCore::ContainerNode::getElementsByTagNameForObjC):
504         (WebCore::ContainerNode::getElementsByTagNameNS):
505         (WebCore::ContainerNode::getElementsByTagNameNSForObjC):
506         * dom/ContainerNode.h:
507         - Have getElementsByTagName*() return an HTMLCollection.
508         - Introduce versions used by the ObjC bindings that return a NodeList
509           for API compatibility reasons.
510         - Move the localName null check to the *ForObjC versions and use a
511           simple assertion for the non ObjC versions. This gets rid of a
512           branch for our JS bindings as this function is hot. It is currently
513           impossible to get a null AtomicString from our JS bindings code because
514           getElementsByTagName() and getElementsByTagName(undefined) in JS end up
515           calling ContainerNode::getElementsByTagName("undefined").
516           Also getElementsByTagName(null) in JS ends up calling
517           ContainerNode::getElementsByTagName("null"). I have also gotten rid of
518           most of the getElementsByTagName() calls from our native code. The
519           remaining ones either call with a non-null AtomicString and they now
520           have a null-check.
521
522         * dom/Document.idl:
523         * dom/Element.idl:
524         Have getElementsByTagName*() return an HTMLCollection except for ObjC
525         bindings in order to maintain legacy API compatibility.
526
527         * dom/Node.cpp:
528         (WebCore::Document::invalidateNodeListAndCollectionCaches):
529         (WebCore::NodeListsNodeData::invalidateCaches):
530         HTMLCollection::invalidateCache(attr) is now renamed to
531         invalidateCacheForAttribute(attr) to avoid ambiguity with
532         HTMLCollection::invalidateCache(doc) and for consistency
533         with LiveNodeList.
534
535         * dom/NodeRareData.h:
536         Make necessary updates now that TagNodeList is renamed to TagCollection
537         and is an HTMLCollection.
538
539         * dom/TagCollection.cpp: Renamed from Source/WebCore/dom/TagNodeList.cpp.
540         * dom/TagCollection.h: Renamed from Source/WebCore/dom/TagNodeList.h.
541         Rename TagNodeList / HTMLTagNodeList to TagCollection / HTMLTagCollection
542         and inherit CachedHTMLCollection instead of CachedLiveNodeList.
543
544         * editing/Editor.cpp:
545         (WebCore::Editor::applyEditingStyleToBodyElement):
546         Update code using getElementsByTagName() to reflect the fact that it
547         now returns an HTMLCollection and item() returns an Element*. This
548         function is matching any Element with "body" tag, not just HTMLBodyElement
549         so I did not refactor it to use an descendantsOfType<HTMLBodyElement>().
550         It is not clear to me what the intention of this code is.
551
552         * editing/markup.cpp:
553         (WebCore::createFragmentFromMarkup):
554         * editing/markup.h:
555         - Return a Ref<> instead of a PassRefPtr<> as it can never return null.
556         - Use descendantsOfType<HTMLAttachmentElement>(fragment) instead of
557           getElementsByTagName() as it results in both shorter and more efficient
558           code.
559
560         * html/CollectionType.h:
561         Add new ByTag / ByHTMLTag collection types for TagCollection /
562         HTMLTabCollection.
563
564         * html/GenericCachedHTMLCollection.cpp:
565         (WebCore::GenericCachedHTMLCollection<traversalType>::elementMatches):
566         Handle new ByTag / ByHTMLTag collection types in the switch statement.
567
568         * html/HTMLCollection.cpp:
569         (WebCore::invalidationTypeExcludingIdAndNameAttributes):
570         (WebCore::HTMLCollection::~HTMLCollection):
571         Handle new ByTag / ByHTMLTag collection types in switch statements.
572
573         (WebCore::HTMLCollection::tags):
574         Add a null-check on localName() before calling getElementsByTagName().
575         This function is currently for ObjC bindings only.
576
577         * html/HTMLPlugInImageElement.cpp:
578         (WebCore::HTMLPlugInImageElement::restartSimilarPlugIns):
579         Simplify / optimize the code by using descendantsOfType<HTMLPlugInImageElement>()
580         instead of getElementsByTagName().
581
582         * html/MediaDocument.cpp:
583         (WebCore::descendantVideoElement):
584         Use descendantsOfType<HTMLVideoElement> instead of getElementsByTagNameNS().
585
586 2015-08-21  Geoffrey Garen  <ggaren@apple.com>
587
588         Debugger's VM should never be null
589         https://bugs.webkit.org/show_bug.cgi?id=148341
590
591         Reviewed by Joseph Pecoraro.
592
593         It doesn't make sense for a Debugger's VM to be null, and code related
594         to maintaining that illusion just caused the Web Inspector to crash on
595         launch (https://bugs.webkit.org/show_bug.cgi?id=148312). So, let's stop
596         doing that.
597
598         Now, Debugger requires its subclass to provide a never-null VM&.
599
600         * bindings/js/WorkerScriptDebugServer.cpp:
601         (WebCore::WorkerScriptDebugServer::WorkerScriptDebugServer):
602         (WebCore::WorkerScriptDebugServer::recompileAllJSFunctions):
603         (WebCore::WorkerScriptDebugServer::runEventLoopWhilePaused):
604         * inspector/PageScriptDebugServer.cpp:
605         (WebCore::PageScriptDebugServer::recompileAllJSFunctions):
606         (WebCore::PageScriptDebugServer::didPause):
607
608 2015-08-21  Myles C. Maxfield  <mmaxfield@apple.com>
609
610         [OS X] Remove dead code from FontCache::systemFallbackForCharacters()
611         https://bugs.webkit.org/show_bug.cgi?id=148218
612
613         Reviewed by Daniel Bates.
614
615         lookupCTFont() in FontCacheMac.mm will always return the best font (because
616         CTFontCreateForCharactersWithLanguage() does so). Also, all fonts that will
617         be created on WebKit's behalf are already printer fonts.
618
619         No new tests because there is no behavior change.
620
621         * platform/graphics/mac/FontCacheMac.mm:
622         (WebCore::FontCache::systemFallbackForCharacters): Deleted.
623
624 2015-08-21  Anders Carlsson  <andersca@apple.com>
625
626         Fix build.
627
628         * platform/network/win/NetworkStateNotifierWin.cpp:
629         (WebCore::NetworkStateNotifier::addrChangeCallback):
630         (WebCore::NetworkStateNotifier::callAddressChanged): Deleted.
631
632 2015-08-21  Myles C. Maxfield  <mmaxfield@apple.com>
633
634         [Cocoa] Clean up Font class
635         https://bugs.webkit.org/show_bug.cgi?id=148216
636
637         Reviewed by Dean Jackson.
638
639         No new tests because there is no behavior change.
640
641         * platform/graphics/Font.cpp:
642         (WebCore::Font::platformGlyphInit): Deleted.
643         * platform/graphics/Font.h:
644         * platform/graphics/cocoa/FontCocoa.mm:
645         (WebCore::Font::platformInit):
646
647 2015-08-21  Myles C. Maxfield  <mmaxfield@apple.com>
648
649         [Cocoa] Unify two more FontCache functions
650         https://bugs.webkit.org/show_bug.cgi?id=148217
651
652         Reviewed by Dean Jackson.
653
654         Move duplicated code from FontCacheMac and FontCacheIOS into
655         FontCacheCoreText.
656
657         No new tests because there is no behavior change.
658
659         * platform/graphics/cocoa/FontCacheCoreText.cpp:
660         (WebCore::toTraitsMask):
661         (WebCore::isFontWeightBold):
662         (WebCore::FontCache::similarFont):
663         (WebCore::FontCache::getTraitsInFamily):
664         * platform/graphics/ios/FontCacheIOS.mm:
665         (WebCore::FontCache::similarFont): Deleted.
666         (WebCore::toTraitsMask): Deleted.
667         (WebCore::FontCache::getTraitsInFamily): Deleted.
668         * platform/graphics/mac/FontCacheMac.mm:
669         (WebCore::toTraitsMask): Deleted.
670         (WebCore::FontCache::similarFont): Deleted.
671         (WebCore::FontCache::getTraitsInFamily): Deleted.
672
673 2015-08-21  Anders Carlsson  <andersca@apple.com>
674
675         Stop using the old callOnMainThread variant on Windows
676         https://bugs.webkit.org/show_bug.cgi?id=148332
677
678         Reviewed by Tim Horton.
679
680         * platform/network/cf/CookieStorageCFNet.cpp:
681         (WebCore::notifyCookiesChanged):
682         (WebCore::notifyCookiesChangedOnMainThread): Deleted.
683         * platform/network/win/NetworkStateNotifierWin.cpp:
684         (WebCore::NetworkStateNotifier::addrChangeCallback):
685
686 2015-08-20  Matt Rajca  <mrajca@apple.com>
687
688         Media Session: let UI clients change the volume of the focused media element
689         https://bugs.webkit.org/show_bug.cgi?id=148289
690
691         Reviewed by Tim Horton.
692
693         * page/Page.cpp:
694         (WebCore::Page::setVolumeOfMediaElement):
695         * page/Page.h:
696
697 2015-08-21  Anders Carlsson  <andersca@apple.com>
698
699         Get rid of uses of the old callOnMainThread function that takes a function ptr + context
700         https://bugs.webkit.org/show_bug.cgi?id=148324
701
702         Reviewed by Tim Horton.
703
704         * Modules/webaudio/AsyncAudioDecoder.cpp:
705         (WebCore::AsyncAudioDecoder::DecodingTask::decode):
706         (WebCore::AsyncAudioDecoder::DecodingTask::notifyCompleteDispatch): Deleted.
707         * Modules/webaudio/AsyncAudioDecoder.h:
708         * Modules/webaudio/OfflineAudioDestinationNode.cpp:
709         (WebCore::OfflineAudioDestinationNode::offlineRender):
710         (WebCore::OfflineAudioDestinationNode::notifyCompleteDispatch): Deleted.
711         * Modules/webaudio/OfflineAudioDestinationNode.h:
712         * Modules/webaudio/ScriptProcessorNode.cpp:
713         (WebCore::ScriptProcessorNode::process):
714         (WebCore::ScriptProcessorNode::fireProcessEventDispatch): Deleted.
715         * Modules/webaudio/ScriptProcessorNode.h:
716         * Modules/webdatabase/DatabaseTracker.cpp:
717         (WebCore::DatabaseTracker::scheduleForNotification):
718         (WebCore::DatabaseTracker::notifyDatabasesChanged):
719         * Modules/webdatabase/DatabaseTracker.h:
720         * platform/graphics/cg/ImageCG.cpp:
721         (WebCore::patternReleaseCallback):
722         (WebCore::patternReleaseOnMainThreadCallback): Deleted.
723         * platform/graphics/cg/PatternCG.cpp:
724         (WebCore::patternReleaseCallback):
725         (WebCore::patternReleaseOnMainThreadCallback): Deleted.
726         * platform/graphics/mac/FontCacheMac.mm:
727         (WebCore::invalidateFontCache):
728         (WebCore::fontCacheRegisteredFontsChangedNotificationCallback):
729         * platform/network/BlobResourceHandle.cpp:
730         (WebCore::doNotifyFinish):
731         (WebCore::BlobResourceHandle::notifyFinish):
732         * platform/network/cf/FormDataStreamCFNet.cpp:
733         (WebCore::formFinalize):
734         (WebCore::formFinishFinalizationOnMainThread): Deleted.
735
736 2015-08-21  Doug Russell  <d_russell@apple.com>
737
738         AX: Table with CSS that makes a row anonymous can return NULL from cellForColumnAndRow
739         https://bugs.webkit.org/show_bug.cgi?id=148293
740
741         Reviewed by Chris Fleizach.
742
743         When RenderTableRows are anonymous, they may not be added to the accessible data 
744         table's internal row list. However, when calculating the row range for a cell, 
745         we were still accounting for those anonymous sections.
746         Change how the row range is calculated to directly ask the accessible parent row 
747         for its index. This will ensure it’s more inline with what’s being represented to 
748         the accessibility API.
749
750         Test: accessibility/aria-table-content.html
751
752         * accessibility/AccessibilityTableCell.cpp:
753         (WebCore::AccessibilityTableCell::parentRow):
754         (WebCore::AccessibilityTableCell::rowIndexRange):
755         * accessibility/AccessibilityTableCell.h:
756
757 2015-08-21  Joseph Pecoraro  <pecoraro@apple.com>
758
759         Web Inspector: REGRESSION(173684): Edit as HTML not working
760         https://bugs.webkit.org/show_bug.cgi?id=148268
761
762         Reviewed by Chris Dumez.
763
764         Tests: inspector/dom/getOuterHTML.html
765                inspector/dom/setOuterHTML.html
766
767         * inspector/DOMPatchSupport.cpp:
768         (WebCore::DOMPatchSupport::innerPatchChildren):
769         Revert the optimization change made in r173684. The optimization changes
770         had a few issues. It changed the logic to potentially drop out of the
771         loop before all new items were processed and using a node reference
772         to track an index did not account for the modifications insertBefore
773         may have made to that node's index in the list.
774
775 2015-08-21  Beth Dakin  <bdakin@apple.com>
776
777         HistoryItems will null CachedPages should never be left in the list of items; 
778         causes crash
779         https://bugs.webkit.org/show_bug.cgi?id=148237
780         -and corresponding-
781         rdar://problem/22356782
782
783         Reviewed by Brady Eidson.
784
785         Setting the CachedPage to nullptr will destroy the CachedPage, destroy the 
786         FrameView, re-enter layout, and potentially try to modify items in the PageCache 
787         based on that layout. So, we should not modify CachedPage in this way while the 
788         item is still in the list of HistoryItems.
789         * history/PageCache.cpp:
790         (WebCore::PageCache::take):
791         (WebCore::PageCache::remove):
792         (WebCore::PageCache::prune):
793
794 2015-08-21  David Kilzer  <ddkilzer@apple.com>
795
796         dispatch_group_t objects may not be retained properly when not backed by Objective-C objects under garbage collection
797         <http://webkit.org/b/148229>
798
799         Reviewed by Eric Carlson.
800
801         When compiled with garbage collection enabled, libdispatch
802         objects are not backed by Objective-C objects, so they don't get
803         the benefit of automatic reference counting when captured by a
804         block or a lambda.  To address this, we use OSObjectPtr<> which
805         always increments the reference count of the contained object.
806
807         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
808         (WebCore::MediaPlayerPrivateAVFoundationObjC::beginLoadingMetadata):
809         Switch to use OSObjectPtr<>.
810
811 2015-08-21  Nan Wang  <n_wang@apple.com>
812
813         [Mac] accessibility/selection-states.html fails
814         https://bugs.webkit.org/show_bug.cgi?id=116637
815
816         Reviewed by Chris Fleizach.
817
818         Added accessibilityAttributeValue callback for isMultiSelectable attribute.
819
820         Updated expectation for accessibility/selection-states.html on mac.
821
822         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
823         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
824
825 2015-08-21  Jonathan Davis  <jond@apple.com>
826
827         Fixed status features JSON formatting.
828
829         * features.json:
830
831 2015-08-21  Chris Dumez  <cdumez@apple.com>
832
833         Have more getElementsBy*() methods return a Ref<>
834         https://bugs.webkit.org/show_bug.cgi?id=148287
835
836         Reviewed by Sam Weinig.
837
838         Have more getElementsBy*() methods return a Ref<> instaed of a RefPtr<>
839         as they cannot return null.
840
841         * dom/ContainerNode.cpp:
842         (WebCore::ContainerNode::getElementsByTagName):
843         (WebCore::ContainerNode::getElementsByTagNameNS):
844         (WebCore::ContainerNode::getElementsByName):
845         (WebCore::ContainerNode::getElementsByClassName):
846         (WebCore::ContainerNode::getElementsByClassNameForObjC):
847         (WebCore::ContainerNode::radioNodeList):
848         * dom/ContainerNode.h:
849
850 2015-08-21  Chris Dumez  <cdumez@apple.com>
851
852         Drop NodeListBase class
853         https://bugs.webkit.org/show_bug.cgi?id=148290
854
855         Reviewed by Ryosuke Niwa.
856
857         Drop NodeListBase class and have HTMLCollection subclass NodeList
858         directly. There is no reason we need another base class.
859
860         * WebCore.xcodeproj/project.pbxproj:
861         * bindings/scripts/CodeGeneratorObjC.pm:
862         (GetImplClassName): Deleted.
863         * dom/ContainerNode.cpp:
864         (WebCore::ContainerNode::getElementsByClassNameForObjC):
865         * dom/ContainerNode.h:
866         * dom/NodeList.h:
867         * dom/NodeListBase.h: Removed.
868         * html/HTMLCollection.h:
869
870 2015-08-20  Yusuke Suzuki  <utatane.tea@gmail.com>
871
872         [ES6] prototyping module loader in JSC shell
873         https://bugs.webkit.org/show_bug.cgi?id=147876
874
875         Reviewed by Saam Barati.
876
877         Just fill Loader hooks with nullptr.
878
879         * bindings/js/JSDOMWindowBase.cpp:
880         * bindings/js/JSWorkerGlobalScopeBase.cpp:
881
882 2015-08-20  Chris Dumez  <cdumez@apple.com>
883
884         Fix passing null / undefined as NodeFilter parameter for createNodeIterator() / createTreeWalker()
885         https://bugs.webkit.org/show_bug.cgi?id=148257
886
887         Reviewed by Darin Adler.
888
889         Fix passing null / undefined as NodeFilter parameter for createNodeIterator() / createTreeWalker().
890         It is supposed to be translated into a *null* NodeFilter. However, WebKit was constructing a
891         NodeFilter in this case.
892
893         Chrome and Firefox do not create a NodeFilter in this case.
894
895         No new tests, already covered by:
896         fast/dom/createNodeIterator-parameters.html
897         fast/dom/createTreeWalker-parameters.html
898
899         * bindings/js/JSNodeFilterCustom.cpp:
900         (WebCore::JSNodeFilter::toWrapped):
901
902 2015-08-20  Zalan Bujtas  <zalan@apple.com>
903
904         Make outline: auto repaint rect inflate more explicit.
905         https://bugs.webkit.org/show_bug.cgi?id=148263
906
907         Reviewed by Simon Fraser.
908
909         Use RenderObject::adjustRectWithMaximumOutline() when inflating is conditional and call
910         RenderView::maximalOutlineSize() when it is not.
911         After this changeset, we can clearly tell calls when inflating is unconditional (adjusting the size of the compositing layer) apart from
912         calls when we just simply inflate the repaint rect during outline painting phase.
913
914         No change in behaviour.
915
916         * rendering/InlineFlowBox.cpp:
917         (WebCore::InlineFlowBox::paint):
918         * rendering/RenderBlock.cpp:
919         (WebCore::RenderBlock::paint):
920         * rendering/RenderBlockFlow.cpp:
921         (WebCore::RenderBlockFlow::layoutBlock):
922         * rendering/RenderDetailsMarker.cpp:
923         (WebCore::RenderDetailsMarker::paint):
924         * rendering/RenderElement.cpp:
925         (WebCore::RenderElement::computeMaxOutlineSize):
926         * rendering/RenderLayer.cpp:
927         (WebCore::RenderLayer::calculateClipRects):
928         * rendering/RenderLineBoxList.cpp:
929         (WebCore::isOutlinePhase):
930         (WebCore::RenderLineBoxList::lineIntersectsDirtyRect):
931         (WebCore::RenderLineBoxList::paint):
932         * rendering/RenderListMarker.cpp:
933         (WebCore::RenderListMarker::paint):
934         * rendering/RenderObject.cpp:
935         (WebCore::RenderObject::adjustRectWithMaximumOutline):
936         (WebCore::RenderObject::maximalOutlineSize): Deleted.
937         * rendering/RenderObject.h:
938         * rendering/RenderRegion.cpp:
939         (WebCore::RenderRegion::overflowRectForFlowThreadPortion):
940         * rendering/RenderReplaced.cpp:
941         (WebCore::RenderReplaced::shouldPaint):
942         * rendering/RenderTable.cpp:
943         (WebCore::RenderTable::paint):
944         * rendering/RenderTableCell.cpp:
945         (WebCore::RenderTableCell::paintCollapsedBorders):
946         * rendering/RenderTableSection.cpp:
947         (WebCore::RenderTableSection::paintObject):
948         * rendering/RenderView.cpp:
949         (WebCore::RenderView::setMaximalOutlineSize):
950         (WebCore::RenderView::RenderView): Deleted.
951         * rendering/RenderView.h:
952
953 2015-08-20  Myles C. Maxfield  <mmaxfield@apple.com>
954
955         [OS X] Cleaup after r188591
956         https://bugs.webkit.org/show_bug.cgi?id=148219
957
958         Unreviewed.
959
960         Forgot to update a call site of FontPlatformData().
961
962         * platform/graphics/mac/FontCacheMac.mm:
963         (WebCore::FontCache::systemFallbackForCharacters):
964
965 2015-08-20  Alex Christensen  <achristensen@webkit.org>
966
967         Build fix after r188716.
968
969         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
970         (WebCore::MediaPlayerPrivateMediaFoundation::endGetEvent):
971         Add some scope so we can declare a variable (weakPtr) inside a switch statement.
972
973 2015-08-20  Alex Christensen  <achristensen@webkit.org>
974
975         Build fix after r188716.
976
977         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
978         (WebCore::MediaPlayerPrivateMediaFoundation::endCreatedMediaSource):
979         (WebCore::MediaPlayerPrivateMediaFoundation::endGetEvent):
980         Replace m_weakFactory with m_weakPtrFactory which actually exists.
981
982 2015-08-20  Myles C. Maxfield  <mmaxfield@apple.com>
983
984         [iOS] Adopt OS X's emoji behavior.
985         https://bugs.webkit.org/show_bug.cgi?id=148265
986
987         Reviewed by Simon Fraser.
988
989         Remove our hardcoded hacks which limit the sizes of emoji. This is how
990         OS X behaves with emoji.
991
992         Test: fast/text/emoji.html
993
994         * platform/graphics/FontPlatformData.h:
995         (WebCore::FontPlatformData::hash):
996         (WebCore::FontPlatformData::isEmoji): Deleted.
997         (WebCore::FontPlatformData::setIsEmoji): Deleted.
998         * platform/graphics/cocoa/FontCascadeCocoa.mm:
999         (WebCore::FontCascade::drawGlyphs):
1000         (WebCore::isOnOrAfterIOS6): Deleted.
1001         (WebCore::pointAdjustedForEmoji): Deleted.
1002         * platform/graphics/cocoa/FontCocoa.mm:
1003         (WebCore::canUseFastGlyphAdvanceGetter):
1004         (WebCore::Font::platformInit): Deleted.
1005         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1006         (WebCore::FontPlatformData::ctFont):
1007         (WebCore::FontPlatformData::platformDataInit): Deleted.
1008         (WebCore::FontPlatformData::platformDataAssign): Deleted.
1009         (WebCore::FontPlatformData::platformIsEqual): Deleted.
1010         (WebCore::FontPlatformData::ctFontSize): Deleted.
1011         * platform/graphics/ios/FontCacheIOS.mm:
1012         (WebCore::FontCache::getSystemFontFallbackForCharacters): Deleted.
1013         (WebCore::FontCache::createFontPlatformData): Deleted.
1014         * platform/graphics/mac/ComplexTextController.cpp:
1015         (WebCore::ComplexTextController::adjustGlyphsAndAdvances): Deleted.
1016
1017 2015-08-20  Chris Dumez  <cdumez@apple.com>
1018
1019         getElementsByClassName() should return an HTMLCollection
1020         https://bugs.webkit.org/show_bug.cgi?id=147980
1021
1022         Reviewed by Darin Adler.
1023
1024         Update Document.getElementsByClassName() and Element.getElementsByClassName()
1025         to return an HTMLCollection instead of a NodeList, as per the specification:
1026         - https://dom.spec.whatwg.org/#interface-document
1027         - https://dom.spec.whatwg.org/#interface-element
1028
1029         This behavior is also consistent with other major browsers. Due to this and
1030         the fact that NodeList / HTMLCollection pretty much the same API, the
1031         compatibility risk should be fairly low.
1032
1033         I also verified that the performance is the same according to the following
1034         performance test:
1035         PerformanceTests/DOM/get-elements-by-class-name-traversal-uncached.html
1036
1037         Tests: fast/dom/getElementsByClassName/dumpHTMLCollection.html
1038                fast/dom/getElementsByClassName/return-type.html
1039
1040         * CMakeLists.txt:
1041         * WebCore.vcxproj/WebCore.vcxproj:
1042         * WebCore.xcodeproj/project.pbxproj:
1043         Rename ClassNodeList.cpp file.
1044
1045         * bindings/scripts/CodeGeneratorObjC.pm:
1046         (GetImplClassName):
1047         Indicate that NodeList is implemented as NodeListBase. This is
1048         needed so that DOMNodeList can have either an HTMLCollection or
1049         a NodeList as internal representation. NodeListBase is a new
1050         common base class for HTMLCollection and NodeList.
1051
1052         * dom/ClassCollection.cpp: Renamed from Source/WebCore/dom/ClassNodeList.cpp.
1053         (WebCore::ClassCollection::create):
1054         (WebCore::ClassCollection::~ClassCollection):
1055         * dom/ClassCollection.h: Renamed from Source/WebCore/dom/ClassNodeList.h.
1056         (WebCore::ClassCollection::ClassCollection):
1057         (WebCore::ClassCollection::elementMatches):
1058         Rename ClassNodeList to ClassCollection and have it subclass
1059         CachedHTMLCollection instead of ClassNodeList.
1060
1061         * dom/ContainerNode.cpp:
1062         (WebCore::ContainerNode::getElementsByClassName):
1063         Have getElementsByClassName return an HTMLCollection instead of a
1064         NodeList.
1065
1066         (WebCore::ContainerNode::getElementsByClassNameForObjC):
1067         New method returns a NodeListBase for ObjC bindings, so they can
1068         convert the return value into a DOMNodeList. We need this to not
1069         break ObjC API compatibility.
1070
1071         * dom/Document.idl:
1072         * dom/Element.idl:
1073         Have getElementsByClassName return an HTMLCollection instead of a
1074         NodeList, except for ObjC bindings.
1075
1076         * dom/NodeList.h:
1077         Have NodeList subclass NodeListBase.
1078
1079         * dom/NodeListBase.h: Added.
1080         New common base interface for HTMLCollection and NodeList. This is
1081         so that the internal representation for ObjC's DOMNodeList can be
1082         a NodeListBase instead of a NodeList. This way, the ObjC API can
1083         keep returning a DOMNodeList, even though our implementation now
1084         returns an HTMLCollection instead of a NodeList.
1085
1086         * dom/NodeRareData.h:
1087         (WebCore::NodeListTypeIdentifier<NameNodeList>::value):
1088         (WebCore::NodeListTypeIdentifier<TagNodeList>::value):
1089         (WebCore::NodeListTypeIdentifier<HTMLTagNodeList>::value):
1090         (WebCore::NodeListTypeIdentifier<RadioNodeList>::value):
1091         (WebCore::NodeListTypeIdentifier<LabelsNodeList>::value):
1092         Drop ClassNodeList from the NodeListTypeIndentifiers.
1093
1094         * html/CollectionType.h:
1095         Add new ByClass CollectionType for ClassCollection.
1096
1097         * html/GenericCachedHTMLCollection.cpp:
1098         (WebCore::GenericCachedHTMLCollection<traversalType>::elementMatches):
1099         Handle new ByClass CollectionType in the switch statement.
1100
1101         * html/HTMLCollection.cpp:
1102         (WebCore::invalidationTypeExcludingIdAndNameAttributes):
1103         (WebCore::HTMLCollection::~HTMLCollection):
1104         Add support for new ByClass Collection type.
1105
1106         * html/HTMLCollection.h:
1107         Have HTMLCollection subclass the NodeListBase interface.
1108
1109 2015-08-20  Myles C. Maxfield  <mmaxfield@apple.com>
1110
1111         Fix the iOS build after r188726
1112         https://bugs.webkit.org/show_bug.cgi?id=148278
1113
1114         Unreviewed.
1115
1116         * platform/graphics/ios/FontCacheIOS.mm:
1117         (WebCore::FontCache::systemFallbackForCharacters):
1118
1119 2015-08-20  Myles C. Maxfield  <mmaxfield@apple.com>
1120
1121         Cleanup after r188726
1122         https://bugs.webkit.org/show_bug.cgi?id=148278
1123
1124         Unreviewed.
1125
1126         No new tests because there is no behavior change.
1127
1128         * platform/graphics/ios/FontCacheIOS.mm:
1129         (WebCore::FontCache::systemFallbackForCharacters):
1130
1131 2015-08-20  Myles C. Maxfield  <mmaxfield@apple.com>
1132
1133         [iOS] Delete dead code
1134         https://bugs.webkit.org/show_bug.cgi?id=148278
1135
1136         Reviewed by Dean Jackson.
1137
1138         No new tests because there is no behavior change.
1139
1140         * platform/graphics/cocoa/FontCocoa.mm:
1141         (WebCore::Font::platformInit):
1142         * platform/graphics/ios/FontCacheIOS.mm:
1143         (WebCore::copyFontCharacterSet): Deleted.
1144         (WebCore::appleColorEmojiCharacterSet): Deleted.
1145         (WebCore::phoneFallbackCharacterSet): Deleted.
1146         (WebCore::languageSpecificFallbackFont): Deleted.
1147         (WebCore::FontCache::systemFallbackForCharacters): Deleted.
1148
1149 2015-08-20  Tim Horton  <timothy_horton@apple.com>
1150
1151         Unreviewed, rolling out r188712.
1152         https://bugs.webkit.org/show_bug.cgi?id=148274
1153
1154         broke allllll the tests (Requested by thorton on #webkit).
1155
1156         Reverted changeset:
1157
1158         "WK1 can re-enter layout during FrameView destruction and
1159         crash"
1160         https://bugs.webkit.org/show_bug.cgi?id=148237
1161         http://trac.webkit.org/changeset/188712
1162
1163 2015-08-20  Commit Queue  <commit-queue@webkit.org>
1164
1165         Unreviewed, rolling out r188717 and r188719.
1166         https://bugs.webkit.org/show_bug.cgi?id=148272
1167
1168         Broke the Mavericks build (Requested by andersca on #webkit).
1169
1170         Reverted changesets:
1171
1172         "Merge Lock and LockBase"
1173         https://bugs.webkit.org/show_bug.cgi?id=148266
1174         http://trac.webkit.org/changeset/188717
1175
1176         "Merge ConditionBase and Condition"
1177         https://bugs.webkit.org/show_bug.cgi?id=148270
1178         http://trac.webkit.org/changeset/188719
1179
1180 2015-08-20  Anders Carlsson  <andersca@apple.com>
1181
1182         Merge ConditionBase and Condition
1183         https://bugs.webkit.org/show_bug.cgi?id=148270
1184
1185         Reviewed by Filip Pizlo.
1186
1187         Change StaticCondition to Condition.
1188
1189         * platform/network/cf/LoaderRunLoopCF.cpp:
1190
1191 2015-08-20  Anders Carlsson  <andersca@apple.com>
1192
1193         Stop using cancelCallOnMainThread in MediaPlayerPrivateMediaFoundation
1194         https://bugs.webkit.org/show_bug.cgi?id=148252
1195
1196         Reviewed by Tim Horton.
1197
1198         Replace cancelCallOnMainThread with WeakPtrs.
1199
1200         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
1201         (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerPrivateMediaFoundation):
1202         (WebCore::MediaPlayerPrivateMediaFoundation::endCreatedMediaSource):
1203         (WebCore::MediaPlayerPrivateMediaFoundation::endGetEvent):
1204         (WebCore::MediaPlayerPrivateMediaFoundation::~MediaPlayerPrivateMediaFoundation):
1205         (WebCore::MediaPlayerPrivateMediaFoundation::onCreatedMediaSourceCallback):
1206         (WebCore::MediaPlayerPrivateMediaFoundation::onTopologySetCallback):
1207         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
1208
1209 2015-08-20  Beth Dakin  <bdakin@apple.com>
1210
1211         WK1 can re-enter layout during FrameView destruction and crash
1212         https://bugs.webkit.org/show_bug.cgi?id=148237
1213         -and corresponding-
1214         rdar://problem/22356782
1215
1216         Reviewed by Zalan Bujtas.
1217
1218         This is a safe fix for the time being. We won't resetScrollbars() for a FrameView 
1219         that is in the PageCache because resetting scrollbars can re-enter layout for the 
1220         Frame's new FrameView, which leads to updating pages in the page cache, which 
1221         leads to a crash because we're in the process of destroying something
1222         in the page cache. We should not be able to get into this mess at all.
1223         * page/FrameView.cpp:
1224         (WebCore::FrameView::~FrameView):
1225
1226 2015-08-20  Chris Dumez  <cdumez@apple.com>
1227
1228         Default value for createNodeIterator() / createTreeWalker()'s whatToShow parameter should be 0xFFFFFFFF
1229         https://bugs.webkit.org/show_bug.cgi?id=148238
1230
1231         Reviewed by Ryosuke Niwa.
1232
1233         Default value for createNodeIterator() / createTreeWalker()'s whatToShow
1234         parameter should be 0xFFFFFFFF as per the specification:
1235         - http://w3c-test.org/dom/traversal/NodeIterator.html
1236         - http://w3c-test.org/dom/traversal/TreeWalker.html
1237
1238         Firefox and Chrome conform to the specification. However, WebKit was
1239         using 0 as default value.
1240
1241         We still don't behave as expected in some cases, as visible from
1242         the checks that are still failing in the new layout tests. Those
1243         will be addressed separately.
1244
1245         Tests: fast/dom/createNodeIterator-parameters.html
1246                fast/dom/createTreeWalker-parameters.html
1247
1248         * dom/Document.cpp:
1249         (WebCore::Document::createNodeIterator):
1250         (WebCore::Document::createTreeWalker):
1251         (WebCore::Document::scheduleForcedStyleRecalc): Deleted.
1252         (WebCore::Document::scheduleStyleRecalc): Deleted.
1253         * dom/Document.h:
1254         * dom/Document.idl:
1255         * dom/NodeIterator.cpp:
1256         (WebCore::NodeIterator::NodeIterator):
1257         * dom/NodeIterator.h:
1258         (WebCore::NodeIterator::create):
1259         * dom/Traversal.cpp:
1260         (WebCore::NodeIteratorBase::NodeIteratorBase):
1261         * dom/Traversal.h:
1262         (WebCore::NodeIteratorBase::whatToShow):
1263         * dom/TreeWalker.cpp:
1264         (WebCore::TreeWalker::TreeWalker):
1265         * dom/TreeWalker.h:
1266         (WebCore::TreeWalker::create):
1267
1268 2015-08-20  Anders Carlsson  <andersca@apple.com>
1269
1270         Stop using cancelCallOnMainThread in MediaPlayerPrivateAVFoundation
1271         https://bugs.webkit.org/show_bug.cgi?id=148248
1272
1273         Reviewed by Tim Horton.
1274
1275         Replace cancelCallOnMainThread with WeakPtrs, just like in MediaPlayerPrivateAVFoundationObjC.
1276
1277         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1278         (WebCore::MediaPlayerPrivateAVFoundation::mainThreadCallback):
1279         (WebCore::MediaPlayerPrivateAVFoundation::scheduleMainThreadNotification):
1280         (WebCore::MediaPlayerPrivateAVFoundation::dispatchNotification):
1281         (WebCore::MediaPlayerPrivateAVFoundation::~MediaPlayerPrivateAVFoundation): Deleted.
1282         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
1283
1284 2015-08-20  Anders Carlsson  <andersca@apple.com>
1285
1286         Stop using cancelCallOnMainThread in DisplayRefreshMonitorMac
1287         https://bugs.webkit.org/show_bug.cgi?id=148241
1288
1289         Reviewed by Tim Horton.
1290
1291         Create a WeakPtrFactory in DisplayRefreshMonitorMac and bind a WeakPtr in the function passed
1292         to callOnMainThread so we can check if the DisplayRefreshMonitorMac has gone away.
1293
1294         * platform/graphics/mac/DisplayRefreshMonitorMac.cpp:
1295         (WebCore::DisplayRefreshMonitorMac::DisplayRefreshMonitorMac):
1296         (WebCore::DisplayRefreshMonitorMac::displayLinkFired):
1297         (WebCore::DisplayRefreshMonitorMac::~DisplayRefreshMonitorMac):
1298         * platform/graphics/mac/DisplayRefreshMonitorMac.h:
1299
1300 2015-08-20  Alex Christensen  <achristensen@webkit.org>
1301
1302         AppleWin CMake build fix after r188696.
1303
1304         * PlatformWin.cmake:
1305         No ${} fixes the problem and keeps the desired behavior.
1306
1307 2015-08-20  Per Arne Vollan  <peavo@outlook.com>
1308
1309         [WinCairo] Link errors when building with VS2015.
1310         https://bugs.webkit.org/show_bug.cgi?id=148233
1311
1312         Reviewed by Alex Christensen.
1313
1314         Include some inline function definitions.
1315
1316         * bindings/js/JSWebGLRenderingContextCustom.cpp:
1317         * html/canvas/WebGLRenderingContext.cpp:
1318
1319 2015-08-20  Alex Christensen  <achristensen@webkit.org>
1320
1321         Clean up CMake build after r188673
1322         https://bugs.webkit.org/show_bug.cgi?id=148234
1323
1324         Reviewed by Tim Horton.
1325
1326         * CMakeLists.txt:
1327         * PlatformEfl.cmake:
1328         * PlatformGTK.cmake:
1329         * PlatformWin.cmake:
1330         Make including ANGLE headers platform specific because EFL and GTK don't want to copy headers,
1331         but we need to in order to get the Windows build working with each Source subdirectory isolated.
1332
1333 2015-08-20  Beth Dakin  <bdakin@apple.com>
1334
1335         Standalone image documents should send their size to the UIClient just like 
1336         standalone media documents
1337         https://bugs.webkit.org/show_bug.cgi?id=148195
1338         -and corresponding-
1339         rdar://problem/21951253
1340
1341         Reviewed by Tim Horton.
1342
1343         This patch re-names mediaDocumentNaturalSizeChanged() to 
1344         imageOrMediaDocumentSizeChanged(), and, as the new name implies, uses the 
1345         function for both media documents and images.
1346
1347         * html/ImageDocument.cpp:
1348         (WebCore::ImageDocument::imageUpdated):
1349         * html/MediaDocument.cpp:
1350         (WebCore::MediaDocument::mediaElementNaturalSizeChanged):
1351         * page/ChromeClient.h:
1352
1353 2015-08-20  Simon Fraser  <simon.fraser@apple.com>
1354
1355         Add myself as the will-change contact.
1356
1357         * features.json:
1358
1359 2015-08-20  Chris Dumez  <cdumez@apple.com>
1360
1361         [Cocoa] Treat Epoch as invalid value for "Last-Modified" header
1362         https://bugs.webkit.org/show_bug.cgi?id=148162
1363         rdar://problem/22330837
1364
1365         Reviewed by Antti Koivisto.
1366
1367         Ignore "Last-Modified" header when computing heuristic freshness if it
1368         is Epoch. CFNetwork currently converts a malformed date for Last-Modified
1369         into Epoch so there is no way for us to distinguish Epoch from invalid
1370         input. Without this, we would end up with cached resources that have a
1371         giant lifetime (> 4 years) due to a malformed HTTP header.
1372
1373         Some Websites (e.g. www.popehat.com) also wrongly return Epoch as
1374         Last-Modified value and we would end up caching it overly aggressively.
1375         Now that we consider Epoch as an invalid value for Last-Modified, it will
1376         also work around this content bug.
1377
1378         Test: http/tests/cache/disk-cache/disk-cache-last-modified.html
1379
1380         * platform/network/ResourceResponseBase.cpp:
1381         (WebCore::ResourceResponseBase::lastModified):
1382
1383 2015-08-19  Brian Burg  <bburg@apple.com>
1384
1385         Web Inspector: add TestHarness option to tee all commands to system console
1386         https://bugs.webkit.org/show_bug.cgi?id=148181
1387
1388         Reviewed by Joseph Pecoraro.
1389
1390         * inspector/InspectorFrontendHost.cpp:
1391         (WebCore::InspectorFrontendHost::unbufferedLog): Remove log prefix so output
1392         to stderr can be diffed against expected results without processing.
1393
1394 2015-08-19  Brent Fulgham  <bfulgham@apple.com>
1395
1396         [Win] Unreviewed build fix after r188663.
1397
1398         The new bindings file was added to the Visual Studio project, but was marked to not
1399         be built. It should have also been added to the "JSBindingsAllInOne.cpp" file so
1400         that the new code gets compiled.
1401
1402         * bindings/js/JSBindingsAllInOne.cpp:
1403
1404 2015-08-19  Alex Christensen  <achristensen@webkit.org>
1405
1406         CMake Windows build should not include files directly from other Source directories
1407         https://bugs.webkit.org/show_bug.cgi?id=148198
1408
1409         Reviewed by Brent Fulgham.
1410
1411         * CMakeLists.txt:
1412         * PlatformEfl.cmake:
1413         * PlatformGTK.cmake:
1414         * PlatformWin.cmake:
1415
1416 2015-08-19  Wenson Hsieh  <wenson_hsieh@apple.com>
1417
1418         Select validation does not correctly work when handling change event
1419         https://bugs.webkit.org/show_bug.cgi?id=145869
1420
1421         Reviewed by Dean Jackson.
1422
1423         When selecting an option in a <select> with validation that also has an onchange listener, calling
1424         checkValidity() for the select within the onchange handler would produce incorrect results and (on
1425         a debug build) crash at an assertion. This is because the change events were being dispatched before
1426         form validity was updated. Making the validation step come before the change event dispatch fixes
1427         this issue.
1428
1429         Test: fast/forms/onchange-select-check-validity.html
1430
1431         * html/HTMLSelectElement.cpp:
1432         (WebCore::HTMLSelectElement::selectOption): Update validity before dispatching change events.
1433
1434 2015-08-19  Jinyoung Hur  <hur.ims@navercorp.com>
1435
1436         GraphicsContext3D::activeTexture should not be called with zero-based index
1437         https://bugs.webkit.org/show_bug.cgi?id=148020
1438
1439         Reviewed by Alex Christensen.
1440
1441         GraphicsContext3D::activeTexture should be called with an argument that is greater than or equal to 
1442         GraphicsContext3D::TEXTURE0.
1443
1444         Test: fast/canvas/webgl/texture-complete.html
1445
1446         * html/canvas/WebGLRenderingContextBase.cpp:
1447         (WebCore::WebGLRenderingContextBase::checkTextureCompleteness):
1448
1449 2015-08-19  Chris Dumez  <cdumez@apple.com>
1450
1451         Avoid double hash lookup in our JS bindings named property getter code
1452         https://bugs.webkit.org/show_bug.cgi?id=148193
1453
1454         Reviewed by Geoffrey Garen.
1455
1456         Avoid double hash lookup in our JS bindings named property getter code
1457         for performance reasons.
1458
1459         * CMakeLists.txt:
1460         * WebCore.xcodeproj/project.pbxproj:
1461         Add new file.
1462
1463         * bindings/js/JSDOMNamedFlowCollectionCustom.cpp: Added.
1464         (WebCore::JSDOMNamedFlowCollection::nameGetter):
1465         Moved custom named getter code for DOMNamedFlowCollection from the
1466         bindings generator to an actual custom bindings file.
1467
1468         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
1469         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
1470         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1471         * bindings/scripts/test/JS/JSTestEventTarget.h:
1472         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1473         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
1474         Rebaseline bindings tests.
1475
1476 2015-08-19  Simon Fraser  <simon.fraser@apple.com>
1477
1478         Add CSS will-change to the feature list
1479         https://bugs.webkit.org/show_bug.cgi?id=148199
1480
1481         Reviewed by Dean Jackson.
1482
1483         * features.json:
1484
1485 2015-08-19  Eric Carlson  <eric.carlson@apple.com>
1486
1487         Remove ENABLE_WEBVTT_REGIONS
1488         https://bugs.webkit.org/show_bug.cgi?id=148184
1489
1490         Reviewed by Jer Noble.
1491
1492         * Configurations/FeatureDefines.xcconfig: Remove ENABLE_WEBVTT_REGIONS.
1493         * html/HTMLMediaElement.cpp:
1494         (WebCore::HTMLMediaElement::textTrackRemoveCue):
1495         * html/shadow/MediaControlElements.cpp:
1496         (WebCore::MediaControlTextTrackContainerElement::updateDisplay):
1497         * html/track/InbandGenericTextTrack.cpp:
1498         (WebCore::InbandGenericTextTrack::newCuesParsed):
1499         (WebCore::InbandGenericTextTrack::newRegionsParsed):
1500         (WebCore::InbandGenericTextTrack::fileFailedToParse):
1501         * html/track/InbandGenericTextTrack.h:
1502         * html/track/InbandWebVTTTextTrack.cpp:
1503         (WebCore::InbandWebVTTTextTrack::newCuesParsed):
1504         (WebCore::InbandWebVTTTextTrack::newRegionsParsed):
1505         (WebCore::InbandWebVTTTextTrack::fileFailedToParse):
1506         * html/track/InbandWebVTTTextTrack.h:
1507         * html/track/LoadableTextTrack.cpp:
1508         (WebCore::LoadableTextTrack::cueLoadingCompleted):
1509         (WebCore::LoadableTextTrack::newRegionsAvailable):
1510         (WebCore::LoadableTextTrack::id):
1511         * html/track/LoadableTextTrack.h:
1512         * html/track/TextTrack.cpp:
1513         (WebCore::TextTrack::TextTrack):
1514         (WebCore::TextTrack::~TextTrack):
1515         (WebCore::TextTrack::removeCue):
1516         (WebCore::TextTrack::ensureVTTRegionList):
1517         (WebCore::TextTrack::removeRegion):
1518         (WebCore::TextTrack::cueWillChange):
1519         * html/track/TextTrack.h:
1520         * html/track/TextTrack.idl:
1521         * html/track/TextTrackCue.cpp:
1522         * html/track/VTTCue.cpp:
1523         (WebCore::VTTCueBox::applyCSSProperties):
1524         (WebCore::VTTCue::createCueRenderingTree):
1525         (WebCore::VTTCue::setRegionId):
1526         (WebCore::VTTCue::notifyRegionWhenRemovingDisplayTree):
1527         (WebCore::VTTCue::setIsActive):
1528         (WebCore::VTTCue::removeDisplayTree):
1529         (WebCore::VTTCue::settingName):
1530         (WebCore::VTTCue::setCueSettings):
1531         (WebCore::VTTCue::getCSSAlignment):
1532         * html/track/VTTCue.h:
1533         (WebCore::VTTCue::regionId):
1534         * html/track/VTTCue.idl:
1535         * html/track/VTTRegion.cpp:
1536         * html/track/VTTRegion.h:
1537         * html/track/VTTRegion.idl:
1538         * html/track/VTTRegionList.cpp:
1539         * html/track/VTTRegionList.h:
1540         * html/track/VTTRegionList.idl:
1541         * html/track/WebVTTParser.cpp:
1542         (WebCore::WebVTTParser::parseFloatPercentageValue):
1543         (WebCore::WebVTTParser::parseFloatPercentageValuePair):
1544         (WebCore::WebVTTParser::WebVTTParser):
1545         (WebCore::WebVTTParser::getNewCues):
1546         (WebCore::WebVTTParser::getNewRegions):
1547         (WebCore::WebVTTParser::parseFileHeader):
1548         (WebCore::WebVTTParser::parse):
1549         (WebCore::WebVTTParser::collectMetadataHeader):
1550         (WebCore::WebVTTParser::collectCueId):
1551         (WebCore::WebVTTParser::resetCueValues):
1552         (WebCore::WebVTTParser::createNewRegion):
1553         (WebCore::WebVTTParser::collectTimeStamp):
1554         * html/track/WebVTTParser.h:
1555         (WebCore::WebVTTParserClient::~WebVTTParserClient):
1556         * loader/TextTrackLoader.cpp:
1557         (WebCore::TextTrackLoader::newCuesParsed):
1558         (WebCore::TextTrackLoader::newRegionsParsed):
1559         (WebCore::TextTrackLoader::fileFailedToParse):
1560         (WebCore::TextTrackLoader::getNewCues):
1561         (WebCore::TextTrackLoader::getNewRegions):
1562         * loader/TextTrackLoader.h:
1563         * rendering/RenderVTTCue.cpp:
1564         (WebCore::RenderVTTCue::layout):
1565
1566 2015-08-19  Brent Fulgham  <bfulgham@apple.com>
1567
1568         Scrollable area container is not properly cleared when page is going into the PageCache
1569         https://bugs.webkit.org/show_bug.cgi?id=148182
1570         <rdar://problem/21969170>
1571
1572         Reviewed by Dean Jackson.
1573
1574         Must be tested manually going back and forth in history several times.
1575
1576         * history/CachedFrame.cpp:
1577         (WebCore::CachedFrame::CachedFrame): Clear the cached ScrollableAreas from the FrameView.
1578         * page/FrameView.cpp:
1579         (WebCore::FrameView::clearScrollableAreas): Added.
1580         * page/FrameView.h:
1581
1582 2015-08-19  Zalan Bujtas  <zalan@apple.com>
1583
1584         outline-style: auto leaves bits behind on strava's flyby view.
1585         https://bugs.webkit.org/show_bug.cgi?id=148178
1586
1587         Reviewed by Simon Fraser.
1588
1589         RenderView::m_maximalOutlineSize should include outline-offset.
1590
1591         Test: fast/repaint/outline-auto-with-width-less-than-focus-ring-width-and-offset-repaint.html
1592
1593         * rendering/RenderElement.cpp:
1594         (WebCore::RenderElement::computeMaxOutlineSize):
1595         * rendering/RenderObject.cpp:
1596         (WebCore::RenderObject::adjustRectForOutlineAndShadow):
1597
1598 2015-08-19  Anders Carlsson  <andersca@apple.com>
1599
1600         Fix errors on bots.
1601
1602         Ask the backend to cleanup and terminate
1603
1604         * Modules/webdatabase/SQLTransaction.cpp:
1605         (WebCore::SQLTransaction::computeNextStateAndCleanupIfNeeded):
1606
1607 2015-08-19  Dean Jackson  <dino@apple.com>
1608
1609         Clean up our CSS files (e.g. remove prefixes)
1610         https://bugs.webkit.org/show_bug.cgi?id=148194
1611         <rdar://problem/22351034>
1612
1613         Reviewed by Brent Fulgham.
1614
1615         A lot of our internal CSS was still using prefixed forms of properties.
1616         As I started cleaning those up, I noticed lots of small things
1617         like missing semicolons and whitespace.
1618
1619         No change in behaviour for testing.
1620
1621         * css/fullscreen.css:
1622         * css/html.css:
1623         * css/mathml.css:
1624         * css/mediaControls.css:
1625         * css/mediaControlsGtk.css:
1626         * css/plugIns.css:
1627
1628 2015-08-19  Zalan Bujtas  <zalan@apple.com>
1629
1630         Cleanup outline-style: auto painting.
1631         https://bugs.webkit.org/show_bug.cgi?id=148159
1632
1633         Reviewed by Simon Fraser.
1634
1635         Old platform style required the focus ring to be painted with an offset. (https://trac.webkit.org/r5358)
1636         (and it has the side effect of growing outline-width adds further, unwanted offset)
1637         Default css for :focus is adjusted to remove this offset by setting the outline-width to 5px
1638         and the outline-offset to -2px. (https://trac.webkit.org/r13639)
1639         This patch removes both the old logic and the workaround for getting rid of the unwanted offset.
1640
1641         Test: fast/repaint/outline-auto-with-default-width-and-offset-repaint.html
1642
1643         * css/html.css:
1644         (:focus):
1645         (input:focus, textarea:focus, isindex:focus, keygen:focus, select:focus): Deleted.
1646         * platform/graphics/mac/GraphicsContextMac.mm:
1647         (WebCore::GraphicsContext::drawFocusRing):
1648         * rendering/RenderElement.cpp:
1649         (WebCore::RenderElement::computeMaxOutlineSize):
1650         (WebCore::RenderElement::paintFocusRing):
1651         (WebCore::RenderElement::paintOutline): Short circuit painting outline when painting is disabled. It
1652         only change behaviour for non-auto outlines -which are anyway not supposed to be painted when painting is disabled.
1653         * rendering/RenderObject.cpp:
1654         (WebCore::RenderObject::adjustRectForOutlineAndShadow):
1655         * rendering/RenderTheme.h:
1656         (WebCore::RenderTheme::platformFocusRingWidth):
1657         (WebCore::RenderTheme::platformFocusRingMaxWidth): Deleted.
1658
1659 2015-08-18  Dean Jackson  <dino@apple.com>
1660
1661         Support CSS filters without webkit prefix
1662         https://bugs.webkit.org/show_bug.cgi?id=148138
1663         <rdar://problem/22331434>
1664
1665         Reviewed by Sam Weinig.
1666
1667         Add support for the un-prefixed form of the CSS filter property.
1668         This was straightforward for the general case on HTML content.
1669         It was a bit more tricky on SVG content, where there already
1670         was an existing "filter" property/attribute. The parsing
1671         code is now shared between SVG and HTML, as is the
1672         computed style output.
1673
1674         Covered by updating the existing tests, and
1675         adding one new test: css3/filters/unprefixed.html
1676
1677         * css/CSSComputedStyleDeclaration.cpp: Rename CSSPropertyWebkitFilter to CSSPropertyFilter.
1678         (WebCore::isLayoutDependent):
1679         (WebCore::ComputedStyleExtractor::propertyValue):
1680
1681         * css/CSSFilterImageValue.cpp:
1682         (WebCore::CSSFilterImageValue::customCSSText): Use "filter(" as the prefix.
1683
1684         * css/CSSParser.cpp:
1685         (WebCore::CSSParser::parseValue): Rename CSSPropertyWebkitFilter to CSSPropertyFilter.
1686         (WebCore::CSSParser::isGeneratedImageValue): Add support for "filter()".
1687         (WebCore::CSSParser::parseGeneratedImage): Ditto.
1688         (WebCore::CSSParser::parseBuiltinFilterArguments):
1689
1690         * css/CSSPropertyNames.in: Add filter. Make -webkit-filter an alias.
1691
1692         * css/SVGCSSComputedStyleDeclaration.cpp:
1693         (WebCore::ComputedStyleExtractor::svgPropertyValue): Deleted.
1694
1695         * page/animation/CSSPropertyAnimation.cpp: Rename CSSPropertyWebkitFilter to CSSPropertyFilter.
1696         (WebCore::PropertyWrapperAcceleratedFilter::PropertyWrapperAcceleratedFilter):
1697         * page/animation/KeyframeAnimation.cpp: Ditto.
1698         (WebCore::KeyframeAnimation::checkForMatchingFilterFunctionLists):
1699
1700         * platform/graphics/GraphicsLayer.cpp: Rename AnimatedPropertyWebkitFilter to AnimatedPropertyFilter.
1701         (WebCore::GraphicsLayer::validateFilterOperations):
1702         * platform/graphics/GraphicsLayerClient.h: Ditto.
1703         * platform/graphics/ca/GraphicsLayerCA.cpp: Ditto.
1704         (WebCore::GraphicsLayerCA::moveOrCopyAnimations):
1705         (WebCore::GraphicsLayerCA::addAnimation):
1706         (WebCore::GraphicsLayerCA::createAnimationFromKeyframes):
1707         (WebCore::GraphicsLayerCA::createFilterAnimationsFromKeyframes):
1708
1709         * rendering/RenderLayer.cpp:
1710         (WebCore::RenderLayer::updateOrRemoveFilterClients): SVG manages its own filter resources,
1711         so we shouldn't add a layer that has an SVG root to the filter clients.
1712
1713         * rendering/RenderLayerBacking.cpp: Renaming.
1714         (WebCore::RenderLayerBacking::startAnimation):
1715         (WebCore::RenderLayerBacking::startTransition):
1716         (WebCore::RenderLayerBacking::graphicsLayerToCSSProperty):
1717         (WebCore::RenderLayerBacking::cssToGraphicsLayerProperty):
1718         * rendering/RenderLayerCompositor.cpp: Ditto.
1719         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation):
1720
1721         * rendering/style/SVGRenderStyle.h: Remove the SVG filter style.
1722         (WebCore::SVGRenderStyle::isolatesBlending): No need to check for hasFilter().
1723         (WebCore::SVGRenderStyle::initialFilterResource): Deleted.
1724         (WebCore::SVGRenderStyle::setFilterResource): Deleted.
1725         (WebCore::SVGRenderStyle::filterResource): Deleted.
1726         (WebCore::SVGRenderStyle::hasFilter): Deleted.
1727
1728         * rendering/style/SVGRenderStyleDefs.cpp: Remove the filter resource.
1729         (WebCore::StyleResourceData::StyleResourceData): Deleted.
1730         (WebCore::StyleResourceData::operator==): Deleted.
1731         * rendering/style/SVGRenderStyleDefs.h:
1732
1733         * rendering/style/WillChangeData.cpp: Renaming.
1734         (WebCore::propertyCreatesStackingContext):
1735         (WebCore::propertyTriggersCompositing):
1736
1737         * rendering/svg/SVGRenderSupport.cpp:
1738         (WebCore::SVGRenderSupport::isolatesBlending): Since SVGRenderStyle no longer checks
1739         hasFilter() in its isolatesBlending(), we need to do it here.
1740
1741         * rendering/svg/SVGRenderingContext.cpp:
1742         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
1743
1744         * rendering/svg/SVGRenderTreeAsText.cpp:
1745         (WebCore::writeResources): Dump from the CSS style value.
1746         * rendering/svg/SVGResources.cpp: Ditto.
1747         (WebCore::SVGResources::buildCachedResources):
1748         * rendering/svg/SVGResources.h:
1749         * rendering/svg/SVGResourcesCache.cpp:
1750         (WebCore::SVGResourcesCache::addResourcesFromRenderer):
1751
1752         * platform/graphics/texmap/TextureMapperLayer.cpp: Renaming.
1753         * platform/graphics/texmap/TextureMapperAnimation.cpp:
1754         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1755
1756 2015-08-18  Anders Carlsson  <andersca@apple.com>
1757
1758         More work on simplifying the WebSQL code
1759         https://bugs.webkit.org/show_bug.cgi?id=148145
1760
1761         Reviewed by Tim Horton.
1762
1763         Eliminate SQLTransaction::sendToBackendState.
1764
1765         * Modules/webdatabase/SQLTransaction.cpp:
1766         (WebCore::SQLTransaction::stateFunctionFor):
1767         Change sendToBackendState to unreachableState,
1768
1769         (WebCore::SQLTransaction::deliverTransactionCallback):
1770         Call deliverTransactionErrorCallback directly and schedule RunStatements on the backend.
1771
1772         (WebCore::SQLTransaction::deliverTransactionErrorCallback):
1773         Schedule CleanupAfterTransactionErrorCallback on the backend.
1774
1775         (WebCore::SQLTransaction::deliverStatementCallback):
1776         Fold nextStateForTransactionError into here. Schedule backend states explicitly.
1777
1778         (WebCore::SQLTransaction::deliverQuotaIncreaseCallback):
1779         Schedule RunStatements on the backend.
1780
1781         (WebCore::SQLTransaction::deliverSuccessCallback):
1782         Schedule CleanupAndTerminate on the backend.
1783
1784         (WebCore::SQLTransaction::computeNextStateAndCleanupIfNeeded):
1785         The return value of this function isn't used to make it return void.
1786
1787         (WebCore::SQLTransaction::nextStateForTransactionError): Deleted.
1788         Remove this, it's been folded into deliverStatementCallback.
1789
1790         (WebCore::SQLTransaction::sendToBackendState): Deleted.
1791         Get rid of this.
1792
1793         * Modules/webdatabase/SQLTransaction.h:
1794         Update member functions.
1795
1796         * Modules/webdatabase/SQLTransactionBackend.cpp:
1797         (WebCore::SQLTransactionBackend::openTransactionAndPreflight):
1798         Just call runStatements() directly.
1799
1800         (WebCore::SQLTransactionBackend::cleanupAfterTransactionErrorCallback):
1801         Just call cleanupAndTerminate() directly.
1802
1803         (WebCore::SQLTransactionBackend::shouldPerformWhilePaused): Deleted.
1804         Get rid of an iOS member function that's no longer used.
1805
1806         * Modules/webdatabase/SQLTransactionBackend.h:
1807         Remove member function.
1808
1809 2015-08-18  Filip Pizlo  <fpizlo@apple.com>
1810
1811         Replace all uses of std::mutex/std::condition_variable with WTF::Lock/WTF::Condition
1812         https://bugs.webkit.org/show_bug.cgi?id=148140
1813
1814         Reviewed by Geoffrey Garen.
1815
1816         No new tests because no new behavior.
1817
1818         * Modules/webaudio/AudioBufferSourceNode.cpp:
1819         (WebCore::AudioBufferSourceNode::process):
1820         (WebCore::AudioBufferSourceNode::setBuffer):
1821         * Modules/webaudio/AudioBufferSourceNode.h:
1822         * Modules/webaudio/AudioParamTimeline.cpp:
1823         (WebCore::AudioParamTimeline::insertEvent):
1824         (WebCore::AudioParamTimeline::cancelScheduledValues):
1825         (WebCore::AudioParamTimeline::valueForContextTime):
1826         (WebCore::AudioParamTimeline::valuesForTimeRange):
1827         * Modules/webaudio/AudioParamTimeline.h:
1828         * Modules/webaudio/ConvolverNode.cpp:
1829         (WebCore::ConvolverNode::process):
1830         (WebCore::ConvolverNode::reset):
1831         (WebCore::ConvolverNode::setBuffer):
1832         * Modules/webaudio/ConvolverNode.h:
1833         * Modules/webaudio/MediaElementAudioSourceNode.cpp:
1834         (WebCore::MediaElementAudioSourceNode::process):
1835         * Modules/webaudio/MediaElementAudioSourceNode.h:
1836         * Modules/webaudio/MediaStreamAudioSourceNode.cpp:
1837         (WebCore::MediaStreamAudioSourceNode::setFormat):
1838         (WebCore::MediaStreamAudioSourceNode::process):
1839         * Modules/webaudio/MediaStreamAudioSourceNode.h:
1840         * Modules/webaudio/OscillatorNode.cpp:
1841         (WebCore::OscillatorNode::process):
1842         (WebCore::OscillatorNode::setPeriodicWave):
1843         * Modules/webaudio/OscillatorNode.h:
1844         * Modules/webaudio/PannerNode.cpp:
1845         (WebCore::PannerNode::process):
1846         (WebCore::PannerNode::setPanningModel):
1847         * Modules/webaudio/PannerNode.h:
1848         * Modules/webaudio/WaveShaperProcessor.cpp:
1849         (WebCore::WaveShaperProcessor::setCurve):
1850         (WebCore::WaveShaperProcessor::setOversample):
1851         (WebCore::WaveShaperProcessor::process):
1852         * Modules/webaudio/WaveShaperProcessor.h:
1853         * Modules/webdatabase/Database.cpp:
1854         (WebCore::retrieveTextResultFromDatabase):
1855         (WebCore::guidToVersionMap):
1856         (WebCore::Database::Database):
1857         (WebCore::Database::performOpenAndVerify):
1858         (WebCore::Database::closeDatabase):
1859         (WebCore::Database::getCachedVersion):
1860         (WebCore::Database::setCachedVersion):
1861         (WebCore::guidMutex): Deleted.
1862         * Modules/webdatabase/DatabaseManager.cpp:
1863         (WebCore::DatabaseManager::existingDatabaseContextFor):
1864         (WebCore::DatabaseManager::registerDatabaseContext):
1865         (WebCore::DatabaseManager::unregisterDatabaseContext):
1866         (WebCore::DatabaseManager::didConstructDatabaseContext):
1867         (WebCore::DatabaseManager::didDestructDatabaseContext):
1868         (WebCore::DatabaseManager::addProposedDatabase):
1869         (WebCore::DatabaseManager::removeProposedDatabase):
1870         (WebCore::DatabaseManager::fullPathForDatabase):
1871         (WebCore::DatabaseManager::detailsForNameAndOrigin):
1872         * Modules/webdatabase/DatabaseManager.h:
1873         * bindings/objc/DOMInternal.mm:
1874         (getDOMWrapper):
1875         (addDOMWrapper):
1876         (removeDOMWrapper):
1877         (wrapperCacheLock): Deleted.
1878         * crypto/CryptoAlgorithmRegistry.cpp:
1879         (WebCore::CryptoAlgorithmRegistry::singleton):
1880         (WebCore::CryptoAlgorithmRegistry::CryptoAlgorithmRegistry):
1881         (WebCore::CryptoAlgorithmRegistry::getIdentifierForName):
1882         (WebCore::CryptoAlgorithmRegistry::nameForIdentifier):
1883         (WebCore::CryptoAlgorithmRegistry::create):
1884         (WebCore::CryptoAlgorithmRegistry::registerAlgorithm):
1885         (WebCore::registryMutex): Deleted.
1886         * inspector/WorkerDebuggerAgent.cpp:
1887         (WebCore::WorkerDebuggerAgent::WorkerDebuggerAgent):
1888         (WebCore::WorkerDebuggerAgent::~WorkerDebuggerAgent):
1889         (WebCore::WorkerDebuggerAgent::interruptAndDispatchInspectorCommands):
1890         * page/WheelEventTestTrigger.cpp:
1891         (WebCore::WheelEventTestTrigger::clearAllTestDeferrals):
1892         (WebCore::WheelEventTestTrigger::setTestCallbackAndStartNotificationTimer):
1893         (WebCore::WheelEventTestTrigger::deferTestsForReason):
1894         (WebCore::WheelEventTestTrigger::removeTestDeferralForReason):
1895         (WebCore::WheelEventTestTrigger::triggerTestTimerFired):
1896         * page/WheelEventTestTrigger.h:
1897         * page/scrolling/ScrollingThread.cpp:
1898         (WebCore::ScrollingThread::dispatch):
1899         (WebCore::ScrollingThread::createThreadIfNeeded):
1900         (WebCore::ScrollingThread::dispatchFunctionsFromScrollingThread):
1901         * page/scrolling/ScrollingThread.h:
1902         * page/scrolling/mac/ScrollingThreadMac.mm:
1903         (WebCore::ScrollingThread::initializeRunLoop):
1904         * platform/audio/ReverbConvolver.cpp:
1905         (WebCore::ReverbConvolver::~ReverbConvolver):
1906         (WebCore::ReverbConvolver::backgroundThreadEntry):
1907         (WebCore::ReverbConvolver::process):
1908         (WebCore::ReverbConvolver::reset):
1909         * platform/audio/ReverbConvolver.h:
1910         * platform/ios/wak/WebCoreThreadRun.cpp:
1911         * platform/mac/Language.mm:
1912         (WebCore::preferredLanguages):
1913         (+[WebLanguageChangeObserver languagePreferencesDidChange:]):
1914         (WebCore::platformUserPreferredLanguages):
1915         (WebCore::preferredLanguagesMutex): Deleted.
1916         * platform/network/cf/LoaderRunLoopCF.cpp:
1917         (WebCore::emptyPerform):
1918         (WebCore::runLoaderThread):
1919         (WebCore::loaderRunLoop):
1920         (WebCore::loaderRunLoopMutex): Deleted.
1921         (WebCore::loaderRunLoopConditionVariable): Deleted.
1922         * platform/network/cf/SocketStreamHandleCFNet.cpp:
1923         (WebCore::callOnMainThreadAndWait):
1924         * platform/network/curl/SocketStreamHandle.h:
1925         * platform/network/curl/SocketStreamHandleCurl.cpp:
1926         (WebCore::SocketStreamHandle::platformSend):
1927         (WebCore::SocketStreamHandle::sendData):
1928         * platform/sql/SQLiteDatabaseTracker.cpp:
1929         (WebCore::SQLiteDatabaseTracker::setClient):
1930         (WebCore::SQLiteDatabaseTracker::incrementTransactionInProgressCount):
1931         (WebCore::SQLiteDatabaseTracker::decrementTransactionInProgressCount):
1932         (WebCore::SQLiteDatabaseTracker::transactionInProgressMutex): Deleted.
1933         * platform/text/TextBreakIterator.cpp:
1934         (WebCore::compareAndSwapNonSharedCharacterBreakIterator):
1935         * platform/text/TextEncodingRegistry.cpp:
1936         (WebCore::newTextCodec):
1937         (WebCore::atomicCanonicalTextEncodingName):
1938         (WebCore::dumpTextEncodingNameMap):
1939         (WebCore::encodingRegistryMutex): Deleted.
1940         * workers/WorkerThread.cpp:
1941         (WebCore::workerThreads):
1942         (WebCore::WorkerThread::workerThreadCount):
1943         (WebCore::WorkerThread::WorkerThread):
1944         (WebCore::WorkerThread::~WorkerThread):
1945         (WebCore::WorkerThread::releaseFastMallocFreeMemoryInAllThreads):
1946         (WebCore::threadSetMutex): Deleted.
1947
1948 2015-08-18  Wenson Hsieh  <wenson_hsieh@apple.com>
1949
1950         Scroll snapping should trigger when receiving a momentum end wheel event
1951         https://bugs.webkit.org/show_bug.cgi?id=148155
1952
1953         Reviewed by Alexey Proskuryakov.
1954
1955         No new tests, since the purpose of this patch is to get existing tests to pass when
1956         allowing similar wheel events to coalesce. To accomplish this, we relax our assumption
1957         that the user must have generated at least 3 momentum wheel events in order for the
1958         gliding animation to trigger. Upon receiving a wheel event indicating the end of the
1959         momentum phase, we now kick off the gliding animation as long as any momentum event
1960         was tracked earlier in the gesture with a nonzero wheel delta.
1961
1962         * platform/cocoa/ScrollController.mm:
1963         (WebCore::ScrollController::processWheelEventForScrollSnapOnAxis): Added logic to
1964             begin a glide animation if we have received a momentum end event but have not
1965             yet triggered a gliding animation.
1966         * platform/cocoa/ScrollSnapAnimatorState.h:
1967         * platform/cocoa/ScrollSnapAnimatorState.mm:
1968         (WebCore::ScrollSnapAnimatorState::wheelDeltaTrackingIsInProgress): Minor refactoring
1969             to make the wheel event processing code more readable.
1970         (WebCore::ScrollSnapAnimatorState::hasFinishedTrackingWheelDeltas): Ditto.
1971
1972 2015-08-18  Myles C. Maxfield  <mmaxfield@apple.com>
1973
1974         [Cocoa] Punctuation near Hindi text is garbled when styled with the system font
1975         https://bugs.webkit.org/show_bug.cgi?id=148164
1976
1977         Reviewed by Brian Burg.
1978
1979         Fonts cache whether or not they are the system font. This caching took place at the end of Font::platformInit().
1980         However, in the middle of Font::platformInit(), we look up a glyph, which calls GlyphPage::fill() which consults
1981         with this cache. However, at this point, the cache has not been constructed yet. The solution is just to
1982         construct the cache earlier (at the beginning of the function).
1983
1984         Consulting with the cache before it is populated causes it to erroneously say that no fonts are system fonts.
1985         Then, we use Core Graphics to ask for glyphs instead of Core Text. Core Graphics, however, is incapable of
1986         handling the system font, and returns us garbled results. In particular, when the system language is set to
1987         Japanese, the system font does not support punctuation, and Core Text tells us so. However, Core Graphics
1988         erroneously tells us that the system font does support punctuation.
1989
1990         Then, if text is near the punctuation which causes us to take the complex text codepath (such as Hindi text),
1991         we tell Core Text to explicitly lay out the punctuation using the system font (which does not support
1992         punctuation). Core Text then replies that the provided font doesn't support the punctuation, and that we should
1993         use LastResort with some other glyphs instead. WebKit then disregards the font CoreText told us to use (because
1994         we are oh-so-sure that the font in question supports punctuation) and uses the LastResort glyph IDs with our
1995         font, which causes arbitrary glyphs to be shown.
1996
1997         Test: fast/text/hindi-system-font-punctuation.html
1998
1999         * platform/graphics/cocoa/FontCocoa.mm:
2000         (WebCore::Font::platformInit):
2001
2002 2015-08-18  Joseph Pecoraro  <pecoraro@apple.com>
2003
2004         Web Inspector: Links for rules in <style> are incorrect, do not account for <style> offset in the document
2005         https://bugs.webkit.org/show_bug.cgi?id=148141
2006
2007         Reviewed by Brian Burg.
2008
2009         Test: inspector/css/getAllStyleSheets.html
2010
2011         * css/CSSStyleSheet.h:
2012         * css/CSSStyleSheet.cpp:
2013         (WebCore::CSSStyleSheet::create):
2014         (WebCore::CSSStyleSheet::createInline):
2015         (WebCore::CSSStyleSheet::CSSStyleSheet):
2016         Include the starting position when created by the Parser.
2017         Default to the minimum position, which should never be
2018         possible for an inline <style> because the "<style>" characters
2019         themselves require at least some offset.
2020
2021         * dom/InlineStyleSheetOwner.cpp:
2022         (WebCore::InlineStyleSheetOwner::createSheet):
2023         Provide the start position offset for this stylesheet if it was inline.
2024
2025         * inspector/InspectorStyleSheet.cpp:
2026         (WebCore::InspectorStyleSheet::buildObjectForStyleSheetInfo):
2027         Include new protocol values for the style sheet.
2028
2029 2015-08-18  Dean Jackson  <dino@apple.com>
2030
2031         Add null check in ImageBufferData::getData
2032         https://bugs.webkit.org/show_bug.cgi?id=148156
2033         <rdar://problem/22337157>
2034
2035         Reviewed by Simon Fraser.
2036
2037         We're getting a number of crash reports that suggest the allocation
2038         of the result buffer has failed, but have been unable to reproduce.
2039         This patch adds a null check to the allocation, and logs a message
2040         to the system console. This might avoid the crashes, and hopefully
2041         we'll see the message.
2042
2043         No new tests, since we're unable to reproduce this crash.
2044
2045         * platform/graphics/cg/ImageBufferDataCG.cpp:
2046         (WebCore::ImageBufferData::getData): Add a null-check and early
2047         return.
2048
2049 2015-08-18  Chris Dumez  <cdumez@apple.com>
2050
2051         Use CSSValuePool::singleton() instead of cssValuePool()
2052         https://bugs.webkit.org/show_bug.cgi?id=148132
2053
2054         Reviewed by Simon Fraser.
2055
2056         Use CSSValuePool::singleton() instead of cssValuePool() to access the
2057         global CSSValuePool instance, as per coding style.
2058
2059 2015-08-17  Matt Rajca  <mrajca@apple.com>
2060
2061         Media Session: don't begin listening for interruptions when an interruption provider is created
2062         https://bugs.webkit.org/show_bug.cgi?id=148109
2063
2064         Reviewed by Eric Carlson.
2065
2066         If we call `beginListeningForInterruption` in MediaSessionInterruptionProvider's constructor, the current
2067         class's implementation will get called, not implementations provided by subclasses (this makes sense since base
2068         classes are initialized before derived classes). To fix this, we let clients of
2069         MediaSessionInterruptionProvider start listening for interruptions instead. As a corollary of this, we can
2070         make MediaSessionInterruptionProvider's methods pure virtual.
2071
2072         * Modules/mediasession/MediaSessionManager.cpp:
2073         (WebCore::MediaSessionManager::MediaSessionManager):
2074         * platform/mediasession/MediaSessionInterruptionProvider.h:
2075         * platform/mediasession/MediaSessionInterruptionProvider.cpp:
2076         (WebCore::MediaSessionInterruptionProvider::MediaSessionInterruptionProvider):
2077
2078 2015-08-18  Eric Carlson  <eric.carlson@apple.com>
2079
2080         Remove "platform text track menu"
2081         https://bugs.webkit.org/show_bug.cgi?id=148139
2082
2083         Reviewed by Jer Noble.
2084
2085         No new tests, this patch removes unused code.
2086
2087         * WebCore.xcodeproj/project.pbxproj: Remove PlatformTextTrackMenu.h.
2088         * html/HTMLMediaElement.cpp:
2089         (WebCore::HTMLMediaElement::scheduleDelayedAction): Remove PLATFORM_TEXT_TRACK_MENU.
2090         (WebCore::HTMLMediaElement::pendingActionTimerFired):
2091         (WebCore::HTMLMediaElement::textTrackModeChanged):
2092         (WebCore::HTMLMediaElement::mediaPlayerDidRemoveVideoTrack):
2093         (WebCore::HTMLMediaElement::closeCaptionTracksChanged):
2094         (WebCore::HTMLMediaElement::addAudioTrack):
2095         (WebCore::HTMLMediaElement::clearMediaPlayer):
2096         (WebCore::HTMLMediaElement::setSelectedTextTrack): Deleted.
2097         (WebCore::HTMLMediaElement::platformTextTracks): Deleted.
2098         (WebCore::HTMLMediaElement::notifyMediaPlayerOfTextTrackChanges): Deleted.
2099         (WebCore::HTMLMediaElement::platformTextTrackMenu): Deleted.
2100         * html/HTMLMediaElement.h:
2101         (WebCore::HTMLMediaElement::player):
2102         * html/track/InbandTextTrack.h:
2103         * html/track/TextTrack.cpp:
2104         (WebCore::TextTrack::hasCue):
2105         (WebCore::TextTrack::isMainProgramContent):
2106         (WebCore::TextTrack::platformTextTrack): Deleted.
2107         * html/track/TextTrack.h:
2108         (WebCore::TextTrack::create):
2109         * platform/graphics/MediaPlayer.cpp:
2110         (WebCore::MediaPlayer::resetMediaEngines):
2111         (WebCore::MediaPlayer::implementsTextTrackControls): Deleted.
2112         (WebCore::MediaPlayer::textTrackMenu): Deleted.
2113         * platform/graphics/MediaPlayer.h:
2114         * platform/graphics/MediaPlayerPrivate.h:
2115         (WebCore::MediaPlayerPrivateInterface::tracksChanged):
2116         (WebCore::MediaPlayerPrivateInterface::simulateAudioInterruption):
2117         (WebCore::MediaPlayerPrivateInterface::implementsTextTrackControls): Deleted.
2118         (WebCore::MediaPlayerPrivateInterface::textTrackMenu): Deleted.
2119         * platform/graphics/PlatformTextTrack.h:
2120         * platform/graphics/PlatformTextTrackMenu.h: Removed.
2121
2122 2015-08-18  Wenson Hsieh  <wenson_hsieh@apple.com>
2123
2124         Search input results and clear icons are misaligned when padding is added
2125         https://bugs.webkit.org/show_bug.cgi?id=148146
2126         <rdar://problem/22310951>
2127
2128         Reviewed by Zalan Bujtas.
2129
2130         Use content box rect to determine where to draw the results and cancel buttons
2131         of a search field that has -webkit-appearance: textfield. Previously, we used
2132         the bounding box, which caused the buttons to render in the input's padding
2133         region.
2134
2135         Test: platform/mac/fast/forms/search/search-padding-cancel-results-buttons.html
2136
2137         * rendering/RenderThemeMac.mm:
2138         (WebCore::RenderThemeMac::paintSearchFieldCancelButton): Use content box to
2139             compute where to render cancel button.
2140         (WebCore::RenderThemeMac::paintSearchFieldResultsButton): Use content box to
2141             compute where to render results button.
2142
2143 2015-08-18  Dean Jackson  <dino@apple.com>
2144
2145         CAOpenGLLayer doesn't need an SPI declaration
2146         https://bugs.webkit.org/show_bug.cgi?id=148151
2147
2148         Reviewed by Tim Horton.
2149
2150         Follow-up to https://trac.webkit.org/r188608.
2151         The property is in the public SDK, so we don't need
2152         to declare it.
2153
2154         * platform/spi/cocoa/QuartzCoreSPI.h:
2155
2156 2015-08-18  Myles C. Maxfield  <mmaxfield@apple.com>
2157
2158         [El Capitan] Fix the open source build
2159         https://bugs.webkit.org/show_bug.cgi?id=148134
2160
2161         Reviewed by Anders Carlsson.
2162
2163         No new tests because there is no behavior change.
2164
2165         Need to declare CGFontRenderingStyle.
2166
2167         * platform/spi/cocoa/CoreTextSPI.h:
2168
2169 2015-08-18  Dean Jackson  <dino@apple.com>
2170
2171         CAOpenGLLayer needs a named class extension for non-internal installs
2172         https://bugs.webkit.org/show_bug.cgi?id=148151
2173         <rdar://problem/22335111>
2174
2175         Reviewed by Tim Horton.
2176
2177         In order to build using the public SDK on El Capitan, we can't
2178         use a class extension to declare this SPI.
2179
2180         No change in behaviour, so no new tests.
2181
2182         * platform/spi/cocoa/QuartzCoreSPI.h:
2183
2184 2015-08-18  Simon Fraser  <simon.fraser@apple.com>
2185
2186         will-change: backface-visibility should not cause stacking context
2187         https://bugs.webkit.org/show_bug.cgi?id=148091
2188
2189         Reviewed by Zalan Bujtas.
2190         
2191         Take CSSPropertyWebkitBackfaceVisibility out of the list of properties that causes
2192         will-change to create stacking context, since no value of the property creates
2193         stacking.
2194
2195         Move willChangeCreatesStackingContext() and shouldWillChangeCreateStackingContext()
2196         into RenderInline since it's only called from there.
2197
2198         * rendering/RenderElement.cpp:
2199         (WebCore::RenderElement::shouldWillChangeCreateStackingContext): Deleted.
2200         * rendering/RenderElement.h:
2201         (WebCore::RenderElement::willChangeCreatesStackingContext): Deleted.
2202         * rendering/RenderInline.h:
2203         (WebCore::RenderInline::willChangeCreatesStackingContext):
2204         * rendering/style/WillChangeData.cpp:
2205         (WebCore::propertyCreatesStackingContext): Deleted.
2206
2207 2015-08-18  Alex Christensen  <achristensen@webkit.org>
2208
2209         Unreviewed, fix the cairo build after r188594.
2210
2211         * platform/network/curl/CurlDownload.h:
2212         * platform/network/curl/ResourceHandleManager.cpp:
2213         Include Lock.h
2214
2215 2015-08-18  Filip Pizlo  <fpizlo@apple.com>
2216
2217         Unreviewed, fix the cairo build.
2218
2219         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
2220
2221 2015-08-17  Filip Pizlo  <fpizlo@apple.com>
2222
2223         Replace all remaining uses of WTF::Mutex with WTF::Lock
2224         https://bugs.webkit.org/show_bug.cgi?id=148089
2225
2226         Reviewed by Geoffrey Garen.
2227
2228         No new tests because no new behavior.
2229
2230         * Modules/webaudio/AsyncAudioDecoder.cpp:
2231         (WebCore::AsyncAudioDecoder::AsyncAudioDecoder):
2232         (WebCore::AsyncAudioDecoder::runLoop):
2233         * Modules/webaudio/AsyncAudioDecoder.h:
2234         * Modules/webaudio/AudioContext.h:
2235         * Modules/webaudio/MediaStreamAudioSource.cpp:
2236         (WebCore::MediaStreamAudioSource::addAudioConsumer):
2237         (WebCore::MediaStreamAudioSource::removeAudioConsumer):
2238         (WebCore::MediaStreamAudioSource::setAudioFormat):
2239         (WebCore::MediaStreamAudioSource::consumeAudio):
2240         * Modules/webaudio/MediaStreamAudioSource.h:
2241         * Modules/webdatabase/Database.cpp:
2242         (WebCore::Database::close):
2243         (WebCore::Database::runTransaction):
2244         (WebCore::Database::inProgressTransactionCompleted):
2245         (WebCore::Database::hasPendingTransaction):
2246         * Modules/webdatabase/Database.h:
2247         * Modules/webdatabase/DatabaseTask.cpp:
2248         (WebCore::DatabaseTaskSynchronizer::taskCompleted):
2249         * Modules/webdatabase/DatabaseTask.h:
2250         * Modules/webdatabase/DatabaseThread.cpp:
2251         (WebCore::DatabaseThread::start):
2252         (WebCore::DatabaseThread::databaseThread):
2253         * Modules/webdatabase/DatabaseThread.h:
2254         * Modules/webdatabase/DatabaseTracker.cpp:
2255         (WebCore::DatabaseTracker::setDatabaseDirectoryPath):
2256         (WebCore::DatabaseTracker::canEstablishDatabase):
2257         (WebCore::DatabaseTracker::retryCanEstablishDatabase):
2258         (WebCore::DatabaseTracker::hasEntryForOrigin):
2259         (WebCore::DatabaseTracker::getMaxSizeForDatabase):
2260         (WebCore::DatabaseTracker::closeAllDatabases):
2261         (WebCore::DatabaseTracker::fullPathForDatabase):
2262         (WebCore::DatabaseTracker::origins):
2263         (WebCore::DatabaseTracker::databaseNamesForOrigin):
2264         (WebCore::DatabaseTracker::detailsForNameAndOrigin):
2265         (WebCore::DatabaseTracker::setDatabaseDetails):
2266         (WebCore::DatabaseTracker::doneCreatingDatabase):
2267         (WebCore::DatabaseTracker::addOpenDatabase):
2268         (WebCore::DatabaseTracker::removeOpenDatabase):
2269         (WebCore::DatabaseTracker::getOpenDatabases):
2270         (WebCore::DatabaseTracker::originLockFor):
2271         (WebCore::DatabaseTracker::quotaForOrigin):
2272         (WebCore::DatabaseTracker::setQuota):
2273         (WebCore::DatabaseTracker::deleteOrigin):
2274         (WebCore::DatabaseTracker::deleteDatabase):
2275         (WebCore::DatabaseTracker::deleteDatabaseFile):
2276         (WebCore::DatabaseTracker::removeDeletedOpenedDatabases):
2277         (WebCore::DatabaseTracker::deleteDatabaseFileIfEmpty):
2278         (WebCore::DatabaseTracker::openDatabaseMutex):
2279         (WebCore::DatabaseTracker::setClient):
2280         (WebCore::notificationMutex):
2281         (WebCore::DatabaseTracker::scheduleNotifyDatabaseChanged):
2282         (WebCore::DatabaseTracker::notifyDatabasesChanged):
2283         * Modules/webdatabase/DatabaseTracker.h:
2284         * Modules/webdatabase/OriginLock.h:
2285         * Modules/webdatabase/SQLCallbackWrapper.h:
2286         (WebCore::SQLCallbackWrapper::clear):
2287         (WebCore::SQLCallbackWrapper::unwrap):
2288         (WebCore::SQLCallbackWrapper::hasCallback):
2289         * Modules/webdatabase/SQLTransactionBackend.cpp:
2290         (WebCore::SQLTransactionBackend::doCleanup):
2291         (WebCore::SQLTransactionBackend::enqueueStatementBackend):
2292         (WebCore::SQLTransactionBackend::getNextStatement):
2293         * Modules/webdatabase/SQLTransactionBackend.h:
2294         * bindings/js/WorkerScriptController.cpp:
2295         (WebCore::WorkerScriptController::scheduleExecutionTermination):
2296         (WebCore::WorkerScriptController::isExecutionTerminating):
2297         * bindings/js/WorkerScriptController.h:
2298         * dom/default/PlatformMessagePortChannel.cpp:
2299         (WebCore::MessagePortChannel::postMessageToRemote):
2300         (WebCore::MessagePortChannel::tryGetMessageFromRemote):
2301         (WebCore::MessagePortChannel::isConnectedTo):
2302         (WebCore::MessagePortChannel::hasPendingActivity):
2303         (WebCore::MessagePortChannel::locallyEntangledPort):
2304         (WebCore::PlatformMessagePortChannel::setRemotePort):
2305         (WebCore::PlatformMessagePortChannel::entangledChannel):
2306         (WebCore::PlatformMessagePortChannel::closeInternal):
2307         * dom/default/PlatformMessagePortChannel.h:
2308         * loader/icon/IconDatabase.cpp:
2309         (WebCore::IconDatabase::removeAllIcons):
2310         (WebCore::IconDatabase::synchronousIconForPageURL):
2311         (WebCore::IconDatabase::synchronousNativeIconForPageURL):
2312         (WebCore::IconDatabase::synchronousIconURLForPageURL):
2313         (WebCore::IconDatabase::retainIconForPageURL):
2314         (WebCore::IconDatabase::performRetainIconForPageURL):
2315         (WebCore::IconDatabase::releaseIconForPageURL):
2316         (WebCore::IconDatabase::performReleaseIconForPageURL):
2317         (WebCore::IconDatabase::setIconDataForIconURL):
2318         (WebCore::IconDatabase::setIconURLForPageURL):
2319         (WebCore::IconDatabase::synchronousLoadDecisionForIconURL):
2320         (WebCore::IconDatabase::synchronousIconDataKnownForIconURL):
2321         (WebCore::IconDatabase::pageURLMappingCount):
2322         (WebCore::IconDatabase::retainedPageURLCount):
2323         (WebCore::IconDatabase::iconRecordCount):
2324         (WebCore::IconDatabase::iconRecordCountWithData):
2325         (WebCore::IconDatabase::wakeSyncThread):
2326         (WebCore::IconDatabase::scheduleOrDeferSyncTimer):
2327         (WebCore::IconDatabase::isOpenBesidesMainThreadCallbacks):
2328         (WebCore::IconDatabase::databasePath):
2329         (WebCore::IconDatabase::getOrCreatePageURLRecord):
2330         (WebCore::IconDatabase::iconDatabaseSyncThread):
2331         (WebCore::IconDatabase::performOpenInitialization):
2332         (WebCore::IconDatabase::performURLImport):
2333         (WebCore::IconDatabase::syncThreadMainLoop):
2334         (WebCore::IconDatabase::performPendingRetainAndReleaseOperations):
2335         (WebCore::IconDatabase::readFromDatabase):
2336         (WebCore::IconDatabase::writeToDatabase):
2337         (WebCore::IconDatabase::pruneUnretainedIcons):
2338         (WebCore::IconDatabase::cleanupSyncThread):
2339         * loader/icon/IconDatabase.h:
2340         * page/scrolling/ScrollingTree.cpp:
2341         (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
2342         (WebCore::ScrollingTree::commitNewTreeState):
2343         (WebCore::ScrollingTree::setMainFramePinState):
2344         (WebCore::ScrollingTree::mainFrameScrollPosition):
2345         (WebCore::ScrollingTree::setMainFrameScrollPosition):
2346         (WebCore::ScrollingTree::isPointInNonFastScrollableRegion):
2347         (WebCore::ScrollingTree::isRubberBandInProgress):
2348         (WebCore::ScrollingTree::setMainFrameIsRubberBanding):
2349         (WebCore::ScrollingTree::isScrollSnapInProgress):
2350         (WebCore::ScrollingTree::setMainFrameIsScrollSnapping):
2351         (WebCore::ScrollingTree::setCanRubberBandState):
2352         (WebCore::ScrollingTree::rubberBandsAtLeft):
2353         (WebCore::ScrollingTree::rubberBandsAtRight):
2354         (WebCore::ScrollingTree::rubberBandsAtBottom):
2355         (WebCore::ScrollingTree::rubberBandsAtTop):
2356         (WebCore::ScrollingTree::setScrollPinningBehavior):
2357         (WebCore::ScrollingTree::scrollPinningBehavior):
2358         (WebCore::ScrollingTree::willWheelEventStartSwipeGesture):
2359         (WebCore::ScrollingTree::latchedNode):
2360         (WebCore::ScrollingTree::setLatchedNode):
2361         (WebCore::ScrollingTree::clearLatchedNode):
2362         * page/scrolling/ScrollingTree.h:
2363         * platform/MemoryPressureHandler.h:
2364         * platform/audio/HRTFDatabaseLoader.cpp:
2365         (WebCore::HRTFDatabaseLoader::loadAsynchronously):
2366         (WebCore::HRTFDatabaseLoader::waitForLoaderThreadCompletion):
2367         * platform/audio/HRTFDatabaseLoader.h:
2368         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
2369         (WebCore::MemoryPressureHandler::setReceivedMemoryPressure):
2370         (WebCore::MemoryPressureHandler::clearMemoryPressure):
2371         (WebCore::MemoryPressureHandler::shouldWaitForMemoryClearMessage):
2372         (WebCore::MemoryPressureHandler::respondToMemoryPressureIfNeeded):
2373         * platform/graphics/DisplayRefreshMonitor.cpp:
2374         (WebCore::DisplayRefreshMonitor::displayDidRefresh):
2375         * platform/graphics/DisplayRefreshMonitor.h:
2376         (WebCore::DisplayRefreshMonitor::setMonotonicAnimationStartTime):
2377         (WebCore::DisplayRefreshMonitor::mutex):
2378         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
2379         (WebCore::MediaPlayerPrivateAVFoundation::setDelayCallbacks):
2380         (WebCore::MediaPlayerPrivateAVFoundation::clearMainThreadPendingFlag):
2381         (WebCore::MediaPlayerPrivateAVFoundation::dispatchNotification):
2382         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
2383         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2384         (WebCore::AVFWrapper::callbackContext):
2385         (WebCore::AVFWrapper::~AVFWrapper):
2386         (WebCore::AVFWrapper::mapLock):
2387         (WebCore::AVFWrapper::addToMap):
2388         (WebCore::AVFWrapper::removeFromMap):
2389         (WebCore::AVFWrapper::periodicTimeObserverCallback):
2390         (WebCore::AVFWrapper::processNotification):
2391         (WebCore::AVFWrapper::loadPlayableCompletionCallback):
2392         (WebCore::AVFWrapper::loadMetadataCompletionCallback):
2393         (WebCore::AVFWrapper::seekCompletedCallback):
2394         (WebCore::AVFWrapper::processCue):
2395         (WebCore::AVFWrapper::legibleOutputCallback):
2396         (WebCore::AVFWrapper::processShouldWaitForLoadingOfResource):
2397         (WebCore::AVFWrapper::resourceLoaderShouldWaitForLoadingOfRequestedResource):
2398         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
2399         (WebCore::InbandTextTrackPrivateGStreamer::handleSample):
2400         (WebCore::InbandTextTrackPrivateGStreamer::notifyTrackOfSample):
2401         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
2402         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
2403         (WebCore::TrackPrivateBaseGStreamer::tagsChanged):
2404         (WebCore::TrackPrivateBaseGStreamer::notifyTrackOfTagsChanged):
2405         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
2406         * platform/graphics/mac/DisplayRefreshMonitorMac.cpp:
2407         (WebCore::DisplayRefreshMonitorMac::requestRefreshCallback):
2408         (WebCore::DisplayRefreshMonitorMac::displayLinkFired):
2409         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
2410         (WebCore::MediaPlayerPrivateMediaFoundation::addListener):
2411         (WebCore::MediaPlayerPrivateMediaFoundation::removeListener):
2412         (WebCore::MediaPlayerPrivateMediaFoundation::notifyDeleted):
2413         (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::Invoke):
2414         (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::onMediaPlayerDeleted):
2415         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
2416         * platform/ios/LegacyTileCache.h:
2417         * platform/ios/LegacyTileCache.mm:
2418         (WebCore::LegacyTileCache::setTilesOpaque):
2419         (WebCore::LegacyTileCache::doLayoutTiles):
2420         (WebCore::LegacyTileCache::setCurrentScale):
2421         (WebCore::LegacyTileCache::commitScaleChange):
2422         (WebCore::LegacyTileCache::layoutTilesNow):
2423         (WebCore::LegacyTileCache::layoutTilesNowForRect):
2424         (WebCore::LegacyTileCache::removeAllNonVisibleTiles):
2425         (WebCore::LegacyTileCache::removeAllTiles):
2426         (WebCore::LegacyTileCache::removeForegroundTiles):
2427         (WebCore::LegacyTileCache::setContentReplacementImage):
2428         (WebCore::LegacyTileCache::contentReplacementImage):
2429         (WebCore::LegacyTileCache::tileCreationTimerFired):
2430         (WebCore::LegacyTileCache::setNeedsDisplayInRect):
2431         (WebCore::LegacyTileCache::updateTilingMode):
2432         (WebCore::LegacyTileCache::setTilingMode):
2433         (WebCore::LegacyTileCache::doPendingRepaints):
2434         (WebCore::LegacyTileCache::flushSavedDisplayRects):
2435         (WebCore::LegacyTileCache::prepareToDraw):
2436         * platform/ios/LegacyTileLayerPool.h:
2437         * platform/ios/LegacyTileLayerPool.mm:
2438         (WebCore::LegacyTileLayerPool::addLayer):
2439         (WebCore::LegacyTileLayerPool::takeLayerWithSize):
2440         (WebCore::LegacyTileLayerPool::setCapacity):
2441         (WebCore::LegacyTileLayerPool::prune):
2442         (WebCore::LegacyTileLayerPool::drain):
2443         * platform/network/curl/CurlDownload.cpp:
2444         (WebCore::CurlDownloadManager::add):
2445         (WebCore::CurlDownloadManager::remove):
2446         (WebCore::CurlDownloadManager::getActiveDownloadCount):
2447         (WebCore::CurlDownloadManager::getPendingDownloadCount):
2448         (WebCore::CurlDownloadManager::stopThreadIfIdle):
2449         (WebCore::CurlDownloadManager::updateHandleList):
2450         (WebCore::CurlDownload::~CurlDownload):
2451         (WebCore::CurlDownload::init):
2452         (WebCore::CurlDownload::getTempPath):
2453         (WebCore::CurlDownload::getUrl):
2454         (WebCore::CurlDownload::getResponse):
2455         (WebCore::CurlDownload::closeFile):
2456         (WebCore::CurlDownload::didReceiveHeader):
2457         (WebCore::CurlDownload::didReceiveData):
2458         (WebCore::CurlDownload::didFail):
2459         * platform/network/curl/CurlDownload.h:
2460         * platform/network/curl/ResourceHandleManager.cpp:
2461         (WebCore::cookieJarPath):
2462         (WebCore::sharedResourceMutex):
2463         (WebCore::curl_lock_callback):
2464         (WebCore::curl_unlock_callback):
2465         * platform/network/ios/QuickLook.mm:
2466         (WebCore::QLDirectoryAttributes):
2467         (qlPreviewConverterDictionaryMutex):
2468         (WebCore::addQLPreviewConverterWithFileForURL):
2469         (WebCore::qlPreviewConverterUTIForURL):
2470         (WebCore::removeQLPreviewConverterForURL):
2471         (WebCore::safeQLURLForDocumentURLAndResourceURL):
2472         * platform/sql/SQLiteDatabase.cpp:
2473         (WebCore::SQLiteDatabase::close):
2474         (WebCore::SQLiteDatabase::maximumSize):
2475         (WebCore::SQLiteDatabase::setMaximumSize):
2476         (WebCore::SQLiteDatabase::pageSize):
2477         (WebCore::SQLiteDatabase::freeSpaceSize):
2478         (WebCore::SQLiteDatabase::totalSize):
2479         (WebCore::SQLiteDatabase::runIncrementalVacuumCommand):
2480         (WebCore::SQLiteDatabase::setAuthorizer):
2481         * platform/sql/SQLiteDatabase.h:
2482         (WebCore::SQLiteDatabase::databaseMutex):
2483         * platform/sql/SQLiteStatement.cpp:
2484         (WebCore::SQLiteStatement::prepare):
2485         (WebCore::SQLiteStatement::step):
2486         * workers/WorkerThread.cpp:
2487         (WebCore::WorkerThread::start):
2488         (WebCore::WorkerThread::workerThread):
2489         (WebCore::WorkerThread::stop):
2490         * workers/WorkerThread.h:
2491
2492 2015-08-18  Myles C. Maxfield  <mmaxfield@apple.com>
2493
2494         [Cocoa] Honor the 'trak' table by opting in via text-rendering: optimizeLegibility
2495         https://bugs.webkit.org/show_bug.cgi?id=148119
2496         <rdar://problem/22291561>
2497
2498         Reviewed by Tim Horton.
2499
2500         When the author has opted in by specifying "text-rendering: optimizeLegibility;", we should
2501         honor the font's 'trak' table. We do this by specifying kCTFontOpticalSizeAttribute at font
2502         creation time, and by using CTFontGetAdvancesForGlyphs() instead of
2503         CGFontGetGlyphAdvancesForStyle().
2504
2505         Test: fast/text/trak-optimizeLegibility.html
2506
2507         * platform/graphics/FontCache.h:
2508         (WebCore::FontDescriptionKey::makeFlagKey): Make our caches sensitive to TextRenderingMode.
2509         * platform/graphics/FontPlatformData.cpp:
2510         (WebCore::FontPlatformData::FontPlatformData): Add a TextRenderingMode member variable.
2511         (WebCore::FontPlatformData::operator=): Update to consult with the new member.
2512         * platform/graphics/FontPlatformData.h:
2513         (WebCore::FontPlatformData::textRenderingMode): Getter.
2514         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2515         (WebCore::preparePlatformFont): Specify kCTFontOpticalSizeAttribute.
2516         (WebCore::applyFontFeatureSettings): Deleted.
2517         * platform/graphics/cocoa/FontCocoa.mm:
2518         (WebCore::canUseFastGlyphAdvanceGetter): Use CTFontGetAdvancesForGlyphs() if we are
2519         optimizeLegibility.
2520         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
2521         (WebCore::FontPlatformData::FontPlatformData): Pass the TextRenderingMode around.
2522         * platform/graphics/ios/FontCacheIOS.mm:
2523         (WebCore::FontCache::getSystemFontFallbackForCharacters): Update to call renamed function.
2524         (WebCore::FontCache::createFontPlatformData): Ditto.
2525         * platform/graphics/mac/FontCacheMac.mm:
2526         (WebCore::fontWithFamily): Ditto.
2527         (WebCore::FontCache::systemFallbackForCharacters): Ditto.
2528         (WebCore::FontCache::createFontPlatformData): Ditto.
2529         * platform/graphics/mac/FontCustomPlatformData.cpp:
2530         (WebCore::FontCustomPlatformData::fontPlatformData): Ditto.
2531         * platform/spi/cocoa/CoreTextSPI.h:
2532         * rendering/RenderThemeIOS.mm:
2533         (WebCore::RenderThemeIOS::updateCachedSystemFontDescription): Ditto.
2534
2535 2015-08-18  Chris Dumez  <cdumez@apple.com>
2536
2537         Make our bindings' GetOwnPropertySlot() behave according to specification
2538         https://bugs.webkit.org/show_bug.cgi?id=148092
2539
2540         Reviewed by Geoffrey Garen.
2541
2542         Make our bindings' GetOwnPropertySlot() behave according to
2543         specification. In particular, our bindings use to do:
2544         1. Indexed getter
2545         2. Check static properties
2546         3. Prototype check
2547         4. Named getter
2548         5. Check own properties
2549
2550         According to the specification [1][2], we should do:
2551         - If the interface has [OverrideBuiltins]:
2552             1. Indexed getter
2553             2. Named getter
2554             3. Static / own properties
2555         - Otherwise:
2556             1. Indexed getter
2557             2. Static / own properties
2558             3. Prototype check
2559             4. Named getter
2560
2561         This patch adds support for the [OverrideBuiltins] IDL extended
2562         attribute [3] and aligns our bindings implementation with the Web IDL
2563         specification weither that IDL extended attribute is present or
2564         not.
2565         
2566         [1] https://heycam.github.io/webidl/#getownproperty-guts
2567         [2] https://heycam.github.io/webidl/#dfn-named-property-visibility
2568         [3] https://heycam.github.io/webidl/#OverrideBuiltins
2569
2570         Performance:
2571         - PerformanceTests/Bindings/childNodes-traversal.html: ~Same
2572         - PerformanceTests/Bindings/children-traversal.html: +104% :)
2573
2574         No new tests, covered by:
2575         fast/dom/htmlcollection-getownproperty.html
2576         fast/dom/collection-length-should-not-be-overridden.html
2577         fast/forms/input-named-action-overrides-action-attribute.html
2578
2579         * bindings/js/JSHTMLCollectionCustom.cpp:
2580         (WebCore::JSHTMLCollection::nameGetter):
2581         Add assertions to make sure we don't use HTMLCollection's namedGetter()
2582         for HTMLFormControlsCollection / HTMLOptionsCollection subclasses.
2583         We should use the subclasses' namedGetter() instead.
2584
2585         * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
2586         (WebCore::JSHTMLOptionsCollection::canGetItemsForName):
2587         (WebCore::JSHTMLOptionsCollection::nameGetter):
2588         Add code for handling named getter requests on
2589         HTMLOptionsCollection.
2590
2591         * bindings/js/JSNodeListCustom.cpp:
2592         (WebCore::JSNodeList::canGetItemsForName):
2593         (WebCore::JSNodeList::nameGetter):
2594         Refactor custom code for the NodeList named getter, now that the
2595         IDL interface is using [CustomNamedGetter] instead of
2596         [JSCustomGetOwnPropertySlotAndDescriptor].
2597
2598         * bindings/scripts/CodeGeneratorJS.pm:
2599         (GenerateGetOwnPropertySlotBody):
2600         (GenerateHeaderContentHeader): Deleted.
2601         - Add support for the [OverrideBuiltins] IDL extended attribute and
2602         update the generated getOwnPropertySlot() methods to match the
2603         Web IDL specification.
2604         - Also drop the JSC::HasImpureGetOwnPropertySlot flag for interfaces
2605         that have a named getter but NOT the [OverrideBuiltins] IDL extended
2606         attribute. Without [OverrideBuiltins], named properties can no longer
2607         shadow own properties so we no longer need to mark GetOwnPropertySlot
2608         as impure. This allows caching of properties.
2609
2610         * bindings/scripts/IDLAttributes.txt:
2611         Add [OverrideBuiltins] IDL extended attribute [3].
2612
2613         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2614         (WebCore::JSTestActiveDOMObject::getOwnPropertySlot):
2615         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
2616         (WebCore::JSTestCustomNamedGetter::getOwnPropertySlot):
2617         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2618         (WebCore::JSTestEventTarget::getOwnPropertySlot):
2619         * bindings/scripts/test/JS/JSTestException.cpp:
2620         (WebCore::JSTestException::getOwnPropertySlot):
2621         * bindings/scripts/test/JS/JSTestInterface.cpp:
2622         (WebCore::JSTestInterface::getOwnPropertySlot):
2623         * bindings/scripts/test/JS/JSTestObj.cpp:
2624         (WebCore::JSTestObj::getOwnPropertySlot):
2625         Rebaseline the bindings tests as their getOwnPropertySlot() method
2626         is now different.
2627
2628         * bindings/scripts/test/GObject/WebKitDOMTestOverrideBuiltins.cpp: Added.
2629         * bindings/scripts/test/GObject/WebKitDOMTestOverrideBuiltins.h: Added.
2630         * bindings/scripts/test/GObject/WebKitDOMTestOverrideBuiltinsPrivate.h: Added.
2631         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp: Added.
2632         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h: Added.
2633         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2634         * bindings/scripts/test/ObjC/DOMTestOverrideBuiltins.h: Added.
2635         * bindings/scripts/test/ObjC/DOMTestOverrideBuiltins.mm: Added.
2636         * bindings/scripts/test/ObjC/DOMTestOverrideBuiltinsInternal.h: Added.
2637         * bindings/scripts/test/TestOverrideBuiltins.idl: Added.
2638         Add bindings test coverage for the new [OverrideBuiltins] IDL extended
2639         attribute [3].
2640
2641         * dom/DOMStringMap.idl:
2642         Add [OverrideBuiltins] IDL extended attribute to match the specification:
2643         https://html.spec.whatwg.org/multipage/infrastructure.html#domstringmap
2644
2645         * dom/NodeList.idl:
2646         Use CustomNamedGetter IDL extended attribute instead of
2647         JSCustomGetOwnPropertySlotAndDescriptor as NodeList merely implements
2648         a custom named getter. This makes sure that the order in which the
2649         named getter is called is correct as per the Web IDL specification.
2650
2651         * html/HTMLDocument.idl:
2652         Add [OverrideBuiltins] IDL extended attribute to match the specification:
2653         https://html.spec.whatwg.org/multipage/dom.html#the-document-object
2654
2655         * html/HTMLFormElement.idl:
2656         Add [OverrideBuiltins] IDL extended attribute to match the specification:
2657         https://html.spec.whatwg.org/multipage/forms.html#the-form-element
2658
2659         * html/HTMLOptionsCollection.idl:
2660         Add missing 'getter' in front of the named getter, as the per the HTML
2661         specification. Without this, HTMLOptionsCollection would not be
2662         recognized as a named properties object, which means that we would not
2663         check the HTMLOptionsCollection prototype before querying the named
2664         getter on HTMLCollection. This used to work because the bindings
2665         generator was hard-coding the prototype check for every HTML*Collection
2666         IDL interface. In this patch, we generalized the check to every
2667         interface that has a named getter.
2668
2669 2015-08-18  Per Arne Vollan  <peavo@outlook.com>
2670
2671         [Win] Popup menu displayed at incorrect position when page is scrolled and device scale factor != 1.
2672         https://bugs.webkit.org/show_bug.cgi?id=148130
2673
2674         Reviewed by Alex Christensen.
2675
2676         Scale WebView coordinates with device scale factor.
2677
2678         * platform/win/PopupMenuWin.cpp:
2679         (WebCore::PopupMenuWin::calculatePositionAndSize):
2680
2681 2015-08-18  Javier Fernandez  <jfernandez@igalia.com>
2682
2683         [CSS Grid Layout] Do not stretch always grid items with auto width
2684         https://bugs.webkit.org/show_bug.cgi?id=148069
2685
2686         Reviewed by Darin Adler.
2687
2688         We assumed that any grid item with 'auto' width will be stretched
2689         to fill all the available space in its grid area. We assumed this
2690         because grid area acts as item's container.
2691
2692         However, Grid Layout specification states on its Alignment section
2693         that items will be stretched by default, unless either
2694         justify-self or align-self compute to a value other than stretch
2695         or margins are auto. In those cases, grid items will auto-size to
2696         fit their contents.
2697
2698         Tests:
2699         fast/css-grid-layout/grid-align-justify-stretch.html
2700         fast/css-grid-layout/grid-item-auto-margins-and-stretch.html
2701         fast/css-grid-layout/grid-items-should-not-be-stretched-when-height-or-width-or-margin-change.html
2702
2703         * rendering/RenderBox.cpp:
2704         (WebCore::RenderBox::computeLogicalWidthInRegion):
2705         * rendering/RenderGrid.cpp:
2706         (WebCore::RenderGrid::layoutGridItems):
2707         (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded):
2708         (WebCore::RenderGrid::needToStretchChildLogicalHeight): Deleted.
2709         * rendering/RenderGrid.h:
2710
2711 2015-08-18  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2712
2713         [Streams API] Update implementation with the latest spec
2714         https://bugs.webkit.org/show_bug.cgi?id=147978
2715
2716         Reviewed by Darin Adler.
2717
2718         Changed the way the read and closed promises are resolved and the stream is released when an even closes or
2719         errors the stream.
2720
2721         Current tests suffice after changing the order of the promise resolution according to the new spec.
2722
2723         * Modules/streams/ReadableStream.cpp:
2724         (WebCore::ReadableStream::releaseReader): Changed how the promises are resolved.
2725         (WebCore::ReadableStream::changeStateToErrored): Changed how the promises are resolved and manually releasing
2726         the stream instead of calling releaseReader according to the spec.
2727
2728 2015-08-17  Zalan Bujtas  <zalan@apple.com>
2729
2730         Outline with auto style leaves bits behind when the the box is moved.
2731         https://bugs.webkit.org/show_bug.cgi?id=148100
2732
2733         Reviewed by Simon Fraser.
2734
2735         We paint the focus ring when 'outline-style: auto' is present, however
2736         we don't take the focus ring width into account when the repaint rect
2737         is computed.
2738
2739         Tests: fast/repaint/outline-with1px-auto-repaint-rect.html
2740                fast/repaint/outline-with2px-auto-repaint-rect.html
2741                fast/repaint/outline-with3px-auto-repaint-rect.html
2742
2743         * rendering/RenderObject.cpp:
2744         (WebCore::RenderObject::adjustRectForOutlineAndShadow):
2745         * rendering/RenderThemeMac.h:
2746         * rendering/RenderThemeMac.mm:
2747         (WebCore::RenderThemeMac::platformFocusRingMaxWidth): Deleted. : 0 as focus ring width is incorrect.
2748         The reason why r169699 fixed the failing cases was because they all had outline width < 3 (but no auto outline style).
2749         The correct fix is to check if the style requires focus ring painting and use the RenderTheme::platformFocusRingMaxWidth
2750         accordingly.
2751
2752 2015-08-17  Myles C. Maxfield  <mmaxfield@apple.com>
2753
2754         [Cocoa] Address post-commit review
2755         https://bugs.webkit.org/show_bug.cgi?id=147864
2756
2757         Reviewed by Darin Adler.
2758
2759         Create helper functions to cast between NSFont*s and CTFontRefs.
2760
2761         No new tests because there is no behavior change.
2762
2763         * platform/graphics/FontPlatformData.h:
2764         (WebCore::toCTFont):
2765         (WebCore::toNSFont):
2766         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2767         * platform/graphics/cocoa/FontCocoa.mm:
2768         (WebCore::Font::platformCreateScaledFont):
2769         (WebCore::Font::compositeFontReferenceFont):
2770         * platform/graphics/mac/FontCacheMac.mm:
2771         (WebCore::FontCache::platformPurgeInactiveFontData):
2772         (WebCore::lookupCTFont):
2773         (WebCore::FontCache::systemFallbackForCharacters):
2774         (WebCore::FontCache::createFontPlatformData):
2775         * platform/mac/DragImageMac.mm:
2776         (WebCore::fontFromNSFont):
2777         (WebCore::widthWithFont):
2778         (WebCore::drawAtPoint):
2779         * platform/spi/mac/NSFontSPI.h:
2780
2781 2015-08-17  Alex Christensen  <achristensen@webkit.org>
2782
2783         WinCairo build fix after r188566
2784
2785         * platform/graphics/win/FontPlatformDataCairoWin.cpp:
2786         (WebCore::FontPlatformData::FontPlatformData):
2787         Remove reference to removed m_isCompositeFontReference.
2788
2789 2015-08-17  Alex Christensen  <achristensen@webkit.org>
2790
2791         Add const to content extension parser
2792         https://bugs.webkit.org/show_bug.cgi?id=148044
2793
2794         Reviewed by Benjamin Poulain.
2795
2796         * contentextensions/ContentExtensionParser.cpp:
2797         (WebCore::ContentExtensions::containsOnlyASCIIWithNoUppercase):
2798         (WebCore::ContentExtensions::getDomainList):
2799         (WebCore::ContentExtensions::getTypeFlags):
2800         (WebCore::ContentExtensions::loadTrigger):
2801         (WebCore::ContentExtensions::loadAction):
2802         (WebCore::ContentExtensions::loadRule):
2803         (WebCore::ContentExtensions::loadEncodedRules):
2804         Add const.  No change in behavior.
2805
2806 2015-08-17  Myles C. Maxfield  <mmaxfield@apple.com>
2807
2808         [OS X] Remove support for composite fonts
2809         https://bugs.webkit.org/show_bug.cgi?id=147920
2810
2811         Reviewed by Dan Bernstein.
2812
2813         Composite fonts were first introduced in [1]. These composite fonts are extremely rare
2814         because:
2815         1. None of the preinstalled fonts on either OS X nor iOS are composite fonts,
2816         2. WebKit does not support loading web fonts from composite font files, and
2817         3. WebKit's support only ever existed on OS X (none of the other ports).
2818
2819         In fact, no one I've consulted with has ever seen any of these fonts used in the wild.
2820         The fonts also require a fundamentally broken code path, and add complexity to WebKit.
2821
2822         [1] https://bugs.webkit.org/attachment.cgi?id=134923&action=review
2823
2824         No new tests.
2825
2826         * platform/graphics/Font.h:
2827         * platform/graphics/FontPlatformData.cpp:
2828         (WebCore::FontPlatformData::FontPlatformData): Deleted.
2829         (WebCore::FontPlatformData::operator=): Deleted.
2830         * platform/graphics/FontPlatformData.h:
2831         (WebCore::FontPlatformData::isCompositeFontReference): Deleted.
2832         (WebCore::FontPlatformData::operator==): Deleted.
2833         * platform/graphics/cocoa/FontCocoa.mm:
2834         (WebCore::Font::compositeFontReferenceFont): Deleted.
2835         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
2836         (WebCore::FontPlatformData::FontPlatformData): Deleted.
2837         (WebCore::FontPlatformData::setFont): Deleted.
2838         * platform/graphics/mac/GlyphPageMac.cpp:
2839         (WebCore::shouldUseCoreText):
2840         (WebCore::GlyphPage::fill):
2841
2842 2015-08-17  Tim Horton  <timothy_horton@apple.com>
2843
2844         Some functions on DictionaryLookup.h should just be generic functions elsewhere
2845         https://bugs.webkit.org/show_bug.cgi?id=138567
2846
2847         Reviewed by Dean Jackson.
2848
2849         No new tests, just refactoring.
2850
2851         * dom/Range.cpp:
2852         (WebCore::Range::contains):
2853         * dom/Range.h:
2854         Add a Range::contains(VisiblePosition).
2855         It's simpler than the old thing from DictionaryLookup.mm, but does the same thing.
2856         It's so simple that it doesn't necessarily need to exist, but it seems useful.
2857
2858         * editing/VisiblePosition.cpp:
2859         (WebCore::makeRange):
2860         nullptrs
2861
2862         * editing/mac/DictionaryLookup.h:
2863         * editing/mac/DictionaryLookup.mm:
2864         (WebCore::selectionContainsPosition):
2865         (WebCore::rangeForDictionaryLookupAtHitTestResult):
2866         (WebCore::isPositionInRange): Deleted.
2867         (WebCore::shouldUseSelection): Deleted.
2868         Move isPositionInRange to Range.
2869         Rename shouldUseSelection to what it really means.
2870         I didn't move selectionContainsPosition to VisibleSelection because it
2871         only handles Range selections, not any of the ohers, and thus isn't
2872         generic enough to put there.
2873
2874 2015-08-17  Alex Christensen  <achristensen@webkit.org>
2875
2876         [Win CMake] Allow WebKitLibraries directory to be set from the command line
2877         https://bugs.webkit.org/show_bug.cgi?id=148112
2878
2879         Reviewed by Brent Fulgham.
2880
2881         * PlatformAppleWin.cmake:
2882         * PlatformWinCairo.cmake:
2883         Don't use an environment variable for WEBKIT_LIBRARIES_DIR.  
2884
2885 2015-08-17  Myles C. Maxfield  <mmaxfield@apple.com>
2886
2887         [OS X] Migrate off of CTFontSetRenderingParameters()
2888         https://bugs.webkit.org/show_bug.cgi?id=148113
2889
2890         Reviewed by Lucas Forschler.
2891
2892         Instead, use CTFontSetRenderingStyle().
2893
2894         No new tests because there is no behavior change.
2895
2896         * platform/spi/cocoa/CoreTextSPI.h:
2897
2898 2015-08-17  Alex Christensen  <achristensen@webkit.org>
2899
2900         Build Debug Suffix on Windows with CMake
2901         https://bugs.webkit.org/show_bug.cgi?id=148083
2902
2903         Reviewed by Brent Fulgham.
2904
2905         * CMakeLists.txt:
2906         * PlatformAppleWin.cmake:
2907         * PlatformWin.cmake:
2908         Add DEBUG_SUFFIX
2909
2910 2015-08-17  Myles C. Maxfield  <mmaxfield@apple.com>
2911
2912         Implement IntegerHasher
2913         https://bugs.webkit.org/show_bug.cgi?id=147866
2914
2915         Reviewed by Darin Adler and Anders Carlsson.
2916
2917         Rename StringHasher.h to Hasher.
2918
2919         No new tests because there is no behavior difference.
2920
2921         * contentextensions/DFAMinimizer.cpp: Use new #include.
2922         * contentextensions/HashableActionList.h: Ditto.
2923         * platform/graphics/FontFeatureSettings.cpp:
2924         (WebCore::FontFeatureSettings::hash): Use new IntegerHasher class.
2925         (WebCore::FontFeature::hash): Deleted.
2926         * platform/graphics/FontFeatureSettings.h: Remove unnecessary function.
2927         * platform/graphics/Gradient.cpp: Use new #include.
2928         * platform/graphics/WidthCache.h: Ditto.
2929
2930 2015-08-17  Chris Dumez  <cdumez@apple.com>
2931
2932         Log actual PageCache retrieval success rate using diagnostic logging
2933         https://bugs.webkit.org/show_bug.cgi?id=147937
2934
2935         Reviewed by Antti Koivisto.
2936
2937         Log actual PageCache retrieval success rate using diagnostic logging.
2938         Previously, we would only log how successful we are at saving entries
2939         into the cache, which is not the most interesting metric.
2940
2941         * history/PageCache.cpp:
2942         (WebCore::canCachePage):
2943         * loader/FrameLoader.cpp:
2944         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
2945         * page/DiagnosticLoggingKeys.cpp:
2946         (WebCore::DiagnosticLoggingKeys::canCacheKey):
2947         * page/DiagnosticLoggingKeys.h:
2948
2949 2015-08-17  Alex Christensen  <achristensen@webkit.org>
2950
2951         Move some commands from ./CMakeLists.txt to Source/cmake
2952         https://bugs.webkit.org/show_bug.cgi?id=148003
2953
2954         Reviewed by Brent Fulgham.
2955
2956         * CMakeLists.txt:
2957         Added commands needed to build WebCore by itself.
2958
2959 2015-08-17  Alex Christensen  <achristensen@webkit.org>
2960
2961         Remove unused multisampling check
2962         https://bugs.webkit.org/show_bug.cgi?id=148030
2963
2964         Reviewed by Dean Jackson.
2965
2966         No change in behavior.
2967         Extensions3DOpenGLCommon.m_maySupportMultisampling is always true.
2968
2969         * platform/graphics/Extensions3D.h:
2970         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
2971         (WebCore::Extensions3DOpenGLCommon::Extensions3DOpenGLCommon):
2972         * platform/graphics/opengl/Extensions3DOpenGLCommon.h:
2973         (WebCore::Extensions3DOpenGLCommon::isImagination):
2974         (WebCore::Extensions3DOpenGLCommon::vendor):
2975         (WebCore::Extensions3DOpenGLCommon::requiresBuiltInFunctionEmulation):
2976         (WebCore::Extensions3DOpenGLCommon::requiresRestrictedMaximumTextureSize):
2977         (WebCore::Extensions3DOpenGLCommon::maySupportMultisampling): Deleted.
2978         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2979         (WebCore::GraphicsContext3D::validateDepthStencil):
2980
2981 2015-08-17  Andy Estes  <aestes@apple.com>
2982
2983         REGRESSION (r188486): Crash in SubresourceLoader::didReceiveResponse() when TemporaryChange goes out of scope
2984         https://bugs.webkit.org/show_bug.cgi?id=148082
2985
2986         Reviewed by Alexey Proskuryakov.
2987
2988         Covered by existing tests run under ASan or Guard Malloc.
2989
2990         * loader/SubresourceLoader.cpp:
2991         (WebCore::SubresourceLoader::didReceiveResponse): Ensure that callingDidReceiveResponse is destroyed while the
2992         SubresourceLoader is still alive by declaring it after protect.
2993
2994 2015-08-17  Simon Fraser  <simon.fraser@apple.com>
2995
2996         will-change should sometimes trigger compositing
2997         https://bugs.webkit.org/show_bug.cgi?id=148072
2998
2999         Reviewed by Tim Horton.
3000         
3001         Implement the compositing side-effects of will-change, if any of the
3002         following properties are specified:
3003             opacity
3004             filter (as -webkit-filter)
3005             backdrop-filter (as -webkit-backdrop-filter)
3006             transform (on transformable elements only)
3007
3008         Tests: compositing/layer-creation/will-change-change.html
3009                compositing/layer-creation/will-change-layer-creation.html
3010
3011         * inspector/InspectorLayerTreeAgent.cpp:
3012         (WebCore::InspectorLayerTreeAgent::reasonsForCompositingLayer): Tell the inspector
3013         about will-change.
3014         * rendering/RenderElement.cpp:
3015         (WebCore::RenderElement::adjustStyleDifference): Need to trigger a recomposite if
3016         will-change includes a compositing trigger property. This gets called before and
3017         after setting the style, so this checks both states.
3018         (WebCore::RenderElement::shouldWillChangeCreateStackingContext):
3019         * rendering/RenderElement.h:
3020         (WebCore::RenderElement::willChangeCreatesStackingContext): Helper function that
3021         RenderInline uses to determine if it needs to create a RenderLayer, since RenderInline
3022         doesn't get automatic layer RenderLayers as a side effect of having non-auto z-index
3023         in the style.
3024         * rendering/RenderInline.h: Need to trigger a RenderLayer if will-change includes
3025         a property that applies to inlines.
3026         * rendering/RenderLayerCompositor.cpp:
3027         (WebCore::RenderLayerCompositor::requiresCompositingLayer): Call requiresCompositingForWillChange().
3028         (WebCore::RenderLayerCompositor::requiresOwnBackingStore): Call requiresCompositingForWillChange().
3029         (WebCore::RenderLayerCompositor::reasonsForCompositing): Include requiresCompositingForWillChange().
3030         (WebCore::RenderLayerCompositor::requiresCompositingForWillChange): If will-change contains a
3031         property that would trigger compositing on this element, return true.
3032         * rendering/RenderLayerCompositor.h:
3033         * rendering/style/RenderStyle.cpp:
3034         (WebCore::RenderStyle::changeRequiresLayout): Set ContextSensitivePropertyWillChange in
3035         changedContextSensitiveProperties if will-change changes.
3036         * rendering/style/RenderStyle.h: Rename for clarity.
3037         * rendering/style/RenderStyleConstants.h: Add ContextSensitivePropertyWillChange.
3038         * rendering/style/WillChangeData.cpp:
3039         (WebCore::propertyCreatesStackingContext): Subset of properties that create stacking
3040         context on any element.
3041         (WebCore::propertyCreatesStackingContextOnBoxesOnly): Additional properties that
3042         create stacking context on boxes.
3043         (WebCore::propertyTriggersCompositing): Properties that trigger compositing on
3044         any element.
3045         (WebCore::propertyTriggersCompositingOnBoxesOnly): Additional properties that
3046         trigger compositing on boxes.
3047         (WebCore::WillChangeData::addFeature): As features are added, manage a set of
3048         flags to know if they trigger stacking context or compositing, on inlines and boxes.
3049         (WebCore::WillChangeData::createsStackingContext): Deleted.
3050         * rendering/style/WillChangeData.h:
3051         (WebCore::WillChangeData::canCreateStackingContext):
3052         (WebCore::WillChangeData::canCreateStackingContextOnInline):
3053         (WebCore::WillChangeData::canTriggerCompositing):
3054         (WebCore::WillChangeData::canTriggerCompositingOnInline):
3055
3056 2015-08-17  Timothy Horton  <timothy_horton@apple.com>
3057
3058         Holes for find matches that span multiple lines are completely wrong
3059         https://bugs.webkit.org/show_bug.cgi?id=148065
3060         <rdar://problem/5305002>
3061
3062         Reviewed by Simon Fraser.
3063
3064         Test: fast/text/mark-matches-broken-line-rendering.html
3065
3066         Two big problems with find holes:
3067             - RenderedDocumentMarker only has one rect, but a marker can be painted
3068               by multiple text runs, each with their own rendered rect
3069             - paintTextMatchMarker does std::max((unsigned)a, (unsigned)0), which is
3070               obviously an overflow problem/not going to work if a is negative
3071
3072         The combination of these issues causes the holes for find matches to be
3073         very broken: text that isn't part of the match is highlighted, and some
3074         text that is part of the match isn't highlighted.
3075
3076         To fix, make RenderedDocumentMarker support multiple rects, and use signed
3077         math (like paintDocumentMarker already did) when computing positions in paintTextMatchMarker.
3078
3079         * dom/DocumentMarkerController.cpp:
3080         (WebCore::DocumentMarkerController::addTextMatchMarker):
3081         (WebCore::DocumentMarkerController::renderedRectsForMarkers):
3082         * dom/RenderedDocumentMarker.h:
3083         (WebCore::RenderedDocumentMarker::RenderedDocumentMarker):
3084         (WebCore::RenderedDocumentMarker::isRendered):
3085         (WebCore::RenderedDocumentMarker::contains):
3086         (WebCore::RenderedDocumentMarker::addRenderedRect):
3087         (WebCore::RenderedDocumentMarker::renderedRects):
3088         (WebCore::RenderedDocumentMarker::invalidate):
3089         (WebCore::RenderedDocumentMarker::setRenderedRect): Deleted.
3090         (WebCore::RenderedDocumentMarker::renderedRect): Deleted.
3091         (WebCore::RenderedDocumentMarker::invalidMarkerRect): Deleted.
3092         * rendering/InlineTextBox.cpp:
3093         (WebCore::InlineTextBox::paintDocumentMarker):
3094         (WebCore::InlineTextBox::paintTextMatchMarker):
3095         (WebCore::InlineTextBox::computeRectForReplacementMarker):
3096         * rendering/svg/SVGInlineFlowBox.cpp:
3097         (WebCore::SVGInlineFlowBox::computeTextMatchMarkerRectForRenderer):
3098
3099 2015-08-17  Timothy Horton  <timothy_horton@apple.com>
3100
3101         Adopt shrink-wrapping for TextIndicators on Mac
3102         https://bugs.webkit.org/show_bug.cgi?id=148064
3103
3104         Reviewed by Beth Dakin.
3105
3106         Instead of indicating the bounding rect when there are multiple text rects,
3107         use shrink-wrapping for TextIndicatorWindow (on Mac), like we do on iOS.
3108
3109         * bindings/objc/DOM.mm:
3110         (-[DOMNode getPreviewSnapshotImage:andRects:]):
3111         Make getPreviewSnapshotImage use the same options that iOS WebKit2 uses.
3112         This fixes a regression from r188420 where iOS WebKit1 TextIndicators lost
3113         all of the relevant (previously hardcoded inside TextIndicator) options.
3114
3115         * page/TextIndicator.cpp:
3116         (WebCore::TextIndicator::createWithRange):
3117         (WebCore::TextIndicator::createWithSelectionInFrame):
3118         (WebCore::initializeIndicator):
3119         Don't keep indicatesCurrentSelection in TextIndicatorData. Instead,
3120         just pass it through to initializeIndicator. Add a flag which stops us
3121         from zeroing out the margin if indicatesCurrentSelection is true.
3122         Move default margins into TextIndicator so they can be applied to the stored rects
3123         just like on iOS, instead of trying to apply them later like we used to on Mac.
3124
3125         * page/TextIndicator.h:
3126         (WebCore::TextIndicator::indicatesCurrentSelection): Deleted.
3127         * page/mac/TextIndicatorWindow.h:
3128         * page/mac/TextIndicatorWindow.mm:
3129         (-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]):
3130         (WebCore::TextIndicatorWindow::setTextIndicator):
3131         (outsetIndicatorRectIncludingShadow): Deleted.
3132         (textIndicatorsForTextRectsOverlap): Deleted.
3133         Make use of pathsWithShrinkWrappedRects for TextIndicatorWindow, instead
3134         of just smushing all intersecting rects together. Use the computed path
3135         for the shadows and to mask the yellow highlight and snapshot layer.
3136
3137         * platform/graphics/PathUtilities.cpp:
3138         (WebCore::PathUtilities::pathsWithShrinkWrappedRects):
3139         (WebCore::PathUtilities::pathWithShrinkWrappedRects):
3140         * platform/graphics/PathUtilities.h:
3141         Make it possible to retrieve each non-intersecting path individually, instead
3142         of just a single giant Path, so that TextIndicatorWindow can make separate
3143         layers for each one (so they can bounce separately).
3144
3145 2015-08-17  Simon Fraser  <simon.fraser@apple.com>
3146
3147         Remove some includes from Node.cpp
3148         https://bugs.webkit.org/show_bug.cgi?id=148000
3149
3150         Reviewed by Anders Carlsson.
3151
3152         No need for these includes.
3153
3154         * dom/Node.cpp:
3155
3156 2015-08-17  Chris Dumez  <cdumez@apple.com>
3157
3158         Accessing HTMLCollection.length is slow
3159         https://bugs.webkit.org/show_bug.cgi?id=148039
3160
3161         Reviewed by Ryosuke Niwa.
3162
3163         Accessing was HTMLCollection.length is slow, much slower than accessing
3164         NodeList.length. The reason is that HTMLCollection's bindings code is
3165         slightly different. In particular, HTMLCollection's GetOwnPropertySlot()
3166         has an extra check to see if the PropertyName is available on the
3167         prototype before doing:
3168         1. Check static properties (getStaticValueSlotEntryWithoutCaching())
3169         2. Indexed getter
3170         3. Named getter
3171         4. Check own properties (getStaticValueSlot())
3172
3173         This means that everytime the JavaScript was accessing HTMLCollection.length
3174         or HTMLCollection[index], we would check if length / index was present on the
3175         prototype before calling HTMLCollection::length() / HTMLCollection::item(i).
3176         The prototype check is fairly expensive and was making traversing an
3177         HTMLCollection much slower than traversing a NodeList.
3178
3179         In this patch, I refactored GetOwnPropertySlot() to do:
3180         1. Indexed getter
3181         2. Check static properties
3182         3. Prototype check
3183         4. Named getter
3184         5. Check own properties
3185
3186         This way, the prototype check is no longer slowing down HTMLCollection
3187         traversal. What matters is that we do the prototype check *before* calling
3188         the named getter as we don't want named properties to mask properties on
3189         the prototype.
3190
3191         Note that this patch takes the minimal approach to get the performance win
3192         while limiting the risk of breakage. Indeed, the current behavior still
3193         does not match the WebIDL specification, which seems to indicate the order
3194         should be:
3195         1. Indexed getter
3196         2. Check static / own properties
3197         3. Prototype check
3198         4. Named getter
3199
3200         Once we match the specification, I believe we will be able to drop the
3201         JSC::HasImpureGetOwnPropertySlot flag on HTMLCollection, which currently
3202         makes HTMLCollection.length not cacheable. Right now, I believe we still
3203         need this flag because named properties can still mask own properties.
3204
3205         Performance:
3206         /Bindings/childNodes-traversal: 5597.54 +/- 0.7% -> 5572.10 +/- 0.4%
3207         /Bindings/children-traversal: 3852.61 +/- 0.3% -> 4731.03 +/- 0.3% (~23% better)
3208
3209         Test: fast/dom/htmlcollection-getownproperty.html
3210
3211         * bindings/scripts/CodeGeneratorJS.pm:
3212         (GenerateGetOwnPropertySlotBody):
3213         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3214         (WebCore::JSTestEventTarget::getOwnPropertySlot):
3215
3216 2015-08-17  Jinyoung Hur  <hur.ims@navercorp.com>
3217
3218         Fix possible EGL and GLX makeCurrent problem of GLPlatformContext and GLPlatformSurface
3219         https://bugs.webkit.org/show_bug.cgi?id=147695
3220
3221         Reviewed by Gyuyoung Kim.
3222
3223         GLPLatformContext::makeCurrent is implemented to do no-op when it thinks, comparing with a static
3224         variable declared in GLPlatformContext.cpp, there is no changes. This can lead to not-working 
3225         makeCurrent when other part of codes, e.g., Cairo-gl, change EGL or GLX current context by calling
3226         something like eglMakeCurrent. So modify GLPLatformContext::makeCurrent to use the return value of
3227         eglGetCurrentContext or glXGetCurrentContext as a comparing target rather than a static variable.
3228         In addition, GLPlatformSurface::isCurrentDrawable is also modified to use eglGetCurrentSurface or
3229         glXGetCurrentDrawable rather than a static variable.
3230
3231         There are no tests because already existing GL tests will verify this change.
3232
3233         * platform/graphics/opengl/GLPlatformContext.cpp:
3234         (WebCore::GLPlatformContext::makeCurrent):
3235         (WebCore::GLPlatformContext::releaseCurrent):
3236         (WebCore::GLCurrentContextWrapper::GLCurrentContextWrapper): Deleted.
3237         (WebCore::GLPlatformContext::~GLPlatformContext): Deleted.
3238         (WebCore::GLPlatformContext::isCurrentContext): Deleted.
3239         (WebCore::GLPlatformContext::getCurrent): Deleted.
3240         * platform/graphics/opengl/GLPlatformContext.h:
3241         * platform/graphics/opengl/GLPlatformSurface.cpp:
3242         (WebCore::GLPlatformSurface::~GLPlatformSurface): Deleted.
3243         (WebCore::GLPlatformSurface::isCurrentDrawable): Deleted.
3244         (WebCore::GLPlatformSurface::onMakeCurrent): Deleted.
3245         (WebCore::GLPlatformSurface::destroy): Deleted.
3246         * platform/graphics/opengl/GLPlatformSurface.h:
3247         * platform/graphics/surfaces/egl/EGLSurface.cpp:
3248         (WebCore::EGLTransportSurface::isCurrentDrawable):
3249         (WebCore::EGLOffScreenSurface::isCurrentDrawable):
3250         * platform/graphics/surfaces/egl/EGLSurface.h:
3251         * platform/graphics/surfaces/glx/GLXSurface.cpp:
3252         (WebCore::GLXTransportSurface::isCurrentContext):
3253         (WebCore::GLXOffScreenSurface::isCurrentContext):
3254         * platform/graphics/surfaces/glx/GLXSurface.h:
3255
3256 2015-08-15  Chris Dumez  <cdumez@apple.com>
3257
3258         Refactor HTMLCollection to be as fast as CachedLiveNodeList
3259         https://bugs.webkit.org/show_bug.cgi?id=147979
3260
3261         Reviewed by Ryosuke Niwa and Antti Koivisto.
3262
3263         Refactor HTMLCollection to be as fast as CachedLiveNodeList. This is in
3264         preparation of having getElementsByTagName*() / getElementsByClassName()
3265         return an HTMLCollection instead of a NodeList, as per the
3266         specification. Chrome and Firefox already match the specification in
3267         this case.
3268
3269         Traversing an HTMLCollection was slow because of all the extra
3270         branching it had compared to CachedLiveNodeList. To address the issue,
3271         this patch introduces a new templated CachedHTMLCollection subclass,
3272         which behaves in a similar way as CachedLiveNodeList. The 2 template
3273         parameters are:
3274         1. The type of the subclass of CachedHTMLCollection, so we can call
3275            elementMatches() directly on the subclass, without needed any
3276            virtual function call or switch statement. This is the same approach
3277            as in CachedLiveNodeList.
3278         2. The type of tree traversal used (Descendants, ChildrenOnly,
3279            CustomForwardOnly). Unlike LiveNodeList, HTMLCollection needs to
3280            support these 3 types of tree traversal. These were causing extra
3281            branching for every item() call. We are now able to choose the right
3282            type of traversal for the CachedHTMLCollection at compile time.
3283
3284         * WebCore.xcodeproj/project.pbxproj:
3285         Add new files to the Project.
3286
3287         * dom/ContainerNode.cpp:
3288         (WebCore::ContainerNode::children):
3289         (WebCore::ContainerNode::cachedHTMLCollection): Deleted.
3290         * dom/ContainerNode.h:
3291         Drop ContainerNode::ensureCachedHTMLCollection() and use
3292         NodeListsNodeData::addCachedCollection() directly at call sites
3293         instead. We need access to the CollectionType at build-time so
3294         we can resolve the CollectionTraversalType parameter for the
3295         GenericCachedHTMLCollection using CollectionTypeTraits.
3296
3297         * dom/Document.cpp:
3298         * dom/Document.h:
3299         Update ensureCachedCollection() so the CollectionType is now a template
3300         parameter instead of a method argument. We need to know the
3301         CollectionType at build time to construct the GenericCachedHTMLCollection.
3302
3303         * dom/ElementChildIterator.h:
3304         (WebCore::ElementChildIterator<ElementType>::operator):
3305         (WebCore::ElementChildConstIterator<ElementType>::operator):
3306         Add support for decrementing an ElementChildIterator, for consistency
3307         with ElementDescendantIterator. We need this to support backward
3308         traversal in CachedHTMLCollections that use the 'ChildrenOnly' type
3309         of traversal.
3310
3311         * dom/LiveNodeList.h:
3312         (WebCore::CachedLiveNodeList<NodeListType>::collectionBegin):
3313         (WebCore::CachedLiveNodeList<NodeListType>::collectionLast):
3314         (WebCore::CachedLiveNodeList<NodeListType>::collectionTraverseForward):
3315         (WebCore::CachedLiveNodeList<NodeListType>::collectionTraverseBackward):
3316         Move traversal implementation to CollectionTraversal.h, so it can be
3317         shared with achedHTMLCollection.h.
3318
3319         * html/CachedHTMLCollection.h: Added.
3320         (WebCore::traversalType>::CachedHTMLCollection):
3321         (WebCore::traversalType>::~CachedHTMLCollection):
3322         (WebCore::traversalType>::CachedHTMLCollection::memoryCost):
3323         (WebCore::traversalType>::collectionCanTraverseBackward):
3324         (WebCore::traversalType>::collectionTraverseForward):
3325         (WebCore::traversalType>::collectionTraverseBackward):
3326         (WebCore::traversalType>::willValidateIndexCache):
3327         (WebCore::traversalType>::length):
3328         (WebCore::traversalType>::item):
3329         (WebCore::traversalType>::invalidateCache):
3330         (WebCore::traversalType>::elementMatches):
3331         (WebCore::nameShouldBeVisibleInDocumentAll):
3332         (WebCore::traversalType>::namedItem):
3333
3334         * html/CollectionTraversal.h: Added.
3335         Add new template class that provide the collection traversal code
3336         needed by CollectionIndexCache. It has template specializations for
3337         all 3 types of traversal: Descendants, ChildrenOnly, and
3338         CustomForwardOnly.
3339
3340         * html/CollectionType.h:
3341         Add CollectionTypeTraits traits so we can resolve the
3342         CollectionTraversalType used by a specific CollectionType at
3343         compile-time. This is needed for the second template parameter of
3344         CachedHTMLCollection.
3345
3346         * html/GenericCachedHTMLCollection.cpp: Added.
3347         (WebCore::GenericCachedHTMLCollection<traversalType>::elementMatches):
3348         * html/GenericCachedHTMLCollection.h: Added.
3349         Add CachedHTMLCollection subclass is the generic one used for all
3350         CollectionTypes that do not have their own subclass (e.g. NodeChildren).
3351         This has an elementMatches() method with a switch() statement handling
3352         all these CollectionTypes. Those are not normally not performance
3353         sensitive.
3354
3355         * html/HTMLAllCollection.cpp:
3356         (WebCore::HTMLAllCollection::HTMLAllCollection):
3357         * html/HTMLAllCollection.h:
3358         Subclass CachedHTMLCollection instead of HTMLCollection. Also provide
3359         an elementMatches() method that simply returns true as we want to
3360         match all elements.
3361
3362         * html/HTMLCollection.cpp:
3363         (WebCore::HTMLCollection::HTMLCollection):
3364         Move CollectionIndexCache member to the subclass and drop the 2 other
3365         members as they are replaced with the CollectionTraversalType template
3366         parameter of CachedHTMLCollection.
3367
3368         (WebCore::HTMLCollection::~HTMLCollection):
3369         Move Document::unregisterCollection() call to ~CachedHTMLCollection()
3370         as we needed to check if the CollectionIndexCache was valid first.
3371
3372         (WebCore::HTMLCollection::updateNamedElementCache):
3373         Move part of the implementation to the CachedHTMLCollection subclass
3374         as it needs to know about the type of traversal and it needs to be
3375         able to call elementMatches().
3376
3377         * html/HTMLCollection.h:
3378         (WebCore::HTMLCollection::rootNode):
3379         Inline for performance reasons and consistency with CachedLiveNodeList.
3380
3381         (WebCore::HTMLCollection::memoryCost):
3382         Make virtual and move part of the implementation to the
3383         CachedHTMLCollection subclass to compute the cost of the
3384         CollectionIndexCache.
3385
3386         (WebCore::HTMLCollection::invalidateCache):
3387         Move part of the implementation to the subclass to invalidate the
3388         CollectionIndexCache.
3389
3390         * html/HTMLFieldSetElement.cpp:
3391         (WebCore::HTMLFieldSetElement::elements):
3392
3393         * html/HTMLFormControlsCollection.cpp:
3394         * html/HTMLFormControlsCollection.h:
3395         Subclass CachedHTMLCollection instead of HTMLCollection.
3396         customElementAfter() no longer needs to be virtual as it
3397         is called directly by CachedHTMLCollection on the subclass.
3398
3399         * html/HTMLFormElement.cpp:
3400         (WebCore::HTMLFormElement::elements):
3401         * html/HTMLMapElement.cpp:
3402         (WebCore::HTMLMapElement::areas):
3403         Call NodeListsNodeData::addCachedCollection() directly.
3404
3405         * html/HTMLNameCollection.cpp:
3406         * html/HTMLNameCollection.h:
3407         Subclass CachedHTMLCollection instead of HTMLCollection.
3408
3409         * html/HTMLOptionsCollection.cpp:
3410         * html/HTMLOptionsCollection.h:
3411         Subclass CachedHTMLCollection instead of HTMLCollection.
3412
3413         * html/HTMLSelectElement.cpp:
3414         (WebCore::HTMLSelectElement::selectedOptions):
3415         (WebCore::HTMLSelectElement::options):
3416         * html/HTMLTableElement.cpp:
3417         (WebCore::HTMLTableElement::rows):
3418         (WebCore::HTMLTableElement::tBodies):
3419         * html/HTMLTableRowElement.cpp:
3420         (WebCore::HTMLTableRowElement::cells):
3421         Call NodeListsNodeData::addCachedCollection() directly.
3422
3423         * html/HTMLTableRowsCollection.cpp:
3424         * html/HTMLTableRowsCollection.h:
3425         Subclass CachedHTMLCollection instead of HTMLCollection.
3426         customElementAfter() no longer needs to be virtual as it
3427         is called directly by CachedHTMLCollection on the subclass.
3428
3429         * html/HTMLTableSectionElement.cpp:
3430         (WebCore::HTMLTableSectionElement::rows):
3431         Call NodeListsNodeData::addCachedCollection() directly.
3432
3433 2015-08-15  Timothy Horton  <timothy_horton@apple.com>
3434
3435         REGRESSION (r168327): ImageDocuments with margins zoom to the wrong position when clicked
3436         https://bugs.webkit.org/show_bug.cgi?id=148063
3437
3438         Reviewed by Simon Fraser.
3439
3440         No new test because it doesn't seem possible to click on a window.open'd ImageDocument.
3441
3442         * html/ImageDocument.cpp:
3443         (WebCore::ImageEventListener::handleEvent):
3444         Use <img>-relative coordinates, not document-relative coordinates,
3445         because after r168327, the image can be centered.
3446