ScrollbarPainters needs to be deallocated on the main thread
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-02-06  Beth Dakin  <bdakin@apple.com>
2
3         ScrollbarPainters needs to be deallocated on the main thread
4         https://bugs.webkit.org/show_bug.cgi?id=153932
5         -and corresponding-
6         rdar://problem/24015483
7
8         Reviewed by Dan Bernstein.
9
10         Darin pointed out that this was still race-y. There was still a race 
11         condition between the destruction of the two local variables and the
12         destruction of the lambda on the main thread. This should fix that. 
13         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
14         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
15         (WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac):
16         (WebCore::ScrollingTreeFrameScrollingNodeMac::releaseReferencesToScrollbarPaintersOnTheMainThread):
17         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
18
19 2016-02-06  Darin Adler  <darin@apple.com>
20
21         Finish auditing call sites of upper() and lower(), eliminate many, and rename the functions
22         https://bugs.webkit.org/show_bug.cgi?id=153905
23
24         Reviewed by Sam Weinig.
25
26         * Modules/mediasource/MediaSource.cpp:
27         (WebCore::MediaSource::isTypeSupported): Use convertToASCIILowercase on MIME type.
28
29         * accessibility/AccessibilityObject.cpp:
30         (WebCore::AccessibilityObject::selectText): Use new names for lower and upper. Also
31         tweaked style a tiny bit and used u_toupper rather than converting an entire
32         string to uppercase.
33
34         * dom/Document.cpp:
35         (WebCore::Document::addImageElementByCaseFoldedUsemap): Renamed to reflect the use
36         of case folding rather than lowercasing.
37         (WebCore::Document::removeImageElementByCaseFoldedUsemap): Ditto.
38         (WebCore::Document::imageElementByCaseFoldedUsemap): Ditto.
39         * dom/Document.h: Ditto.
40         * dom/DocumentOrderedMap.cpp:
41         (WebCore::DocumentOrderedMap::getElementByCaseFoldedMapName): Ditto.
42         (WebCore::DocumentOrderedMap::getElementByCaseFoldedUsemap): Ditto.
43         * dom/DocumentOrderedMap.h: Ditto.
44
45         * dom/TreeScope.cpp:
46         (WebCore::TreeScope::getImageMap): Removed unneeded special case for null string.
47         Simplified logic for cases where the URL does not have a "#" character in it.
48         Use case folding instead of lowercase.
49
50         * editing/cocoa/HTMLConverter.mm:
51         (HTMLConverter::_processText): Removed unneded special case for the empty string.
52         Use makCapitalized instead of Cocoa function for "capitalize". Use upper and lower
53         functions by their new names.
54
55         * html/HTMLImageElement.cpp:
56         (WebCore::HTMLImageElement::parseAttribute): Use case folding instead of
57         lowerasing for the usemap attribute.
58         (WebCore::HTMLImageElement::insertedInto): Ditto.
59         (WebCore::HTMLImageElement::removedFrom): Ditto.
60         (WebCore::HTMLImageElement::matchesCaseFoldedUsemap): Ditto.
61         * html/HTMLImageElement.h: Rename since usemap is case folded now, not lowercased.
62
63         * html/HTMLMapElement.cpp:
64         (WebCore::HTMLMapElement::imageElement): Use case folding instead of lowercasing
65         for usemap.
66         (WebCore::HTMLMapElement::parseAttribute): Ditto.
67
68         * platform/Language.cpp:
69         (WebCore::canonicalLanguageIdentifier): Use convertToASCIILowercase for language code.
70         (WebCore::indexOfBestMatchingLanguageInList): Ditto.
71
72         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
73         (WebCore::HarfBuzzShaper::shapeHarfBuzzRuns): Use new name for the upper function.
74
75         * platform/network/HTTPParsers.cpp:
76         (WebCore::parseContentTypeOptionsHeader): Use equalLettersIgnoringASCIICase instead
77         of lowercasing to check for a specific header value.
78
79         * platform/network/MIMEHeader.cpp:
80         (WebCore::retrieveKeyValuePairs): Use convertToASCIILowercase for MIME header name.
81         (WebCore::MIMEHeader::parseContentTransferEncoding): Use equalLettersIgnoringASCIICase
82         instead of lowercasing.
83
84         * platform/network/cf/ResourceHandleCFNet.cpp:
85         (WebCore::allowsAnyHTTPSCertificateHosts): Make this hash ASCII case-insensitive.
86         (WebCore::clientCertificates): Ditto.
87         (WebCore::ResourceHandle::createCFURLConnection): Remove call to lower since the
88         set is now ASCII case-insensitive.
89         (WebCore::ResourceHandle::setHostAllowsAnyHTTPSCertificate): Ditto.
90         (WebCore::ResourceHandle::setClientCertificate): Ditto.
91
92         * platform/network/curl/CookieJarCurl.cpp:
93         (WebCore::getNetscapeCookieFormat): Use equalLettersIgnoringASCIICase instead of
94         lowercasing.
95
96         * platform/network/curl/MultipartHandle.cpp:
97         (WebCore::MultipartHandle::didReceiveResponse): Use convertToASCIILowercase to
98         make a MIME type lowercase.
99
100         * platform/network/curl/ResourceHandleCurl.cpp:
101         (WebCore::ResourceHandle::setHostAllowsAnyHTTPSCertificate): Removed unneeded
102         conversion to lowercase now that the set is ASCII case-insensitive.
103         (WebCore::ResourceHandle::setClientCertificate): Removed code that populates a map
104         that is then never used for anything.
105
106         * platform/network/curl/ResourceHandleManager.cpp:
107         (WebCore::headerCallback): Use convertToASCIILowercase for MIME type.
108
109         * platform/network/curl/SSLHandle.cpp: Made hash maps keyed by host names
110         ASCII case-insensitive.
111         (WebCore::addAllowedClientCertificate): Removed lowercasing since the map itself
112         is now ASCII case insensitve.
113         (WebCore::setSSLClientCertificate): Ditto. Also use auto for iterator type so we
114         don't have to write out the map type.
115         (WebCore::sslIgnoreHTTPSCertificate): Ditto.
116         (WebCore::certVerifyCallback): Ditto.
117
118         * platform/network/soup/ResourceHandleSoup.cpp: Made hash maps keyed by host names
119         ASCII case-insensitive.
120         (WebCore::allowsAnyHTTPSCertificateHosts): Ditto.
121         (WebCore::handleUnignoredTLSErrors): Ditto.
122         (WebCore::ResourceHandle::setHostAllowsAnyHTTPSCertificate): Ditto.
123         (WebCore::ResourceHandle::setClientCertificate): Ditto.
124
125         * platform/text/LocaleToScriptMappingDefault.cpp: Made hash maps keyed by script
126         names ASCII case-insensitive. USE WTF_ARRAY_LENGTH as appropriate.
127         (WebCore::scriptNameToCode): Use modern style to initialize the map. Removed
128         unnecessary lowercasing of the script name before looking at the map.
129         (WebCore::localeToScriptCodeForFontSelection): Ditto.
130
131         * platform/text/win/LocaleWin.cpp:
132         (WebCore::convertLocaleNameToLCID): Made map ASCII case-insensitive and removed
133         unneeded lowercasing.
134
135         * platform/win/PasteboardWin.cpp:
136         (WebCore::clipboardTypeFromMIMEType): Use equalLettersIgnoringASCIICase instead
137         of lowercasing.
138
139         * rendering/RenderText.cpp:
140         (WebCore::applyTextTransform): Use new names for the upper and lower functions.
141
142         * xml/XMLHttpRequest.cpp:
143         (WebCore::XMLHttpRequest::responseIsXML): Remove unneeded lowercasing, since
144         DOMImplementation now has ASCII case-insensitive handling of MIME types.
145
146 2016-02-06  Zalan Bujtas  <zalan@apple.com>
147
148         Outline should contribute to visual overflow.
149         https://bugs.webkit.org/show_bug.cgi?id=153299
150
151         This patch eliminates the special outline handling (RenderView::setMaximalOutlineSize).
152         Now that outline is part of visual overflow, we don't have to inflate the layers to accomodate
153         outline borders.
154         This patch fixes several focusring related repaint issues. However when both the outline: auto
155         and the descendant renderer are composited, we still don't paint properly in certain cases. -not a regression.
156         (Also when parent renderer has overflow: hidden repaint does not take outline into account. -regression.)
157         It changes column behavior (see TestExpectations) since outline behaves now like any other visual overflow properties.
158
159         Reviewed by David Hyatt.
160
161         Test: fast/repaint/focus-ring-repaint.html
162               fast/repaint/focus-ring-repaint-with-negative-offset.html
163
164         * css/html.css: resetting to old behavior.
165         (:focus):
166         (input:focus, textarea:focus, isindex:focus, keygen:focus, select:focus):
167         * rendering/InlineFlowBox.cpp:
168         (WebCore::InlineFlowBox::addToLine):
169         (WebCore::InlineFlowBox::addOutlineVisualOverflow):
170         (WebCore::InlineFlowBox::computeOverflow):
171         (WebCore::InlineFlowBox::paint): Deleted.
172         * rendering/InlineFlowBox.h:
173         * rendering/RenderBlock.cpp:
174         (WebCore::RenderBlock::computeOverflow):
175         (WebCore::RenderBlock::outlineStyleForRepaint):
176         (WebCore::RenderBlock::paint): Deleted.
177         * rendering/RenderBlockFlow.cpp:
178         (WebCore::RenderBlockFlow::layoutBlock): Deleted.
179         (WebCore::RenderBlockFlow::addFocusRingRectsForInlineChildren): Deleted.
180         * rendering/RenderBlockLineLayout.cpp:
181         (WebCore::RenderBlockFlow::addOverflowFromInlineChildren):
182         * rendering/RenderBox.cpp:
183         (WebCore::RenderBox::addVisualEffectOverflow):
184         (WebCore::RenderBox::applyVisualEffectOverflow):
185         (WebCore::RenderBox::clippedOverflowRectForRepaint): Deleted.
186         * rendering/RenderBoxModelObject.h:
187         * rendering/RenderDetailsMarker.cpp:
188         (WebCore::RenderDetailsMarker::paint): Deleted.
189         * rendering/RenderElement.cpp:
190         (WebCore::RenderElement::insertChildInternal):
191         (WebCore::RenderElement::styleDidChange):
192         (WebCore::RenderElement::repaintAfterLayoutIfNeeded):
193         (WebCore::RenderElement::issueRepaintForOutlineAuto):
194         (WebCore::RenderElement::updateOutlineAutoAncestor):
195         (WebCore::RenderElement::computeMaxOutlineSize): Deleted.
196         (WebCore::RenderElement::styleWillChange): Deleted.
197         * rendering/RenderElement.h:
198         (WebCore::RenderElement::hasContinuation):
199         * rendering/RenderInline.cpp:
200         (WebCore::RenderInline::paintOutlineForLine): Deleted.
201         * rendering/RenderLayer.cpp:
202         (WebCore::RenderLayer::calculateClipRects):
203         * rendering/RenderLineBoxList.cpp:
204         (WebCore::RenderLineBoxList::anyLineIntersectsRect):
205         (WebCore::RenderLineBoxList::lineIntersectsDirtyRect):
206         (WebCore::RenderLineBoxList::paint):
207         (WebCore::isOutlinePhase): Deleted.
208         * rendering/RenderLineBoxList.h:
209         * rendering/RenderListBox.cpp:
210         (WebCore::RenderListBox::computePreferredLogicalWidths):
211         * rendering/RenderListMarker.cpp:
212         (WebCore::RenderListMarker::paint): Deleted.
213         * rendering/RenderObject.cpp:
214         (WebCore::RenderObject::propagateRepaintToParentWithOutlineAutoIfNeeded): The renderer with outline: auto is responsible for
215         painting focusring around the descendants. If we issued repaint only on the descendant when it changes,
216         the focusring would not refresh properly. We have to find the ancestor with outline: auto, inflate the repaint rect and
217         issue the repaint on the ancestor if we crossed repaint container.
218  
219         (WebCore::RenderObject::repaintUsingContainer):
220         (WebCore::RenderObject::adjustRectForOutlineAndShadow):
221         (WebCore::RenderObject::setHasOutlineAutoAncestor):
222         (WebCore::RenderObject::adjustRectWithMaximumOutline): Deleted.
223         
224         * rendering/RenderObject.h: We mark the descendants of outline: auto so that
225         when a child renderer changes we can propagate the repaint to the ancestor with outline.
226
227         (WebCore::RenderObject::hasOutlineAutoAncestor):
228         (WebCore::RenderObject::RenderObjectRareData::RenderObjectRareData):
229         * rendering/RenderRegion.cpp:
230         (WebCore::RenderRegion::overflowRectForFlowThreadPortion):
231         * rendering/RenderReplaced.cpp:
232         (WebCore::RenderReplaced::shouldPaint): Deleted.
233         (WebCore::RenderReplaced::clippedOverflowRectForRepaint): Deleted.
234         * rendering/RenderTable.cpp:
235         (WebCore::RenderTable::paint): Deleted.
236         * rendering/RenderTableCell.cpp:
237         (WebCore::RenderTableCell::clippedOverflowRectForRepaint): Deleted.
238         (WebCore::RenderTableCell::paintCollapsedBorders): Deleted.
239         * rendering/RenderTableRow.cpp:
240         (WebCore::RenderTableRow::layout):
241         (WebCore::RenderTableRow::clippedOverflowRectForRepaint): Deleted.
242         * rendering/RenderTableSection.cpp:
243         (WebCore::RenderTableSection::layoutRows):
244         (WebCore::RenderTableSection::computeOverflowFromCells): Deleted.
245         (WebCore::RenderTableSection::paintObject): Deleted.
246         * rendering/RenderTheme.h:
247         (WebCore::RenderTheme::platformFocusRingWidth):
248         * rendering/RenderView.cpp:
249         (WebCore::RenderView::setMaximalOutlineSize): Deleted.
250         * rendering/RenderView.h:
251         * rendering/style/RenderStyle.cpp:
252         (WebCore::RenderStyle::changeAffectsVisualOverflow):
253         (WebCore::RenderStyle::outlineWidth):
254         * rendering/style/RenderStyle.h:
255
256 2016-02-06  Andreas Kling  <akling@apple.com>
257
258         [iOS] Throw away linked code when navigating to a new page.
259         <https://webkit.org/b/153851>
260
261         Reviewed by Gavin Barraclough.
262
263         When navigating to a new page, tell JSC to throw out any linked code it has lying around.
264         Linked code is tied to a specific global object, and as we're creating a new one for the
265         new page, none of it is useful to us here.
266
267         In the event that the user navigates back, the cost of relinking some code will be far
268         lower than the memory cost of keeping all of it around.
269
270         This landed previously but was rolled out due to a Speedometer regression. I've made one
271         minor but important change here: only throw away code if we're navigating away from an
272         existing history item. Or in other words, don't throw away code for "force peeks" or any
273         other navigations that are not traditional top-level main frame navigations.
274
275         * bindings/js/GCController.cpp:
276         (WebCore::GCController::deleteAllLinkedCode):
277         * bindings/js/GCController.h:
278         * loader/FrameLoader.cpp:
279         (WebCore::FrameLoader::commitProvisionalLoad):
280
281 2016-02-06  Konstantin Tokarev  <annulen@yandex.ru>
282
283         Added implementations of AXObjectCache methods for !HAVE(ACCESSIBILITY).
284         https://bugs.webkit.org/show_bug.cgi?id=153924
285
286         Reviewed by Andreas Kling.
287
288         No new tests needed.
289
290         * accessibility/AXObjectCache.h:
291         (WebCore::AXObjectCache::ariaModalNode): Added stub implementation.
292         (WebCore::AXObjectCache::postLiveRegionChangeNotification): Ditto.
293         (WebCore::AXObjectCache::rangeForNodeContents): Ditto.
294         (WebCore::AXObjectCache::setIsSynchronizingSelection): Ditto.
295         (WebCore::AXObjectCache::setTextSelectionIntent): Ditto.
296         (WebCore::AXAttributeCacheEnabler::AXAttributeCacheEnabler): Ditto.
297         (WebCore::AXAttributeCacheEnabler::~AXAttributeCacheEnabler): Ditto.
298
299 2016-02-04  Antti Koivisto  <antti@apple.com>
300
301         Use scope stack instead of nested TreeResolvers for shadow trees
302         https://bugs.webkit.org/show_bug.cgi?id=153893
303
304         Reviewed by Andreas Kling.
305
306         Make TreeResolver per-document. This is a step towards iterative style resolve.
307
308         This is done replacing use of nested TreeResolvers with a scope stack that maintains
309         the style resolver and the selector filter for the current tree scope.
310
311         * style/StyleTreeResolver.cpp:
312         (WebCore::Style::ensurePlaceholderStyle):
313         (WebCore::Style::TreeResolver::Scope::Scope):
314         (WebCore::Style::TreeResolver::TreeResolver):
315         (WebCore::Style::shouldCreateRenderer):
316         (WebCore::Style::TreeResolver::styleForElement):
317         (WebCore::Style::TreeResolver::createRenderTreeForShadowRoot):
318         (WebCore::Style::TreeResolver::createRenderTreeForSlotAssignees):
319         (WebCore::Style::TreeResolver::createRenderTreeRecursively):
320         (WebCore::Style::TreeResolver::resolveLocally):
321         (WebCore::Style::TreeResolver::resolveShadowTree):
322         (WebCore::Style::TreeResolver::resolveBeforeOrAfterPseudoElement):
323         (WebCore::Style::TreeResolver::resolveChildren):
324         (WebCore::Style::TreeResolver::resolveSlotAssignees):
325         (WebCore::Style::TreeResolver::resolveRecursively):
326         (WebCore::Style::TreeResolver::resolve):
327         (WebCore::Style::detachRenderTree):
328         * style/StyleTreeResolver.h:
329         (WebCore::Style::TreeResolver::scope):
330         (WebCore::Style::TreeResolver::pushScope):
331         (WebCore::Style::TreeResolver::pushEnclosingScope):
332         (WebCore::Style::TreeResolver::popScope):
333
334 2016-02-06  Commit Queue  <commit-queue@webkit.org>
335
336         Unreviewed, rolling out r196104.
337         https://bugs.webkit.org/show_bug.cgi?id=153940
338
339         Regressed Speedometer on iOS (Requested by kling on #webkit).
340
341         Reverted changeset:
342
343         "[iOS] Throw away linked code when navigating to a new page."
344         https://bugs.webkit.org/show_bug.cgi?id=153851
345         http://trac.webkit.org/changeset/196104
346
347 2016-02-05  Beth Dakin  <bdakin@apple.com>
348
349         ScrollbarPainters needs to be deallocated on the main thread
350         https://bugs.webkit.org/show_bug.cgi?id=153932
351         -and corresponding-
352         rdar://problem/24015483
353
354         Reviewed by Geoff Garen.
355
356         Follow-up fix since the first one was still race-y.
357         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
358         (WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac):
359         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
360
361 2016-02-05  Beth Dakin  <bdakin@apple.com>
362
363         ScrollbarPainters needs to be deallocated on the main thread
364         https://bugs.webkit.org/show_bug.cgi?id=153932
365         -and corresponding-
366         rdar://problem/24015483
367
368         Reviewed by Tim Horton.
369
370         Ensure the the destructor of ScrollingTreeFrameScrollingNodeMac and the 
371         assignments done in this class are not responsible for deallocating the 
372         ScrollbarPainter. 
373         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
374         (WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac):
375         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
376
377 2016-02-05  Chris Dumez  <cdumez@apple.com>
378
379         Instance property getters / setters cannot be called on another instance of the same type
380         https://bugs.webkit.org/show_bug.cgi?id=153895
381
382         Reviewed by Gavin Barraclough.
383
384         It should be possible to call instance property getters / setters on
385         other instances of the same type, as per the WEB IDL specification:
386         - http://heycam.github.io/webidl/#dfn-attribute-getter
387         - http://heycam.github.io/webidl/#dfn-attribute-setter
388
389         This matches the behavior of Firefox.
390
391         The issue without our bindings was that the getters / setters were
392         using |slotBase| instead of |thisValue| and therefore ended up using
393         the instance the getter was taken from instead of the actual target
394         object.
395
396         Test:
397         js/instance-property-getter-other-instance.html
398         js/instance-property-setter-other-instance.html
399
400         * bindings/scripts/CodeGeneratorJS.pm:
401         (GenerateImplementation):
402         - Have instance getters / setters use thisValue instead of slotBase.
403         - In the case of interfaces that have attributes on the instance for
404           compatibility reasons, try the prototype object if |thisValue| does
405           does have the right type, instead of using slotBase like previously.
406           I believe this maintains the original compatibility intention while
407           also behaving correctly when called on another instance.
408
409         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
410         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
411         * bindings/scripts/test/JS/JSTestException.cpp:
412         * bindings/scripts/test/JS/JSTestInterface.cpp:
413         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
414         * bindings/scripts/test/JS/JSTestNode.cpp:
415         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
416         * bindings/scripts/test/JS/JSTestObj.cpp:
417         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
418         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
419         * bindings/scripts/test/JS/JSattribute.cpp:
420         Rebaseline bindings tests.
421
422 2016-02-05  Brady Eidson  <beidson@apple.com>
423
424         Modern IDB: UniqueIDBDatabase's m_databaseInfo is unsafely used from multiple threads.
425         https://bugs.webkit.org/show_bug.cgi?id=153912
426
427         Reviewed by Alex Christensen.
428
429         No new tests (Anything testable about this patch is already covered by existing tests).
430
431         * Modules/indexeddb/server/IDBBackingStore.h:
432
433         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
434         (WebCore::IDBServer::MemoryIDBBackingStore::infoForObjectStore):
435         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
436
437         Teach the SQLiteIDBBackingStore to actually keep its m_databaseInfo up to date as it changes,
438         and to revert it when version change transactions abort:
439         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
440         (WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction):
441         (WebCore::IDBServer::SQLiteIDBBackingStore::abortTransaction):
442         (WebCore::IDBServer::SQLiteIDBBackingStore::commitTransaction):
443         (WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
444         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore):
445         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
446         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
447         (WebCore::IDBServer::SQLiteIDBBackingStore::infoForObjectStore):
448         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
449
450         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
451         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd): Use the IDBBackingStore's copy of the 
452           IDBObjectStoreInfo, meant only for the database thread, instead of the UniqueIDBDatabase's copy, 
453           which is meant only for the main thread.
454
455 2016-02-05  Alex Christensen  <achristensen@webkit.org>
456
457         Clean up Blob code
458         https://bugs.webkit.org/show_bug.cgi?id=153910
459
460         Reviewed by Alexey Proskuryakov.
461
462         No new tests, no change in behavior.
463
464         * css/StyleSheet.h:
465         * fileapi/Blob.cpp:
466         (WebCore::Blob::Blob):
467         (WebCore::Blob::normalizedContentType):
468         (WebCore::Blob::isNormalizedContentType):
469         (WebCore::Blob::registry):
470         * fileapi/Blob.h:
471         * fileapi/BlobURL.cpp:
472         (WebCore::BlobURL::createPublicURL):
473         * fileapi/BlobURL.h:
474         (WebCore::BlobURL::BlobURL):
475         (WebCore::BlobURL::blobProtocol): Deleted.
476         * platform/PlatformStrategies.cpp:
477         (WebCore::setPlatformStrategies):
478         (WebCore::hasPlatformStrategies): Deleted.
479         * platform/PlatformStrategies.h:
480         * platform/network/BlobRegistry.cpp:
481         (WebCore::blobRegistry):
482         * platform/network/BlobRegistry.h:
483         * platform/network/BlobRegistryImpl.cpp:
484         (WebCore::BlobRegistryImpl::~BlobRegistryImpl):
485         (WebCore::createResourceHandle):
486         (WebCore::registerBlobResourceHandleConstructor):
487         (WebCore::BlobRegistryImpl::createResourceHandle):
488         (WebCore::BlobRegistryImpl::appendStorageItems):
489         (WebCore::BlobRegistryImpl::registerFileBlobURL):
490         (WebCore::BlobRegistryImpl::registerBlobURL):
491         * platform/network/BlobRegistryImpl.h:
492         * platform/network/BlobResourceHandle.cpp:
493         (WebCore::BlobResourceHandle::loadResourceSynchronously):
494         (WebCore::BlobResourceHandle::BlobResourceHandle):
495         * platform/network/ResourceHandle.h:
496
497 2016-02-05  Carlos Garcia Campos  <cgarcia@igalia.com>
498
499         [GTK] Scrollbars incorrectly rendered with older versions of GTK+
500         https://bugs.webkit.org/show_bug.cgi?id=153861
501
502         Reviewed by Michael Catanzaro.
503
504         The theme doesn't really know it's a scrollbar. Older versions of
505         GTK+ require to explicitly add the scrollbar style class to the
506         child GtkStyleContext.
507
508         * platform/gtk/ScrollbarThemeGtk.cpp:
509         (WebCore::createChildStyleContext):
510
511 2016-02-05  Carlos Garcia Campos  <cgarcia@igalia.com>
512
513         [GTK] Scrollbars not correctly rendered in non GNOME environments
514         https://bugs.webkit.org/show_bug.cgi?id=153860
515
516         Reviewed by Michael Catanzaro.
517
518         I noticed this in a matchbox environment, where there's no
519         gnome-setting-daemon running. The problem is only with the
520         scrollbars, because we initialize the GtkSettings in
521         RenderThemeGtk and notify the ScrollbarTheme when it changes, but
522         ScrollbarTheme is created before RenderThemeGtk so we initialize
523         the theme properties before the GtkSettings have been
524         initialized. We can just let the ScrollbarTheme monitor the
525         theme itself instead of relying on being notified by the WebCore
526         layer.
527
528         * platform/gtk/ScrollbarThemeGtk.cpp:
529         (WebCore::themeChangedCallback):
530         (WebCore::ScrollbarThemeGtk::ScrollbarThemeGtk):
531         * rendering/RenderThemeGtk.cpp:
532         (WebCore::gtkStyleChangedCallback): Deleted.
533
534 2016-02-05  Youenn Fablet  <youenn.fablet@crf.canon.fr>
535
536         Remove DOMWrapped parameter from JSKeyValueIterator
537         https://bugs.webkit.org/show_bug.cgi?id=153859
538
539         Reviewed by Sam Weinig.
540
541         No change in behavior.
542
543         Using std::declval to infer DOMWrapped from JSWrapper::wrapped.
544
545         * bindings/js/JSFetchHeadersCustom.cpp:
546         (WebCore::JSFetchHeaders::entries):
547         (WebCore::JSFetchHeaders::keys):
548         (WebCore::JSFetchHeaders::values):
549         * bindings/js/JSKeyValueIterator.h:
550         (WebCore::createIterator):
551         (WebCore::JSKeyValueIterator<JSWrapper>::destroy):
552         (WebCore::JSKeyValueIterator<JSWrapper>::next):
553         (WebCore::JSKeyValueIteratorPrototypeFunctionNext):
554         (WebCore::JSKeyValueIteratorPrototype<JSWrapper>::finishCreation):
555
556 2016-02-05  Nan Wang  <n_wang@apple.com>
557
558         AX: WebKit hanging when VoiceOver attempts to focus in on page
559         https://bugs.webkit.org/show_bug.cgi?id=153899
560         <rdar://problem/24506603>
561
562         Reviewed by Chris Fleizach.
563
564         The VisiblePosition to CharacterOffset conversion will lead to an infinite loop if the
565         nextVisiblePostion call is returning the original VisiblePosition. Fixed it by breaking out
566         of the loop early in that situation. 
567
568         Test: accessibility/text-marker/character-offset-visible-position-conversion-hang.html
569
570         * accessibility/AXObjectCache.cpp:
571         (WebCore::AXObjectCache::characterOffsetFromVisiblePosition):
572
573 2016-02-04  Joseph Pecoraro  <pecoraro@apple.com>
574
575         Web Inspector: InspectorTimelineAgent doesn't need to recompile functions because it now uses the sampling profiler
576         https://bugs.webkit.org/show_bug.cgi?id=153500
577         <rdar://problem/24352458>
578
579         Reviewed by Timothy Hatcher.
580
581         * bindings/js/JSDOMWindowBase.cpp:
582         (WebCore::JSDOMWindowBase::supportsLegacyProfiling):
583         (WebCore::JSDOMWindowBase::supportsRichSourceInfo):
584         (WebCore::JSDOMWindowBase::supportsProfiling): Deleted.
585         * bindings/js/JSDOMWindowBase.h:
586         * bindings/js/JSWorkerGlobalScopeBase.cpp:
587         (WebCore::JSWorkerGlobalScopeBase::supportsLegacyProfiling):
588         (WebCore::JSWorkerGlobalScopeBase::supportsProfiling): Deleted.
589         * bindings/js/JSWorkerGlobalScopeBase.h:
590         * inspector/InspectorController.h:
591         * inspector/InspectorController.cpp:
592         (WebCore::InspectorController::legacyProfilerEnabled):
593         (WebCore::InspectorController::setLegacyProfilerEnabled):
594         Be more explicit about enabling legacy profiling.
595
596         * inspector/InspectorTimelineAgent.cpp:
597         (WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
598         (WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend): Deleted.
599         TimelineAgent doesn't need to recompile if using the sampling profiler.
600         This breaks console.profile, but console.profile should move to using
601         the sampling profiler as well.
602
603         (WebCore::InspectorTimelineAgent::startFromConsole):
604         (WebCore::InspectorTimelineAgent::stopFromConsole):
605         (WebCore::startProfiling): Deleted.
606         (WebCore::stopProfiling): Deleted.
607         Inlined the use once static functions.
608
609         * page/PageConsoleClient.cpp:
610         (WebCore::PageConsoleClient::profile):
611         (WebCore::PageConsoleClient::profileEnd):
612         Added FIXMEs for improving console.profile and profileEnd.
613
614         * testing/Internals.cpp:
615         (WebCore::Internals::resetToConsistentState):
616         (WebCore::Internals::setLegacyJavaScriptProfilingEnabled):
617         (WebCore::Internals::setJavaScriptProfilingEnabled): Deleted.
618         * testing/Internals.h:
619         * testing/Internals.idl:
620         Be more explicit about enabling legacy profiling.
621
622 2016-02-04  Brent Fulgham  <bfulgham@apple.com>
623
624         Follow-up: Add "WebKit built-in PDF" Plugin to set of publicly visible plugins
625         https://bugs.webkit.org/show_bug.cgi?id=153657
626         <rdar://problem/24413107>
627
628         Reviewed by Darin Adler.
629
630         * plugins/PluginData.cpp:
631         (WebCore::shouldBePubliclyVisible): Revise comments to provide a
632         better explanation of the function and why it exists.
633
634 2016-02-04  Jonathan Davis  <jond@apple.com>
635
636         Add Fetch API and CSS Variables to feature status
637         https://bugs.webkit.org/show_bug.cgi?id=153896
638
639         Reviewed by Timothy Hatcher.
640
641         * features.json:
642
643 2016-02-04  Daniel Bates  <dabates@apple.com>
644
645         WebKit for iOS Simulator fails to build with public iOS SDK
646         https://bugs.webkit.org/show_bug.cgi?id=153881
647
648         Reviewed by Alex Christensen.
649
650         Make constants have internal linkage to match the Apple Internal SDK.
651
652         * platform/spi/ios/MobileGestaltSPI.h:
653
654 2016-02-04  Chris Dumez  <cdumez@apple.com>
655
656         Object.getOwnPropertyDescriptor() returns incomplete descriptor for instance properties
657         https://bugs.webkit.org/show_bug.cgi?id=153817
658
659         Reviewed by Geoffrey Garen.
660
661         Update the bindings generator so that property getters / setters now
662         make sure |this| has the right type and throw a TypeError if it does
663         not, as per:
664         - http://heycam.github.io/webidl/#dfn-attribute-getter (step 2.4.2)
665         - http://heycam.github.io/webidl/#dfn-attribute-setter (step 3.5)
666
667         This was an issue when doing something like:
668         Object.getOwnPropertyDescriptor(window, "location").get.call(nonWindow)
669
670         We would call toJSDOMWindow(thisValue), which would return null as
671         thisValue is not a JSDOMWindow. We would then dereference this null
672         pointer and crash. We now do a null check and throw a TypeError in
673         this case, as per the Web IDL specification.
674
675         The generated bindings still have some non-spec compliant behavior
676         though:
677         1. The getters / setters of instance properties use slotBase instead
678            of thisValue, which means that calling instanceA's getter on
679            instanceB returns instanceA's property insteas of instanceB's.
680         2. Global object property getters should not require an explicit
681            |this| so calling the following should work:
682            - Object.getOwnPropertyDescriptor(window, "location").get.call()
683            We currently throw in this case.
684
685         These issues will be addressed in follow-up patches.
686
687         Tests: js/getOwnPropertyDescriptor-unforgeable-attributes.html
688                js/getOwnPropertyDescriptor-window-attributes.html
689                js/instance-property-getter-other-instance.html
690
691         * bindings/scripts/CodeGeneratorJS.pm:
692         (GenerateImplementation):
693         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
694         (WebCore::jsTestActiveDOMObjectExcitingAttr):
695         * bindings/scripts/test/JS/JSTestException.cpp:
696         (WebCore::jsTestExceptionName):
697         * bindings/scripts/test/JS/JSTestObj.cpp:
698         (WebCore::jsTestObjConstructorTestSubObj):
699         (WebCore::jsTestObjTestSubObjEnabledBySettingConstructor):
700         (WebCore::jsTestObjConditionalAttr4Constructor):
701         (WebCore::jsTestObjConditionalAttr5Constructor):
702         (WebCore::jsTestObjConditionalAttr6Constructor):
703         (WebCore::jsTestObjContentDocument):
704         (WebCore::setJSTestObjTestSubObjEnabledBySettingConstructor):
705         (WebCore::setJSTestObjConditionalAttr4Constructor):
706         (WebCore::setJSTestObjConditionalAttr5Constructor):
707         (WebCore::setJSTestObjConditionalAttr6Constructor):
708         (WebCore::setJSTestObjConstructor): Deleted.
709         (WebCore::setJSTestObjConstructorStaticStringAttr): Deleted.
710         (WebCore::setJSTestObjConditionalAttr3): Deleted.
711         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
712         (WebCore::jsTestTypedefsConstructorTestSubObj):
713
714 2016-02-04  Brady Eidson  <beidson@apple.com>
715
716         Modern IDB: LayoutTest imported/w3c/indexeddb/keyorder-private.html is flaky.
717         https://bugs.webkit.org/show_bug.cgi?id=153438.
718
719         Reviewed by Alex Christensen.
720
721         Tests: storage/indexeddb/modern/idbkey-array-equality-private.html
722                storage/indexeddb/modern/idbkey-array-equality.html
723
724         * Modules/indexeddb/IDBKeyData.cpp:
725         (WebCore::IDBKeyData::loggingString):
726         (WebCore::IDBKeyData::operator==): Fix obvious bug.
727
728 2016-02-04  Chris Dumez  <cdumez@apple.com>
729
730         Unreviewed, fix the EFL clean build after r196123
731         https://bugs.webkit.org/show_bug.cgi?id=153875
732
733         * CMakeLists.txt:
734         * PlatformGTK.cmake:
735         * PlatformMac.cmake:
736         * html/DOMSettableTokenList.h:
737         * html/DOMSettableTokenList.idl:
738
739 2016-02-04  Eric Carlson  <eric.carlson@apple.com>
740
741         PageGroup::captionPreferences should return a reference
742         https://bugs.webkit.org/show_bug.cgi?id=153877
743         <rdar://problem/24506917>
744
745         Reviewed by Jer Noble.
746
747         No new tests, no functional change.
748
749         * Modules/mediacontrols/MediaControlsHost.cpp:
750         (WebCore::MediaControlsHost::sortedTrackListForMenu):
751         (WebCore::MediaControlsHost::displayNameForTrack):
752         (WebCore::MediaControlsHost::captionMenuOffItem):
753         (WebCore::MediaControlsHost::captionDisplayMode):
754         * dom/Document.cpp:
755         (WebCore::Document::registerForCaptionPreferencesChangedCallbacks):
756         * html/HTMLMediaElement.cpp:
757         (WebCore::HTMLMediaElement::HTMLMediaElement):
758         (WebCore::HTMLMediaElement::addTextTrack):
759         (WebCore::HTMLMediaElement::configureTextTrackGroup):
760         (WebCore::HTMLMediaElement::setSelectedTextTrack):
761         (WebCore::HTMLMediaElement::configureTextTracks):
762         (WebCore::HTMLMediaElement::captionPreferencesChanged):
763         (WebCore::HTMLMediaElement::mediaPlayerPreferredAudioCharacteristics):
764         * html/shadow/MediaControlElements.cpp:
765         (WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay):
766         (WebCore::MediaControlClosedCaptionsTrackListElement::rebuildTrackListMenu):
767         (WebCore::MediaControlTextTrackContainerElement::updateActiveCuesFontSize):
768         * page/PageGroup.cpp:
769         (WebCore::PageGroup::captionPreferencesChanged):
770         (WebCore::PageGroup::captionPreferences):
771         * page/PageGroup.h:
772         * platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
773         (WebVideoFullscreenModelVideoElement::updateLegibleOptions):
774         * testing/InternalSettings.cpp:
775         (WebCore::InternalSettings::setShouldDisplayTrackKind):
776         (WebCore::InternalSettings::shouldDisplayTrackKind):
777         * testing/Internals.cpp:
778         (WebCore::Internals::resetToConsistentState):
779         (WebCore::Internals::Internals):
780         (WebCore::Internals::userPreferredAudioCharacteristics):
781         (WebCore::Internals::setUserPreferredAudioCharacteristic):
782         (WebCore::Internals::captionsStyleSheetOverride):
783         (WebCore::Internals::setCaptionsStyleSheetOverride):
784         (WebCore::Internals::setPrimaryAudioTrackLanguageOverride):
785         (WebCore::Internals::setCaptionDisplayMode):
786
787 2016-02-04  Konstantin Tokarev  <annulen@yandex.ru>
788
789         Removed unused Settings::setPrivateBrowsingEnabled.
790         https://bugs.webkit.org/show_bug.cgi?id=153869
791
792         Reviewed by Alexey Proskuryakov.
793
794         Implementation of Settings::setPrivateBrowsingEnabled was removed
795         in r166661, but declaration is still here.
796
797         No new tests needed.
798
799         * page/Settings.h:
800         (WebCore::Settings::setPrivateBrowsingEnabled): Deleted.
801
802 2016-02-04  Eric Carlson  <eric.carlson@apple.com>
803
804         Don't discard in-band cues with negative start times
805         https://bugs.webkit.org/show_bug.cgi?id=153867
806         <rdar://problem/19588632>
807
808         Reviewed by Jer Noble.
809
810         No new tests, updated and un-skipped http/tests/media/track-in-band-hls-metadata.html.
811
812         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp:
813         (WebCore::InbandMetadataTextTrackPrivateAVF::addDataCue):  ASSERT if passed negative time value.
814         (WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes): Ditto. Correct logging.
815
816         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
817         (WebCore::MediaPlayerPrivateAVFoundationObjC::processCue): ASSERT if passed negative time value.
818         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive): Convert negative cue times to zero.
819         (-[WebCoreAVFMovieObserver legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:]):
820           Ditto.
821
822 2016-02-04  Hyemi Shin  <hyemi.sin@samsung.com>
823
824         Specify an exception for createChannelMerger, createChannelSplitter and createPeriodicWave
825         https://bugs.webkit.org/show_bug.cgi?id=150925
826
827         Reviewed by Darin Adler.
828
829         createChannelMerger and createChannelSplitter should throw INDEX_SIZE_ERR
830         for invalid numberOfInputs value.
831         createPeriodicWave should throw INDEX_SIZE_ERR for invalid lengths of parameters.
832
833         Tests: webaudio/audiochannelmerger-basic.html
834                webaudio/audiochannelsplitter.html
835                webaudio/periodicwave-lengths.html
836
837         * Modules/webaudio/AudioContext.cpp:
838         (WebCore::AudioContext::createChannelSplitter):
839         (WebCore::AudioContext::createChannelMerger):
840         (WebCore::AudioContext::createPeriodicWave):
841
842 2016-02-04  Youenn Fablet  <youenn.fablet@crf.canon.fr>
843
844         [Fetch API] Add support for iterating over Headers
845         https://bugs.webkit.org/show_bug.cgi?id=153787
846
847         Reviewed by Darin Adler.
848
849         Relanding, updating bindings/js/JSKeyValueIterator.h for Windows bots.
850
851         Covered by updated tests.
852         Introducing template class (JSKeyValueIterator) to support key-value iterators in DOM classes.
853         Using JSKeyValueIterator to implement Headers entries(), keys() and values() as custom methods.
854         Binding generator should be updated to generate directly these custom methods and handle iterator Symbol.
855
856         * CMakeLists.txt:
857         * Modules/fetch/FetchHeaders.cpp:
858         (WebCore::FetchHeaders::Iterator::next):
859         (WebCore::FetchHeaders::Iterator::Iterator):
860         * Modules/fetch/FetchHeaders.h:
861         (WebCore::FetchHeaders::createIterator):
862         * Modules/fetch/FetchHeaders.idl:
863         * WebCore.xcodeproj/project.pbxproj:
864         * bindings/js/JSBindingsAllInOne.cpp:
865         * bindings/js/JSDOMBinding.h:
866         (WebCore::jsPair):
867         * bindings/js/JSFetchHeadersCustom.cpp: Added.
868         (WebCore::JSFetchHeaders::entries):
869         (WebCore::JSFetchHeaders::keys):
870         (WebCore::JSFetchHeaders::values):
871         * bindings/js/JSKeyValueIterator.h: Added.
872         (WebCore::JSKeyValueIteratorPrototype::create):
873         (WebCore::JSKeyValueIteratorPrototype::createStructure):
874         (WebCore::JSKeyValueIteratorPrototype::JSKeyValueIteratorPrototype):
875         (WebCore::createIterator):
876         (WebCore::DOMWrapped>::destroy):
877         (WebCore::DOMWrapped>::next):
878         (WebCore::DOMWrapped>::finishCreation):
879
880 2016-02-04  Chris Dumez  <cdumez@apple.com>
881
882         Merge DOMTokenList and DOMSettableTokenList
883         https://bugs.webkit.org/show_bug.cgi?id=153677
884         <rdar://problem/24419675>
885
886         Reviewed by Sam Weinig.
887
888         Merge DOMTokenList and DOMSettableTokenList, as per a recent
889         specification change:
890         - https://github.com/whatwg/dom/pull/120
891         - https://github.com/whatwg/html/issues/361
892
893         No new tests, already covered by existing tests.
894
895         * CMakeLists.txt:
896         * DerivedSources.cpp:
897         * WebCore.vcxproj/WebCore.vcxproj:
898         * WebCore.vcxproj/WebCore.vcxproj.filters:
899         * WebCore.xcodeproj/project.pbxproj:
900         * dom/Element.idl:
901         * dom/Node.h:
902         * dom/NodeRareData.h:
903         * html/AttributeDOMTokenList.h:
904         * html/DOMSettableTokenList.cpp: Removed.
905         * html/DOMSettableTokenList.h:
906         * html/DOMSettableTokenList.idl:
907         * html/DOMTokenList.cpp:
908         (WebCore::DOMTokenList::setValue):
909         * html/DOMTokenList.h:
910         * html/DOMTokenList.idl:
911         * html/HTMLAnchorElement.idl:
912         * html/HTMLAreaElement.idl:
913         * html/HTMLElement.cpp:
914         * html/HTMLElement.idl:
915         * html/HTMLIFrameElement.cpp:
916         (WebCore::HTMLIFrameElement::sandbox):
917         * html/HTMLIFrameElement.h:
918         * html/HTMLIFrameElement.idl:
919         * html/HTMLLinkElement.cpp:
920         (WebCore::HTMLLinkElement::sizes):
921         * html/HTMLLinkElement.h:
922         * html/HTMLLinkElement.idl:
923         * html/HTMLOutputElement.cpp:
924         (WebCore::HTMLOutputElement::htmlFor):
925         * html/HTMLOutputElement.h:
926         * html/HTMLOutputElement.idl:
927         * html/HTMLTableCellElement.idl:
928         * page/DOMWindow.cpp:
929         * page/DOMWindow.idl:
930
931 2016-02-04  Youenn Fablet  <youenn.fablet@crf.canon.fr>
932
933         Unreviewed.
934         Reverting r196115 and r19116, related tohttps://bugs.webkit.org/show_bug.cgi?id=153787.
935
936 2016-02-04  Alejandro G. Castro  <alex@igalia.com>
937
938         [GTK] Implement mediastream mediaplayer
939         https://bugs.webkit.org/show_bug.cgi?id=153541
940
941         Reviewed by Martin Robinson.
942
943         Added the implementation of the mediaplayer for the
944         mediastream. The code was implemented by Philippe Normand and
945         Alessandro Decina.
946
947         * PlatformGTK.cmake: Added the file to the compilation.
948         * html/HTMLMediaElement.cpp:
949         (WebCore::HTMLMediaElement::setSrcObject): Set the src of the
950         media element to the mediastream.
951         * platform/graphics/MediaPlayer.cpp:
952         (WebCore::buildMediaEnginesVector): Register the mediastream
953         mediaplayer as an option in the media engines vector.
954         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp: Added.
955         (WebCore::MediaPlayerPrivateGStreamerOwr::MediaPlayerPrivateGStreamerOwr):
956         (WebCore::MediaPlayerPrivateGStreamerOwr::~MediaPlayerPrivateGStreamerOwr):
957         (WebCore::MediaPlayerPrivateGStreamerOwr::play):
958         (WebCore::MediaPlayerPrivateGStreamerOwr::pause):
959         (WebCore::MediaPlayerPrivateGStreamerOwr::hasVideo):
960         (WebCore::MediaPlayerPrivateGStreamerOwr::hasAudio):
961         (WebCore::MediaPlayerPrivateGStreamerOwr::currentTime):
962         (WebCore::MediaPlayerPrivateGStreamerOwr::load):
963         (WebCore::MediaPlayerPrivateGStreamerOwr::loadingFailed):
964         (WebCore::MediaPlayerPrivateGStreamerOwr::didLoadingProgress):
965         (WebCore::MediaPlayerPrivateGStreamerOwr::internalLoad):
966         (WebCore::MediaPlayerPrivateGStreamerOwr::stop):
967         (WebCore::MediaPlayerPrivateGStreamerOwr::registerMediaEngine):
968         (WebCore::MediaPlayerPrivateGStreamerOwr::getSupportedTypes):
969         (WebCore::MediaPlayerPrivateGStreamerOwr::supportsType):
970         (WebCore::MediaPlayerPrivateGStreamerOwr::isAvailable):
971         (WebCore::MediaPlayerPrivateGStreamerOwr::createGSTAudioSinkBin):
972         (WebCore::MediaPlayerPrivateGStreamerOwr::sourceStopped):
973         (WebCore::MediaPlayerPrivateGStreamerOwr::sourceMutedChanged):
974         (WebCore::MediaPlayerPrivateGStreamerOwr::sourceSettingsChanged):
975         (WebCore::MediaPlayerPrivateGStreamerOwr::preventSourceFromStopping):
976         (WebCore::MediaPlayerPrivateGStreamerOwr::createVideoSink):
977         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h: Added.
978         (WebCore::MediaPlayerPrivateGStreamerOwr::engineDescription):
979         (WebCore::MediaPlayerPrivateGStreamerOwr::load):
980         (WebCore::MediaPlayerPrivateGStreamerOwr::cancelLoad):
981         (WebCore::MediaPlayerPrivateGStreamerOwr::prepareToPlay):
982         (WebCore::MediaPlayerPrivateGStreamerOwr::duration):
983         (WebCore::MediaPlayerPrivateGStreamerOwr::seek):
984         (WebCore::MediaPlayerPrivateGStreamerOwr::seeking):
985         (WebCore::MediaPlayerPrivateGStreamerOwr::setRate):
986         (WebCore::MediaPlayerPrivateGStreamerOwr::setPreservesPitch):
987         (WebCore::MediaPlayerPrivateGStreamerOwr::paused):
988         (WebCore::MediaPlayerPrivateGStreamerOwr::hasClosedCaptions):
989         (WebCore::MediaPlayerPrivateGStreamerOwr::setClosedCaptionsVisible):
990         (WebCore::MediaPlayerPrivateGStreamerOwr::maxTimeSeekable):
991         (WebCore::MediaPlayerPrivateGStreamerOwr::buffered):
992         (WebCore::MediaPlayerPrivateGStreamerOwr::totalBytes):
993         (WebCore::MediaPlayerPrivateGStreamerOwr::bytesLoaded):
994         (WebCore::MediaPlayerPrivateGStreamerOwr::canLoadPoster):
995         (WebCore::MediaPlayerPrivateGStreamerOwr::setPoster):
996         (WebCore::MediaPlayerPrivateGStreamerOwr::isLiveStream):
997         (WebCore::MediaPlayerPrivateGStreamerOwr::audioSink):
998
999 2016-02-04  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1000
1001         [Fetch API] Add support for iterating over Headers
1002         https://bugs.webkit.org/show_bug.cgi?id=153787
1003
1004         Reviewed by Darin Adler.
1005
1006         Covered by updated tests.
1007         Introducing template class (JSKeyValueIterator) to support key-value iterators in DOM classes.
1008         Using JSKeyValueIterator to implement Headers entries(), keys() and values() as custom methods.
1009         Binding generator should be updated to generate directly these custom methods and handle iterator Symbol.
1010
1011         * CMakeLists.txt:
1012         * Modules/fetch/FetchHeaders.cpp:
1013         (WebCore::FetchHeaders::Iterator::next):
1014         (WebCore::FetchHeaders::Iterator::Iterator):
1015         * Modules/fetch/FetchHeaders.h:
1016         (WebCore::FetchHeaders::createIterator):
1017         * Modules/fetch/FetchHeaders.idl:
1018         * WebCore.xcodeproj/project.pbxproj:
1019         * bindings/js/JSDOMBinding.h:
1020         (WebCore::jsPair):
1021         * bindings/js/JSBindingsAllInOne.cpp:
1022         * bindings/js/JSFetchHeadersCustom.cpp: Added.
1023         (WebCore::JSFetchHeaders::entries):
1024         (WebCore::JSFetchHeaders::keys):
1025         (WebCore::JSFetchHeaders::values):
1026         * bindings/js/JSKeyValueIterator.h: Added.
1027         (WebCore::JSKeyValueIteratorPrototype::create):
1028         (WebCore::JSKeyValueIteratorPrototype::createStructure):
1029         (WebCore::JSKeyValueIteratorPrototype::JSKeyValueIteratorPrototype):
1030         (WebCore::JSKeyValueIteratorPrototypeFuncNext):
1031
1032 2016-02-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1033
1034         Do not show context menu when right clicking on a scrollbar
1035         https://bugs.webkit.org/show_bug.cgi?id=153493
1036
1037         Reviewed by Michael Catanzaro.
1038
1039         Scrollbars don't currently handle right clicks, but we are showing
1040         the context menu when they are right clicked. This is not desired
1041         at least in GTK+ and I've checked that it isn't consistent with
1042         other applications in Mac either.
1043
1044         Test: fast/events/contextmenu-on-scrollbars.html
1045
1046         * page/EventHandler.cpp:
1047         (WebCore::EventHandler::sendContextMenuEvent):
1048
1049 2016-02-03  Andreas Kling  <akling@apple.com>
1050
1051         [iOS] Throw away linked code when navigating to a new page.
1052         <https://webkit.org/b/153851>
1053
1054         Reviewed by Gavin Barraclough.
1055
1056         When navigating to a new page, tell JSC to throw out any linked code it has lying around.
1057         Linked code is tied to a specific global object, and as we're creating a new one for the
1058         new page, none of it is useful to us here.
1059         In the event that the user navigates back, the cost of relinking some code will be far
1060         lower than the memory cost of keeping all of it around.
1061
1062         * bindings/js/GCController.cpp:
1063         (WebCore::GCController::deleteAllLinkedCode):
1064         * bindings/js/GCController.h:
1065         * loader/FrameLoader.cpp:
1066         (WebCore::FrameLoader::commitProvisionalLoad):
1067
1068 2016-02-03  Alex Christensen  <achristensen@webkit.org>
1069
1070         Report wasBlocked and cannotShowURL errors when using NetworkSession
1071         https://bugs.webkit.org/show_bug.cgi?id=153846
1072
1073         Reviewed by Antti Koivisto.
1074
1075         No new tests, but this fixes http/tests/xmlhttprequest/redirect-cross-origin-2.html
1076         when using NetworkSession.
1077
1078         * platform/URL.h:
1079         WEBCORE_EXPORT because we are using portAllowed in WebKit2 now.
1080
1081 2016-02-03  Jer Noble  <jer.noble@apple.com>
1082
1083         iOS build fix after Yosemite build fix broke iOS build.
1084
1085         * platform/network/cocoa/WebCoreNSURLSession.h:
1086         * platform/network/cocoa/WebCoreNSURLSession.mm:
1087
1088 2016-02-03  Beth Dakin  <bdakin@apple.com>
1089
1090         Accepted candidates should not be autocorrected
1091         https://bugs.webkit.org/show_bug.cgi?id=153813
1092         -and corresponding-
1093         rdar://problem/24066924
1094
1095         Reviewed by Darin Adler.
1096
1097         New document marker to mark inserted candidates. This was we can treat 
1098         inserted candidates just like a RejectedCorrection and we won’t accidentally 
1099         autocorrect them later on.
1100         * dom/DocumentMarker.h:
1101         (WebCore::DocumentMarker::AllMarkers::AllMarkers):
1102         * editing/AlternativeTextController.cpp:
1103         (WebCore::AlternativeTextController::processMarkersOnTextToBeReplacedByResult):
1104
1105         When handling an acceptant candidate, set m_isHandlingAcceptedCandidate to
1106         true while the text is being inserted, and then mark the range as an accepted 
1107         candidate.
1108         * editing/Editor.cpp:
1109         (WebCore::Editor::handleAcceptedCandidate):
1110         * editing/Editor.h:
1111         (WebCore::Editor::isHandlingAcceptedCandidate):
1112
1113         If frame.editor. isHandlingAcceptedCandidate() then return early from 
1114         markMisspellingsAfterTyping.
1115         * editing/TypingCommand.cpp:
1116         (WebCore::TypingCommand::markMisspellingsAfterTyping):
1117
1118         Add some test infrastructure. 
1119         * testing/Internals.cpp:
1120         (WebCore::Internals::handleAcceptedCandidate):
1121         * testing/Internals.h:
1122         * testing/Internals.idl:
1123
1124 2016-02-03  Jer Noble  <jer.noble@apple.com>
1125
1126         [Win] Pass entire request (rather than just URL) to clients of WebCoreAVCFResourceLoader
1127         https://bugs.webkit.org/show_bug.cgi?id=153653
1128
1129         Reviewed by Brent Fulgham.
1130
1131         This will allow those clients to see the byte-range request ("Range:") header and respond
1132         appropriately.
1133
1134         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
1135         (WebCore::WebCoreAVCFResourceLoader::startLoading):
1136
1137 2016-02-03  Jer Noble  <jer.noble@apple.com>
1138
1139         Yosemite build fix; hide the entire WebCoreNSURLSessionDataTask class from Yosemite and prior.
1140
1141         * platform/network/cocoa/WebCoreNSURLSession.h:
1142         * platform/network/cocoa/WebCoreNSURLSession.mm:
1143         (-[WebCoreNSURLSessionDataTask initWithSession:identifier:URL:]):
1144         (-[WebCoreNSURLSessionDataTask initWithSession:identifier:request:]):
1145
1146 2016-02-03  Jer Noble  <jer.noble@apple.com>
1147
1148         [EME][Mac] MediaKeys.createSession() fails with initData containing a contentId whose length is > 1/2 the initData.
1149         https://bugs.webkit.org/show_bug.cgi?id=153517
1150         <rdar://problem/24303782>
1151
1152         Reviewed by Eric Carlson.
1153
1154         The length of contentId is given in bytes, not Uint16 characters. Use the former when extracting
1155         the contentId string from the initData.
1156
1157         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1158         (WebCore::MediaPlayerPrivateAVFoundation::extractKeyURIKeyIDAndCertificateFromInitData):
1159
1160 2016-02-03  Jer Noble  <jer.noble@apple.com>
1161
1162         [Mac] Wrap a resource and resource loader in a NSURLSession-like object for use by lower level frameworks
1163         https://bugs.webkit.org/show_bug.cgi?id=153669
1164
1165         Reviewed by Alex Christensen.
1166
1167         API Test: WebCore.WebCoreNSURLSession
1168
1169         Add a NSURLSession-like object, which wraps a CachedResourceLoader and CachedRawResource, which we can
1170         hand to lower-level frameworks, so that network loads by those frameworks use WebKit's loader.
1171
1172         * platform/network/cocoa/WebCoreNSURLSession.h: Added.
1173         * platform/network/cocoa/WebCoreNSURLSession.mm: Added.
1174         (-[WebCoreNSURLSession initWithResourceLoader:delegate:delegateQueue:]):
1175         (-[WebCoreNSURLSession dealloc]):
1176         (-[WebCoreNSURLSession copyWithZone:]):
1177         (-[WebCoreNSURLSession delegateQueue]):
1178         (-[WebCoreNSURLSession configuration]):
1179         (-[WebCoreNSURLSession loader]):
1180         (-[WebCoreNSURLSession finishTasksAndInvalidate]):
1181         (-[WebCoreNSURLSession invalidateAndCancel]):
1182         (-[WebCoreNSURLSession resetWithCompletionHandler:]):
1183         (-[WebCoreNSURLSession flushWithCompletionHandler:]):
1184         (-[WebCoreNSURLSession getTasksWithCompletionHandler:]):
1185         (-[WebCoreNSURLSession getAllTasksWithCompletionHandler:]):
1186         (-[WebCoreNSURLSession dataTaskWithRequest:]):
1187         (-[WebCoreNSURLSession dataTaskWithURL:]):
1188         (-[WebCoreNSURLSession uploadTaskWithRequest:fromFile:]):
1189         (-[WebCoreNSURLSession uploadTaskWithRequest:fromData:]):
1190         (-[WebCoreNSURLSession uploadTaskWithStreamedRequest:]):
1191         (-[WebCoreNSURLSession downloadTaskWithRequest:]):
1192         (-[WebCoreNSURLSession downloadTaskWithURL:]):
1193         (-[WebCoreNSURLSession downloadTaskWithResumeData:]):
1194         (-[WebCoreNSURLSession streamTaskWithHostName:port:]):
1195         (-[WebCoreNSURLSession streamTaskWithNetService:]):
1196         (-[WebCoreNSURLSession isKindOfClass:]):
1197
1198         Add a C++ class which can act as a CachedRawResourceClient, passing the results back to a WebCoreNSURLSessionDataTask:
1199
1200         (WebCore::WebCoreNSURLSessionDataTaskClient::WebCoreNSURLSessionDataTaskClient):
1201         (WebCore::WebCoreNSURLSessionDataTaskClient::dataSent):
1202         (WebCore::WebCoreNSURLSessionDataTaskClient::responseReceived):
1203         (WebCore::WebCoreNSURLSessionDataTaskClient::dataReceived):
1204         (WebCore::WebCoreNSURLSessionDataTaskClient::redirectReceived):
1205         (WebCore::WebCoreNSURLSessionDataTaskClient::notifyFinished):
1206
1207         Add a NSURLSessionDataTask-like object, which takes a request, then uses it to create and wrap a CachedRawResource.
1208         Becase NSURSessionDataTask is intended to be used off-main-thread, care must be taken to dispatch back to the main-
1209         (or web-) thread before calling CachedRawResource functions.
1210
1211         (-[WebCoreNSURLSessionDataTask initWithSession:identifier:URL:]):
1212         (-[WebCoreNSURLSessionDataTask initWithSession:identifier:request:]):
1213         (-[WebCoreNSURLSessionDataTask copyWithZone:]):
1214         (-[WebCoreNSURLSessionDataTask _restart]):
1215         (-[WebCoreNSURLSessionDataTask _cancel]):
1216         (-[WebCoreNSURLSessionDataTask _finish]):
1217         (-[WebCoreNSURLSessionDataTask _setDefersLoading:]):
1218         (-[WebCoreNSURLSessionDataTask cancel]):
1219         (-[WebCoreNSURLSessionDataTask suspend]):
1220         (-[WebCoreNSURLSessionDataTask resume]):
1221         (-[WebCoreNSURLSessionDataTask _timingData]):
1222         (-[WebCoreNSURLSessionDataTask resource:sentBytes:totalBytesToBeSent:]):
1223         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:]):
1224         (-[WebCoreNSURLSessionDataTask resource:receivedData:length:]):
1225         (-[WebCoreNSURLSessionDataTask resource:receivedRedirect:request:]):
1226         (-[WebCoreNSURLSessionDataTask resourceFinished:]):
1227         * WebCore.xcodeproj/project.pbxproj: Add new files to project.
1228
1229 2016-02-03  Darin Adler  <darin@apple.com>
1230
1231         Convert another batch of String::lower callsites to something better, typically convertToASCIILowercase
1232         https://bugs.webkit.org/show_bug.cgi?id=153789
1233
1234         Reviewed by Sam Weinig.
1235
1236         * dom/DOMImplementation.cpp:
1237         (WebCore::DOMImplementation::isXMLMIMEType): Use equalLettersIgnoringASCIICase
1238         and the boolean argument to endsWith to ignore ASCII case.
1239         (WebCore::DOMImplementation::isTextMIMEType): Ditto. Also simplified the logic
1240         by removing an if statement.
1241
1242         * dom/Document.cpp:
1243         (WebCore::isSeparator): Deleted. Moved to WindowFeatures.cpp.
1244         (WebCore::processArguments): Ditto.
1245         (WebCore::Document::processViewport): Call the processFeaturesString function
1246         from WindowFeatures.h; the code here was originally just a pasted copy of that code!
1247         (WebCore::Document::processFormatDetection): Ditto.
1248
1249         * html/HTMLCanvasElement.cpp:
1250         (WebCore::HTMLCanvasElement::toEncodingMimeType): Remove now-unneeded
1251         lowercasing of MIME type before calling isSupportedImageMIMETypeForEncoding,
1252         since the MIME type registry now ignores ASCII case. Use convertToASCIILowercase
1253         on the return value, to preserve behavior.
1254         (WebCore::HTMLCanvasElement::toDataURL): Minor coding style tweaks.
1255
1256         * html/HTMLEmbedElement.cpp:
1257         (WebCore::HTMLEmbedElement::parseAttribute): Use convertToASCIILowercase for
1258         the service type here.
1259
1260         * html/HTMLImageElement.cpp:
1261         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement): Remove now-unneeded
1262         lowercasing since MIME type registry now ignores ASCII case. And use
1263         equalLettersIgnoringASCIICase for the case here.
1264
1265         * html/HTMLInputElement.cpp:
1266         (WebCore::parseAcceptAttribute): Use convertToASCIILowercase for the type here.
1267
1268         * html/HTMLLinkElement.cpp:
1269         (WebCore::HTMLLinkElement::parseAttribute): Use convertToASCIILowercase for the
1270         media value here.
1271
1272         * html/HTMLMediaElement.cpp:
1273         (WebCore::HTMLMediaElement::canPlayType): Use convertToASCIILowercase for the
1274         content type here.
1275         (WebCore::HTMLMediaElement::selectNextSourceChild): Ditto.
1276
1277         * html/HTMLObjectElement.cpp:
1278         (WebCore::HTMLObjectElement::parseAttribute): Use convertToASCIILowercase for
1279         the service type here.
1280
1281         * html/HTMLTrackElement.cpp:
1282         (WebCore::HTMLTrackElement::parseAttribute): Use convertToASCIILowercase for
1283         the kind here.
1284         (WebCore::HTMLTrackElement::ensureTrack): Ditto. Also use fastGetAttribute
1285         since this is neither the style attribute nor an animatable SVG attribute.
1286
1287         * html/parser/HTMLTreeBuilder.cpp:
1288         (WebCore::createCaseMap): Use convertToASCIILowercase for the local names here.
1289
1290         * inspector/DOMPatchSupport.cpp:
1291         (WebCore::DOMPatchSupport::patchNode): Use containsIgnoringASCIICase instead
1292         of combining lower with find == notFound here.
1293         (WebCore::nodeName): Use convertToASCIILowercase here.
1294
1295         * inspector/InspectorOverlay.cpp:
1296         (WebCore::buildObjectForElementData): Use convertToASCIILowercase for node
1297         name here.
1298
1299         * inspector/InspectorPageAgent.cpp:
1300         (WebCore::createXHRTextDecoder): Remove a now-unneeded call to lower since
1301         DOMImplementation::isXMLMIMEType now ignores ASCII case.
1302
1303         * inspector/InspectorStyleSheet.cpp:
1304         (WebCore::lowercasePropertyName): Use convertToASCIILowercase for property
1305         names here. Also use startsWith rather than a hand-written alternative.
1306         (WebCore::InspectorStyle::populateAllProperties): Use the return value of
1307         the add function to avoid doing a double hash table lookp.
1308         (WebCore::InspectorStyle::styleWithProperties): Use convertToASCIILowercase
1309         to lowercase the property name.
1310
1311         * inspector/NetworkResourcesData.cpp:
1312         (WebCore::createOtherResourceTextDecoder): Remove unneeded call to lower since
1313         DOMImplement::isXMLMIMEType now ignores ASCII case.
1314
1315         * loader/CrossOriginAccessControl.cpp:
1316         (WebCore::createAccessControlPreflightRequest): Use convertToASCIILowercase
1317         to lowercase the access control request header field value.
1318
1319         * loader/cache/CachedScript.cpp:
1320         (WebCore::CachedScript::mimeType): Use convertToASCIILowercase on the content type.
1321
1322         * page/CaptionUserPreferencesMediaAF.cpp:
1323         (WebCore::languageIdentifier): Use convertToASCIILowercase on the language code.
1324
1325         * page/DOMWindow.cpp:
1326         (WebCore::DOMWindow::open): Call parseWindowFeatures instead of using the
1327         constructor for WindowFeatures.
1328         (WebCore::DOMWindow::showModalDialog): Call parseDialogFeatures instead of
1329         using the constructor for WindowFeatures.
1330
1331         * page/EventHandler.cpp:
1332         (WebCore::findDropZone): Remove unneeded lowercasing and empty string checking,
1333         and use the option SpaceSplitString already has to convert to lowercase.
1334         (WebCore::EventHandler::handleAccessKey): Remove unneeded call to lower since
1335         getElementByAccessKey now ignores case. Also tweaked coding style a bit.
1336
1337         * page/OriginAccessEntry.cpp:
1338         (WebCore::OriginAccessEntry::OriginAccessEntry): Use convertToASCIILowercase
1339         on the protocol and host.
1340         (WebCore::OriginAccessEntry::matchesOrigin): Ditto.
1341
1342         * page/SecurityOrigin.cpp:
1343         (WebCore::shouldTreatAsUniqueOrigin): Remove unneeded call to lower since
1344         SchemeRegistry now ignores ASCII case.
1345         (WebCore::SecurityOrigin::SecurityOrigin): Use convertToASCIILowercase on
1346         the protocol and host.
1347         (WebCore::SecurityOrigin::setDomainFromDOM): Use convertToASCIILowercase on
1348         the domain.
1349         (WebCore::SecurityOrigin::canDisplay): Remove call to lower since SchemeRegistry
1350         now ignores ASCII case and because this now uses equalIgnoringASCIICase in
1351         one place that used to use exact matching.
1352
1353         * page/WindowFeatures.cpp: Refactored so this is now some helper functions
1354         plus a struct rather than a class.
1355         (WebCore::isSeparator): Renamed this and removed special handling for NUL.
1356         (WebCore::parseWindowFeatures): Moved the code that was formerly in the
1357         WindowFeatures constructor in here. Refactored the parsing into the
1358         processFeaturesString function, shared with the functions in Document that
1359         do the same kind of parsing. Removed the code that converts the entire string
1360         to lowercase before parsing.
1361         (WebCore::processFeaturesString): Moved the improved version of this function
1362         here from Document.cpp; more efficient because it doesn't allocate strings.
1363         (WebCore::setWindowFeature): Changed to be a function private to this file
1364         with internal linkage. Use equalLettersIgnoringASCIICase so we no longer
1365         rely on converting the string to lowercase before parsing.
1366         (WebCore::parseDialogFeatures): Similar refactoring, but also changed all
1367         the default handling to use Optional<> instead of default values.
1368         (WebCore::boolFeature): Changed to use option and to ignore ASCII case.
1369         (WebCore::floatFeature): Ditto.
1370         (WebCore::parseDialogFeaturesMap): Removed the calls to lower, which are
1371         not needed any more.
1372
1373         * page/WindowFeatures.h: Added default values for all the data members,
1374         and removed all the functions from the WindowFeatures struct. Added the two
1375         functions for parsing window and dialog features. Also added the
1376         processFeaturesString function so we can share it with Document.cpp.
1377
1378         * platform/SchemeRegistry.cpp:
1379         (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsLocal): Use
1380         equalLettersIgnoringASCIICase to ignore ASCII case.
1381
1382         * platform/efl/MIMETypeRegistryEfl.cpp:
1383         (WebCore::MIMETypeRegistry::getMIMETypeForExtension): Use a modern for loop,
1384         and equalIgnoringASCIICase rather than calling lower.
1385
1386         * platform/graphics/MediaPlayer.cpp:
1387         (WebCore::MediaPlayer::load): Use convertToASCIILowercase on MIME type and
1388         key system.
1389         (WebCore::MediaPlayer::generateKeyRequest): Ditto.
1390         (WebCore::MediaPlayer::addKey): Ditto.
1391         (WebCore::MediaPlayer::cancelKeyRequest): Ditto.
1392
1393         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
1394         (WebCore::Extensions3DOpenGLCommon::Extensions3DOpenGLCommon): Use
1395         convertToASCIILowercase on vendor string.
1396
1397         * platform/gtk/MIMETypeRegistryGtk.cpp:
1398         (WebCore::MIMETypeRegistry::getMIMETypeForExtension): Use a modern for loop,
1399         and equalIgnoringASCIICase rather than calling lower.
1400
1401         * platform/mac/PasteboardMac.mm:
1402         (WebCore::cocoaTypeFromHTMLClipboardType): Use convertToASCIILowercase
1403         on the type. Also did a bit of renaming and tweaking the logic.
1404
1405 2016-02-03  Dave Hyatt  <hyatt@apple.com>
1406
1407         Implement hanging-punctuation property parsing.
1408         https://bugs.webkit.org/show_bug.cgi?id=18109.
1409
1410         Reviewed by Zalan Bujtas.
1411
1412         Added parsing test in fast/css.
1413
1414         * css/CSSComputedStyleDeclaration.cpp:
1415         (WebCore::renderEmphasisPositionFlagsToCSSValue):
1416         (WebCore::hangingPunctuationToCSSValue):
1417         (WebCore::fillRepeatToCSSValue):
1418         (WebCore::ComputedStyleExtractor::propertyValue):
1419         * css/CSSParser.cpp:
1420         (WebCore::CSSParser::parseValue):
1421         (WebCore::CSSParser::parseTextIndent):
1422         (WebCore::CSSParser::parseHangingPunctuation):
1423         (WebCore::CSSParser::parseLineBoxContain):
1424         * css/CSSParser.h:
1425         * css/CSSPrimitiveValueMappings.h:
1426         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1427         (WebCore::CSSPrimitiveValue::operator HangingPunctuation):
1428         (WebCore::CSSPrimitiveValue::operator LineBreak):
1429         * css/CSSPropertyNames.in:
1430         * css/CSSValueKeywords.in:
1431         * css/StyleBuilderConverter.h:
1432         (WebCore::StyleBuilderConverter::convertRegionBreakInside):
1433         (WebCore::StyleBuilderConverter::convertHangingPunctuation):
1434         * rendering/style/RenderStyle.cpp:
1435         (WebCore::RenderStyle::changeRequiresLayout):
1436         * rendering/style/RenderStyle.h:
1437         * rendering/style/RenderStyleConstants.h:
1438         (WebCore::operator| ):
1439         (WebCore::operator|= ):
1440         * rendering/style/StyleRareInheritedData.cpp:
1441         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
1442         (WebCore::StyleRareInheritedData::operator==):
1443         * rendering/style/StyleRareInheritedData.h:
1444
1445 2016-02-03  Jessie Berlin  <jberlin@webkit.org>
1446
1447         Build fix.
1448
1449         [NSEvent context] has always returned nil. Replace uses with nullptr.
1450
1451         * page/mac/EventHandlerMac.mm:
1452         (WebCore::EventHandler::sendFakeEventsAfterWidgetTracking):
1453
1454 2016-02-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1455
1456         [GTK] Layout Test http/tests/appcache/different-https-origin-resource-main.html is failing
1457         https://bugs.webkit.org/show_bug.cgi?id=145253
1458
1459         Reviewed by Michael Catanzaro.
1460
1461         The problem is that when the load is cancelled while the
1462         connection is still being established,
1463         SoupMessage::notify::tls-errors is emitted and the handler calls
1464         ResourceHandleClient::didFail() which can delete the ResourceHandle.
1465
1466         * platform/network/soup/ResourceHandleSoup.cpp:
1467         (WebCore::tlsErrorsChangedCallback): Protect the ResourceHandle
1468         for the scope of the callback because
1469         ResourceHandleClient::didFail() could delete the object.
1470
1471 2016-02-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1472
1473         REGRESSION(r191948): [GStreamer] 4 new timeouts on layout tests.
1474         https://bugs.webkit.org/show_bug.cgi?id=152797
1475
1476         Reviewed by Darin Adler.
1477
1478         Always schedule messages to the main thread, even when the bus
1479         sync handlder was called in the main thread. It seems that
1480         GStreamer expects things to happen in the next main loop
1481         iteration.
1482
1483         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1484         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
1485
1486 2016-02-03  Zan Dobersek  <zdobersek@igalia.com>
1487
1488         [TexMap] CompositingCoordinator should store the overlay layer, flush it as appropriate
1489         https://bugs.webkit.org/show_bug.cgi?id=152058
1490
1491         Reviewed by Michael Catanzaro.
1492
1493         Previously, the CompositingCoordinator only added the overlay layer to the
1494         layer tree, but flushing its compositing state is also required. For that to
1495         happen, CompositingCoordinator has to store a pointer to the overlay layer
1496         object and flush it in ::flushPendingLayerChanges().
1497
1498         Overlay layers are most prominently used by the Web Inspector to highlight
1499         the DOM elements on the Web page that are being hovered in the inspector.
1500
1501         * platform/graphics/texmap/coordinated/CompositingCoordinator.cpp:
1502         (WebCore::CompositingCoordinator::CompositingCoordinator):
1503         (WebCore::CompositingCoordinator::setRootCompositingLayer):
1504         (WebCore::CompositingCoordinator::flushPendingLayerChanges):
1505         * platform/graphics/texmap/coordinated/CompositingCoordinator.h:
1506
1507 2016-02-03  Zan Dobersek  <zdobersek@igalia.com>
1508
1509         [CoordinatedGraphics] CompositingCoordinator destructor is scheduling layer flushes
1510         https://bugs.webkit.org/show_bug.cgi?id=153823
1511
1512         Reviewed by Carlos Garcia Campos.
1513
1514         Purging the backing stores during the CompositingCoordinator destructor
1515         is also scheduling layer flushes in the object's client, which is an object
1516         of the LayerTreeHost-deriving class that owns the CompositingCoordinator
1517         object in question and is also being destroyed.
1518
1519         In case of ThreadedCoordinatedLayerTreeHost, this scheduling can access
1520         the RunLoop::Timer object which has already been destroyed, causing a
1521         crash. Another problem with this is that we're invoking a virtual function
1522         on an object that's being destructed, which works well enough in this case
1523         but should be discouraged in general.
1524
1525         In order to avoid this, add the m_isDestructing boolean to the
1526         CompositingCoordinator class, flip it to true during the destruction,
1527         and check for its falseness before scheduling a layer flush.
1528
1529         * platform/graphics/texmap/coordinated/CompositingCoordinator.cpp:
1530         (WebCore::CompositingCoordinator::CompositingCoordinator):
1531         (WebCore::CompositingCoordinator::~CompositingCoordinator):
1532         (WebCore::CompositingCoordinator::notifyFlushRequired):
1533         * platform/graphics/texmap/coordinated/CompositingCoordinator.h:
1534
1535 2016-02-03  Zan Dobersek  <zdobersek@igalia.com>
1536
1537         [TexMap] Don't use RELEASE_ASSERT in TextureMapperLayer::computeTransformsRecursive()
1538         https://bugs.webkit.org/show_bug.cgi?id=153822
1539
1540         Reviewed by Carlos Garcia Campos.
1541
1542         * platform/graphics/texmap/TextureMapperLayer.cpp:
1543         (WebCore::TextureMapperLayer::computeTransformsRecursive):
1544         Use ASSERT to check that the m_children members are indeed children
1545         of the current layer, RELEASE_ASSERT probably slipped in unnoticed
1546         at some point.
1547
1548 2016-02-03  Zan Dobersek  <zdobersek@igalia.com>
1549
1550         PlatformPathCairo: Lazily allocate the path surface
1551         https://bugs.webkit.org/show_bug.cgi?id=153821
1552
1553         Reviewed by Carlos Garcia Campos.
1554
1555         Move the static variable that holds the Cairo surface into
1556         the pathSurface() function (previously getPathSurface). This
1557         way the surface will only be allocated once the function is
1558         called for the first time from the CairoPath surface.
1559
1560         No change in functionality, just a cleanup.
1561
1562         * platform/graphics/cairo/PlatformPathCairo.cpp:
1563         (WebCore::pathSurface):
1564         (WebCore::CairoPath::CairoPath):
1565         (WebCore::getPathSurface): Deleted.
1566
1567 2016-02-02  Fujii Hironori  <Hironori.Fujii@jp.sony.com>
1568
1569         ASSERTION FAILED: roundedIntPoint(rendererMappedResult) == roundedIntPoint(result)
1570         https://bugs.webkit.org/show_bug.cgi?id=153576
1571
1572         Reviewed by Darin Adler.
1573
1574         Tests: fast/block/geometry-map-assertion-with-rounding-negative-half.html
1575
1576         The results of roundedIntPoint of FloatPoint and LayoutPoint may be different
1577         because of the uniqueness of LayoutUnit::round introduced by this bug
1578         <https://bugs.webkit.org/show_bug.cgi?id=107208>.
1579         Should convert a FloatPoint to a LayoutPoint before rounding.
1580
1581         * rendering/RenderGeometryMap.cpp:
1582         (WebCore::RenderGeometryMap::mapToContainer):
1583
1584 2016-02-02  Aakash Jain  <aakash_jain@apple.com>
1585
1586         Remove references to CallFrameInlines.h
1587         https://bugs.webkit.org/show_bug.cgi?id=153810
1588
1589         Reviewed by Mark Lam.
1590
1591         * ForwardingHeaders/interpreter/CallFrameInlines.h: Removed.
1592
1593 2016-02-02  Jinyoung Hur  <hur.ims@navercorp.com>
1594
1595         WEBGL_debug_shaders should be disabled for OpenGLES backend also
1596         https://bugs.webkit.org/show_bug.cgi?id=153788
1597
1598         Reviewed by Darin Adler.
1599
1600         WEBGL_debug_shaders extension is disabled for OpenGL backed platform
1601         because the implementation is not fully compliant to the spec yet.
1602         Because this is not an OpenGL-specific problem, WEBGL_debug_shaders extension
1603         should be disabled for OpenGLES backed platforms also.
1604
1605         No new tests, already covered by existing tests.
1606
1607         * platform/graphics/opengl/Extensions3DOpenGL.cpp:
1608         (WebCore::Extensions3DOpenGL::supportsExtension): Deleted.
1609         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
1610         (WebCore::Extensions3DOpenGLCommon::supports):
1611
1612 2016-02-02  Brady Eidson  <beidson@apple.com>
1613
1614         Modern IDB: storage/indexeddb/cursor-primary-key-order.html fails with SQLite backend.
1615         https://bugs.webkit.org/show_bug.cgi?id=153800
1616
1617         Reviewed by Alex Christensen.
1618
1619         No new tests (Existing tests now unskipped).
1620
1621         The IndexRecords SQL schema did not order things by primaryKey.
1622         
1623         Easy fix to the schema. Sadly requires a migration...
1624
1625         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1626         (WebCore::IDBServer::v1IndexRecordsTableSchema):
1627         (WebCore::IDBServer::v1IndexRecordsTableSchemaAlternate):
1628         (WebCore::IDBServer::v2IndexRecordsTableSchema):
1629         (WebCore::IDBServer::v2IndexRecordsTableSchemaAlternate):
1630         (WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidIndexRecordsTable):
1631         (WebCore::IDBServer::SQLiteIDBBackingStore::createAndPopulateInitialDatabaseInfo):
1632         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
1633
1634 2016-02-02  Tim Horton  <timothy_horton@apple.com>
1635
1636         <attachment> should attempt to guess the icon from the file extension if all else fails
1637         https://bugs.webkit.org/show_bug.cgi?id=153804
1638         <rdar://problem/24448146>
1639
1640         Reviewed by Anders Carlsson.
1641
1642         Test: fast/attachment/attachment-icon-from-file-extension.html
1643
1644         * platform/graphics/Icon.h:
1645         * platform/graphics/mac/IconMac.mm:
1646         (WebCore::Icon::createIconForFileExtension):
1647         * rendering/RenderThemeMac.mm:
1648         (WebCore::iconForAttachment):
1649         If we can't find an icon any other way, try assuming that the title is a filename,
1650         grab its extension, and have NSWorkspace try to work out an icon for it.
1651
1652 2016-02-02  Antti Koivisto  <antti@apple.com>
1653
1654         Factor style sharing code out of StyleResolver
1655         https://bugs.webkit.org/show_bug.cgi?id=153768
1656
1657         Reviewed by Darin Adler.
1658
1659         Move the code to a new class, Style::SharingResolver.
1660
1661         When resolving document style we query the sharing resolver first before using the regular style resolver.
1662         Other paths that call style resolver were mostly already disabling it with DisallowStyleSharing flag.
1663
1664         * WebCore.xcodeproj/project.pbxproj:
1665         * css/ElementRuleCollector.cpp:
1666         (WebCore::MatchRequest::MatchRequest):
1667         (WebCore::ElementRuleCollector::matchAllRules):
1668         (WebCore::ElementRuleCollector::hasAnyMatchingRules):
1669
1670             More const.
1671
1672         * css/ElementRuleCollector.h:
1673         (WebCore::ElementRuleCollector::setRegionForStyling):
1674         (WebCore::ElementRuleCollector::setMedium):
1675         * css/MediaQueryMatcher.cpp:
1676         (WebCore::MediaQueryMatcher::prepareEvaluator):
1677         * css/StyleMedia.cpp:
1678         (WebCore::StyleMedia::matchMedium):
1679         * css/StyleResolver.cpp:
1680         (WebCore::StyleResolver::State::cacheBorderAndBackground):
1681         (WebCore::StyleResolver::StyleResolver):
1682         (WebCore::StyleResolver::sweepMatchedPropertiesCache):
1683         (WebCore::StyleResolver::State::State):
1684         (WebCore::StyleResolver::State::setStyle):
1685         (WebCore::isAtShadowBoundary):
1686         (WebCore::StyleResolver::styleForElement):
1687         (WebCore::StyleResolver::classNamesAffectedByRules): Deleted.
1688         (WebCore::parentElementPreventsSharing): Deleted.
1689         (WebCore::StyleResolver::locateCousinList): Deleted.
1690         (WebCore::StyleResolver::styleSharingCandidateMatchesRuleSet): Deleted.
1691         (WebCore::StyleResolver::canShareStyleWithControl): Deleted.
1692         (WebCore::elementHasDirectionAuto): Deleted.
1693         (WebCore::StyleResolver::sharingCandidateHasIdenticalStyleAffectingAttributes): Deleted.
1694         (WebCore::StyleResolver::canShareStyleWithElement): Deleted.
1695         (WebCore::StyleResolver::findSiblingForStyleSharing): Deleted.
1696         (WebCore::StyleResolver::locateSharedStyle): Deleted.
1697
1698             Style sharing code moves to SharingResolver.
1699
1700         * css/StyleResolver.h:
1701         (WebCore::StyleResolver::mediaQueryEvaluator):
1702         (WebCore::StyleResolver::State::regionForStyling):
1703         (WebCore::StyleResolver::State::elementLinkState):
1704         (WebCore::StyleResolver::State::setApplyPropertyToRegularStyle):
1705         (WebCore::StyleResolver::State::setApplyPropertyToVisitedLinkStyle):
1706         (WebCore::StyleResolver::state):
1707         (WebCore::StyleResolver::setTextOrientation):
1708         (WebCore::StyleResolver::State::setElementAffectedByClassRules): Deleted.
1709         (WebCore::StyleResolver::State::elementAffectedByClassRules): Deleted.
1710         (WebCore::StyleResolver::styleNotYetAvailable): Deleted.
1711
1712             Placeholder code moves to TreeResolver.
1713
1714         * dom/VisitedLinkState.cpp:
1715         (WebCore::linkAttribute):
1716         (WebCore::VisitedLinkState::invalidateStyleForAllLinks):
1717         (WebCore::linkHashForElement):
1718         (WebCore::VisitedLinkState::invalidateStyleForLink):
1719         (WebCore::VisitedLinkState::determineLinkStateSlowCase):
1720         * dom/VisitedLinkState.h:
1721         (WebCore::VisitedLinkState::determineLinkState):
1722         * html/HTMLFormControlElement.h:
1723         * rendering/RenderElement.cpp:
1724         (WebCore::RenderElement::getUncachedPseudoStyle):
1725         * rendering/RenderNamedFlowFragment.cpp:
1726         (WebCore::RenderNamedFlowFragment::computeStyleInRegion):
1727         * rendering/style/RenderStyle.cpp:
1728         (WebCore::RenderStyle::isStyleAvailable):
1729         (WebCore::RenderStyle::hasUniquePseudoStyle):
1730         * style/StyleSharingResolver.cpp: Added.
1731         (WebCore::Style::SharingResolver::SharingResolver):
1732         (WebCore::Style::parentElementPreventsSharing):
1733         (WebCore::Style::elementHasDirectionAuto):
1734         (WebCore::Style::SharingResolver::searchSimilar):
1735         (WebCore::Style::SharingResolver::findSibling):
1736         (WebCore::Style::SharingResolver::locateCousinList):
1737         (WebCore::Style::canShareStyleWithControl):
1738         (WebCore::Style::SharingResolver::canShareStyleWithElement):
1739         (WebCore::Style::SharingResolver::styleSharingCandidateMatchesRuleSet):
1740         (WebCore::Style::SharingResolver::sharingCandidateHasIdenticalStyleAffectingAttributes):
1741         (WebCore::Style::SharingResolver::classNamesAffectedByRules):
1742         * style/StyleSharingResolver.h: Added.
1743         * style/StyleTreeResolver.cpp:
1744         (WebCore::Style::ensurePlaceholderStyle):
1745         (WebCore::Style::TreeResolver::TreeResolver):
1746         (WebCore::Style::TreeResolver::styleForElement):
1747
1748             Try to use SharingResolver first.
1749             Also move placeholder style handling here, it is only relevant when resolving document style.
1750
1751         (WebCore::Style::postResolutionCallbacksAreSuspended):
1752         (WebCore::Style::isPlaceholderStyle):
1753         * style/StyleTreeResolver.h:
1754         * svg/SVGElement.cpp:
1755         (WebCore::SVGElement::customStyleForRenderer):
1756         * svg/SVGElementRareData.h:
1757         (WebCore::SVGElementRareData::overrideComputedStyle):
1758
1759 2016-02-02  Tim Horton  <timothy_horton@apple.com>
1760
1761         <attachment> icon should be a folder for the custom MIME type multipart/x-folder
1762         https://bugs.webkit.org/show_bug.cgi?id=153795
1763         <rdar://problem/24416632>
1764
1765         Reviewed by Anders Carlsson.
1766
1767         Test: fast/attachment/attachment-folder-icon.html
1768
1769         * rendering/RenderThemeMac.mm:
1770         (WebCore::iconForAttachment):
1771         (WebCore::paintAttachmentIcon):
1772         Mail uses this special MIME type to indicate that something is a folder, which there
1773         isn't a normal non-deprecated MIME type for.
1774
1775 2016-02-02  Brady Eidson  <beidson@apple.com>
1776
1777         Modern IDB: storage/indexeddb/cursor-continue-validity.html fails.
1778         https://bugs.webkit.org/show_bug.cgi?id=153791
1779
1780         Reviewed by Alex Christensen.
1781
1782         No new tests (Existing test now unskipped).
1783
1784         There was a preexisting check in the SQLite cursor for remembering the current record and
1785         refusing to refetch it.
1786         
1787         This check was causing this bug, because we needed to refetch the current record.
1788         
1789         Removing the check (and its associated flag) doesn't regress any other test, and fixes this one.
1790
1791         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
1792         (WebCore::IDBServer::SQLiteIDBCursor::resetAndRebindStatement):
1793         (WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce):
1794         * Modules/indexeddb/server/SQLiteIDBCursor.h:
1795
1796 2016-02-01  Dave Hyatt  <hyatt@apple.com>
1797
1798         Add a line grid pagination SPI to WebKit.
1799         https://bugs.webkit.org/show_bug.cgi?id=153757
1800         <rdar://problem/23041598>
1801
1802         Reviewed by Anders Carlsson.
1803
1804         New tests in fast/multicol/pagination.
1805
1806         * page/Page.cpp:
1807         (WebCore::Page::setPaginationLineGridEnabled):
1808         * page/Page.h:
1809         (WebCore::Page::paginationLineGridEnabled):
1810         Add a boolean to the page to turn the line grid on and off.
1811
1812         * rendering/RenderBox.cpp:
1813         (WebCore::RenderBox::styleDidChange):
1814         Propagate the body's font up to the paginated RenderView so that
1815         it can be used to establish the line grid.
1816
1817         * style/StyleResolveForDocument.cpp:
1818         (WebCore::Style::resolveForDocument):
1819         Set up a line grid with containment snapping by default if the
1820         line grid enabled flag is set.
1821
1822         * testing/Internals.cpp:
1823         (WebCore::Internals::resetToConsistentState):
1824         (WebCore::Internals::setPagination):
1825         (WebCore::Internals::setPaginationLineGridEnabled):
1826         (WebCore::Internals::configurationForViewport):
1827         * testing/Internals.h:
1828         (WebCore::Internals::setPagination):
1829         * testing/Internals.idl:
1830         Add support for testing the grid being enabled.
1831
1832 2016-02-01  Antti Koivisto  <antti@apple.com>
1833
1834         Tab suspension code shouldn't use page cache cacheability logic
1835         https://bugs.webkit.org/show_bug.cgi?id=153680
1836
1837         Reviewed by Andreas Kling.
1838
1839         Most of PageCache::canCache() is unnecessary for tab suspension.
1840
1841         Also improve robustness and introduce 1 minute delay before suspending.
1842
1843         * page/Page.cpp:
1844         (WebCore::Page::setPageActivityState):
1845         (WebCore::Page::setIsVisible):
1846         (WebCore::Page::setIsVisibleInternal):
1847         (WebCore::Page::setIsPrerender):
1848         (WebCore::Page::canTabSuspend):
1849
1850             Include visibility test here.
1851
1852             Instead of calling PageCache::canCache() just check for each frame
1853             - that the document is loaded
1854             - that active DOM objects allow suspension
1855
1856         (WebCore::Page::setIsTabSuspended):
1857         (WebCore::Page::setTabSuspensionEnabled):
1858         (WebCore::Page::updateTabSuspensionState):
1859
1860             Refactor for robustness.
1861
1862         (WebCore::Page::tabSuspensionTimerFired):
1863
1864             Call canTabSuspend, the result might have changed.
1865
1866         (WebCore::Page::scheduleTabSuspension): Deleted.
1867         * page/Page.h:
1868
1869 2016-02-02  Yusuke Suzuki  <utatane.tea@gmail.com>
1870
1871         [JSC] Introduce BytecodeIntrinsic constant rep like @undefined
1872         https://bugs.webkit.org/show_bug.cgi?id=153737
1873
1874         Reviewed by Darin Adler.
1875
1876         * Modules/fetch/FetchHeaders.js:
1877         (initializeFetchHeaders):
1878         * Modules/streams/ReadableStream.js:
1879         (initializeReadableStream):
1880         (closeDestination):
1881         (abortDestination):
1882         (pipeTo):
1883         * Modules/streams/ReadableStreamInternals.js:
1884         (privateInitializeReadableStreamController):
1885         (teeReadableStream):
1886         (isReadableStreamReader):
1887         (errorReadableStream):
1888         (finishClosingReadableStream):
1889         (enqueueInReadableStream):
1890         (readFromReadableStreamReader):
1891         * Modules/streams/ReadableStreamReader.js:
1892         (releaseLock):
1893         * Modules/streams/StreamInternals.js:
1894         (shieldingPromiseResolve):
1895         (promiseInvokeOrNoopNoCatch):
1896         (promiseInvokeOrFallbackOrNoop):
1897         (validateAndNormalizeQueuingStrategy):
1898         * Modules/streams/WritableStream.js:
1899         (initializeWritableStream):
1900         (write):
1901         * Modules/streams/WritableStreamInternals.js:
1902         (errorWritableStream):
1903
1904 2016-02-02  Brady Eidson  <beidson@apple.com>
1905
1906         Modern IDB: storage/indexeddb/dont-wedge.html sometimes ASSERTs.
1907         https://bugs.webkit.org/show_bug.cgi?id=153790
1908
1909         Reviewed by Tim Horton.
1910
1911         No new tests (Failing test now unskipped).
1912
1913         This test uncovered an unhandled race where the main thread tried to perform an OpenDB operation 
1914         multiple times while it was already in-progress on the server thread.
1915
1916         There was already a flag meant to cover this race, and it just needed to be applied to one more site.
1917         
1918         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1919         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation):
1920         (WebCore::IDBServer::UniqueIDBDatabase::openBackingStore):
1921
1922 2016-02-02  Daniel Bates  <dabates@apple.com>
1923
1924         CSP: Support checking content security policy without a script execution context
1925         https://bugs.webkit.org/show_bug.cgi?id=153748
1926         <rdar://problem/24439149>
1927
1928         Reviewed by Darin Alder.
1929
1930         Towards checking a Web Worker's content security policy against a redirected worker
1931         script load or redirected XHR request for an XHR request initiated from it, we should
1932         support instantiating a ContentSecurityPolicy object without a ScriptExecutionContext.
1933
1934         No functionality was changed. So, no new tests.
1935
1936         * dom/Document.cpp:
1937         (WebCore::Document::initSecurityContext): Pass |this| as a reference instead of as a pointer.
1938         * page/csp/ContentSecurityPolicy.cpp: Remove extraneous includes ScriptState.h, TextEncoding.h,
1939         and URL.h as they are included by ContentSecurityPolicy.h, FormDataList.h and FormData.h, respectively.
1940         (WebCore::CSPSource::CSPSource): Take a constant reference to a ContentSecurityPolicy instead
1941         of a pointer since we never expected a null pointer.
1942         (WebCore::CSPSource::schemeMatches): Move logic for checking the protocol of source "self"
1943         from here to ContentSecurityPolicy::protocolMatchesSelf() because we may not have a security
1944         origin if ContentSecurityPolicy was initiated without a ScriptExecutionContext object.
1945         (WebCore::CSPSourceList::allowSelf): Added.
1946         (WebCore::CSPSourceList::CSPSourceList): Take a constant reference to a ContentSecurityPolicy
1947         instead of a pointer since we never expected a null pointer. Remove fields from member
1948         initialization list that can be initialized using C++11 in-class initialization syntax.
1949         (WebCore::CSPSourceList::matches): Call ContentSecurityPolicy::urlMatchesSelf() to match the
1950         effective URL against the URL of source "self".
1951         (WebCore::CSPSourceList::parse): Update code as necessary now that m_policy is a reference
1952         instead of a pointer.
1953         (WebCore::CSPSourceList::parseSource): Simplify code by setting internal member fields directly
1954         instead of via member functions.
1955         (WebCore::CSPSourceList::parsePath): Update code as necessary now that m_policy is a reference
1956         instead of a pointer.
1957         (WebCore::CSPDirective::CSPDirective): Take a constant reference to a ContentSecurityPolicy
1958         instead of a pointer since we never expected a null pointer.
1959         (WebCore::CSPDirective::policy): Return a reference to a const ContentSecurityPolicy.
1960         (WebCore::MediaListDirective::MediaListDirective): Take a constant reference to a ContentSecurityPolicy
1961         instead of a pointer since we never expected a null pointer.
1962         (WebCore::MediaListDirective::parse): Update code as necessary now that m_policy is a reference
1963         instead of a pointer.
1964         (WebCore::SourceListDirective::SourceListDirective): Take a constant reference to a ContentSecurityPolicy
1965         instead of a pointer since we never expected a null pointer.
1966         (WebCore::SourceListDirective::allows): Write in terms of CSPSourceList::allowSelf() because we
1967         may not have a security origin to get a URL from if ContentSecurityPolicy was initiated without
1968         a ScriptExecutionContext object.
1969         (WebCore::CSPDirectiveList::reportURIs): Change return type from Vector<URL> to Vector<String>
1970         The caller will convert the strings to URLs with respect to the script execution context.
1971         (WebCore::CSPDirectiveList::parseReportURI): Store the report URI as a string instead of a URL
1972         because we may not have a security origin to compute the absolute URL if ContentSecurityPolicy
1973         was initiated without a ScriptExecutionContext object.
1974         (WebCore::CSPDirectiveList::CSPDirectiveList): Take a reference to a ContentSecurityPolicy
1975         instead of a pointer since we never expected a null pointer. It would be better to take a const
1976         reference to a ContentSecurityPolicy, but ContentSecurityPolicy::applySandboxPolicy() needs to set
1977         state on ContentSecurityPolicy :(
1978         (WebCore::CSPDirectiveList::create): Ditto.
1979         (WebCore::CSPDirectiveList::reportViolation): Update code as necessary now that m_policy is a reference
1980         instead of a pointer.
1981         (WebCore::CSPDirectiveList::checkEvalAndReportViolation): Ditto.
1982         (WebCore::CSPDirectiveList::checkInlineAndReportViolation): Ditto.
1983         (WebCore::CSPDirectiveList::parseDirective): Ditto.
1984         (WebCore::CSPDirectiveList::parseReportURI): Store the report URI as a string instead of a URL
1985         because we may not have a security origin to compute the absolute URL if ContentSecurityPolicy
1986         was initiated without a ScriptExecutionContext object.
1987         (WebCore::CSPDirectiveList::setCSPDirective): Update code as necessary now that m_policy is a reference
1988         instead of a pointer.
1989         (WebCore::CSPDirectiveList::applySandboxPolicy): Ditto.
1990         (WebCore::CSPDirectiveList::parseReflectedXSS): Ditto.
1991         (WebCore::CSPDirectiveList::addDirective): Ditto.
1992         (WebCore::ContentSecurityPolicy::ContentSecurityPolicy): Modified to take the ScriptExecutionObject
1993         as a reference and compute the CSPSource object for "self" and cache the protocol for "self". Removed
1994         field m_overrideInlineStyleAllowed from the member initialization list and used C++11 in-class
1995         initialization syntax to initialize it. Added overloaded constructor that takes a SecurityOrigin object.
1996         We are not making use of this overloaded constructor at this time. We will in a subsequent patch.
1997         (WebCore::ContentSecurityPolicy::didReceiveHeader): Store the eval disabled error message for
1998         the last parsed policy in a member field instead of using it as part of disabling eval execution
1999         on the script execution context because we may not have such a context.
2000         (WebCore::ContentSecurityPolicy::applyPolicyToScriptExecutionContext): Applies the content security
2001         policy eval and sandbox restrictions to the script execution context.
2002         (WebCore::ContentSecurityPolicy::urlMatchesSelf): Match the specified URL against the URL for
2003         source "self".
2004         (WebCore::ContentSecurityPolicy::protocolMatchesSelf): Match the protocol of the specified URL
2005         against the protocol for source "self".
2006         (WebCore::ContentSecurityPolicy::gatherReportURIs): Modified to use the script execution context
2007         to compute the absolute URL for each report URI.
2008         (WebCore::ContentSecurityPolicy::reportViolation): Bail out if we do not have a script execution
2009         context.
2010         (WebCore::ContentSecurityPolicy::logToConsole): Only log to the console if we have a script
2011         execution context.
2012         (WebCore::ContentSecurityPolicy::reportBlockedScriptExecutionToInspector): Only report blocked
2013         script execution to the Web Inspector if we have a script execution context.
2014         (WebCore::CSPSourceList::addSourceSelf): Deleted.
2015         (WebCore::CSPSourceList::addSourceStar): Deleted.
2016         (WebCore::CSPSourceList::addSourceUnsafeInline): Deleted.
2017         (WebCore::CSPSourceList::addSourceUnsafeEval): Deleted.
2018         (WebCore::CSPDirectiveList::gatherReportURIs): Deleted.
2019         (WebCore::ContentSecurityPolicy::securityOrigin): Deleted.
2020         (WebCore::ContentSecurityPolicy::url): Deleted.
2021         (WebCore::ContentSecurityPolicy::completeURL): Deleted.
2022         (WebCore::ContentSecurityPolicy::enforceSandboxFlags): Deleted.
2023         * page/csp/ContentSecurityPolicy.h:
2024         (WebCore::ContentSecurityPolicy::enforceSandboxFlags): Accumulates the parsed sandbox flags. We
2025         will apply the sandbox flags in ContentSecurityPolicy::applyPolicyToScriptExecutionContext().
2026         * workers/WorkerGlobalScope.cpp:
2027         (WebCore::WorkerGlobalScope::WorkerGlobalScope): Instantiate ContentSecurityPolicy.
2028         (WebCore::WorkerGlobalScope::applyContentSecurityPolicyResponseHeaders): Move instantiation of
2029         ContentSecurityPolicy from here to constructor.
2030
2031 2016-02-02  Eric Carlson  <eric.carlson@apple.com>
2032
2033         Allow ports to disable automatic text track selection
2034         https://bugs.webkit.org/show_bug.cgi?id=153761
2035         <rdar://problem/24416768>
2036
2037         Reviewed by Darin Adler.
2038
2039         Test: media/track/track-manual-mode.html
2040
2041         * Modules/mediacontrols/MediaControlsHost.cpp:
2042         (WebCore::MediaControlsHost::manualKeyword): New.
2043         (WebCore::MediaControlsHost::captionDisplayMode): Support 'manual' mode.
2044         * Modules/mediacontrols/MediaControlsHost.h:
2045
2046         * Modules/mediacontrols/mediaControlsApple.js:
2047         (Controller.prototype.buildCaptionMenu): Check the 'off' item when in manual mode.
2048
2049         * html/HTMLMediaElement.cpp:
2050         (WebCore::HTMLMediaElement::addTextTrack): Update m_captionDisplayMode when called for the first
2051           time so it is always correct. Set the track's manual selection mode as appropriate.
2052         (WebCore::HTMLMediaElement::captionPreferencesChanged): Set each track's manual selection 
2053           mode as appropriate.
2054
2055         * html/track/TextTrack.cpp:
2056         (WebCore::TextTrack::kind): Return 'subtitles' for forced tracks when in manual mode.
2057         * html/track/TextTrack.h:
2058
2059         * html/track/TrackBase.h:
2060         (WebCore::TrackBase::kind): Make virtual.
2061
2062         * page/CaptionUserPreferences.cpp:
2063         (WebCore::CaptionUserPreferences::beginBlockingNotifications): New.
2064         (WebCore::CaptionUserPreferences::endBlockingNotifications): Ditto.
2065         (WebCore::CaptionUserPreferences::notify): Don't notify when blocked.
2066         * page/CaptionUserPreferences.h:
2067
2068         * page/CaptionUserPreferencesMediaAF.cpp:
2069         (WebCore::CaptionUserPreferencesMediaAF::CaptionUserPreferencesMediaAF): Set manual mode 
2070           when appropriate.
2071         (WebCore::CaptionUserPreferencesMediaAF::captionDisplayMode): Check manual mode.
2072         (WebCore::CaptionUserPreferencesMediaAF::setCaptionDisplayMode): Ditto.
2073         (WebCore::CaptionUserPreferencesMediaAF::setPreferredLanguage): Ditto.
2074         (WebCore::CaptionUserPreferencesMediaAF::textTrackSelectionScore): Return zero when in manual mode.
2075         (WebCore::CaptionUserPreferencesMediaAF::sortedTrackListForMenu): Consider manual mode. Fix
2076           typos in logging.
2077
2078         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2079         (WebCore::mediaDescriptionForKind): Return 'auxiliary' when in manual mode.
2080
2081         * testing/Internals.cpp:
2082         (WebCore::Internals::setCaptionDisplayMode): Support manual mode.
2083
2084 2016-02-02  Adrien Plazas  <aplazas@igalia.com>
2085
2086         REGRESSION(r195899): ASSERTION FAILED: is<Target>(source) in EventPath::retargetTouch() since r195899
2087         https://bugs.webkit.org/show_bug.cgi?id=153741
2088
2089         Reviewed by Ryosuke Niwa.
2090
2091         * dom/EventDispatcher.cpp:
2092         (WebCore::EventPath::retargetTouch):
2093
2094 2016-02-01  Joseph Pecoraro  <pecoraro@apple.com>
2095
2096         Web Inspector: High Level Memory Overview Instrument
2097         https://bugs.webkit.org/show_bug.cgi?id=153516
2098         <rdar://problem/24356378>
2099
2100         Reviewed by Brian Burg.
2101
2102         Add a new agent that gathers data from the ResourceUsageThread
2103         and sends to the frontend.
2104
2105         Test: inspector/memory/tracking.html
2106
2107         * CMakeLists.txt:
2108         * Configurations/FeatureDefines.xcconfig:
2109         * WebCore.xcodeproj/project.pbxproj:
2110         New files.
2111
2112         * inspector/InspectorController.cpp:
2113         (WebCore::InspectorController::InspectorController):
2114         Add the new agent.
2115
2116         * inspector/InspectorMemoryAgent.h: Added.
2117         * inspector/InspectorMemoryAgent.cpp: Added.
2118         (WebCore::InspectorMemoryAgent::InspectorMemoryAgent):
2119         (WebCore::InspectorMemoryAgent::didCreateFrontendAndBackend):
2120         (WebCore::InspectorMemoryAgent::willDestroyFrontendAndBackend):
2121         (WebCore::InspectorMemoryAgent::startTracking):
2122         (WebCore::InspectorMemoryAgent::stopTracking):
2123         (WebCore::InspectorMemoryAgent::collectSample):
2124         Implement the agent by adding / removing it as a ResourceUsage
2125         observer. When receiving the data forward it to the frontend.
2126
2127 2016-02-01  Alex Christensen  <achristensen@webkit.org>
2128
2129         Fix CMake build.
2130
2131         * PlatformMac.cmake:
2132
2133 2016-02-01  Brady Eidson  <beidson@apple.com>
2134
2135         Modern IDB: Cursors (still) do not keep their opening request alive.
2136         https://bugs.webkit.org/show_bug.cgi?id=153724
2137
2138         Reviewed by Alex Christensen.
2139
2140         No new tests (All existing tests pass without flakiness).
2141
2142         IDBCursors did not properly keep their JS wrappers alive.
2143         Making them ActiveDOMObjects that keep track of how many requests might be in flight fixes this.
2144         This also makes them actually keep their opening-request live via the opaque-root mechanism.
2145         
2146         IDBCursorWithValue also needed to opt in to all of these mechanisms.
2147
2148         * CMakeLists.txt:
2149         * WebCore.xcodeproj/project.pbxproj:
2150
2151         * Modules/indexeddb/IDBCursor.h:
2152         (WebCore::IDBCursor::hasPendingActivity): The base IDBCursor always has no pending activity,
2153           to maintain current behavior in LegacyIDB. This weirdness will go away when LegacyIDB does.
2154         * Modules/indexeddb/IDBCursor.idl:
2155         * Modules/indexeddb/IDBCursorWithValue.idl:
2156
2157         Track a count for all outstanding requests to keep the cursor alive as an ActiveDOMObject.
2158         * Modules/indexeddb/client/IDBCursorImpl.cpp:
2159         (WebCore::IDBClient::IDBCursor::IDBCursor):
2160         (WebCore::IDBClient::IDBCursor::update):
2161         (WebCore::IDBClient::IDBCursor::uncheckedIterateCursor):
2162         (WebCore::IDBClient::IDBCursor::deleteFunction):
2163         (WebCore::IDBClient::IDBCursor::activeDOMObjectName):
2164         (WebCore::IDBClient::IDBCursor::canSuspendForDocumentSuspension):
2165         (WebCore::IDBClient::IDBCursor::hasPendingActivity):
2166         (WebCore::IDBClient::IDBCursor::decrementOutstandingRequestCount):
2167         * Modules/indexeddb/client/IDBCursorImpl.h:
2168         
2169         Rework the "delete" family of functions on the object store to allow for returning a modern IDBRequest.
2170         A lot of this can go away when LegacyIDB does.
2171         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
2172         (WebCore::IDBClient::IDBObjectStore::deleteFunction):
2173         (WebCore::IDBClient::IDBObjectStore::doDelete):
2174         (WebCore::IDBClient::IDBObjectStore::modernDelete):
2175         * Modules/indexeddb/client/IDBObjectStoreImpl.h:
2176         
2177         * Modules/indexeddb/client/IDBRequestImpl.cpp:
2178         (WebCore::IDBClient::IDBRequest::setSource): Setup a ScopeGuard to decrement the cursor's request
2179           count whenever it makes sense to do so.
2180         (WebCore::IDBClient::IDBRequest::dispatchEvent): Clear the ScopeGuard (if it exists) to decrement the count.
2181         (WebCore::IDBClient::IDBRequest::willIterateCursor): Set the ScopeGuard.
2182         (WebCore::IDBClient::IDBRequest::didOpenOrIterateCursor): Clear the ScopeGuard (if it exists) to decrement the count.
2183         * Modules/indexeddb/client/IDBRequestImpl.h:
2184         
2185         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2186         (WebCore::IDBServer::ScopeGuard::ScopeGuard): Deleted.
2187         (WebCore::IDBServer::ScopeGuard::~ScopeGuard): Deleted.
2188         (WebCore::IDBServer::ScopeGuard::enable): Deleted.
2189         (WebCore::IDBServer::ScopeGuard::disable): Deleted.
2190         
2191         * bindings/js/JSIDBCursorWithValueCustom.cpp: Added.
2192         (WebCore::JSIDBCursorWithValue::visitAdditionalChildren):
2193         
2194         * platform/ScopeGuard.h: Added.
2195         (WebCore::ScopeGuard::ScopeGuard):
2196         (WebCore::ScopeGuard::~ScopeGuard):
2197         (WebCore::ScopeGuard::enable):
2198         (WebCore::ScopeGuard::disable):
2199
2200 2016-02-01  Sun-woo Nam  <sunny.nam@samsung.com>
2201
2202         Free Colormap when XWindow is destroyed.
2203         https://bugs.webkit.org/show_bug.cgi?id=153413
2204
2205         Reviewed by Žan Doberšek.
2206
2207         Colormap is needed to create XWindow and it should be freed when XWindow is destroyed.
2208         Unless Colormap is freed before destroying XWindow, memory leak is suspected.
2209         XFreeColormap therefore is needed on X11Helper.
2210
2211         * platform/graphics/surfaces/glx/X11Helper.cpp: Added XFreeColormap.
2212         (WebCore::X11Helper::destroyWindow):
2213
2214 2016-02-01  Tim Horton  <timothy_horton@apple.com>
2215
2216         Move some SPI declarations into the appropriate SPI header
2217         https://bugs.webkit.org/show_bug.cgi?id=153755
2218
2219         Reviewed by Darin Adler.
2220
2221         * platform/graphics/cocoa/IOSurface.mm:
2222         * platform/spi/cg/CoreGraphicsSPI.h:
2223
2224 2016-02-01  Tim Horton  <timothy_horton@apple.com>
2225
2226         Snapshot surfaces are forever wired after being compressed
2227         https://bugs.webkit.org/show_bug.cgi?id=153751
2228         <rdar://problem/24354546>
2229
2230         Reviewed by Darin Adler.
2231
2232         * platform/graphics/cocoa/IOSurface.mm:
2233         (IOSurface::convertToFormat):
2234         Allow IOSurfaceAccelerator to unwire surfaces after they're transformed.
2235
2236 2016-02-01  Dan Bernstein  <mitz@apple.com>
2237
2238         <rdar://problem/20150072> [iOS] Remove some file upload code only needed before iOS 9
2239         https://bugs.webkit.org/show_bug.cgi?id=153754
2240
2241         Reviewed by Darin Adler.
2242
2243         * English.lproj/Localizable.strings: Updated for removal of WebKit2 string.
2244
2245 2016-02-01  Said Abou-Hallawa  <sabouhallawa@apple.com>
2246
2247         Cache the Path instead of creating it every time it is required
2248         https://bugs.webkit.org/show_bug.cgi?id=152939
2249
2250         Reviewed by Darin Adler.
2251
2252         Instead of creating the Path object every time it is required, we should 
2253         cache it in an LRU cache. TinyLRUCache returns a reference to the cached
2254         entry so we do not have to pay the cost of copying it either.
2255
2256         * platform/graphics/FloatRoundedRect.h:
2257         (WebCore::operator!=):
2258         Implement the inequality operator for FloatRoundedRect since it is
2259         called by TinyLRUCache.
2260         
2261         * rendering/ClipPathOperation.h:
2262         Return a reference to the path in the cache since instead of creating a
2263         new copy.
2264         
2265         * rendering/style/BasicShapes.cpp:
2266         (WebCore::SVGPathTranslatedByteStream::SVGPathTranslatedByteStream):
2267         (WebCore::SVGPathTranslatedByteStream::operator==):
2268         (WebCore::SVGPathTranslatedByteStream::operator!=):
2269         (WebCore::SVGPathTranslatedByteStream::isEmpty):
2270         (WebCore::SVGPathTranslatedByteStream::path):
2271         This struct holds an offset and an SVGPathByteStream. It is the key of 
2272         the LRU cache for the the translated SVGPathByteStream.
2273         
2274         (WebCore::EllipsePathPolicy::isKeyNull):
2275         (WebCore::EllipsePathPolicy::createValueForKey):
2276         (WebCore::RoundedRectPathPolicy::isKeyNull):
2277         (WebCore::RoundedRectPathPolicy::createValueForKey):
2278         (WebCore::PolygonPathPolicy::isKeyNull):
2279         (WebCore::PolygonPathPolicy::createValueForKey):
2280         (WebCore::TranslatedByteStreamPathPolicy::isKeyNull):
2281         (WebCore::TranslatedByteStreamPathPolicy::createValueForKey):
2282         Inherit from the LRU cache policy template, so have a specific name for
2283         the desired path contents and pass this class explicitly to the LRU cache
2284         template.
2285         
2286         (WebCore::cachedEllipsePath):
2287         (WebCore::cachedRoundedRectPath):
2288         (WebCore::cachedPolygonPath):
2289         (WebCore::cachedTranslatedByteStreamPath):
2290         Return a cached path object for specific path contents.
2291         
2292         (WebCore::BasicShapeCircle::path):
2293         (WebCore::BasicShapeEllipse::path):
2294         (WebCore::BasicShapePolygon::path):
2295         (WebCore::BasicShapePath::path):
2296         (WebCore::BasicShapeInset::path):
2297         Get the Path object from the cache; create a new one if it does not exist.
2298         
2299         * rendering/style/BasicShapes.h:
2300         Change the prototype of the path() function to return a reference to the
2301         path in the cache instead of a having to copying it.
2302         
2303         * svg/SVGPathByteStream.h:
2304         (WebCore::SVGPathByteStream::operator!=):
2305         Implement the inequality operator for SVGPathByteStream because it is
2306         called by TinyLRUCache.
2307
2308 2016-02-01  Chris Dumez  <cdumez@apple.com>
2309
2310         Move properties that use custom bindings to the prototype
2311         https://bugs.webkit.org/show_bug.cgi?id=153735
2312
2313         Reviewed by Darin Adler.
2314
2315         Move properties that use custom bindings to the prototype. Whether a
2316         property's bindings code is generated or custom-written should not
2317         impact where the property is located.
2318
2319         No new tests, already covered by existing tests.
2320
2321         * bindings/js/JSHTMLDocumentCustom.cpp:
2322         (WebCore::JSHTMLDocument::getOwnPropertySlot):
2323         Add null-check for staticPropHashTable. HTMLDocument no longer has
2324         any property on the instance so staticPropHashTable is now null.
2325
2326         * bindings/scripts/CodeGeneratorJS.pm:
2327
2328 2016-02-01  Jer Noble  <jer.noble@apple.com>
2329
2330         REGRESSION(r195770): Use-after-free in ResourceLoaderOptions::cachingPolicy
2331         https://bugs.webkit.org/show_bug.cgi?id=153727
2332         <rdar://problem/24429886>
2333
2334         Reviewed by Chris Dumez.
2335
2336         The `this` object may be freed after calling deleteIfPossible(). Make the early-return-if-
2337         deleted more explicit, and only check allowsCaching() after the deleteIfPossible() return
2338         value check.
2339
2340         * loader/cache/CachedResource.cpp:
2341         (WebCore::CachedResource::removeClient):
2342
2343 2016-02-01  Dan Bernstein  <mitz@apple.com>
2344
2345         Tried to fix a build after r195899.
2346
2347         * dom/EventContext.h: Enabled TouchEventContext type trait specialization on iOS.
2348
2349 2016-02-01  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2350
2351         [Fetch API] Implement Fetch API Request
2352         https://bugs.webkit.org/show_bug.cgi?id=153437
2353
2354         Added support for Fetch Request and Body.
2355         Body is sharing functionality between Request and Response.
2356         Conversion between various body types are not implemented yet.
2357
2358         Added a FetchOptions class. Options in this class are partially redundant with ResourceLoaderOptions.
2359
2360         Fixing bug in Headers constructor.
2361         Making error reporting in case of modifying headers compliant with the spec.
2362
2363         Reviewed by Darin Adler.
2364
2365         Tests: imported/w3c/web-platform-tests/fetch/api/request/request-clone.sub.html
2366                imported/w3c/web-platform-tests/fetch/api/request/request-consume.html
2367                imported/w3c/web-platform-tests/fetch/api/request/request-disturbed.html
2368                imported/w3c/web-platform-tests/fetch/api/request/request-error.html
2369                imported/w3c/web-platform-tests/fetch/api/request/request-headers.html
2370                imported/w3c/web-platform-tests/fetch/api/request/request-idl.html
2371                imported/w3c/web-platform-tests/fetch/api/request/request-init-001.sub.html
2372                imported/w3c/web-platform-tests/fetch/api/request/request-init-002.html
2373                imported/w3c/web-platform-tests/fetch/api/request/request-init-003.sub.html
2374                imported/w3c/web-platform-tests/fetch/api/request/request-structure.html
2375
2376         * CMakeLists.txt:
2377         * DerivedSources.cpp:
2378         * DerivedSources.make:
2379         * Modules/fetch/FetchBody.cpp: Added.
2380         (WebCore::FetchBody::initBody):
2381         (WebCore::FetchBody::clear):
2382         (WebCore::FetchBody::processIfEmptyOrDisturbed):
2383         (WebCore::FetchBody::arrayBuffer):
2384         (WebCore::FetchBody::formData):
2385         (WebCore::FetchBody::blob):
2386         (WebCore::FetchBody::text):
2387         (WebCore::FetchBody::json):
2388         * Modules/fetch/FetchBody.h: Added.
2389         (WebCore::FetchBody::~FetchBody):
2390         (WebCore::FetchBody::isEmpty):
2391         (WebCore::FetchBody::isDisturbed):
2392         (WebCore::FetchBody::setDisturbed):
2393         (WebCore::FetchBody::setMimeType):
2394         (WebCore::FetchBody::mimeType):
2395         * Modules/fetch/FetchBody.idl: Added.
2396         * Modules/fetch/FetchHeaders.cpp:
2397         (WebCore::canWriteHeader):
2398         (WebCore::FetchHeaders::append):
2399         (WebCore::FetchHeaders::remove):
2400         (WebCore::FetchHeaders::set):
2401         (WebCore::FetchHeaders::fill): Helper routine implementing https://fetch.spec.whatwg.org/#concept-headers-fill
2402         * Modules/fetch/FetchHeaders.h: Adding header getter/setter for FetchRequest.
2403         (WebCore::FetchHeaders::fastGet):
2404         (WebCore::FetchHeaders::fastSet):
2405         * Modules/fetch/FetchHeaders.js: Fixing bug in constructor (covered by modified headers-basc.html test).
2406         (initializeFetchHeaders):
2407         * Modules/fetch/FetchOptions.h: Added.
2408         (WebCore::FetchOptions::FetchOptions):
2409         (WebCore::FetchOptions::type):
2410         (WebCore::FetchOptions::destination):
2411         (WebCore::FetchOptions::mode):
2412         (WebCore::FetchOptions::credentials):
2413         (WebCore::FetchOptions::cache):
2414         (WebCore::FetchOptions::redirect):
2415         (WebCore::FetchOptions::referrerPolicy):
2416         (WebCore::FetchOptions::setType):
2417         (WebCore::FetchOptions::setDestination):
2418         (WebCore::FetchOptions::setMode):
2419         (WebCore::FetchOptions::setCredentials):
2420         (WebCore::FetchOptions::setCache):
2421         (WebCore::FetchOptions::setRedirect):
2422         (WebCore::FetchOptions::setReferrerPolicy):
2423         * Modules/fetch/FetchRequest.cpp: Added.
2424         (WebCore::FetchRequest::create):
2425         (WebCore::FetchRequest::FetchRequest):
2426         (WebCore::FetchRequest::init):
2427         (WebCore::FetchRequest::setReferrer):
2428         (WebCore::FetchRequest::setReferrerPolicy):
2429         (WebCore::FetchRequest::setMode):
2430         (WebCore::FetchRequest::setCredentials):
2431         (WebCore::FetchRequest::setCache):
2432         (WebCore::FetchRequest::setRedirect):
2433         (WebCore::FetchRequest::type):
2434         (WebCore::FetchRequest::destination):
2435         (WebCore::FetchRequest::referrerPolicy):
2436         (WebCore::FetchRequest::referrer):
2437         (WebCore::FetchRequest::mode):
2438         (WebCore::FetchRequest::credentials):
2439         (WebCore::FetchRequest::cache):
2440         (WebCore::FetchRequest::redirect):
2441         (WebCore::FetchRequest::setMethod):
2442         (WebCore::FetchRequest::clone):
2443         * Modules/fetch/FetchRequest.h: Added.
2444         (WebCore::FetchRequest::method):
2445         (WebCore::FetchRequest::url):
2446         (WebCore::FetchRequest::integrity):
2447         (WebCore::FetchRequest::headers):
2448         * Modules/fetch/FetchRequest.idl: Added.
2449         * WebCore.xcodeproj/project.pbxproj:
2450         * bindings/js/Dictionary.h:
2451         (WebCore::Dictionary::execState):
2452         * bindings/js/JSDictionary.cpp:
2453         (WebCore::JSDictionary::convertValue):
2454         * bindings/js/JSDictionary.h:
2455         (WebCore::JSDictionary::get):
2456
2457 2016-01-31  Jeremy Jones  <jeremyj@apple.com>
2458
2459         Add resize event for HTMLMediaElement
2460         https://bugs.webkit.org/show_bug.cgi?id=125715
2461
2462         Reviewed by Darin Adler.
2463
2464         Tests: http/tests/media/hls/hls-video-resize.html
2465                media/video-resize.html
2466
2467         Move resize javascript event from DOMWindow.idl to GlobalEventHandlers.idl
2468         per https://html.spec.whatwg.org/multipage/webappapis.html#globaleventhandlers
2469
2470         Post resize event from video element when metadata loads and when content size changes.
2471
2472         * dom/GlobalEventHandlers.idl: Add onresize.
2473         * html/HTMLElement.cpp:
2474         (WebCore::HTMLElement::createEventHandlerNameMap): Add onresizeAttr.
2475         * html/HTMLMediaElement.cpp:
2476         (WebCore::HTMLMediaElement::setReadyState):
2477         (WebCore::HTMLMediaElement::mediaPlayerSizeChanged):
2478         * html/HTMLMediaElement.h:
2479         (WebCore::HTMLMediaElement::scheduleResizeEvent):
2480         (WebCore::HTMLMediaElement::scheduleResizeEventIfSizeChanged):
2481         * html/HTMLVideoElement.cpp:
2482         (WebCore::HTMLVideoElement::scheduleResizeEvent): Sechedule event.
2483         (WebCore::HTMLVideoElement::scheduleResizeEventIfSizeChanged): Schedule event if size has changed.
2484         * html/HTMLVideoElement.h: Add declarations.
2485         * page/DOMWindow.idl: Remove onresize.
2486
2487 2016-01-31  Darin Adler  <darin@apple.com>
2488
2489         Revert accidental behavior change from previous patch.
2490
2491         * platform/URL.cpp:
2492         (WebCore::mimeTypeFromDataURL): Restore behavior where an empty MIME type would
2493         be turned into "text/plain".
2494
2495 2016-01-31  Darin Adler  <darin@apple.com>
2496
2497         Cut down on calls to String::lower; mostly replace with convertToASCIILowercase
2498         https://bugs.webkit.org/show_bug.cgi?id=153732
2499
2500         Reviewed by Dean Jackson.
2501
2502         * Modules/mediasource/MediaSource.cpp:
2503         (WebCore::MediaSource::isTypeSupported): Added comment about mysterious call
2504         to lower(); should probably return here and remove it.
2505
2506         * Modules/navigatorcontentutils/NavigatorContentUtils.cpp:
2507         (WebCore::initProtocolHandlerWhitelist): Deleted. Moved into isProtocolWhitelisted.
2508         (WebCore::isProtocolWhitelisted): Changed set to be ASCIICaseInsensitiveHash and
2509         initialized it using a lambda instead of a separate function.
2510         (WebCore::verifyProtocolHandlerScheme): Added a FIXME about some case sensitive
2511         checking of the protocol prefix here.
2512
2513         * Modules/plugins/QuickTimePluginReplacement.mm:
2514         (WebCore::QuickTimePluginReplacement::supportsMimeType): Changed set to be
2515         ASCIICaseInsensitiveHash and initialized it using a lambda instead of using
2516         an explict check for empty.
2517         (WebCore::QuickTimePluginReplacement::supportsFileExtension): Ditto.
2518
2519         * Modules/plugins/YouTubePluginReplacement.cpp:
2520         (WebCore::queryKeysAndValues): Use convertToASCIILowercase. The keys here are
2521         going to be all ASCII.
2522         (WebCore::isYouTubeURL): Use equalLettersIgnoringASCIICase instead of lowercasing
2523         the string.
2524         (WebCore::processAndCreateYouTubeURL): Use url.protocolIsInHTTPFamily instead of
2525         listing "http" and then "https" explicitly. Use equalLettersIgnoringASCIICase
2526         instead of lowercasing a string.
2527         (WebCore::YouTubePluginReplacement::youTubeURL): Ditto.
2528
2529         * Modules/websockets/WebSocketHandshake.cpp:
2530         (WebCore::hostName): Use convertToASCIILowercase on host name.
2531         (WebCore::WebSocketHandshake::host): Ditto.
2532
2533         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2534         (webkitAccessibleGetAttributes): Call convertToASCIILowercase instead of lower
2535         to lowercase an element's tag name. This is a strange way to do things; typically
2536         would be better to use some other function on Element, since tagName goes out of
2537         its way to be capitalized, but some ATK expert can improve this later.
2538
2539         * css/CSSGrammar.y.in: Use the new convertToASCIILowercaseInPlace function rather
2540         than the old lower function. We only need to lowercase the ASCII letters, and it's
2541         also better to have the function have a clearer name.
2542
2543         * css/CSSParser.cpp:
2544         (WebCore::convertToASCIILowercaseInPlace): Renamed from makeLower and made it deal
2545         with only ASCII lowercasing.
2546         (WebCore::CSSParserString::convertToASCIILowercaseInPlace): Renamed from lower.
2547         (WebCore::isUniversalKeyword): Added. Helper for the function below that uses
2548         equalLettersIgnoringASCIICase rather than lowercasing the string.
2549         (WebCore::parseKeywordValue): Use isUniversalKeyword. Also clarified a comment.
2550         (WebCore::CSSParser::parseAttr): Use convertToASCIILowercaseInPlace and delay
2551         String creation until later in the function, using CSSParserString operations more.
2552
2553         * css/CSSParserValues.cpp:
2554         (WebCore::CSSParserSelector::parsePseudoElementSelector): Use
2555         convertToASCIILowercaseInPlace by its new name, with its new behavior.
2556
2557         * css/CSSParserValues.h: Tweaked comment and formatting a bit. Replaced the lower
2558         function with the convertToASCIILowercaseInPlace function.
2559
2560         * css/CSSSelector.cpp:
2561         (WebCore::CSSSelector::RareData::parseNth): Rewrote this to avoid the need to
2562         make a lowercased copy of m_argument. Use equalLettersIgnoringASCIICase, and two
2563         calls to find. Also use String::toIntStrict so we don't have to create String
2564         objects for substrings.
2565
2566         * css/MediaQuery.cpp:
2567         (WebCore::MediaQuery::MediaQuery): Use convertToASCIILowercase for media type name.
2568         * css/MediaQueryExp.cpp:
2569         (WebCore::MediaQueryExp::serialize): Use convertToASCIILowercase for media feature name.
2570
2571         * dom/Document.cpp:
2572         (WebCore::isSeparator): Tweaked formatting and removed non-helpful comment.
2573         (WebCore::processArguments): Changed this from a static member function to a non-member
2574         file internal function. Use a std::function instead of a function pointer with a void*
2575         pointer. Rewrote algorithm to simplify it and use StringView instead of String for the
2576         keys and values.
2577         (WebCore::Document::processViewport): Use a lambda instead of a function pointer to
2578         call setViewportFeature, so that function's interface is no longer dictated by
2579         the exact type of the function pointer argument to processArguments.
2580         (WebCore::Document::processFormatDetection): Use a lambda instead of the
2581         setParserFeature function above; use equalLettersIgnoringASCIICase for both the
2582         key and the value, since processArguments no longer lowercases the string.
2583         (WebCore::Document::processArguments): Deleted.
2584
2585         * dom/Document.h: Removed unnecessary declaration of processArguments and
2586         ArgumentsCallback. Both are now private to the cpp file.
2587
2588         * dom/Element.cpp:
2589         (WebCore::makeIdForStyleResolution): Use convertToASCIILowercase. When in quirks mode,
2590         we want to match IDs in an ASCII case-insensitive way not match compatibility caseless.
2591
2592         * dom/ScriptElement.cpp:
2593         (WebCore::ScriptElement::isScriptTypeSupported): Remove the use of lower here since
2594         the MIME type registry is now itself ASCII case-insensitive.
2595
2596         * dom/ViewportArguments.cpp:
2597         (WebCore::numericPrefix): Changed to use StringView and take a Document&, rearranged
2598         argument order so Document& comes first.
2599         (WebCore::findSizeValue): Ditto.
2600         (WebCore::findScaleValue): Ditto.
2601         (WebCore::findBooleanValue): Ditto. Also use std::abs instead of fabs, possibly
2602         avoiding a conversion from float to double (not sure it was happening before but it's
2603         definitely not happening now).
2604         (WebCore::setViewportFeature): Changed to put arguments in a more logical order, to take
2605         the ViewportArguments as a reference, not a void*, and to use StringView to avoid forcing
2606         the caller to allocate strings. Also changed to use equalLettersIgnoringASCIICase so we
2607         don't rely on the caller to make the key lowercase for us.
2608         (WebCore::reportViewportWarning): Changed argument types. Added a couple comments about
2609         mistakes in the function.
2610
2611         * dom/ViewportArguments.h: Removed unnecessary declaration of reportViewportWarning,
2612         which is now private to the cpp file. Updated for new arguments to setViewportFeature.
2613
2614         * editing/EditorCommand.cpp:
2615         (WebCore::executeFormatBlock): Use convertToASCIILowercase on the argument, which is
2616         specifying a tag name.
2617
2618         * fileapi/Blob.cpp:
2619         (WebCore::Blob::isValidContentType): Removed unnecessary separate loops for
2620         8-bit and 16-bit strings. Content types are short strings and this small optimization is
2621         not worth the additional code complexity.
2622         (WebCore::Blob::normalizedContentType): Use convertToASCIILowercase since valid
2623         content types are guaranteed to be all ASCII.
2624         (WebCore::Blob::isNormalizedContentType): Removed unnecessary separate loops for
2625         8-bit and 16-bit strings. Content types are short strings and this small optimization is
2626         not worth the additional code complexity.
2627
2628         * html/parser/HTMLParserIdioms.cpp: Added now-needed include of QualifiedName.h.
2629
2630         * html/parser/HTMLParserIdioms.h: Removed unneeded include of QualifiedName.h and
2631         WTFString.h. Made sure every function is declared first, even if it's also defined
2632         later in the header in the section for functions templates and inline functions.
2633
2634         * loader/archive/ArchiveFactory.cpp:
2635         (WebCore::ArchiveFactory::registerKnownArchiveMIMETypes): Use auto& for the type of
2636         the set of MIME types here, since it's now using ASCIICaseInsensitiveHash.
2637
2638         * platform/MIMETypeRegistry.cpp: Changed the MIME type sets to use
2639         ASCIICaseInsensitiveHash since MIME type are not case sensitive.
2640         (WebCore::initializeSupportedImageMIMETypes): Use a modern for loop.
2641         (WebCore::initializeSupportedImageMIMETypesForEncoding): Updated for HashSet type change.
2642         (WebCore::initializePDFMIMETypes): Use a modern for loop.
2643         (WebCore::initializeSupportedNonImageMimeTypes): Use a modern for loop.
2644         (WebCore::initializeSupportedMediaMIMETypes): Updated for HashSet type change.
2645         (WebCore::initializeUnsupportedTextMIMETypes): Use a modern for loop.
2646         (WebCore::initializeMIMETypeRegistry): Updated for HashSet type change.
2647         (WebCore::MIMETypeRegistry::getSupportedImageMIMETypes): Ditto.
2648         (WebCore::MIMETypeRegistry::getSupportedImageResourceMIMETypes): Ditto.
2649         (WebCore::MIMETypeRegistry::getSupportedImageMIMETypesForEncoding): Ditto.
2650         (WebCore::MIMETypeRegistry::getSupportedNonImageMIMETypes): Ditto.
2651         (WebCore::MIMETypeRegistry::getSupportedMediaMIMETypes): Ditto.
2652         (WebCore::MIMETypeRegistry::getPDFMIMETypes): Ditto.
2653         (WebCore::MIMETypeRegistry::getPDFAndPostScriptMIMETypes): Ditto.
2654         (WebCore::MIMETypeRegistry::getUnsupportedTextMIMETypes): Ditto.
2655         (WebCore::mimeTypeAssociationMap): Use ASCIICaseInsensitiveHash.
2656         (WebCore::MIMETypeRegistry::getNormalizedMIMEType): Use auto to make code tighter.
2657
2658         * platform/MIMETypeRegistry.h: Changed return types of the getMIMETypes functions
2659         to use ASCIICaseInsensitiveHash.
2660
2661         * platform/SchemeRegistry.cpp:
2662         (WebCore::schemesForbiddenFromDomainRelaxation): Changed type to
2663         use ASCIICaseInsensitiveHash.
2664
2665         * platform/URL.cpp:
2666         (WebCore::mimeTypeFromDataURL): Use convertToASCIILowercase instead of lower.
2667         Also removed some dead code that tried to handle the case where the data URL
2668         has a comma as one of the first 5 characters: That can't happen since it's a
2669         precondition of this function that the first five characters are "data:".
2670
2671         * platform/graphics/MediaPlayer.cpp:
2672         (WebCore::MediaPlayer::getSupportedTypes): Change type of argument to
2673         a HashSet with ASCIICaseInsensitiveHash.
2674         * platform/graphics/MediaPlayer.h: Ditto.
2675
2676         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
2677         (WebCore::MediaPlayerPrivateAVFoundation::staticMIMETypeList):
2678         Changed type of HashSet to use ASCIICaseInsensitiveHash.
2679         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h: Ditto.
2680
2681         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2682         (WebCore::avfMIMETypes):
2683         Changed type of HashSet to use ASCIICaseInsensitiveHash.
2684         (WebCore::MediaPlayerPrivateAVFoundationCF::getSupportedTypes): Ditto.
2685         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h: Ditto.
2686
2687         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2688         Changed type of HashSet to use ASCIICaseInsensitiveHash.
2689         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2690         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithImageGenerator): Removed
2691         an unnecessary line of code to set a local variable to 0 just before it falls
2692         out of scope.
2693         (WebCore::avfMIMETypes): Ditto. Also tightened up the code a bit.
2694         (WebCore::MediaPlayerPrivateAVFoundationObjC::getSupportedTypes): Ditto.
2695
2696         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2697         Changed type of HashSet to use ASCIICaseInsensitiveHash.
2698         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2699         (WebCore::mimeTypeCache): Ditto.
2700         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::getSupportedTypes): Ditto.
2701
2702         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: Ditto.
2703         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2704         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::getSupportedTypes): Ditto.
2705
2706         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2707         (WebCore::mimeTypeCache): Ditto.
2708         (WebCore::MediaPlayerPrivateGStreamer::getSupportedTypes): Ditto.
2709         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Ditto.
2710
2711         * platform/graphics/mac/MediaPlayerPrivateQTKit.h: Ditto.
2712         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2713         (WebCore::shouldRejectMIMEType): Made this non-case-sensitive by using startsWith
2714         and the "false" argument. Later change this to startsWithIgnoringASCIICase or
2715         startsWithLettersIgnoringASCIICase.
2716         (WebCore::addFileTypesToCache): Use ASCIICaseInsensitiveHash. ALso rewrote to
2717         tighten up the code a bit and use modern Objective-C for loops.
2718         (WebCore::mimeCommonTypesCache): Use ASCIICaseInsensitiveHash.
2719         (WebCore::mimeModernTypesCache): Ditto.
2720         (WebCore::concatenateHashSets): Ditto.
2721         (WebCore::MediaPlayerPrivateQTKit::getSupportedTypes): Ditto.
2722         (WebCore::MediaPlayerPrivateQTKit::disableUnsupportedTracks): Initialied
2723         track type set using lambda, but left it case sensitive.
2724
2725         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
2726         (WebCore::mimeTypeCache): Changed type of HashSet to use ASCIICaseInsensitiveHash.
2727         (WebCore::MediaPlayerPrivateMediaFoundation::getSupportedTypes): Ditto.
2728         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
2729
2730         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
2731         (WebCore::mimeTypeCache): Ditto.
2732         (WebCore::MockMediaPlayerMediaSource::getSupportedTypes): Ditto.
2733         * platform/mock/mediasource/MockMediaPlayerMediaSource.h: Ditto.
2734
2735 2016-01-31  Brent Fulgham  <bfulgham@apple.com>
2736
2737         Add "WebKit built-in PDF" Plugin to set of publicly visible plugins
2738         https://bugs.webkit.org/show_bug.cgi?id=153657
2739         <rdar://problem/24413107>
2740
2741         Reviewed by Darin Adler.
2742
2743         Tested by http/tests/plugins/visible_plugins.html.
2744
2745         A number of poorly-coded sites break when WebKit reports that it understands PDF mime types,
2746         but does not have a list of plugins that the site can iterate through.
2747
2748         To avoid this compatibility problem, we should also expose the "WebKit built-in PDF" plugin
2749         to avoid this edge case.
2750
2751         * plugins/PluginData.cpp:
2752         (WebCore::shouldBePubliclyVisible): Add "WebKit built-in PDF" plugin.
2753
2754 2016-01-31  Doug Russell  <d_russell@apple.com>
2755
2756         AX: Add a boundary value to AXTextStateChangeType
2757         https://bugs.webkit.org/show_bug.cgi?id=153085
2758
2759         Reviewed by Darin Adler.
2760
2761         Post an AT notification when navigation is attempted past
2762         an editable element's boundaries.
2763
2764         Test: accessibility/mac/selection-boundary-userinfo.html
2765
2766         * accessibility/AXObjectCache.cpp:
2767         (WebCore::AXObjectCache::showIntent):
2768         * accessibility/AXTextStateChangeIntent.h:
2769         * accessibility/mac/AXObjectCacheMac.mm:
2770         (platformChangeTypeForWebCoreChangeType):
2771         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
2772         * editing/FrameSelection.cpp:
2773         (WebCore::FrameSelection::modifyMovingRight):
2774         (WebCore::FrameSelection::modifyMovingForward):
2775         (WebCore::FrameSelection::modifyMovingLeft):
2776         (WebCore::FrameSelection::modifyMovingBackward):
2777         (WebCore::textSelectionWithDirectionAndGranularity):
2778         (WebCore::FrameSelection::modify):
2779         (WebCore::FrameSelection::modifyExtendingBackward): Deleted.
2780         (WebCore::FrameSelection::textSelectionIntent): Deleted.
2781         * editing/FrameSelection.h:
2782         * editing/VisiblePosition.cpp:
2783         (WebCore::VisiblePosition::next):
2784         (WebCore::VisiblePosition::previous):
2785         (WebCore::VisiblePosition::left):
2786         (WebCore::VisiblePosition::right):
2787         (WebCore::VisiblePosition::honorEditingBoundaryAtOrBefore):
2788         (WebCore::VisiblePosition::honorEditingBoundaryAtOrAfter):
2789         (WebCore::VisiblePosition::leftVisuallyDistinctCandidate): Deleted.
2790         (WebCore::VisiblePosition::rightVisuallyDistinctCandidate): Deleted.
2791         * editing/VisiblePosition.h:
2792         * editing/VisibleUnits.cpp:
2793         (WebCore::startOfLine):
2794         (WebCore::logicalStartOfLine):
2795         (WebCore::endOfLine):
2796         (WebCore::logicalEndOfLine):
2797         (WebCore::leftBoundaryOfLine):
2798         (WebCore::rightBoundaryOfLine):
2799         (WebCore::inSameLogicalLine): Deleted.
2800         (WebCore::endOfEditableContent): Deleted.
2801         (WebCore::isEndOfEditableOrNonEditableContent): Deleted.
2802         * editing/VisibleUnits.h:
2803
2804 2016-01-31  Daniel Bates  <dabates@apple.com>
2805
2806         CSP: Use the served CSP header for dedicated workers
2807         https://bugs.webkit.org/show_bug.cgi?id=153157
2808         <rdar://problem/24383254>
2809         And
2810         https://bugs.webkit.org/show_bug.cgi?id=153156
2811         <rdar://problem/24383246>
2812
2813         Reviewed by Brent Fulgham.
2814
2815         Inspired by Blink commit:
2816         <https://src.chromium.org/viewvc/blink?revision=194143&view=revision>
2817
2818         Implement support for respecting Content Security Policy (CSP) HTTP headers included in the
2819         HTTP response for a Web Worker's script as per section Workers of the CSP 2.0 spec,
2820         <https://w3c.github.io/webappsec-csp/2/#processing-model-workers> (29 August 2015).
2821
2822         Currently a Web Worker always inherits the CSP of its owner document. Instead a web worker
2823         will inherit the CSP of its owner document only if its script is incapable of defining a
2824         content security policy (i.e. its origin is a globally unique identifier). Otherwise, the
2825         CSP HTTP headers delivered with the script will be used to define the CSP for the worker.
2826
2827         Tests: fast/workers/worker-inherits-csp-blocks-eval.html
2828                fast/workers/worker-inherits-csp-blocks-xhr.html
2829                http/tests/security/contentSecurityPolicy/worker-blob-inherits-csp-blocks-eval.html
2830
2831         * CMakeLists.txt: Add file ContentSecurityPolicyResponseHeaders.cpp.
2832         * WebCore.vcxproj/WebCore.vcxproj: Add files ContentSecurityPolicyResponseHeaders.{cpp, h}.
2833         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
2834         * WebCore.xcodeproj/project.pbxproj: Ditto.
2835         * dom/Document.cpp:
2836         (WebCore::Document::processHttpEquiv): Update code to use enum class ContentSecurityPolicyHeaderType.
2837         * loader/FrameLoader.cpp:
2838         (WebCore::FrameLoader::didBeginDocument): Extract logic to collect Content Security Policy HTTP headers
2839         into class ContentSecurityPolicyResponseHeaders and make use of it here.
2840         * page/csp/ContentSecurityPolicy.cpp:
2841         (WebCore::CSPDirectiveList::headerType): Modified to use enum class ContentSecurityPolicyHeaderType.
2842         (WebCore::CSPDirectiveList::CSPDirectiveList): Ditto.
2843         (WebCore::CSPDirectiveList::create): Ditto.
2844         (WebCore::ContentSecurityPolicy::responseHeaders): Creates and returns a ContentSecurityPolicyResponseHeaders
2845         object with the parsed CSP policy headers.
2846         (WebCore::ContentSecurityPolicy::didReceiveHeaders): Processed the CSP policy headers represented by the
2847         specified ContentSecurityPolicyResponseHeaders object.
2848         (WebCore::ContentSecurityPolicy::deprecatedHeader): Deleted.
2849         (WebCore::ContentSecurityPolicy::deprecatedHeaderType): Deleted.
2850         * page/csp/ContentSecurityPolicy.h: Defines a class that represents a collection of CSP policy headers.
2851         This class has two purposes:
2852             - It extracts the CSP policy headers from a HTTP response (ResourceResponse object). We make use of
2853             this functionality in both FrameLoader::didBeginDocument() and Worker::didReceiveResponse().
2854             - It serves as a memento that externalizes the internal CSP policy details of an instance of
2855             ContentSecurityPolicy. We make use of this memento functionality to support inheriting the
2856             CSP policy of the worker's owner document in a thread-safe manner. You can create and restore
2857             a memento using ContentSecurityPolicy::responseHeaders() and ContentSecurityPolicy::didReceiveHeaders(), respectively.
2858         * page/csp/ContentSecurityPolicyResponseHeaders.cpp: Added.
2859         (WebCore::ContentSecurityPolicyResponseHeaders::ContentSecurityPolicyResponseHeaders): Extracts the
2860         CSP HTTP headers from a ResourceResponse object.
2861         (WebCore::ContentSecurityPolicyResponseHeaders::isolatedCopy): Make a copy of this object that is
2862         safe to pass to another thread.
2863         * page/csp/ContentSecurityPolicyResponseHeaders.h: Added.
2864         * workers/DedicatedWorkerGlobalScope.cpp:
2865         (WebCore::DedicatedWorkerGlobalScope::create): Modified to use class ContentSecurityPolicyResponseHeaders.
2866         * workers/DedicatedWorkerGlobalScope.h:
2867         * workers/DedicatedWorkerThread.cpp:
2868         (WebCore::DedicatedWorkerThread::create): Ditto.
2869         (WebCore::DedicatedWorkerThread::DedicatedWorkerThread): Ditto.
2870         (WebCore::DedicatedWorkerThread::createWorkerGlobalScope): Ditto.
2871         * workers/DedicatedWorkerThread.h:
2872         * workers/Worker.cpp:
2873         (WebCore::Worker::didReceiveResponse): Create a ContentSecurityPolicyResponseHeaders if the origin of
2874         the worker's script is capable of providing a CSP. Otherwise, we will inherit the CSP of the worker's owner
2875         document in Worker::notifyFinished().
2876         (WebCore::Worker::notifyFinished): Pass the appropriate CSP response headers to WorkerMessagingProxy::startWorkerGlobalScope().
2877         * workers/Worker.h:
2878         * workers/WorkerGlobalScope.cpp:
2879         (WebCore::WorkerGlobalScope::applyContentSecurityPolicyResponseHeaders): Renamed; formerly named applyContentSecurityPolicyFromString().
2880         Modified to take a ContentSecurityPolicyResponseHeaders and apply it to the ContentSecurityPolicy object associated with the worker.
2881         (WebCore::WorkerGlobalScope::applyContentSecurityPolicyFromString): Deleted.
2882         * workers/WorkerGlobalScope.h:
2883         * workers/WorkerMessagingProxy.cpp:
2884         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope): Pass the worker's ContentSecurityPolicyResponseHeaders object.
2885         * workers/WorkerThread.cpp:
2886         (WebCore::WorkerThreadStartupData::WorkerThreadStartupData): Added field m_contentSecurityPolicyResponseHeaders to store
2887         the CSP response headers to be applied to the worker's ContentSecurityPolicy object.
2888         (WebCore::WorkerThread::WorkerThread): Modified to use ContentSecurityPolicyResponseHeaders.
2889         (WebCore::WorkerThread::workerThread): Pass the ContentSecurityPolicyResponseHeaders object from the start up data struct
2890         to DedicatedWorkerThread::createWorkerGlobalScope().
2891         * workers/WorkerThread.h:
2892
2893 2016-01-31  Darin Adler  <darin@apple.com>
2894
2895         Get rid of most calls to String::upper; mostly replace them with convertToASCIIUppercase
2896         https://bugs.webkit.org/show_bug.cgi?id=153715
2897
2898         Reviewed by Gyuyoung Kim.
2899
2900         * editing/cocoa/HTMLConverter.mm:
2901         (HTMLConverter::computedAttributesForElement): Use convertToASCIILowercase to fold
2902         ASCII case when searching for fonts by name.
2903
2904         * platform/network/cf/ResourceResponseCFNet.cpp:
2905         (WebCore::ResourceResponse::platformLazyInit): Use convertToASCIIUppercase to make
2906         the HTTP version string canonical. Not sure why it's needed at all, but the letters
2907         we might be uppercasing are "HTTP", so no need to handle non-ASCII.
2908         * platform/network/cocoa/ResourceResponseCocoa.mm:
2909         (WebCore::ResourceResponse::platformLazyInit): Ditto.
2910
2911         * rendering/svg/SVGRenderTreeAsText.cpp:
2912         (WebCore::operator<<): Use convertToASCIIUppercase when writing the spread
2913         method type into a text stream. The method types are all ASCII.
2914
2915 2016-01-31  Dan Bernstein  <mitz@apple.com>
2916
2917         [Cocoa] Remove __has_include guards around use of WebKitAdditions
2918         https://bugs.webkit.org/show_bug.cgi?id=153728
2919
2920         Reviewed by Andy Estes.
2921
2922         Guard WebKitAdditions includes with #if USE(APPLE_INTERNAL_SDK) rather than with __has_include.
2923
2924         * dom/EventNames.h:
2925         * loader/EmptyClients.cpp:
2926         (WebCore::fillWithEmptyClients):
2927         * page/MainFrame.cpp:
2928         (WebCore::MainFrame::MainFrame):
2929         * page/MainFrame.h:
2930         * page/PageConfiguration.h:
2931         * platform/cocoa/WebKitAdditions.mm:
2932         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2933         * platform/ios/LegacyTileGridTile.mm:
2934
2935 2016-01-31  Darin Adler  <darin@apple.com>
2936
2937         Replace CaseFoldingHash with ASCIICaseInsensitiveHash
2938         https://bugs.webkit.org/show_bug.cgi?id=153639
2939
2940         Reviewed by Filip Pizlo.
2941
2942         * Modules/webdatabase/DatabaseAuthorizer.h: Use ASCIICaseInsensitiveHash
2943         for whitelisted functions. Function names are all ASCII.
2944
2945         * accessibility/AccessibilityObject.cpp: Use ASCIICaseInsensitiveHash
2946         for ARIA roles. ARIA roles are all ASCII.
2947
2948         * crypto/CryptoAlgorithmRegistry.h: Use ASCIICaseInsensitiveHash for
2949         crypto algorithm names. Algorithm names are all ASCII.
2950
2951         * css/CSSFontSelector.cpp:
2952         (WebCore::registerLocalFontFacesForFamily): Use ASCIICaseInsensitiveHash
2953         for font faces. Face names should use ASCII case insensitive matching;
2954         there is no need for non-ASCII case folding.
2955         * css/CSSFontSelector.h: Ditto.
2956
2957         * dom/DOMImplementation.cpp: Use ASCIICaseInsensitiveHash for the
2958         FeatureSet. The features are all ASCII.
2959
2960         * dom/Document.h: Use ASCIICaseInsensitiveHash for the access key
2961         map. Access keys are all ASCII.
2962
2963         * dom/ScriptElement.cpp:
2964         (WebCore::isLegacySupportedJavaScriptLanguage): Use ASCIICaseInsensitiveHash
2965         for the language set. These strings are all ASCII.
2966
2967         * editing/EditorCommand.cpp: Use ASCIICaseInsensitiveHash for editor
2968         command names. These names are all ASCII.
2969
2970         * html/HTMLObjectElement.cpp:
2971         (WebCore::HTMLObjectElement::parametersForPlugin): Use ASCIICaseInsensitiveHash
2972         for parameter names. These names are all ASCII.
2973
2974         * html/InputType.cpp: Use ASCIICaseInsensitiveHash for the input types.
2975         The input types are all ASCII.
2976
2977         * loader/CrossOriginAccessControl.h: Use ASCIICaseInsensitiveHash for
2978         HTTP header field names. These names are all ASCII.
2979         * loader/CrossOriginPreflightResultCache.h: Ditto.
2980
2981         * loader/archive/ArchiveFactory.cpp: Use ASCIICaseInsensitiveHash for
2982         MIME types. MIME types are all ASCII.
2983         * platform/MIMETypeRegistry.cpp:
2984         (WebCore::initializeSupportedImageMIMETypes): Ditto.
2985
2986         * platform/SchemeRegistry.h: Use ASCIICaseInsensitiveHas for URL schemes.
2987         URL schemes are all ASCII.
2988         * platform/URL.cpp: Ditto.
2989
2990         * platform/graphics/FontCache.cpp:
2991         (WebCore::FontPlatformDataCacheKey::operator==): Use ASCIICaseInsensitiveHash.
2992         (WebCore::FontPlatformDataCacheKeyHash::hash): Use ASCIICaseInsensitiveHash.
2993
2994         * platform/graphics/FontCascade.cpp:
2995         (WebCore::keysMatch): Rename from operator== since this operation is not
2996         equality. Changed to equalIgnoringASCIICase and did a little streamlining.
2997         (WebCore::makeFontCascadeCacheKey): Use reserveInitialCapacity for slightly
2998         better memory use.
2999         (WebCore::computeFontCascadeCacheHash): Use IntegerHasher to make computing
3000         a hash more efficient by eliminating the overhead of building a vector and
3001         even possible heap allocation and deallocation.
3002         (WebCore::retrieveOrAddCachedFonts): Use keysMatch instead of ==.
3003
3004         * platform/graphics/cocoa/FontCacheCoreText.cpp: Use ASCIICaseInsensitiveHash
3005         for font family names. These names should use ASCII case insensitive matching;
3006         there is no need for non-ASCII case folding.
3007
3008         * platform/network/HTTPHeaderMap.h: Use ASCIICaseInsensitiveHash for
3009         HTTP header field names. These names are all ASCII.
3010
3011         * rendering/style/RenderStyle.cpp:
3012         (WebCore::computeFontHash): Use IntegerHasher to avoid allocating memory just
3013         to compute a hash. Use ASCIICaseInsensitiveHash.
3014
3015 2016-01-31  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3016
3017         Reduce PassRefPtr uses in dom - 5
3018         https://bugs.webkit.org/show_bug.cgi?id=153470
3019
3020         Reviewed by Darin Adler.
3021
3022         As a step to remove PassRefPtr, this patch reduces uses of PassRefPtr in WebCore/dom. 
3023
3024         * dom/Document.cpp:
3025         (WebCore::Document::adoptNode):
3026         (WebCore::Document::implicitClose):
3027         (WebCore::Document::enqueuePopstateEvent):
3028         (WebCore::Document::setInputCursor):
3029         * dom/Document.h:
3030         * dom/DocumentMarker.cpp:
3031         (WebCore::DocumentMarkerTextMatch::instanceFor):
3032         * dom/Event.cpp:
3033         (WebCore::Event::setUnderlyingEvent):
3034         * dom/Event.h:
3035         * dom/EventDispatcher.h:
3036         * dom/GenericEventQueue.cpp:
3037         (WebCore::GenericEventQueue::enqueueEvent):
3038         * dom/GenericEventQueue.h:
3039         * dom/MouseEvent.cpp:
3040         (WebCore::SimulatedMouseEvent::SimulatedMouseEvent):
3041         * dom/Node.cpp:
3042         (WebCore::Node::dispatchDOMActivateEvent):
3043         * dom/NodeIterator.h:
3044         * dom/PendingScript.h:
3045         * dom/PopStateEvent.cpp:
3046         (WebCore::PopStateEvent::create):
3047         * dom/PopStateEvent.h:
3048         * dom/ProcessingInstruction.cpp:
3049         (WebCore::ProcessingInstruction::setCSSStyleSheet): Deleted. Nobody calls this function.
3050         * dom/ProcessingInstruction.h:
3051         * dom/RangeBoundaryPoint.h:
3052         (WebCore::RangeBoundaryPoint::RangeBoundaryPoint):
3053         * dom/TextEvent.cpp:
3054         (WebCore::TextEvent::createForFragmentPaste):
3055         (WebCore::TextEvent::TextEvent):
3056         * dom/TextEvent.h:
3057         * editing/Editor.cpp:
3058         (WebCore::Editor::pasteAsFragment):
3059         * editing/Editor.h:
3060         * editing/mac/EditorMac.mm:
3061         (WebCore::Editor::replaceNodeFromPasteboard):
3062
3063 2016-01-31  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3064
3065         Use std::make_unique<> when creating an unique_ptr object.
3066         https://bugs.webkit.org/show_bug.cgi?id=153705
3067
3068         Reviewed by Darin Adler.
3069
3070         Some factory functions have used std::unique_ptr<> for creating an unique_ptr object.
3071         It is wrong. We have to use std::make_unique<>.
3072
3073         * Modules/mediasession/WebMediaSessionManager.cpp:
3074         (WebCore::WebMediaSessionManager::mockPicker):
3075         * inspector/InspectorTimelineAgent.cpp:
3076         (WebCore::InspectorTimelineAgent::internalStart):
3077         * platform/cf/RunLoopObserver.cpp:
3078         (WebCore::RunLoopObserver::create): Deleted.
3079         * platform/cf/RunLoopObserver.h:
3080         (WebCore::RunLoopObserver::RunLoopObserver):
3081         * platform/graphics/avfoundation/WebMediaSessionManagerMac.cpp:
3082         (WebCore::WebMediaSessionManagerMac::platformPicker):
3083         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
3084         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
3085         (WebCore::MediaPlaybackTargetPickerMac::create): Deleted.
3086         * platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp:
3087         (WebCore::LayerFlushScheduler::LayerFlushScheduler):
3088         * platform/mock/MediaPlaybackTargetPickerMock.cpp:
3089         (WebCore::MediaPlaybackTargetPickerMock::create): Deleted.
3090         * platform/mock/MediaPlaybackTargetPickerMock.h:
3091         * rendering/FloatingObjects.cpp:
3092         (WebCore::FloatingObject::copyToNewContainer):
3093
3094 2016-01-30  Michael Catanzaro  <mcatanzaro@igalia.com>
3095
3096         Unreviewed, fix GTK debug build after r195899
3097
3098         * dom/EventContext.h:
3099         (isType):
3100
3101 2016-01-30  Jeremy Huddleston Sequoia  <jeremyhu@apple.com>
3102
3103         Add missing include to fix building debug configuration
3104         https://bugs.webkit.org/show_bug.cgi?id=153719
3105
3106         Reviewed by Darin Adler.
3107
3108         No new tests.
3109
3110         * rendering/RenderObject.cpp:
3111
3112 2016-01-30  Commit Queue  <commit-queue@webkit.org>
3113
3114         Unreviewed, rolling out r195911.
3115         https://bugs.webkit.org/show_bug.cgi?id=153723
3116
3117         Caused frequent assertion failures on bots (Requested by ap on
3118         #webkit).
3119
3120         Reverted changeset:
3121
3122         "Replace CaseFoldingHash with ASCIICaseInsensitiveHash"
3123         https://bugs.webkit.org/show_bug.cgi?id=153639
3124         http://trac.webkit.org/changeset/195911
3125
3126 2016-01-30  Commit Queue  <commit-queue@webkit.org>
3127
3128         Unreviewed, rolling out r195799 and r195828.
3129         https://bugs.webkit.org/show_bug.cgi?id=153722
3130
3131         Caused assertion failures, severely affecting EWS (Requested
3132         by ap on #webkit).
3133
3134         Reverted changesets:
3135
3136         "Web Inspector: InspectorTimelineAgent doesn't need to
3137         recompile functions because it now uses the sampling profiler"
3138         https://bugs.webkit.org/show_bug.cgi?id=153500
3139         http://trac.webkit.org/changeset/195799
3140
3141         "Attempt to fix the Windows build after r195799"
3142         http://trac.webkit.org/changeset/195828
3143
3144 2016-01-30  Brady Eidson  <beidson@apple.com>
3145
3146         Modern IDB: Some tests crash with specific odd database names.
3147         https://bugs.webkit.org/show_bug.cgi?id=153688
3148
3149         Reviewed by Darin Adler.
3150
3151         No new tests (2 existing tests now pass).
3152
3153         * platform/FileSystem.cpp:
3154         (WebCore::shouldEscapeUChar): Return true for some surrogate-pair situations.
3155         (WebCore::encodeForFileName): Pass along the previous and next characters, as well,
3156           and do a two byte escaping for some characters.
3157
3158 2016-01-30  Eric Carlson  <eric.carlson@apple.com>
3159
3160         More than one audio and/or text track sometimes selected in media controls menu
3161         https://bugs.webkit.org/show_bug.cgi?id=153664
3162
3163         Use an <img> element for the track menu item checkmark instead of a background image and
3164         the ::before selector.
3165
3166         Reviewed by Jer Noble.
3167
3168         Test: media/controls/track-menu.html
3169
3170         * Modules/mediacontrols/mediaControlsApple.css:
3171         (audio::-webkit-media-controls-closed-captions-container li:hover):
3172         (audio::-webkit-media-controls-closed-captions-container li .checkmark-container):
3173         (audio::-webkit-media-controls-closed-captions-container li.selected .checkmark-container):
3174         (audio::-webkit-media-controls-closed-captions-container li.selected:hover .checkmark-container):
3175         (audio::-webkit-media-controls-closed-captions-container li.selected::before): Deleted.
3176         (audio::-webkit-media-controls-closed-captions-container li.selected:hover::before): Deleted.
3177         * Modules/mediacontrols/mediaControlsApple.js:
3178         (Controller.prototype.buildCaptionMenu):
3179         (Controller.prototype.):
3180         (Controller.prototype.getCurrentControlsStatus):
3181
3182 2016-01-30  Darin Adler  <darin@apple.com>
3183
3184         Replace CaseFoldingHash with ASCIICaseInsensitiveHash
3185         https://bugs.webkit.org/show_bug.cgi?id=153639
3186
3187         Reviewed by Filip Pizlo.
3188
3189         * Modules/webdatabase/DatabaseAuthorizer.h: Use ASCIICaseInsensitiveHash
3190         for whitelisted functions. Function names are all ASCII.
3191
3192         * accessibility/AccessibilityObject.cpp: Use ASCIICaseInsensitiveHash
3193         for ARIA roles. ARIA roles are all ASCII.
3194
3195         * crypto/CryptoAlgorithmRegistry.h: Use ASCIICaseInsensitiveHash for
3196         crypto algorithm names. Algorithm names are all ASCII.
3197
3198         * css/CSSFontSelector.cpp:
3199         (WebCore::registerLocalFontFacesForFamily): Use ASCIICaseInsensitiveHash
3200         for font faces. Face names should use ASCII case insensitive matching;
3201         there is no need for non-ASCII case folding.
3202         * css/CSSFontSelector.h: Ditto.
3203
3204         * dom/DOMImplementation.cpp: Use ASCIICaseInsensitiveHash for the
3205         FeatureSet. The features are all ASCII.
3206
3207         * dom/Document.h: Use ASCIICaseInsensitiveHash for the access key
3208         map. Access keys are all ASCII.
3209
3210         * dom/ScriptElement.cpp:
3211         (WebCore::isLegacySupportedJavaScriptLanguage): Use ASCIICaseInsensitiveHash
3212         for the language set. These strings are all ASCII.
3213
3214         * editing/EditorCommand.cpp: Use ASCIICaseInsensitiveHash for editor
3215         command names. These names are all ASCII.
3216
3217         * html/HTMLObjectElement.cpp:
3218         (WebCore::HTMLObjectElement::parametersForPlugin): Use ASCIICaseInsensitiveHash
3219         for parameter names. These names are all ASCII.
3220
3221         * html/InputType.cpp: Use ASCIICaseInsensitiveHash for the input types.
3222         The input types are all ASCII.
3223
3224         * loader/CrossOriginAccessControl.h: Use ASCIICaseInsensitiveHash for
3225         HTTP header field names. These names are all ASCII.
3226         * loader/CrossOriginPreflightResultCache.h: Ditto.
3227
3228         * loader/archive/ArchiveFactory.cpp: Use ASCIICaseInsensitiveHash for
3229         MIME types. MIME types are all ASCII.
3230         * platform/MIMETypeRegistry.cpp:
3231         (WebCore::initializeSupportedImageMIMETypes): Ditto.
3232
3233         * platform/SchemeRegistry.h: Use ASCIICaseInsensitiveHas for URL schemes.
3234         URL schemes are all ASCII.
3235         * platform/URL.cpp: Ditto.
3236
3237         * platform/graphics/FontCache.cpp: Reworked FontPlatformDataCacheKey struct:
3238         Made it a conventional struct with non-prefixed data members names. Removed
3239         the "==" operator since it was appropriate for hash table lookup but wasn't
3240         a true equality operator. Tightened the implementations of the constructors.
3241         (WebCore::FontPlatformDataCacheKeyHash::hash): Use ASCIICaseInsensitiveHash.
3242         (WebCore::FontPlatformDataCacheKeyHash::equal): Do the equality check here,
3243         not using the == operator. And use equalIgnoringASCIICase.
3244         (WebCore::FontPlatformDataCacheKeyTraits::isEmptyValue): Added this entire
3245         traits struct so we check empty values in a more efficient way.
3246         (WebCore::FontCache::getCachedFontPlatformData): Added comments and tweaked
3247         style in this function.
3248
3249         * platform/graphics/FontCascade.cpp:
3250         (WebCore::keysMatch): Rename from operator== since this operation is not
3251         equality. Changed to equalIgnoringASCIICase and did a little streamlining.
3252         (WebCore::makeFontCascadeCacheKey): Use reserveInitialCapacity for slightly
3253         better memory use.
3254         (WebCore::computeFontCascadeCacheHash): Use IntegerHasher to make computing
3255         a hash more efficient by eliminating the overhead of building a vector and
3256         even possible heap allocation and deallocation.
3257         (WebCore::retrieveOrAddCachedFonts): Use keysMatch instead of ==.
3258
3259         * platform/graphics/cocoa/FontCacheCoreText.cpp: Use ASCIICaseInsensitiveHash
3260         for font family names. These names should use ASCII case insensitive matching;
3261         there is no need for non-ASCII case folding.
3262
3263         * platform/network/HTTPHeaderMap.h: Use ASCIICaseInsensitiveHash for
3264         HTTP header field names. These names are all ASCII.
3265
3266         * rendering/style/RenderStyle.cpp:
3267         (WebCore::computeFontHash): Use IntegerHasher to avoid allocating memory just
3268         to compute a hash. Use ASCIICaseInsensitiveHash.
3269
3270 2016-01-30  Chris Dumez  <cdumez@apple.com>
3271
3272         Unreviewed, rolling out r195871.
3273
3274         Caused several layout tests to time out
3275
3276         Reverted changeset:
3277
3278         "Tab suspension code shouldn't use page cache cacheability
3279         logic"
3280         https://bugs.webkit.org/show_bug.cgi?id=153680
3281         http://trac.webkit.org/changeset/195871
3282
3283 2016-01-30  Chris Dumez  <cdumez@apple.com>
3284
3285         Unreviewed, rebaseline bindings tests after r195904.
3286
3287         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
3288         (WebCore::JSTestCustomNamedGetter::getOwnPropertySlot):
3289         (WebCore::jsTestCustomNamedGetterConstructor):
3290         (WebCore::setJSTestCustomNamedGetterConstructor):
3291         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3292         (WebCore::JSTestEventTarget::getOwnPropertySlot):
3293         (WebCore::jsTestEventTargetConstructor):
3294         (WebCore::setJSTestEventTargetConstructor):
3295         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
3296         (WebCore::JSTestOverrideBuiltins::getOwnPropertySlot):
3297         (WebCore::jsTestOverrideBuiltinsConstructor):
3298         (WebCore::setJSTestOverrideBuiltinsConstructor):
3299
3300 2016-01-30  Chris Dumez  <cdumez@apple.com>
3301
3302         [JS Bindings] prototype.constructor should be writable
3303         https://bugs.webkit.org/show_bug.cgi?id=149412
3304         <rdar://problem/22545096>
3305
3306         Reviewed by Darin Adler.
3307
3308         prototype.constructor should have the following properties:
3309         { [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true }
3310
3311         as per the Web IDL specification:
3312         https://heycam.github.io/webidl/#interface-prototype-object
3313
3314         In WebKit, it is currently not writable. It is writable in Firefox.
3315
3316         This patch was first landed in r190085 but was rolled out for causing
3317         crashes: <rdar://problem/22825602>. The issue was that even though we
3318         marked constructor as writable, we failed to generate a setter for it.
3319         This patch addresses the issue and the crash in <rdar://problem/22825602>
3320         no longer occurs after this change. A regression test is also added for
3321         this crash.
3322
3323         Tests:
3324         fast/dom/HTMLDocument/constructor-setter-crash.html
3325         fast/dom/prototype-constructor-setter.html
3326
3327         * bindings/scripts/CodeGeneratorJS.pm:
3328         (GenerateAttributesHashTable):
3329         (GenerateImplementation):
3330         * bindings/scripts/IDLAttributes.txt:
3331         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3332         (WebCore::setJSTestActiveDOMObjectConstructor):
3333         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
3334         (WebCore::setJSTestClassWithJSBuiltinConstructorConstructor):
3335         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
3336         (WebCore::setJSTestCustomConstructorWithNoInterfaceObjectConstructor):
3337         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
3338         (WebCore::setJSTestCustomNamedGetterConstructor):
3339         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3340         (WebCore::setJSTestEventConstructorConstructor):
3341         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3342         (WebCore::setJSTestEventTargetConstructor):
3343         * bindings/scripts/test/JS/JSTestException.cpp:
3344         (WebCore::setJSTestExceptionConstructor):
3345         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3346         (WebCore::setJSTestGenerateIsReachableConstructor):
3347         * bindings/scripts/test/JS/JSTestInterface.cpp:
3348         (WebCore::setJSTestInterfaceConstructor):
3349         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
3350         (WebCore::setJSTestJSBuiltinConstructorConstructor):
3351         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3352         (WebCore::setJSTestMediaQueryListListenerConstructor):
3353         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3354         (WebCore::setJSTestNamedConstructorConstructor):
3355         * bindings/scripts/test/JS/JSTestNode.cpp:
3356         (WebCore::setJSTestNodeConstructor):
3357         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
3358         (WebCore::setJSTestNondeterministicConstructor):
3359         * bindings/scripts/test/JS/JSTestObj.cpp:
3360         (WebCore::setJSTestObjConstructor):
3361         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3362         (WebCore::setJSTestOverloadedConstructorsConstructor):
3363         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
3364         (WebCore::setJSTestOverrideBuiltinsConstructor):
3365         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3366         (WebCore::setJSTestSerializedScriptValueInterfaceConstructor):
3367         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3368         (WebCore::setJSTestTypedefsConstructor):
3369         * bindings/scripts/test/JS/JSattribute.cpp:
3370         (WebCore::setJSattributeConstructor):
3371         * bindings/scripts/test/JS/JSreadonly.cpp:
3372         (WebCore::setJSreadonlyConstructor):
3373         * page/DOMWindow.idl:
3374
3375 2016-01-30  Chris Dumez  <cdumez@apple.com>
3376
3377         Move more 'constructor' properties to the prototype
3378         https://bugs.webkit.org/show_bug.cgi?id=153667
3379
3380         Reviewed by Darin Adler.
3381
3382         Move more 'constructor' properties to the prototype. In particular, we
3383         used to keep the 'constructor' on the instance for interfaces that have
3384         an indexed / named property getter because our getOwnPropertySlot()
3385         implementation used to be wrong for such interfaces.
3386
3387         However, getOwnPropertySlot() should be correct after r188590 so we
3388         should now be able to move the 'constructor' up to the prototype for
3389         these interfaces, as per the specification:
3390         http://heycam.github.io/webidl/#interface-prototype-object
3391
3392         No new tests, already covered by existing tests.
3393
3394         * bindings/js/JSPluginElementFunctions.h:
3395         (WebCore::pluginElementCustomGetOwnPropertySlot):
3396         Add a null check for staticPropHashTable. It is now null because this
3397         type no longer has any property on the instance now that 'constructor'
3398         is on the prototype.
3399
3400         * bindings/scripts/CodeGeneratorJS.pm:
3401         (ConstructorShouldBeOnInstance):
3402
3403 2016-01-29  Ada Chan  <adachan@apple.com>
3404
3405         Enable VIDEO_PRESENTATION_MODE only in Debug and Release builds on Mac
3406         https://bugs.webkit.org/show_bug.cgi?id=153665
3407
3408         Reviewed by Dan Bernstein.
3409
3410         * Configurations/FeatureDefines.xcconfig:
3411
3412 2016-01-30  David Kilzer  <ddkilzer@apple.com>
3413
3414         [iOS] WebKit1 apps crash in ___ZN7WebCore16DiskCacheMonitorC2ERKNS_15ResourceRequestENS_9SessionIDEPK20_CFCachedURLResponse_block_invoke1
3415         <http://webkit.org/b/153710>
3416         <rdar://problem/23116706>
3417
3418         Reviewed by Darin Adler.
3419
3420         * loader/cocoa/DiskCacheMonitorCocoa.mm:
3421         (WebCore::DiskCacheMonitor::DiskCacheMonitor):
3422         - Fix race condition on iOS WebKit1 clients by calling the block
3423           to cancel the DiskCacheMonitor on the WebThread, which is the
3424           same thread where the CFCachedURLResponseCallBackBlock is
3425           called.
3426         - Removed whitespace to adhere to style.
3427
3428 2016-01-30  Ryosuke Niwa  <rniwa@webkit.org>
3429
3430         TouchList should be retargeted
3431         https://bugs.webkit.org/show_bug.cgi?id=149592
3432
3433         Reviewed by Antti Koivisto.
3434
3435         Retarget touch target's using the same algorithm as the one used for related targets instead of
3436         EventRelatedNodeResolver which is removed in this patch.
3437
3438         Also enable the retargeting on iOS.
3439
3440         Test: fast/shadow-dom/touch-event-ios.html
3441
3442         * dom/EventContext.cpp:
3443         (WebCore::TouchEventContext::TouchEventContext):
3444         (WebCore::TouchEventContext::handleLocalEvents):
3445         (WebCore::TouchEventContext::checkReachability):
3446         * dom/EventContext.h:
3447         (WebCore::toTouchEventContext):
3448         (WebCore::EventContext::isUnreachableNode):
3449         * dom/EventDispatcher.cpp:
3450         (WebCore::EventRelatedNodeResolver): Deleted.
3451         (WebCore::EventPath::EventPath):
3452         (WebCore::EventDispatcher::dispatchEvent): 
3453         (WebCore::addRelatedNodeResolversForTouchList): Deleted.
3454         (WebCore::EventPath::updateTouchLists): Deleted.
3455         (WebCore::EventPath::setRelatedTarget): Removed superfluous UNUSED_PARAM since the argument is always used.
3456         (WebCore::EventPath::retargetTouch): Extracted from updateTouchLists/setRelatedTarget. Clones Touch object
3457         with the new target for each event context just like related targets.
3458         (WebCore::EventPath::retargetTouchLists): Renamed from updateTouchLists. Calls retargetTouch on each Touch
3459         object in each TouchList.
3460         * dom/TouchEvent.h:
3461
3462 2016-01-30 Dave Hyatt  <hyatt@apple.com>
3463
3464         Support break-after, break-before and break-inside.
3465         https://bugs.webkit.org/show_bug.cgi?id=148814
3466
3467         Reviewed by Dean Jackson.
3468
3469         New tests added in printing/, fast/multicol/, and fast/regions.
3470
3471         * css/CSSComputedStyleDeclaration.cpp:
3472         (WebCore::convertToPageBreak):
3473         (WebCore::convertToColumnBreak):
3474         (WebCore::convertToRegionBreak):
3475         For backwards compatibility, keep support for all the old properties in
3476         computed style. This means we have to convert the break-* property values
3477         into keywords that make sense for the legacy properties. This mainly
3478         involves mapping "page", "column", "region" to "always" (similar rule for
3479         the avoid-* versions as well).
3480
3481         (WebCore::ComputedStyleExtractor::propertyValue):
3482         Add support for the three new break-* properties.
3483
3484         * css/CSSParser.cpp:
3485         (WebCore::isValidKeywordPropertyAndValue):
3486         (WebCore::isKeywordPropertyID):
3487         (WebCore::CSSParser::parseValue):
3488         Add support for the new break properties.
3489
3490         * css/CSSPrimitiveValueMappings.h:
3491         (WebCore::CSSPrimitiveValue::operator BreakBetween):
3492         (WebCore::CSSPrimitiveValue::operator BreakInside):
3493         Add converters for the new BreakBetween and BreakInside enums. Remove
3494         the EPageBreak enum, since it is no longer used.
3495
3496         * css/CSSPropertyNames.in:
3497         * css/CSSValueKeywords.in:
3498         Add the new properties and the new values supported by the properties
3499         to the keywords lists.
3500
3501         * css/StyleBuilderConverter.h:
3502         (WebCore::StyleBuilderConverter::convertFontSynthesis):
3503         (WebCore::StyleBuilderConverter::convertPageBreakBetween):
3504         (WebCore::StyleBuilderConverter::convertPageBreakInside):
3505         (WebCore::StyleBuilderConverter::convertColumnBreakBetween):
3506         (WebCore::StyleBuilderConverter::convertColumnBreakInside):
3507         (WebCore::StyleBuilderConverter::convertRegionBreakBetween):
3508         (WebCore::StyleBuilderConverter::convertRegionBreakInside):
3509         In order to map the legacy properties into the new break-* values
3510         we have custom converter functions.
3511
3512         * rendering/RenderBlock.cpp:
3513         (WebCore::RenderBlock::paintChild):
3514         (WebCore::RenderBlock::childBoxIsUnsplittableForFragmentation):
3515         (WebCore::RenderBlock::computeRegionRangeForBoxChild):
3516         * rendering/RenderBlockFlow.cpp:
3517         (WebCore::RenderBlockFlow::applyBeforeBreak):
3518         (WebCore::RenderBlockFlow::applyAfterBreak):
3519         Patch the block code to check the correct new break-* constants. For
3520         avoidance, this means checking both the general avoid value and the
3521         specific value (e.g., avoid-page). In place of "always", we check
3522         the specific value (e.g., column) and then for page specifically, we
3523         also treat "left", "right", "recto" and "verso" as "always break" for now.
3524
3525         * rendering/style/RenderStyle.cpp:
3526         (WebCore::RenderStyle::changeRequiresLayout):
3527         Make sure changes to the break properties trigger relayout.
3528
3529         * rendering/style/RenderStyle.h:
3530         Add getters and setters for the break-* properties and remove all
3531         occurrences of the legacy page, column and region values from the RenderStyle.
3532
3533         * rendering/style/RenderStyleConstants.cpp:
3534         (WebCore::alwaysPageBreak):
3535         We have a helper function here for mapping several constant values to "page".
3536
3537         * rendering/style/RenderStyleConstants.h:
3538         Definitions of the new BreakBetween and BreakInside enums.
3539
3540         * rendering/style/StyleMultiColData.cpp:
3541         (WebCore::StyleMultiColData::StyleMultiColData):
3542         (WebCore::StyleMultiColData::operator==):
3543         * rendering/style/StyleMultiColData.h:
3544         Remove the column-specific break data.
3545
3546         * rendering/style/StyleRareNonInheritedData.cpp:
3547         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
3548         (WebCore::StyleRareNonInheritedData::operator==):
3549         * rendering/style/StyleRareNonInheritedData.h:
3550         Remove the region-specific break data and replace it with generic break
3551         data that is now used by all three pagination models.
3552
3553 2016-01-29  Per Arne Vollan  <peavo@outlook.com>
3554
3555         [Win] Fix compile error.
3556         https://bugs.webkit.org/show_bug.cgi?id=153646
3557
3558         Reviewed by Darin Adler.
3559
3560         * platform/text/win/LocaleWin.cpp:
3561         (WebCore::LCIDFromLocaleInternal):
3562
3563 2016-01-29  Antti Koivisto  <antti@apple.com>
3564
3565         Tab suspension code shouldn't use page cache cacheability logic
3566         https://bugs.webkit.org/show_bug.cgi?id=153680
3567
3568         Reviewed by Andreas Kling.
3569
3570         Most of PageCache::canCache() is unnecessary for tab suspension.
3571
3572         Also improve robustness.
3573
3574         * page/Page.cpp:
3575         (WebCore::Page::setPageActivityState):
3576         (WebCore::Page::setIsVisible):
3577         (WebCore::Page::setIsVisibleInternal):
3578         (WebCore::Page::setIsPrerender):
3579         (WebCore::Page::canTabSuspend):
3580
3581             Include visibility test here.
3582
3583             Instead of calling PageCache::canCache() just check for each frame that
3584             - that the document is loaded
3585             - that active DOM objects allow suspension
3586
3587         (WebCore::Page::setIsTabSuspended):
3588         (WebCore::Page::setTabSuspensionEnabled):
3589         (WebCore::Page::updateTabSuspensionState):
3590
3591             Refactor for robustness.
3592
3593         (WebCore::Page::tabSuspensionTimerFired):
3594
3595             Call canTabSuspend, the result might have changed.
3596
3597         (WebCore::Page::scheduleTabSuspension): Deleted.
3598         * page/Page.h:
3599
3600 2016-01-29  Ryosuke Niwa  <rniwa@webkit.org>
3601
3602         fast/shadow-dom/Element-interface-attachShadow.html fails on iOS
3603         https://bugs.webkit.org/show_bug.cgi?id=153681
3604
3605         Reviewed by Antti Koivisto.
3606
3607         The bug was caused by canHaveUserAgentShadowRoot() returning false on a meter element since it's disabled on iOS.
3608         Override HTMLUnknownElement's canHaveUserAgentShadowRoot to return false for compatbility on iOS.
3609
3610         * html/HTMLUnknownElement.h:
3611         (WebCore::HTMLUnknownElement::canHaveUserAgentShadowRoot):
3612
3613 2016-01-29  Brady Eidson  <beidson@apple.com>
3614
3615         Modern IDB: Getting records for key ranges with null keys aren't properly handled in SQLite backend
3616         https://bugs.webkit.org/show_bug.cgi?id=153666
3617
3618         Reviewed by Tim Horton.
3619
3620         No new tests (Two failing tests now pass).
3621
3622         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3623         (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
3624
3625 2016-01-29  Simon Fraser  <simon.fraser@apple.com>
3626
3627         image-rendering: -webkit-optimize-contrast not working for background images
3628         https://bugs.webkit.org/show_bug.cgi?id=97991
3629
3630         Reviewed by Darin Adler.
3631         
3632         Don't equate "pixelated" and "crisp-edges" values for image-rendering with low
3633         quality scaling; they should map to InterpolationNone, not InterpolationLow.
3634         
3635         To support this change ImageQualityController to return a InterpolationQuality
3636         from the renamed chooseInterpolationQuality(). If the returned value is not
3637         InterpolationDefault, set the GraphicsContext image interpolation when drawing
3638         images and image buffers.
3639         
3640         Remove the redundant "useLowQualityScale" from 
3641
3642         Test: fast/images/image-rendering-interpolation.html
3643
3644         * html/HTMLCanvasElement.cpp:
3645         (WebCore::HTMLCanvasElement::paint):
3646         * html/HTMLCanvasElement.h:
3647         * page/DragController.cpp:
3648         (WebCore::DragController::doImageDrag):
3649         * platform/graphics/GraphicsContext.cpp:
3650         (WebCore::GraphicsContext::drawImage):
3651         (WebCore::GraphicsContext::drawTiledImage):
3652         (WebCore::GraphicsContext::drawImageBuffer):
3653         (WebCore::GraphicsContext::drawConsumingImageBuffer):
3654         (WebCore::InterpolationQualityMaintainer::InterpolationQualityMaintainer): Deleted.
3655         (WebCore::InterpolationQualityMaintainer::~InterpolationQualityMaintainer): Deleted.
3656         * platform/graphics/GraphicsContext.h:
3657         (WebCore::ImagePaintingOptions::ImagePaintingOptions):
3658         (WebCore::ImagePaintingOptions::usesDefaultInterpolation):
3659         (WebCore::InterpolationQualityMaintainer::InterpolationQualityMaintainer):
3660         (WebCore::InterpolationQualityMaintainer::~InterpolationQualityMaintainer):
3661         * platform/graphics/GraphicsTypes.h:
3662         * platform/graphics/ImageBuffer.h:
3663         * platform/graphics/cg/ImageBufferCG.cpp:
3664         (WebCore::ImageBuffer::drawConsuming):
3665         (WebCore::ImageBuffer::draw):
3666         * rendering/ImageQualityController.cpp:
3667         (WebCore::ImageQualityController::interpolationQualityFromStyle):
3668         (WebCore::ImageQualityController::chooseInterpolationQuality):
3669         (WebCore::ImageQualityController::ImageQualityController): Deleted.
3670         (WebCore::ImageQualityController::shouldPaintAtLowQuality): Deleted.
3671         * rendering/ImageQualityController.h:
3672         * rendering/RenderBoxModelObject.cpp:
3673         (WebCore::RenderBoxModelObject::chooseInterpolationQuality):
3674         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
3675         (WebCore::RenderBoxModelObject::shouldPaintAtLowQuality): Deleted.
3676         * rendering/RenderBoxModelObject.h:
3677         * rendering/RenderEmbeddedObject.cpp:
3678         (WebCore::RenderEmbeddedObject::paintSnapshotImage):
3679         * rendering/RenderHTMLCanvas.cpp:
3680         (WebCore::RenderHTMLCanvas::paintReplaced):
3681         * rendering/RenderImage.cpp:
3682         (WebCore::RenderImage::paintIntoRect):
3683         * rendering/RenderSnapshottedPlugIn.cpp:
3684         (WebCore::RenderSnapshottedPlugIn::paintSnapshot):
3685         * rendering/style/RenderStyle.h:
3686
3687 2016-01-29  Brady Eidson  <beidson@apple.com>
3688
3689         Modern IDB: storage/indexeddb/modern/index-3.html fails.
3690         https://bugs.webkit.org/show_bug.cgi?id=153661
3691
3692         Reviewed by Tim Horton.
3693
3694         No new tests (1 failing test now passes, others get closer).
3695
3696         When indexing a new record fails due to uniqueness constraints, remove all traces of the record.
3697
3698         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3699         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
3700         (WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
3701         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
3702
3703 2016-01-29  Brent Fulgham  <bfulgham@apple.com>
3704
3705         [WebGL] Check vertex array bounds before permitting a glDrawArrays to execute
3706         https://bugs.webkit.org/show_bug.cgi?id=153643
3707         <rdar://problem/23424456>
3708
3709         Reviewed by Dean Jackson.
3710
3711         Tested by fast/canvas/webgl/webgl-drawarrays-crash.html.
3712
3713         * html/canvas/WebGLRenderingContextBase.cpp:
3714         (WebCore::WebGLRenderingContextBase::validateDrawArrays): Make sure that we have at
3715         least one buffer bound to a program if a drawArray call with a non-zero range of
3716         requested data is being made.
3717         (WebCore::WebGLRenderingContextBase::validateDrawElements): Drive-by formatting fix.
3718
3719 2016-01-29  Brady Eidson  <beidson@apple.com>
3720
3721         Modern IDB: Fix logging that overwhelms python with strings of excessive length.
3722         https://bugs.webkit.org/show_bug.cgi?id=153652
3723
3724         Reviewed by Tim Horton.
3725
3726         No new tests (Two skipped tests now pass).
3727
3728         * Modules/indexeddb/IDBKeyData.cpp:
3729         (WebCore::IDBKeyData::loggingString): Limit the length of the string.
3730         
3731         * Modules/indexeddb/IDBKeyRangeData.cpp:
3732         (WebCore::IDBKeyRangeData::loggingString): Limit the length of the string.
3733
3734 2016-01-29  Jer Noble  <jer.noble@apple.com>
3735
3736         Unreviewed Windows build fix; one more ResourceLoaderOptions call site which needs to
3737         be updated after adding the CachingPolicy parameter.
3738
3739         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
3740         (WebCore::WebCoreAVCFResourceLoader::startLoading):
3741
3742 2016-01-29  Carlos Garcia Campos  <cgarcia@igalia.com>
3743
3744         [GTK] Implement overlay scrollbars
3745         https://bugs.webkit.org/show_bug.cgi?id=153405
3746
3747         Reviewed by Michael Catanzaro.
3748
3749         Add support for overlay scrollbars to GTK+ platform following the
3750         same style and behavior than GtkScrolledWindow. They are only
3751         available for GTK+ >= 3.19, but honoring the GTK_OVERLAY_SCROLLING
3752         environment variable, so they could be disable at run time, except
3753         when threaded compositor is enabled. A new ScrollAnimator class
3754         has been added for GTK+ to implement overlay scrollbars and still
3755         allow smooth scrolling when available.
3756
3757         * PlatformGTK.cmake: Add ScrollAnimatorGtk and stop building ScrollAnimatorSmooth.
3758         * platform/ScrollAnimator.h:
3759         (WebCore::ScrollAnimator::ScrollAnimator::mouseEnteredContentArea):
3760         Remove const to allow the ScrollAnimator to be updated.
3761         (WebCore::ScrollAnimator::ScrollAnimator::mouseExitedContentArea): Ditto.
3762         (WebCore::ScrollAnimator::ScrollAnimator::mouseMovedInContentArea): Ditto.
3763         (WebCore::ScrollAnimator::ScrollAnimator::contentAreaDidShow): Ditto.
3764         (WebCore::ScrollAnimator::ScrollAnimator::contentAreaDidHide): Ditto.
3765         * platform/Scrollbar.h:
3766         (WebCore::Scrollbar::opacity): Get scrollbar opacity.
3767         (WebCore::Scrollbar::setOpacity): Set scrollbar opacity.
3768         * platform/gtk/ScrollAnimatorGtk.cpp: Added.
3769         (WebCore::ScrollAnimator::create): Create a ScrollAnimatorGtk.
3770         (WebCore::ScrollAnimatorGtk::ScrollAnimatorGtk):
3771         (WebCore::ScrollAnimatorGtk::~ScrollAnimatorGtk):
3772         (WebCore::ScrollAnimatorGtk::ensureSmoothScrollingAnimation):
3773         Initialize the ScrollAnimationSmooth if it doesn't exist.
3774         (WebCore::ScrollAnimatorGtk::scroll): Ensure we have a
3775         ScrollAnimationSmooth if smooth scrolling is enabled. This also
3776         fixes the problem of having to reload the page after changing the
3777         smooth scrolling setting.
3778         (WebCore::ScrollAnimatorGtk::scrollToOffsetWithoutAnimation):
3779         (WebCore::ScrollAnimatorGtk::willEndLiveResize):
3780         (WebCore::ScrollAnimatorGtk::didAddVerticalScrollbar): Register
3781         the scrollbar if it's an overlay scrollbar and make it visible
3782         without animating it. Start the hide animation.
3783         (WebCore::ScrollAnimatorGtk::didAddHorizontalScrollbar): Ditto.
3784         (WebCore::ScrollAnimatorGtk::willRemoveVerticalScrollbar):
3785         Unregister the scrollbar if it was registered and resrt the
3786         animation state if it was the only scrollbar.
3787         (WebCore::ScrollAnimatorGtk::willRemoveHorizontalScrollbar): Ditto.
3788         (WebCore::ScrollAnimatorGtk::updateOverlayScrollbarsOpacity): Update
3789         the scrollbars opacity and invalidate the indicator.
3790         (WebCore::easeOutCubic):
3791         (WebCore::ScrollAnimatorGtk::overlayScrollbarAnimationTimerFired):
3792         Update the scrollbars opacity and schedule a next frame if the
3793         animation didn't finish or start the hide animation otherwhise.
3794         (WebCore::ScrollAnimatorGtk::showOverlayScrollbars): Start the
3795         fade animation to show the scrollbars if needed.
3796         (WebCore::ScrollAnimatorGtk::hideOverlayScrollbars): Start the
3797         dafe animation to hide the scrollbars if needed.
3798         (WebCore::ScrollAnimatorGtk::mouseEnteredContentArea): Call
3799         showOverlayScrollbars().
3800         (WebCore::ScrollAnimatorGtk::mouseExitedContentArea): Call
3801         hideOverlayScrollbars().
3802         (WebCore::ScrollAnimatorGtk::mouseMovedInContentArea): Call
3803         showOverlayScrollbars().
3804         (WebCore::ScrollAnimatorGtk::contentAreaDidShow): Ditto.
3805         (WebCore::ScrollAnimatorGtk::contentAreaDidHide): Hide the
3806         scrollbars without animations.
3807         (WebCore::ScrollAnimatorGtk::notifyContentAreaScrolled): Call
3808         showOverlayScrollbars().
3809         (WebCore::ScrollAnimatorGtk::lockOverlayScrollbarStateToHidden):
3810         Update the lock state and hide or show the scrollbars when locked
3811         or unlocked.
3812         * platform/gtk/ScrollAnimatorGtk.h: Added.
3813         * platform/gtk/ScrollbarThemeGtk.cpp:
3814         (WebCore::ScrollbarThemeGtk::backButtonRect): Pass
3815         StyleContextMode to getOrCreateStyleContext depending on the
3816         painting parameter.
3817         (WebCore::ScrollbarThemeGtk::forwardButtonRect): Ditto.
3818         (WebCore::ScrollbarThemeGtk::trackRect): Ditto.
3819         (WebCore::ScrollbarThemeGtk::getOrCreateStyleContext): Add
3820         StyleContextMode parameter to add the hovering class
3821         unconditionally when using overlay scrollbars in layout mode. In
3822         paint mode we add the hovering clas only when the scrollbar is
3823         hovered. This way we always claim the size of the scrollbar when
3824         hovered to be able to show the full scrollbar when the mouse is
3825         close enough to the indicator.
3826         (WebCore::ScrollbarThemeGtk::ScrollbarThemeGtk): Initialize
3827         m_usesOverlayScrollbars.
3828         (WebCore::ScrollbarThemeGtk::thumbRect): Pass the scrollbar to
3829         getOrCreateStyleContext().
3830         (WebCore::adjustRectAccordingToMargin): Fix the top margin.
3831         (WebCore::ScrollbarThemeGtk::paintTrackBackground): Pass the
3832         scrollbar and paint mode to getOrCreateStyleContext().
3833         (WebCore::ScrollbarThemeGtk::paintScrollbarBackground): Ditto.
3834         (WebCore::ScrollbarThemeGtk::paintThumb): Adjust the thumb
3835         rectangle when overlay scrollbar is not hovered to its current
3836         size, since we always claim the size of the scrollbar in hovered
3837         mode.
3838         (WebCore::ScrollbarThemeGtk::paintButton): Pass the scrollbar and
3839         paint mode to getOrCreateStyleContext().
3840         (WebCore::ScrollbarThemeGtk::paint): Take the scrollbar opacity
3841         into account when rendering overlay scrollbars as indicators. Also
3842         get the scrollbar opacity from the GTK+ theme and use a
3843         transparency group when the global opacity is not full opaque.
3844         (WebCore::ScrollbarThemeGtk::buttonSize): Pass the scrollbar to
3845         getOrCreateStyleContext().
3846         * platform/gtk/ScrollbarThemeGtk.h:
3847         * platform/mac/ScrollAnimatorMac.h:
3848         * platform/mac/ScrollAnimatorMac.mm:
3849         (WebCore::ScrollAnimatorMac::mouseEnteredContentArea):
3850         (WebCore::ScrollAnimatorMac::mouseExitedContentArea):
3851         (WebCore::ScrollAnimatorMac::mouseMovedInContentArea):
3852         (WebCore::ScrollAnimatorMac::contentAreaDidShow):
3853         (WebCore::ScrollAnimatorMac::contentAreaDidHide):
3854
3855 2016-01-29  ChangSeok Oh  <changseok.oh@collabora.com>
3856
3857         [GStreamer] built-in media player doesn't update
3858         https://bugs.webkit.org/show_bug.cgi?id=151816
3859
3860         Reviewed by Xabier Rodriguez-Calvar.
3861
3862         The timeline of audio controls in media document is not properly updated since it is assumed
3863         that the controls are hidden as soon as playing. However, such full page audio always has
3864         opacity : 1 declared by video:-webkit-full-page-media::-webkit-media-controls-panel.no-video.
3865         i.e. it is not actually hidden. We can fix this by simply returning false for no-video media
3866         in controlsAreHidden();
3867
3868         Test: media/audio-controls-timeline-in-media-document.html
3869
3870         * Modules/mediacontrols/mediaControlsBase.js:
3871         (Controller.prototype.controlsAreAlwaysVisible):
3872         (Controller.prototype.controlsAreHidden):
3873
3874 2016-01-29  Manuel Rego Casasnovas  <rego@igalia.com>
3875
3876         [css-grid] Store lines instead of tracks in GridResolvedPosition
3877         https://bugs.webkit.org/show_bug.cgi?id=153592
3878
3879         Reviewed by Sergio Villar Senin.
3880
3881         Due to the new feature that allows to create implicit tracks before the
3882         explicit ones, we will need to use lines instead of tracks in the
3883         code to be able to implement it properly.
3884
3885         This is just a first simple patch using lines instead of tracks in
3886         GridResolvedPosition. It modifies the code that was using it, as it was
3887         considering that the resolvedFinalPosition was a track index and
3888         not a line index.
3889
3890         So if we've an item positioned like:
3891           grid-column: 2 / 5;
3892           grid-row: 1 / span 2;
3893
3894         Before we were storing this information on the GridSpan:
3895         * columns:
3896           * resolvedInitialPosition: 1
3897           * resolvedFinalPosition:  3
3898         * rows:
3899           * resolvedInitialPosition: 0
3900           * resolvedFinalPosition:  1
3901
3902         And now we're storing:
3903         * columns:
3904           * resolvedInitialPosition: 1
3905           * resolvedFinalPosition:  4
3906         * rows:
3907           * resolvedInitialPosition: 0
3908           * resolvedFinalPosition:  2
3909
3910         No new tests, no change of behavior.
3911
3912         * css/CSSGridTemplateAreasValue.cpp:
3913         (WebCore::stringForPosition):
3914         * css/CSSParser.cpp:
3915         (WebCore::CSSParser::parseGridTemplateAreasRow):
3916         * css/StyleBuilderConverter.h:
3917         (WebCore::StyleBuilderConverter::createImplicitNamedGridLinesFromGridArea):
3918         * rendering/RenderGrid.cpp:
3919         (WebCore::RenderGrid::GridIterator::nextEmptyGridArea):
3920         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
3921         (WebCore::RenderGrid::ensureGridSize):
3922         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
3923         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
3924         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
3925         (WebCore::RenderGrid::gridAreaBreadthForChildIncludingAlignmentOffsets):
3926         (WebCore::RenderGrid::columnAxisOffsetForChild):
3927         (WebCore::RenderGrid::rowAxisOffsetForChild):
3928         * rendering/RenderGrid.h:
3929         * rendering/style/GridCoordinate.h:
3930         (WebCore::GridSpan::GridSpan):
3931         (WebCore::GridSpan::integerSpan):
3932         (WebCore::GridSpan::end):
3933         (WebCore::GridCoordinate::GridCoordinate):
3934         * rendering/style/GridResolvedPosition.cpp:
3935         (WebCore::resolveRowStartColumnStartNamedGridLinePositionAgainstOppositePosition):
3936         (WebCore::resolveRowEndColumnEndNamedGridLinePositionAgainstOppositePosition):
3937         (WebCore::resolveNamedGridLinePositionAgainstOppositePosition):
3938         (WebCore::resolveGridPositionAgainstOppositePosition):
3939         (WebCore::GridResolvedPosition::resolveGridPositionsFromAutoPlacementPosition):
3940         (WebCore::GridResolvedPosition::resolveGridPositionsFromStyle):
3941         (WebCore::resolveNamedGridLinePositionFromStyle): Deleted.
3942         * rendering/style/GridResolvedPosition.h:
3943
3944 2016-01-28  Brady Eidson  <beidson@apple.com>
3945
3946         Modern IDB: SQLite backend mismanages key generator values.
3947         https://bugs.webkit.org/show_bug.cgi?id=153625
3948
3949         Reviewed by Andy Estes.