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