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