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