7d6acf479019f819a5a917d4dc5bb109b95f05f7
[WebKit.git] / Source / WebCore / ChangeLog
1 2016-02-11  Zalan Bujtas  <zalan@apple.com>
2
3         Subpixel rendering: Make focusring painting subpixel aware.
4         https://bugs.webkit.org/show_bug.cgi?id=154111
5
6         Reviewed by David Hyatt.
7
8         Do not integral snap focusring rects while collecting them (use device pixel snapping instead
9         right before passing them to GraphicsContext::drawFocusRing).
10
11         Unable to test.
12
13         * platform/graphics/GraphicsContext.h:
14         * platform/graphics/displaylists/DisplayListItems.h:
15         (WebCore::DisplayList::DrawFocusRingRects::create):
16         (WebCore::DisplayList::DrawFocusRingRects::rects):
17         (WebCore::DisplayList::DrawFocusRingRects::DrawFocusRingRects):
18         * platform/graphics/displaylists/DisplayListRecorder.cpp:
19         (WebCore::DisplayList::Recorder::drawFocusRing):
20         * platform/graphics/displaylists/DisplayListRecorder.h:
21         * platform/graphics/mac/GraphicsContextMac.mm:
22         (WebCore::GraphicsContext::drawFocusRing):
23         * rendering/RenderBlock.cpp:
24         (WebCore::RenderBlock::addFocusRingRectsForInlineChildren):
25         (WebCore::RenderBlock::addFocusRingRects):
26         * rendering/RenderBlock.h:
27         * rendering/RenderBlockFlow.cpp:
28         (WebCore::RenderBlockFlow::addFocusRingRectsForInlineChildren):
29         * rendering/RenderBlockFlow.h:
30         * rendering/RenderBox.cpp:
31         (WebCore::RenderBox::addFocusRingRects):
32         * rendering/RenderBox.h:
33         * rendering/RenderElement.cpp:
34         (WebCore::RenderElement::paintFocusRing):
35         (WebCore::RenderElement::issueRepaintForOutlineAuto):
36         * rendering/RenderInline.cpp:
37         (WebCore::RenderInline::absoluteRects):
38         (WebCore::RenderInline::addFocusRingRects):
39         * rendering/RenderInline.h:
40         * rendering/RenderListBox.cpp:
41         (WebCore::RenderListBox::addFocusRingRects):
42         * rendering/RenderListBox.h:
43         * rendering/RenderObject.cpp:
44         (WebCore::RenderObject::addPDFURLRect):
45         (WebCore::RenderObject::absoluteFocusRingQuads):
46         * rendering/RenderObject.h:
47         (WebCore::RenderObject::addFocusRingRects):
48         * rendering/RenderTextControl.cpp:
49         (WebCore::RenderTextControl::addFocusRingRects):
50         * rendering/RenderTextControl.h:
51         * rendering/svg/RenderSVGContainer.cpp:
52         (WebCore::RenderSVGContainer::addFocusRingRects):
53         * rendering/svg/RenderSVGContainer.h:
54         * rendering/svg/RenderSVGImage.cpp:
55         (WebCore::RenderSVGImage::addFocusRingRects):
56         * rendering/svg/RenderSVGImage.h:
57         * rendering/svg/RenderSVGShape.cpp:
58         (WebCore::RenderSVGShape::addFocusRingRects):
59         * rendering/svg/RenderSVGShape.h:
60
61 2016-02-11  Myles C. Maxfield  <mmaxfield@apple.com>
62
63         Addressing post-review comments after r196393
64
65         Unreviewed.
66
67         * css/CSSFontSelector.cpp:
68         (WebCore::CSSFontSelector::getFontFace):
69         * css/CSSSegmentedFontFace.h:
70
71 2016-02-11  Antti Koivisto  <antti@apple.com>
72
73         Rename Element::style() to Element::cssomStyle()
74         https://bugs.webkit.org/show_bug.cgi?id=154107
75
76         Reviewed by Alex Christensen.
77
78         It implements the IDL "style" attribute that returns a CSSOM object.
79         Inside WebCore "style" generally refers to a RenderStyle.
80
81         * dom/Element.cpp:
82         (WebCore::Element::hasAttributeNS):
83         (WebCore::Element::cssomStyle):
84         (WebCore::Element::focus):
85         (WebCore::Element::style): Deleted.
86         * dom/Element.h:
87         (WebCore::Element::tagQName):
88         * dom/Element.idl:
89         * dom/StyledElement.cpp:
90         (WebCore::StyledElement::~StyledElement):
91         (WebCore::StyledElement::cssomStyle):
92         (WebCore::StyledElement::style): Deleted.
93         * dom/StyledElement.h:
94         (WebCore::StyledElement::synchronizeStyleAttributeInternal):
95         (WebCore::StyledElement::collectStyleForPresentationAttribute):
96         * editing/Editor.cpp:
97         (WebCore::Editor::applyEditingStyleToElement):
98         * inspector/InspectorCSSAgent.cpp:
99         (WebCore::InspectorCSSAgent::getMatchedStylesForNode):
100         (WebCore::InspectorCSSAgent::getInlineStylesForNode):
101         (WebCore::InspectorCSSAgent::asInspectorStyleSheet):
102         * inspector/InspectorStyleSheet.cpp:
103         (WebCore::InspectorStyleSheetForInlineStyle::didModifyElementAttribute):
104         (WebCore::InspectorStyleSheetForInlineStyle::inlineStyle):
105         (WebCore::InspectorStyleSheetForInlineStyle::elementStyleText):
106         * svg/SVGElement.idl:
107
108 2016-02-11  Konstantin Tokarev  <annulen@yandex.ru>
109
110         [cmake] Consolidate TextureMapper file and include dir lists.
111         https://bugs.webkit.org/show_bug.cgi?id=154106
112
113         Reviewed by Michael Catanzaro.
114
115         No new tests needed.
116
117         * CMakeLists.txt: Moved texmap include dir and source list to
118         TextureMapper.cmake, removed non-existent include dir "filters/texmap".
119         * PlatformEfl.cmake: Moved texmap and coordinatedgraphics include
120         dirs and source list to TextureMapper.cmake.
121         * PlatformGTK.cmake: Ditto, also removed non-existent include dir
122         "texmap/threadedcompositor"
123         * PlatformWinCairo.cmake: Moved texmap files to TextureMapper.cmake.
124         * platform/TextureMapper.cmake: Added.
125
126 2016-02-11  Chris Dumez  <cdumez@apple.com>
127
128         Move 'length' property to the prototype
129         https://bugs.webkit.org/show_bug.cgi?id=154051
130         <rdar://problem/24577385>
131
132         Reviewed by Darin Adler.
133
134         Move 'length' property to the prototype, where it should be. We used to
135         keep it on the instance because our implementation of
136         getOwnPropertySlot() was wrong for interfaces with a named property
137         getter. However, our implementation of getOwnPropertySlot() is now
138         spec-compliant so this should be OK.
139
140         Moving 'length' to the prototype is also a little bit risky in terms of
141         performance, especially for HTMLCollection / NodeList. However, I did
142         not see an impact on realistic benchmarks like Speedometer and only saw
143         a small impact (< 5%) on micro-benchmarks. I propose we make our behavior
144         correct and monitor performance. If we see any benchmark we care about
145         regress then we should try and optimize while keeping the attribute on
146         the prototype.
147
148         No new tests, already covered by existing tests.
149
150         * bindings/js/JSDOMBinding.h:
151         (WebCore::getStaticValueSlotEntryWithoutCaching):
152         * bindings/js/JSHTMLDocumentCustom.cpp:
153         (WebCore::JSHTMLDocument::getOwnPropertySlot):
154         (WebCore::JSHTMLDocument::nameGetter): Deleted.
155         * bindings/js/JSLocationCustom.cpp:
156         (WebCore::JSLocation::putDelegate):
157         * bindings/js/JSPluginElementFunctions.h:
158         (WebCore::pluginElementCustomGetOwnPropertySlot):
159         * bindings/js/JSStorageCustom.cpp:
160         (WebCore::JSStorage::deleteProperty):
161         (WebCore::JSStorage::deletePropertyByIndex):
162         (WebCore::JSStorage::putDelegate):
163         Leverage the new hasStaticPropertyTable static property in the
164         generated bindings for performance.
165
166         * bindings/scripts/CodeGeneratorJS.pm:
167         (GenerateHeader):
168         Generate a "hasStaticPropertyTable" static const boolean property
169         for each bindings class so we can check at build time if
170         ClassInfo::staticPropHashTable is null.
171
172         (AttributeShouldBeOnInstance):
173         Move "length" to the prototype.
174
175         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
176         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
177         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
178         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
179         * bindings/scripts/test/JS/JSTestEventConstructor.h:
180         * bindings/scripts/test/JS/JSTestEventTarget.h:
181         * bindings/scripts/test/JS/JSTestException.h:
182         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
183         * bindings/scripts/test/JS/JSTestInterface.h:
184         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
185         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
186         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
187         * bindings/scripts/test/JS/JSTestNode.h:
188         * bindings/scripts/test/JS/JSTestNondeterministic.h:
189         * bindings/scripts/test/JS/JSTestObj.h:
190         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
191         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
192         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
193         * bindings/scripts/test/JS/JSTestTypedefs.h:
194         * bindings/scripts/test/JS/JSattribute.h:
195         * bindings/scripts/test/JS/JSreadonly.h:
196         Rebaseline bindings tests.
197
198
199 2016-02-11  Csaba Osztrogonác  <ossy@webkit.org>
200
201         Fix the !(ENABLE(SHADOW_DOM) || ENABLE(DETAILS_ELEMENT)) after r196281
202         https://bugs.webkit.org/show_bug.cgi?id=154035
203
204         Reviewed by Antti Koivisto.
205
206         Follow-up fix after r196365. Removed guards around slotNodeIndex.
207
208         * dom/ComposedTreeIterator.h:
209         (WebCore::ComposedTreeIterator::Context::Context):
210
211 2016-02-10  Ryan Haddad  <ryanhaddad@apple.com>
212
213         Updating bindings test reference file for JSTestEventConstructor.cpp after r196400
214
215         Unreviewed test gardening.
216
217         No new tests needed.
218
219         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
220         (WebCore::JSTestEventConstructorConstructor::construct):
221
222 2016-02-10  Eric Carlson  <eric.carlson@apple.com>
223
224         Update "manual" caption track logic
225         https://bugs.webkit.org/show_bug.cgi?id=154084
226         <rdar://problem/24530516>
227
228         Reviewed by Dean Jackson.
229
230         No new tests, media/track/track-manual-mode.html was updated.
231
232         * English.lproj/Localizable.strings: Add new string.
233
234         * html/HTMLMediaElement.cpp:
235         (WebCore::HTMLMediaElement::addTextTrack): track.setManualSelectionMode is no more.
236         (WebCore::HTMLMediaElement::configureTextTrackGroup): Never enable a track automatically when
237           in manual selection mode.
238         (WebCore::HTMLMediaElement::captionPreferencesChanged):  track.setManualSelectionMode is no more.
239
240         * html/track/TextTrack.cpp:
241         (WebCore::TextTrack::containsOnlyForcedSubtitles): Return true for forced tracks.
242         (WebCore::TextTrack::kind): Deleted.
243         * html/track/TextTrack.h:
244
245         * html/track/TrackBase.h:
246         (WebCore::TrackBase::kind): De-virtualize, nobody overrides it.
247
248         * page/CaptionUserPreferencesMediaAF.cpp:
249         (WebCore::trackDisplayName): Include "forced" in the name of forced tracks.
250
251         * platform/LocalizedStrings.cpp:
252         (WebCore::forcedTrackMenuItemText): New.
253         * platform/LocalizedStrings.h:
254
255 2016-02-10  Jiewen Tan  <jiewen_tan@apple.com>
256
257         Rename *Event::create* which creates events for bindings to *Event::createForBindings* and cleanup corresponding paths
258         https://bugs.webkit.org/show_bug.cgi?id=153903
259         <rdar://problem/24518146>
260
261         Reviewed by Darin Adler.
262
263         Rename Event::create(const AtomicString&, const EventInit&) to Event::createForBindings
264         (const AtomicString&, const EventInit&) and for all the subclasses as well in order to
265         support Event.isTrusted. Besides, some of the subclasses use the create method for bindings
266         to create events not for bindings and vice versa. Therefore, this patch also cleanup
267         corresponding paths to ensure no misuse of the create mehtod. The same for Event::create()
268         as it is combined with Event::initEvent to create an event for bindings for legacy content.
269
270         After this patch, all call sites of *Event::create* are supposed to use *Event::create
271         to create events for user agent and *Event::createForBindings for bindings.
272
273         No change in behavior.
274
275         * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.h:
276         (WebCore::WebKitPlaybackTargetAvailabilityEvent::create):
277         (WebCore::WebKitPlaybackTargetAvailabilityEvent::createForBindings):
278         (WebCore::WebKitPlaybackTargetAvailabilityEventInit::WebKitPlaybackTargetAvailabilityEventInit): Deleted.
279         * Modules/encryptedmedia/MediaKeyMessageEvent.cpp:
280         (WebCore::MediaKeyMessageEvent::MediaKeyMessageEvent):
281         (WebCore::MediaKeyMessageEventInit::MediaKeyMessageEventInit): Deleted.
282         * Modules/encryptedmedia/MediaKeyMessageEvent.h:
283         (WebCore::MediaKeyMessageEvent::create):
284         (WebCore::MediaKeyMessageEvent::createForBindings):
285         * Modules/encryptedmedia/MediaKeyNeededEvent.cpp:
286         (WebCore::MediaKeyNeededEvent::MediaKeyNeededEvent):
287         (WebCore::MediaKeyNeededEventInit::MediaKeyNeededEventInit): Deleted.
288         * Modules/encryptedmedia/MediaKeyNeededEvent.h:
289         (WebCore::MediaKeyNeededEvent::create):
290         (WebCore::MediaKeyNeededEvent::createForBindings):
291         * Modules/encryptedmedia/MediaKeySession.cpp:
292         (WebCore::MediaKeySession::sendMessage):
293         * Modules/gamepad/GamepadEvent.h:
294         (WebCore::GamepadEvent::create):
295         (WebCore::GamepadEvent::createForBindings):
296         (WebCore::GamepadEventInit::GamepadEventInit): Deleted.
297         * Modules/indieui/UIRequestEvent.cpp:
298         (WebCore::UIRequestEvent::createForBindings):
299         (WebCore::UIRequestEvent::UIRequestEvent):
300         (WebCore::UIRequestEventInit::UIRequestEventInit): Deleted.
301         (WebCore::UIRequestEvent::create): Deleted.
302         * Modules/indieui/UIRequestEvent.h:
303         * Modules/mediastream/MediaStreamEvent.cpp:
304         (WebCore::MediaStreamEvent::createForBindings):
305         (WebCore::MediaStreamEventInit::MediaStreamEventInit): Deleted.
306         (WebCore::MediaStreamEvent::create): Deleted.
307         * Modules/mediastream/MediaStreamEvent.h:
308         * Modules/mediastream/MediaStreamTrackEvent.cpp:
309         (WebCore::MediaStreamTrackEvent::createForBindings):
310         (WebCore::MediaStreamTrackEventInit::MediaStreamTrackEventInit): Deleted.
311         (WebCore::MediaStreamTrackEvent::create): Deleted.
312         * Modules/mediastream/MediaStreamTrackEvent.h:
313         * Modules/mediastream/RTCDTMFToneChangeEvent.cpp:
314         (WebCore::RTCDTMFToneChangeEvent::createForBindings):
315         (WebCore::RTCDTMFToneChangeEvent::create): Deleted.
316         * Modules/mediastream/RTCDTMFToneChangeEvent.h:
317         * Modules/mediastream/RTCDataChannelEvent.cpp:
318         (WebCore::RTCDataChannelEvent::createForBindings):
319         (WebCore::RTCDataChannelEvent::create): Deleted.
320         * Modules/mediastream/RTCDataChannelEvent.h:
321         * Modules/mediastream/RTCIceCandidateEvent.cpp:
322         (WebCore::RTCIceCandidateEvent::createForBindings):
323         (WebCore::RTCIceCandidateEvent::create): Deleted.
324         * Modules/mediastream/RTCIceCandidateEvent.h:
325         * Modules/mediastream/RTCTrackEvent.cpp:
326         (WebCore::RTCTrackEvent::createForBindings):
327         (WebCore::RTCTrackEventInit::RTCTrackEventInit): Deleted.
328         (WebCore::RTCTrackEvent::create): Deleted.
329         * Modules/mediastream/RTCTrackEvent.h:
330         * Modules/speech/SpeechSynthesisEvent.cpp:
331         (WebCore::SpeechSynthesisEvent::createForBindings):
332         (WebCore::SpeechSynthesisEvent::create):
333         (WebCore::SpeechSynthesisEvent::SpeechSynthesisEvent):
334         * Modules/speech/SpeechSynthesisEvent.h:
335         * Modules/webaudio/AudioProcessingEvent.cpp:
336         (WebCore::AudioProcessingEvent::create): Deleted.
337         * Modules/webaudio/AudioProcessingEvent.h:
338         (WebCore::AudioProcessingEvent::create):
339         (WebCore::AudioProcessingEvent::createForBindings):
340         * Modules/webaudio/OfflineAudioCompletionEvent.cpp:
341         (WebCore::OfflineAudioCompletionEvent::createForBindings):
342         (WebCore::OfflineAudioCompletionEvent::create): Deleted.
343         * Modules/webaudio/OfflineAudioCompletionEvent.h:
344         * Modules/websockets/CloseEvent.h:
345         (WebCore::CloseEvent::create):
346         (WebCore::CloseEvent::createForBindings):
347         (WebCore::CloseEvent::CloseEvent):
348         (WebCore::CloseEventInit::CloseEventInit): Deleted.
349         * bindings/objc/DOM.mm:
350         (-[DOMNode nextFocusNode]):
351         (-[DOMNode previousFocusNode]):
352         * bindings/scripts/CodeGeneratorJS.pm:
353         (GenerateConstructorDefinition):
354         * dom/AnimationEvent.cpp:
355         (WebCore::AnimationEventInit::AnimationEventInit): Deleted.
356         * dom/AnimationEvent.h:
357         * dom/BeforeLoadEvent.h:
358         (WebCore::BeforeLoadEventInit::BeforeLoadEventInit): Deleted.
359         * dom/ClipboardEvent.h:
360         * dom/CompositionEvent.cpp:
361         (WebCore::CompositionEventInit::CompositionEventInit): Deleted.
362         * dom/CompositionEvent.h:
363         * dom/CustomEvent.cpp:
364         (WebCore::CustomEventInit::CustomEventInit): Deleted.
365         * dom/CustomEvent.h:
366         * dom/DeviceMotionEvent.h:
367         * dom/DeviceOrientationEvent.h:
368         * dom/Document.cpp:
369         (WebCore::Document::createEvent):
370         * dom/Element.cpp:
371         (WebCore::Element::dispatchMouseEvent):
372         * dom/ErrorEvent.cpp:
373         (WebCore::ErrorEventInit::ErrorEventInit): Deleted.
374         * dom/ErrorEvent.h:
375         * dom/Event.cpp:
376         (WebCore::EventInit::EventInit): Deleted.
377         * dom/Event.h:
378         (WebCore::Event::createForBindings):
379         (WebCore::Event::create): Deleted.
380         * dom/FocusEvent.cpp:
381         (WebCore::FocusEventInit::FocusEventInit): Deleted.
382         * dom/FocusEvent.h:
383         * dom/HashChangeEvent.h:
384         (WebCore::HashChangeEventInit::HashChangeEventInit): Deleted.
385         * dom/KeyboardEvent.cpp:
386         (WebCore::KeyboardEvent::KeyboardEvent):
387         (WebCore::KeyboardEventInit::KeyboardEventInit): Deleted.
388         * dom/KeyboardEvent.h:
389         * dom/MessageEvent.cpp:
390         (WebCore::MessageEvent::MessageEvent):
391         (WebCore::MessageEventInit::MessageEventInit): Deleted.
392         * dom/MessageEvent.h:
393         * dom/MouseEvent.cpp:
394         (WebCore::MouseEvent::createForBindings):
395         (WebCore::MouseEvent::create):
396         (WebCore::MouseEvent::MouseEvent):
397         (WebCore::MouseEvent::cloneFor):
398         (WebCore::MouseEventInit::MouseEventInit): Deleted.
399         * dom/MouseEvent.h:
400         (WebCore::MouseEvent::createForBindings):
401         (WebCore::MouseEvent::create): Deleted.
402         * dom/MouseRelatedEvent.cpp:
403         (WebCore::MouseRelatedEvent::MouseRelatedEvent):
404         (WebCore::MouseRelatedEvent::init):
405         * dom/MouseRelatedEvent.h:
406         (WebCore::MouseRelatedEvent::screenX):
407         (WebCore::MouseRelatedEvent::screenY):
408         (WebCore::MouseRelatedEvent::screenLocation):
409         (WebCore::MouseRelatedEvent::clientX):
410         (WebCore::MouseRelatedEvent::clientY):
411         (WebCore::MouseRelatedEvent::movementX):
412         (WebCore::MouseRelatedEvent::movementY):
413         (WebCore::MouseRelatedEvent::clientLocation):
414         (WebCore::MouseRelatedEvent::isSimulated):
415         (WebCore::MouseRelatedEvent::absoluteLocation):
416         (WebCore::MouseRelatedEvent::setAbsoluteLocation):
417         * dom/MutationEvent.h:
418         * dom/OverflowEvent.cpp:
419         (WebCore::OverflowEvent::OverflowEvent):
420         (WebCore::OverflowEvent::initOverflowEvent):
421         (WebCore::OverflowEventInit::OverflowEventInit): Deleted.
422         * dom/OverflowEvent.h:
423         * dom/PageTransitionEvent.cpp:
424         (WebCore::PageTransitionEventInit::PageTransitionEventInit): Deleted.
425         * dom/PageTransitionEvent.h:
426         * dom/PopStateEvent.cpp:
427         (WebCore::PopStateEvent::createForBindings):
428         (WebCore::PopStateEventInit::PopStateEventInit): Deleted.
429         (WebCore::PopStateEvent::PopStateEvent): Deleted.
430         (WebCore::PopStateEvent::create): Deleted.
431         * dom/PopStateEvent.h:
432         * dom/ProgressEvent.cpp:
433         (WebCore::ProgressEventInit::ProgressEventInit): Deleted.
434         * dom/ProgressEvent.h:
435         (WebCore::ProgressEvent::createForBindings):
436         (WebCore::ProgressEvent::create): Deleted.
437         * dom/SecurityPolicyViolationEvent.h:
438         (WebCore::SecurityPolicyViolationEventInit::SecurityPolicyViolationEventInit): Deleted.
439         * dom/TextEvent.cpp:
440         (WebCore::TextEvent::createForBindings):
441         (WebCore::TextEvent::create): Deleted.
442         * dom/TextEvent.h:
443         * dom/TouchEvent.h:
444         * dom/TransitionEvent.cpp:
445         (WebCore::TransitionEventInit::TransitionEventInit): Deleted.
446         * dom/TransitionEvent.h:
447         * dom/UIEvent.cpp:
448         (WebCore::UIEventInit::UIEventInit): Deleted.
449         * dom/UIEvent.h:
450         (WebCore::UIEvent::createForBindings):
451         (WebCore::UIEvent::create): Deleted.
452         * dom/UIEventWithKeyState.h:
453         (WebCore::UIEventWithKeyState::ctrlKey):
454         (WebCore::UIEventWithKeyState::shiftKey):
455         (WebCore::UIEventWithKeyState::altKey):
456         (WebCore::UIEventWithKeyState::metaKey):
457         (WebCore::UIEventWithKeyState::UIEventWithKeyState):
458         * dom/WebKitAnimationEvent.cpp:
459         (WebCore::WebKitAnimationEventInit::WebKitAnimationEventInit): Deleted.
460         * dom/WebKitAnimationEvent.h:
461         * dom/WebKitTransitionEvent.cpp:
462         (WebCore::WebKitTransitionEventInit::WebKitTransitionEventInit): Deleted.
463         * dom/WebKitTransitionEvent.h:
464         * dom/WheelEvent.h:
465         * html/HTMLMediaElement.cpp:
466         (WebCore::HTMLMediaElement::mediaPlayerKeyAdded):
467         (WebCore::HTMLMediaElement::mediaPlayerKeyError):
468         (WebCore::HTMLMediaElement::mediaPlayerKeyMessage):
469         (WebCore::HTMLMediaElement::mediaPlayerKeyNeeded):
470         * html/MediaKeyEvent.cpp:
471         (WebCore::MediaKeyEvent::MediaKeyEvent):
472         (WebCore::MediaKeyEventInit::MediaKeyEventInit): Deleted.
473         * html/MediaKeyEvent.h:
474         * html/canvas/WebGLContextEvent.cpp:
475         (WebCore::WebGLContextEventInit::WebGLContextEventInit): Deleted.
476         * html/canvas/WebGLContextEvent.h:
477         * html/track/TrackEvent.cpp:
478         (WebCore::TrackEvent::TrackEvent):
479         (WebCore::TrackEventInit::TrackEventInit): Deleted.
480         * html/track/TrackEvent.h:
481         * html/track/TrackListBase.cpp:
482         (TrackListBase::scheduleTrackEvent):
483         (TrackListBase::scheduleChangeEvent):
484         * page/EventSource.cpp:
485         (WebCore::EventSource::createMessageEvent):
486         * page/csp/ContentSecurityPolicy.cpp:
487         (WebCore::ContentSecurityPolicy::reportViolation):
488         (WebCore::gatherSecurityPolicyViolationEventData): Deleted.
489         * storage/StorageEvent.cpp:
490         (WebCore::StorageEvent::createForBindings):
491         (WebCore::StorageEventInit::StorageEventInit): Deleted.
492         (WebCore::StorageEvent::create): Deleted.
493         * storage/StorageEvent.h:
494         * svg/SVGZoomEvent.h:
495         (WebCore::SVGZoomEvent::createForBindings):
496         (WebCore::SVGZoomEvent::create): Deleted.
497         * xml/XMLHttpRequestProgressEvent.h:
498         (WebCore::XMLHttpRequestProgressEvent::createForBindings):
499         (WebCore::XMLHttpRequestProgressEvent::create): Deleted.
500
501 2016-02-10  Ryan Haddad  <ryanhaddad@apple.com>
502
503         Rebaselining bindings tests
504
505         Unreviewed test gardening.
506
507         No new tests needed.
508
509         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
510         * bindings/scripts/test/JS/JSTestCallback.cpp:
511         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
512         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
513         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
514         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
515         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
516         * bindings/scripts/test/JS/JSTestException.cpp:
517         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
518         * bindings/scripts/test/JS/JSTestInterface.cpp:
519         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
520         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
521         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
522         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
523         * bindings/scripts/test/JS/JSTestObj.cpp:
524         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
525         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
526         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
527         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
528         * bindings/scripts/test/JS/JSattribute.cpp:
529         * bindings/scripts/test/JS/JSreadonly.cpp:
530
531 2016-02-10  Konstantin Tokarev  <annulen@yandex.ru>
532
533         [cmake] Consolidate CMake code related to image decoders.
534         https://bugs.webkit.org/show_bug.cgi?id=154074
535
536         Reviewed by Alex Christensen.
537
538         Common image decoder sources, includes and libs are moved to
539         platform/ImageDecoders.cmake.
540
541         Also, added include directories of libjpeg and libpng to
542         WebCore_SYSTEM_INCLUDE_DIRECTORIES.
543
544         No new tests needed.
545
546         * CMakeLists.txt: Moved common include paths to ImageDecoders.cmake.
547         * PlatformEfl.cmake: Moved common sources and libs to ImageDecoders.cmake.
548         * PlatformGTK.cmake: Ditto.
549         * PlatformWinCairo.cmake: Moved common sources to ImageDecoders.cmake.
550         * platform/ImageDecoders.cmake: Added.
551
552 2016-02-10  Myles C. Maxfield  <mmaxfield@apple.com>
553
554         CSSSegmentedFontFace does not need to be reference counted
555         https://bugs.webkit.org/show_bug.cgi?id=154083
556
557         Reviewed by Antti Koivisto.
558
559         ...There is only ever a single reference to one.
560
561         No new tests because there is no behavior change.
562
563         * css/CSSFontSelector.cpp:
564         (WebCore::CSSFontSelector::getFontFace):
565         * css/CSSFontSelector.h:
566         * css/CSSSegmentedFontFace.h:
567         (WebCore::CSSSegmentedFontFace::create): Deleted.
568
569 2016-02-10  Myles C. Maxfield  <mmaxfield@apple.com>
570
571         FontCache's clients should use references instead of pointers
572         https://bugs.webkit.org/show_bug.cgi?id=154085
573
574         Reviewed by Antti Koivisto.
575
576         They are never null.
577
578         No new tests because there is no behavior change.
579
580         * css/CSSFontSelector.cpp:
581         (WebCore::CSSFontSelector::CSSFontSelector):
582         (WebCore::CSSFontSelector::~CSSFontSelector):
583         * platform/graphics/FontCache.cpp:
584         (WebCore::FontCache::addClient):
585         (WebCore::FontCache::removeClient):
586         * platform/graphics/FontCache.h:
587
588 2016-02-10  Chris Dumez  <cdumez@apple.com>
589
590         [Web IDL] interface objects should be Function objects
591         https://bugs.webkit.org/show_bug.cgi?id=154038
592         <rdar://problem/24569358>
593
594         Reviewed by Geoffrey Garen.
595
596         interface objects should be Function objects as per Web IDL:
597         - http://heycam.github.io/webidl/#interface-object
598         - http://heycam.github.io/webidl/#es-interfaces
599
600         So window.Event should be a Function object for e.g. but in WebKit it
601         is a regular EventConstructor JSObject.
602         Firefox and Chrome match the specification.
603
604         Test: js/interface-objects.html
605
606         * bindings/js/JSDOMBinding.cpp:
607         (WebCore::callThrowTypeError):
608         (WebCore::DOMConstructorObject::getCallData):
609         When calling the interface object as a function, we throw a TypeError
610         with a message asking to use the 'new' operator to match the behavior
611         of Firefox and Chrome.
612
613         * bindings/js/JSDOMBinding.h:
614         Add JSC::TypeOfShouldCallGetCallData structure flag and implement
615         getCallData() so that typeof returns "function", as per the
616         specification and the behavior of other browsers.
617
618         (WebCore::DOMConstructorObject::className):
619         Implement className() and return "Function" to match the specification and
620         other browsers. Otherwise, it would fall back to using ClassInfo::className
621         which os the function name and interface name (e.g. "Event").
622
623         * bindings/js/JSDOMConstructor.h:
624         (WebCore::JSDOMConstructorNotConstructable::callThrowTypeError):
625         (WebCore::JSDOMConstructorNotConstructable::getCallData):
626         As per the specification, interfaces that do not have a [Constructor]
627         should throw a TypeError when called as a function. Use the "Illegal
628         constructor" error message to match Firefox and Chrome.
629
630         * bindings/js/JSDOMGlobalObject.h:
631         (WebCore::getDOMConstructor):
632         Instead of using objectPrototype as prototype for all DOM constructors,
633         we now call the prototypeForStructure() static function that is
634         generated for each bindings class. As per the Web IDL specification,
635         The [[Prototype]] internal property of an interface object for a
636         non-callback interface is determined as follows:
637         1. If the interface inherits from some other interface, the value of
638            [[Prototype]] is the interface object for that other interface.
639         2. If the interface doesn't inherit from any other interface, the value
640            of [[Prototype]] is %FunctionPrototype% ([ECMA-262], section 6.1.7.4).
641
642         * bindings/js/JSImageConstructor.cpp:
643         (WebCore::JSImageConstructor::prototypeForStructure):
644         Have the Image's interface object use HTMLElement's interface object
645         as prototype as HTMLImageElement inherits HTMLElement.
646
647         * bindings/scripts/CodeGenerator.pm:
648         (getInterfaceExtendedAttributesFromName):
649         Add a utility function to cheaply retrieve an interface's IDL extended
650         attributes without actually parsing the IDL. This is used to check if
651         an interface's parent is marked as [NoInterfaceObject] currently.
652
653         * bindings/scripts/CodeGeneratorJS.pm:
654         (GenerateHeader):
655         (GenerateImplementation):
656         (GenerateCallbackHeader):
657         (GenerateCallbackImplementation):
658         Mark JSGlobalObject* parameter as const as the implementation does not
659         alter the globalObject.
660
661         (GenerateConstructorHelperMethods):
662         - Generate prototypeForStructure() function for each bindings class that
663           is not marked as [NoInterfaceObject] so getDOMConstructor() knows which
664           prototype to use for the interface object / constructor when constructing
665           it.
666         - Use the interface name for the interface object, without the "Constructor"
667           suffix, to match the behavior of Firefox and Chrome.
668
669         * bindings/scripts/test/*:
670         Rebaseline bindings tests.
671
672 2016-02-10  Jer Noble  <jer.noble@apple.com>
673
674         [Mac] Graphical corruption in videos when enabling custom loading path
675         https://bugs.webkit.org/show_bug.cgi?id=154044
676
677         Reviewed by Alex Christensen.
678
679         Revert the "Drive-by fix" in r196345 as it breaks the WebCoreNSURLSessionTests.BasicOperation API test.
680
681         * platform/network/cocoa/WebCoreNSURLSession.mm:
682         (-[WebCoreNSURLSessionDataTask resource:receivedData:length:]):
683
684 2016-02-10  Myles C. Maxfield  <mmaxfield@apple.com>
685
686         CSSSegmentedFontFace does not need to be reference counted
687         https://bugs.webkit.org/show_bug.cgi?id=154083
688
689         Reviewed by Antti Koivisto.
690
691         ...There is only ever a single reference to one.
692
693         No new tests because there is no behavior change.
694
695         * css/CSSFontSelector.cpp:
696         (WebCore::CSSFontSelector::getFontFace):
697         * css/CSSFontSelector.h:
698         * css/CSSSegmentedFontFace.h:
699         (WebCore::CSSSegmentedFontFace::create): Deleted.
700
701 2016-02-10  Antti Koivisto  <antti@apple.com>
702
703         Optimize style invalidation after class attribute change
704         https://bugs.webkit.org/show_bug.cgi?id=154075
705         rdar://problem/12526450
706
707         Reviewed by Andreas Kling.
708
709         Currently a class attribute change invalidates style for the entire element subtree for any class found in the
710         active stylesheet set.
711
712         This patch optimizes class changes by building a new optimization structure called ancestorClassRules. It contains
713         rules that have class selectors in the portion of the complex selector that matches ancestor elements. The sets
714         of rules are hashes by the class name.
715
716         On class attribute change the existing StyleInvalidationAnalysis mechanism is used with ancestorClassRules to invalidate
717         exactly those descendants that are affected by the addition or removal of the class name. This is fast because the CSS JIT
718         makes selector matching cheap and the number of relevant rules is typically small.
719
720         This optimization is very effective on many dynamic pages. For example when focusing and unfocusing the web inspector it
721         cuts down the number of resolved elements from ~1000 to ~50. Even in PLT it reduces the number of resolved elements by ~11%.
722
723         * css/DocumentRuleSets.cpp:
724         (WebCore::DocumentRuleSets::collectFeatures):
725         (WebCore::DocumentRuleSets::ancestorClassRules):
726
727             Create optimization RuleSets on-demand when there is an actual dynamic class change.
728
729         * css/DocumentRuleSets.h:
730         (WebCore::DocumentRuleSets::features):
731         (WebCore::DocumentRuleSets::sibling):
732         (WebCore::DocumentRuleSets::uncommonAttribute):
733         * css/ElementRuleCollector.cpp:
734         (WebCore::ElementRuleCollector::ElementRuleCollector):
735
736             Add a new constructor that doesn't requires DocumentRuleSets. Only the user and author style is required.
737
738         (WebCore::ElementRuleCollector::matchAuthorRules):
739         (WebCore::ElementRuleCollector::matchUserRules):
740         * css/ElementRuleCollector.h:
741         * css/RuleFeature.cpp:
742         (WebCore::RuleFeatureSet::recursivelyCollectFeaturesFromSelector):
743
744             Collect class names that show up in the ancestor portion of the selector.
745             Make this a member.
746
747         (WebCore::RuleFeatureSet::collectFeatures):
748
749             Move this code from RuleData.
750             Add the rule to ancestorClassRules if needed.
751
752         (WebCore::RuleFeatureSet::add):
753         (WebCore::RuleFeatureSet::clear):
754         (WebCore::RuleFeatureSet::shrinkToFit):
755         (WebCore::recursivelyCollectFeaturesFromSelector): Deleted.
756         (WebCore::RuleFeatureSet::collectFeaturesFromSelector): Deleted.
757         * css/RuleFeature.h:
758         (WebCore::RuleFeature::RuleFeature):
759         (WebCore::RuleFeatureSet::RuleFeatureSet): Deleted.
760         * css/RuleSet.cpp:
761         (WebCore::RuleData::RuleData):
762         (WebCore::RuleSet::RuleSet):
763         (WebCore::RuleSet::~RuleSet):
764         (WebCore::RuleSet::addToRuleSet):
765         (WebCore::RuleSet::addRule):
766         (WebCore::RuleSet::addRulesFromSheet):
767         (WebCore::collectFeaturesFromRuleData): Deleted.
768         * css/RuleSet.h:
769         (WebCore::RuleSet::tagRules):
770         (WebCore::RuleSet::RuleSet): Deleted.
771         * css/StyleInvalidationAnalysis.cpp:
772         (WebCore::shouldDirtyAllStyle):
773         (WebCore::StyleInvalidationAnalysis::StyleInvalidationAnalysis):
774
775             Add a new constructor that takes a ready made RuleSet instead of a stylesheet.
776
777         (WebCore::StyleInvalidationAnalysis::invalidateIfNeeded):
778         (WebCore::StyleInvalidationAnalysis::invalidateStyleForTree):
779         (WebCore::StyleInvalidationAnalysis::invalidateStyle):
780         (WebCore::StyleInvalidationAnalysis::invalidateStyle):
781
782             New function for invalidating a subtree instead of the whole document.
783
784         * css/StyleInvalidationAnalysis.h:
785         (WebCore::StyleInvalidationAnalysis::dirtiesAllStyle):
786         (WebCore::StyleInvalidationAnalysis::hasShadowPseudoElementRulesInAuthorSheet):
787         * dom/Element.cpp:
788         (WebCore::classStringHasClassName):
789         (WebCore::collectClasses):
790         (WebCore::computeClassChange):
791
792             Factor to return the changed classes.
793
794         (WebCore::invalidateStyleForClassChange):
795
796             First filter out classes that don't show up in stylesheets. If something remains invalidate the current
797             element for inline style change (that is a style change that doesn't affect descendants).
798
799             Next check if there are any ancestorClassRules for the changed class. If so use the StyleInvalidationAnalysis
800             to find any affected descendants and invalidate them with inline style change as well.
801
802         (WebCore::Element::classAttributeChanged):
803
804             Invalidate for removed classes before setting new attribute value, invalidate for added classes afterwards.
805
806         (WebCore::Element::absoluteLinkURL):
807         (WebCore::checkSelectorForClassChange): Deleted.
808         * dom/ElementData.h:
809         (WebCore::ElementData::setClassNames):
810         (WebCore::ElementData::classNames):
811         (WebCore::ElementData::classNamesMemoryOffset):
812         (WebCore::ElementData::clearClass): Deleted.
813         (WebCore::ElementData::setClass): Deleted.
814
815 2016-02-10  Myles C. Maxfield  <mmaxfield@apple.com>
816
817         Addressing post-review comments after r196322
818
819         Unreviwed.
820
821         * css/CSSFontFaceSource.cpp:
822         (WebCore::CSSFontFaceSource::font):
823         * css/CSSFontFaceSource.h:
824
825 2016-02-10  Chris Dumez  <cdumez@apple.com>
826
827         Attributes on the Window instance should be configurable unless [Unforgeable]
828         https://bugs.webkit.org/show_bug.cgi?id=153920
829         <rdar://problem/24563211>
830
831         Reviewed by Darin Adler.
832
833         Attributes on the Window instance should be configurable unless [Unforgeable]:
834         1. 'constructor' property:
835            - http://www.w3.org/TR/WebIDL/#interface-prototype-object
836         2. Constructor properties (e.g. window.Node):
837            - http://www.w3.org/TR/WebIDL/#es-interfaces
838         3. IDL attributes:
839            - http://heycam.github.io/webidl/#es-attributes (configurable unless
840              [Unforgeable], e.g. window.location)
841
842         Firefox complies with the WebIDL specification but WebKit does not for 1. and 3.
843
844         Test: fast/dom/Window/window-properties-configurable.html
845
846         * bindings/js/JSDOMWindowCustom.cpp:
847         (WebCore::JSDOMWindow::getOwnPropertySlot):
848         For known Window properties (i.e. properties in the static property table),
849         if we have reified and this is same-origin access, then call
850         Base::getOwnPropertySlot() to get the property from the local property
851         storage. If we have not reified yet, or this is cross-origin access, query
852         the static property table. This is to match the behavior of Firefox and
853         Chrome which seem to keep returning the original properties upon cross
854         origin access, even if those were deleted or redefined.
855
856         (WebCore::JSDOMWindow::put):
857         The previous code used to call the static property setter for properties in
858         the static table. However, this does not do the right thing if properties
859         were reified. For example, deleting window.name and then trying to set it
860         again would not work. Therefore, update this code to only do this if the
861         properties have not been reified, similarly to what is done in
862         JSObject::putInlineSlow().
863
864         * bindings/scripts/CodeGeneratorJS.pm:
865         (ConstructorShouldBeOnInstance):
866         Add a FIXME comment indicating that window.constructor should be on
867         the prototype as per the Web IDL specification.
868
869         (GenerateAttributesHashTable):
870         - Mark 'constructor' property as configurable for Window, as per the
871           specification and consistently with other 'constructor' properties:
872           http://www.w3.org/TR/WebIDL/#interface-prototype-object
873         - Mark properties as configurable even though they are on the instance.
874           Window has its properties on the instance as per the specification:
875           1. http://heycam.github.io/webidl/#es-attributes
876           2. http://heycam.github.io/webidl/#PrimaryGlobal (window is [PrimaryGlobal]
877           However, these properties should be configurable as long as they are
878           not marked as [Unforgeable], as per 1.
879
880         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
881         * bindings/scripts/test/JS/JSTestException.cpp:
882         * bindings/scripts/test/JS/JSTestObj.cpp:
883         Rebaseline bindings tests.
884
885 2016-02-10  Brady Eidson  <beidson@apple.com>
886
887         Modern IDB: Ref cycle between IDBObjectStore and IDBTransaction.
888         https://bugs.webkit.org/show_bug.cgi?id=154061
889
890         Reviewed by Alex Christensen.
891
892         No new tests (Currently untestable).
893
894         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
895         (WebCore::IDBClient::IDBTransaction::transitionedToFinishing): Make sure the new state makes sense,
896           set the new state, and then clear the set of referenced object stores which is no longer needed.
897         (WebCore::IDBClient::IDBTransaction::abort):
898         (WebCore::IDBClient::IDBTransaction::commit):
899         * Modules/indexeddb/client/IDBTransactionImpl.h:
900
901 2016-02-10  Jer Noble  <jer.noble@apple.com>
902
903         REGRESSION(r195770): Use-after-free in ResourceLoaderOptions::cachingPolicy
904         https://bugs.webkit.org/show_bug.cgi?id=153727
905         <rdar://problem/24429886>
906
907         Reviewed by Darin Adler.
908
909         Follow-up after r195965. Only protect those parts of CachedResource::removeClient() which
910         affect the MemoryCache when allowsCaching() is false.
911
912         * loader/cache/CachedResource.cpp:
913         (WebCore::CachedResource::removeClient):
914
915 2016-02-10  Csaba Osztrogonác  <ossy@webkit.org>
916
917         Fix the !(ENABLE(SHADOW_DOM) || ENABLE(DETAILS_ELEMENT)) after r196281
918         https://bugs.webkit.org/show_bug.cgi?id=154035
919
920         Reviewed by Antti Koivisto.
921
922         * dom/ComposedTreeIterator.h:
923         (WebCore::ComposedTreeIterator::Context::Context):
924
925 2016-02-09  Carlos Garcia Campos  <cgarcia@igalia.com>
926
927         [GTK] Toggle buttons are blurry with GTK+ 3.19
928         https://bugs.webkit.org/show_bug.cgi?id=154007
929
930         Reviewed by Michael Catanzaro.
931
932         Use min-width/min-height style properties when GTK+ >= 3.19.7 to
933         get the size of toggle buttons.
934
935         * rendering/RenderThemeGtk.cpp:
936         (WebCore::setToggleSize):
937         (WebCore::paintToggle):
938
939 2016-02-09  Aakash Jain  <aakash_jain@apple.com>
940
941         Headers that use WEBCORE_EXPORT should include PlatformExportMacros.h
942         https://bugs.webkit.org/show_bug.cgi?id=146984
943
944         Reviewed by Alexey Proskuryakov.
945
946         * Modules/speech/SpeechSynthesis.h:
947         * contentextensions/ContentExtensionError.h:
948         * dom/DeviceOrientationClient.h:
949         * platform/graphics/Color.h:
950         * platform/ios/wak/WebCoreThread.h:
951         * platform/network/CacheValidation.h:
952         * platform/network/cf/CertificateInfo.h:
953
954 2016-02-09  Nan Wang  <n_wang@apple.com>
955
956         AX: Implement word related text marker functions using TextIterator
957         https://bugs.webkit.org/show_bug.cgi?id=153939
958         <rdar://problem/24269605>
959
960         Reviewed by Chris Fleizach.
961
962         Using CharacterOffset to implement word related text marker calls. Reused
963         logic from previousBoundary and nextBoundary in VisibleUnits class.
964
965         Test: accessibility/mac/text-marker-word-nav.html
966
967         * accessibility/AXObjectCache.cpp:
968         (WebCore::AXObjectCache::traverseToOffsetInRange):
969         (WebCore::AXObjectCache::rangeForNodeContents):
970         (WebCore::isReplacedNodeOrBR):
971         (WebCore::characterOffsetsInOrder):
972         (WebCore::resetNodeAndOffsetForReplacedNode):
973         (WebCore::setRangeStartOrEndWithCharacterOffset):
974         (WebCore::AXObjectCache::rangeForUnorderedCharacterOffsets):
975         (WebCore::AXObjectCache::setTextMarkerDataWithCharacterOffset):
976         (WebCore::AXObjectCache::startOrEndCharacterOffsetForRange):
977         (WebCore::AXObjectCache::startOrEndTextMarkerDataForRange):
978         (WebCore::AXObjectCache::characterOffsetForNodeAndOffset):
979         (WebCore::AXObjectCache::textMarkerDataForCharacterOffset):
980         (WebCore::AXObjectCache::previousNode):
981         (WebCore::AXObjectCache::visiblePositionFromCharacterOffset):
982         (WebCore::AXObjectCache::characterOffsetFromVisiblePosition):
983         (WebCore::AXObjectCache::textMarkerDataForVisiblePosition):
984         (WebCore::AXObjectCache::nextCharacterOffset):
985         (WebCore::AXObjectCache::previousCharacterOffset):
986         (WebCore::startWordBoundary):
987         (WebCore::endWordBoundary):
988         (WebCore::AXObjectCache::startCharacterOffsetOfWord):
989         (WebCore::AXObjectCache::endCharacterOffsetOfWord):
990         (WebCore::AXObjectCache::previousWordStartCharacterOffset):
991         (WebCore::AXObjectCache::nextWordEndCharacterOffset):
992         (WebCore::AXObjectCache::leftWordRange):
993         (WebCore::AXObjectCache::rightWordRange):
994         (WebCore::characterForCharacterOffset):
995         (WebCore::AXObjectCache::characterAfter):
996         (WebCore::AXObjectCache::characterBefore):
997         (WebCore::parentEditingBoundary):
998         (WebCore::AXObjectCache::nextWordBoundary):
999         (WebCore::AXObjectCache::previousWordBoundary):
1000         (WebCore::AXObjectCache::rootAXEditableElement):
1001         * accessibility/AXObjectCache.h:
1002         (WebCore::AXObjectCache::removeNodeForUse):
1003         (WebCore::AXObjectCache::isNodeInUse):
1004         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1005         (-[WebAccessibilityObjectWrapper previousTextMarkerForNode:offset:]):
1006         (-[WebAccessibilityObjectWrapper textMarkerForNode:offset:ignoreStart:]):
1007         (-[WebAccessibilityObjectWrapper textMarkerForNode:offset:]):
1008         (textMarkerForCharacterOffset):
1009         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
1010         * editing/VisibleUnits.cpp:
1011         (WebCore::rightWordPosition):
1012         (WebCore::prepend):
1013         (WebCore::appendRepeatedCharacter):
1014         (WebCore::suffixLengthForRange):
1015         (WebCore::prefixLengthForRange):
1016         (WebCore::backwardSearchForBoundaryWithTextIterator):
1017         (WebCore::forwardSearchForBoundaryWithTextIterator):
1018         (WebCore::previousBoundary):
1019         (WebCore::nextBoundary):
1020         * editing/VisibleUnits.h:
1021
1022 2016-02-09  Daniel Bates  <dabates@apple.com>
1023
1024         CSP: Extract helper classes into their own files
1025         https://bugs.webkit.org/show_bug.cgi?id=154040
1026         <rdar://problem/24571189>
1027
1028         Reviewed by Brent Fulgham.
1029
1030         No functionality was changed. So, no new tests.
1031
1032         * CMakeLists.txt: Add files ContentSecurityPolicy{DirectiveList, MediaListDirective, Source, SourceList, SourceListDirective}.cpp.
1033         * WebCore.xcodeproj/project.pbxproj: Ditto.
1034         * page/csp/ContentSecurityPolicy.cpp: Clean up #includes. Include header ParsingUtilities.h so that we can remove our own
1035         variants of skip{Exactly, Until, While}(). Update code as necessary for class renames.
1036         (WebCore::skipExactly): Deleted; instead use the analogous function in ParsingUtilities.h.
1037         (WebCore::skipUntil): Deleted; instead use the analogous function in ParsingUtilities.h.
1038         (WebCore::skipWhile): Deleted; instead use the analogous function in ParsingUtilities.h.
1039         (WebCore::isSourceListNone): Moved to file ContentSecurityPolicySourceList.cpp.
1040         (WebCore::CSPSource): Deleted; moved implementation to files ContentSecurityPolicySource.{cpp, h}.
1041         (WebCore::CSPSourceList): Deleted; moved implementation to files ContentSecurityPolicySourceList.{cpp, h}.
1042         (WebCore::CSPDirective): Deleted; moved implementation to file ContentSecurityPolicyDirective.h.
1043         (WebCore::MediaListDirective): Deleted; moved implementation to files ContentSecurityPolicyMediaListDirective.{cpp, h}.
1044         (WebCore::SourceListDirective): Deleted; moved implementation to files ContentSecurityPolicySourceListDirective.{cpp, h}.
1045         (WebCore::CSPDirectiveList): Deleted; moved implementation to files ContentSecurityPolicyDirectiveList.{cpp, h}.
1046         * page/csp/ContentSecurityPolicy.h:
1047         * page/csp/ContentSecurityPolicyDirective.h: Added.
1048         * page/csp/ContentSecurityPolicyDirectiveList.cpp: Added; removed use of ternary operator where it made the code less readable.
1049         Updated code to make use of the functions defined in ParsingUtilities.h.
1050         (WebCore::isExperimentalDirectiveName): Moved from file ContentSecurityPolicy.cpp.
1051         (WebCore::isCSPDirectiveName): Ditto.
1052         (WebCore::isDirectiveNameCharacter): Ditto.
1053         (WebCore::isDirectiveValueCharacter): Ditto.
1054         (WebCore::isNotASCIISpace): Ditto.
1055         * page/csp/ContentSecurityPolicyDirectiveList.h: Added.
1056         * page/csp/ContentSecurityPolicyMediaListDirective.cpp: Added. Updated code to make use of the functions defined in ParsingUtilities.h.
1057         (WebCore::isMediaTypeCharacter): Moved from file ContentSecurityPolicy.cpp.
1058         (WebCore::isNotASCIISpace): Ditto.
1059         * page/csp/ContentSecurityPolicyMediaListDirective.h: Added.
1060         * page/csp/ContentSecurityPolicySource.cpp: Added.
1061         * page/csp/ContentSecurityPolicySource.h: Added.
1062         * page/csp/ContentSecurityPolicySourceList.cpp: Added. Updated code to make use of the functions defined in ParsingUtilities.h.
1063         (WebCore::isSourceCharacter): Moved from file ContentSecurityPolicy.cpp.
1064         (WebCore::isHostCharacter): Ditto.
1065         (WebCore::isPathComponentCharacter): Ditto.
1066         (WebCore::isSchemeContinuationCharacter): Ditto.
1067         (WebCore::isNotColonOrSlash): Ditto.
1068         (WebCore::isSourceListNone): Ditto.
1069         * page/csp/ContentSecurityPolicySourceList.h: Added.
1070         * page/csp/ContentSecurityPolicySourceListDirective.cpp: Added.
1071         * page/csp/ContentSecurityPolicySourceListDirective.h: Added.
1072
1073 2016-02-09  Brady Eidson  <beidson@apple.com>
1074
1075         Modern IDB: TransactionOperation objects leak.
1076         https://bugs.webkit.org/show_bug.cgi?id=154054
1077
1078         Reviewed by Alex Christensen.
1079
1080         No new tests (Currently untestable).
1081
1082         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
1083         (WebCore::IDBClient::IDBTransaction::abortOnServerAndCancelRequests): Remove the TransactionOperation from
1084           the map, as this operation doesn't complete "normally" like most others.
1085         (WebCore::IDBClient::IDBTransaction::commitOnServer): Ditto.
1086         
1087         * Modules/indexeddb/client/TransactionOperation.h:
1088         (WebCore::IDBClient::TransactionOperation::perform): Clear the m_performFunction after use,
1089           as it holds a lambda that holds a RefPtr to the IDBTransaction, as well as a self-ref.
1090         (WebCore::IDBClient::TransactionOperation::completed): Clear m_completeFunction for the same reasons.
1091
1092 2016-02-09  Jer Noble  <jer.noble@apple.com>
1093
1094         [Mac] Graphical corruption in videos when enabling custom loading path
1095         https://bugs.webkit.org/show_bug.cgi?id=154044
1096
1097         Reviewed by Alex Christensen.
1098
1099         The NSOperationQueue provided by AVFoundation from the AVAssetResourceLoader queue is not
1100         set to be a serial queue. So when adding dataReceived operations to that queue, there exists
1101         the possibility that some operations are handled before others, and the client will receieve
1102         data out of order.
1103
1104         A real NSURLSession object will only issue another operation when the first operation
1105         completes, so emulate this behavior in WebCoreNSURLSession by using a serial dispatch queue.
1106         The internal queue will enqueue an operation to the resource loader's queue, and block until
1107         that operation completes, thus ensuring ordering of the data (and other) operations.
1108
1109         * platform/network/cocoa/WebCoreNSURLSession.h:
1110         * platform/network/cocoa/WebCoreNSURLSession.mm:
1111         (-[WebCoreNSURLSession initWithResourceLoader:delegate:delegateQueue:]): Initialize _internalQueue
1112         (-[WebCoreNSURLSession addDelegateOperation:]): Added utility method.
1113         (-[WebCoreNSURLSession taskCompleted:]): Call -addDelegateOperation:
1114         (-[WebCoreNSURLSession finishTasksAndInvalidate]): Ditto.
1115         (-[WebCoreNSURLSession resetWithCompletionHandler:]): Ditto.
1116         (-[WebCoreNSURLSession flushWithCompletionHandler:]): Ditto.
1117         (-[WebCoreNSURLSession getTasksWithCompletionHandler:]): Ditto.
1118         (-[WebCoreNSURLSession getAllTasksWithCompletionHandler:]): Ditto.
1119         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:]): Ditto.
1120         (-[WebCoreNSURLSessionDataTask resource:receivedData:length:]): Ditto.
1121         (-[WebCoreNSURLSessionDataTask resourceFinished:]): Ditto.
1122
1123         Drive-by fix:
1124         (-[WebCoreNSURLSessionDataTask resource:receivedData:length:]): Set countOfBytesReceived outside the operation,
1125             queue, matching NSURLSessionDataTask's behavior.
1126
1127 2016-02-09  Nan Wang  <n_wang@apple.com>
1128
1129         [iOS Simulator] accessibility/text-marker/text-marker-range-stale-node-crash.html crashing
1130         https://bugs.webkit.org/show_bug.cgi?id=154039
1131
1132         Reviewed by Chris Fleizach.
1133
1134         We are accessing the derefed node in the CharacterOffset object, we should create an empty
1135         CharacterOffset object if the node is not in use.
1136
1137         It's covered by the test accessibility/text-marker/text-marker-range-stale-node-crash.html.
1138
1139         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1140         (-[WebAccessibilityTextMarker characterOffset]):
1141         (-[WebAccessibilityTextMarker isIgnored]):
1142
1143 2016-02-09  Myles C. Maxfield  <mmaxfield@apple.com>
1144
1145         Unreviewed build fix after r196322
1146
1147         Unreviewed.
1148
1149         * css/CSSFontFace.cpp:
1150         (WebCore::CSSFontFace::font):
1151
1152 2016-02-09  Zalan Bujtas  <zalan@apple.com>
1153
1154         Outline corners do not align properly for multiline inlines.
1155         https://bugs.webkit.org/show_bug.cgi?id=154025
1156
1157         Reviewed by David Hyatt.
1158
1159         Adjust border position when outline-offset > 0. This patch also
1160         removes integral pixelsnapping (drawLineForBoxSide takes care of
1161         device pixelsnapping). 
1162
1163         Test: fast/inline/outline-corners-with-offset.html
1164
1165         * rendering/RenderInline.cpp:
1166         (WebCore::RenderInline::paintOutlineForLine):
1167
1168 2016-02-09  Jer Noble  <jer.noble@apple.com>
1169
1170         [Mac] Adopt NSURLSession properties in AVAssetResourceLoader
1171
1172         Rubber-stamped by Eric Carlson;
1173
1174         Set the correct global variable from setAVFoundationNSURLSessionEnabled().
1175
1176         * page/Settings.cpp:
1177         (WebCore::Settings::setAVFoundationNSURLSessionEnabled):
1178
1179 2016-02-07  Gavin Barraclough  <barraclough@apple.com>
1180
1181         GetValueFunc/PutValueFunc should not take both slotBase and thisValue
1182         https://bugs.webkit.org/show_bug.cgi?id=154009
1183
1184         Reviewed by Geoff Garen.
1185
1186         In JavaScript there are two types of properties - regular value properties, and accessor properties.
1187         One difference between these is how they are reflected by getOwnPropertyDescriptor, and another is
1188         what object they operate on in the case of a prototype access. If you access a value property of a
1189         prototype object it return a value pertinent to the prototype, but in the case of a prototype object
1190         returning an accessor, then the accessor function is applied to the base object of the access.
1191
1192         JSC supports special 'custom' properties implemented as a c++ callback, and these custom properties
1193         can be used to implement either value- or accessor-like behavior. getOwnPropertyDescriptor behavior
1194         is selected via the CustomAccessor attribute. Value- or accessor-like object selection is current
1195         supported by passing both the slotBase and the thisValue to the callback,and hoping it uses the
1196         right one. This is probably inefficient, bug-prone, and leads to crazy like JSBoundSlotBaseFunction.
1197
1198         Instead, just pass one thisValue to the callback functions, consistent with CustomAccessor.
1199
1200         * bindings/js/JSDOMBinding.cpp:
1201         (WebCore::printErrorMessageForFrame):
1202         (WebCore::objectToStringFunctionGetter):
1203         * bindings/js/JSDOMBinding.h:
1204         (WebCore::propertyNameToString):
1205         (WebCore::getStaticValueSlotEntryWithoutCaching<JSDOMObject>):
1206         (WebCore::nonCachingStaticFunctionGetter):
1207         * bindings/js/JSDOMWindowCustom.cpp:
1208         (WebCore::JSDOMWindow::visitAdditionalChildren):
1209         (WebCore::childFrameGetter):
1210         (WebCore::namedItemGetter):
1211         (WebCore::jsDOMWindowWebKit):
1212         (WebCore::jsDOMWindowIndexedDB):
1213             - add missing null check, in case indexDB acessor is applied to non-window object.
1214         * bindings/js/JSPluginElementFunctions.cpp:
1215         (WebCore::pluginScriptObject):
1216         (WebCore::pluginElementPropertyGetter):
1217         * bindings/js/JSPluginElementFunctions.h:
1218         * bindings/scripts/CodeGeneratorJS.pm:
1219         (GenerateHeader):
1220         (GenerateImplementation):
1221         * bridge/runtime_array.cpp:
1222         (JSC::RuntimeArray::destroy):
1223         (JSC::RuntimeArray::lengthGetter):
1224         * bridge/runtime_array.h:
1225         * bridge/runtime_method.cpp:
1226         (JSC::RuntimeMethod::finishCreation):
1227         (JSC::RuntimeMethod::lengthGetter):
1228         * bridge/runtime_method.h:
1229         * bridge/runtime_object.cpp:
1230         (JSC::Bindings::RuntimeObject::invalidate):
1231         (JSC::Bindings::RuntimeObject::fallbackObjectGetter):
1232         (JSC::Bindings::RuntimeObject::fieldGetter):
1233         (JSC::Bindings::RuntimeObject::methodGetter):
1234         * bridge/runtime_object.h:
1235             - Merged slotBase & thisValue to custom property callbacks.
1236
1237 2016-02-09  Jer Noble  <jer.noble@apple.com>
1238
1239         Build-fix; add Nullibility macros around previously un-macro'd class definitions.
1240
1241         * platform/spi/mac/AVFoundationSPI.h:
1242
1243 2016-02-04  Jer Noble  <jer.noble@apple.com>
1244
1245         [Mac] Adopt NSURLSession properties in AVAssetResourceLoader
1246         https://bugs.webkit.org/show_bug.cgi?id=153873
1247
1248         Reviewed by Eric Carlson.
1249
1250         Adopt a new AVAssetResourceLoader API allowing clients to specify a NSURLSession object to
1251         use for media loading, and control the use of this property with a new Setting.
1252
1253         * page/Settings.cpp:
1254         (WebCore::Settings::setAVFoundationNSURLSessionEnabled):
1255         * page/Settings.h:
1256         (WebCore::Settings::isAVFoundationNSURLSessionEnabled):
1257         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1258         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
1259         * platform/spi/mac/AVFoundationSPI.h:
1260
1261 2016-02-09  Myles C. Maxfield  <mmaxfield@apple.com>
1262
1263         Decouple font creation from font loading
1264         https://bugs.webkit.org/show_bug.cgi?id=153414
1265
1266         Reviewed by Darin Adler.
1267
1268         Previously, CSSFontFaceSource never triggered a font download until that font was actually used. This means
1269         that the function which triggers the download also has the goal of returning a font to use. However,
1270         the CSS Font Loading JavaScript API requires being able to trigger a font download without this extra font
1271         creation overhead.
1272
1273         In addition, this patch adds an explicit (and enforced) state transition diagram. The diagram looks like
1274         this:
1275                             => Success
1276                           //
1277         Pending => Loading
1278                           \\
1279                             => Failure
1280
1281         Therefore, the API for CSSFontFaceSource has changed to expose the concept of these new states. This means
1282         that its user (CSSSegmentedFontFaceSource) has been updated to handle each possible state that its constituent
1283         CSSFontFaceSources may be in.
1284
1285         No new tests because there is no behavior change.
1286
1287         * css/CSSFontFace.cpp:
1288         (WebCore::CSSFontFace::allSourcesFailed): Renamed to make the name clearer.
1289         (WebCore::CSSFontFace::addedToSegmentedFontFace): Use references instead of pointers.
1290         (WebCore::CSSFontFace::removedFromSegmentedFontFace): Ditto.
1291         (WebCore::CSSFontFace::adoptSource): Renamed to make the name clearer.
1292         (WebCore::CSSFontFace::fontLoaded): Use references instead of pointers. Also, remove old dead code.
1293         (WebCore::CSSFontFace::font): Adapt to the new API of CSSFontFaceSource.
1294         (WebCore::CSSFontFace::isValid): Deleted.
1295         (WebCore::CSSFontFace::addSource): Deleted.
1296         (WebCore::CSSFontFace::notifyFontLoader): Deleted. Old dead code.
1297         (WebCore::CSSFontFace::notifyLoadingDone): Deleted. Old dead code.
1298         * css/CSSFontFace.h:
1299         (WebCore::CSSFontFace::create): Remove old dead code.
1300         (WebCore::CSSFontFace::CSSFontFace): Use references instead of pointers.
1301         (WebCore::CSSFontFace::loadState): Deleted. Remove old dead code.
1302         * css/CSSFontFaceSource.cpp:
1303         (WebCore::CSSFontFaceSource::setStatus): Enforce state transitions.
1304         (WebCore::CSSFontFaceSource::CSSFontFaceSource): Explicitly handle new state transitions.
1305         (WebCore::CSSFontFaceSource::fontLoaded): Update for new states.
1306         (WebCore::CSSFontFaceSource::load): Pulled out code from font().
1307         (WebCore::CSSFontFaceSource::font): Moved code into load().
1308         (WebCore::CSSFontFaceSource::isValid): Deleted.
1309         (WebCore::CSSFontFaceSource::isDecodeError): Deleted.
1310         (WebCore::CSSFontFaceSource::ensureFontData): Deleted.
1311         * css/CSSFontFaceSource.h: Much cleaner API.
1312         * css/CSSFontSelector.cpp:
1313         (WebCore::createFontFace): Migrate to references instead of pointers. This requires a little
1314         reorganization.
1315         (WebCore::registerLocalFontFacesForFamily): Update to new CSSFontFaceSource API.
1316         (WebCore::CSSFontSelector::addFontFaceRule): Ditto.
1317         (WebCore::CSSFontSelector::getFontFace): Ditto.
1318         * css/CSSSegmentedFontFace.cpp:
1319         (WebCore::CSSSegmentedFontFace::CSSSegmentedFontFace): Migrate to references instead of pointers.
1320         (WebCore::CSSSegmentedFontFace::~CSSSegmentedFontFace): Ditto.
1321         (WebCore::CSSSegmentedFontFace::fontLoaded): Remove old dead code.
1322         (WebCore::CSSSegmentedFontFace::appendFontFace): Cleanup.
1323         (WebCore::CSSSegmentedFontFace::fontRanges): Adopt to new API.
1324         (WebCore::CSSSegmentedFontFace::pruneTable): Deleted.
1325         (WebCore::CSSSegmentedFontFace::isLoading): Deleted. Old dead code.
1326         (WebCore::CSSSegmentedFontFace::checkFont): Deleted. Ditto.
1327         (WebCore::CSSSegmentedFontFace::loadFont): Deleted. Ditto.
1328         * css/CSSSegmentedFontFace.h:
1329         (WebCore::CSSSegmentedFontFace::create): Migrate to references instead of pointers.
1330         (WebCore::CSSSegmentedFontFace::fontSelector): Ditto.
1331         (WebCore::CSSSegmentedFontFace::LoadFontCallback::~LoadFontCallback): Deleted.
1332         * loader/cache/CachedFont.cpp:
1333         (WebCore::CachedFont::didAddClient): Migrate to references instead of pointers.
1334         (WebCore::CachedFont::checkNotify): Ditto.
1335         * loader/cache/CachedFontClient.h:
1336         (WebCore::CachedFontClient::fontLoaded): Ditto.
1337
1338 2016-02-09  Brady Eidson  <beidson@apple.com>
1339
1340         Modern IDB: IDBOpenDBRequests leak.
1341         https://bugs.webkit.org/show_bug.cgi?id=154032
1342
1343         Reviewed by Alex Christensen.
1344
1345         No new tests (Currently untestable).
1346
1347         * CMakeLists.txt:
1348         * WebCore.xcodeproj/project.pbxproj:
1349
1350         Add a simple Event subclass that holds a ref to an IDBRequest, to make sure that we
1351         drop the last ref to the request after its last event fires or is otherwise destroyed:
1352         * Modules/indexeddb/IDBRequestCompletionEvent.cpp: Added.
1353         (WebCore::IDBRequestCompletionEvent::IDBRequestCompletionEvent):
1354         * Modules/indexeddb/IDBRequestCompletionEvent.h: Added.
1355         (WebCore::IDBRequestCompletionEvent::create):
1356
1357         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
1358         (WebCore::IDBClient::IDBOpenDBRequest::onError): IDBRequestCompletionEvent instead of Event.
1359         (WebCore::IDBClient::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit): Ditto.
1360         (WebCore::IDBClient::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion): Ditto.
1361         (WebCore::IDBClient::IDBOpenDBRequest::onSuccess): Ditto.
1362
1363         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
1364         (WebCore::IDBClient::IDBTransaction::dispatchEvent): After setting up the request's 
1365           completion event to fire, clear the back-ref to the request.
1366
1367 2016-02-09  Commit Queue  <commit-queue@webkit.org>
1368
1369         Unreviewed, rolling out r196286.
1370         https://bugs.webkit.org/show_bug.cgi?id=154026
1371
1372         Looks like 5% iOS PLT regression (Requested by kling on
1373         #webkit).
1374
1375         Reverted changeset:
1376
1377         "[iOS] Throw away some unlinked code when navigating to a new
1378         page."
1379         https://bugs.webkit.org/show_bug.cgi?id=154014
1380         http://trac.webkit.org/changeset/196286
1381
1382 2016-02-08  Chris Dumez  <cdumez@apple.com>
1383
1384         Attribute getters should not require an explicit 'this' value for Window properties
1385         https://bugs.webkit.org/show_bug.cgi?id=153968
1386
1387         Reviewed by Darin Adler.
1388
1389         Attribute getters should not require an explicit 'this' value for
1390         Window properties. This is because the Window interface is marked
1391         as [ImplicitThis]:
1392         - http://heycam.github.io/webidl/#ImplicitThis
1393         - https://www.w3.org/Bugs/Public/show_bug.cgi?id=29421
1394
1395         This matches the behavior of Firefox and the expectations of the W3C
1396         web-platform-tests.
1397
1398         No new tests, already covered by existing tests.
1399
1400         * bindings/scripts/CodeGeneratorJS.pm:
1401         In attribute getters of an interface marked as [ImplicitThis],
1402         if 'thisValue' is undefined or null, fall back to using the
1403         global object as 'thisValue'.
1404
1405         * bindings/scripts/IDLAttributes.txt:
1406         Add support for [ImplicitThis]:
1407         http://heycam.github.io/webidl/#ImplicitThis
1408
1409         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1410         * bindings/scripts/test/JS/JSTestException.cpp:
1411         * bindings/scripts/test/JS/JSTestInterface.cpp:
1412         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
1413         * bindings/scripts/test/JS/JSTestNode.cpp:
1414         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
1415         * bindings/scripts/test/JS/JSTestObj.cpp:
1416         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1417         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1418         * bindings/scripts/test/JS/JSattribute.cpp:
1419         Rebaseline bindings tests.
1420
1421         * page/DOMWindow.idl:
1422         Mark Window as [ImplicitThis]:
1423         http://heycam.github.io/webidl/#ImplicitThis
1424
1425 2016-02-08  Nan Wang  <n_wang@apple.com>
1426
1427         AX: crash at WebCore::Range::selectNodeContents(WebCore::Node*, int&)
1428         https://bugs.webkit.org/show_bug.cgi?id=154018
1429
1430         Reviewed by Chris Fleizach.
1431
1432         Sometimes rangeForUnorderedCharacterOffsets call is accessing derefed node objects
1433         and leading to a crash. Fixed it by checking isNodeInUse before creating the CharacterOffset
1434         object.
1435
1436         Test: accessibility/text-marker/text-marker-range-stale-node-crash.html
1437
1438         * accessibility/AXObjectCache.cpp:
1439         (WebCore::AXObjectCache::visiblePositionForTextMarkerData):
1440         (WebCore::AXObjectCache::characterOffsetForTextMarkerData):
1441         (WebCore::AXObjectCache::traverseToOffsetInRange):
1442         * accessibility/AXObjectCache.h:
1443         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1444         (-[WebAccessibilityObjectWrapper rangeForTextMarkerRange:]):
1445         (characterOffsetForTextMarker):
1446         (-[WebAccessibilityObjectWrapper characterOffsetForTextMarker:]):
1447         (textMarkerForVisiblePosition):
1448
1449 2016-02-08  Andreas Kling  <akling@apple.com>
1450
1451         [iOS] Throw away some unlinked code when navigating to a new page.
1452         <https://webkit.org/b/154014>
1453
1454         Reviewed by Gavin Barraclough.
1455
1456         Extended the mechanism introduced earlier to also throw away unlinked code
1457         that's only relevant to the page that we're navigating away from.
1458
1459         The new JSC::VM API is deleteAllCodeExceptCaches() and it does what it sounds
1460         like, deleting unlinked and linked code but leaving code caches alone.
1461
1462         This means that if the page we're navigating to wants to parse some of the
1463         same JS that the page we're leaving had on it, it might still be found in the
1464         JSC::CodeCache.
1465
1466         Doing a back navigation to a PageCache'd page may now incur some reparsing,
1467         just like leaving the app or tab would.
1468
1469         * bindings/js/GCController.cpp:
1470         (WebCore::GCController::deleteAllCodeExceptCaches):
1471         (WebCore::GCController::deleteAllLinkedCode): Deleted.
1472         * bindings/js/GCController.h:
1473         * loader/FrameLoader.cpp:
1474         (WebCore::FrameLoader::commitProvisionalLoad):
1475
1476 2016-02-08  Daniel Bates  <dabates@apple.com>
1477
1478         CSP connect-src directive should block redirects
1479         https://bugs.webkit.org/show_bug.cgi?id=69359
1480         <rdar://problem/24383025>
1481
1482         Reviewed by Brent Fulgham.
1483
1484         Inspired by Blink patch:
1485         <https://src.chromium.org/viewvc/blink?revision=150246&view=revision>
1486
1487         Apply the connect-src directive of the Content Security Policy for the document or worker to the redirect URL
1488         of an XMLHttpRequest and EventSource load so as to conform to section Paths and Redirects of the CSP 2.0 spec.,
1489         <https://w3c.github.io/webappsec-csp/2/#source-list-paths-and-redirects> (29 August 2015).
1490
1491         Additionally, check that each requested script URL passed to WorkerGlobalScope.importScripts() is allowed by
1492         the CSP of the worker before initiating a load for it. If some URL i is blocked by the CSP policy
1493         then we do not try to load URLs j >= i.
1494
1495         Tests: http/tests/security/contentSecurityPolicy/worker-blob-inherits-csp-importScripts-block-aborts-all-subsequent-imports.html
1496                http/tests/security/contentSecurityPolicy/worker-blob-inherits-csp-importScripts-redirect-cross-origin-blocked.html
1497                http/tests/security/contentSecurityPolicy/worker-csp-blocks-xhr-redirect-cross-origin.html
1498                http/tests/security/contentSecurityPolicy/worker-csp-importScripts-redirect-cross-origin-allowed.html
1499                http/tests/security/contentSecurityPolicy/worker-csp-importScripts-redirect-cross-origin-blocked.html
1500                http/tests/security/contentSecurityPolicy/worker-without-csp-importScripts-redirect-cross-origin-allowed.html
1501                http/tests/security/isolatedWorld/bypass-main-world-csp-for-xhr-redirect.html
1502                http/tests/security/isolatedWorld/bypass-main-world-csp-worker-blob-importScript-redirect-cross-origin.html
1503                http/tests/security/isolatedWorld/bypass-main-world-csp-worker-importScripts-redirect-cross-origin.html
1504                http/tests/security/isolatedWorld/bypass-worker-csp-for-xhr-redirect-cross-origin.html
1505                http/tests/security/isolatedWorld/bypass-worker-csp-for-xhr.html
1506
1507         * fileapi/FileReaderLoader.cpp:
1508         (WebCore::FileReaderLoader::start): Do not enforce a CSP directive as CSP is not applicable to File API.
1509         * inspector/InspectorNetworkAgent.cpp:
1510         (WebCore::InspectorNetworkAgent::loadResource): Do not enforce a CSP directive as CSP should not interfere
1511         with the Web Inspector.
1512         * loader/DocumentThreadableLoader.cpp:
1513         (WebCore::DocumentThreadableLoader::loadResourceSynchronously): Modified to take an optional ContentSecurityPolicy
1514         and pass it through to DocumentThreadableLoader::create().
1515         (WebCore::DocumentThreadableLoader::create): Modified to take an optional ContentSecurityPolicy and pass it through
1516         to DocumentThreadableLoader::DocumentThreadableLoader().
1517         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): Modified to take an optional ContentSecurityPolicy.
1518         Asserts that the CSP allows the load of the request URL so as to catch when a caller creates a loader for a request
1519         that is not allowed by the CSP. The caller should not create a loader for such a request.
1520         (WebCore::DocumentThreadableLoader::redirectReceived): Check if the CSP allows the redirect URL. If it does not
1521         then notify the client that the redirect check failed.
1522         (WebCore::DocumentThreadableLoader::loadRequest): Ditto.
1523         (WebCore::DocumentThreadableLoader::isAllowedByContentSecurityPolicy): Checks that the specified URL is allowed
1524         by the enforced CSP directive.
1525         (WebCore::DocumentThreadableLoader::contentSecurityPolicy): Returns the ContentSecurityPolicy object passed to
1526         DocumentThreadableLoader on instantiation or the ContentSecurityPolicy object of the associated document.
1527         * loader/DocumentThreadableLoader.h: Add overloaded variants of DocumentThreadableLoader::{create, loadResourceSynchronously}()
1528         that take a std::unique_ptr<ContentSecurityPolicy>&&. Remove some unnecessary headers.
1529         * loader/ThreadableLoader.cpp:
1530         (WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions): Take the CSP directive to enforce and store it.
1531         (WebCore::ThreadableLoaderOptions::isolatedCopy): Copy the CSP directive to enforce.
1532         * loader/ThreadableLoader.h: Added member field to store the CSP directive to enforce (defaults to enforce the
1533         directive connect-src - the most appropriate directive in most circumstances). As of the time of writing,
1534         only WorkerGlobalScope.importScripts() enforces a different directive: script-src.
1535         * loader/WorkerThreadableLoader.cpp:
1536         (WebCore::WorkerThreadableLoader::WorkerThreadableLoader): Pass the SecurityOrigin and ContentSecurityPolicy associated
1537         with the WorkerGlobalScope to WorkerThreadableLoader::MainThreadBridge::MainThreadBridge().
1538         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge): Pass a copy of the worker's ContentSecurityPolicy
1539         to the DocumentThreadableLoader.
1540         * loader/WorkerThreadableLoader.h:
1541         * page/EventSource.cpp:
1542         (WebCore::EventSource::connect): Enforce the CSP directive connect-src on redirects unless we are running in an isolated world.
1543         * workers/AbstractWorker.cpp:
1544         (WebCore::AbstractWorker::resolveURL): Modified to take a boolean whether to bypass the main world Content Security Policy
1545         instead of querying for it directly.
1546         * workers/AbstractWorker.h:
1547         * workers/Worker.cpp:
1548         (WebCore::Worker::create): Added FIXME to enforce child-src directive of the document's CSP to the worker's script URL
1549         on redirect once we fix <https://bugs.webkit.org/show_bug.cgi?id=153562>. For now, do not enforce a CSP policy on redirect
1550         of the worker's script URL.
1551         * workers/WorkerGlobalScope.cpp:
1552         (WebCore::WorkerGlobalScope::importScripts): Check that the requested URL is allowed by the CSP of the worker (if applicable).
1553         Enforce the CSP directive script-src on redirects unless we are running in an isolated world.
1554         * workers/WorkerScriptLoader.cpp:
1555         (WebCore::WorkerScriptLoader::loadSynchronously): Pass SecurityOrigin and ContentSecurityPolicyEnforcement to WorkerThreadableLoader.
1556         (WebCore::WorkerScriptLoader::loadAsynchronously): Ditto.
1557         * workers/WorkerScriptLoader.h:
1558         * xml/XMLHttpRequest.cpp:
1559         (WebCore::XMLHttpRequest::createRequest): Enforce the CSP directive connect-src on redirects unless we are running in
1560         an isolated world.
1561
1562 2016-02-08  Antti Koivisto  <antti@apple.com>
1563
1564         Try to fix Yosemite build.
1565
1566         * dom/ComposedTreeIterator.h:
1567         (WebCore::ComposedTreeIterator::ComposedTreeIterator):
1568         (WebCore::ComposedTreeIterator::traverseNext):
1569
1570 2016-02-08  Antti Koivisto  <antti@apple.com>
1571
1572         Implement ComposedTreeIterator in terms of ElementAndTextDescendantIterator
1573         https://bugs.webkit.org/show_bug.cgi?id=154003
1574
1575         Reviewed by Darin Adler.
1576
1577         Currently ComposedTreeIterator implements tree traversal using NodeTraversal. This makes it overly complicated.
1578         It can also return nodes other than Element and Text which should not be part of the composed tree.
1579
1580         This patch adds a new iterator type, ElementAndTextDescendantIterator, similar to the existing ElementDescendantIterator.
1581         ComposedTreeIterator is then implemented using this new iterator.
1582
1583         When entering a shadow tree or a slot the local iterator is pushed along with the context stack and a new local
1584         iterator is initialized for the new context. When leaving a shadow tree the context stack is popped and the previous
1585         local iterator becomes active.
1586
1587         * WebCore.xcodeproj/project.pbxproj:
1588         * dom/ComposedTreeIterator.cpp:
1589         (WebCore::ComposedTreeIterator::ComposedTreeIterator):
1590         (WebCore::ComposedTreeIterator::initializeContextStack):
1591         (WebCore::ComposedTreeIterator::pushContext):
1592         (WebCore::ComposedTreeIterator::traverseNextInShadowTree):
1593         (WebCore::ComposedTreeIterator::traverseNextLeavingContext):
1594         (WebCore::ComposedTreeIterator::advanceInSlot):
1595         (WebCore::ComposedTreeIterator::traverseSiblingInSlot):
1596         (WebCore::ComposedTreeIterator::initializeShadowStack): Deleted.
1597         (WebCore::ComposedTreeIterator::traverseParentInShadowTree): Deleted.
1598         (WebCore::ComposedTreeIterator::traverseNextSiblingSlot): Deleted.
1599         (WebCore::ComposedTreeIterator::traversePreviousSiblingSlot): Deleted.
1600         * dom/ComposedTreeIterator.h:
1601         (WebCore::ComposedTreeIterator::operator*):
1602         (WebCore::ComposedTreeIterator::operator->):
1603         (WebCore::ComposedTreeIterator::operator==):
1604         (WebCore::ComposedTreeIterator::operator!=):
1605         (WebCore::ComposedTreeIterator::operator++):
1606         (WebCore::ComposedTreeIterator::Context::Context):
1607         (WebCore::ComposedTreeIterator::context):
1608         (WebCore::ComposedTreeIterator::current):
1609         (WebCore::ComposedTreeIterator::ComposedTreeIterator):
1610         (WebCore::ComposedTreeIterator::traverseNext):
1611         (WebCore::ComposedTreeIterator::traverseNextSkippingChildren):
1612         (WebCore::ComposedTreeIterator::traverseNextSibling):
1613         (WebCore::ComposedTreeIterator::traversePreviousSibling):
1614         (WebCore::ComposedTreeDescendantAdapter::ComposedTreeDescendantAdapter):
1615         (WebCore::ComposedTreeDescendantAdapter::begin):
1616         (WebCore::ComposedTreeDescendantAdapter::end):
1617         (WebCore::ComposedTreeDescendantAdapter::at):
1618         (WebCore::ComposedTreeChildAdapter::Iterator::Iterator):
1619         (WebCore::ComposedTreeChildAdapter::ComposedTreeChildAdapter):
1620         (WebCore::ComposedTreeChildAdapter::begin):
1621         (WebCore::ComposedTreeChildAdapter::end):
1622         (WebCore::ComposedTreeChildAdapter::at):
1623         (WebCore::ComposedTreeIterator::ShadowContext::ShadowContext): Deleted.
1624         (WebCore::ComposedTreeIterator::traverseParent): Deleted.
1625         * dom/ElementAndTextDescendantIterator.h: Added.
1626
1627             New iterator type that traverses Element and Text nodes (that is renderable nodes only).
1628             It also tracks depth for future use.
1629
1630 2016-02-08  Joseph Pecoraro  <pecoraro@apple.com>
1631
1632         Web Inspector: copy({x:1}) should copy "{x:1}", not "[object Object]"
1633         https://bugs.webkit.org/show_bug.cgi?id=148605
1634
1635         Reviewed by Brian Burg.
1636
1637         Test: inspector/console/command-line-api-copy.html
1638
1639         * inspector/CommandLineAPIModuleSource.js:
1640         (CommandLineAPIImpl.prototype.copy):
1641         Support copying different types. This is meant to be more
1642         convenient then just JSON.stringify, so it handles types
1643         like Node, Symbol, RegExp, and Function a bit better.
1644
1645 2016-02-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
1646
1647         REGRESSION(r181345): SVG polyline and polygon leak page
1648         https://bugs.webkit.org/show_bug.cgi?id=152759
1649
1650         Reviewed by Darin Adler.
1651
1652         The leak happens because of cyclic reference between SVGListPropertyTearOff 
1653         and SVGAnimatedListPropertyTearOff which is derived from SVGAnimatedProperty.
1654         There is also cyclic reference between SVGAnimatedProperty and SVGElement
1655         and this causes the whole document to be leaked. So if the JS requests, for
1656         example, an instance of SVGPolylineElement.points, the whole document will be
1657         leaked.
1658
1659         The fix depends on having the cyclic reference as is since the owning and the
1660         owned classes have to live together if any of them is referenced. But the owning
1661         class caches a raw 'ref-counted' pointer of the owned class. If it is requested
1662         for an instance of the owned class it returned a RefPtr<> of it. Once the owned
1663         class is not used, it can delete itself. The only thing needed here is to notify
1664         the owner class of the deletion so it cleans its caches and be able to create a
1665         new pointer if it is requested for an instance of the owned class later.
1666
1667         Revert the change of r181345 in SVGAnimatedProperty::lookupOrCreateWrapper()
1668         to break the cyclic reference between SVGElement and SVGAnimatedProperty.
1669         
1670         Also apply the same approach in SVGAnimatedListPropertyTearOff::baseVal() and
1671         animVal() to break cyclic reference between SVGListPropertyTearOff and
1672         SVGAnimatedListPropertyTearOff.
1673
1674         Test: svg/animations/smil-leak-list-property-instances.svg
1675
1676         * bindings/scripts/CodeGeneratorJS.pm:
1677         (NativeToJSValue): The SVG non-string list tear-off properties became of
1678         type RefPtr<>. So we need to use get() with the casting expressions.
1679         
1680         * svg/SVGMarkerElement.cpp:
1681         (WebCore::SVGMarkerElement::orientType):
1682         Use 'auto' type for the return of SVGAnimatedProperty::lookupWrapper().
1683
1684         * svg/SVGPathElement.cpp:
1685         (WebCore::SVGPathElement::pathByteStream):
1686         (WebCore::SVGPathElement::lookupOrCreateDWrapper):
1687         Since SVGAnimatedProperty::lookupWrappe() returns a RefPtr<> we need to 
1688         use get() for the casting expressions.
1689         
1690         (WebCore::SVGPathElement::pathSegList):
1691         (WebCore::SVGPathElement::normalizedPathSegList):
1692         (WebCore::SVGPathElement::animatedPathSegList):
1693         (WebCore::SVGPathElement::animatedNormalizedPathSegList):
1694         * svg/SVGPathElement.h:
1695         Change the return value from raw pointer to RefPtr<>.
1696
1697         * svg/SVGPathSegWithContext.h:
1698         (WebCore::SVGPathSegWithContext::animatedProperty):
1699         Change the return type to be RefPtr<> to preserve the value from being deleted.
1700         
1701         * svg/SVGPolyElement.cpp:
1702         (WebCore::SVGPolyElement::parseAttribute):
1703         Since SVGAnimatedProperty::lookupWrapper() returns a RefPtr<> we need to 
1704         use get() for the casting expressions.
1705         
1706         (WebCore::SVGPolyElement::points):
1707         (WebCore::SVGPolyElement::animatedPoints):
1708         * svg/SVGPolyElement.h:
1709         Change the return value from raw pointer to RefPtr<>.
1710         
1711         * svg/SVGViewSpec.cpp:
1712         (WebCore::SVGViewSpec::setTransformString):
1713         Since SVGAnimatedProperty::lookupWrapper() returns a RefPtr<> we need to 
1714         use get() for the casting expressions.
1715
1716         (WebCore::SVGViewSpec::transform):
1717         * svg/SVGViewSpec.h:
1718         Change the return value from raw pointer to RefPtr<>.
1719         
1720         * svg/properties/SVGAnimatedListPropertyTearOff.h:
1721         (WebCore::SVGAnimatedListPropertyTearOff::baseVal):
1722         (WebCore::SVGAnimatedListPropertyTearOff::animVal):
1723         Change the return value from raw pointer to RefPtr<> and change the cached
1724         value from RefPtr<> to raw pointer. If the property is null, it will be
1725         created, its raw pointer will be cached and the only ref-counted RefPtr<>
1726         will be returned. This will guarantee, the RefPtr<> will be deleted once
1727         it is not used anymore. 
1728         
1729         (WebCore::SVGAnimatedListPropertyTearOff::propertyWillBeDeleted):
1730         Clean the raw pointer caches m_baseVal and m_animVal upon deleting the
1731         actual pointer. This function will be called from the destructor of
1732         SVGListPropertyTearOff.
1733         
1734         (WebCore::SVGAnimatedListPropertyTearOff::findItem):
1735         (WebCore::SVGAnimatedListPropertyTearOff::removeItemFromList):
1736         We have to ensure the baseVal() is created before using it.
1737         
1738         (WebCore::SVGAnimatedListPropertyTearOff::detachListWrappers):
1739         (WebCore::SVGAnimatedListPropertyTearOff::currentAnimatedValue):
1740         (WebCore::SVGAnimatedListPropertyTearOff::animationStarted):
1741         (WebCore::SVGAnimatedListPropertyTearOff::animationEnded):
1742         (WebCore::SVGAnimatedListPropertyTearOff::synchronizeWrappersIfNeeded):
1743         (WebCore::SVGAnimatedListPropertyTearOff::animValWillChange):
1744         (WebCore::SVGAnimatedListPropertyTearOff::animValDidChange):
1745         For animation, a separate RefPtr<> 'm_animatingAnimVal' will be assigned
1746         to the animVal(). This will prevent deleting m_animVal while animation.
1747         
1748         * svg/properties/SVGAnimatedPathSegListPropertyTearOff.h:
1749         (WebCore::SVGAnimatedPathSegListPropertyTearOff::baseVal):
1750         (WebCore::SVGAnimatedPathSegListPropertyTearOff::animVal):
1751         Same as what is done in SVGAnimatedListPropertyTearOff.
1752         
1753         (WebCore::SVGAnimatedPathSegListPropertyTearOff::findItem):
1754         (WebCore::SVGAnimatedPathSegListPropertyTearOff::removeItemFromList):
1755         Same as what is done in SVGAnimatedListPropertyTearOff.
1756         
1757         * svg/properties/SVGAnimatedProperty.h:
1758         (WebCore::SVGAnimatedProperty::lookupOrCreateWrapper):
1759         Change the return value from raw reference to Ref<> and change the
1760         cached value from Ref<> to raw pointer. This reverts the change of
1761         r181345 in this function.
1762         
1763         (WebCore::SVGAnimatedProperty::lookupWrapper):
1764         Change the return value from raw pointer to RefPtr<>.
1765         
1766         * svg/properties/SVGAnimatedPropertyMacros.h:
1767         Use 'auto' type for the return of SVGAnimatedProperty::lookupWrapper().
1768         
1769         * svg/properties/SVGAnimatedTransformListPropertyTearOff.h:
1770         (WebCore::SVGAnimatedTransformListPropertyTearOff::baseVal):
1771         (WebCore::SVGAnimatedTransformListPropertyTearOff::animVal):
1772         Same as what is done in SVGAnimatedListPropertyTearOff.
1773
1774         * svg/properties/SVGListPropertyTearOff.h:
1775         (WebCore::SVGListPropertyTearOff::~SVGListPropertyTearOff):
1776         Call the SVGAnimatedListPropertyTearOff::propertyWillBeDeleted() to clean
1777         its raw pointers when the RefPtr<> deletes itself.
1778
1779 2016-02-08  Carlos Garcia Campos  <cgarcia@igalia.com>
1780
1781         [GTK] WebKitWebView should send crossing events to the WebProcess
1782         https://bugs.webkit.org/show_bug.cgi?id=153740
1783
1784         Reviewed by Michael Catanzaro.
1785
1786         Update the target element under the mouse also when only updating
1787         scrollbars, so that if the mouse enters the page when the window
1788         is not active, the scroll animator is notified that the mouse
1789         entered the scrollable area.
1790
1791         * page/EventHandler.cpp:
1792         (WebCore::EventHandler::handleMouseMoveEvent): Call
1793         updateMouseEventTargetNode() before early returning in case of
1794         only updating scrollbars.
1795
1796 2016-02-08  Jeremy Jones  <jeremyj@apple.com>
1797
1798         PiP and external playback are mutually exclusive.
1799         https://bugs.webkit.org/show_bug.cgi?id=153988
1800         rdar://problem/24108661
1801
1802         Reviewed by Eric Carlson.
1803
1804         Adding isPlayingOnSecondScreen to isPlayingOnExternalScreen allows AVKit to disable PiP
1805         when appropriate. Testing video fullscreen mode in updateDisableExternalPlayback allows us to 
1806         turn-off external playback when entering picture-in-picture.
1807
1808         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1809         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenMode):
1810         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateDisableExternalPlayback):
1811         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1812         (-[WebAVPlayerController isPlayingOnExternalScreen]):
1813         (+[WebAVPlayerController keyPathsForValuesAffectingPlayingOnExternalScreen]):
1814
1815 2016-02-08  Commit Queue  <commit-queue@webkit.org>
1816
1817         Unreviewed, rolling out r196253.
1818         https://bugs.webkit.org/show_bug.cgi?id=153990
1819
1820         Caused several crashes in GTK+ bots (Requested by KaL on
1821         #webkit).
1822
1823         Reverted changeset:
1824
1825         "[GTK] WebKitWebView should send crossing events to the
1826         WebProcess"
1827         https://bugs.webkit.org/show_bug.cgi?id=153740
1828         http://trac.webkit.org/changeset/196253
1829
1830 2016-02-08  Jeremy Jones  <jeremyj@apple.com>
1831
1832         WebAVPlayerController should implement currentTimeWithinEndTimes.
1833         https://bugs.webkit.org/show_bug.cgi?id=153983
1834         rdar://problem/22864621
1835
1836         Reviewed by Eric Carlson.
1837
1838         Implement currentTimeWithinEndTimes in terms of seekToTime and AVTiming. This is a trivial
1839         implementation becuase AVPlayer start and end times aren't used.
1840
1841         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1842         (-[WebAVPlayerController currentTimeWithinEndTimes]):
1843         (-[WebAVPlayerController setCurrentTimeWithinEndTimes:]):
1844         (+[WebAVPlayerController keyPathsForValuesAffectingCurrentTimeWithinEndTimes]):
1845
1846 2016-02-08  Carlos Garcia Campos  <cgarcia@igalia.com>
1847
1848         [GTK] WebKitWebView should send crossing events to the WebProcess
1849         https://bugs.webkit.org/show_bug.cgi?id=153740
1850
1851         Reviewed by Michael Catanzaro.
1852
1853         Update the target element under the mouse also when only updating
1854         scrollbars, so that if the mouse enters the page when the window
1855         is not active, the scroll animator is notified that the mouse
1856         entered the scrollable area.
1857
1858         * page/EventHandler.cpp:
1859         (WebCore::EventHandler::handleMouseMoveEvent): Call
1860         updateMouseEventTargetNode() before early returning in case of
1861         only updating scrollbars.
1862
1863 2016-02-08  Jeremy Jones  <jeremyj@apple.com>
1864
1865         WebVideoFullscreenInterface should handle video resizing.
1866         https://bugs.webkit.org/show_bug.cgi?id=153982
1867         rdar://problem/22031249
1868
1869         Reviewed by Eric Carlson.
1870
1871         Video fullscreen can be initiated before video dimension are available.
1872         Protect against an initial width or height of zero and observe resize events 
1873         to update once video dimensions become available or change.
1874
1875         * platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
1876         (WebVideoFullscreenModelVideoElement::updateForEventName):
1877         (WebVideoFullscreenModelVideoElement::observedEventNames):
1878         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1879         (-[WebAVPlayerLayer layoutSublayers]):
1880         (-[WebAVPlayerLayer videoRect]):
1881         (WebVideoFullscreenInterfaceAVKit::setVideoDimensions):
1882
1883 2016-02-08  Adrien Plazas  <aplazas@igalia.com>
1884
1885         Indent inline box test fails due to assertion in VisibleSelection::selectionFromContentsOfNode()
1886         https://bugs.webkit.org/show_bug.cgi?id=153824
1887
1888         Reviewed by Michael Catanzaro.
1889
1890         * editing/markup.cpp:
1891         (WebCore::highestAncestorToWrapMarkup):
1892
1893 2016-02-07  Sam Weinig  <sam@webkit.org>
1894
1895         Remove unused enum ScrollbarOverlayState.
1896
1897         Rubber-stamped by Dan Bernstein.
1898
1899         * platform/ScrollTypes.h:
1900
1901 2016-02-07  Sam Weinig  <sam@webkit.org>
1902
1903         Remove unnecessary respondsToSelector checks for methods that exist on all supported platforms
1904         https://bugs.webkit.org/show_bug.cgi?id=153970
1905
1906         Reviewed by Dan Bernstein.
1907
1908         -[NSScrollerImp mouseEnteredScroller], -[NSScrollerImp expansionTransitionProgress],
1909         -[NSScrollerImpPair contentAreaScrolledInDirection:], and -[NSScrollerImp setExpanded:]
1910         are now available on all supported OS's. No need to check for them.
1911
1912         * platform/mac/ScrollAnimatorMac.mm:
1913         (macScrollbarTheme):
1914         (-[WebScrollbarPainterDelegate scrollerImp:animateUIStateTransitionWithDuration:]):
1915         (-[WebScrollbarPainterDelegate scrollerImp:animateExpansionTransitionWithDuration:]):
1916         (WebCore::ScrollAnimatorMac::mouseEnteredScrollbar):
1917         (WebCore::ScrollAnimatorMac::mouseExitedScrollbar):
1918         (WebCore::ScrollAnimatorMac::sendContentAreaScrolled):
1919         (WebCore::ScrollAnimatorMac::sendContentAreaScrolledTimerFired):
1920         (supportsUIStateTransitionProgress): Deleted.
1921         (supportsExpansionTransitionProgress): Deleted.
1922         (supportsContentAreaScrolledInDirection): Deleted.
1923         * platform/mac/ScrollbarThemeMac.mm:
1924         (+[WebScrollbarPrefsObserver appearancePrefsChanged:]):
1925         (+[WebScrollbarPrefsObserver behaviorPrefsChanged:]):
1926         (WebCore::ScrollbarThemeMac::scrollbarThickness):
1927
1928 2016-02-07  Sam Weinig  <sam@webkit.org>
1929
1930         Use modern SPI header idiom for NSScrollerImp and NSScrollerImpPair
1931         https://bugs.webkit.org/show_bug.cgi?id=153969
1932
1933         Reviewed by Dan Bernstein.
1934
1935         * WebCore.xcodeproj/project.pbxproj:
1936         Add new file NSScrollerImpSPI.h
1937
1938         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1939         Use new include of NSScrollerImpSPI.h.
1940
1941         * platform/ScrollbarThemeComposite.h:
1942         Define ScrollbarPainter more precisely as NSScrollerImp * now that the type is available to us.
1943
1944         * platform/mac/NSScrollerImpDetails.h:
1945         Remove NSObject category based SPI usage with the modern one NSScrollerImpSPI.h
1946
1947         * platform/mac/NSScrollerImpDetails.mm:
1948         (WebCore::recommendedScrollerStyle):
1949         Simplify recommendedScrollerStyle() now that all OS's we ship on have +[NSScroller preferredScrollerStyle].
1950
1951         * platform/mac/ScrollAnimatorMac.mm:
1952         (supportsUIStateTransitionProgress):
1953         (supportsExpansionTransitionProgress):
1954         (supportsContentAreaScrolledInDirection):
1955         Stop using NSClassFromString now that we can reference the classes explicitly.
1956
1957         (-[WebScrollbarPainterControllerDelegate invalidate]):
1958         (-[WebScrollbarPainterControllerDelegate contentAreaRectForScrollerImpPair:]):
1959         (-[WebScrollbarPainterControllerDelegate inLiveResizeForScrollerImpPair:]):
1960         (-[WebScrollbarPainterControllerDelegate mouseLocationInContentAreaForScrollerImpPair:]):
1961         (-[WebScrollbarPainterControllerDelegate scrollerImpPair:convertContentPoint:toScrollerImp:]):
1962         (-[WebScrollbarPainterControllerDelegate scrollerImpPair:setContentAreaNeedsDisplayInRect:]):
1963         (-[WebScrollbarPainterControllerDelegate scrollerImpPair:updateScrollerStyleForNewRecommendedScrollerStyle:]):
1964         (-[WebScrollbarPainterDelegate layer]):
1965         (-[WebScrollbarPainterDelegate mouseLocationInScrollerForScrollerImp:]):
1966         (-[WebScrollbarPainterDelegate convertRectToLayer:]):
1967         (-[WebScrollbarPainterDelegate shouldUseLayerPerPartForScrollerImp:]):
1968         (-[WebScrollbarPainterDelegate setUpAlphaAnimation:scrollerPainter:part:animateAlphaTo:duration:]):
1969         (-[WebScrollbarPainterDelegate scrollerImp:animateKnobAlphaTo:duration:]):
1970         (-[WebScrollbarPainterDelegate scrollerImp:animateTrackAlphaTo:duration:]):
1971         (-[WebScrollbarPainterDelegate scrollerImp:animateUIStateTransitionWithDuration:]):
1972         (-[WebScrollbarPainterDelegate scrollerImp:animateExpansionTransitionWithDuration:]):
1973         (-[WebScrollbarPainterDelegate scrollerImp:overlayScrollerStateChangedTo:]):
1974         (WebCore::ScrollAnimatorMac::ScrollAnimatorMac):
1975         (WebCore::ScrollAnimatorMac::lockOverlayScrollbarStateToHidden):
1976         (WebCore::ScrollAnimatorMac::didAddVerticalScrollbar):
1977         (WebCore::ScrollAnimatorMac::didAddHorizontalScrollbar):
1978         (WebCore::ScrollAnimatorMac::updateScrollerStyle):
1979         Add proper conforming to protocols and replace ids with proper types.
1980
1981         * platform/mac/ScrollbarThemeMac.mm:
1982         (WebCore::supportsExpandedScrollbars):
1983         (WebCore::ScrollbarThemeMac::registerScrollbar):
1984         (WebCore::ScrollbarThemeMac::scrollbarThickness):
1985         (WebCore::ScrollbarThemeMac::setUpContentShadowLayer):
1986         Stop using NSClassFromString now that we can reference the classes explicitly.
1987
1988         * platform/spi/mac/NSScrollerImpSPI.h: Added.
1989
1990 2016-02-07  Zalan Bujtas  <zalan@apple.com>
1991
1992         Outline does not clip when ancestor has overflow: hidden and requires layer.
1993         https://bugs.webkit.org/show_bug.cgi?id=153901
1994
1995         Now that outline is part of visual overflow, we no longer need the special outline cliprect.
1996         PaintPhaseChildOutlines drawing will switch to foreground cliprect. It ensures proper overflow clipping
1997         at parent level. PaintPhaseSelfOutline drawing will start using the visual overflow inflated background cliprect.
1998         With this change, outline will be using the same cliprects as the other visual overflow properties (box-shadow etc). 
1999
2000         Reviewed by David Hyatt.
2001
2002         Test: fast/repaint/outline-with-overflow-hidden-ancestor.html
2003
2004         * rendering/LayerFragment.h:
2005         (WebCore::LayerFragment::setRects):
2006         (WebCore::LayerFragment::moveBy): Deleted.
2007         (WebCore::LayerFragment::intersect): Deleted.
2008         * rendering/RenderLayer.cpp:
2009         (WebCore::RenderLayer::collectFragments):
2010         (WebCore::RenderLayer::paintOutlineForFragments):
2011         (WebCore::RenderLayer::calculateClipRects):
2012         (WebCore::RenderLayer::paintForegroundForFragments): Deleted.
2013         * rendering/RenderLayer.h:
2014         * rendering/RenderTreeAsText.cpp:
2015         (WebCore::write):
2016         (WebCore::writeLayers):
2017
2018 2016-02-07  Daniel Bates  <dabates@apple.com>
2019
2020         CSP: Allow Web Workers initiated from an isolated world to bypass the main world Content Security Policy
2021         https://bugs.webkit.org/show_bug.cgi?id=153622
2022         <rdar://problem/24400023>
2023
2024         Reviewed by Gavin Barraclough.
2025
2026         Fixes an issue where Web Workers initiated from an isolated world (say, a Safari Content Script Extension)
2027         would be subject to the Content Security Policy of the page.
2028
2029         Currently code in an isolated world that does not execute in a Web Worker is exempt from the CSP of
2030         the page. However, code that runs inside a Web Worker that was initiated from an isolated world is
2031         subject to the CSP of the page. Instead, such Web Worker code should also be exempt from the CSP of
2032         the page.
2033
2034         Tests: http/tests/security/isolatedWorld/bypass-main-world-csp-worker-blob-eval.html
2035                http/tests/security/isolatedWorld/bypass-main-world-csp-worker-blob-xhr.html
2036                http/tests/security/isolatedWorld/bypass-main-world-csp-worker.html
2037
2038         * Modules/websockets/WebSocket.cpp:
2039         (WebCore::WebSocket::connect): Modified to ask the script execution context whether to bypass the
2040         main world Content Security Policy now that script execution context knows this information.
2041         * bindings/js/ScriptController.cpp:
2042         (WebCore::ScriptController::shouldBypassMainWorldContentSecurityPolicy): Deleted; moved logic from here...
2043         * bindings/js/ScriptController.h:
2044         * dom/Document.cpp:
2045         (WebCore::Document::shouldBypassMainWorldContentSecurityPolicy): ...to here.
2046         * dom/Document.h:
2047         * dom/ScriptExecutionContext.h:
2048         (WebCore::ScriptExecutionContext::shouldBypassMainWorldContentSecurityPolicy): Added; defaults to false -
2049         do not bypass the main world Content Security Policy.
2050         * page/EventSource.cpp:
2051         (WebCore::EventSource::create): Modified to ask the script execution context whether to bypass the
2052         main world Content Security Policy now that script execution context knows this information.
2053         * page/csp/ContentSecurityPolicy.cpp:
2054         (WebCore::ContentSecurityPolicy::shouldBypassMainWorldContentSecurityPolicy): Deleted.
2055         * page/csp/ContentSecurityPolicy.h:
2056         * workers/AbstractWorker.cpp:
2057         (WebCore::AbstractWorker::resolveURL): Bypass the main world Content Security Policy if applicable.
2058         Added FIXME comment to enforce the child-src directive of the document's CSP (as opposed to the script-src
2059         directive) on the worker's script URL. Also, scriptExecutionContext()->contentSecurityPolicy() should
2060         always be non-null just as we expect scriptExecutionContext()->securityOrigin() to be non-null. Assert
2061         this invariant to catch cases where a ScriptExecutionContext is not properly initialized.
2062         * workers/DedicatedWorkerGlobalScope.cpp:
2063         (WebCore::DedicatedWorkerGlobalScope::create): Modified to take boolean argument shouldBypassMainWorldContentSecurityPolicy
2064         as to whether to bypass the main world Content Security Policy and only apply the Content Security
2065         Policy headers when shouldBypassMainWorldContentSecurityPolicy is false.
2066         (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope): Pass through a boolean argument shouldBypassMainWorldContentSecurityPolicy
2067         as to whether to bypass the main world Content Security Policy.
2068         * workers/DedicatedWorkerGlobalScope.h:
2069         * workers/DedicatedWorkerThread.cpp:
2070         (WebCore::DedicatedWorkerThread::DedicatedWorkerThread): Ditto.
2071         (WebCore::DedicatedWorkerThread::createWorkerGlobalScope): Ditto.
2072         * workers/DedicatedWorkerThread.h:
2073         * workers/Worker.cpp:
2074         (WebCore::Worker::create): Store whether we should bypass the main world Content Security Policy so
2075         that we can pass it to WorkerMessagingProxy::startWorkerGlobalScope() in Worker::notifyFinished().
2076         We need to store this decision here as opposed to determining it at any later time (say, in Worker::notifyFinished())
2077         because it is dependent on the current JavaScript program stack at the time this function is invoked.
2078         (WebCore::Worker::notifyFinished): Pass whether to bypass the main world Content Security Policy.
2079         * workers/Worker.h:
2080         * workers/WorkerGlobalScope.cpp:
2081         (WebCore::WorkerGlobalScope::WorkerGlobalScope): Modified to take a boolean as to whether to bypass the
2082         main world Content Security Policy and store it in a member field. Also, always instantiate a Content
2083         Security Policy object as our current code assumes that one is always created.
2084         * workers/WorkerGlobalScope.h:
2085         * workers/WorkerGlobalScopeProxy.h:
2086         * workers/WorkerMessagingProxy.cpp:
2087         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope): Pass through a boolean argument shouldBypassMainWorldContentSecurityPolicy
2088         as to whether to bypass the main world Content Security Policy.
2089         * workers/WorkerMessagingProxy.h:
2090         * workers/WorkerThread.cpp:
2091         (WebCore::WorkerThreadStartupData::WorkerThreadStartupData): Modified to take a boolean argument as to
2092         whether to bypass the main world Content Security Policy and store it in a member field.
2093         (WebCore::WorkerThread::WorkerThread): Pass through a boolean argument shouldBypassMainWorldContentSecurityPolicy
2094         as to whether to bypass the main world Content Security Policy.
2095         (WebCore::WorkerThread::workerThread): Ditto.
2096         * workers/WorkerThread.h:
2097         * xml/XMLHttpRequest.cpp:
2098         (WebCore::XMLHttpRequest::open): Modified to ask the script execution context whether to bypass the
2099         main world Content Security Policy now that script execution context knows this information.
2100
2101 2016-02-07  Dan Bernstein  <mitz@apple.com>
2102
2103         [Cocoa] Replace __has_include guards around inclusion of Apple-internal-SDK headers with USE(APPLE_INTERNAL_SDK)
2104         https://bugs.webkit.org/show_bug.cgi?id=153963
2105
2106         Reviewed by Sam Weinig.
2107
2108         * accessibility/mac/AXObjectCacheMac.mm:
2109         * crypto/CommonCryptoUtilities.cpp:
2110         * crypto/CommonCryptoUtilities.h:
2111         * editing/mac/TextUndoInsertionMarkupMac.h:
2112         * editing/mac/TextUndoInsertionMarkupMac.mm:
2113         * platform/cocoa/TelephoneNumberDetectorCocoa.cpp:
2114         * platform/graphics/cg/ImageSourceCG.cpp:
2115         * platform/graphics/mac/PDFDocumentImageMac.mm:
2116         * platform/network/ios/NetworkStateNotifierIOS.mm:
2117         * platform/network/mac/BlobDataFileReferenceMac.mm:
2118         * platform/network/mac/ResourceHandleMac.mm:
2119         * rendering/RenderThemeMac.mm:
2120
2121 2016-02-07  Carlos Garcia Campos  <cgarcia@igalia.com>
2122
2123         REGRESSION(r195661): [GTK] Scrollbar tests crashing after overlay scrollbar groundwork
2124         https://bugs.webkit.org/show_bug.cgi?id=153695
2125
2126         Reviewed by Michael Catanzaro.
2127
2128         The problem is that ScrollAnimation objects are not destroyed by
2129         the ScrollAnimator destructor, because I forgot to add a virtual
2130         destructor for ScrollAnimation in r195661.
2131
2132         * platform/ScrollAnimation.h:
2133         (WebCore::ScrollAnimation::~ScrollAnimation):
2134
2135 2016-02-06  Chris Dumez  <cdumez@apple.com>
2136
2137         Prevent cross-origin access to window.history
2138         https://bugs.webkit.org/show_bug.cgi?id=153931
2139
2140         Reviewed by Darin Adler.
2141
2142         Prevent cross-origin access to window.history to match the specification [1]
2143         and the behavior of other browsers (tested Firefox and Chrome).
2144
2145         [1] https://html.spec.whatwg.org/multipage/browsers.html#security-window
2146
2147         No new tests, already covered by existing tests that
2148         were updated in this patch.
2149
2150         * bindings/js/JSHistoryCustom.cpp:
2151         (WebCore::JSHistory::pushState):
2152         (WebCore::JSHistory::replaceState):
2153         (WebCore::JSHistory::state): Deleted.
2154         * page/DOMWindow.idl:
2155         * page/History.idl:
2156
2157 2016-02-06  Beth Dakin  <bdakin@apple.com>
2158
2159         ScrollbarPainters needs to be deallocated on the main thread
2160         https://bugs.webkit.org/show_bug.cgi?id=153932
2161         -and corresponding-
2162         rdar://problem/24015483
2163
2164         Reviewed by Dan Bernstein.
2165
2166         Darin pointed out that this was still race-y. There was still a race 
2167         condition between the destruction of the two local variables and the
2168         destruction of the lambda on the main thread. This should fix that. 
2169         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
2170         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2171         (WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac):
2172         (WebCore::ScrollingTreeFrameScrollingNodeMac::releaseReferencesToScrollbarPaintersOnTheMainThread):
2173         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
2174
2175 2016-02-06  Darin Adler  <darin@apple.com>
2176
2177         Finish auditing call sites of upper() and lower(), eliminate many, and rename the functions
2178         https://bugs.webkit.org/show_bug.cgi?id=153905
2179
2180         Reviewed by Sam Weinig.
2181
2182         * Modules/mediasource/MediaSource.cpp:
2183         (WebCore::MediaSource::isTypeSupported): Use convertToASCIILowercase on MIME type.
2184
2185         * accessibility/AccessibilityObject.cpp:
2186         (WebCore::AccessibilityObject::selectText): Use new names for lower and upper. Also
2187         tweaked style a tiny bit and used u_toupper rather than converting an entire
2188         string to uppercase.
2189
2190         * dom/Document.cpp:
2191         (WebCore::Document::addImageElementByCaseFoldedUsemap): Renamed to reflect the use
2192         of case folding rather than lowercasing.
2193         (WebCore::Document::removeImageElementByCaseFoldedUsemap): Ditto.
2194         (WebCore::Document::imageElementByCaseFoldedUsemap): Ditto.
2195         * dom/Document.h: Ditto.
2196         * dom/DocumentOrderedMap.cpp:
2197         (WebCore::DocumentOrderedMap::getElementByCaseFoldedMapName): Ditto.
2198         (WebCore::DocumentOrderedMap::getElementByCaseFoldedUsemap): Ditto.
2199         * dom/DocumentOrderedMap.h: Ditto.
2200
2201         * dom/TreeScope.cpp:
2202         (WebCore::TreeScope::getImageMap): Removed unneeded special case for null string.
2203         Simplified logic for cases where the URL does not have a "#" character in it.
2204         Use case folding instead of lowercase.
2205
2206         * editing/cocoa/HTMLConverter.mm:
2207         (HTMLConverter::_processText): Removed unneded special case for the empty string.
2208         Use makCapitalized instead of Cocoa function for "capitalize". Use upper and lower
2209         functions by their new names.
2210
2211         * html/HTMLImageElement.cpp:
2212         (WebCore::HTMLImageElement::parseAttribute): Use case folding instead of
2213         lowerasing for the usemap attribute.
2214         (WebCore::HTMLImageElement::insertedInto): Ditto.
2215         (WebCore::HTMLImageElement::removedFrom): Ditto.
2216         (WebCore::HTMLImageElement::matchesCaseFoldedUsemap): Ditto.
2217         * html/HTMLImageElement.h: Rename since usemap is case folded now, not lowercased.
2218
2219         * html/HTMLMapElement.cpp:
2220         (WebCore::HTMLMapElement::imageElement): Use case folding instead of lowercasing
2221         for usemap.
2222         (WebCore::HTMLMapElement::parseAttribute): Ditto.
2223
2224         * platform/Language.cpp:
2225         (WebCore::canonicalLanguageIdentifier): Use convertToASCIILowercase for language code.
2226         (WebCore::indexOfBestMatchingLanguageInList): Ditto.
2227
2228         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
2229         (WebCore::HarfBuzzShaper::shapeHarfBuzzRuns): Use new name for the upper function.
2230
2231         * platform/network/HTTPParsers.cpp:
2232         (WebCore::parseContentTypeOptionsHeader): Use equalLettersIgnoringASCIICase instead
2233         of lowercasing to check for a specific header value.
2234
2235         * platform/network/MIMEHeader.cpp:
2236         (WebCore::retrieveKeyValuePairs): Use convertToASCIILowercase for MIME header name.
2237         (WebCore::MIMEHeader::parseContentTransferEncoding): Use equalLettersIgnoringASCIICase
2238         instead of lowercasing.
2239
2240         * platform/network/cf/ResourceHandleCFNet.cpp:
2241         (WebCore::allowsAnyHTTPSCertificateHosts): Make this hash ASCII case-insensitive.
2242         (WebCore::clientCertificates): Ditto.
2243         (WebCore::ResourceHandle::createCFURLConnection): Remove call to lower since the
2244         set is now ASCII case-insensitive.
2245         (WebCore::ResourceHandle::setHostAllowsAnyHTTPSCertificate): Ditto.
2246         (WebCore::ResourceHandle::setClientCertificate): Ditto.
2247
2248         * platform/network/curl/CookieJarCurl.cpp:
2249         (WebCore::getNetscapeCookieFormat): Use equalLettersIgnoringASCIICase instead of
2250         lowercasing.
2251
2252         * platform/network/curl/MultipartHandle.cpp:
2253         (WebCore::MultipartHandle::didReceiveResponse): Use convertToASCIILowercase to
2254         make a MIME type lowercase.
2255
2256         * platform/network/curl/ResourceHandleCurl.cpp:
2257         (WebCore::ResourceHandle::setHostAllowsAnyHTTPSCertificate): Removed unneeded
2258         conversion to lowercase now that the set is ASCII case-insensitive.
2259         (WebCore::ResourceHandle::setClientCertificate): Removed code that populates a map
2260         that is then never used for anything.
2261
2262         * platform/network/curl/ResourceHandleManager.cpp:
2263         (WebCore::headerCallback): Use convertToASCIILowercase for MIME type.
2264
2265         * platform/network/curl/SSLHandle.cpp: Made hash maps keyed by host names
2266         ASCII case-insensitive.
2267         (WebCore::addAllowedClientCertificate): Removed lowercasing since the map itself
2268         is now ASCII case insensitve.
2269         (WebCore::setSSLClientCertificate): Ditto. Also use auto for iterator type so we
2270         don't have to write out the map type.
2271         (WebCore::sslIgnoreHTTPSCertificate): Ditto.
2272         (WebCore::certVerifyCallback): Ditto.
2273
2274         * platform/network/soup/ResourceHandleSoup.cpp: Made hash maps keyed by host names
2275         ASCII case-insensitive.
2276         (WebCore::allowsAnyHTTPSCertificateHosts): Ditto.
2277         (WebCore::handleUnignoredTLSErrors): Ditto.
2278         (WebCore::ResourceHandle::setHostAllowsAnyHTTPSCertificate): Ditto.
2279         (WebCore::ResourceHandle::setClientCertificate): Ditto.
2280
2281         * platform/text/LocaleToScriptMappingDefault.cpp: Made hash maps keyed by script
2282         names ASCII case-insensitive. USE WTF_ARRAY_LENGTH as appropriate.
2283         (WebCore::scriptNameToCode): Use modern style to initialize the map. Removed
2284         unnecessary lowercasing of the script name before looking at the map.
2285         (WebCore::localeToScriptCodeForFontSelection): Ditto.
2286
2287         * platform/text/win/LocaleWin.cpp:
2288         (WebCore::convertLocaleNameToLCID): Made map ASCII case-insensitive and removed
2289         unneeded lowercasing.
2290
2291         * platform/win/PasteboardWin.cpp:
2292         (WebCore::clipboardTypeFromMIMEType): Use equalLettersIgnoringASCIICase instead
2293         of lowercasing.
2294
2295         * rendering/RenderText.cpp:
2296         (WebCore::applyTextTransform): Use new names for the upper and lower functions.
2297
2298         * xml/XMLHttpRequest.cpp:
2299         (WebCore::XMLHttpRequest::responseIsXML): Remove unneeded lowercasing, since
2300         DOMImplementation now has ASCII case-insensitive handling of MIME types.
2301
2302 2016-02-06  Zalan Bujtas  <zalan@apple.com>
2303
2304         Outline should contribute to visual overflow.
2305         https://bugs.webkit.org/show_bug.cgi?id=153299
2306
2307         This patch eliminates the special outline handling (RenderView::setMaximalOutlineSize).
2308         Now that outline is part of visual overflow, we don't have to inflate the layers to accomodate
2309         outline borders.
2310         This patch fixes several focusring related repaint issues. However when both the outline: auto
2311         and the descendant renderer are composited, we still don't paint properly in certain cases. -not a regression.
2312         (Also when parent renderer has overflow: hidden repaint does not take outline into account. -regression.)
2313         It changes column behavior (see TestExpectations) since outline behaves now like any other visual overflow properties.
2314
2315         Reviewed by David Hyatt.
2316
2317         Test: fast/repaint/focus-ring-repaint.html
2318               fast/repaint/focus-ring-repaint-with-negative-offset.html
2319
2320         * css/html.css: resetting to old behavior.
2321         (:focus):
2322         (input:focus, textarea:focus, isindex:focus, keygen:focus, select:focus):
2323         * rendering/InlineFlowBox.cpp:
2324         (WebCore::InlineFlowBox::addToLine):
2325         (WebCore::InlineFlowBox::addOutlineVisualOverflow):
2326         (WebCore::InlineFlowBox::computeOverflow):
2327         (WebCore::InlineFlowBox::paint): Deleted.
2328         * rendering/InlineFlowBox.h:
2329         * rendering/RenderBlock.cpp:
2330         (WebCore::RenderBlock::computeOverflow):
2331         (WebCore::RenderBlock::outlineStyleForRepaint):
2332         (WebCore::RenderBlock::paint): Deleted.
2333         * rendering/RenderBlockFlow.cpp:
2334         (WebCore::RenderBlockFlow::layoutBlock): Deleted.
2335         (WebCore::RenderBlockFlow::addFocusRingRectsForInlineChildren): Deleted.
2336         * rendering/RenderBlockLineLayout.cpp:
2337         (WebCore::RenderBlockFlow::addOverflowFromInlineChildren):
2338         * rendering/RenderBox.cpp:
2339         (WebCore::RenderBox::addVisualEffectOverflow):
2340         (WebCore::RenderBox::applyVisualEffectOverflow):
2341         (WebCore::RenderBox::clippedOverflowRectForRepaint): Deleted.
2342         * rendering/RenderBoxModelObject.h:
2343         * rendering/RenderDetailsMarker.cpp:
2344         (WebCore::RenderDetailsMarker::paint): Deleted.
2345         * rendering/RenderElement.cpp:
2346         (WebCore::RenderElement::insertChildInternal):
2347         (WebCore::RenderElement::styleDidChange):
2348         (WebCore::RenderElement::repaintAfterLayoutIfNeeded):
2349         (WebCore::RenderElement::issueRepaintForOutlineAuto):
2350         (WebCore::RenderElement::updateOutlineAutoAncestor):
2351         (WebCore::RenderElement::computeMaxOutlineSize): Deleted.
2352         (WebCore::RenderElement::styleWillChange): Deleted.
2353         * rendering/RenderElement.h:
2354         (WebCore::RenderElement::hasContinuation):
2355         * rendering/RenderInline.cpp:
2356         (WebCore::RenderInline::paintOutlineForLine): Deleted.
2357         * rendering/RenderLayer.cpp:
2358         (WebCore::RenderLayer::calculateClipRects):
2359         * rendering/RenderLineBoxList.cpp:
2360         (WebCore::RenderLineBoxList::anyLineIntersectsRect):
2361         (WebCore::RenderLineBoxList::lineIntersectsDirtyRect):
2362         (WebCore::RenderLineBoxList::paint):
2363         (WebCore::isOutlinePhase): Deleted.
2364         * rendering/RenderLineBoxList.h:
2365         * rendering/RenderListBox.cpp:
2366         (WebCore::RenderListBox::computePreferredLogicalWidths):
2367         * rendering/RenderListMarker.cpp:
2368         (WebCore::RenderListMarker::paint): Deleted.
2369         * rendering/RenderObject.cpp:
2370         (WebCore::RenderObject::propagateRepaintToParentWithOutlineAutoIfNeeded): The renderer with outline: auto is responsible for
2371         painting focusring around the descendants. If we issued repaint only on the descendant when it changes,
2372         the focusring would not refresh properly. We have to find the ancestor with outline: auto, inflate the repaint rect and
2373         issue the repaint on the ancestor if we crossed repaint container.
2374  
2375         (WebCore::RenderObject::repaintUsingContainer):
2376         (WebCore::RenderObject::adjustRectForOutlineAndShadow):
2377         (WebCore::RenderObject::setHasOutlineAutoAncestor):
2378         (WebCore::RenderObject::adjustRectWithMaximumOutline): Deleted.
2379         
2380         * rendering/RenderObject.h: We mark the descendants of outline: auto so that
2381         when a child renderer changes we can propagate the repaint to the ancestor with outline.
2382
2383         (WebCore::RenderObject::hasOutlineAutoAncestor):
2384         (WebCore::RenderObject::RenderObjectRareData::RenderObjectRareData):
2385         * rendering/RenderRegion.cpp:
2386         (WebCore::RenderRegion::overflowRectForFlowThreadPortion):
2387         * rendering/RenderReplaced.cpp:
2388         (WebCore::RenderReplaced::shouldPaint): Deleted.
2389         (WebCore::RenderReplaced::clippedOverflowRectForRepaint): Deleted.
2390         * rendering/RenderTable.cpp:
2391         (WebCore::RenderTable::paint): Deleted.
2392         * rendering/RenderTableCell.cpp:
2393         (WebCore::RenderTableCell::clippedOverflowRectForRepaint): Deleted.
2394         (WebCore::RenderTableCell::paintCollapsedBorders): Deleted.
2395         * rendering/RenderTableRow.cpp:
2396         (WebCore::RenderTableRow::layout):
2397         (WebCore::RenderTableRow::clippedOverflowRectForRepaint): Deleted.
2398         * rendering/RenderTableSection.cpp:
2399         (WebCore::RenderTableSection::layoutRows):
2400         (WebCore::RenderTableSection::computeOverflowFromCells): Deleted.
2401         (WebCore::RenderTableSection::paintObject): Deleted.
2402         * rendering/RenderTheme.h:
2403         (WebCore::RenderTheme::platformFocusRingWidth):
2404         * rendering/RenderView.cpp:
2405         (WebCore::RenderView::setMaximalOutlineSize): Deleted.
2406         * rendering/RenderView.h:
2407         * rendering/style/RenderStyle.cpp:
2408         (WebCore::RenderStyle::changeAffectsVisualOverflow):
2409         (WebCore::RenderStyle::outlineWidth):
2410         * rendering/style/RenderStyle.h:
2411
2412 2016-02-06  Andreas Kling  <akling@apple.com>
2413
2414         [iOS] Throw away linked code when navigating to a new page.
2415         <https://webkit.org/b/153851>
2416
2417         Reviewed by Gavin Barraclough.
2418
2419         When navigating to a new page, tell JSC to throw out any linked code it has lying around.
2420         Linked code is tied to a specific global object, and as we're creating a new one for the
2421         new page, none of it is useful to us here.
2422
2423         In the event that the user navigates back, the cost of relinking some code will be far
2424         lower than the memory cost of keeping all of it around.
2425
2426         This landed previously but was rolled out due to a Speedometer regression. I've made one
2427         minor but important change here: only throw away code if we're navigating away from an
2428         existing history item. Or in other words, don't throw away code for "force peeks" or any
2429         other navigations that are not traditional top-level main frame navigations.
2430
2431         * bindings/js/GCController.cpp:
2432         (WebCore::GCController::deleteAllLinkedCode):
2433         * bindings/js/GCController.h:
2434         * loader/FrameLoader.cpp:
2435         (WebCore::FrameLoader::commitProvisionalLoad):
2436
2437 2016-02-06  Konstantin Tokarev  <annulen@yandex.ru>
2438
2439         Added implementations of AXObjectCache methods for !HAVE(ACCESSIBILITY).
2440         https://bugs.webkit.org/show_bug.cgi?id=153924
2441
2442         Reviewed by Andreas Kling.
2443
2444         No new tests needed.
2445
2446         * accessibility/AXObjectCache.h:
2447         (WebCore::AXObjectCache::ariaModalNode): Added stub implementation.
2448         (WebCore::AXObjectCache::postLiveRegionChangeNotification): Ditto.
2449         (WebCore::AXObjectCache::rangeForNodeContents): Ditto.
2450         (WebCore::AXObjectCache::setIsSynchronizingSelection): Ditto.
2451         (WebCore::AXObjectCache::setTextSelectionIntent): Ditto.
2452         (WebCore::AXAttributeCacheEnabler::AXAttributeCacheEnabler): Ditto.
2453         (WebCore::AXAttributeCacheEnabler::~AXAttributeCacheEnabler): Ditto.
2454
2455 2016-02-04  Antti Koivisto  <antti@apple.com>
2456
2457         Use scope stack instead of nested TreeResolvers for shadow trees
2458         https://bugs.webkit.org/show_bug.cgi?id=153893
2459
2460         Reviewed by Andreas Kling.
2461
2462         Make TreeResolver per-document. This is a step towards iterative style resolve.
2463
2464         This is done replacing use of nested TreeResolvers with a scope stack that maintains
2465         the style resolver and the selector filter for the current tree scope.
2466
2467         * style/StyleTreeResolver.cpp:
2468         (WebCore::Style::ensurePlaceholderStyle):
2469         (WebCore::Style::TreeResolver::Scope::Scope):
2470         (WebCore::Style::TreeResolver::TreeResolver):
2471         (WebCore::Style::shouldCreateRenderer):
2472         (WebCore::Style::TreeResolver::styleForElement):
2473         (WebCore::Style::TreeResolver::createRenderTreeForShadowRoot):
2474         (WebCore::Style::TreeResolver::createRenderTreeForSlotAssignees):
2475         (WebCore::Style::TreeResolver::createRenderTreeRecursively):
2476         (WebCore::Style::TreeResolver::resolveLocally):
2477         (WebCore::Style::TreeResolver::resolveShadowTree):
2478         (WebCore::Style::TreeResolver::resolveBeforeOrAfterPseudoElement):
2479         (WebCore::Style::TreeResolver::resolveChildren):
2480         (WebCore::Style::TreeResolver::resolveSlotAssignees):
2481         (WebCore::Style::TreeResolver::resolveRecursively):
2482         (WebCore::Style::TreeResolver::resolve):
2483         (WebCore::Style::detachRenderTree):
2484         * style/StyleTreeResolver.h:
2485         (WebCore::Style::TreeResolver::scope):
2486         (WebCore::Style::TreeResolver::pushScope):
2487         (WebCore::Style::TreeResolver::pushEnclosingScope):
2488         (WebCore::Style::TreeResolver::popScope):
2489
2490 2016-02-06  Commit Queue  <commit-queue@webkit.org>
2491
2492         Unreviewed, rolling out r196104.
2493         https://bugs.webkit.org/show_bug.cgi?id=153940
2494
2495         Regressed Speedometer on iOS (Requested by kling on #webkit).
2496
2497         Reverted changeset:
2498
2499         "[iOS] Throw away linked code when navigating to a new page."
2500         https://bugs.webkit.org/show_bug.cgi?id=153851
2501         http://trac.webkit.org/changeset/196104
2502
2503 2016-02-05  Beth Dakin  <bdakin@apple.com>
2504
2505         ScrollbarPainters needs to be deallocated on the main thread
2506         https://bugs.webkit.org/show_bug.cgi?id=153932
2507         -and corresponding-
2508         rdar://problem/24015483
2509
2510         Reviewed by Geoff Garen.
2511
2512         Follow-up fix since the first one was still race-y.
2513         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2514         (WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac):
2515         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
2516
2517 2016-02-05  Beth Dakin  <bdakin@apple.com>
2518
2519         ScrollbarPainters needs to be deallocated on the main thread
2520         https://bugs.webkit.org/show_bug.cgi?id=153932
2521         -and corresponding-
2522         rdar://problem/24015483
2523
2524         Reviewed by Tim Horton.
2525
2526         Ensure the the destructor of ScrollingTreeFrameScrollingNodeMac and the 
2527         assignments done in this class are not responsible for deallocating the 
2528         ScrollbarPainter. 
2529         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2530         (WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac):
2531         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
2532
2533 2016-02-05  Chris Dumez  <cdumez@apple.com>
2534
2535         Instance property getters / setters cannot be called on another instance of the same type
2536         https://bugs.webkit.org/show_bug.cgi?id=153895
2537
2538         Reviewed by Gavin Barraclough.
2539
2540         It should be possible to call instance property getters / setters on
2541         other instances of the same type, as per the WEB IDL specification:
2542         - http://heycam.github.io/webidl/#dfn-attribute-getter
2543         - http://heycam.github.io/webidl/#dfn-attribute-setter
2544
2545         This matches the behavior of Firefox.
2546
2547         The issue without our bindings was that the getters / setters were
2548         using |slotBase| instead of |thisValue| and therefore ended up using
2549         the instance the getter was taken from instead of the actual target
2550         object.
2551
2552         Test:
2553         js/instance-property-getter-other-instance.html
2554         js/instance-property-setter-other-instance.html
2555
2556         * bindings/scripts/CodeGeneratorJS.pm:
2557         (GenerateImplementation):
2558         - Have instance getters / setters use thisValue instead of slotBase.
2559         - In the case of interfaces that have attributes on the instance for
2560           compatibility reasons, try the prototype object if |thisValue| does
2561           does have the right type, instead of using slotBase like previously.
2562           I believe this maintains the original compatibility intention while
2563           also behaving correctly when called on another instance.
2564
2565         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2566         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2567         * bindings/scripts/test/JS/JSTestException.cpp:
2568         * bindings/scripts/test/JS/JSTestInterface.cpp:
2569         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
2570         * bindings/scripts/test/JS/JSTestNode.cpp:
2571         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
2572         * bindings/scripts/test/JS/JSTestObj.cpp:
2573         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2574         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2575         * bindings/scripts/test/JS/JSattribute.cpp:
2576         Rebaseline bindings tests.
2577
2578 2016-02-05  Brady Eidson  <beidson@apple.com>
2579
2580         Modern IDB: UniqueIDBDatabase's m_databaseInfo is unsafely used from multiple threads.
2581         https://bugs.webkit.org/show_bug.cgi?id=153912
2582
2583         Reviewed by Alex Christensen.
2584
2585         No new tests (Anything testable about this patch is already covered by existing tests).
2586
2587         * Modules/indexeddb/server/IDBBackingStore.h:
2588
2589         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
2590         (WebCore::IDBServer::MemoryIDBBackingStore::infoForObjectStore):
2591         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
2592
2593         Teach the SQLiteIDBBackingStore to actually keep its m_databaseInfo up to date as it changes,
2594         and to revert it when version change transactions abort:
2595         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2596         (WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction):
2597         (WebCore::IDBServer::SQLiteIDBBackingStore::abortTransaction):
2598         (WebCore::IDBServer::SQLiteIDBBackingStore::commitTransaction):
2599         (WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
2600         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore):
2601         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
2602         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
2603         (WebCore::IDBServer::SQLiteIDBBackingStore::infoForObjectStore):
2604         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
2605
2606         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2607         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd): Use the IDBBackingStore's copy of the 
2608           IDBObjectStoreInfo, meant only for the database thread, instead of the UniqueIDBDatabase's copy, 
2609           which is meant only for the main thread.
2610
2611 2016-02-05  Alex Christensen  <achristensen@webkit.org>
2612
2613         Clean up Blob code
2614         https://bugs.webkit.org/show_bug.cgi?id=153910
2615
2616         Reviewed by Alexey Proskuryakov.
2617
2618         No new tests, no change in behavior.
2619
2620         * css/StyleSheet.h:
2621         * fileapi/Blob.cpp:
2622         (WebCore::Blob::Blob):
2623         (WebCore::Blob::normalizedContentType):
2624         (WebCore::Blob::isNormalizedContentType):
2625         (WebCore::Blob::registry):
2626         * fileapi/Blob.h:
2627         * fileapi/BlobURL.cpp:
2628         (WebCore::BlobURL::createPublicURL):
2629         * fileapi/BlobURL.h:
2630         (WebCore::BlobURL::BlobURL):
2631         (WebCore::BlobURL::blobProtocol): Deleted.
2632         * platform/PlatformStrategies.cpp:
2633         (WebCore::setPlatformStrategies):
2634         (WebCore::hasPlatformStrategies): Deleted.
2635         * platform/PlatformStrategies.h:
2636         * platform/network/BlobRegistry.cpp:
2637         (WebCore::blobRegistry):
2638         * platform/network/BlobRegistry.h:
2639         * platform/network/BlobRegistryImpl.cpp:
2640         (WebCore::BlobRegistryImpl::~BlobRegistryImpl):
2641         (WebCore::createResourceHandle):
2642         (WebCore::registerBlobResourceHandleConstructor):
2643         (WebCore::BlobRegistryImpl::createResourceHandle):
2644         (WebCore::BlobRegistryImpl::appendStorageItems):
2645         (WebCore::BlobRegistryImpl::registerFileBlobURL):
2646         (WebCore::BlobRegistryImpl::registerBlobURL):
2647         * platform/network/BlobRegistryImpl.h:
2648         * platform/network/BlobResourceHandle.cpp:
2649         (WebCore::BlobResourceHandle::loadResourceSynchronously):
2650         (WebCore::BlobResourceHandle::BlobResourceHandle):
2651         * platform/network/ResourceHandle.h:
2652
2653 2016-02-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2654
2655         [GTK] Scrollbars incorrectly rendered with older versions of GTK+
2656         https://bugs.webkit.org/show_bug.cgi?id=153861
2657
2658         Reviewed by Michael Catanzaro.
2659
2660         The theme doesn't really know it's a scrollbar. Older versions of
2661         GTK+ require to explicitly add the scrollbar style class to the
2662         child GtkStyleContext.
2663
2664         * platform/gtk/ScrollbarThemeGtk.cpp:
2665         (WebCore::createChildStyleContext):
2666
2667 2016-02-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2668
2669         [GTK] Scrollbars not correctly rendered in non GNOME environments
2670         https://bugs.webkit.org/show_bug.cgi?id=153860
2671
2672         Reviewed by Michael Catanzaro.
2673
2674         I noticed this in a matchbox environment, where there's no
2675         gnome-setting-daemon running. The problem is only with the
2676         scrollbars, because we initialize the GtkSettings in
2677         RenderThemeGtk and notify the ScrollbarTheme when it changes, but
2678         ScrollbarTheme is created before RenderThemeGtk so we initialize
2679         the theme properties before the GtkSettings have been
2680         initialized. We can just let the ScrollbarTheme monitor the
2681         theme itself instead of relying on being notified by the WebCore
2682         layer.
2683
2684         * platform/gtk/ScrollbarThemeGtk.cpp:
2685         (WebCore::themeChangedCallback):
2686         (WebCore::ScrollbarThemeGtk::ScrollbarThemeGtk):
2687         * rendering/RenderThemeGtk.cpp:
2688         (WebCore::gtkStyleChangedCallback): Deleted.
2689
2690 2016-02-05  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2691
2692         Remove DOMWrapped parameter from JSKeyValueIterator
2693         https://bugs.webkit.org/show_bug.cgi?id=153859
2694
2695         Reviewed by Sam Weinig.
2696
2697         No change in behavior.
2698
2699         Using std::declval to infer DOMWrapped from JSWrapper::wrapped.
2700
2701         * bindings/js/JSFetchHeadersCustom.cpp:
2702         (WebCore::JSFetchHeaders::entries):
2703         (WebCore::JSFetchHeaders::keys):
2704         (WebCore::JSFetchHeaders::values):
2705         * bindings/js/JSKeyValueIterator.h:
2706         (WebCore::createIterator):
2707         (WebCore::JSKeyValueIterator<JSWrapper>::destroy):
2708         (WebCore::JSKeyValueIterator<JSWrapper>::next):
2709         (WebCore::JSKeyValueIteratorPrototypeFunctionNext):
2710         (WebCore::JSKeyValueIteratorPrototype<JSWrapper>::finishCreation):
2711
2712 2016-02-05  Nan Wang  <n_wang@apple.com>
2713
2714         AX: WebKit hanging when VoiceOver attempts to focus in on page
2715         https://bugs.webkit.org/show_bug.cgi?id=153899
2716         <rdar://problem/24506603>
2717
2718         Reviewed by Chris Fleizach.
2719
2720         The VisiblePosition to CharacterOffset conversion will lead to an infinite loop if the
2721         nextVisiblePostion call is returning the original VisiblePosition. Fixed it by breaking out
2722         of the loop early in that situation. 
2723
2724         Test: accessibility/text-marker/character-offset-visible-position-conversion-hang.html
2725
2726         * accessibility/AXObjectCache.cpp:
2727         (WebCore::AXObjectCache::characterOffsetFromVisiblePosition):
2728
2729 2016-02-04  Joseph Pecoraro  <pecoraro@apple.com>
2730
2731         Web Inspector: InspectorTimelineAgent doesn't need to recompile functions because it now uses the sampling profiler
2732         https://bugs.webkit.org/show_bug.cgi?id=153500
2733         <rdar://problem/24352458>
2734
2735         Reviewed by Timothy Hatcher.
2736
2737         * bindings/js/JSDOMWindowBase.cpp:
2738         (WebCore::JSDOMWindowBase::supportsLegacyProfiling):
2739         (WebCore::JSDOMWindowBase::supportsRichSourceInfo):
2740         (WebCore::JSDOMWindowBase::supportsProfiling): Deleted.
2741         * bindings/js/JSDOMWindowBase.h:
2742         * bindings/js/JSWorkerGlobalScopeBase.cpp:
2743         (WebCore::JSWorkerGlobalScopeBase::supportsLegacyProfiling):
2744         (WebCore::JSWorkerGlobalScopeBase::supportsProfiling): Deleted.
2745         * bindings/js/JSWorkerGlobalScopeBase.h:
2746         * inspector/InspectorController.h:
2747         * inspector/InspectorController.cpp:
2748         (WebCore::InspectorController::legacyProfilerEnabled):
2749         (WebCore::InspectorController::setLegacyProfilerEnabled):
2750         Be more explicit about enabling legacy profiling.
2751
2752         * inspector/InspectorTimelineAgent.cpp:
2753         (WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
2754         (WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend): Deleted.
2755         TimelineAgent doesn't need to recompile if using the sampling profiler.
2756         This breaks console.profile, but console.profile should move to using
2757         the sampling profiler as well.
2758
2759         (WebCore::InspectorTimelineAgent::startFromConsole):
2760         (WebCore::InspectorTimelineAgent::stopFromConsole):
2761         (WebCore::startProfiling): Deleted.
2762         (WebCore::stopProfiling): Deleted.
2763         Inlined the use once static functions.
2764
2765         * page/PageConsoleClient.cpp:
2766         (WebCore::PageConsoleClient::profile):
2767         (WebCore::PageConsoleClient::profileEnd):
2768         Added FIXMEs for improving console.profile and profileEnd.
2769
2770         * testing/Internals.cpp:
2771         (WebCore::Internals::resetToConsistentState):
2772         (WebCore::Internals::setLegacyJavaScriptProfilingEnabled):
2773         (WebCore::Internals::setJavaScriptProfilingEnabled): Deleted.
2774         * testing/Internals.h:
2775         * testing/Internals.idl:
2776         Be more explicit about enabling legacy profiling.
2777
2778 2016-02-04  Brent Fulgham  <bfulgham@apple.com>
2779
2780         Follow-up: Add "WebKit built-in PDF" Plugin to set of publicly visible plugins
2781         https://bugs.webkit.org/show_bug.cgi?id=153657
2782         <rdar://problem/24413107>
2783
2784         Reviewed by Darin Adler.
2785
2786         * plugins/PluginData.cpp:
2787         (WebCore::shouldBePubliclyVisible): Revise comments to provide a
2788         better explanation of the function and why it exists.
2789
2790 2016-02-04  Jonathan Davis  <jond@apple.com>
2791
2792         Add Fetch API and CSS Variables to feature status
2793         https://bugs.webkit.org/show_bug.cgi?id=153896
2794
2795         Reviewed by Timothy Hatcher.
2796
2797         * features.json:
2798
2799 2016-02-04  Daniel Bates  <dabates@apple.com>
2800
2801         WebKit for iOS Simulator fails to build with public iOS SDK
2802         https://bugs.webkit.org/show_bug.cgi?id=153881
2803
2804         Reviewed by Alex Christensen.
2805
2806         Make constants have internal linkage to match the Apple Internal SDK.
2807
2808         * platform/spi/ios/MobileGestaltSPI.h:
2809
2810 2016-02-04  Chris Dumez  <cdumez@apple.com>
2811
2812         Object.getOwnPropertyDescriptor() returns incomplete descriptor for instance properties
2813         https://bugs.webkit.org/show_bug.cgi?id=153817
2814
2815         Reviewed by Geoffrey Garen.
2816
2817         Update the bindings generator so that property getters / setters now
2818         make sure |this| has the right type and throw a TypeError if it does
2819         not, as per:
2820         - http://heycam.github.io/webidl/#dfn-attribute-getter (step 2.4.2)
2821         - http://heycam.github.io/webidl/#dfn-attribute-setter (step 3.5)
2822
2823         This was an issue when doing something like:
2824         Object.getOwnPropertyDescriptor(window, "location").get.call(nonWindow)
2825
2826         We would call toJSDOMWindow(thisValue), which would return null as
2827         thisValue is not a JSDOMWindow. We would then dereference this null
2828         pointer and crash. We now do a null check and throw a TypeError in
2829         this case, as per the Web IDL specification.
2830
2831         The generated bindings still have some non-spec compliant behavior
2832         though:
2833         1. The getters / setters of instance properties use slotBase instead
2834            of thisValue, which means that calling instanceA's getter on
2835            instanceB returns instanceA's property insteas of instanceB's.
2836         2. Global object property getters should not require an explicit
2837            |this| so calling the following should work:
2838            - Object.getOwnPropertyDescriptor(window, "location").get.call()
2839            We currently throw in this case.
2840
2841         These issues will be addressed in follow-up patches.
2842
2843         Tests: js/getOwnPropertyDescriptor-unforgeable-attributes.html
2844                js/getOwnPropertyDescriptor-window-attributes.html
2845                js/instance-property-getter-other-instance.html
2846
2847         * bindings/scripts/CodeGeneratorJS.pm:
2848         (GenerateImplementation):
2849         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2850         (WebCore::jsTestActiveDOMObjectExcitingAttr):
2851         * bindings/scripts/test/JS/JSTestException.cpp:
2852         (WebCore::jsTestExceptionName):
2853         * bindings/scripts/test/JS/JSTestObj.cpp:
2854         (WebCore::jsTestObjConstructorTestSubObj):
2855         (WebCore::jsTestObjTestSubObjEnabledBySettingConstructor):
2856         (WebCore::jsTestObjConditionalAttr4Constructor):
2857         (WebCore::jsTestObjConditionalAttr5Constructor):
2858         (WebCore::jsTestObjConditionalAttr6Constructor):
2859         (WebCore::jsTestObjContentDocument):
2860         (WebCore::setJSTestObjTestSubObjEnabledBySettingConstructor):
2861         (WebCore::setJSTestObjConditionalAttr4Constructor):
2862         (WebCore::setJSTestObjConditionalAttr5Constructor):
2863         (WebCore::setJSTestObjConditionalAttr6Constructor):
2864         (WebCore::setJSTestObjConstructor): Deleted.
2865         (WebCore::setJSTestObjConstructorStaticStringAttr): Deleted.
2866         (WebCore::setJSTestObjConditionalAttr3): Deleted.
2867         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2868         (WebCore::jsTestTypedefsConstructorTestSubObj):
2869
2870 2016-02-04  Brady Eidson  <beidson@apple.com>
2871
2872         Modern IDB: LayoutTest imported/w3c/indexeddb/keyorder-private.html is flaky.
2873         https://bugs.webkit.org/show_bug.cgi?id=153438.
2874
2875         Reviewed by Alex Christensen.
2876
2877         Tests: storage/indexeddb/modern/idbkey-array-equality-private.html
2878                storage/indexeddb/modern/idbkey-array-equality.html
2879
2880         * Modules/indexeddb/IDBKeyData.cpp:
2881         (WebCore::IDBKeyData::loggingString):
2882         (WebCore::IDBKeyData::operator==): Fix obvious bug.
2883
2884 2016-02-04  Chris Dumez  <cdumez@apple.com>
2885
2886         Unreviewed, fix the EFL clean build after r196123
2887         https://bugs.webkit.org/show_bug.cgi?id=153875
2888
2889         * CMakeLists.txt:
2890         * PlatformGTK.cmake:
2891         * PlatformMac.cmake:
2892         * html/DOMSettableTokenList.h:
2893         * html/DOMSettableTokenList.idl:
2894
2895 2016-02-04  Eric Carlson  <eric.carlson@apple.com>
2896
2897         PageGroup::captionPreferences should return a reference
2898         https://bugs.webkit.org/show_bug.cgi?id=153877
2899         <rdar://problem/24506917>
2900
2901         Reviewed by Jer Noble.
2902
2903         No new tests, no functional change.
2904
2905         * Modules/mediacontrols/MediaControlsHost.cpp:
2906         (WebCore::MediaControlsHost::sortedTrackListForMenu):
2907         (WebCore::MediaControlsHost::displayNameForTrack):
2908         (WebCore::MediaControlsHost::captionMenuOffItem):
2909         (WebCore::MediaControlsHost::captionDisplayMode):
2910         * dom/Document.cpp:
2911         (WebCore::Document::registerForCaptionPreferencesChangedCallbacks):
2912         * html/HTMLMediaElement.cpp:
2913         (WebCore::HTMLMediaElement::HTMLMediaElement):
2914         (WebCore::HTMLMediaElement::addTextTrack):
2915         (WebCore::HTMLMediaElement::configureTextTrackGroup):
2916         (WebCore::HTMLMediaElement::setSelectedTextTrack):
2917         (WebCore::HTMLMediaElement::configureTextTracks):
2918         (WebCore::HTMLMediaElement::captionPreferencesChanged):
2919         (WebCore::HTMLMediaElement::mediaPlayerPreferredAudioCharacteristics):
2920         * html/shadow/MediaControlElements.cpp:
2921         (WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay):
2922         (WebCore::MediaControlClosedCaptionsTrackListElement::rebuildTrackListMenu):
2923         (WebCore::MediaControlTextTrackContainerElement::updateActiveCuesFontSize):
2924         * page/PageGroup.cpp:
2925         (WebCore::PageGroup::captionPreferencesChanged):
2926         (WebCore::PageGroup::captionPreferences):
2927         * page/PageGroup.h:
2928         * platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
2929         (WebVideoFullscreenModelVideoElement::updateLegibleOptions):
2930         * testing/InternalSettings.cpp:
2931         (WebCore::InternalSettings::setShouldDisplayTrackKind):
2932         (WebCore::InternalSettings::shouldDisplayTrackKind):
2933         * testing/Internals.cpp:
2934         (WebCore::Internals::resetToConsistentState):
2935         (WebCore::Internals::Internals):
2936         (WebCore::Internals::userPreferredAudioCharacteristics):
2937         (WebCore::Internals::setUserPreferredAudioCharacteristic):
2938         (WebCore::Internals::captionsStyleSheetOverride):
2939         (WebCore::Internals::setCaptionsStyleSheetOverride):
2940         (WebCore::Internals::setPrimaryAudioTrackLanguageOverride):
2941         (WebCore::Internals::setCaptionDisplayMode):
2942
2943 2016-02-04  Konstantin Tokarev  <annulen@yandex.ru>
2944
2945         Removed unused Settings::setPrivateBrowsingEnabled.
2946         https://bugs.webkit.org/show_bug.cgi?id=153869
2947
2948         Reviewed by Alexey Proskuryakov.
2949
2950         Implementation of Settings::setPrivateBrowsingEnabled was removed
2951         in r166661, but declaration is still here.
2952
2953         No new tests needed.
2954
2955         * page/Settings.h:
2956         (WebCore::Settings::setPrivateBrowsingEnabled): Deleted.
2957
2958 2016-02-04  Eric Carlson  <eric.carlson@apple.com>
2959
2960         Don't discard in-band cues with negative start times
2961         https://bugs.webkit.org/show_bug.cgi?id=153867
2962         <rdar://problem/19588632>
2963
2964         Reviewed by Jer Noble.
2965
2966         No new tests, updated and un-skipped http/tests/media/track-in-band-hls-metadata.html.
2967
2968         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp:
2969         (WebCore::InbandMetadataTextTrackPrivateAVF::addDataCue):  ASSERT if passed negative time value.
2970         (WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes): Ditto. Correct logging.
2971
2972         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2973         (WebCore::MediaPlayerPrivateAVFoundationObjC::processCue): ASSERT if passed negative time value.
2974         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive): Convert negative cue times to zero.
2975         (-[WebCoreAVFMovieObserver legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:]):
2976           Ditto.
2977
2978 2016-02-04  Hyemi Shin  <hyemi.sin@samsung.com>
2979
2980         Specify an exception for createChannelMerger, createChannelSplitter and createPeriodicWave
2981         https://bugs.webkit.org/show_bug.cgi?id=150925
2982
2983         Reviewed by Darin Adler.
2984
2985         createChannelMerger and createChannelSplitter should throw INDEX_SIZE_ERR
2986         for invalid numberOfInputs value.
2987         createPeriodicWave should throw INDEX_SIZE_ERR for invalid lengths of parameters.
2988
2989         Tests: webaudio/audiochannelmerger-basic.html
2990                webaudio/audiochannelsplitter.html
2991                webaudio/periodicwave-lengths.html
2992
2993         * Modules/webaudio/AudioContext.cpp:
2994         (WebCore::AudioContext::createChannelSplitter):
2995         (WebCore::AudioContext::createChannelMerger):
2996         (WebCore::AudioContext::createPeriodicWave):
2997
2998 2016-02-04  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2999
3000         [Fetch API] Add support for iterating over Headers
3001         https://bugs.webkit.org/show_bug.cgi?id=153787
3002
3003         Reviewed by Darin Adler.
3004
3005         Relanding, updating bindings/js/JSKeyValueIterator.h for Windows bots.
3006
3007         Covered by updated tests.
3008         Introducing template class (JSKeyValueIterator) to support key-value iterators in DOM classes.
3009         Using JSKeyValueIterator to implement Headers entries(), keys() and values() as custom methods.
3010         Binding generator should be updated to generate directly these custom methods and handle iterator Symbol.
3011
3012         * CMakeLists.txt:
3013         * Modules/fetch/FetchHeaders.cpp:
3014         (WebCore::FetchHeaders::Iterator::next):
3015         (WebCore::FetchHeaders::Iterator::Iterator):
3016         * Modules/fetch/FetchHeaders.h:
3017         (WebCore::FetchHeaders::createIterator):
3018         * Modules/fetch/FetchHeaders.idl:
3019         * WebCore.xcodeproj/project.pbxproj:
3020         * bindings/js/JSBindingsAllInOne.cpp:
3021         * bindings/js/JSDOMBinding.h:
3022         (WebCore::jsPair):
3023         * bindings/js/JSFetchHeadersCustom.cpp: Added.
3024         (WebCore::JSFetchHeaders::entries):
3025         (WebCore::JSFetchHeaders::keys):
3026         (WebCore::JSFetchHeaders::values):
3027         * bindings/js/JSKeyValueIterator.h: Added.
3028         (WebCore::JSKeyValueIteratorPrototype::create):
3029         (WebCore::JSKeyValueIteratorPrototype::createStructure):
3030         (WebCore::JSKeyValueIteratorPrototype::JSKeyValueIteratorPrototype):
3031         (WebCore::createIterator):
3032         (WebCore::DOMWrapped>::destroy):
3033         (WebCore::DOMWrapped>::next):
3034         (WebCore::DOMWrapped>::finishCreation):
3035
3036 2016-02-04  Chris Dumez  <cdumez@apple.com>
3037
3038         Merge DOMTokenList and DOMSettableTokenList
3039         https://bugs.webkit.org/show_bug.cgi?id=153677
3040         <rdar://problem/24419675>
3041
3042         Reviewed by Sam Weinig.
3043
3044         Merge DOMTokenList and DOMSettableTokenList, as per a recent
3045         specification change:
3046         - https://github.com/whatwg/dom/pull/120
3047         - https://github.com/whatwg/html/issues/361
3048
3049         No new tests, already covered by existing tests.
3050
3051         * CMakeLists.txt:
3052         * DerivedSources.cpp:
3053         * WebCore.vcxproj/WebCore.vcxproj:
3054         * WebCore.vcxproj/WebCore.vcxproj.filters:
3055         * WebCore.xcodeproj/project.pbxproj:
3056         * dom/Element.idl:
3057         * dom/Node.h:
3058         * dom/NodeRareData.h:
3059         * html/AttributeDOMTokenList.h:
3060         * html/DOMSettableTokenList.cpp: Removed.
3061         * html/DOMSettableTokenList.h:
3062         * html/DOMSettableTokenList.idl:
3063         * html/DOMTokenList.cpp:
3064         (WebCore::DOMTokenList::setValue):
3065         * html/DOMTokenList.h:
3066         * html/DOMTokenList.idl:
3067         * html/HTMLAnchorElement.idl:
3068         * html/HTMLAreaElement.idl:
3069         * html/HTMLElement.cpp:
3070         * html/HTMLElement.idl:
3071         * html/HTMLIFrameElement.cpp:
3072         (WebCore::HTMLIFrameElement::sandbox):
3073         * html/HTMLIFrameElement.h:
3074         * html/HTMLIFrameElement.idl:
3075         * html/HTMLLinkElement.cpp:
3076         (WebCore::HTMLLinkElement::sizes):
3077         * html/HTMLLinkElement.h:
3078         * html/HTMLLinkElement.idl:
3079         * html/HTMLOutputElement.cpp:
3080         (WebCore::HTMLOutputElement::htmlFor):
3081         * html/HTMLOutputElement.h:
3082         * html/HTMLOutputElement.idl:
3083         * html/HTMLTableCellElement.idl:
3084         * page/DOMWindow.cpp:
3085         * page/DOMWindow.idl:
3086
3087 2016-02-04  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3088
3089         Unreviewed.
3090         Reverting r196115 and r19116, related tohttps://bugs.webkit.org/show_bug.cgi?id=153787.
3091
3092 2016-02-04  Alejandro G. Castro  <alex@igalia.com>
3093
3094         [GTK] Implement mediastream mediaplayer
3095         https://bugs.webkit.org/show_bug.cgi?id=153541
3096
3097         Reviewed by Martin Robinson.
3098
3099         Added the implementation of the mediaplayer for the
3100         mediastream. The code was implemented by Philippe Normand and
3101         Alessandro Decina.
3102
3103         * PlatformGTK.cmake: Added the file to the compilation.
3104         * html/HTMLMediaElement.cpp:
3105         (WebCore::HTMLMediaElement::setSrcObject): Set the src of the
3106         media element to the mediastream.
3107         * platform/graphics/MediaPlayer.cpp:
3108         (WebCore::buildMediaEnginesVector): Register the mediastream
3109         mediaplayer as an option in the media engines vector.
3110         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp: Added.
3111         (WebCore::MediaPlayerPrivateGStreamerOwr::MediaPlayerPrivateGStreamerOwr):
3112         (WebCore::MediaPlayerPrivateGStreamerOwr::~MediaPlayerPrivateGStreamerOwr):
3113         (WebCore::MediaPlayerPrivateGStreamerOwr::play):
3114         (WebCore::MediaPlayerPrivateGStreamerOwr::pause):
3115         (WebCore::MediaPlayerPrivateGStreamerOwr::hasVideo):
3116         (WebCore::MediaPlayerPrivateGStreamerOwr::hasAudio):
3117         (WebCore::MediaPlayerPrivateGStreamerOwr::currentTime):
3118         (WebCore::MediaPlayerPrivateGStreamerOwr::load):
3119         (WebCore::MediaPlayerPrivateGStreamerOwr::loadingFailed):
3120         (WebCore::MediaPlayerPrivateGStreamerOwr::didLoadingProgress):
3121         (WebCore::MediaPlayerPrivateGStreamerOwr::internalLoad):
3122         (WebCore::MediaPlayerPrivateGStreamerOwr::stop):
3123         (WebCore::MediaPlayerPrivateGStreamerOwr::registerMediaEngine):
3124         (WebCore::MediaPlayerPrivateGStreamerOwr::getSupportedTypes):
3125         (WebCore::MediaPlayerPrivateGStreamerOwr::supportsType):
3126         (WebCore::MediaPlayerPrivateGStreamerOwr::isAvailable):
3127         (WebCore::MediaPlayerPrivateGStreamerOwr::createGSTAudioSinkBin):
3128         (WebCore::MediaPlayerPrivateGStreamerOwr::sourceStopped):
3129         (WebCore::MediaPlayerPrivateGStreamerOwr::sourceMutedChanged):
3130         (WebCore::MediaPlayerPrivateGStreamerOwr::sourceSettingsChanged):
3131         (WebCore::MediaPlayerPrivateGStreamerOwr::preventSourceFromStopping):
3132         (WebCore::MediaPlayerPrivateGStreamerOwr::createVideoSink):
3133         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h: Added.
3134         (WebCore::MediaPlayerPrivateGStreamerOwr::engineDescription):
3135         (WebCore::MediaPlayerPrivateGStreamerOwr::load):
3136         (WebCore::MediaPlayerPrivateGStreamerOwr::cancelLoad):
3137         (WebCore::MediaPlayerPrivateGStreamerOwr::prepareToPlay):
3138         (WebCore::MediaPlayerPrivateGStreamerOwr::duration):
3139         (WebCore::MediaPlayerPrivateGStreamerOwr::seek):
3140         (WebCore::MediaPlayerPrivateGStreamerOwr::seeking):
3141         (WebCore::MediaPlayerPrivateGStreamerOwr::setRate):
3142         (WebCore::MediaPlayerPrivateGStreamerOwr::setPreservesPitch):
3143         (WebCore::MediaPlayerPrivateGStreamerOwr::paused):
3144         (WebCore::MediaPlayerPrivateGStreamerOwr::hasClosedCaptions):
3145         (WebCore::MediaPlayerPrivateGStreamerOwr::setClosedCaptionsVisible):
3146         (WebCore::MediaPlayerPrivateGStreamerOwr::maxTimeSeekable):
3147         (WebCore::MediaPlayerPrivateGStreamerOwr::buffered):
3148         (WebCore::MediaPlayerPrivateGStreamerOwr::totalBytes):
3149         (WebCore::MediaPlayerPrivateGStreamerOwr::bytesLoaded):
3150         (WebCore::MediaPlayerPrivateGStreamerOwr::canLoadPoster):
3151         (WebCore::MediaPlayerPrivateGStreamerOwr::setPoster):
3152         (WebCore::MediaPlayerPrivateGStreamerOwr::isLiveStream):
3153         (WebCore::MediaPlayerPrivateGStreamerOwr::audioSink):
3154
3155 2016-02-04  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3156
3157         [Fetch API] Add support for iterating over Headers
3158         https://bugs.webkit.org/show_bug.cgi?id=153787
3159
3160         Reviewed by Darin Adler.
3161
3162         Covered by updated tests.
3163         Introducing template class (JSKeyValueIterator) to support key-value iterators in DOM classes.
3164         Using JSKeyValueIterator to implement Headers entries(), keys() and values() as custom methods.
3165         Binding generator should be updated to generate directly these custom methods and handle iterator Symbol.
3166
3167         * CMakeLists.txt:
3168         * Modules/fetch/FetchHeaders.cpp:
3169         (WebCore::FetchHeaders::Iterator::next):
3170         (WebCore::FetchHeaders::Iterator::Iterator):
3171         * Modules/fetch/FetchHeaders.h:
3172         (WebCore::FetchHeaders::createIterator):
3173         * Modules/fetch/FetchHeaders.idl:
3174         * WebCore.xcodeproj/project.pbxproj:
3175         * bindings/js/JSDOMBinding.h:
3176         (WebCore::jsPair):
3177         * bindings/js/JSBindingsAllInOne.cpp:
3178         * bindings/js/JSFetchHeadersCustom.cpp: Added.
3179         (WebCore::JSFetchHeaders::entries):
3180         (WebCore::JSFetchHeaders::keys):
3181         (WebCore::JSFetchHeaders::values):
3182         * bindings/js/JSKeyValueIterator.h: Added.
3183         (WebCore::JSKeyValueIteratorPrototype::create):
3184         (WebCore::JSKeyValueIteratorPrototype::createStructure):
3185         (WebCore::JSKeyValueIteratorPrototype::JSKeyValueIteratorPrototype):
3186         (WebCore::JSKeyValueIteratorPrototypeFuncNext):
3187
3188 2016-02-03  Carlos Garcia Campos  <cgarcia@igalia.com>
3189
3190         Do not show context menu when right clicking on a scrollbar
3191         https://bugs.webkit.org/show_bug.cgi?id=153493
3192
3193         Reviewed by Michael Catanzaro.
3194
3195         Scrollbars don't currently handle right clicks, but we are showing
3196         the context menu when they are right clicked. This is not desired
3197         at least in GTK+ and I've checked that it isn't consistent with
3198         other applications in Mac either.
3199
3200         Test: fast/events/contextmenu-on-scrollbars.html
3201
3202         * page/EventHandler.cpp:
3203         (WebCore::EventHandler::sendContextMenuEvent):
3204
3205 2016-02-03  Andreas Kling  <akling@apple.com>
3206
3207         [iOS] Throw away linked code when navigating to a new page.
3208         <https://webkit.org/b/153851>
3209
3210         Reviewed by Gavin Barraclough.
3211
3212         When navigating to a new page, tell JSC to throw out any linked code it has lying around.
3213         Linked code is tied to a specific global object, and as we're creating a new one for the
3214         new page, none of it is useful to us here.
3215         In the event that the user navigates back, the cost of relinking some code will be far
3216         lower than the memory cost of keeping all of it around.
3217
3218         * bindings/js/GCController.cpp:
3219         (WebCore::GCController::deleteAllLinkedCode):
3220         * bindings/js/GCController.h:
3221         * loader/FrameLoader.cpp:
3222         (WebCore::FrameLoader::commitProvisionalLoad):
3223
3224 2016-02-03  Alex Christensen  <achristensen@webkit.org>
3225
3226         Report wasBlocked and cannotShowURL errors when using NetworkSession
3227         https://bugs.webkit.org/show_bug.cgi?id=153846
3228
3229         Reviewed by Antti Koivisto.
3230
3231         No new tests, but this fixes http/tests/xmlhttprequest/redirect-cross-origin-2.html
3232         when using NetworkSession.
3233
3234         * platform/URL.h:
3235         WEBCORE_EXPORT because we are using portAllowed in WebKit2 now.
3236
3237 2016-02-03  Jer Noble  <jer.noble@apple.com>
3238
3239         iOS build fix after Yosemite build fix broke iOS build.
3240
3241         * platform/network/cocoa/WebCoreNSURLSession.h:
3242         * platform/network/cocoa/WebCoreNSURLSession.mm:
3243
3244 2016-02-03  Beth Dakin  <bdakin@apple.com>
3245
3246         Accepted candidates should not be autocorrected
3247         https://bugs.webkit.org/show_bug.cgi?id=153813
3248         -and corresponding-
3249         rdar://problem/24066924
3250
3251         Reviewed by Darin Adler.
3252
3253         New document marker to mark inserted candidates. This was we can treat 
3254         inserted candidates just like a RejectedCorrection and we won’t accidentally 
3255         autocorrect them later on.
3256         * dom/DocumentMarker.h:
3257         (WebCore::DocumentMarker::AllMarkers::AllMarkers):
3258         * editing/AlternativeTextController.cpp:
3259         (WebCore::AlternativeTextController::processMarkersOnTextToBeReplacedByResult):
3260
3261         When handling an acceptant candidate, set m_isHandlingAcceptedCandidate to
3262         true while the text is being inserted, and then mark the range as an accepted 
3263         candidate.
3264         * editing/Editor.cpp:
3265         (WebCore::Editor::handleAcceptedCandidate):
3266         * editing/Editor.h:
3267         (WebCore::Editor::isHandlingAcceptedCandidate):
3268
3269         If frame.editor. isHandlingAcceptedCandidate() then return early from 
3270         markMisspellingsAfterTyping.
3271         * editing/TypingCommand.cpp:
3272         (WebCore::TypingCommand::markMisspellingsAfterTyping):
3273
3274         Add some test infrastructure. 
3275         * testing/Internals.cpp:
3276         (WebCore::Internals::handleAcceptedCandidate):
3277         * testing/Internals.h:
3278         * testing/Internals.idl:
3279
3280 2016-02-03  Jer Noble  <jer.noble@apple.com>
3281
3282         [Win] Pass entire request (rather than just URL) to clients of WebCoreAVCFResourceLoader
3283         https://bugs.webkit.org/show_bug.cgi?id=153653
3284
3285         Reviewed by Brent Fulgham.
3286
3287         This will allow those clients to see the byte-range request ("Range:") header and respond
3288         appropriately.
3289
3290         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
3291         (WebCore::WebCoreAVCFResourceLoader::startLoading):
3292
3293 2016-02-03  Jer Noble  <jer.noble@apple.com>
3294
3295         Yosemite build fix; hide the entire WebCoreNSURLSessionDataTask class from Yosemite and prior.
3296
3297         * platform/network/cocoa/WebCoreNSURLSession.h:
3298         * platform/network/cocoa/WebCoreNSURLSession.mm:
3299         (-[WebCoreNSURLSessionDataTask initWithSession:identifier:URL:]):
3300         (-[WebCoreNSURLSessionDataTask initWithSession:identifier:request:]):
3301
3302 2016-02-03  Jer Noble  <jer.noble@apple.com>
3303
3304         [EME][Mac] MediaKeys.createSession() fails with initData containing a contentId whose length is > 1/2 the initData.
3305         https://bugs.webkit.org/show_bug.cgi?id=153517
3306         <rdar://problem/24303782>
3307
3308         Reviewed by Eric Carlson.
3309
3310         The length of contentId is given in bytes, not Uint16 characters. Use the former when extracting
3311         the contentId string from the initData.
3312
3313         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
3314         (WebCore::MediaPlayerPrivateAVFoundation::extractKeyURIKeyIDAndCertificateFromInitData):
3315
3316 2016-02-03  Jer Noble  <jer.noble@apple.com>
3317
3318         [Mac] Wrap a resource and resource loader in a NSURLSession-like object for use by lower level frameworks
3319         https://bugs.webkit.org/show_bug.cgi?id=153669
3320
3321         Reviewed by Alex Christensen.
3322
3323         API Test: WebCore.WebCoreNSURLSession
3324
3325         Add a NSURLSession-like object, which wraps a CachedResourceLoader and CachedRawResource, which we can
3326         hand to lower-level frameworks, so that network loads by those frameworks use WebKit's loader.
3327
3328         * platform/network/cocoa/WebCoreNSURLSession.h: Added.
3329         * platform/network/cocoa/WebCoreNSURLSession.mm: Added.
3330         (-[WebCoreNSURLSession initWithResourceLoader:delegate:delegateQueue:]):
3331         (-[WebCoreNSURLSession dealloc]):
3332         (-[WebCoreNSURLSession copyWithZone:]):
3333         (-[WebCoreNSURLSession delegateQueue]):
3334         (-[WebCoreNSURLSession configuration]):
3335         (-[WebCoreNSURLSession loader]):
3336         (-[WebCoreNSURLSession finishTasksAndInvalidate]):
3337         (-[WebCoreNSURLSession invalidateAndCancel]):
3338         (-[WebCoreNSURLSession resetWithCompletionHandler:]):
3339         (-[WebCoreNSURLSession flushWithCompletionHandler:]):
3340         (-[WebCoreNSURLSession getTasksWithCompletionHandler:]):
3341         (-[WebCoreNSURLSession getAllTasksWithCompletionHandler:]):
3342         (-[WebCoreNSURLSession dataTaskWithRequest:]):
3343         (-[WebCoreNSURLSession dataTaskWithURL:]):
3344         (-[WebCoreNSURLSession uploadTaskWithRequest:fromFile:]):
3345         (-[WebCoreNSURLSession uploadTaskWithRequest:fromData:]):
3346         (-[WebCoreNSURLSession uploadTaskWithStreamedRequest:]):
3347         (-[WebCoreNSURLSession downloadTaskWithRequest:]):
3348         (-[WebCoreNSURLSession downloadTaskWithURL:]):
3349         (-[WebCoreNSURLSession downloadTaskWithResumeData:]):
3350         (-[WebCoreNSURLSession streamTaskWithHostName:port:]):
3351         (-[WebCoreNSURLSession streamTaskWithNetService:]):
3352         (-[WebCoreNSURLSession isKindOfClass:]):
3353
3354         Add a C++ class which can act as a CachedRawResourceClient, passing the results back to a WebCoreNSURLSessionDataTask:
3355
3356         (WebCore::WebCoreNSURLSessionDataTaskClient::WebCoreNSURLSessionDataTaskClient):
3357         (WebCore::WebCoreNSURLSessionDataTaskClient::dataSent):
3358         (WebCore::WebCoreNSURLSessionDataTaskClient::responseReceived):
3359         (WebCore::WebCoreNSURLSessionDataTaskClient::dataReceived):
3360         (WebCore::WebCoreNSURLSessionDataTaskClient::redirectReceived):
3361         (WebCore::WebCoreNSURLSessionDataTaskClient::notifyFinished):
3362
3363         Add a NSURLSessionDataTask-like object, which takes a request, then uses it to create and wrap a CachedRawResource.
3364         Becase NSURSessionDataTask is intended to be used off-main-thread, care must be taken to dispatch back to the main-
3365         (or web-) thread before calling CachedRawResource functions.
3366
3367         (-[WebCoreNSURLSessionDataTask initWithSession:identifier:URL:]):
3368         (-[WebCoreNSURLSessionDataTask initWithSession:identifier:request:]):
3369         (-[WebCoreNSURLSessionDataTask copyWithZone:]):
3370         (-[WebCoreNSURLSessionDataTask _restart]):
3371         (-[WebCoreNSURLSessionDataTask _cancel]):
3372         (-[WebCoreNSURLSessionDataTask _finish]):
3373         (-[WebCoreNSURLSessionDataTask _setDefersLoading:]):
3374         (-[WebCoreNSURLSessionDataTask cancel]):
3375         (-[WebCoreNSURLSessionDataTask suspend]):
3376         (-[WebCoreNSURLSessionDataTask resume]):
3377         (-[WebCoreNSURLSessionDataTask _timingData]):
3378         (-[WebCoreNSURLSessionDataTask resource:sentBytes:totalBytesToBeSent:]):
3379         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:]):
3380         (-[WebCoreNSURLSessionDataTask resource:receivedData:length:]):
3381         (-[WebCoreNSURLSessionDataTask resource:receivedRedirect:request:]):
3382         (-[WebCoreNSURLSessionDataTask resourceFinished:]):
3383         * WebCore.xcodeproj/project.pbxproj: Add new files to project.
3384
3385 2016-02-03  Darin Adler  <darin@apple.com>
3386
3387         Convert another batch of String::lower callsites to something better, typically convertToASCIILowercase
3388         https://bugs.webkit.org/show_bug.cgi?id=153789
3389
3390         Reviewed by Sam Weinig.
3391
3392         * dom/DOMImplementation.cpp:
3393         (WebCore::DOMImplementation::isXMLMIMEType): Use equalLettersIgnoringASCIICase
3394         and the boolean argument to endsWith to ignore ASCII case.
3395         (WebCore::DOMImplementation::isTextMIMEType): Ditto. Also simplified the logic
3396         by removing an if statement.
3397
3398         * dom/Document.cpp:
3399         (WebCore::isSeparator): Deleted. Moved to WindowFeatures.cpp.
3400         (WebCore::processArguments): Ditto.
3401         (WebCore::Document::processViewport): Call the processFeaturesString function
3402         from WindowFeatures.h; the code here was originally just a pasted copy of that code!
3403         (WebCore::Document::processFormatDetection): Ditto.
3404
3405         * html/HTMLCanvasElement.cpp:
3406         (WebCore::HTMLCanvasElement::toEncodingMimeType): Remove now-unneeded
3407         lowercasing of MIME type before calling isSupportedImageMIMETypeForEncoding,
3408         since the MIME type registry now ignores ASCII case. Use convertToASCIILowercase
3409         on the return value, to preserve behavior.
3410         (WebCore::HTMLCanvasElement::toDataURL): Minor coding style tweaks.
3411
3412         * html/HTMLEmbedElement.cpp:
3413         (WebCore::HTMLEmbedElement::parseAttribute): Use convertToASCIILowercase for
3414         the service type here.
3415
3416         * html/HTMLImageElement.cpp:
3417         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement): Remove now-unneeded
3418         lowercasing since MIME type registry now ignores ASCII case. And use
3419         equalLettersIgnoringASCIICase for the case here.
3420
3421         * html/HTMLInputElement.cpp:
3422         (WebCore::parseAcceptAttribute): Use convertToASCIILowercase for the type here.
3423
3424         * html/HTMLLinkElement.cpp:
3425         (WebCore::HTMLLinkElement::parseAttribute): Use convertToASCIILowercase for the
3426         media value here.
3427
3428         * html/HTMLMediaElement.cpp:
3429         (WebCore::HTMLMediaElement::canPlayType): Use convertToASCIILowercase for the
3430         content type here.
3431         (WebCore::HTMLMediaElement::selectNextSourceChild): Ditto.
3432
3433         * html/HTMLObjectElement.cpp:
3434         (WebCore::HTMLObjectElement::parseAttribute): Use convertToASCIILowercase for
3435         the service type here.
3436
3437         * html/HTMLTrackElement.cpp:
3438         (WebCore::HTMLTrackElement::parseAttribute): Use convertToASCIILowercase for
3439         the kind here.
3440         (WebCore::HTMLTrackElement::ensureTrack): Ditto. Also use fastGetAttribute
3441         since this is neither the style attribute nor an animatable SVG attribute.
3442
3443         * html/parser/HTMLTreeBuilder.cpp:
3444         (WebCore::createCaseMap): Use convertToASCIILowercase for the local names here.
3445
3446         * inspector/DOMPatchSupport.cpp:
3447         (WebCore::DOMPatchSupport::patchNode): Use containsIgnoringASCIICase instead
3448         of combining lower with find == notFound here.
3449         (WebCore::nodeName): Use convertToASCIILowercase here.
3450
3451         * inspector/InspectorOverlay.cpp:
3452         (WebCore::buildObjectForElementData): Use convertToASCIILowercase for node
3453         name here.
3454
3455         * inspector/InspectorPageAgent.cpp:
3456         (WebCore::createXHRTextDecoder): Remove a now-unneeded call to lower since
3457         DOMImplementation::isXMLMIMEType now ignores ASCII case.
3458
3459         * inspector/InspectorStyleSheet.cpp:
3460         (WebCore::lowercasePropertyName): Use convertToASCIILowercase for property
3461         names here. Also use startsWith rather than a hand-written alternative.
3462         (WebCore::InspectorStyle::populateAllProperties): Use the return value of
3463         the add function to avoid doing a double hash table lookp.
3464         (WebCore::InspectorStyle::styleWithProperties): Use convertToASCIILowercase
3465         to lowercase the property name.
3466
3467         * inspector/NetworkResourcesData.cpp:
3468         (WebCore::createOtherResourceTextDecoder): Remove unneeded call to lower since
3469         DOMImplement::isXMLMIMEType now ignores ASCII case.
3470
3471         * loader/CrossOriginAccessControl.cpp:
3472         (WebCore::createAccessControlPreflightRequest): Use convertToASCIILowercase
3473         to lowercase the access control request header field value.
3474
3475         * loader/cache/CachedScript.cpp:
3476         (WebCore::CachedScript::mimeType): Use convertToASCIILowercase on the content type.
3477
3478         * page/CaptionUserPreferencesMediaAF.cpp:
3479         (WebCore::languageIdentifier): Use convertToASCIILowercase on the language code.
3480
3481         * page/DOMWindow.cpp:
3482         (WebCore::DOMWindow::open): Call parseWindowFeatures instead of using the
3483         constructor for WindowFeatures.
3484         (WebCore::DOMWindow::showModalDialog): Call parseDialogFeatures instead of
3485         using the constructor for WindowFeatures.
3486
3487         * page/EventHandler.cpp:
3488         (WebCore::findDropZone): Remove unneeded lowercasing and empty string checking,
3489         and use the option SpaceSplitString already has to convert to lowercase.
3490         (WebCore::EventHandler::handleAccessKey): Remove unneeded call to lower since
3491         getElementByAccessKey now ignores case. Also tweaked coding style a bit.
3492
3493         * page/OriginAccessEntry.cpp:
3494         (WebCore::OriginAccessEntry::OriginAccessEntry): Use convertToASCIILowercase
3495         on the protocol and host.
3496         (WebCore::OriginAccessEntry::matchesOrigin): Ditto.
3497
3498         * page/SecurityOrigin.cpp:
3499         (WebCore::shouldTreatAsUniqueOrigin): Remove unneeded call to lower since
3500         SchemeRegistry now ignores ASCII case.
3501         (WebCore::SecurityOrigin::SecurityOrigin): Use convertToASCIILowercase on
3502         the protocol and host.
3503         (WebCore::SecurityOrigin::setDomainFromDOM): Use convertToASCIILowercase on
3504         the domain.
3505         (WebCore::SecurityOrigin::canDisplay): Remove call to lower since SchemeRegistry
3506         now ignores ASCII case and because this now uses equalIgnoringASCIICase in
3507         one place that used to use exact matching.
3508
3509         * page/WindowFeatures.cpp: Refactored so this is now some helper functions
3510         plus a struct rather than a class.
3511         (WebCore::isSeparator): Renamed this and removed special handling for NUL.
3512         (WebCore::parseWindowFeatures): Moved the code that was formerly in the
3513         WindowFeatures constructor in here. Refactored the parsing into the
3514         processFeaturesString function, shared with the functions in Document that
3515         do the same kind of parsing. Removed the code that converts the entire string
3516         to lowercase before parsing.
3517         (WebCore::processFeaturesString): Moved the improved version of this function
3518         here from Document.cpp; more efficient because it doesn't allocate strings.
3519         (WebCore::setWindowFeature): Changed to be a function private to this file
3520         with internal linkage. Use equalLettersIgnoringASCIICase so we no longer
3521         rely on converting the string to lowercase before parsing.
3522         (WebCore::parseDialogFeatures): Similar refactoring, but also changed all
3523         the default handling to use Optional<> instead of default values.
3524         (WebCore::boolFeature): Changed to use option and to ignore ASCII case.
3525         (WebCore::floatFeature): Ditto.
3526         (WebCore::parseDialogFeaturesMap): Removed the calls to lower, which are
3527         not needed any more.
3528
3529         * page/WindowFeatures.h: Added default values for all the data members,
3530         and removed all the functions from the WindowFeatures struct. Added the two
3531         functions for parsing window and dialog features. Also added the
3532         processFeaturesString function so we can share it with Document.cpp.
3533
3534         * platform/SchemeRegistry.cpp:
3535         (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsLocal): Use
3536         equalLettersIgnoringASCIICase to ignore ASCII case.
3537
3538         * platform/efl/MIMETypeRegistryEfl.cpp:
3539         (WebCore::MIMETypeRegistry::getMIMETypeForExtension): Use a modern for loop,
3540         and equalIgnoringASCIICase rather than calling lower.
3541
3542         * platform/graphics/MediaPlayer.cpp:
3543         (WebCore::MediaPlayer::load): Use convertToASCIILowercase on MIME type and
3544         key system.
3545         (WebCore::MediaPlayer::generateKeyRequest): Ditto.
3546         (WebCore::MediaPlayer::addKey): Ditto.
3547         (WebCore::MediaPlayer::cancelKeyRequest): Ditto.
3548
3549         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
3550         (WebCore::Extensions3DOpenGLCommon::Extensions3DOpenGLCommon): Use
3551         convertToASCIILowercase on vendor string.
3552
3553         * platform/gtk/MIMETypeRegistryGtk.cpp:
3554         (WebCore::MIMETypeRegistry::getMIMETypeForExtension): Use a modern for loop,
3555         and equalIgnoringASCIICase rather than calling lower.
3556
3557         * platform/mac/PasteboardMac.mm:
3558         (WebCore::cocoaTypeFromHTMLClipboardType): Use convertToASCIILowercase
3559         on the type. Also did a bit of renaming and tweaking the logic.
3560
3561 2016-02-03  Dave Hyatt  <hyatt@apple.com>
3562
3563         Implement hanging-punctuation property parsing.
3564         https://bugs.webkit.org/show_bug.cgi?id=18109.
3565
3566         Reviewed by Zalan Bujtas.
3567
3568         Added parsing test in fast/css.
3569
3570         * css/CSSComputedStyleDeclaration.cpp:
3571         (WebCore::renderEmphasisPositionFlagsToCSSValue):
3572         (WebCore::hangingPunctuationToCSSValue):
3573         (WebCore::fillRepeatToCSSValue):
3574         (WebCore::ComputedStyleExtractor::propertyValue):
3575         * css/CSSParser.cpp:
3576         (WebCore::CSSParser::parseValue):
3577         (WebCore::CSSParser::parseTextIndent):
3578         (WebCore::CSSParser::parseHangingPunctuation):
3579         (WebCore::CSSParser::parseLineBoxContain):
3580         * css/CSSParser.h:
3581         * css/CSSPrimitiveValueMappings.h:
3582         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3583         (WebCore::CSSPrimitiveValue::operator HangingPunctuation):
3584         (WebCore::CSSPrimitiveValue::operator LineBreak):
3585         * css/CSSPropertyNames.in:
3586         * css/CSSValueKeywords.in:
3587         * css/StyleBuilderConverter.h:
3588         (WebCore::StyleBuilderConverter::convertRegionBreakInside):
3589         (WebCore::StyleBuilderConverter::convertHangingPunctuation):
3590         * rendering/style/RenderStyle.cpp:
3591         (WebCore::RenderStyle::changeRequiresLayout):
3592         * rendering/style/RenderStyle.h:
3593         * rendering/style/RenderStyleConstants.h:
3594         (WebCore::operator| ):
3595         (WebCore::operator|= ):
3596         * rendering/style/StyleRareInheritedData.cpp:
3597         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
3598         (WebCore::StyleRareInheritedData::operator==):
3599         * rendering/style/StyleRareInheritedData.h:
3600
3601 2016-02-03  Jessie Berlin  <jberlin@webkit.org>
3602
3603         Build fix.
3604
3605         [NSEvent context] has always returned nil. Replace uses with nullptr.
3606
3607         * page/mac/EventHandlerMac.mm:
3608         (WebCore::EventHandler::sendFakeEventsAfterWidgetTracking):
3609
3610 2016-02-03  Carlos Garcia Campos  <cgarcia@igalia.com>
3611
3612         [GTK] Layout Test http/tests/appcache/different-https-origin-resource-main.html is failing
3613         https://bugs.webkit.org/show_bug.cgi?id=145253
3614
3615         Reviewed by Michael Catanzaro.
3616
3617         The problem is that when the load is cancelled while the
3618         connection is still being established,
3619         SoupMessage::notify::tls-errors is emitted and the handler calls
3620         ResourceHandleClient::didFail() which can delete the ResourceHandle.
3621
3622         * platform/network/soup/ResourceHandleSoup.cpp:
3623         (WebCore::tlsErrorsChangedCallback): Protect the ResourceHandle
3624         for the scope of the callback because
3625         ResourceHandleClient::didFail() could delete the object.
3626
3627 2016-02-03  Carlos Garcia Campos  <cgarcia@igalia.com>
3628
3629         REGRESSION(r191948): [GStreamer] 4 new timeouts on layout tests.
3630         https://bugs.webkit.org/show_bug.cgi?id=152797
3631
3632         Reviewed by Darin Adler.
3633
3634         Always schedule messages to the main thread, even when the bus
3635         sync handlder was called in the main thread. It seems that
3636         GStreamer expects things to happen in the next main loop
3637         iteration.
3638
3639         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3640         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
3641
3642 2016-02-03  Zan Dobersek  <zdobersek@igalia.com>
3643
3644         [TexMap] CompositingCoordinator should store the overlay layer, flush it as appropriate
3645         https://bugs.webkit.org/show_bug.cgi?id=152058
3646
3647         Reviewed by Michael Catanzaro.
3648
3649         Previously, the CompositingCoordinator only added the overlay layer to the
3650         layer tree, but flushing its compositing state is also required. For that to
3651         happen, CompositingCoordinator has to store a pointer to the overlay layer
3652         object and flush it in ::flushPendingLayerChanges().
3653
3654         Overlay layers are most prominently used by the Web Inspector to highlight
3655         the DOM elements on the Web page that are being hovered in the inspector.
3656
3657         * platform/graphics/texmap/coordinated/CompositingCoordinator.cpp:
3658         (WebCore::CompositingCoordinator::CompositingCoordinator):
3659         (WebCore::CompositingCoordinator::setRootCompositingLayer):
3660         (WebCore::CompositingCoordinator::flushPendingLayerChanges):
3661         * platform/graphics/texmap/coordinated/CompositingCoordinator.h:
3662
3663 2016-02-03  Zan Dobersek  <zdobersek@igalia.com>
3664
3665         [CoordinatedGraphics] CompositingCoordinator destructor is scheduling layer flushes
3666         https://bugs.webkit.org/show_bug.cgi?id=153823
3667
3668         Reviewed by Carlos Garcia Campos.
3669
3670         Purging the backing stores during the CompositingCoordinator destructor
3671         is also scheduling layer flushes in the object's client, which is an object
3672         of the LayerTreeHost-deriving class that owns the CompositingCoordinator
3673         object in question and is also being destroyed.
3674
3675         In case of ThreadedCoordinatedLayerTreeHost, this scheduling can access
3676         the RunLoop::Timer object which has already been destroyed, causing a
3677         crash. Another problem with this is that we're invoking a virtual function
3678         on an object that's being destructed, which works well enough in this case
3679         but should be discouraged in general.
3680
3681         In order to avoid this, add the m_isDestructing boolean to the
3682         CompositingCoordinator class, flip it to true during the destruction,
3683         and check for its falseness before scheduling a layer flush.
3684
3685         * platform/graphics/texmap/coordinated/CompositingCoordinator.cpp:
3686         (WebCore::CompositingCoordinator::CompositingCoordinator):
3687         (WebCore::CompositingCoordinator::~CompositingCoordinator):
3688         (WebCore::CompositingCoordinator::notifyFlushRequired):
3689         * platform/graphics/texmap/coordinated/CompositingCoordinator.h:
3690
3691 2016-02-03  Zan Dobersek  <zdobersek@igalia.com>
3692
3693         [TexMap] Don't use RELEASE_ASSERT in TextureMapperLayer::computeTransformsRecursive()
3694         https://bugs.webkit.org/show_bug.cgi?id=153822
3695
3696         Reviewed by Carlos Garcia Campos.
3697
3698         * platform/graphics/texmap/TextureMapperLayer.cpp:
3699         (WebCore::TextureMapperLayer::computeTransformsRecursive):
3700         Use ASSERT to check that the m_children members are indeed children
3701         of the current layer, RELEASE_ASSERT probably slipped in unnoticed
3702         at some point.
3703
3704 2016-02-03  Zan Dobersek  <zdobersek@igalia.com>
3705
3706         PlatformPathCairo: Lazily allocate the path surface
3707         https://bugs.webkit.org/show_bug.cgi?id=153821
3708
3709         Reviewed by Carlos Garcia Campos.
3710
3711         Move the static variable that holds the Cairo surface into
3712         the pathSurface() function (previously getPathSurface). This
3713         way the surface will only be allocated once the function is
3714         called for the first time from the CairoPath surface.
3715
3716         No change in functionality, just a cleanup.
3717
3718         * platform/graphics/cairo/PlatformPathCairo.cpp:
3719         (WebCore::pathSurface):
3720         (WebCore::CairoPath::CairoPath):
3721         (WebCore::getPathSurface): Deleted.
3722
3723 2016-02-02  Fujii Hironori  <Hironori.Fujii@jp.sony.com>
3724
3725         ASSERTION FAILED: roundedIntPoint(rendererMappedResult) == roundedIntPoint(result)
3726         https://bugs.webkit.org/show_bug.cgi?id=153576
3727
3728         Reviewed by Darin Adler.
3729
3730         Tests: fast/block/geometry-map-assertion-with-rounding-negative-half.html
3731
3732         The results of roundedIntPoint of FloatPoint and LayoutPoint may be different
3733         because of the uniqueness of LayoutUnit::round introduced by this bug
3734         <https://bugs.webkit.org/show_bug.cgi?id=107208>.
3735         Should convert a FloatPoint to a LayoutPoint before rounding.
3736
3737         * rendering/RenderGeometryMap.cpp:
3738         (WebCore::RenderGeometryMap::mapToContainer):
3739
3740 2016-02-02  Aakash Jain  <aakash_jain@apple.com>
3741
3742         Remove references to CallFrameInlines.h
3743         https://bugs.webkit.org/show_bug.cgi?id=153810
3744
3745         Reviewed by Mark Lam.
3746
3747         * ForwardingHeaders/interpreter/CallFrameInlines.h: Removed.
3748
3749 2016-02-02  Jinyoung Hur  <hur.ims@navercorp.com>
3750
3751         WEBGL_debug_shaders should be disabled for OpenGLES backend also
3752         https://bugs.webkit.org/show_bug.cgi?id=153788
3753
3754         Reviewed by Darin Adler.
3755
3756         WEBGL_debug_shaders extension is disabled for OpenGL backed platform
3757         because the implementation is not fully compliant to the spec yet.
3758         Because this is not an OpenGL-specific problem, WEBGL_debug_shaders extension
3759         should be disabled for OpenGLES backed platforms also.
3760
3761         No new tests, already covered by existing tests.
3762
3763         * platform/graphics/opengl/Extensions3DOpenGL.cpp:
3764         (WebCore::Extensions3DOpenGL::supportsExtension): Deleted.
3765         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
3766         (WebCore::Extensions3DOpenGLCommon::supports):
3767
3768 2016-02-02  Brady Eidson  <beidson@apple.com>
3769
3770         Modern IDB: storage/indexeddb/cursor-primary-key-order.html fails with SQLite backend.
3771         https://bugs.webkit.org/show_bug.cgi?id=153800
3772
3773         Reviewed by Alex Christensen.
3774
3775         No new tests (Existing tests now unskipped).
3776
3777         The IndexRecords SQL schema did not order things by primaryKey.
3778         
3779         Easy fix to the schema. Sadly requires a migration...
3780
3781         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3782         (WebCore::IDBServer::v1IndexRecordsTableSchema):
3783         (WebCore::IDBServer::v1IndexRecordsTableSchemaAlternate):
3784         (WebCore::IDBServer::v2IndexRecordsTableSchema):
3785         (WebCore::IDBServer::v2IndexRecordsTableSchemaAlternate):
3786         (WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidIndexRecordsTable):
3787         (WebCore::IDBServer::SQLiteIDBBackingStore::createAndPopulateInitialDatabaseInfo):
3788         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
3789
3790 2016-02-02  Tim Horton  <timothy_horton@apple.com>
3791
3792         <attachment> should attempt to guess the icon from the file extension if all else fails
3793         https://bugs.webkit.org/show_bug.cgi?id=153804
3794         <rdar://problem/24448146>
3795
3796         Reviewed by Anders Carlsson.
3797
3798         Test: fast/attachment/attachment-icon-from-file-extension.html
3799
3800         * platform/graphics/Icon.h:
3801         * platform/graphics/mac/IconMac.mm:
3802         (WebCore::Icon::createIconForFileExtension):
3803         * rendering/RenderThemeMac.mm:
3804         (WebCore::iconForAttachment):
3805         If we can't find an icon any other way, try assuming that the title is a filename,
3806         grab its extension, and have NSWorkspace try to work out an icon for it.
3807
3808 2016-02-02  Antti Koivisto  <antti@apple.com>
3809
3810         Factor style sharing code out of StyleResolver
3811         https://bugs.webkit.org/show_bug.cgi?id=153768
3812
3813         Reviewed by Darin Adler.
3814
3815         Move the code to a new class, Style::SharingResolver.
3816
3817         When resolving document style we query the sharing resolver first before using the regular style resolver.
3818         Other paths that call style resolver were mostly already disabling it with DisallowStyleSharing flag.
3819
3820         * WebCore.xcodeproj/project.pbxproj:
3821         * css/ElementRuleCollector.cpp:
3822         (WebCore::MatchRequest::MatchRequest):
3823         (WebCore::ElementRuleCollector::matchAllRules):
3824         (WebCore::ElementRuleCollector::hasAnyMatchingRules):
3825
3826             More const.
3827
3828         * css/ElementRuleCollector.h:
3829         (WebCore::ElementRuleCollector::setRegionForStyling):
3830         (WebCore::ElementRuleCollector::setMedium):
3831         * css/MediaQueryMatcher.cpp:
3832         (WebCore::MediaQueryMatcher::prepareEvaluator):
3833         * css/StyleMedia.cpp:
3834         (WebCore::StyleMedia::matchMedium):
3835         * css/StyleResolver.cpp:
3836         (WebCore::StyleResolver::State::cacheBorderAndBackground):
3837         (WebCore::StyleResolver::StyleResolver):
3838         (WebCore::StyleResolver::sweepMatchedPropertiesCache):
3839         (WebCore::StyleResolver::State::State):
3840         (WebCore::StyleResolver::State::setStyle):
3841         (WebCore::isAtShadowBoundary):
3842         (WebCore::StyleResolver::styleForElement):
3843         (WebCore::StyleResolver::classNamesAffectedByRules): Deleted.
3844         (WebCore::parentElementPreventsSharing): Deleted.
3845         (WebCore::StyleResolver::locateCousinList): Deleted.
3846         (WebCore::StyleResolver::styleSharingCandidateMatchesRuleSet): Deleted.
3847         (WebCore::StyleResolver::canShareStyleWithControl): Deleted.
3848         (WebCore::elementHasDirectionAuto): Deleted.
3849         (WebCore::StyleResolver::sharingCandidateHasIdenticalStyleAffectingAttributes): Deleted.
3850         (WebCore::StyleResolver::canShareStyleWithElement): Deleted.
3851         (WebCore::StyleResolver::findSiblingForStyleSharing): Deleted.
3852         (WebCore::StyleResolver::locateSharedStyle): Deleted.
3853
3854             Style sharing code moves to SharingResolver.
3855
3856         * css/StyleResolver.h:
3857         (WebCore::StyleResolver::mediaQueryEvaluator):
3858         (WebCore::StyleResolver::State::regionForStyling):
3859         (WebCore::StyleResolver::State::elementLinkState):
3860         (WebCore::StyleResolver::State::setApplyPropertyToRegularStyle):
3861         (WebCore::StyleResolver::State::setApplyPropertyToVisitedLinkStyle):
3862         (WebCore::StyleResolver::state):
3863         (WebCore::StyleResolver::setTextOrientation):
3864         (WebCore::StyleResolver::State::setElementAffectedByClassRules): Deleted.
3865         (WebCore::StyleResolver::State::elementAffectedByClassRules): Deleted.
3866         (WebCore::StyleResolver::styleNotYetAvailable): Deleted.
3867
3868             Placeholder code moves to TreeResolver.
3869
3870         * dom/VisitedLinkState.cpp:
3871         (WebCore::linkAttribute):
3872         (WebCore::VisitedLinkState::invalidateStyleForAllLinks):
3873         (WebCore::linkHashForElement):
3874         (WebCore::VisitedLinkState::invalidateStyleForLink):
3875         (WebCore::VisitedLinkState::determineLinkStateSlowCase):
3876         * dom/VisitedLinkState.h:
3877         (WebCore::VisitedLinkState::determineLinkState):
3878         * html/HTMLFormControlElement.h:
3879         * rendering/RenderElement.cpp:
3880         (WebCore::RenderElement::getUncachedPseudoStyle):
3881         * rendering/RenderNamedFlowFragment.cpp:
3882         (WebCore::RenderNamedFlowFragment::computeStyleInRegion):
3883         * rendering/style/RenderStyle.cpp:
3884         (WebCore::RenderStyle::isStyleAvailable):
3885         (WebCore::RenderStyle::hasUniquePseudoStyle):
3886         * style/StyleSharingResolver.cpp: Added.
3887         (WebCore::Style::SharingResolver::SharingResolver):
3888         (WebCore::Style::parentElementPreventsSharing):
3889         (WebCore::Style::elementHasDirectionAuto):
3890         (WebCore::Style::SharingResolver::searchSimilar):
3891         (WebCore::Style::SharingResolver::findSibling):
3892         (WebCore::Style::SharingResolver::locateCousinList):
3893         (WebCore::Style::canShareStyleWithControl):
3894         (WebCore::Style::SharingResolver::canShareStyleWithElement):
3895         (WebCore::Style::SharingResolver::styleSharingCandidateMatchesRuleSet):
3896         (WebCore::Style::SharingResolver::sharingCandidateHasIdenticalStyleAffectingAttributes):
3897         (WebCore::Style::SharingResolver::classNamesAffectedByRules):
3898         * style/StyleSharingResolver.h: Added.
3899         * style/StyleTreeResolver.cpp:
3900         (WebCore::Style::ensurePlaceholderStyle):
3901         (WebCore::Style::TreeResolver::TreeResolver):
3902         (WebCore::Style::TreeResolver::styleForElement):
3903
3904             Try to use SharingResolver first.
3905             Also move placeholder style handling here, it is only relevant when resolving document style.
3906
3907         (WebCore::Style::postResolutionCallbacksAreSuspended):
3908         (WebCore::Style::isPlaceholderStyle):
3909         * style/StyleTreeResolver.h:
3910         * svg/SVGElement.cpp:
3911         (WebCore::SVGElement::customStyleForRenderer):
3912         * svg/SVGElementRareData.h:
3913         (WebCore::SVGElementRareData::overrideComputedStyle):
3914
3915 2016-02-02  Tim Horton  <timothy_horton@apple.com>
3916
3917         <attachment> icon should be a folder for the custom MIME type multipart/x-folder
3918         https://bugs.webkit.org/show_bug.cgi?id=153795
3919         <rdar://problem/24416632>
3920
3921         Reviewed by Anders Carlsson.
3922
3923         Test: fast/attachment/attachment-folder-icon.html
3924
3925         * rendering/RenderThemeMac.mm:
3926         (WebCore::iconForAttachment):
3927         (WebCore::paintAttachmentIcon):
3928         Mail uses this special MIME type to indicate that something is a folder, which there
3929         isn't a normal non-deprecated MIME type for.
3930
3931 2016-02-02  Brady Eidson  <beidson@apple.com>
3932
3933         Modern IDB: storage/indexeddb/cursor-continue-validity.html fails.
3934         https://bugs.webkit.org/show_bug.cgi?id=153791
3935
3936         Reviewed by Alex Christensen.
3937
3938         No new tests (Existing test now unskipped).
3939
3940         There was a preexisting check in the SQLite cursor for remembering the current record and
3941         refusing to refetch it.
3942         
3943         This check was causing this bug, because we needed to refetch the current record.
3944         
3945         Removing the check (and its associated flag) doesn't regress any other test, and fixes this one.
3946
3947         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
3948         (WebCore::IDBServer::SQLiteIDBCursor::resetAndRebindStatement):
3949         (WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce):
3950         * Modules/indexeddb/server/SQLiteIDBCursor.h:
3951
3952 2016-02-01  Dave Hyatt  <hyatt@apple.com>
3953
3954         Add a line grid pagination SPI to WebKit.
3955         https://bugs.webkit.org/show_bug.cgi?id=153757
3956         <rdar://problem/23041598>
3957
3958         Reviewed by Anders Carlsson.
3959
3960         New tests in fast/multicol/pagination.
3961
3962         * page/Page.cpp:
3963         (WebCore::Page::setPaginationLineGridEnabled):
3964         * page/Page.h:
3965         (WebCore::Page::paginationLineGridEnabled):
3966         Add a boolean to the page to turn the line grid on and off.
3967
3968         * rendering/RenderBox.cpp:
3969         (WebCore::RenderBox::styleDidChange):
3970         Propagate the body's font up to the paginated RenderView so that
3971         it can be used to establish the line grid.
3972
3973         * style/StyleResolveForDocument.cpp:
3974         (WebCore::Style::resolveForDocument):
3975         Set up a line grid with containment snapping by default if the
3976         line grid enabled flag is set.
3977
3978         * testing/Internals.cpp:
3979         (WebCore::Internals::resetToConsistentState):
3980         (WebCore::Internals::setPagination):
3981         (WebCore::Internals::setPaginationLineGridEnabled):
3982         (WebCore::Internals::configurationForViewport):
3983         * testing/Internals.h:
3984         (WebCore::Internals::setPagination):
3985         * testing/Internals.idl:
3986         Add support for testing the grid being enabled.
3987
3988 2016-02-01  Antti Koivisto  <antti@apple.com>
3989
3990         Tab suspension code shouldn't use page cache cacheability logic
3991         https://bugs.webkit.org/show_bug.cgi?id=153680
3992
3993         Reviewed by Andreas Kling.
3994
3995         Most of PageCache::canCache() is unnecessary for tab suspension.
3996
3997         Also improve robustness and introduce 1 minute delay before suspending.
3998
3999         * page/Page.cpp:
4000         (WebCore::Page::setPageActivityState):
4001         (WebCore::Page::setIsVisible):
4002         (WebCore::Page::setIsVisibleInternal):
4003         (WebCore::Page::setIsPrerender):
4004         (WebCore::Page::canTabSuspend):
4005
4006             Include visibility test here.
4007
4008             Instead of calling PageCache::canCache() just check for each frame
4009             - that the document is loaded
4010             - that active DOM objects allow suspension
4011
4012         (WebCore::Page::setIsTabSuspended):
4013         (WebCore::Page::setTabSuspensionEnabled):
4014         (WebCore::Page::updateTabSuspensionState):
4015
4016             Refactor for robustness.
4017
4018         (WebCore::Page::tabSuspensionTimerFired):
4019
4020             Call canTabSuspend, the result might have changed.
4021
4022         (WebCore::Page::scheduleTabSuspension): Deleted.
4023         * page/Page.h:
4024
4025 2016-02-02  Yusuke Suzuki  <utatane.tea@gmail.com>
4026
4027         [JSC] Introduce BytecodeIntrinsic constant rep like @undefined
4028         https://bugs.webkit.org/show_bug.cgi?id=153737
4029
4030         Reviewed by Darin Adler.
4031
4032         * Modules/fetch/FetchHeaders.js:
4033         (initializeFetchHeaders):
4034         * Modules/streams/ReadableStream.js:
4035         (initializeReadableStream):
4036         (closeDestination):
4037         (abortDestination):
4038         (pipeTo):
4039         * Modules/streams/ReadableStreamInternals.js:
4040         (privateInitializeReadableStreamController):
4041         (teeReadableStream):
4042         (isReadableStreamReader):
4043         (errorReadableStream):
4044         (finishClosingReadableStream):
4045         (enqueueInReadableStream):
4046         (readFromReadableStreamReader):
4047         * Modules/streams/ReadableStreamReader.js:
4048         (releaseLock):
4049         * Modules/streams/StreamInternals.js:
4050         (shieldingPromiseResolve):
4051         (promiseInvokeOrNoopNoCatch):
4052         (promiseInvokeOrFallbackOrNoop):
4053         (validateAndNormalizeQueuingStrategy):
4054         * Modules/streams/WritableStream.js:
4055         (initializeWritableStream):
4056         (write):
4057         * Modules/streams/WritableStreamInternals.js:
4058         (errorWritableStream):
4059
4060 2016-02-02  Brady Eidson  <beidson@apple.com>
4061
4062         Modern IDB: storage/indexeddb/dont-wedge.html sometimes ASSERTs.
4063         https://bugs.webkit.org/show_bug.cgi?id=153790
4064
4065         Reviewed by Tim Horton.
4066