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