dbfece12b29e64ebca4ef7e973e47ea907aa9189
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-06-28  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2
3         [Streams API]Remove ReadableStreamController.close custom binding
4         https://bugs.webkit.org/show_bug.cgi?id=146380
5
6         Reviewed by Darin Adler.
7
8         No change in behavior.
9
10         * Modules/streams/ReadableStreamController.h:
11         (WebCore::ReadableStreamController::close): Calling ReadableJSStream close method.
12         * Modules/streams/ReadableStreamController.idl: Removed Custom.
13         * bindings/js/JSReadableStreamControllerCustom.cpp:
14         (WebCore::JSReadableStreamController::close): Deleted.
15         * bindings/js/ReadableJSStream.cpp:
16         (WebCore::ReadableJSStream::close): Moved custom binding code here.
17         * bindings/js/ReadableJSStream.h:
18
19 2015-06-27  Chris Fleizach  <cfleizach@apple.com>
20
21         AX: implement @aria-roledescription
22         https://bugs.webkit.org/show_bug.cgi?id=146274
23
24         Reviewed by Darin Adler.
25
26         Add support for aria-roledescription.
27
28         Test: accessibility/aria-roledescription.html
29
30         * accessibility/AccessibilityObject.cpp:
31         (WebCore::AccessibilityObject::hasHighlighting):
32         (WebCore::AccessibilityObject::roleDescription):
33         (WebCore::nodeHasPresentationRole):
34         * accessibility/AccessibilityObject.h:
35         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
36         (-[WebAccessibilityObjectWrapper _accessibilityMaxValue]):
37         (-[WebAccessibilityObjectWrapper accessibilityRoleDescription]):
38         (-[WebAccessibilityObjectWrapper accessibilityLabel]):
39         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
40         (-[WebAccessibilityObjectWrapper roleDescription]):
41
42 2015-06-27  Darin Adler  <darin@apple.com>
43
44         Fix the build.
45
46         * platform/network/cf/ResourceErrorCF.cpp:
47         (WebCore::ResourceError::cfError): Take out log statement. Add FIXME comment
48         that explains part of the reason we may get null here.
49         * platform/network/mac/ResourceErrorMac.mm:
50         (WebCore::createNSErrorFromResourceErrorBase): Ditto.
51
52 2015-06-27  David Kilzer  <ddkilzer@apple.com>
53
54         Crash in WebCore::ResourceError::cfError() after provisional load failed
55         <http://webkit.org/b/146384>
56
57         Reviewed by Darin Adler.
58
59         This is a speculative fix based on the crashing stack.
60
61         * platform/network/cf/ResourceErrorCF.cpp:
62         (WebCore::ResourceError::cfError): Add NULL check.
63         * platform/network/mac/ResourceErrorMac.mm:
64         (WebCore::createNSErrorFromResourceErrorBase): Add nil check in
65         case we ever turn off USE(CFNETWORK) for iOS.
66
67 2015-06-27  Eric Carlson  <eric.carlson@apple.com>
68
69         [Mac] Only flag a video element as eligible for auto-play to AppleTV one time
70         https://bugs.webkit.org/show_bug.cgi?id=146386
71
72         Reviewed by Brent Fulgham.
73
74         * Modules/mediasession/WebMediaSessionManager.cpp:
75         (WebCore::WebMediaSessionManager::removeAllPlaybackTargetPickerClients): Drive-by fix - early 
76           return when there are no clients.
77
78         * html/HTMLMediaElement.cpp:
79         (WebCore::HTMLMediaElement::pendingActionTimerFired): Set m_failedToPlayToWirelessTarget if the
80           media engine is still unable to play to the wireless target.
81         (WebCore::HTMLMediaElement::prepareForLoad): Clear m_failedToPlayToWirelessTarget.
82         (WebCore::HTMLMediaElement::mediaState): Don't set the ExternalDeviceAutoPlayCandidate flag
83           if m_failedToPlayToWirelessTarget is true.
84         * html/HTMLMediaElement.h:
85
86 2015-06-27  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
87
88         [Streams API] Implement ReadableStreamController.desiredSize property
89         https://bugs.webkit.org/show_bug.cgi?id=146311
90
91         Reviewed by Darin Adler.
92
93         Covered by rebased tests.
94
95         * Modules/streams/ReadableStreamController.h: Adding desiredSize getter.
96         (WebCore::ReadableStreamController::desiredSize): Ditto.
97         * Modules/streams/ReadableStreamController.idl: Added desiredSize attribute.
98
99 2015-06-27  Carlos Garcia Campos  <cgarcia@igalia.com>
100
101         [GTK][SOUP] Implement WebCore::PublicSuffix for soup and enable PUBLIC_SUFFIX_LIST for GTK+
102         https://bugs.webkit.org/show_bug.cgi?id=146318
103
104         Reviewed by Sergio Villar Senin.
105
106         This is covered by unit tests.
107
108         * PlatformGTK.cmake:
109         * platform/soup/PublicSuffixSoup.cpp: Added.
110         (WebCore::isPublicSuffix):
111         (WebCore::topPrivatelyControlledDomain):
112
113 2015-06-26  Myles C. Maxfield  <mmaxfield@apple.com>
114
115         [iOS] AppleGothic has been superseded by Apple SD Gothic Neo
116         https://bugs.webkit.org/show_bug.cgi?id=146372
117         <rdar://problem/21574004>
118
119         Reviewed by Dean Jackson.
120
121         Test: fast/text/hangul-generic-font-families.html
122
123         * page/mac/SettingsMac.mm:
124         (WebCore::Settings::initializeDefaultFontFamilies):
125
126 2015-06-26  Matt Daiter  <mdaiter@apple.com>
127
128         Supporting getStartDate and added tests
129         https://bugs.webkit.org/show_bug.cgi?id=145676
130         <rdar://problem/20876076>
131
132         Reviewed by Brent Fulgham.
133
134         Test: http/tests/media/hls/video-controller-getStartDate.html
135
136         * bindings/js/JSDOMBinding.cpp:
137         (WebCore::jsDateOrNaN):
138         * bindings/js/JSDOMBinding.h:
139         * bindings/scripts/CodeGeneratorJS.pm: Added features to return 
140         NaN for Date
141         * bindings/scripts/CodeGeneratorGObject.pm: Needed to add
142         type checking code for GObject (no date)
143         (NativeToJSValue):
144         * bindings/scripts/IDLAttributes.txt: 
145         * html/HTMLMediaElement.cpp: Added getStartDate function
146         (WebCore::HTMLMediaElement::getStartDate):
147         * html/HTMLMediaElement.h: Needed to add declarations
148         * html/HTMLMediaElement.idl: Needed to modify for returning NaN
149         * platform/graphics/MediaPlayer.cpp:
150         (WebCore::MediaPlayer::getStartDate):
151         * platform/graphics/MediaPlayer.h:
152         * platform/graphics/MediaPlayerPrivate.h: Added in Mac-specific platform
153         (WebCore::MediaPlayerPrivateInterface::getStartDate):
154         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
155         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
156         (WebCore::MediaPlayerPrivateAVFoundationObjC::getStartDate):
157
158 2015-06-26  Beth Dakin  <bdakin@apple.com>
159
160         WebPage::getPositionInformation() should not copy an image that is larger than the  
161         screen
162         https://bugs.webkit.org/show_bug.cgi?id=146367
163
164         Reviewed by Tim Horton.
165
166         Export the rect version of this function too.
167         * platform/graphics/GraphicsContext.h:
168
169 2015-06-26  Eric Carlson  <eric.carlson@apple.com>
170
171         [Mac] Muted videos should not automatically play to AppleTV
172         https://bugs.webkit.org/show_bug.cgi?id=146366
173
174         Reviewed by Dean Jackson.
175
176         * html/HTMLMediaElement.cpp:
177         (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize m_initiallyMuted.
178         (WebCore::HTMLMediaElement::scheduleDelayedAction): Support CheckMediaState.
179         (WebCore::HTMLMediaElement::setReadyState): Set m_initiallyMuted to true if the element is
180           muted or the volume is less than 5%.
181         (WebCore::HTMLMediaElement::setMuted): Update media state asynchronously so multiple state
182           changes can be coalesced.
183         (WebCore::HTMLMediaElement::mediaPlayerEngineUpdated): Ditto.
184         (WebCore::HTMLMediaElement::setPlaying): Ditto.
185         (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged): Ditto.
186         (WebCore::HTMLMediaElement::removeEventListener): Ditto.
187         (WebCore::HTMLMediaElement::enqueuePlaybackTargetAvailabilityChangedEvent): Ditto.
188         (WebCore::HTMLMediaElement::updateMediaState): Update after a timer when passed UpdateMediaState::Asynchronously.
189         (WebCore::HTMLMediaElement::mediaState): Don't set the ExternalDeviceAutoPlayCandidate flag if
190           m_initiallyMuted is true.
191         * html/HTMLMediaElement.h:
192         * html/HTMLMediaElementEnums.h:
193
194 2015-06-26  Daniel Bates  <dabates@apple.com>
195
196         Rolling out r184660
197         https://bugs.webkit.org/show_bug.cgi?id=145200
198
199         Reverting r184660 because it caused a regression.
200
201         * English.lproj/Localizable.strings:
202         * html/TextFieldInputType.cpp:
203         (WebCore::TextFieldInputType::createAutoFillButton): Deleted.
204         * platform/LocalizedStrings.cpp:
205         (WebCore::AXAutoFillButtonText): Deleted.
206         * platform/LocalizedStrings.h:
207         * platform/efl/LocalizedStringsEfl.cpp:
208         (WebCore::AXAutoFillButtonText): Deleted.
209         * platform/gtk/LocalizedStringsGtk.cpp:
210         (WebCore::AXAutoFillButtonText): Deleted.
211
212 2015-06-26  Daniel Bates  <dabates@apple.com>
213
214         Rolling out r185881
215         https://bugs.webkit.org/show_bug.cgi?id=146243
216         And
217         r185828
218         https://bugs.webkit.org/show_bug.cgi?id=145241
219
220         Reverting r185881 and r185828 because the latter caused a regression.
221
222         * accessibility/AccessibilityRenderObject.cpp:
223         (WebCore::AccessibilityRenderObject::accessibilityTextFieldDecorationHitTest): Deleted.
224         (WebCore::AccessibilityRenderObject::accessibilityHitTest): Deleted.
225         * accessibility/AccessibilityRenderObject.h:
226
227 2015-06-26  Dean Jackson  <dino@apple.com>
228
229         No audio on animated page with the attached fixed layout epub
230         https://bugs.webkit.org/show_bug.cgi?id=146365
231
232         Reviewed by Eric Carlson.
233
234         The new restriction RequireUserGestureForAudioRateChange conflicted
235         with existing clients who expected RequireUserGestureForRateChange
236         to allow autoplaying audio. Update the logic to ensure that
237         RequireUserGestureForRateChange covers all media when set to
238         false.
239
240         This may require a revisit once we're using RequireUserGestureForAudioRateChange
241         in production, because the global setting will trump that, and
242         most clients have the global setting to false. We'll need to come
243         up with a way to allow legacy clients to preserve their behaviour.
244
245         * html/HTMLMediaElement.cpp:
246         (WebCore::HTMLMediaElement::HTMLMediaElement): Only restrict audio
247         if RequireUserGestureForRateChange is also false.
248
249 2015-06-25  Anders Carlsson  <andersca@apple.com>
250
251         Get rid of ScrollbarThemeClient now that it's unused
252         https://bugs.webkit.org/show_bug.cgi?id=146327
253
254         Reviewed by Beth Dakin.
255
256         * WebCore.vcxproj/WebCore.vcxproj:
257         * WebCore.vcxproj/WebCore.vcxproj.filters:
258         * WebCore.xcodeproj/project.pbxproj:
259         * platform/Scrollbar.cpp:
260         (WebCore::Scrollbar::scrollbarOverlayStyle): Deleted.
261         (WebCore::Scrollbar::isScrollableAreaActive): Deleted.
262         (WebCore::Scrollbar::isScrollViewScrollbar): Deleted.
263         (WebCore::Scrollbar::root): Deleted.
264         * platform/Scrollbar.h:
265         (WebCore::Scrollbar::isCustomScrollbar):
266         (WebCore::Scrollbar::orientation):
267         (WebCore::Scrollbar::value):
268         (WebCore::Scrollbar::currentPos):
269         (WebCore::Scrollbar::visibleSize):
270         (WebCore::Scrollbar::totalSize):
271         (WebCore::Scrollbar::maximum):
272         (WebCore::Scrollbar::controlSize):
273         (WebCore::Scrollbar::lineStep):
274         (WebCore::Scrollbar::pageStep):
275         (WebCore::Scrollbar::pressedPart):
276         (WebCore::Scrollbar::hoveredPart):
277         (WebCore::Scrollbar::enabled):
278         (WebCore::Scrollbar::styleChanged):
279         (WebCore::Scrollbar::isAlphaLocked):
280         (WebCore::Scrollbar::setIsAlphaLocked):
281         * platform/ScrollbarTheme.h:
282         * platform/ScrollbarThemeClient.h: Removed.
283         (WebCore::ScrollbarThemeClient::~ScrollbarThemeClient): Deleted.
284         * platform/mac/ScrollbarThemeMac.mm:
285         (WebCore::ScrollbarThemeMac::updateScrollbarOverlayStyle):
286         * rendering/RenderScrollbarTheme.cpp:
287
288 2015-06-26  Chris Dumez  <cdumez@apple.com>
289
290         Prevent new loads while in PageCache (or being added to PageCache)
291         https://bugs.webkit.org/show_bug.cgi?id=146299
292         <rdar://problem/21523788>
293
294         Reviewed by Darin Adler.
295
296         Generalize the change in r185337 to prevent new loads while in the
297         PageCache (or being added to the PageCache), instead of merely
298         preventing new loads in pagehide event handlers. We should never
299         have any pages that are still loading inside the PageCache.
300
301         The fix in r185337 was apparently insufficient to address the
302         problem so generalizing the check / policy will hopefully catch
303         more cases where content is able to start loads while being added
304         to the PageCache. This patch also removes some of the complexity
305         added in r185337 as it is no longer needed.
306
307         No new tests, already covered by:
308         http/tests/navigation/image-load-in-pagehide-handler.html
309         http/tests/navigation/subframe-pagehide-handler-starts-load.html
310         http/tests/navigation/subframe-pagehide-handler-starts-load2.html
311
312         * loader/FrameLoader.cpp:
313         (WebCore::FrameLoader::stopLoading):
314         (WebCore::FrameLoader::loadURL):
315         (WebCore::FrameLoader::loadWithDocumentLoader):
316         (WebCore::FrameLoader::stopAllLoaders):
317         (WebCore::FrameLoader::handleBeforeUnloadEvent):
318         (WebCore::FrameLoader::FrameLoader): Deleted.
319         * loader/FrameLoader.h:
320         (WebCore::FrameLoader::pageDismissalEventBeingDispatched):
321         * loader/ImageLoader.cpp:
322         (WebCore::pageIsBeingDismissed):
323         * loader/cache/CachedResource.cpp:
324         (WebCore::CachedResource::load):
325         * loader/cache/CachedResourceLoader.cpp:
326         (WebCore::CachedResourceLoader::requestImage):
327         * page/Page.cpp:
328         (WebCore::Page::inPageCache):
329         * page/Page.h:
330         (WebCore::Page::group): Deleted.
331
332 2015-06-26  Simon Fraser  <simon.fraser@apple.com>
333
334         [OS X] Change the layer tiling threshold from 2000 to 2048 pixels
335         https://bugs.webkit.org/show_bug.cgi?id=146353
336
337         Reviewed by Tim Horton.
338
339         Programmers love powers of two.
340
341         * platform/graphics/ca/GraphicsLayerCA.cpp:
342
343 2015-06-26  Myles C. Maxfield  <mmaxfield@apple.com>
344
345         [Cocoa] Sans-serif generic font family should map to PingFang
346         https://bugs.webkit.org/show_bug.cgi?id=146333
347         <rdar://problem/21521217>
348
349         Reviewed by Alexey Proskuryakov.
350
351         Also performs a little bit of cleanup.
352
353         Test: fast/text/han-generic-font-families.html
354
355         * page/mac/SettingsMac.mm:
356         (WebCore::sansSerifTraditionalHanFontFamily):
357         (WebCore::sansSerifSimplifiedHanFontFamily):
358         (WebCore::Settings::initializeDefaultFontFamilies):
359
360 2015-06-26  Per Arne Vollan  <peavo@outlook.com>
361
362         [Curl] Compile errors; ResourceResponseBase::resourceLoadTiming() has changed return type.
363         https://bugs.webkit.org/show_bug.cgi?id=146343
364
365         Reviewed by Brent Fulgham.
366
367         * platform/network/curl/ResourceHandleManager.cpp:
368         (WebCore::calculateWebTimingInformations):
369         (WebCore::headerCallback):
370         (WebCore::ResourceHandleManager::initializeHandle):
371         (WebCore::ResourceHandleManager::initCookieSession):
372         (WebCore::sockoptfunction): Deleted.
373
374 2015-06-26  Chris Fleizach  <cfleizach@apple.com>
375
376         iOS speech synthesizer should expose names
377         https://bugs.webkit.org/show_bug.cgi?id=146319
378
379         Reviewed by Mario Sanchez Prada.
380
381         Use newer API to get the name and identifier of each voice asset.
382
383         * platform/ios/PlatformSpeechSynthesizerIOS.mm:
384         (WebCore::PlatformSpeechSynthesizer::initializeVoiceList):
385
386 2015-06-26  Csaba Osztrogonác  <ossy@webkit.org>
387
388         [EFL] Remove unnecessary overriden methods from ScrollBarEfl
389         https://bugs.webkit.org/show_bug.cgi?id=146342
390
391         Reviewed by Gyuyoung Kim.
392
393         * platform/efl/ScrollbarEfl.cpp:
394         (WebCore::ScrollbarEfl::setParent): Deleted.
395         (WebCore::ScrollbarEfl::setFrameRect): Deleted.
396         (WebCore::ScrollbarEfl::frameRectsChanged): Deleted.
397         (WebCore::ScrollbarEfl::invalidate): Deleted.
398         * platform/efl/ScrollbarEfl.h:
399
400 2015-06-26  Csaba Osztrogonác  <ossy@webkit.org>
401
402         Convert some of WebCore/dom over to range-for loops
403         https://bugs.webkit.org/show_bug.cgi?id=126250
404
405         Reviewed by Darin Adler.
406
407         Based on the original patch of Sam Weinig <sam@webkit.org>.
408
409         * dom/ContainerNode.cpp:
410         (WebCore::ContainerNode::replaceChild):
411         (WebCore::willRemoveChildren):
412         (WebCore::ContainerNode::appendChild):
413         * dom/MutationObserver.cpp:
414         (WebCore::MutationObserver::disconnect):
415         (WebCore::MutationObserver::getObservedNodes):
416         (WebCore::MutationObserver::deliver):
417         * dom/MutationObserverInterestGroup.cpp:
418         (WebCore::MutationObserverInterestGroup::isOldValueRequested):
419         (WebCore::MutationObserverInterestGroup::enqueueMutationRecord):
420         * dom/MutationObserverRegistration.cpp:
421         (WebCore::MutationObserverRegistration::clearTransientRegistrations):
422         (WebCore::MutationObserverRegistration::addRegistrationNodesToSet):
423         * dom/Node.cpp:
424         (WebCore::Node::dumpStatistics):
425         (WebCore::collectMatchingObserversForMutation):
426         (WebCore::Node::notifyMutationObserversNodeWillDetach):
427
428 2015-06-25  Lucas Forschler  <lforschler@apple.com>
429
430         Unreviewed build fix.
431         
432         * platform/audio/VectorMath.cpp:
433         (WebCore::VectorMath::vsmul):
434         (WebCore::VectorMath::vadd):
435         (WebCore::VectorMath::vmul):
436         (WebCore::VectorMath::zvmul):
437
438 2015-06-25  Stephanie Lewis  <slewis@apple.com>
439
440         Build fix.
441
442         Unreviewed.
443
444         * platform/audio/DirectConvolver.cpp:
445         (WebCore::DirectConvolver::process):
446
447 2015-06-25  Chris Fleizach  <cfleizach@apple.com>
448
449         AX: improve list heuristics (presentational use versus actual lists)
450         https://bugs.webkit.org/show_bug.cgi?id=134187
451
452         Rolling this change back in. 
453         It was taken out to allow clients to have time to update their expectations of what is a list vs. a group
454
455         Test: accessibility/list-detection2.html
456
457         * accessibility/AccessibilityList.cpp:
458         (WebCore::AccessibilityList::isDescriptionList):
459         (WebCore::AccessibilityList::childHasPseudoVisibleListItemMarkers):
460         (WebCore::AccessibilityList::determineAccessibilityRole):
461         * accessibility/AccessibilityList.h:
462
463 2015-06-25  Brent Fulgham  <bfulgham@apple.com>
464
465         Unreviewed build fix after r185964.
466
467         Correct a few pointers-that-should-be-references-now errors.
468
469         * platform/win/PopupMenuWin.cpp:
470         (WebCore::AccessiblePopupMenu::accLocation):
471         (WebCore::AccessiblePopupMenu::accHitTest):
472
473 2015-06-25  Doug Russell  <d_russell@apple.com>
474
475         Bug 146300 AX: AccessibilityObject focus events that don't cause a selection 
476         change can leave m_isSynchronizingSelection set to true
477         https://bugs.webkit.org/show_bug.cgi?id=146300
478
479         Reviewed by Chris Fleizach.
480
481         Added a clearTextSelectionIntent() convenience function to be used after any
482         event that can, but isn't guaranteed to result in a selection change. Matches
483         calls to setTextSelectionIntent() convenience function.
484         Added support for tests listening for focus change notifications.
485
486         Test: platform/mac/accessibility/focus-setting-selection-syncronizing-not-clearing.html
487
488         * accessibility/AccessibilityRenderObject.cpp:
489         (WebCore::clearTextSelectionIntent):
490         (WebCore::AccessibilityRenderObject::setSelectedTextRange):
491         (WebCore::AccessibilityRenderObject::setFocused):
492         (WebCore::AccessibilityRenderObject::setSelectedVisiblePositionRange):
493         * accessibility/mac/AXObjectCacheMac.mm:
494         (WebCore::AXObjectCache::platformHandleFocusedUIElementChanged):
495
496 2015-06-25  Alex Christensen  <achristensen@webkit.org>
497
498         [Content Extensions] Add a way to match a domain but not subdomains
499         https://bugs.webkit.org/show_bug.cgi?id=146241
500         rdar://problem/21557754
501
502         Reviewed by Darin Adler.
503
504         This patch makes it possible to have a trigger with an if-domain apply to sub2.sub1.webkit.org
505         but not sub1.webkit.org by making the domains default to only applying to the domain and not subdomains.
506         To make a domain apply to a domain and any subdomains, the domain must begin with a '*'.
507
508         * contentextensions/CombinedURLFilters.cpp:
509         (WebCore::ContentExtensions::CombinedURLFilters::addDomain):
510         (WebCore::ContentExtensions::CombinedURLFilters::addPattern):
511         Make domains apply only to the exact domain unless there is a * at the beginning,
512         in which case they apply to the domain and any subdomains.
513
514 2015-06-25  Simon Fraser  <simon.fraser@apple.com>
515
516         [iOS WK2] Swiping back just after scrolling can cause some tiles to disappear
517         https://bugs.webkit.org/show_bug.cgi?id=146329
518         rdar://problem/21233010
519
520         Reviewed by Tim Horton.
521
522         Have the Compositing log channel dump the visible rect used for layer flushing.
523
524         * rendering/RenderLayerCompositor.cpp:
525         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
526
527 2015-06-25  Brent Fulgham  <bfulgham@apple.com>
528
529         [WIN] Enable WEB_TIMING API
530         https://bugs.webkit.org/show_bug.cgi?id=146330
531         <rdar://problem/21530765>
532
533         Reviewed by Dean Jackson.
534
535         Tested by internal HLS tests.
536
537         Enable WEB_TIMING features on Windows by activating the feature flag,
538         and correcting some build errors.
539
540         * platform/network/cf/ResourceHandleCFNet.cpp:
541         (WebCore::ResourceHandle::start): "setCollectionTimingData" is only
542         defined for PLATFORM(COCOA).
543         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
544         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
545         The 'ResourceHandle::getConnectionTimingData' method is only defined
546         for PLATFORM(COCOA).
547
548 2015-06-25  Dean Jackson  <dino@apple.com>
549
550         Inline media controls disappear when returning a video to inline
551         https://bugs.webkit.org/show_bug.cgi?id=146328
552         <rdar://problem/21142862>
553
554         Reviewed by Tim Horton.
555
556         We were getting into a state where the controls were being
557         hidden via a timer while we were in fullscreen or on
558         another tab. Meanwhile, we could exit from such
559         a condition to a point where the controls were
560         not visible, but not completely removed from the DOM, confusing
561         the logic that decided whether to show them on tap.
562
563         * Modules/mediacontrols/mediaControlsApple.js:
564         (Controller.prototype.hideControls): If we are in the act of hiding
565         controls, we can clear any existing timers that are going to try
566         to hide them again.
567         (Controller.prototype.resetHideControlsTimer): Make sure we null
568         out the hideTimer object, since we look at its value often to
569         decide whether or not a timer exists.
570         * Modules/mediacontrols/mediaControlsiOS.js:
571         (ControllerIOS.prototype.handlePlayButtonTouchEnd): If the user
572         taps play, then we should call showControls, which resets the hide
573         timers amongst other things. We need to do this due to the next change,
574         so that a timer started before we pressed play doesn't cause the
575         controls to instantly disappear as soon as we start playing.
576         (ControllerIOS.prototype.handleWrapperTouchStart): We can get into
577         the state where controls are invisible but still in the tree. Since the
578         controlsAreHidden() logic only looks for the latter, we need to also
579         look for invisible when the user taps for the controls. Yes, this
580         naming doesn't make much sense :(
581
582 2015-06-25  Joseph Pecoraro  <pecoraro@apple.com>
583
584         [Mac] Web Inspector: Window dragging on toolbar should behave more like native window dragging
585         https://bugs.webkit.org/show_bug.cgi?id=146324
586
587         Reviewed by Timothy Hatcher.
588
589         * inspector/InspectorFrontendClient.h:
590         * inspector/InspectorFrontendClientLocal.h:
591         Do nothing or pass it up to the the frontend client.
592
593         * inspector/InspectorFrontendHost.h:
594         * inspector/InspectorFrontendHost.idl:
595         * inspector/InspectorFrontendHost.cpp:
596         (WebCore::InspectorFrontendHost::startWindowDrag):
597         Add a new host function to get native window dragging behavior.
598
599 2015-06-25  Tim Horton  <timothy_horton@apple.com>
600
601         Viewport units are wrong when scaled in 2-up mode, cause content to hop around on apple.com/music
602         https://bugs.webkit.org/show_bug.cgi?id=146322
603         <rdar://problem/21413884>
604
605         Reviewed by Simon Fraser.
606
607         * page/FrameView.cpp:
608         (WebCore::FrameView::viewportSizeForCSSViewportUnits):
609         Use the fixed layout size, if enabled, instead of the visibleContentRect,
610         for the viewport unit size. This ensures that viewport units take up the whole
611         fixed-layout viewport, not just the size of the view scaled by the page scale
612         (which visibleContentRect provides).
613
614 2015-06-25  Eric Carlson  <eric.carlson@apple.com>
615
616         [Mac] AirPlay menu button still doesn't always show on page load
617         https://bugs.webkit.org/show_bug.cgi?id=146325
618
619         Reviewed by Dean Jackson.
620
621         * html/HTMLMediaElement.cpp:
622         (WebCore::HTMLMediaElement::mediaState): A player that can't currently play to a wireless 
623           target does require target monitoring if an availability event listner has been registered,
624           otherwise we may not register for availability change notifications.
625
626 2015-06-25  Anders Carlsson  <andersca@apple.com>
627
628         Stop using ScrollbarThemeClient and just use Scrollbar directly
629         https://bugs.webkit.org/show_bug.cgi?id=146320
630
631         Reviewed by Tim Horton.
632
633         * page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm:
634         (WebCore::ScrollingStateFrameScrollingNode::setScrollbarPaintersFromScrollbars):
635         * platform/ScrollableArea.cpp:
636         (WebCore::ScrollableArea::setScrollbarOverlayStyle):
637         * platform/Scrollbar.cpp:
638         (WebCore::Scrollbar::Scrollbar):
639         (WebCore::Scrollbar::~Scrollbar):
640         (WebCore::Scrollbar::offsetDidChange):
641         (WebCore::Scrollbar::updateThumb):
642         (WebCore::Scrollbar::paint):
643         (WebCore::thumbUnderMouse):
644         (WebCore::Scrollbar::autoscrollPressedPart):
645         (WebCore::Scrollbar::startTimerIfNeeded):
646         (WebCore::Scrollbar::moveThumb):
647         (WebCore::Scrollbar::setHoveredPart):
648         (WebCore::Scrollbar::setPressedPart):
649         (WebCore::Scrollbar::mouseMoved):
650         (WebCore::Scrollbar::mouseUp):
651         (WebCore::Scrollbar::mouseDown):
652         (WebCore::Scrollbar::setEnabled):
653         * platform/ScrollbarTheme.h:
654         (WebCore::ScrollbarTheme::updateEnabledState):
655         (WebCore::ScrollbarTheme::paint):
656         (WebCore::ScrollbarTheme::hitTest):
657         (WebCore::ScrollbarTheme::updateScrollbarOverlayStyle):
658         (WebCore::ScrollbarTheme::invalidateParts):
659         (WebCore::ScrollbarTheme::invalidatePart):
660         (WebCore::ScrollbarTheme::paintTickmarks):
661         (WebCore::ScrollbarTheme::shouldCenterOnThumb):
662         (WebCore::ScrollbarTheme::shouldSnapBackToDragOrigin):
663         (WebCore::ScrollbarTheme::shouldDragDocumentInsteadOfThumb):
664         (WebCore::ScrollbarTheme::thumbPosition):
665         (WebCore::ScrollbarTheme::thumbLength):
666         (WebCore::ScrollbarTheme::trackPosition):
667         (WebCore::ScrollbarTheme::trackLength):
668         (WebCore::ScrollbarTheme::registerScrollbar):
669         (WebCore::ScrollbarTheme::unregisterScrollbar):
670         * platform/ScrollbarThemeComposite.cpp:
671         (WebCore::ScrollbarThemeComposite::paint):
672         (WebCore::ScrollbarThemeComposite::hitTest):
673         (WebCore::ScrollbarThemeComposite::invalidatePart):
674         (WebCore::ScrollbarThemeComposite::splitTrack):
675         (WebCore::usedTotalSize):
676         (WebCore::ScrollbarThemeComposite::thumbPosition):
677         (WebCore::ScrollbarThemeComposite::thumbLength):
678         (WebCore::ScrollbarThemeComposite::minimumThumbLength):
679         (WebCore::ScrollbarThemeComposite::trackPosition):
680         (WebCore::ScrollbarThemeComposite::trackLength):
681         (WebCore::ScrollbarThemeComposite::thumbRect):
682         * platform/ScrollbarThemeComposite.h:
683         (WebCore::ScrollbarThemeComposite::willPaintScrollbar):
684         (WebCore::ScrollbarThemeComposite::didPaintScrollbar):
685         (WebCore::ScrollbarThemeComposite::paintScrollbarBackground):
686         (WebCore::ScrollbarThemeComposite::paintTrackBackground):
687         (WebCore::ScrollbarThemeComposite::paintTrackPiece):
688         (WebCore::ScrollbarThemeComposite::paintButton):
689         (WebCore::ScrollbarThemeComposite::paintThumb):
690         (WebCore::ScrollbarThemeComposite::constrainTrackRectToTrackPieces):
691         * platform/efl/ScrollbarThemeEfl.h:
692         * platform/gtk/ScrollbarThemeGtk.cpp:
693         (WebCore::ScrollbarThemeGtk::hasThumb):
694         (WebCore::ScrollbarThemeGtk::backButtonRect):
695         (WebCore::ScrollbarThemeGtk::forwardButtonRect):
696         (WebCore::ScrollbarThemeGtk::trackRect):
697         (WebCore::ScrollbarThemeGtk::registerScrollbar):
698         (WebCore::ScrollbarThemeGtk::unregisterScrollbar):
699         (WebCore::ScrollbarThemeGtk::updateScrollbarsFrameThickness):
700         (WebCore::ScrollbarThemeGtk::thumbRect):
701         (WebCore::ScrollbarThemeGtk::paintTrackBackground):
702         (WebCore::ScrollbarThemeGtk::paintScrollbarBackground):
703         (WebCore::ScrollbarThemeGtk::paintThumb):
704         (WebCore::ScrollbarThemeGtk::paintButton):
705         (WebCore::ScrollbarThemeGtk::paint):
706         (WebCore::ScrollbarThemeGtk::shouldCenterOnThumb):
707         (WebCore::ScrollbarThemeGtk::buttonSize):
708         (WebCore::ScrollbarThemeGtk::minimumThumbLength):
709         * platform/gtk/ScrollbarThemeGtk.h:
710         (WebCore::ScrollbarThemeGtk::hasButtons):
711         * platform/ios/ScrollbarThemeIOS.h:
712         * platform/ios/ScrollbarThemeIOS.mm:
713         (WebCore::ScrollbarThemeIOS::registerScrollbar):
714         (WebCore::ScrollbarThemeIOS::unregisterScrollbar):
715         (WebCore::ScrollbarThemeIOS::hasButtons):
716         (WebCore::ScrollbarThemeIOS::hasThumb):
717         (WebCore::ScrollbarThemeIOS::backButtonRect):
718         (WebCore::ScrollbarThemeIOS::forwardButtonRect):
719         (WebCore::ScrollbarThemeIOS::trackRect):
720         (WebCore::ScrollbarThemeIOS::minimumThumbLength):
721         (WebCore::ScrollbarThemeIOS::shouldCenterOnThumb):
722         (WebCore::ScrollbarThemeIOS::paint):
723         * platform/mac/ScrollAnimatorMac.mm:
724         (scrollbarPainterForScrollbar):
725         (-[WebScrollbarPainterControllerDelegate scrollerImpPair:convertContentPoint:toScrollerImp:]):
726         (-[WebScrollbarPartAnimation startAnimation]):
727         (-[WebScrollbarPainterDelegate mouseLocationInScrollerForScrollerImp:]):
728         (-[WebScrollbarPainterDelegate setUpAlphaAnimation:scrollerPainter:part:animateAlphaTo:duration:]):
729         (-[WebScrollbarPainterDelegate scrollerImp:animateKnobAlphaTo:duration:]):
730         (-[WebScrollbarPainterDelegate scrollerImp:animateTrackAlphaTo:duration:]):
731         (-[WebScrollbarPainterDelegate scrollerImp:animateUIStateTransitionWithDuration:]):
732         (-[WebScrollbarPainterDelegate scrollerImp:animateExpansionTransitionWithDuration:]):
733         (WebCore::ScrollAnimatorMac::mouseEnteredScrollbar):
734         (WebCore::ScrollAnimatorMac::mouseExitedScrollbar):
735         (WebCore::ScrollAnimatorMac::didAddVerticalScrollbar):
736         (WebCore::ScrollAnimatorMac::willRemoveVerticalScrollbar):
737         (WebCore::ScrollAnimatorMac::didAddHorizontalScrollbar):
738         (WebCore::ScrollAnimatorMac::willRemoveHorizontalScrollbar):
739         (WebCore::ScrollAnimatorMac::invalidateScrollbarPartLayers):
740         (WebCore::ScrollAnimatorMac::verticalScrollbarLayerDidChange):
741         (WebCore::ScrollAnimatorMac::horizontalScrollbarLayerDidChange):
742         (WebCore::ScrollAnimatorMac::shouldScrollbarParticipateInHitTesting):
743         (WebCore::ScrollAnimatorMac::updateScrollerStyle):
744         * platform/mac/ScrollbarThemeMac.h:
745         * platform/mac/ScrollbarThemeMac.mm:
746         (WebCore::ScrollbarThemeMac::registerScrollbar):
747         (WebCore::ScrollbarThemeMac::unregisterScrollbar):
748         (WebCore::ScrollbarThemeMac::setNewPainterForScrollbar):
749         (WebCore::ScrollbarThemeMac::painterForScrollbar):
750         (WebCore::ScrollbarThemeMac::updateScrollbarOverlayStyle):
751         (WebCore::ScrollbarThemeMac::hasButtons):
752         (WebCore::ScrollbarThemeMac::hasThumb):
753         (WebCore::ScrollbarThemeMac::backButtonRect):
754         (WebCore::ScrollbarThemeMac::forwardButtonRect):
755         (WebCore::ScrollbarThemeMac::trackRect):
756         (WebCore::ScrollbarThemeMac::minimumThumbLength):
757         (WebCore::ScrollbarThemeMac::shouldCenterOnThumb):
758         (WebCore::ScrollbarThemeMac::shouldDragDocumentInsteadOfThumb):
759         (WebCore::ScrollbarThemeMac::updateEnabledState):
760         (WebCore::ScrollbarThemeMac::setPaintCharacteristicsForScrollbar):
761         (WebCore::ScrollbarThemeMac::paint):
762         * platform/mock/ScrollbarThemeMock.cpp:
763         (WebCore::ScrollbarThemeMock::trackRect):
764         (WebCore::ScrollbarThemeMock::paintTrackBackground):
765         (WebCore::ScrollbarThemeMock::paintThumb):
766         * platform/mock/ScrollbarThemeMock.h:
767         (WebCore::ScrollbarThemeMock::hasButtons): Deleted.
768         (WebCore::ScrollbarThemeMock::hasThumb): Deleted.
769         (WebCore::ScrollbarThemeMock::backButtonRect): Deleted.
770         (WebCore::ScrollbarThemeMock::forwardButtonRect): Deleted.
771         (WebCore::ScrollbarThemeMock::maxOverlapBetweenPages): Deleted.
772         (WebCore::ScrollbarThemeMock::isMockTheme): Deleted.
773         * platform/win/ScrollbarThemeSafari.cpp:
774         (WebCore::ScrollbarThemeSafari::hasButtons):
775         (WebCore::ScrollbarThemeSafari::hasThumb):
776         (WebCore::ScrollbarThemeSafari::backButtonRect):
777         (WebCore::ScrollbarThemeSafari::forwardButtonRect):
778         (WebCore::ScrollbarThemeSafari::trackRect):
779         (WebCore::ScrollbarThemeSafari::minimumThumbLength):
780         (WebCore::ScrollbarThemeSafari::shouldCenterOnThumb):
781         (WebCore::ScrollbarThemeSafari::paintTrackBackground):
782         (WebCore::ScrollbarThemeSafari::paintButton):
783         (WebCore::ScrollbarThemeSafari::paintThumb):
784         * platform/win/ScrollbarThemeSafari.h:
785         * platform/win/ScrollbarThemeWin.cpp:
786         (WebCore::ScrollbarThemeWin::hasThumb):
787         (WebCore::ScrollbarThemeWin::backButtonRect):
788         (WebCore::ScrollbarThemeWin::forwardButtonRect):
789         (WebCore::ScrollbarThemeWin::trackRect):
790         (WebCore::ScrollbarThemeWin::shouldCenterOnThumb):
791         (WebCore::ScrollbarThemeWin::shouldSnapBackToDragOrigin):
792         (WebCore::ScrollbarThemeWin::paintTrackBackground):
793         (WebCore::ScrollbarThemeWin::paintTrackPiece):
794         (WebCore::ScrollbarThemeWin::paintButton):
795         (WebCore::paintGripper):
796         (WebCore::ScrollbarThemeWin::paintThumb):
797         * platform/win/ScrollbarThemeWin.h:
798         * rendering/RenderScrollbar.h:
799         (isType):
800         * rendering/RenderScrollbarPart.cpp:
801         (WebCore::RenderScrollbarPart::styleDidChange):
802         (WebCore::RenderScrollbarPart::imageChanged):
803         * rendering/RenderScrollbarTheme.cpp:
804         (WebCore::RenderScrollbarTheme::buttonSizesAlongTrackAxis):
805         (WebCore::RenderScrollbarTheme::hasButtons):
806         (WebCore::RenderScrollbarTheme::hasThumb):
807         (WebCore::RenderScrollbarTheme::minimumThumbLength):
808         (WebCore::RenderScrollbarTheme::backButtonRect):
809         (WebCore::RenderScrollbarTheme::forwardButtonRect):
810         (WebCore::RenderScrollbarTheme::trackRect):
811         (WebCore::RenderScrollbarTheme::constrainTrackRectToTrackPieces):
812         (WebCore::RenderScrollbarTheme::willPaintScrollbar):
813         (WebCore::RenderScrollbarTheme::didPaintScrollbar):
814         (WebCore::RenderScrollbarTheme::paintScrollbarBackground):
815         (WebCore::RenderScrollbarTheme::paintTrackBackground):
816         (WebCore::RenderScrollbarTheme::paintTrackPiece):
817         (WebCore::RenderScrollbarTheme::paintButton):
818         (WebCore::RenderScrollbarTheme::paintThumb):
819         (WebCore::RenderScrollbarTheme::paintTickmarks):
820         * rendering/RenderScrollbarTheme.h:
821
822 2015-06-24  Matt Rajca  <mrajca@apple.com>
823
824         MediaSession: fall back to "content" kind when an unsupported media session kind is passed in
825         https://bugs.webkit.org/show_bug.cgi?id=146293
826
827         Reviewed by Eric Carlson.
828
829         * Modules/mediasession/MediaSession.cpp:
830         (WebCore::MediaSession::parseKind): Parse the media session kind to one of the four supported types.
831         (WebCore::MediaSession::MediaSession):
832         (WebCore::MediaSession::kind): Format the value as a string (which the JS bindings expect).
833         * Modules/mediasession/MediaSession.h: The media session kind is now stored as an enum rather than a string
834           since we only support a small, fixed number of values.
835
836 2015-06-25  Eric Carlson  <eric.carlson@apple.com>
837
838         [Mac] Crash in WebCore::MediaPlayer::canPlayToWirelessPlaybackTarget
839         https://bugs.webkit.org/show_bug.cgi?id=146317
840
841         Reviewed by Brent Fulgham.
842
843         * html/HTMLMediaElement.cpp:
844         (WebCore::HTMLMediaElement::mediaState): NULL-check m_player before using it.
845
846 2015-06-25  Commit Queue  <commit-queue@webkit.org>
847
848         Unreviewed, rolling out r185956.
849         https://bugs.webkit.org/show_bug.cgi?id=146321
850
851         Causes massive crashes on test bots (Requested by bfulgham on
852         #webkit).
853
854         Reverted changeset:
855
856         "Enabling MEDIA_STREAM"
857         https://bugs.webkit.org/show_bug.cgi?id=145947
858         http://trac.webkit.org/changeset/185956
859
860 2015-06-25  Brent Fulgham  <bfulgham@apple.com>
861
862         [Win] Update MediaPlayerPrivateAVFoundationCF::supportsType
863         https://bugs.webkit.org/show_bug.cgi?id=146302
864         <rdar://problem/19726553>
865
866         Reviewed by Eric Carlson.
867
868         Tested by existing media tests.
869
870         Update the AVFoundationCF version of 'supportsType' to more closely match the AVFoundation
871         version. Use this new code when the necessary AVFoundationCF functions are present.
872
873         * AVFoundationSupport.py: Check for presence of AVCFURLAssetIsPlayableExtendedMIMEType.
874         (fileContains): Added helper function.
875         * WebCore.vcxproj/WebCoreGenerated.vcxproj: Add AVFoundationSupport.py to project file to make
876         maintenance easier.
877         * WebCore.vcxproj/WebCoreGenerated.vcxproj.filters: Ditto.
878         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
879         (WebCore::MediaPlayerPrivateAVFoundation::isUnsupportedMIMEType): Moved from ObjC version.
880         (WebCore::MediaPlayerPrivateAVFoundation::staticMIMETypeList): Ditto.
881         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
882         * platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h: Add missing declaration.
883         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
884         (WebCore::avfMIMETypes): Added CF version of AVFoundation code.
885         (WebCore::MediaPlayerPrivateAVFoundationCF::supportsType): Update to use new AVCF
886         method if it is available.
887         (WebCore::MediaPlayerPrivateAVFoundationCF::languageOfPrimaryAudioTrack): Handle case of a
888         null language locale. This is a drive-by fix of a bug found during testing.
889         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
890         (WebCore::isUnsupportedMIMEType): Deleted.
891         (WebCore::staticMIMETypeList): Deleted.
892
893 2015-06-25  Matthew Daiter  <mdaiter@apple.com>
894
895         Enabling MEDIA_STREAM
896         https://bugs.webkit.org/show_bug.cgi?id=145947
897         <rdar://problem/21365829>
898
899         Reviewed by Brent Fulgham.
900
901         * Configurations/FeatureDefines.xcconfig:
902         * Modules/mediastream/UserMediaClient.h:
903         * WebCore.xcodeproj/project.pbxproj:
904         * platform/mediastream/mac/AVAudioCaptureSource.mm:
905         * platform/mock/UserMediaClientMock.h:
906
907 2015-06-25  Zalan Bujtas  <zalan@apple.com>
908
909         Do not send touch events to the slider's thumb when it does not have a renderer.
910         https://bugs.webkit.org/show_bug.cgi?id=146307
911         rdar://problem/21539399
912
913         Reviewed by Simon Fraser.
914
915         Bail out early if either the touch target or the renderer() is null.
916
917         Test: fast/events/touch/input-range-with-thumb-display-none-crash.html
918
919         * html/shadow/SliderThumbElement.cpp:
920         (WebCore::findTouchWithIdentifier):
921         (WebCore::SliderThumbElement::handleTouchStart):
922         (WebCore::SliderThumbElement::handleTouchMove):
923         (WebCore::SliderThumbElement::handleTouchEndAndCancel):
924
925 2015-06-25  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
926
927         [Streams API] Implement HighWaterMark
928         https://bugs.webkit.org/show_bug.cgi?id=146235
929
930         Reviewed by Darin Adler.
931
932         Retrieval of HighWaterMark parameter from arguments passed to the ReadableStream JS constructor.
933         Retrieval of size function callback from arguments passed to the ReadableStream JS constructor.
934         Calling doPull() if buffer size is below HighWaterMark.
935
936         Covered by rebased tests.
937
938         * Modules/streams/ReadableStream.cpp:
939         (WebCore::ReadableStream::pull): Adding precise check for HWM.
940         * Modules/streams/ReadableStream.h: Introducing hasEnoughValues.
941         * bindings/js/ReadableJSStream.cpp:
942         (WebCore::getHighWaterMark): Utility routine to get properly HWM value.
943         (WebCore::ReadableJSStream::create): Retrieval of HWM and size function.
944         (WebCore::ReadableJSStream::ReadableJSStream):
945         * bindings/js/ReadableJSStream.h: Adding hasEnoughValues and desiredSize prototypes.
946
947 2015-06-25  Tim Horton  <timothy_horton@apple.com>
948
949         Try to fix the iOS EWS build.
950
951         * platform/spi/cocoa/SecuritySPI.h:
952
953 2015-06-25  Carlos Garcia Campos  <cgarcia@igalia.com>
954
955         [GTK] Empty gtk-font-name setting causes WebProcess crash rendering pages
956         https://bugs.webkit.org/show_bug.cgi?id=146246
957
958         Reviewed by Sergio Villar Senin.
959
960         Return early if system font is empty.
961
962         * rendering/RenderThemeGtk.cpp:
963         (WebCore::RenderThemeGtk::updateCachedSystemFontDescription):
964
965 2015-06-24  Chris Dumez  <cdumez@apple.com>
966
967         Unreviewed, EFL build fix after r185940.
968
969         Members were initialized in wrong order.
970
971         * Modules/mediastream/MediaDeviceInfo.cpp:
972         (WebCore::MediaDeviceInfo::MediaDeviceInfo):
973
974 2015-06-24  Chris Dumez  <cdumez@apple.com>
975
976         Unreviewed, Build fix after r185940.
977
978         Move implementation inside WebCore namespace.
979
980         * Modules/mediastream/MediaDeviceInfo.cpp:
981
982 2015-06-24  Chris Dumez  <cdumez@apple.com>
983
984         Unreviewed, speculative GTK build fix after 185940.
985
986         Add new cpp file to CMakeLists.txt.
987
988         * CMakeLists.txt:
989
990 2015-06-24  Matt Daiter  <mdaiter@apple.com>
991
992         Building MediaDeviceInfo for enumerateDevices
993         https://bugs.webkit.org/show_bug.cgi?id=146257
994         <rdar://problem/21513462>
995
996         Reviewed by Eric Carlson.
997
998         MediaDeviceInfo necessary for enumerateDevices
999
1000         * CMakeLists.txt: Added MediaDevicesInfo.idl
1001         * DerivedSources.make: Added MediaDevicesInfo.idl
1002         * Modules/mediastream/MediaDeviceInfo.h: Created class for MediaDevicesInfo
1003         (WebCore::MediaDeviceInfo::create): Allocates class
1004         (WebCore::MediaDeviceInfo::MediaDeviceInfo): Creates class for public
1005         (WebCore::MediaDeviceInfo::~MediaDeviceInfo): 
1006         (WebCore::MediaDeviceInfo::label):
1007         (WebCore::MediaDeviceInfo::deviceId):
1008         (WebCore::MediaDeviceInfo::groupId):
1009         (WebCore::MediaDeviceInfo::kind):
1010         * Modules/mediastream/MediaDeviceInfo.idl:
1011         * WebCore.xcodeproj/project.pbxproj:
1012
1013 2015-06-24  Anders Carlsson  <andersca@apple.com>
1014
1015         Detect view services by using the "com.apple.UIKit.vends-view-services" entitlement
1016         https://bugs.webkit.org/show_bug.cgi?id=146301
1017
1018         Reviewed by Tim Horton.
1019
1020         * WebCore.xcodeproj/project.pbxproj:
1021         * platform/spi/cocoa/SecuritySPI.h:
1022
1023 2015-06-24  Said Abou-Hallawa  <sabouhallawa@apple.com>
1024
1025         Add a new color -apple-wireless-playback-target-active
1026         https://bugs.webkit.org/show_bug.cgi?id=146269
1027         <rdar://problem/21465189>
1028
1029         Reviewed by Dean Jackson.
1030
1031         At the moment we use -apple-system-blue to indicate an Airplay route is
1032         active. This might not always be blue, so we need to add another system
1033         color with a name that will allow us to change the underlying color.
1034         Initially -apple-wireless-playback-target-active will be an alias to
1035         -apple-system-blue.
1036
1037         Existing tests are modified to include the new color value.
1038
1039         * Modules/mediacontrols/mediaControlsApple.js:
1040         (Controller.prototype.updateWirelessTargetPickerButton):
1041         * Modules/mediacontrols/mediaControlsiOS.css:
1042         (video::-webkit-media-controls-wireless-playback-picker-button.playing):
1043         Use the new color value in the media controls.
1044         
1045         * css/CSSParser.cpp:
1046         (WebCore::isAppleLegacyCssValueKeyword): Returns true if the value keyword
1047         has an '-apple' prefix which has to be replaced by '-webkit'
1048         
1049         (WebCore::cssValueKeywordID): Call a new function which handles all the
1050         '-apple' legacy keywords.
1051         
1052         * css/CSSValueKeywords.in: Define the new color keyword.
1053         
1054         * rendering/RenderThemeIOS.mm:
1055         (WebCore::RenderThemeIOS::systemColor):
1056         * rendering/RenderThemeMac.mm:
1057         (WebCore::RenderThemeMac::systemColor):
1058         Define the value of the new color keyword to be an alias of systemBlueColor.
1059
1060 2015-06-24  Matt Rajca  <mrajca@apple.com>
1061
1062         MediaSession: propagate MediaSessionMetadata to WebPageProxy
1063         https://bugs.webkit.org/show_bug.cgi?id=146282
1064
1065         Reviewed by Darin Adler and Tim Horton.
1066
1067         * Modules/mediasession/MediaSession.cpp:
1068         (WebCore::MediaSession::setMetadata):
1069
1070 2015-06-24  Chris Dumez  <cdumez@apple.com>
1071
1072         Null dereference in DocumentLoader::areAllLoadersPageCacheAcceptable()
1073         https://bugs.webkit.org/show_bug.cgi?id=146286
1074         <rdar://problem/21523788>
1075
1076         Reviewed by Sam Weinig.
1077
1078         Add null check for the Page in areAllLoadersPageCacheAcceptable()
1079         to fix this top crasher until I can investigate how this can happen.
1080
1081         * loader/DocumentLoader.cpp:
1082         (WebCore::areAllLoadersPageCacheAcceptable):
1083
1084 2015-06-24  Anders Carlsson  <andersca@apple.com>
1085
1086         Move PluginMainThreadScheduler to WebKit/win
1087         https://bugs.webkit.org/show_bug.cgi?id=146289
1088
1089         Reviewed by Tim Horton.
1090
1091         * CMakeLists.txt:
1092         * Configurations/WebCore.xcconfig:
1093         * WebCore.vcxproj/WebCore.vcxproj:
1094         * WebCore.vcxproj/WebCore.vcxproj.filters:
1095         * WebCore.xcodeproj/project.pbxproj:
1096         * plugins/PluginMainThreadScheduler.cpp:
1097         (WebCore::PluginMainThreadScheduler::scheduler): Deleted.
1098         (WebCore::PluginMainThreadScheduler::PluginMainThreadScheduler): Deleted.
1099         (WebCore::PluginMainThreadScheduler::scheduleCall): Deleted.
1100         (WebCore::PluginMainThreadScheduler::registerPlugin): Deleted.
1101         (WebCore::PluginMainThreadScheduler::unregisterPlugin): Deleted.
1102         (WebCore::PluginMainThreadScheduler::dispatchCallsForPlugin): Deleted.
1103         (WebCore::PluginMainThreadScheduler::dispatchCalls): Deleted.
1104         (WebCore::PluginMainThreadScheduler::mainThreadCallback): Deleted.
1105         * plugins/PluginMainThreadScheduler.h:
1106         (WebCore::PluginMainThreadScheduler::Call::Call): Deleted.
1107         (WebCore::PluginMainThreadScheduler::Call::performCall): Deleted.
1108
1109 2015-06-24  Dean Jackson  <dino@apple.com>
1110
1111         Better fix for Element with blur backdrop-filter shows edge duplication and dark edges
1112         https://bugs.webkit.org/show_bug.cgi?id=146287
1113         <rdar://problem/21530437>
1114
1115         Reviewed by Simon Fraser.
1116
1117         There is no need to carry around a bit in FilterOperations indicating what
1118         type of source property the object came from. Whether or not to clip to the
1119         bounds of the filter region is purely a property of the type of CALayer
1120         we are applying the filter to.
1121
1122         This basically reverts r185846.
1123
1124         Covered by the test for the previous commit.
1125
1126         * css/CSSPropertyNames.in:
1127         * css/StyleBuilderConverter.h:
1128         (WebCore::StyleBuilderConverter::convertBackdropFilterOperations): Deleted.
1129         * page/animation/CSSPropertyAnimation.cpp:
1130         (WebCore::blendFilterOperations): Deleted.
1131         * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm: Set the normalized
1132         edges property if we are a CABackdropLayer.
1133         * platform/graphics/filters/FilterOperations.cpp:
1134         (WebCore::FilterOperations::operator==):
1135         (WebCore::FilterOperations::operationsMatch):
1136         (WebCore::FilterOperations::operator=): Deleted.
1137         * platform/graphics/filters/FilterOperations.h:
1138         (WebCore::FilterOperations::isUsedForBackdropFilters): Deleted.
1139         (WebCore::FilterOperations::setUsedForBackdropFilters): Deleted.
1140
1141 2015-06-24  Doug Russell  <d_russell@apple.com>
1142
1143         Bug 146177 - AX: AXObjectCache should try to use an unignored accessibilityObject 
1144         when posting a selection notification when on the border between two accessibilityObjects
1145         https://bugs.webkit.org/show_bug.cgi?id=146177
1146
1147         Reviewed by Darin Adler.
1148
1149         Add support for position to be passed for selection changes to allow checking.
1150         for boundaries in the case of ignored elements.
1151         Add support for searching for unignored siblings of AccessibilityObjects.
1152         Include AccessibilityObject wrappers in notifications for tests.
1153
1154         Test: platform/mac/accessibility/selection-element-tabbing-to-link.html
1155
1156         * accessibility/AXObjectCache.cpp:
1157         (WebCore::AXObjectCache::postTextStateChangeNotification):
1158         * accessibility/AXObjectCache.h:
1159         * accessibility/AccessibilityObject.cpp:
1160         (WebCore::AccessibilityObject::previousSiblingUnignored):
1161         (WebCore::AccessibilityObject::nextSiblingUnignored):
1162         * accessibility/AccessibilityObject.h:
1163         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
1164         (isValueTypeSupported):
1165         (arrayRemovingNonSupportedTypes):
1166         (dictionaryRemovingNonSupportedTypes):
1167         (-[WebAccessibilityObjectWrapperBase accessibilityPostedNotification:userInfo:]):
1168         * editing/mac/FrameSelectionMac.mm:
1169         (WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
1170
1171 2015-06-24  Anders Carlsson  <andersca@apple.com>
1172
1173         Enable -Winconsistent-missing-override when building with Xcode
1174         https://bugs.webkit.org/show_bug.cgi?id=146288
1175
1176         Reviewed by Sam Weinig.
1177
1178         * Configurations/Base.xcconfig:
1179         * Modules/encryptedmedia/MediaKeySession.h:
1180         * Modules/webdatabase/DatabaseTask.h:
1181         * html/DateTimeLocalInputType.h:
1182         * page/scrolling/ios/ScrollingCoordinatorIOS.h:
1183         * page/scrolling/mac/ScrollingCoordinatorMac.h:
1184         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
1185         (WebCore::MediaPlayerPrivateAVFoundation::platformLayer): Deleted.
1186         (WebCore::MediaPlayerPrivateAVFoundation::supportsScanning): Deleted.
1187         (WebCore::MediaPlayerPrivateAVFoundation::fileSize): Deleted.
1188         (WebCore::MediaPlayerPrivateAVFoundation::engineDescription): Deleted.
1189         (WebCore::MediaPlayerPrivateAVFoundation::platformErrorCode): Deleted.
1190         (WebCore::MediaPlayerPrivateAVFoundation::notifyTrackModeChanged): Deleted.
1191         * platform/graphics/avfoundation/VideoTrackPrivateAVF.h:
1192         (WebCore::VideoTrackPrivateAVF::trackIndex): Deleted.
1193         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
1194         (WebCore::CDMSessionAVFoundationObjC::type): Deleted.
1195         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
1196         (WebCore::CDMSessionMediaSourceAVFObjC::type): Deleted.
1197         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1198         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsAcceleratedRendering): Deleted.
1199         (WebCore::MediaPlayerPrivateAVFoundationObjC::canPlayToWirelessPlaybackTarget): Deleted.
1200         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1201         (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedCredential): Deleted.
1202         (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedRequestToContinueWithoutCredential): Deleted.
1203         (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedCancellation): Deleted.
1204         (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedRequestToPerformDefaultHandling): Deleted.
1205         (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedChallengeRejection): Deleted.
1206         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1207         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsFullscreen): Deleted.
1208         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
1209         (WebCore::MediaPlayerPrivateQTKit::supportsScanning): Deleted.
1210         (WebCore::MediaPlayerPrivateQTKit::networkState): Deleted.
1211         (WebCore::MediaPlayerPrivateQTKit::readyState): Deleted.
1212         (WebCore::MediaPlayerPrivateQTKit::maximumDurationToCacheMediaTime): Deleted.
1213         (WebCore::MediaPlayerPrivateQTKit::engineDescription): Deleted.
1214         * platform/mac/ScrollAnimatorMac.h:
1215         * platform/mac/SerializedPlatformRepresentationMac.h:
1216         (WebCore::SerializedPlatformRepresentationMac::platformType): Deleted.
1217         * platform/mac/ThemeMac.h:
1218         (WebCore::ThemeMac::controlRequiresPreWhiteSpace): Deleted.
1219         * testing/MockCDM.cpp:
1220         (WebCore::MockCDMSession::setClient): Deleted.
1221
1222 2015-06-24  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1223
1224         Improve JSDOMPromise callPromiseFunction naming
1225         https://bugs.webkit.org/show_bug.cgi?id=146280
1226
1227         Unreviewed.
1228
1229         No change in behavior.
1230
1231         * bindings/js/JSDOMPromise.h:
1232         (WebCore::callPromiseFunction):
1233
1234 2015-06-24  Tim Horton  <timothy_horton@apple.com>
1235
1236         REGRESSION (r185804): Crash selecting time in the form on https://backup.brighthorizons.com/BackupCareRequest.aspx
1237         <rdar://problem/21525376>
1238
1239         Reviewed by Sam Weinig.
1240
1241         * page/TextIndicator.cpp:
1242         (WebCore::TextIndicator::createWithRange):
1243         Null check.
1244
1245 2015-06-24  Zalan Bujtas  <zalan@apple.com>
1246
1247         Subpixel rendering: roundToDevicePixel() snaps to wrong value.
1248         https://bugs.webkit.org/show_bug.cgi?id=146273
1249         rdar://problem/18509840
1250
1251         Reviewed by Simon Fraser.
1252
1253         Due to the floating point approximate representation, we can't always produce
1254         the correct snap value. This patch addresses the issue by removing redundant kFixedPointDenominator multiplication
1255         and by changing the rounding in roundToDevicePixel() from float to double.
1256
1257         API test is added.
1258
1259         * platform/LayoutUnit.h:
1260         (WebCore::roundToDevicePixel):
1261
1262 2015-06-23  Matt Rajca  <mrajca@apple.com>
1263
1264         MediaSession: Support setting of metadata
1265         https://bugs.webkit.org/show_bug.cgi?id=146253
1266
1267         Reviewed by Eric Carlson.
1268
1269         * Modules/mediasession/MediaSession.cpp:
1270         (WebCore::MediaSession::MediaSession): Store a reference to the document so we can use it in setMetadata.
1271         (WebCore::MediaSession::setMetadata): Implemented as described in the Media Session spec.
1272         * Modules/mediasession/MediaSession.h:
1273         * Modules/mediasession/MediaSession.idl: Added the setMetadata method.
1274         * Modules/mediasession/MediaSessionMetadata.h:
1275         (WebCore::MediaSessionMetadata::MediaSessionMetadata): Added to keep track of media session metadata.
1276         (WebCore::MediaSessionMetadata::title):
1277         (WebCore::MediaSessionMetadata::artist):
1278         (WebCore::MediaSessionMetadata::album):
1279         (WebCore::MediaSessionMetadata::artworkURL):
1280         * WebCore.xcodeproj/project.pbxproj: Added MediaSessionMetadata.h.
1281
1282 2015-06-24  Daniel Bates  <dabates@apple.com>
1283
1284         Content Security Policy error message when frame load is blocked does not read well
1285         https://bugs.webkit.org/show_bug.cgi?id=146279
1286
1287         Reviewed by Csaba Osztrogonác.
1288
1289         Substitute "Refused to load frame" for "Refused to frame" as the prefix of the error message
1290         emitted when the Content Security Policy of the page blocks a frame load.
1291
1292         * page/ContentSecurityPolicy.cpp:
1293         (WebCore::CSPDirectiveList::checkSourceAndReportViolation):
1294
1295 2015-06-11  Sergio Villar Senin  <svillar@igalia.com>
1296
1297         intrinsic size keywords don't work for heights
1298         https://bugs.webkit.org/show_bug.cgi?id=113610
1299
1300         Reviewed by Darin Adler.
1301
1302         Based on Blink's r148314 & r150355 by <cbiesinger@chromium.org>.
1303
1304         Adds intrinsic values support to heigh & min/max-height. This involves the
1305         following changes:
1306         - RenderBox needs to pass the content height through to computeLogicalHeight and
1307         related functions, which needs it to resolve max-content, et. al.
1308         - Make the callers pass the content height to this function. Some callers pass
1309         logicalHeight() (adjusted for border/padding) which works because if
1310         logicalHeight is not the content height, then it is the height we ended up using,
1311         so the constrain* functions will just constrain to that value again.
1312         - Parsing code needs to be adjusted to support intrinsic values for heights.
1313
1314         Tests: fast/css-intrinsic-dimensions/height-css-tables-collapsed.html
1315                fast/css-intrinsic-dimensions/height-css-tables.html
1316                fast/css-intrinsic-dimensions/height-flexbox.html
1317                fast/css-intrinsic-dimensions/height-positioned-replaced.html
1318                fast/css-intrinsic-dimensions/height-positioned.html
1319                fast/css-intrinsic-dimensions/height-replaced.html
1320                fast/css-intrinsic-dimensions/height-tables-collapsed.html
1321                fast/css-intrinsic-dimensions/height-tables.html
1322                fast/css-intrinsic-dimensions/height.html
1323
1324         * css/CSSParser.cpp:
1325         (WebCore::CSSParser::isValidSize): Refactored from validateWidth and
1326         validateHeight.
1327         (WebCore::CSSParser::parseValue):
1328         (WebCore::CSSParser::validateWidth): Deleted.
1329         (WebCore::CSSParser::validateHeight): Deleted.
1330         * css/CSSParser.h:
1331         * platform/Length.h:
1332         (WebCore::Length::isFillAvailable):
1333         (WebCore::Length::isFitContent):
1334         * rendering/RenderBox.cpp:
1335         (WebCore::RenderBox::constrainLogicalHeightByMinMax):
1336         (WebCore::RenderBox::constrainContentBoxLogicalHeightByMinMax):
1337         (WebCore::RenderBox::computeLogicalHeight):
1338         (WebCore::RenderBox::computeLogicalHeightUsing):
1339         (WebCore::RenderBox::computeContentLogicalHeight):
1340         (WebCore::RenderBox::computeIntrinsicLogicalContentHeightUsing):
1341         (WebCore::RenderBox::computeContentAndScrollbarLogicalHeightUsing):
1342         (WebCore::RenderBox::computePercentageLogicalHeight):
1343         (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
1344         (WebCore::RenderBox::availableLogicalHeight):
1345         (WebCore::RenderBox::availableLogicalHeightUsing):
1346         (WebCore::RenderBox::computePositionedLogicalHeight):
1347         (WebCore::RenderBox::computePositionedLogicalHeightUsing):
1348         * rendering/RenderBox.h:
1349         * rendering/RenderFlexibleBox.cpp:
1350         (WebCore::RenderFlexibleBox::computeMainAxisExtentForChild):
1351         (WebCore::RenderFlexibleBox::applyStretchAlignmentToChild):
1352         * rendering/RenderFlowThread.cpp:
1353         (WebCore::RenderFlowThread::addForcedRegionBreak):
1354         * rendering/RenderGrid.cpp:
1355         (WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
1356         (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded):
1357         * rendering/RenderMultiColumnSet.cpp:
1358         (WebCore::RenderMultiColumnSet::calculateMaxColumnHeight):
1359         * rendering/RenderReplaced.cpp:
1360         (WebCore::RenderReplaced::hasReplacedLogicalHeight):
1361         * rendering/RenderTable.cpp:
1362         (WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight):
1363         (WebCore::RenderTable::layout):
1364
1365 2015-06-24  Commit Queue  <commit-queue@webkit.org>
1366
1367         Unreviewed, rolling out r185906.
1368         https://bugs.webkit.org/show_bug.cgi?id=146276
1369
1370         MSVC doesn't yet provide a const-qualified std::array<T,
1371         N>::size(), failing to compile the static_assert (Requested by
1372         zdobersek on #webkit).
1373
1374         Reverted changeset:
1375
1376         "Improve the source code generated by make_names.pl"
1377         https://bugs.webkit.org/show_bug.cgi?id=146208
1378         http://trac.webkit.org/changeset/185906
1379
1380 2015-06-24  Zan Dobersek  <zdobersek@igalia.com>
1381
1382         Improve the source code generated by make_names.pl
1383         https://bugs.webkit.org/show_bug.cgi?id=146208
1384
1385         Reviewed by Darin Adler.
1386
1387         Clean up and optimize the output that's generated by the make_names.pl script
1388         when generating large sets of DOM names for attributes and tags.
1389
1390         The GenerateStrings() function in the StaticString.pm module is split into
1391         GenerateStringData() and GenerateASCIILiteral() so that the two new functions
1392         can be used independently, with the original function still being called when
1393         generating font names.
1394
1395         Tags and attributes have the corresponding static QualifiedName globals defined
1396         as before. After that, two static const std::array<> objects are defined for
1397         both types -- the first is an ordered array of addresses of the QualifiedName
1398         objects (corresponding to the C array that was defined in getHTMLTags(),
1399         getSVGAttrs() etc.), and the second is an ordered array of StringImpl::StaticASCIILiteral
1400         objects that replaces separately defined StringImpl::StaticASCIILiteral objects
1401         and the additional tables that contained pairs of QualifiedName object addresses
1402         and the corresponding StaticASCIILiteral object references in the init() function.
1403         This is all generated by the printStaticData() function in make_names.pl.
1404
1405         The printQualifiedNameCreation() function generates a static_assert() that ensures
1406         that the corresponding std::array<QualifiedName*> and std::array<StaticASCIILiteral>
1407         objects have the same amount of items, and then sets up a loop that walks through
1408         the two arrays and properly constructs the QualifiedName objects from the static
1409         literal data.
1410
1411         On the GTK port, this shaves off ~54kB from the final stripped shared library
1412         on a 64-bit build, and ~21kB on a 32-bit build.
1413
1414         * bindings/scripts/StaticString.pm:
1415         (GenerateStringData):
1416         (GenerateASCIILiteral):
1417         (GenerateStrings):
1418         * dom/make_names.pl:
1419         (printCppHead):
1420         (printNamesCppFile):
1421         (printStaticData):
1422         (printQualifiedNameCreation):
1423         (printInit): Deleted.
1424         (printDefinitions): Deleted.
1425
1426 2015-06-24  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1427
1428         Refactor UserMediaRequest to share more codes between MediaDevices.getUserMedia and legacy webkitGetUserMedia
1429         https://bugs.webkit.org/show_bug.cgi?id=146237
1430
1431         Reviewed by Darin Adler.
1432
1433         Covered by existing tests, no change in behavior.
1434
1435         * Modules/mediastream/MediaConstraintsImpl.cpp:
1436         (WebCore::MediaConstraintsImpl::create): Simplified error handling by removing exception code parameter.
1437         * Modules/mediastream/MediaConstraintsImpl.h: Ditto.
1438         * Modules/mediastream/MediaDevices.cpp:
1439         (WebCore::MediaDevices::getUserMedia): Removed code now in UserMediaRequest::start.
1440         * Modules/mediastream/NavigatorUserMedia.cpp:
1441         (WebCore::NavigatorUserMedia::webkitGetUserMedia): Ditto.
1442         * Modules/mediastream/UserMediaRequest.cpp:
1443         (WebCore::parseOptions): Simplified error handling by removing exception code parameter.
1444         (WebCore::UserMediaRequest::start): Renamed create in start and added common code.
1445         * Modules/mediastream/UserMediaRequest.h:
1446
1447 2015-06-23  Andreas Kling  <akling@apple.com>
1448
1449         Should reduce tile coverage for the first paint after a tab switch.
1450         <https://webkit.org/b/146252>
1451         <rdar://problem/19821583>
1452
1453         Reviewed by Darin Adler.
1454
1455         Reduce the number of tiles we need to paint after switching tabs,
1456         to shorten the time it takes before we can flush pixels to screen.
1457
1458         We accomplish this by piggybacking on the "speculative tiling enabled"
1459         mode of FrameView, which was previously only used to throttle painting
1460         and layer flushes during page load.
1461
1462         When a FrameView becomes visible, which is what happens when you
1463         switch to its tab, we revert the speculative tiling optimization to
1464         its initial state, and reset the "scrolled by user" flag.
1465
1466         In practice this means that after switching tabs, we only generate
1467         enough tiles to fill the viewport. Then, after 500ms has passed
1468         or the user scrolls the page, we go back to the usual speculative
1469         tiling mode.
1470
1471         * page/FrameView.cpp:
1472         (WebCore::FrameView::show):
1473
1474 2015-06-23  Anders Carlsson  <andersca@apple.com>
1475
1476         Remove windowResizerRect code, nobody is using it anymore
1477         https://bugs.webkit.org/show_bug.cgi?id=146265
1478
1479         Reviewed by Beth Dakin.
1480
1481         * loader/EmptyClients.h:
1482         * page/Chrome.cpp:
1483         (WebCore::Chrome::windowResizerRect): Deleted.
1484         * page/Chrome.h:
1485         * page/ChromeClient.h:
1486         * page/FrameView.cpp:
1487         (WebCore::FrameView::windowResizerRect): Deleted.
1488         * page/FrameView.h:
1489         * platform/ScrollView.cpp:
1490         (WebCore::ScrollView::ScrollView): Deleted.
1491         (WebCore::ScrollView::windowResizerRectChanged): Deleted.
1492         (WebCore::ScrollView::containsScrollbarsAvoidingResizer): Deleted.
1493         (WebCore::ScrollView::adjustScrollbarsAvoidingResizerCount): Deleted.
1494         (WebCore::ScrollView::setParent): Deleted.
1495         * platform/ScrollView.h:
1496         (WebCore::ScrollView::windowResizerRect): Deleted.
1497         * platform/Scrollbar.cpp:
1498         (WebCore::Scrollbar::Scrollbar): Deleted.
1499         (WebCore::Scrollbar::setFrameRect): Deleted.
1500         (WebCore::Scrollbar::setParent): Deleted.
1501         * platform/Scrollbar.h:
1502
1503 2015-06-23  Dean Jackson  <dino@apple.com>
1504
1505         Media controls are missing the white backdrop in UIWebViews
1506         https://bugs.webkit.org/show_bug.cgi?id=146251
1507         <rdar://problem/20181345>
1508
1509         Reviewed by Simon Fraser.
1510
1511         Implement two new CALayer subclasses that explicitly set
1512         something that resembles the system appearance for
1513         media-controls-dark-bar-background and media-controls-light-bar-background.
1514         This way, WebKit1 clients get a visible result.
1515
1516         Creating the actual system recipes is tracked by:
1517         https://bugs.webkit.org/show_bug.cgi?id=146250
1518
1519         * WebCore.xcodeproj/project.pbxproj: Add new files.
1520         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1521         (PlatformCALayerCocoa::PlatformCALayerCocoa): Use the new CALayer subclasses for
1522         the appropriate layer types.
1523         * platform/graphics/ca/cocoa/WebSystemBackdropLayer.h: Added.
1524         * platform/graphics/ca/cocoa/WebSystemBackdropLayer.mm: Added.
1525         (-[WebLightSystemBackdropLayer init]):
1526         (-[WebLightSystemBackdropLayer setBackgroundColor:]): Only set to a light grey.
1527         (-[WebDarkSystemBackdropLayer init]):
1528         (-[WebDarkSystemBackdropLayer setBackgroundColor:]): Only set to a dark grey.
1529
1530 2015-06-18  Matt Rajca  <mrajca@apple.com>
1531
1532         Support releasing media sessions
1533         https://bugs.webkit.org/show_bug.cgi?id=146132
1534
1535         Reviewed by Darin Adler.
1536
1537         * Modules/mediasession/MediaSession.cpp: Implemented as described in the Media Session spec.
1538         (WebCore::MediaSession::releaseSession):
1539         (WebCore::MediaSession::releaseInternal):
1540         * Modules/mediasession/MediaSession.h:
1541
1542 2015-06-23  Chris Fleizach  <cfleizach@apple.com>
1543
1544         AX: iOS: VoiceOver and ARIA: has popup property not announced
1545         https://bugs.webkit.org/show_bug.cgi?id=146188
1546
1547         Reviewed by Darin Adler.
1548
1549         Expose the existing "has popup" property to the iOS Accessibility API.
1550
1551         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1552         (-[WebAccessibilityObjectWrapper accessibilityHasPopup]):
1553
1554 2015-06-23  Javier Fernandez  <jfernandez@igalia.com>
1555
1556         [CSS Grid Layout] Performance optimization: avoid computing overflow alignment if not needed
1557         https://bugs.webkit.org/show_bug.cgi?id=146231
1558
1559         Reviewed by Sergio Villar Senin.
1560
1561         We don't need to apply any overflow handling if alignment value don't have a potential
1562         risk of data loss, as it's the case of 'start' value.
1563
1564         This patch avoid computing the overflow in all the cases, since it adds an unneeded
1565         overhead which affects performance.
1566
1567         New code improves performance around 3%-8%, depending on the grid tests.
1568
1569         No new tests, no new funcitonality.
1570
1571         * rendering/RenderGrid.cpp:
1572         (WebCore::RenderGrid::rowPositionForChild):
1573         (WebCore::RenderGrid::columnPositionForChild):
1574
1575 2015-06-23  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1576
1577         MediaDevices.getUserMedia should migrate from callbacks to DOMPromise
1578         https://bugs.webkit.org/show_bug.cgi?id=146200
1579
1580         Reviewed by Darin Adler.
1581
1582         Introduced DOMPromiseWithCallback to resolve/reject promises while allowing promise clients to use a typed callback approach.
1583         Migrated MediaDevices.getUserMedia from callbacks to DOMPromiseWithCallback.
1584         Removed MediaDevices.getUserMedia custom binding.
1585
1586         Covered by existing tests.
1587
1588         * CMakeLists.txt: Removing custom binding.
1589         * Modules/mediastream/MediaDevices.cpp:
1590         (WebCore::MediaDevices::getUserMedia): Moving from callback to promise.
1591         * Modules/mediastream/MediaDevices.h: Ditto.
1592         * Modules/mediastream/MediaDevices.idl: Removing custom binding.
1593         * Modules/mediastream/NavigatorUserMedia.cpp:
1594         (WebCore::NavigatorUserMedia::webkitGetUserMedia): Converting from promise callback to API callbacks.
1595         * Modules/mediastream/UserMediaRequest.cpp:
1596         (WebCore::UserMediaRequest::create): Moving from callback to promise.
1597         (WebCore::UserMediaRequest::UserMediaRequest): Ditto.
1598         (WebCore::UserMediaRequest::didCreateStream): Ditto.
1599         (WebCore::UserMediaRequest::failedToCreateStreamWithConstraintsError): Ditto.
1600         (WebCore::UserMediaRequest::failedToCreateStreamWithPermissionError): Ditto.
1601         * Modules/mediastream/UserMediaRequest.h: Ditto.
1602         * bindings/js/JSDOMPromise.h: Introducing DOMPromiseWithCallback and removing crypto specific header.
1603         (WebCore::DOMPromiseWithCallback::DOMPromiseWithCallback):
1604         (WebCore::Error>::resolve):
1605         (WebCore::Error>::reject):
1606         * bindings/js/JSMediaDevicesCustom.cpp: Removed.
1607         * bindings/js/JSSubtleCryptoCustom.cpp: Updating headers.
1608
1609 2015-06-23  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
1610
1611         [Streams API] Implement ReadableStream js source "'cancel" callback
1612         https://bugs.webkit.org/show_bug.cgi?id=146204
1613
1614         Reviewed by Darin Adler.
1615
1616         Calling "cancel" JS function when web app is cancelling a JS readable stream.
1617         Handling of promise returned value in case of async cancel.
1618
1619         Covered by rebased tests.
1620
1621         * bindings/js/ReadableJSStream.cpp:
1622         (WebCore::ReadableJSStream::invoke): Refactoring to pass cancel reason or controller to the JS function.
1623         (WebCore::ReadableJSStream::doStart): Ditto.
1624         (WebCore::startReadableStreamAsync): Renaming readableStream as protectedStream.
1625         (WebCore::createPullResultFulfilledFunction): Ditto.
1626         (WebCore::ReadableJSStream::doPull): Refactoring to pass cancel reason or controller to the JS function.
1627         (WebCore::createCancelResultFulfilledFunction): Cancel promise fullfil callback.
1628         (WebCore::createCancelResultRejectedFunction): Cancel promise reject callback.
1629         (WebCore::ReadableJSStream::doCancel): Calling cancel JS callback and handling promise returned value.
1630         * bindings/js/ReadableJSStream.h: Refactoring to pass cancel reason or controller to the JS function.
1631
1632 2015-06-22  Ryuan Choi  <ryuan.choi@navercorp.com>
1633
1634         [EFL] Hyphenation is not supported
1635         https://bugs.webkit.org/show_bug.cgi?id=89830
1636
1637         Reviewed by Gyuyoung Kim.
1638
1639         Share libHyphen backend of GTK port.
1640
1641         Rebased fast/text/hyphenate-*.html
1642
1643         * PlatformEfl.cmake:
1644         * PlatformGTK.cmake:
1645         * platform/efl/FileSystemEfl.cpp:
1646         (WebCore::listDirectory): Deleted because of lack of functionality.
1647         eina_file_ls returns full directory path so fnmatch fails to check dict file.
1648         This patch reuse Posix implementation instead of EFL port specific function.
1649         * platform/posix/FileSystemPOSIX.cpp: Ditto.
1650         * platform/text/gtk/HyphenationLibHyphen.cpp: Moved to platform/text/hyphen
1651         * platform/text/hyphen/HyphenationLibHyphen.cpp:
1652         Renamed from Source/WebCore/platform/text/gtk/HyphenationLibHyphen.cpp.
1653         (WebCore::scanTestDictionariesDirectoryIfNecessary):
1654         Added PLATFORM guard and EFL implementation for the test directory
1655
1656 2015-06-22  Chris Dumez  <cdumez@apple.com>
1657
1658         [WK1] WebAllowDenyPolicyListener.denyOnlyThisRequest() should not start a new permission request
1659         https://bugs.webkit.org/show_bug.cgi?id=146228
1660         <rdar://problem/15179262>
1661
1662         Reviewed by Daniel Bates.
1663
1664         Add Geolocation::resetIsAllowed() API that merely resets
1665         m_allowGeolocation to Unknown, so that we will request the permission
1666         again the next time a position is requested.
1667
1668         * Modules/geolocation/Geolocation.h:
1669         (WebCore::Geolocation::resetIsAllowed):
1670
1671 2015-06-22  Simon Fraser  <simon.fraser@apple.com>
1672
1673         ASSERT(!m_zOrderListsDirty) when mousing over web view with incremental rendering suppressed
1674         https://bugs.webkit.org/show_bug.cgi?id=146225
1675
1676         Reviewed by Zalan Bujtas.
1677
1678         Update RenderLayer's z-order lists when hit testing. There's no guarantee that they've
1679         been updated; this happens to work most of the time because painting updates them,
1680         but if incremental rendering is suppressed, we may not have painted yet.
1681         
1682         Easy to hit on webkit.org in MiniBrowser, but I wasn't able to make a reduced testcase.
1683
1684         * rendering/RenderLayer.cpp:
1685         (WebCore::RenderLayer::hitTest):
1686         (WebCore::RenderLayer::updateLayerListsIfNeeded): Flip the order of the tests, since checking
1687         dirty bits is cheaper than calling isStackingContext().
1688
1689 2015-06-22  Dean Jackson  <dino@apple.com>
1690
1691         Rename PlatformCA*Mac to PlatformCA*Cocoa
1692         https://bugs.webkit.org/show_bug.cgi?id=146224
1693         <rdar://problem/21497182>
1694
1695         Reviewed by Simon Fraser.
1696
1697         Rename PlatformCALayerMac and related files in platform/graphics/ca/mac
1698         to the more accurate Cocoa suffix.
1699
1700         * WebCore.xcodeproj/project.pbxproj:
1701         * page/mac/ServicesOverlayController.mm:
1702         * platform/graphics/ca/GraphicsLayerCA.cpp:
1703         * platform/graphics/ca/PlatformCAAnimation.h:
1704         * platform/graphics/ca/PlatformCALayer.h:
1705         * platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp: Renamed from Source/WebCore/platform/graphics/ca/mac/LayerFlushSchedulerMac.cpp.
1706         * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.h: Renamed from Source/WebCore/platform/graphics/ca/mac/PlatformCAAnimationMac.h.
1707         * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm: Renamed from Source/WebCore/platform/graphics/ca/mac/PlatformCAAnimationMac.mm.
1708         * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm: Renamed from Source/WebCore/platform/graphics/ca/mac/PlatformCAFiltersMac.mm.
1709         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h: Renamed from Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h.
1710         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: Renamed from Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm.
1711         * platform/graphics/ca/cocoa/WebTiledBackingLayer.h: Renamed from Source/WebCore/platform/graphics/ca/mac/WebTiledBackingLayer.h.
1712         * platform/graphics/ca/cocoa/WebTiledBackingLayer.mm: Renamed from Source/WebCore/platform/graphics/ca/mac/WebTiledBackingLayer.mm.
1713         * platform/graphics/ca/mac/LayerFlushSchedulerMac.cpp:
1714         * platform/graphics/ca/mac/PlatformCAAnimationMac.mm:
1715         * platform/graphics/ca/mac/PlatformCAFiltersMac.mm:
1716         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
1717         * platform/graphics/ca/mac/WebTiledBackingLayer.mm:
1718
1719 2015-06-22  Alex Christensen  <achristensen@webkit.org>
1720
1721         [cssjit] Disable compiling scrollbar pseudoclass selectors
1722         https://bugs.webkit.org/show_bug.cgi?id=146220
1723
1724         Reviewed by Benjamin Poulain.
1725
1726         * cssjit/SelectorCompiler.cpp:
1727         (WebCore::SelectorCompiler::addScrollbarPseudoClassType):
1728         Don't compile selectors with scrollbar pseudoclasses.
1729
1730 2015-06-22  Simon Fraser  <simon.fraser@apple.com>
1731
1732         -webkit-clip-path clips incorrectly if the element bounds go beyond the top edge of the page
1733         https://bugs.webkit.org/show_bug.cgi?id=146218
1734         rdar://problem/21127840
1735
1736         Reviewed by Zalan Bujtas.
1737
1738         The clip path is computed using the RenderLayer's bounding box, so needs to be offset
1739         by the offsetFromRenderer when set on the mask layer.
1740
1741         Test: compositing/masks/compositing-clip-path-origin.html
1742
1743         * rendering/RenderLayerBacking.cpp:
1744         (WebCore::RenderLayerBacking::updateMaskingLayerGeometry):
1745
1746 2015-06-22  Michael Catanzaro  <mcatanzaro@igalia.com>
1747
1748         Web sockets should be treated as active mixed content
1749         https://bugs.webkit.org/show_bug.cgi?id=140624
1750
1751         Reviewed by Sam Weinig.
1752
1753         Tests: http/tests/security/mixedContent/websocket/insecure-websocket-in-iframe.html
1754                http/tests/security/mixedContent/websocket/insecure-websocket-in-main-frame.html
1755
1756         * Modules/websockets/WebSocket.cpp:
1757         (WebCore::WebSocket::connect): Block ws:// WebSocket connections from https:// pages, and
1758         emit the onerror event after doing so.
1759         * platform/SchemeRegistry.cpp:
1760         (WebCore::secureSchemes): Add wss:// to the list of secure schemes.
1761
1762 2015-06-22  Dean Jackson  <dino@apple.com>
1763
1764         Element with blur backdrop-filter shows edge duplication and dark edges
1765         https://bugs.webkit.org/show_bug.cgi?id=146215
1766         <rdar://problem/20367695>
1767
1768         Reviewed by Tim Horton.
1769
1770         The input images to backdrop filters should duplicate their edge pixels
1771         outwards, rather than using transparent pixels. This is a flag we
1772         set on the Gaussian blur, but means we have to remember if the
1773         FilterOperations list came from a regular filter or a backdrop filter.
1774
1775         Test: css3/filters/backdrop/blur-input-bounds.html
1776
1777         * css/CSSPropertyNames.in: New custom convertor for backdrop-filter.
1778         * css/StyleBuilderConverter.h:
1779         (WebCore::StyleBuilderConverter::convertBackdropFilterOperations): New convertor
1780         that sets the backdrop flag, but is otherwise the same as a normal filter
1781         convertor.
1782         * page/animation/CSSPropertyAnimation.cpp:
1783         (WebCore::blendFilterOperations): Inherit the backdrop flag if either of our
1784         inputs has it.
1785         * platform/graphics/ca/mac/PlatformCAFiltersMac.mm: Set the inputNormalizeEdges
1786         key on the CAFilter if necessary.
1787         * platform/graphics/filters/FilterOperations.cpp: Add a new flag indicating if
1788         these operations are intended for backdrops.
1789         (WebCore::FilterOperations::operator=):
1790         (WebCore::FilterOperations::operator==):
1791         * platform/graphics/filters/FilterOperations.h:
1792         (WebCore::FilterOperations::isUsedForBackdropFilters):
1793         (WebCore::FilterOperations::setUsedForBackdropFilters):
1794
1795 2015-06-22  Tim Horton  <timothy_horton@apple.com>
1796
1797         [TextIndicator] Text shifts one pixel to the left when I force click to bring up Lookup in Mail messages
1798         https://bugs.webkit.org/show_bug.cgi?id=146214
1799         <rdar://problem/20782970>
1800
1801         Reviewed by Dean Jackson.
1802
1803         * page/mac/TextIndicatorWindow.mm:
1804         (-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]):
1805         (WebCore::TextIndicatorWindow::setTextIndicator):
1806         (-[WebTextIndicatorView initWithFrame:textIndicator:margin:]): Deleted.
1807         When the WebView is at a nonintegral position, we can end up needing a TextIndicator
1808         with a nonintegral position. We need to round the window position, so we need to apply
1809         the fractional part to the indicator layers inside, not to the window.
1810
1811 2015-06-22  Myles C. Maxfield  <mmaxfield@apple.com>
1812
1813         [iOS] Arabic text styled with Georgia is rendered as boxes
1814         https://bugs.webkit.org/show_bug.cgi?id=145681
1815         <rdar://problem/21169844>
1816
1817         Reviewed by Darin Adler.
1818
1819         Georgia doesn't support Arabic, so we ask CoreText what font does support Arabic. It returns
1820         TimesNewRomanPSMT. However, WebKit explicitly disallows this font on iOS. Therefore, instead
1821         of using TimesNewRomanPSMT, we will simply just use GeezaPro.
1822
1823         Test: fast/text/arabic-times-new-roman.html
1824
1825         * platform/graphics/ios/FontCacheIOS.mm:
1826         (WebCore::FontCache::systemFallbackForCharacters):
1827         * platform/graphics/Font.h: Let FontCacheIOS call fontFamilyShouldNotBeUsedForArabic()
1828         * platform/graphics/cocoa/FontCocoa.mm:
1829         (WebCore::fontFamilyShouldNotBeUsedForArabic):
1830
1831 2015-06-22  Alex Christensen  <achristensen@webkit.org>
1832
1833         Unreviewed non-mac debug build fix after r185840.
1834
1835         * loader/ResourceLoader.cpp:
1836         (WebCore::ResourceLoader::willSendRequest):
1837         Added enable flag around assertion.
1838
1839 2015-06-20  Alex Christensen  <achristensen@webkit.org>
1840
1841         [Content Extensions] Add SPI to reload without content blocking.
1842         https://bugs.webkit.org/show_bug.cgi?id=146128
1843         rdar://problem/20351903
1844
1845         Reviewed by Sam Weinig.
1846
1847         * html/HTMLMediaElement.cpp:
1848         (WebCore::HTMLMediaElement::loadResource):
1849         * loader/ResourceLoader.cpp:
1850         (WebCore::ResourceLoader::willSendRequest):
1851         * loader/cache/CachedResourceLoader.cpp:
1852         (WebCore::CachedResourceLoader::requestResource):
1853         * page/DOMWindow.cpp:
1854         (WebCore::DOMWindow::open):
1855         * page/Page.h:
1856         (WebCore::Page::userContentController):
1857         (WebCore::Page::userContentExtensionsEnabled):
1858         (WebCore::Page::setUserContentExtensionsEnabled):
1859         (WebCore::Page::group):
1860         * page/UserContentController.cpp:
1861         (WebCore::UserContentController::removeAllUserContentExtensions):
1862         (WebCore::UserContentController::processContentExtensionRulesForLoad):
1863         (WebCore::UserContentController::actionsForResourceLoad):
1864         * page/UserContentController.h:
1865
1866 2015-06-22  Zalan Bujtas  <zalan@apple.com>
1867
1868         REGRESSION(r169105) Dangling renderer pointer in SelectionSubtreeRoot::SelectionSubtreeData.
1869         https://bugs.webkit.org/show_bug.cgi?id=146116
1870         rdar://problem/20959369
1871
1872         Reviewed by Brent Fulgham.
1873
1874         This patch ensures that we don't adjust the selection unless the visual selection still matches this subtree root.
1875
1876         When multiple selection roots are present we need to ensure that a RenderObject
1877         only shows up in one of them.
1878         RenderView::splitSelectionBetweenSubtrees(), as the name implies, splits the
1879         selection and sets the selection range (start/end) on each selection root.
1880         However, SelectionSubtreeRoot::adjustForVisibleSelection() later recomputes the range
1881         based on visible selection and that could end up collecting renderers as selection start/end
1882         from another selection subtree.
1883         RenderObject's holds the last selection state (RenderObject::setSelectionState).
1884         If we set a renderer first as "on selection border" and later "inside" using multiple selection roots,
1885         we can't clean up selections properly when this object gets destroyed.
1886         One of the roots ends up with a dangling RenderObject pointer.
1887
1888         Test: fast/regions/crash-when-renderer-is-in-multiple-selection-subtrees.html
1889
1890         * rendering/SelectionSubtreeRoot.cpp:
1891         (WebCore::SelectionSubtreeRoot::adjustForVisibleSelection):
1892
1893 2015-06-22  Jeremy Jones  <jeremyj@apple.com>
1894
1895         Do not exit fullscreen when starting PiP since this is done automatically.
1896         https://bugs.webkit.org/show_bug.cgi?id=144871
1897
1898         Reviewed by Darin Adler.
1899
1900         Since we don't explicitly exit fullscreen, update state in shouldExitFullscreenWithReason()
1901
1902         * platform/ios/WebVideoFullscreenInterfaceAVKit.h: Declare shouldExitFullscreenWithReason().
1903         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1904         (-[WebAVPlayerController playerViewController:shouldExitFullScreenWithReason:]): Forward to WebVideoFullscreenInterfaceAVKit.
1905         (WebVideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason): Added.
1906         (WebVideoFullscreenInterfaceAVKit::willStartPictureInPicture): Remove enter fullscreen code.
1907         * platform/spi/cocoa/AVKitSPI.h: Add missing enums.
1908
1909 2015-06-22  Daniel Bates  <dabates@apple.com>
1910
1911         AX: UI Automation cannot find AutoFill or search cancel buttons
1912         https://bugs.webkit.org/show_bug.cgi?id=145241
1913         <rdar://problem/21051411>
1914
1915         Reviewed by Chris Fleizach.
1916
1917         Add support for hit testing the search cancel button and AutoFill button so that
1918         they can be accessed by UI Automation.
1919
1920         Currently the accessibility hit test machinery ignores nodes in a shadow tree.
1921         So, it neither finds the <input type="search"> cancel button nor the AutoFill button
1922         when it performs a hit test. Therefore these buttons cannot be accessed using
1923         UI Automation.
1924
1925         Tests: accessibility/hit-test-input-auto-fill-button.html
1926                accessibility/hit-test-input-search-cancel-button.html
1927                accessibility/input-search-cancel-button.html
1928
1929         * accessibility/AccessibilityRenderObject.cpp:
1930         (WebCore::AccessibilityRenderObject::accessibilityTextFieldDecorationHitTest): Added; returns
1931         the AccessibilityObject for the search cancel button or AutoFill text field decoration as applicable.
1932         (WebCore::AccessibilityRenderObject::accessibilityHitTest): Check whether the hit node
1933         is a text field decoration.
1934
1935 2015-06-22  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
1936
1937         [Streams API] Implement ReadableStream cancel (abstract part)
1938         https://bugs.webkit.org/show_bug.cgi?id=146111
1939
1940         Reviewed by Darin Adler.
1941
1942         This patch implements ReadableStream and ReadableStreamReader cancel.
1943         The reader delegates cancellation to its stream.
1944
1945         This patch also ensures that controller.close() will not throw in case cancellation is on-going.
1946
1947         A follow-up patch will implement the calling of 'cancel' JS callback for JS sources.
1948
1949         Covered by rebased tests.
1950
1951         * Modules/streams/ReadableStream.cpp:
1952         (WebCore::ReadableStream::cancel): Checks whether locked or not before cancelling.
1953         (WebCore::ReadableStream::cancelNoCheck): Cancel without lock check.
1954         (WebCore::ReadableStream::notifyCancelSucceeded): Async cancel callback.
1955         (WebCore::ReadableStream::notifyCancelFailed): Ditto.
1956         * Modules/streams/ReadableStream.h:
1957         * Modules/streams/ReadableStream.idl: Cleaned up IDL.
1958         * Modules/streams/ReadableStreamReader.cpp:
1959         (WebCore::ReadableStreamReader::cancel):
1960         * Modules/streams/ReadableStreamReader.h:
1961         * Modules/streams/ReadableStreamReader.idl: Cleaned up IDL
1962         * bindings/js/JSReadableStreamControllerCustom.cpp:
1963         (WebCore::JSReadableStreamController::close):
1964         * bindings/js/JSReadableStreamCustom.cpp:
1965         (WebCore::JSReadableStream::cancel):
1966         * bindings/js/JSReadableStreamReaderCustom.cpp:
1967         (WebCore::JSReadableStreamReader::cancel):
1968         * bindings/js/ReadableJSStream.cpp:
1969         (WebCore::ReadableJSStream::doCancel):
1970         * bindings/js/ReadableJSStream.h:
1971
1972 2015-06-22  Adam Bergkvist  <adam.bergkvist@ericsson.com>
1973
1974         WebRTC: Navigator.webkitGetUserMedia() requires three arguments
1975         https://bugs.webkit.org/show_bug.cgi?id=146022
1976
1977         Reviewed by Eric Carlson.
1978
1979         Updated custom binding to make the third error callback argument
1980         mandatory. Updated and unskipped three tests (for the GTK+ port).
1981
1982         * bindings/js/JSNavigatorCustom.cpp:
1983         (WebCore::JSNavigator::webkitGetUserMedia):
1984
1985 2015-06-22  Carlos Garcia Campos  <cgarcia@igalia.com>
1986
1987         Unreviewed. Fix GTK+ build after r185818.
1988
1989         Actually rollout r185320.
1990
1991         * platform/network/soup/DNSSoup.cpp:
1992         (WebCore::DNSResolveQueue::platformProxyIsEnabledInSystemPreferences):
1993         (WebCore::DNSResolveQueue::platformResolve):
1994         (WebCore::gotProxySettingsCallback): Deleted.
1995         (WebCore::DNSResolveQueue::platformMaybeResolveHost): Deleted.
1996
1997 2015-06-16  Gavin Barraclough  <barraclough@apple.com>
1998
1999         Page load performance regression due to bugs.webkit.org/show_bug.cgi?id=145542
2000         https://bugs.webkit.org/show_bug.cgi?id=146198
2001
2002         Unreviewed rollout.
2003
2004         * platform/network/DNSResolveQueue.cpp:
2005         (WebCore::DNSResolveQueue::DNSResolveQueue):
2006         (WebCore::DNSResolveQueue::isUsingProxy):
2007         (WebCore::DNSResolveQueue::add):
2008         (WebCore::DNSResolveQueue::timerFired):
2009         * platform/network/DNSResolveQueue.h:
2010         * platform/network/cf/DNSCFNet.cpp:
2011         (WebCore::DNSResolveQueue::platformProxyIsEnabledInSystemPreferences):
2012         (WebCore::clientCallback):
2013         (WebCore::DNSResolveQueue::platformResolve):
2014         (WebCore::proxyIsEnabledInSystemPreferences): Deleted.
2015         (WebCore::isUsingProxy): Deleted.
2016         (WebCore::DNSResolveQueue::platformMaybeResolveHost): Deleted.
2017         * platform/network/soup/DNSSoup.cpp:
2018
2019 2015-06-21  Alexey Proskuryakov  <ap@apple.com>
2020
2021         REGRESSION (r172975): navigator.language unable to tell region for Traditional Chinese users
2022         https://bugs.webkit.org/show_bug.cgi?id=146121
2023         rdar://problem/21395180
2024
2025         Reviewed by Darin Adler.
2026
2027         Revert to previous behavior, which is wrong in many ways, but not as wrong as the new one.
2028
2029         * platform/mac/Language.mm:
2030         (WebCore::httpStyleLanguageCode):
2031         (WebCore::platformUserPreferredLanguages):
2032         * platform/spi/cf/CFBundleSPI.h:
2033
2034 2015-06-19  Andy Estes  <aestes@apple.com>
2035
2036         Give Node::didNotifySubtreeInsertions() a better name
2037         https://bugs.webkit.org/show_bug.cgi?id=146170
2038
2039         Reviewed by Darin Adler.
2040
2041         didNotifySubtreeInsertions() is not a good name. It sounds like we are notifying the subtree insertions, which doesn't make sense.
2042
2043         This function is really about notifying the Node that the subtree it's a part of has finished being inserted into the DOM
2044         (i.e. all nodes have received their call to insertedInto()). Change the name to finishedInsertingSubtree() to better reflect this.
2045
2046         * dom/ContainerNode.cpp:
2047         (WebCore::ContainerNode::notifyChildInserted):
2048         * dom/ContainerNodeAlgorithms.h:
2049         (WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoDocument):
2050         (WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoTree):
2051         * dom/Element.cpp:
2052         (WebCore::Element::addShadowRoot):
2053         * dom/Node.h:
2054         (WebCore::Node::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
2055         (WebCore::Node::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
2056         * dom/ScriptElement.cpp:
2057         (WebCore::ScriptElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
2058         (WebCore::ScriptElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
2059         * dom/ScriptElement.h:
2060         * html/HTMLFrameElementBase.cpp:
2061         (WebCore::HTMLFrameElementBase::insertedInto):
2062         (WebCore::HTMLFrameElementBase::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
2063         (WebCore::HTMLFrameElementBase::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
2064         * html/HTMLFrameElementBase.h:
2065         * html/HTMLScriptElement.cpp:
2066         (WebCore::HTMLScriptElement::insertedInto):
2067         (WebCore::HTMLScriptElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
2068         (WebCore::HTMLScriptElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
2069         * html/HTMLScriptElement.h:
2070         * svg/SVGFEImageElement.cpp:
2071         (WebCore::SVGFEImageElement::insertedInto):
2072         (WebCore::SVGFEImageElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
2073         (WebCore::SVGFEImageElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
2074         * svg/SVGFEImageElement.h:
2075         * svg/SVGMPathElement.cpp:
2076         (WebCore::SVGMPathElement::insertedInto):
2077         (WebCore::SVGMPathElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
2078         (WebCore::SVGMPathElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
2079         * svg/SVGMPathElement.h:
2080         * svg/SVGScriptElement.cpp:
2081         (WebCore::SVGScriptElement::insertedInto):
2082         (WebCore::SVGScriptElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
2083         (WebCore::SVGScriptElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
2084         * svg/SVGScriptElement.h:
2085         * svg/SVGTRefElement.cpp:
2086         (WebCore::SVGTRefElement::insertedInto):
2087         (WebCore::SVGTRefElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
2088         (WebCore::SVGTRefElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
2089         * svg/SVGTRefElement.h:
2090         * svg/SVGTextPathElement.cpp:
2091         (WebCore::SVGTextPathElement::insertedInto):
2092         (WebCore::SVGTextPathElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
2093         (WebCore::SVGTextPathElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
2094         * svg/SVGTextPathElement.h:
2095         * svg/animation/SVGSMILElement.cpp:
2096         (WebCore::SVGSMILElement::insertedInto):
2097         (WebCore::SVGSMILElement::finishedInsertingSubtree): Renamed from didNotifySubtreeInsertions.
2098         (WebCore::SVGSMILElement::didNotifySubtreeInsertions): Renamed to finishedInsertingSubtree.
2099         * svg/animation/SVGSMILElement.h:
2100
2101 2015-06-21  Philip Chimento  <philip.chimento@gmail.com>
2102
2103         libwebkit2gtk fails to link without opengl
2104         https://bugs.webkit.org/show_bug.cgi?id=138332
2105
2106         Reviewed by Carlos Garcia Campos.
2107
2108         * CMakeLists.txt: The third-party ANGLE directories need to be
2109         included even if ENABLE(GRAPHICS_CONTEXT_3D) is false. They must
2110         be included after the OpenGL headers as the comment says.
2111         * platform/graphics/texmap/BitmapTexturePool.cpp: Remove
2112         reference to no longer existent header file.
2113
2114 2015-06-20  Tim Horton  <timothy_horton@apple.com>
2115
2116         Deselection of text causes a noticeable jump on force touch machines
2117         https://bugs.webkit.org/show_bug.cgi?id=146173
2118         <rdar://problem/20992842>
2119
2120         Reviewed by Sam Weinig.
2121
2122         When we have a TextIndicator of type Crossfade, we end up putting
2123         a layer with the blue highlight + text painted into it on top of the
2124         content, and cross-fading that layer to the yellow-highlighted text.
2125
2126         This is necessary for BounceAndCrossfade TextIndicators, because the
2127         blue highlight has to bounce, but is not necessary for Crossfade-only
2128         ones; we can just fade in the yellow highlight on top of the
2129         existing blue page highlight, and all is well.
2130
2131         So, get rid of the Crossfade TextIndicator type and use FadeIn, separately
2132         keeping track of whether or not we can add a margin (we still can't
2133         add a margin to TextIndicators that indicate the page's current selection,
2134         because the blue highlight cannot have the margin applied to it, and we
2135         want the bounds to match exactly).
2136
2137         * page/TextIndicator.cpp:
2138         (WebCore::TextIndicator::createWithRange):
2139         If the range is the same as the selection, turn off the margin.
2140         We were previously doing this based on the presentation transition, but now
2141         there's no difference in presentation transition in this case.
2142
2143         (WebCore::TextIndicator::createWithSelectionInFrame):
2144         (WebCore::TextIndicator::wantsBounce):
2145         (WebCore::TextIndicator::wantsContentCrossfade):
2146         (WebCore::TextIndicator::wantsFadeIn):
2147         (WebCore::TextIndicator::wantsManualAnimation):
2148         * page/TextIndicator.h:
2149         Get rid of TextIndicatorPresentationTransition::Crossfade.
2150
2151         (WebCore::TextIndicator::setWantsMargin):
2152         (WebCore::TextIndicator::wantsMargin):
2153         Keep track of whether we want a margin.
2154
2155         * page/mac/TextIndicatorWindow.mm:
2156         (-[WebTextIndicatorView initWithFrame:textIndicator:margin:]):
2157         Determine if we should use a margin based on wantsMargin instead of the
2158         presentation transition.
2159
2160 2015-06-20  Ryuan Choi  <ryuan.choi@navercorp.com>
2161
2162         [EFL] Do not consider test directories when DEVELOPER_MODE is OFF
2163         https://bugs.webkit.org/show_bug.cgi?id=146171
2164
2165         Reviewed by Gyuyoung Kim.
2166
2167         * platform/efl/EflInspectorUtilities.cpp:
2168         (WebCore::inspectorResourcePath): Only used WEB_INSPECTOR_DIR which CMake decides properly.
2169
2170 2015-06-19  Michael Catanzaro  <mcatanzaro@igalia.com>
2171
2172         Fix absolute value warning in LocalizedStringsGtk.cpp
2173         https://bugs.webkit.org/show_bug.cgi?id=145919
2174
2175         Reviewed by Martin Robinson.
2176
2177         Use abs(static_cast<int>(time)) rather than static_cast<int>(abs(time)) to avoid clang's
2178         warnings about passing a float to abs() instead of std::abs(). Also, because casting an int
2179         to an int is silly.
2180
2181         * platform/gtk/LocalizedStringsGtk.cpp:
2182         (WebCore::localizedMediaTimeDescription):
2183
2184 2015-06-19  Devin Rousso  <drousso@apple.com>
2185
2186         Web Inspector: Highlight currently edited CSS selector
2187         https://bugs.webkit.org/show_bug.cgi?id=145658
2188
2189         Reviewed by Joseph Pecoraro.
2190
2191         Test: inspector/dom/highlight-multiple-shapes.html
2192
2193         * inspector/InspectorController.cpp:
2194         (WebCore::InspectorController::buildObjectForHighlightedNode):
2195         * inspector/InspectorController.h:
2196         * inspector/InspectorDOMAgent.cpp:
2197         (WebCore::InspectorDOMAgent::highlightSelector): Gets a list of all nodes matching a given selector string and highlights each of them.
2198         * inspector/InspectorDOMAgent.h:
2199         * inspector/InspectorOverlay.cpp:
2200         (WebCore::InspectorOverlay::hideHighlight):
2201         (WebCore::InspectorOverlay::highlightNodeList): Loops through a given NodeList to create highlightObjects for each of them.
2202         (WebCore::InspectorOverlay::shouldShowOverlay):
2203         (WebCore::buildObjectForElementData): Don't show flow fragments when highlighting multiple nodes.
2204         (WebCore::InspectorOverlay::buildHighlightObjectForNode):
2205         (WebCore::InspectorOverlay::buildObjectForHighlightedNode): Now returns an array containing the highlightObject for each highligthed node.
2206         (WebCore::InspectorOverlay::drawNodeHighlight): Now sends an array to the InspectorOverlayPage.js to provide support for highlighting multiple nodes.
2207         * inspector/InspectorOverlay.h:
2208         * inspector/InspectorOverlayPage.js: Now expects an array as its parameter and loops through it to highlight each node given.
2209         If the parameter array contains more than one element, do not draw the textbox containing info on that node.
2210         (drawNodeHighlight):
2211
2212 2015-06-19  Joseph Pecoraro  <pecoraro@apple.com>
2213
2214         Crash under WebCore::PageConsoleClient::addMessage attempting to log insecure content message in ImageDocument
2215         https://bugs.webkit.org/show_bug.cgi?id=146096
2216
2217         Reviewed by Timothy Hatcher.
2218
2219         Was able to reproduce this using a user stylesheet with an http css font
2220         on a pdf (ImageDocument) main document loaded over https. Was unable to
2221         create a reliable test for this scenario.
2222
2223         * page/PageConsoleClient.cpp:
2224         (WebCore::getParserLocationForConsoleMessage):
2225         The scriptableDocumentParser could be null, such as in an ImageDocument.
2226
2227 2015-06-19  Dean Jackson  <dino@apple.com>
2228
2229         Extremely large canvas crashes on pre-El Capitan machines
2230         https://bugs.webkit.org/show_bug.cgi?id=146169
2231         <rdar://problem/21410046>
2232
2233         Reviewed by Tim Horton.
2234
2235         On machines before El Capitan, make the maximum canvas size
2236         8k by 8k.
2237
2238         Covered by existing tests.
2239
2240         * html/HTMLCanvasElement.cpp:
2241
2242 2015-06-19  Tim Horton  <timothy_horton@apple.com>
2243
2244         Selection services cannot be invoked when force click is enabled
2245         https://bugs.webkit.org/show_bug.cgi?id=146166
2246         <rdar://problem/21468362>
2247
2248         Reviewed by Darin Adler.
2249
2250         * page/mac/ServicesOverlayController.h:
2251         Turn Highlight::Type into something we can use for dirty flags.
2252
2253         * page/mac/ServicesOverlayController.mm:
2254         (WebCore::ServicesOverlayController::Highlight::createForSelection):
2255         (WebCore::ServicesOverlayController::Highlight::createForTelephoneNumber):
2256         (WebCore::ServicesOverlayController::ServicesOverlayController):
2257         (WebCore::ServicesOverlayController::selectionRectsDidChange):
2258         (WebCore::ServicesOverlayController::selectedTelephoneNumberRangesChanged):
2259         (WebCore::ServicesOverlayController::invalidateHighlightsOfType):
2260         (WebCore::ServicesOverlayController::buildPotentialHighlightsIfNeeded):
2261         (WebCore::ServicesOverlayController::remainingTimeUntilHighlightShouldBeShown):
2262         (WebCore::ServicesOverlayController::buildPhoneNumberHighlights):
2263         (WebCore::ServicesOverlayController::buildSelectionHighlight):
2264         (WebCore::ServicesOverlayController::findTelephoneNumberHighlightContainingSelectionHighlight):
2265         (WebCore::ServicesOverlayController::determineActiveHighlight):
2266         (WebCore::ServicesOverlayController::didScrollFrame):
2267         (WebCore::ServicesOverlayController::handleClick):
2268         Coalesce highlight rebuilding so that things (like TextIndicator creation)
2269         that change the selection and then reset it immediately don't cause us
2270         to lose the active highlight.
2271
2272         This also means that if the selection changes multiple times in a runloop
2273         (easily possible from script), we won't waste a lot of time rebuilding highlights.
2274
2275         (WebCore::ServicesOverlayController::didRebuildPotentialHighlights):
2276         Merged into buildPotentialHighlightsIfNeeded.
2277
2278 2015-06-19  Matt Baker  <mattbaker@apple.com>
2279
2280         Web Inspector: TimelineAgent needs to handle nested runloops
2281         https://bugs.webkit.org/show_bug.cgi?id=145090
2282
2283         Reviewed by Joseph Pecoraro.
2284
2285         Previously nested run loops caused InspectorTimelineAgent to prematurely pop the current run loop record. This
2286         patch adds a counter to track the run loop nesting level, and rendering frame records are only pushed/popped
2287         when the nesting level is zero. Run loop entry/exit notifications received while the debugger is paused do not
2288         affect the nesting level.
2289
2290         * inspector/InspectorTimelineAgent.cpp:
2291         (WebCore::InspectorTimelineAgent::internalStart):
2292         (WebCore::InspectorTimelineAgent::internalStop):
2293         (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
2294         * inspector/InspectorTimelineAgent.h:
2295
2296 2015-06-19  Brent Fulgham  <bfulgham@apple.com>
2297
2298         Follow-up fix to r185766.
2299         https://bugs.webkit.org/show_bug.cgi?id=22132
2300
2301         Reviewed by Zalan Bujtas.
2302
2303         Suggested by Darin Adler in the bug.
2304
2305         * platform/graphics/filters/FETile.cpp:
2306         (WebCore::FETile::platformApplySoftware): Use WTF::move when passing
2307         the new tileImageCopy RefPtr.
2308
2309 2015-06-19  Michael Catanzaro  <mcatanzaro@igalia.com>
2310
2311         [SOUP] Fix return-type-c-linkage warning after r185553
2312         https://bugs.webkit.org/show_bug.cgi?id=146014
2313
2314         Reviewed by Martin Robinson.
2315
2316         * platform/network/soup/WebKitSoupRequestGeneric.cpp:
2317         (webkitSoupRequestGenericGetRequest): Return a pointer rather than a reference.
2318         * platform/network/soup/WebKitSoupRequestGeneric.h: webkitSoupRequestGenericGetRequest now
2319         returns a pointer rather than a reference.
2320
2321 2015-06-19  Dean Jackson  <dino@apple.com>
2322
2323         Played <audio> looks invisible against the gray background
2324         https://bugs.webkit.org/show_bug.cgi?id=146164
2325         <rdar://problem/21014284>
2326
2327         Reviewed by Brent Fulgham.
2328
2329         The plus-darker blend mode was not allowing any white to
2330         show through in the rendering. We don't need this for
2331         audio controls, where we draw on an opaque grey background.
2332
2333         * Modules/mediacontrols/mediaControlsiOS.css:
2334         (audio::-webkit-media-controls-panel): Darken the color of the controls a
2335         little to make white stand out more.
2336         (audio::-webkit-media-controls-timeline): Remove the plus-darker blending.
2337         (video::-webkit-media-controls-timeline): Apply blending only to video.
2338
2339 2015-06-19  Andy Estes  <aestes@apple.com>
2340
2341         Various assertion failures occur when executing script in the midst of DOM insertion
2342         https://bugs.webkit.org/show_bug.cgi?id=132482
2343
2344         Reviewed by Darin Adler.
2345
2346         Prior to this change, when an element containing a <script> child was inserted into a document, the script was
2347         executed in ScriptElement::insertedInto(). That script can access nodes that follow it in the newly-inserted
2348         hierarchy but are not yet fully inserted, leading to at least the following problems:
2349
2350             - The script could remove a node that is not yet marked as in the document.
2351             - The script could remove a named <map> that has yet to be added to TreeScope::m_imageMapsByName.
2352             - The script could remove a form control that has yet to be added to FormController::m_formElementsWithState.
2353
2354         These scenarios all result in assertion failures. This change ensures that each node in the newly-inserted
2355         hierarchy is fully inserted before executing any scripts.
2356
2357         Tests: fast/dom/element-removed-while-inserting-parent-crash.html
2358                fast/dom/named-map-removed-while-inserting-parent-crash.html
2359                fast/forms/form-control-removed-while-inserting-parent-crash.html
2360                svg/dom/element-removed-while-inserting-parent-crash.html
2361
2362         * dom/ScriptElement.cpp:
2363         (WebCore::ScriptElement::shouldNotifySubtreeInsertions): Renamed from insertedInto().
2364         Returned true in the case where insertedInto() would've called prepareScript().
2365         (WebCore::ScriptElement::didNotifySubtreeInsertions): Called prepareScript().
2366         (WebCore::ScriptElement::insertedInto): Renamed to shouldNotifySubtreeInsertions().
2367         * dom/ScriptElement.h:
2368         * html/HTMLScriptElement.cpp:
2369         (WebCore::HTMLScriptElement::insertedInto): If shouldNotifySubtreeInsertions() is true, returned InsertionShouldCallDidNotifySubtreeInsertions.
2370         Otherwise, returned InsertionDone.
2371         (WebCore::HTMLScriptElement::didNotifySubtreeInsertions): Called ScriptElement::didNotifySubtreeInsertions().
2372         * html/HTMLScriptElement.h:
2373         * svg/SVGScriptElement.cpp:
2374         (WebCore::SVGScriptElement::insertedInto): Did the same as HTMLScriptElement::insertedInto().
2375         (WebCore::SVGScriptElement::didNotifySubtreeInsertions): Called ScriptElement::didNotifySubtreeInsertions().
2376         * svg/SVGScriptElement.h:
2377
2378 2015-06-19  Brent Fulgham  <bfulgham@apple.com>
2379
2380         All calls of ImageBuffer::create should null check the return value
2381         https://bugs.webkit.org/show_bug.cgi?id=22132
2382
2383         Reviewed by Zalan Bujtas.
2384
2385         ImageBuffer::create returns nullptr for a number of reasons, and should be
2386         expected to do so. We missed this check in a few places, resulting in
2387         crashes on some systems. Likewise, ImageBuffer::copyImage may return nullptr
2388         in normal use and should be checked.
2389
2390         * platform/graphics/BitmapImage.cpp:
2391         (WebCore::BitmapImage::drawPattern): Add nullptr check for create and copyImage. Remove
2392         extra call to 'setImageObserver'.
2393         * platform/graphics/cairo/ImageBufferCairo.cpp:
2394         (WebCore::ImageBuffer::drawPattern): Add nullptr check for copyImage.
2395         * platform/graphics/cg/ImageBufferCG.cpp:
2396         (WebCore::ImageBuffer::drawPattern): Add nullptr checks for copyImage.
2397         * platform/graphics/filters/FETile.cpp:
2398         (WebCore::FETile::platformApplySoftware): Add nullptr check for copyImage.
2399         * platform/graphics/filters/FilterEffect.cpp:
2400         (WebCore::FilterEffect::asImageBuffer): Add nullptr check for create.
2401         (WebCore::FilterEffect::openCLImageToImageBuffer): Ditto.
2402         * platform/graphics/texmap/BitmapTexture.cpp:
2403         (WebCore::BitmapTexture::updateContents): Add nullptr checks for create and copyImage.
2404         * svg/graphics/SVGImage.cpp:
2405         (WebCore::SVGImage::drawPatternForContainer): Add nullptr check for copyImage.
2406
2407 2015-06-19  Jeremy Jones  <jeremyj@apple.com>
2408
2409         Get CAContext directly for CALayer instead of walking the layer tree.
2410         https://bugs.webkit.org/show_bug.cgi?id=146138
2411         <rdar://problem/21455974>
2412
2413         Reviewed by Darin Adler.
2414
2415         This will get the context directly from the CALayer instead of getting all CAContexts, walking the layer tree 
2416         to the root and comparing that against each CAContext's root layer.
2417
2418         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2419         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
2420
2421 2015-06-18  Brent Fulgham  <bfulgham@apple.com>
2422
2423         [iOS] scrollIntoViewIfNeeded is not working with scroll-snap points
2424         https://bugs.webkit.org/show_bug.cgi?id=145318
2425         <rdar://problem/21081501>
2426
2427         Reviewed by Simon Fraser.
2428
2429         Use the ScrollController in iOS to track the scroll snap point state.
2430         We do not need the animation implementation or timers since the actual
2431         animation is handled by UIKit.
2432
2433         This change lets us communicate the current offset into the scroll snap
2434         offset vector between the WebProcess and RemoteScrollingTree so that
2435         both sides stay in sync regardless of whether user gestures or style
2436         updates have caused us to shift to a different snap point.
2437
2438         * page/scrolling/AsyncScrollingCoordinator.cpp:
2439         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated): Set the
2440         current horizontal and vertical scroll snap offset indices.
2441         (WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode): Ditto.
2442         * page/scrolling/AsyncScrollingCoordinator.h: Mark the setActiveScrollSnapIndices
2443         for export so that it can be reached by the UIProcess.
2444         * page/scrolling/ScrollingCoordinator.h: Keep track of horizontal and
2445         vertical scroll snap offset indices.
2446         * page/scrolling/ScrollingStateScrollingNode.cpp:
2447         (WebCore::ScrollingStateScrollingNode::setCurrentHorizontalSnapPointIndex): Added.
2448         (WebCore::ScrollingStateScrollingNode::setCurrentVerticalSnapPointIndex): Added.
2449         * page/scrolling/ScrollingStateScrollingNode.h:
2450         (WebCore::ScrollingStateScrollingNode::currentHorizontalSnapPointIndex): Added.
2451         (WebCore::ScrollingStateScrollingNode::currentVerticalSnapPointIndex): Added.
2452         * page/scrolling/ScrollingTree.h:
2453         * page/scrolling/ScrollingTreeScrollingNode.cpp:
2454         (WebCore::ScrollingTreeScrollingNode::updateBeforeChildren): Update the scroll snap
2455         point offset indices if either has changed.
2456         * page/scrolling/ScrollingTreeScrollingNode.h:
2457         (WebCore::ScrollingTreeScrollingNode::currentHorizontalSnapPointIndex): Added.
2458         (WebCore::ScrollingTreeScrollingNode::currentVerticalSnapPointIndex): Added.
2459         (WebCore::ScrollingTreeScrollingNode::setCurrentHorizontalSnapPointIndex): Added.
2460         (WebCore::ScrollingTreeScrollingNode::setCurrentVerticalSnapPointIndex): Added.
2461         * page/scrolling/ThreadedScrollingTree.cpp:
2462         (WebCore::ThreadedScrollingTree::currentSnapPointIndicesDidChange): New method
2463         to handle notifications about scroll snap index changes from the UIProcess.
2464         * page/scrolling/ThreadedScrollingTree.h:
2465         * page/scrolling/ios/ScrollingTreeIOS.cpp:
2466         (WebCore::ScrollingTreeIOS::currentSnapPointIndicesDidChange): New method
2467         to handle notifications about scroll snap index changes from the UIProcess.
2468         * page/scrolling/ios/ScrollingTreeIOS.h:
2469         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2470         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren): Update scroll
2471         snap point current offset indices if they have changed.
2472         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollOffsetOnAxis): Remove unneeded
2473         PLATFORM(MAC) macro.
2474         * platform/ScrollAnimator.cpp:
2475         (WebCore::ScrollAnimator::ScrollAnimator): We have a ScrollController if we are
2476         supporting scroll snap points or rubber banding.
2477         (WebCore::ScrollAnimator::processWheelEventForScrollSnap): This method is not needed
2478         for iOS builds.
2479         (WebCore::ScrollAnimator::updateActiveScrollSnapIndexForOffset): Enable this on iOS.
2480         (WebCore::ScrollAnimator::updateScrollSnapState): Renamed from 'updateScrollAnimatorsAndTimers'
2481         and enabled on iOS.
2482         (WebCore::ScrollAnimator::updateScrollAnimatorsAndTimers): Deleted.
2483         * platform/ScrollAnimator.h: Enable some scroll snap methods on iOS.
2484         * platform/ScrollableArea.cpp:
2485         (WebCore::ScrollableArea::handleWheelEvent): Enable scroll snap index bookkeeping on iOS, too.
2486         (WebCore::ScrollableArea::updateScrollSnapState): Revise to call 'updateScrollSnapState' instead
2487         of 'updateScrollAnimatorsAndTimers'.
2488         * platform/cocoa/ScrollController.h: Enable some methods on iOS. Reorder methods to
2489         reduce the number of macros needed to do so.
2490         * platform/cocoa/ScrollController.mm:
2491         (systemUptime): Only build for Mac.
2492         (WebCore::ScrollController::ScrollController): Disable rubber band-specific members on iOS.
2493         (WebCore::ScrollController::handleWheelEvent): Only build this on Mac.
2494         (WebCore::ScrollController::isRubberBandInProgress): Always return 'false' on iOS.
2495         (WebCore::ScrollController::startSnapRubberbandTimer): Only build this on Mac.
2496         (WebCore::ScrollController::shouldRubberBandInHorizontalDirection): Ditto.
2497         (WebCore::ScrollController::scrollSnapPointState): Enable on iOS.
2498         (WebCore::ScrollController::hasActiveScrollSnapTimerForAxis): Only build on Mac.
2499         (WebCore::ScrollController::updateScrollSnapState): renamed from 'updateScrollAnimatorsAndTimers'
2500         (WebCore::ScrollController::startScrollSnapTimer): Only build on Mac.
2501         (WebCore::ScrollController::initializeGlideParameters): Ditto.
2502         (WebCore::ScrollController::activeScrollSnapIndexForAxis): Enable on iOS.
2503         (WebCore::ScrollController::setActiveScrollSnapIndicesForOffset): Ditto.
2504         (WebCore::ScrollController::beginScrollSnapAnimation): Only build on Mac.
2505         (WebCore::ScrollController::computeGlideDelta): Ditto.
2506         (WebCore::ScrollController::updateScrollAnimatorsAndTimers): Deleted.
2507         * rendering/RenderLayerCompositor.cpp:
2508         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): Capture any changes in scroll
2509         snap offset indices.
2510
2511 2015-06-19  Jeremy Jones  <jeremyj@apple.com>
2512
2513         Fullscreen view should not update bounds of video when in PiP.
2514         https://bugs.webkit.org/show_bug.cgi?id=146134
2515
2516         Reviewed by Darin Adler.
2517
2518         Don't update bounds on video layer when it is not a child.
2519
2520         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2521         (-[WebAVVideoLayer setBounds:]):
2522
2523 2015-06-19  Zalan Bujtas  <zalan@apple.com>
2524
2525         RenderRubyText requires RenderRubyRun parent.
2526         https://bugs.webkit.org/show_bug.cgi?id=146148
2527         rdar://problem/21423319
2528
2529         Reviewed by Simon Fraser.
2530
2531         RenderRubyText expects its parent to be RenderRubyRun and since a
2532         a non-block <rt> requires anonymous wrapper, we should check whether
2533         the display type is actually block.
2534
2535         Test: fast/ruby/crash-when-ruby-rt-is-non-block.html
2536
2537         * html/RubyTextElement.cpp:
2538         (WebCore::RubyTextElement::createElementRenderer):
2539
2540 2015-06-19  Jeremy Jones  <jeremyj@apple.com>
2541
2542         cancelPreviousPerformRequestsWithTarget for -resolveBounds in wrong class.
2543         https://bugs.webkit.org/show_bug.cgi?id=146140
2544
2545         Reviewed by Eric Carlson.
2546
2547         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2548         (-[WebCALayerHostWrapper dealloc]): Added.
2549         (-[WebAVVideoLayer dealloc]): Deleted.
2550
2551 2015-06-19  Per Arne Vollan  <peavo@outlook.com>
2552
2553         [WinCairo] Null pointer crash in BitmapTexture::updateContents.
2554         https://bugs.webkit.org/show_bug.cgi?id=146147
2555
2556         Reviewed by Brent Fulgham.
2557
2558         Added null pointer check.
2559
2560         * platform/graphics/texmap/BitmapTexture.cpp:
2561         (WebCore::BitmapTexture::updateContents):
2562
2563 2015-06-19  Anders Carlsson  <andersca@apple.com>
2564
2565         Spintracer treats the web process as hung when it's showing JavaScript dialogs in the UI process
2566         https://bugs.webkit.org/show_bug.cgi?id=146124
2567         rdar://problem/21449395
2568
2569         Reviewed by Geoffrey Garen.
2570
2571         * platform/spi/cg/CoreGraphicsSPI.h:
2572
2573 2015-06-19  Csaba Osztrogonác  <ossy@webkit.org>
2574
2575         Remove unnecessary svn:executable flags
2576         https://bugs.webkit.org/show_bug.cgi?id=146107
2577
2578         Reviewed by Alexey Proskuryakov.
2579
2580         * html/canvas/CanvasRenderingContext2D.cpp: Removed property svn:executable.
2581         * mathml/MathMLMencloseElement.cpp: Removed property svn:executable.
2582         * mathml/MathMLMencloseElement.h: Removed property svn:executable.
2583         * platform/efl/RenderThemeEfl.cpp: Removed property svn:executable.
2584         * rendering/mathml/RenderMathMLMenclose.cpp: Removed property svn:executable.
2585         * rendering/mathml/RenderMathMLMenclose.h: Removed property svn:executable.
2586
2587 2015-06-19  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2588
2589         Bindings generator should generate code to catch exception and reject promises for Promise-based APIs
2590         https://bugs.webkit.org/show_bug.cgi?id=146060
2591
2592         Reviewed by Darin Adler.
2593
2594         The binding generator splits the function that binds JS to the DOM class implementation in two for functions returning promise.
2595         The first function, called from JS, is responsible of casting this to the expected JSXXX class.
2596         If casting fails, an exception is raised. Otherwise, it calls the second function.
2597         After calling the second function, it checks whether an exception is raised, in which case it returns a rejected promise.
2598         The second function is responsible of argument conversion and calling the DOM class function.
2599
2600         Covered by expectations and AudioContext promise still working.
2601         A test case is added for a promise returning function taking a typed argument as input (if argument value cannot be typed, the promise is rejected).
2602         A second test case is a promise-returning function that can raise an exception. In that case the DOMException is used as rejection value.
2603
2604         As can be seen from generated code, this generalized code adds a mandatory check (is there an exception?) at the end of the function.
2605         This check is done even in cases we know there will be no exception.
2606         This may be covered by another patch if this optimization is thought useful enough.
2607
2608         * bindings/js/JSDOMPromise.cpp:
2609         (WebCore::rejectPromiseWithExceptionIfAny): Utility method for the binding code.
2610         (WebCore::callPromiseFunction): Ditto.
2611         * bindings/js/JSDOMPromise.h:
2612         * bindings/scripts/CodeGeneratorJS.pm:
2613         (GenerateImplementation):
2614         (GenerateFunctionCastedThis): Extracted from GenerateImplementationFunctionCall to reuse it in case of promise-returning functions.
2615         (GenerateImplementationFunctionCall):
2616         (GenerateCallbackImplementation): Deleted.
2617         * bindings/scripts/test/JS/JSTestObj.cpp:
2618         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunction):
2619         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionPromise):
2620         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgument):
2621         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
2622         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithException):
2623         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithExceptionPromise):
2624         * bindings/scripts/test/TestObj.idl:
2625
2626 2015-06-18  Jeremy Jones  <jeremyj@apple.com>
2627
2628         Disable UIWindow for fullscreen video for selected clients.
2629         https://bugs.webkit.org/show_bug.cgi?id=145852
2630
2631         Reviewed by Simon Fraser.
2632
2633         Disable UIWindow for fullscreen video doesn't work everywhere (rdar://problem/21315993), so just disable it when creating a UIWindow won't work.
2634         Fix some interface hiding and layout problems that showed up in the non UIWindow code path.
2635
2636         * platform/RuntimeApplicationChecksIOS.h:
2637         * platform/RuntimeApplicationChecksIOS.mm: Remove iAD bundle identifier.
2638         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2639         (WebVideoFullscreenInterfaceAVKit::setupFullscreen): Opt out of UIWindow when hosted in another process. And fix view parenting for non-window case.
2640         (WebVideoFullscreenInterfaceAVKit::exitFullscreen): Fix for AVKit exit fullscreen complaining about -needsLayout.
2641
2642         (WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen):
2643         (WebVideoFullscreenInterfaceAVKit::preparedToReturnToInline):
2644         (WebVideoFullscreenInterfaceAVKit::willStartOptimizedFullscreen):
2645         (WebVideoFullscreenInterfaceAVKit::didStartOptimizedFullscreen):
2646         (WebVideoFullscreenInterfaceAVKit::willStopOptimizedFullscreen):
2647         (WebVideoFullscreenInterfaceAVKit::didStopOptimizedFullscreen):
2648         These hide and show the view controller where we hide and show the window.
2649
2650 2015-06-18  Dean Jackson  <dino@apple.com>
2651
2652         Provide a way for web developers to draw a Theme-specific Wireless Playback icon
2653         https://bugs.webkit.org/show_bug.cgi?id=146123
2654         <rdar://problem/21119287>
2655
2656         Reviewed by Simon Fraser.
2657
2658         Implement a -webkit-named-image() CSS <image> generator that allows a site to
2659         request artwork by name and get the platform variant. At the moment
2660         we only support "wireless-playback" which returns a generic image everywhere
2661         but Cocoa platforms, where we render the AirPlay icon.
2662
2663         In order to do this I added a ThemeCocoa to share any Theme code between
2664         Mac and iOS.
2665
2666         Test: fast/css/named-icons.html
2667
2668         * WebCore.xcodeproj/project.pbxproj: Add new files CSSNamedImageValue, NamedImageGeneratedImage and ThemeCocoa.
2669
2670         * css/CSSImageGeneratorValue.cpp: Handle the new NamedImageClass in the switch statements for downcasting.
2671         (WebCore::CSSImageGeneratorValue::image):
2672         (WebCore::CSSImageGeneratorValue::isFixedSize):
2673         (WebCore::CSSImageGeneratorValue::isPending):
2674         (WebCore::CSSImageGeneratorValue::knownToBeOpaque):
2675
2676         * css/CSSNamedImageValue.cpp: New class. Just holds a name String.
2677         (WebCore::CSSNamedImageValue::customCSSText):
2678         (WebCore::CSSNamedImageValue::image):
2679         (WebCore::CSSNamedImageValue::equals):
2680         * css/CSSNamedImageValue.h:
2681         (WebCore::CSSNamedImageValue::create):
2682         (WebCore::CSSNamedImageValue::isFixedSize):
2683         (WebCore::CSSNamedImageValue::isPending):
2684         (WebCore::CSSNamedImageValue::CSSNamedImageValue):
2685
2686         * css/CSSParser.cpp:
2687         (WebCore::CSSParser::isGeneratedImageValue): Allow "-webkit-named-image(".
2688         (WebCore::CSSParser::parseGeneratedImage): Call parseNamedImage if we hit named-icon.
2689         (WebCore::CSSParser::parseNamedImage): Parse the function looking for a CSS ident.
2690         * css/CSSParser.h:
2691
2692         * css/CSSValue.cpp: Handle NamedImageClass in the various switch statements.
2693         (WebCore::CSSValue::equals):
2694         (WebCore::CSSValue::cssText):
2695         (WebCore::CSSValue::destroy):
2696         * css/CSSValue.h:
2697         (WebCore::CSSValue::isNamedImageValue): Helper to detect the correct CSSValue subclass.
2698
2699         * platform/Theme.cpp:
2700         (WebCore::Theme::drawNamedImage): Draw a generic wireless playback icon.
2701         * platform/Theme.h: Add drawNamedImage.
2702
2703         * platform/cocoa/ThemeCocoa.cpp: New shared base class for ThemeMac and ThemeIOS.
2704         (WebCore::fitContextToBox):
2705         (WebCore::ThemeCocoa::drawNamedImage): Draw an AirPlay icon for wireless playback.
2706         * platform/cocoa/ThemeCocoa.h:
2707
2708         * platform/graphics/CrossfadeGeneratedImage.h: Drive-by removal of unnecessary forward class definition.
2709
2710         * platform/graphics/ImageBuffer.h: Add NamedImageGeneratedImage as a friend class.
2711
2712         * platform/graphics/NamedImageGeneratedImage.cpp: New class. Calls into the Theme to render the artwork.
2713         (WebCore::NamedImageGeneratedImage::NamedImageGeneratedImage):
2714         (WebCore::NamedImageGeneratedImage::draw):
2715         (WebCore::NamedImageGeneratedImage::drawPattern):
2716         * platform/graphics/NamedImageGeneratedImage.h:
2717
2718         * platform/ios/ThemeIOS.h: Inherit from ThemeCocoa.
2719         * platform/mac/ThemeMac.h: Ditto.
2720
2721 2015-06-18  KyungTae Kim  <ktf.kim@samsung.com> and Myles C. Maxfield  <mmaxfield@apple.com>
2722
2723         [CSS3] Add support for the word-break:keep-all CSS property
2724         https://bugs.webkit.org/show_bug.cgi?id=123782
2725
2726         Reviewed by Darin Adler.
2727
2728         Add support for word-break:keep-all CSS property by CSS3 spec:
2729         http://www.w3.org/TR/2013/WD-css-text-3-20131010/#word-break-property
2730
2731         Test: fast/text/word-break-keep-all.html
2732
2733         * css/CSSParser.cpp:
2734         (WebCore::isValidKeywordPropertyAndValue):
2735         * css/CSSPrimitiveValueMappings.h:
2736         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2737         (WebCore::CSSPrimitiveValue::operator EWordBreak):
2738         * css/CSSValueKeywords.in:
2739         * rendering/RenderText.cpp:
2740         (WebCore::RenderText::computePreferredLogicalWidths):
2741         * rendering/break_lines.h:
2742         (WebCore::nextBreakablePositionKeepingAllWords):
2743         (WebCore::nextBreakablePositionKeepingAllWordsIgnoringNBSP):
2744         (WebCore::isBreakable):
2745         * rendering/line/BreakingContext.h:
2746         (WebCore::BreakingContext::handleText):
2747         (WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord):
2748         * rendering/style/RenderStyleConstants.h:
2749
2750 2015-06-18  Jon Lee  <jonlee@apple.com>
2751
2752         Update AVKit usage of pip
2753         https://bugs.webkit.org/show_bug.cgi?id=146095
2754         <rdar://problem/21386853>
2755
2756         Reviewed by Eric Carlson.
2757
2758         - Rename enum VideoFullscreenModeOptimized to VideoFullscreenModePictureInPicture
2759         - Rename MediaElementSession::allowsAlternateFullscreen to allowsPictureInPicture
2760         - Rename Settings::allowsAlternateFullscreen to allowsPictureInPictureMediaPlayback
2761         - Update AVKit calls and AVKitSPI.h
2762         - Rename WebVideoFullscreenInterfaceAVKit delegate functions and member variables
2763
2764         * html/HTMLMediaElement.cpp:
2765         * html/HTMLVideoElement.cpp:
2766         * html/MediaElementSession.cpp:
2767         (WebCore::MediaElementSession::allowsPictureInPicture): Renamed.
2768         (WebCore::MediaElementSession::allowsAlternateFullscreen): Deleted.
2769         * html/MediaElementSession.h:
2770         * page/Settings.cpp:
2771         * page/Settings.in:
2772         * platform/graphics/MediaPlayerEnums.h:
2773         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2774         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
2775         * platform/ios/WebVideoFullscreenInterfaceAVKit.h: Remove unused setIsOptimized.
2776         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2777         * platform/spi/cocoa/AVKitSPI.h: Remove unused typedef.
2778         * platform/spi/mac/AVFoundationSPI.h:
2779
2780 2015-06-18  Jeremy Jones  <jeremyj@apple.com>
2781
2782         Fix crash when entering fullscreen during exit fullscreen animation.
2783         https://bugs.webkit.org/show_bug.cgi?id=146117
2784
2785         Reviewed by Simon Fraser.
2786
2787         Because enterFullscreen can be called during exitFullscreen animation, the exit fullscreen teardown
2788         should not imply a fullscreen state change on video element.
2789
2790         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
2791         (WebVideoFullscreenControllerContext::exitFullscreen): May be called from mainThread
2792         (-[WebVideoFullscreenController exitFullscreen]): May be called from mainThread
2793         * platform/ios/WebVideoFullscreenModelVideoElement.mm:
2794         (WebVideoFullscreenModelVideoElement::setVideoElement): 
2795         Changing associated video element does not imply fullscreen mode change.
2796
2797 2015-06-18  Brian J. Burg  <burg@cs.washington.edu>
2798
2799         Web Inspector: improve generated types for objects passed to backend commands
2800         https://bugs.webkit.org/show_bug.cgi?id=146091
2801
2802         Reviewed by Joseph Pecoraro.
2803
2804         Update type signatures for backend command implementations. In a few cases, clean
2805         up relevant helper function signatures and copy data out of parameter objects where
2806         the code previously held onto a reference.
2807
2808         No new tests, no behavior changed.
2809
2810         * inspector/InspectorCSSAgent.cpp:
2811         (WebCore::computePseudoClassMask):
2812         (WebCore::InspectorCSSAgent::setStyleText):
2813         (WebCore::InspectorCSSAgent::setRuleSelector):
2814         (WebCore::InspectorCSSAgent::forcePseudoState):
2815         * inspector/InspectorCSSAgent.h:
2816         * inspector/InspectorDOMAgent.cpp:
2817         (WebCore::parseColor):
2818         (WebCore::parseConfigColor):
2819         (WebCore::parseQuad):
2820         (WebCore::InspectorDOMAgent::performSearch):
2821         (WebCore::InspectorDOMAgent::setSearchingForNode):
2822         (WebCore::InspectorDOMAgent::highlightConfigFromInspectorObject):
2823         (WebCore::InspectorDOMAgent::setInspectModeEnabled):
2824         (WebCore::InspectorDOMAgent::highlightRect):
2825         (WebCore::InspectorDOMAgent::highlightQuad):
2826         (WebCore::InspectorDOMAgent::innerHighlightQuad):
2827         (WebCore::InspectorDOMAgent::highlightNode):
2828         (WebCore::InspectorDOMAgent::highlightFrame):
2829         * inspector/InspectorDOMAgent.h:
2830         * inspector/InspectorDOMStorageAgent.cpp:
2831         (WebCore::InspectorDOMStorageAgent::getDOMStorageItems):
2832         (WebCore::InspectorDOMStorageAgent::setDOMStorageItem):
2833         (WebCore::InspectorDOMStorageAgent::removeDOMStorageItem):
2834         (WebCore::InspectorDOMStorageAgent::findStorageArea):
2835         * inspector/InspectorDOMStorageAgent.h:
2836         * inspector/InspectorIndexedDBAgent.cpp:
2837         (WebCore::InspectorIndexedDBAgent::requestData):
2838         * inspector/InspectorIndexedDBAgent.h:
2839         * inspector/InspectorReplayAgent.cpp:
2840         (WebCore::InspectorReplayAgent::replayToPosition):
2841         * inspector/InspectorReplayAgent.h:
2842         * inspector/InspectorResourceAgent.cpp:
2843         (WebCore::InspectorResourceAgent::willSendRequest):
2844         (WebCore::InspectorResourceAgent::setExtraHTTPHeaders):
2845         Clean up extraHTTPHeaders to copy header key/values out of the InspectorObject, rather
2846         than retaining the protocol object indefinitely. This matches the ownership scheme used
2847         everywhere else.
2848
2849         * inspector/InspectorResourceAgent.h:
2850         * inspector/InspectorStyleSheet.h:
2851         (WebCore::InspectorCSSId::InspectorCSSId):
2852         * inspector/InspectorWorkerAgent.cpp:
2853         (WebCore::InspectorWorkerAgent::sendMessageToWorker):
2854         * inspector/InspectorWorkerAgent.h:
2855
2856 2015-06-18  Anders Carlsson  <andersca@apple.com>
2857
2858         Remove shouldInterruptJavaScript
2859         https://bugs.webkit.org/show_bug.cgi?id=146118
2860
2861         Reviewed by Antti Koivisto.
2862
2863         The WebKit SPI methods for deciding whether JavaScript execution should be interrupted hasn't been used
2864         for many releases. Furthermore, they don't make sense in the multi-process architecture since it's still possible
2865         to interrupt execution (by closing the browser tab or window) from the UI process.
2866
2867         * bindings/js/JSDOMWindowBase.cpp:
2868         (WebCore::JSDOMWindowBase::shouldInterruptScript):
2869         * loader/EmptyClients.h:
2870         * page/Chrome.cpp:
2871         (WebCore::Chrome::shouldInterruptJavaScript): Deleted.
2872         * page/Chrome.h:
2873         * page/ChromeClient.h:
2874
2875 2015-06-18  Benjamin Poulain  <bpoulain@apple.com>
2876
2877         [CSS JIT][ARMv7] The pseudo element early exit trashes r6
2878         https://bugs.webkit.org/show_bug.cgi?id=146078
2879
2880         Reviewed by Alex Christensen.
2881
2882         The pseudo element early failure runs before we generate the prologue.
2883         The reason is that we can often exit immediately on function entry, before
2884         we even touch any memory.
2885
2886         On ARMv7, we don't have many spare registers so the MacroAssembler
2887         uses r6 as a scratch register and the client code is expected to save
2888         it.
2889
2890         In the early failure case, we were not pushing r6 before using the MacroAssembler
2891         and its value could be trashed.
2892
2893         This patch push the macro assembler registers separately from the prologue.
2894
2895         For restoring the registers, a new function generateFunctionEnding() encapsulate
2896         the pop() and ret().
2897
2898         * cssjit/SelectorCompiler.cpp:
2899         (WebCore::SelectorCompiler::SelectorCodeGenerator::pushMacroAssemblerRegisters):
2900         (WebCore::SelectorCompiler::SelectorCodeGenerator::popMacroAssemblerRegisters):
2901         (WebCore::SelectorCompiler::SelectorCodeGenerator::generatePrologue):
2902         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateEpilogue):
2903         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
2904
2905         * cssjit/StackAllocator.h:
2906         (WebCore::StackAllocator::operator=):
2907         We have a new case for the stack allocator: some stack changes are conditional
2908         at compile time instead of runtime. This is easy to deal with by overriding
2909         the stack if a path is not taken at compile time.
2910
2911 2015-06-17  Conrad Shultz  <conrad_shultz@apple.com>
2912
2913         REGRESSION: js/dom/navigator-plugins-crash.html asserts a lot
2914         https://bugs.webkit.org/show_bug.cgi?id=144399
2915
2916         Reviewed by Darin Adler.
2917
2918         Earlier work made the array of web-visible plug-ins dynamic, but allowed DOMPlugin (and, indirectly by extension,
2919         DOMMimeType) to continue keeping a reference to a plug-in in terms of an index into that array. This superficially
2920         appeared correct since DOMPlugin immutably holds onto a PluginData instance, which in turn immutably holds onto a
2921         Page instance. PluginStrategy::getWebVisiblePluginInfo() is passed this Page, which is used to determine the contents
2922         of the plugin array. The expectation was that keeping an index would still be safe since the Page is not changing,
2923         but this is not strictly correct since relevant attributes of the Page and/or the available plugins may still change.
2924
2925         It's not entirely clear why the test failures are intermittent and occur only on certain configurations, but address
2926         them by eliminating the incorrect storage of indexes in favor of keeping copies of the relevant plugin info itself.
2927
2928         * plugins/DOMMimeType.cpp:
2929         (WebCore::DOMMimeType::DOMMimeType):
2930         Instead of storing the MIME type index, retrieve and store the MIME class info and plugin info.
2931         (WebCore::DOMMimeType::type):
2932         Directly access the m_mimeClassInfo member.
2933         (WebCore::DOMMimeType::suffixes):
2934         Ditto.
2935         (WebCore::DOMMimeType::description):
2936         Ditto.
2937         (WebCore::DOMMimeType::enabledPlugin):
2938         Directly access the m_pluginInfo member.
2939         (WebCore::DOMMimeType::mimeClassInfo): Deleted.
2940
2941         * plugins/DOMMimeType.h:
2942         Update member variables.
2943
2944         * plugins/DOMPlugin.cpp:
2945         (WebCore::DOMPlugin::DOMPlugin):
2946         Instead of storing the plugin index, store the plugin info directly.
2947         (WebCore::DOMPlugin::name):
2948         Directly access m_pluginInfo.
2949         (WebCore::DOMPlugin::filename):
2950         Ditto.
2951         (WebCore::DOMPlugin::description):
2952         Ditto.
2953         (WebCore::DOMPlugin::length):
2954         Ditto.
2955         (WebCore::DOMPlugin::item):
2956         Access m_pluginInfo directly; find the matching plug-in based on matching PluginInfo (for which an overloaded
2957         comparator is supplied below).
2958         (WebCore::DOMPlugin::pluginInfo): Deleted.
2959
2960         * plugins/DOMPlugin.h:
2961         Update member variables.
2962         (WebCore::DOMPlugin::create):
2963         Accept a PluginInfo instead of a plugin index.
2964
2965         * plugins/DOMPluginArray.cpp:
2966         (WebCore::DOMPluginArray::item):
2967         (WebCore::DOMPluginArray::namedItem):
2968
2969         * plugins/PluginData.h:
2970         (WebCore::operator==):
2971         Added; compare PluginInfo structs on the basis of member equality.
2972
2973 2015-06-17  Alex Christensen  <achristensen@webkit.org>
2974
2975         [Content Extensions] Log blocked loads to the WebInspector console
2976         https://bugs.webkit.org/show_bug.cgi?id=146089
2977
2978         Reviewed by Joseph Pecoraro.
2979
2980         * contentextensions/ContentExtensionsBackend.cpp:
2981         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
2982         (WebCore::ContentExtensions::ContentExtensionsBackend::displayNoneCSSRule):
2983         Log which URLs are blocked and the URL of the page they are blocked from.
2984
2985 2015-06-18  Joseph Pecoraro  <pecoraro@apple.com>
2986
2987         Crash under WebCore::DOMWindow::dispatchMessageEventWithOriginCheck attempting to log console message
2988         https://bugs.webkit.org/show_bug.cgi?id=146093
2989
2990         Reviewed by Timothy Hatcher.
2991
2992         * page/DOMWindow.cpp:
2993         (WebCore::DOMWindow::dispatchMessageEventWithOriginCheck):
2994         The console could be null so null check its use.
2995
2996 2015-06-18  Csaba Osztrogonác  <ossy@webkit.org>
2997
2998         Suppress null-conversion warnings in ANGLE
2999         https://bugs.webkit.org/show_bug.cgi?id=145125
3000
3001         Reviewed by Alex Christensen.
3002
3003         * CMakeLists.txt:
3004
3005 2015-06-18  Youenn Fablet <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar  <calvaris@igalia.com>
3006
3007         [Streams API] Implement ReadableStreamReader.releaseLock
3008         https://bugs.webkit.org/show_bug.cgi?id=145299
3009
3010         Reviewed by Darin Adler.
3011
3012         Covered by rebased tests.
3013
3014         * Modules/streams/ReadableStream.cpp:
3015         (WebCore::ReadableStream::close): Moving some close code to newly added releaseReader.
3016         (WebCore::ReadableStream::releaseReader): Implements reader release and callbacks finalization.
3017         (WebCore::ReadableStream::changeStateToErrored): Calls releaseReader.
3018         * Modules/streams/ReadableStream.h:
3019         (WebCore::ReadableStream::hasReadPendingRequests): Added to enable reader.releaseLock throwing if read requests are pending.
3020         * Modules/streams/ReadableStreamReader.cpp:
3021         (WebCore::ReadableStreamReader::releaseLock): Implementation of releaseLock
3022         * Modules/streams/ReadableStreamReader.h:
3023         * Modules/streams/ReadableStreamReader.idl:
3024         (WebCore::releaseLock): Deleted.
3025
3026 2015-06-18  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3027
3028         GObject and ObjC bindings generator should not generate code for promise-based APIs
3029         https://bugs.webkit.org/show_bug.cgi?id=146059
3030
3031         Reviewed by Darin Adler.
3032
3033         Covered by rebased expectations.
3034
3035         * bindings/scripts/CodeGeneratorGObject.pm:
3036         (SkipFunction): Disabling GObject DOM binding for functions returning promises.
3037         * bindings/scripts/CodeGeneratorObjC.pm:
3038         (SkipFunction): Disabling ObjC DOM binding for functions returning promises.
3039         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp: Rebasing expectation.
3040         (webkit_dom_test_obj_get_read_only_long_attr): Deleted.
3041         (webkit_dom_test_obj_get_read_only_string_attr): Deleted.
3042         * bindings/scripts/test/GObject/WebKitDOMTestObj.h: Rebasing expectation.
3043         * bindings/scripts/test/ObjC/DOMTestObj.h: Ditto.
3044         * bindings/scripts/test/ObjC/DOMTestObj.mm: Ditto.
3045         (core): Deleted.
3046
3047 2015-06-17  Ryuan Choi  <ryuan.choi@navercorp.com>
3048
3049         [EFL] test_ewk2_context_url_scheme_register has been crashed since r185553
3050         https://bugs.webkit.org/show_bug.cgi?id=146075
3051
3052         Reviewed by Carlos Garcia Campos.
3053
3054         Since r185553, CustomProtocolManager sends StartLoading message to UIProcess
3055         with request of SoupGenericRequest instead of request itself.
3056         But, request of SoupGenericRequest is nullptr in EFL port because EFL port
3057         does not use m_initiatingPageID.
3058
3059         This patch updates request of SoupGenericRequest although m_initiatingPageID is null.
3060
3061         * platform/network/soup/ResourceRequestSoup.cpp: 
3062         (WebCore::ResourceRequest::updateSoupRequest):
3063
3064 2015-06-17  Daniel Bates  <dabates@apple.com>
3065
3066         Client may receive began editing callback for already focused text field
3067         https://bugs.webkit.org/show_bug.cgi?id=146074
3068         <rdar://problem/21293562>
3069
3070         Reviewed by Darin Adler.
3071
3072         Fixes an issue where the client would be notified that began editing in a text field
3073         for each programmatic DOM focus event dispatched at the text field regardless of
3074         whether the field was focused. The client should only be notified that began editing
3075         exactly once when a text field becomes focused (either programmatically or by user interaction).
3076
3077         * html/TextFieldInputType.cpp:
3078         (WebCore::TextFieldInputType::forwardEvent): Move logic to dispatch editing began callback from here...
3079         (WebCore::TextFieldInputType::handleFocusEvent): to here. This function is called when the
3080         text field becomes newly focused.
3081         * html/TextFieldInputType.h:
3082
3083 2015-06-17  Alex Christensen  <achristensen@webkit.org>
3084
3085         [Content Extensions] Fail to parse invalid arrays
3086         https://bugs.webkit.org/show_bug.cgi?id=146079
3087         rdar://problem/21422649
3088
3089         Reviewed by Benjamin Poulain.
3090
3091         Covered by new and corrected API tests.
3092
3093         * contentextensions/ContentExtensionParser.cpp:
3094         (WebCore::ContentExtensions::loadTrigger):
3095         Fail to parse invalid arrays for if-domain, unless-domain, resource-type, and load-type arrays.
3096
3097 2015-06-16  Jon Honeycutt  <jhoneycutt@apple.com>
3098
3099         Position::findParent() should take a reference
3100         https://bugs.webkit.org/show_bug.cgi?id=146038
3101
3102         Reviewed by Darin Adler.
3103
3104         * dom/Position.cpp:
3105         (WebCore::Position::containerNode):
3106         (WebCore::Position::parentAnchoredEquivalent):
3107         Pass a reference; there is already a null check.
3108         (WebCore::Position::previous):
3109         Add a missing null check. Code below this expects that node is non-null.
3110         (WebCore::Position::next):
3111         Ditto.
3112         (WebCore::Position::atStartOfTree):
3113         (WebCore::Position::atEndOfTree):
3114         Pass a reference.
3115         (WebCore::Position::findParent):
3116         Changed to take a reference.
3117
3118         * dom/Position.h:
3119         Ditto.
3120
3121 2015-06-17  Brent Fulgham  <bfulgham@apple.com>
3122
3123         Overflow regions with scroll snap points are not reliably rubber banding
3124         https://bugs.webkit.org/show_bug.cgi?id=142522
3125         <rdar://problem/20100726>
3126
3127         Reviewed by Darin Adler.
3128
3129         When computing the target scroll destination, update the nearest snap point index
3130         and other bookkeeping, but keep the original gesture target if it would have taken
3131         us beyond either limit of the scroll container.
3132
3133         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
3134         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
3135         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollExtents): Add new method
3136         to support client API.
3137         * platform/ScrollAnimator.cpp:
3138         (WebCore::ScrollAnimator::scrollExtents): Add new method to support client API.
3139         * platform/ScrollAnimator.h:
3140         * platform/cocoa/ScrollController.h:
3141         (WebCore::ScrollControllerClient::scrollExtents): Added new pure virtual method to API.
3142         * platform/cocoa/ScrollController.mm:
3143         (WebCore::ScrollController::beginScrollSnapAnimation): Hold onto original user gesture
3144         target, and use that instead of our nearest snap point if the gesture takes us past
3145         either extreme of the scroll container.
3146
3147 2015-06-17  Tim Horton  <timothy_horton@apple.com>
3148
3149         Swipe gesture can get stuck, preventing scrolling and other gestures
3150         https://bugs.webkit.org/show_bug.cgi?id=146088
3151         <rdar://problem/16056087>
3152
3153         Reviewed by Darin Adler.
3154
3155         * WebCore.xcodeproj/project.pbxproj:
3156         * platform/spi/mac/NSEventSPI.h: Added.
3157         Add an SPI header.
3158
3159 2015-06-16  Matt Rajca  <mrajca@apple.com>
3160
3161         MediaSession: handle MediaEventTrackNext and MediaEventTrackPrevious events
3162         https://bugs.webkit.org/show_bug.cgi?id=146028
3163
3164         Reviewed by Darin Adler.
3165
3166         * Modules/mediasession/MediaRemoteControls.idl: Added nexttrack/previoustrack event handlers.
3167         * Modules/mediasession/MediaSession.cpp: Dispatch the nexttrack/previoustrack events.
3168         (WebCore::MediaSession::skipToNextTrack):
3169         (WebCore::MediaSession::skipToPreviousTrack):
3170         * Modules/mediasession/MediaSession.h:
3171         * Modules/mediasession/MediaSessionManager.cpp: Skip to the next/previous track as described in the media session spec.
3172         (WebCore::MediaSessionManager::skipToNextTrack):
3173         (WebCore::MediaSessionManager::skipToPreviousTrack):
3174         * Modules/mediasession/MediaSessionManager.h:
3175         * dom/EventNames.h: Added the nexttrack/previoustrack event names.
3176         * page/Page.cpp: Tell MediaSessionManager to handle the new track-skipping events.
3177         (WebCore::Page::handleMediaEvent):
3178
3179 2015-06-17  Chris Fleizach  <cfleizach@apple.com>
3180
3181         AX: VoiceOver in iOS not announcing generic WAI-ARIA region, even if labelled properly
3182         https://bugs.webkit.org/show_bug.cgi?id=146066
3183
3184         Reviewed by Darin Adler.
3185
3186         Allow the region role to identify as a landmark type.
3187
3188         Updated test: platform/ios-simulator/accessibility/landmark-types.html
3189
3190         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3191         (-[WebAccessibilityObjectWrapper _accessibilityIsLandmarkRole:]):
3192
3193 2015-06-17  Simon Fraser  <simon.fraser@apple.com>
3194
3195         REGRESSION (r173283-r173296): Amazon.com front page has no caret in the search field
3196         https://bugs.webkit.org/show_bug.cgi?id=146073
3197         rdar://problem/21022203
3198
3199         Reviewed by Tim Horton.
3200
3201         Text controls (text inputs and textareas) need backing store even when empty, because
3202         they need to be able to paint a caret.
3203
3204         Test: compositing/backing/form-controls-backing.html
3205
3206         * rendering/RenderLayerBacking.cpp:
3207         (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
3208
3209 2015-06-17  Zalan Bujtas  <zalan@apple.com>
3210
3211         Selection cache produces invalid result when ancestor has float element.
3212         https://bugs.webkit.org/show_bug.cgi?id=146042
3213         rdar://problem/20604592
3214
3215         Reviewed by Ryosuke Niwa.
3216
3217         Selection cache already takes floats into account, however it's not enough to check current
3218         block against floats. Any of the ancestor's float starting from the selection root block
3219         can impact the selection offsets.
3220
3221         Test: fast/block/selection-cache-is-incorrect-when-non-direct-parent-has-float.html
3222
3223         * rendering/LogicalSelectionOffsetCaches.h:
3224         (WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::ContainingBlockInfo):
3225         (WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::setBlock):
3226         (WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::block):
3227         (WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::cache):
3228         (WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::hasFloatsOrFlowThreads):
3229         (WebCore::LogicalSelectionOffsetCaches::LogicalSelectionOffsetCaches):
3230
3231 2015-06-17  Joanmarie Diggs  <jdiggs@igalia.com>
3232
3233         AX: [ATK] Expose element tag name as an object attribute
3234         https://bugs.webkit.org/show_bug.cgi?id=146062
3235
3236         Reviewed by Mario Sanchez Prada.
3237
3238         Expose the element tag name as an object attribute with name "tag" and
3239         value being the lowercase tag name, both being what Gecko does for ATK.
3240
3241         No new tests. We already have sufficient coverage for AtkObject attributes.
3242         These tests have been updated to reflect the addition of the new attribute.
3243
3244         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
3245         (webkitAccessibleGetAttributes):
3246
3247 2015-06-17  Antti Koivisto  <antti@apple.com>
3248
3249         iOS WebKit1: [LegacyTileLayer drawInContext:] should ensure it has web lock
3250         https://bugs.webkit.org/show_bug.cgi?id=146072
3251         rdar://problem/21149759
3252
3253         Reviewed by Simon Fraser
3254
3255         There are some scenarios where we end up drawing without web lock due to client or system issues.
3256         This can cause crashes.
3257
3258         * platform/ios/LegacyTileLayer.mm:
3259         (-[LegacyTileLayer setNeedsDisplayInRect:]):
3260         (-[LegacyTileLayer drawInContext:]):
3261
3262             Ensure we have the web lock when called in main thread (even though we should have it already).
3263
3264 2015-06-17  Brent Fulgham  <bfulgham@apple.com>
3265
3266         CSS scroll snap: defining snap points on axis that does not scroll does not work properly
3267         https://bugs.webkit.org/show_bug.cgi?id=146043
3268         <rdar://problem/20125511>
3269
3270         Reviewed by Simon Fraser.
3271
3272         Tested by css3/scroll-snap/scroll-snap-mismatch.html
3273
3274         We always seed the set of scroll snap points with the start and end of the scroll container. This is not
3275         the right behavior if there are no scroll points defined, because we end up creating a snap for the start
3276         and end of the container, and any scroll gesture just takes us across the entire element.
3277         
3278         Instead, when we do not find any scroll snap points, we should clear the snap point state for the container.
3279
3280         * page/scrolling/AxisScrollSnapOffsets.cpp:
3281         (WebCore::updateFromStyle): If we did not find any snap points (i.e., the snapOffsets container
3282         only holds '0', return an empty Vector. 
3283         (WebCore::updateSnapOffsetsForScrollableArea): If the set of snap points produced by 'updateFromStyle' is empty,
3284         clear the horizontal (or vertical) snap offsets for the scroll area.
3285         
3286
3287 2015-06-17  Chris Fleizach  <cfleizach@apple.com>
3288
3289         AX: input role="spinbutton" gets skipped in voiceover
3290         https://bugs.webkit.org/show_bug.cgi?id=145514
3291
3292         Reviewed by Mario Sanchez Prada.
3293
3294         SpinButton role was added, but left out of iOS.
3295         To prevent this from happening again, explicitly list every role in the switch statement that
3296         determines accessible visibility.
3297
3298         Test: platform/ios-simulator/accessibility/spinbutton.html
3299
3300         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3301         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
3302         (-[WebAccessibilityObjectWrapper isAccessibilityElement]):
3303
3304 2015-06-17  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
3305
3306         [Streams API] ReadableJSStream should handle promises returned by JS source pull callback
3307         https://bugs.webkit.org/show_bug.cgi?id=145965
3308
3309         Reviewed by Darin Adler.
3310
3311         Implemented asynchronous pulling.
3312         In particular, ensuring that doPull is not called as long as previous call to doPull is finished.
3313         Storing whether to pull automatically when the current pull is finished. 
3314
3315         Covered by rebased tests.
3316
3317         * Modules/streams/ReadableStream.cpp:
3318         (WebCore::ReadableStream::pull): stores whether to pull again.
3319         (WebCore::ReadableStream::finishPulling): called when pulling finishes.
3320         * Modules/streams/ReadableStream.h:
3321         * bindings/js/ReadableJSStream.cpp:
3322         (WebCore::createPullResultFulfilledFunction): The promise resolve callback.
3323         (WebCore::ReadableJSStream::doPull): Handling of promise.
3324         * bindings/js/ReadableJSStream.h:
3325
3326 2015-06-16  Carlos Garcia Campos  <cgarcia@igalia.com>
3327
3328         WebProcess crashes after too many redirect error when there's an active NPAPI plugin
3329         https://bugs.webkit.org/show_bug.cgi?id=146019
3330
3331         Reviewed by Darin Adler.
3332
3333         This happens with the GTK+ port after a navigation action ends up
3334         in an infinite redirection and the ResourceHandle fails with too
3335         many redirections error. I should actually happen after any error
3336         is reported by the ResourceHnalder before the load is
3337         committed. But tt only happens if there's an active NPAPI
3338         plugin. The problem is that FrameLoader::receivedMainResourceError()
3339         is called recursively because DocumentLoader::stopLoading() ends up
3340         calling mainReceivedError() that calls FrameLoader::receivedMainResourceError()
3341         again. DocumentLoader::stopLoading() checks if the document is
3342         still loading, which can happen if the main resource is loading,
3343         if there's any subresource loading or if there's a plugin
3344         loading. So, in case of being loading, those cases are handled
3345         individually to cancel the main resource, or set an error in the
3346         document loader and cancel subresources and plugins, except for
3347         this case of plugins, that mainReceivedError is called instead of
3348         setting cancelled error on the document loader.
3349
3350         * loader/DocumentLoader.cpp:
3351         (WebCore::DocumentLoader::stopLoading): If the document is still
3352         loading because there are active plugins, set the cancelled error
3353         on the document instead of calling mainReceivedError again.
3354
3355 2015-06-16  Youenn Fablet <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar  <calvaris@igalia.com>
3356
3357         [Streams API] Implement ReadableStream locked property
3358         https://bugs.webkit.org/show_bug.cgi?id=146023
3359
3360         Reviewed by Darin Adler.
3361
3362         Covered by rebased tests.
3363
3364         * Modules/streams/ReadableStream.h:
3365         (WebCore::ReadableStream::locked): Renamed isLocked by locked.
3366         * Modules/streams/ReadableStream.idl: Adding locked.
3367         * bindings/js/JSReadableStreamCustom.cpp:
3368         (WebCore::JSReadableStream::getReader): Using isLocked.
3369         * bindings/js/JSReadableStreamReaderCustom.cpp:
3370         (WebCore::constructJSReadableStreamReader): Using isLocked.
3371
3372 2015-06-16  Myles C. Maxfield  <mmaxfield@apple.com>
3373
3374         REGRESSION(r184899): [Cocoa] font-variant: small-caps is not honored with web fonts
3375         https://bugs.webkit.org/show_bug.cgi?id=145873
3376         <rdar://problem/21314282>
3377
3378         Reviewed by Dean Jackson.
3379
3380         When font-variant: small-caps is applied, we create a smaller version of the original font
3381         and draw capital characters in that smaller font. CGFontRefs do not have an intrinsic size,
3382         and web fonts historically only had a CGFontRef, which means that there was no need to
3383         convert the CGFontRef to be smaller (as opposed to regular fonts, which had a CTFontRef and
3384         therefore needed the conversion). Instead, we just changed m_size, which represents
3385         the size that the text should be drawn in.
3386
3387         However, r184899 gave CTFontRefs to web fonts. This means that now the FontPlatformData's
3388         m_size variable disagreed with the CTFontRef member. The solution here is to unify the web
3389         font and regular font codepaths, and treat them the same throughout.
3390
3391         Note that this patch removes the last use of the m_isCustomFont variable. As soon as we
3392         entirely migrate to CORETEXT_WEB_FONTS, we should delete this variable.
3393
3394         Test: fast/text/small-caps-web-font.html
3395
3396         * platform/graphics/cocoa/FontCocoa.mm:
3397         (WebCore::Font::platformCreateScaledFont): Treat web fonts the same as regular fonts.
3398         * platform/text/TextFlags.h: Add a comment regarding teh deletion of m_isCustomFont.
3399
3400 2015-06-16  Alex Christensen  <achristensen@webkit.org>
3401
3402         [Content Extensions] Implement branch compaction for DFA bytecode.
3403         https://bugs.webkit.org/show_bug.cgi?id=145619
3404
3405         Reviewed by Benjamin Poulain.
3406
3407         This patch adds another pass to the DFABytecodeCompiler which finds where the bytecode from each node
3408         would be if it were compiled with no branch compaction, then uses that as a worst-case value to determine
3409         how many bytes are needed to store the relative jump distance.  Then when linking, it will fill in the 
3410         value as it already did, but with a variable size jump.  The jumps are also now signed distances relative to
3411         where the jump is stored.
3412
3413         This patch is covered by existing tests, which have many jumps that are near the -128/127 byte boundary,
3414         and the switch from 16-bit jumps to 32-bit jumps near the -65536/65535 byte boundary is analogous.
3415
3416         * contentextensions/ContentExtensionCompiler.cpp:
3417         (WebCore::ContentExtensions::compileRuleList):
3418         * contentextensions/DFABytecode.h:
3419         (WebCore::ContentExtensions::smallestPossibleJumpSize):
3420         (WebCore::ContentExtensions::instructionSizeWithArguments):
3421         * contentextensions/DFABytecodeCompiler.cpp:
3422         (WebCore::ContentExtensions::append):
3423         (WebCore::ContentExtensions::appendZeroes):
3424         (WebCore::ContentExtensions::setBits):
3425         (WebCore::ContentExtensions::appendActionBytecodeSize):
3426         (WebCore::ContentExtensions::DFABytecodeCompiler::emitAppendAction):
3427         (WebCore::ContentExtensions::DFABytecodeCompiler::longestPossibleJump):
3428         (WebCore::ContentExtensions::DFABytecodeCompiler::emitJump):
3429         (WebCore::ContentExtensions::DFABytecodeCompiler::emitCheckValue):
3430         (WebCore::ContentExtensions::DFABytecodeCompiler::emitCheckValueRange):
3431         (WebCore::ContentExtensions::DFABytecodeCompiler::emitTerminate):
3432         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNode):
3433         (WebCore::ContentExtensions::DFABytecodeCompiler::compiledNodeMaxBytecodeSize):
3434         (WebCore::ContentExtensions::DFABytecodeCompiler::ranges):
3435         (WebCore::ContentExtensions::DFABytecodeCompiler::checkForRangeMaxBytecodeSize):
3436         (WebCore::ContentExtensions::DFABytecodeCompiler::compileCheckForRange):
3437         (WebCore::ContentExtensions::DFABytecodeCompiler::nodeTransitionsMaxBytecodeSize):
3438         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNodeTransitions):
3439         (WebCore::ContentExtensions::DFABytecodeCompiler::compile):
3440         (WebCore::ContentExtensions::set32Bits): Deleted.
3441         * contentextensions/DFABytecodeCompiler.h:
3442         * contentextensions/DFABytecodeInterpreter.cpp:
3443         (WebCore::ContentExtensions::getBits):
3444         (WebCore::ContentExtensions::getInstruction):
3445         (WebCore::ContentExtensions::jumpSizeInBytes):
3446         (WebCore::ContentExtensions::getJumpSize):
3447         (WebCore::ContentExtensions::getJumpDistance):
3448         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretAppendAction):
3449         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretTestFlagsAndAppendAction):
3450         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsForDefaultStylesheetFromDFARoot):
3451         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
3452         * loader/ResourceLoadInfo.h:
3453
3454 2015-06-16  Carlos Alberto Lopez Perez  <clopez@igalia.com>
3455
3456         [GTK] [Wayland] Should be possible to build with support for both X11 and Wayland.
3457         https://bugs.webkit.org/show_bug.cgi?id=145701
3458
3459         Reviewed by Darin Adler.
3460
3461         No new tests, no behavior changes.
3462
3463         When building both targets, we have to include the wayland-egl
3464         headers in order to build the Wayland target. This causes that
3465         EGLNativePixmapType and EGLNativeWindowType get defined as
3466         different types than when building only the X11 target.
3467
3468         By type casting them to the ones that are expected, we are able
3469         to build both targets at the same time.
3470
3471         I have done tests (building each target alone as also both targets
3472         at the same time), and everything seems to works as expected.
3473
3474         Once built for both targets, if you try to launch the MiniBrowser
3475         from inside a Wayland compositor (Weston on top of X for example),
3476         it will trigger the X11 target if the DISPLAY environment variable
3477         is set and the environment variable GDK_BACKEND is not set to wayland,
3478         otherwise it will trigger the Wayland target.
3479
3480         * platform/graphics/GLContext.cpp:
3481         (WebCore::GLContext::createContextForWindow): Add type casts. We have
3482         to consider here two different type casts depending on the type of
3483         GLNativeWindowType to avoid a build failure on 32-bits platforms.
3484         The static_cast one was already beeing done as an implicit cast
3485         (from uint64_t to XID), the reinterpret_cast is the new one that
3486         we need to do only when building on both platforms.
3487         * platform/graphics/egl/GLContextEGL.cpp: Add missing include when
3488         building both targets that is required for defining DefaultRootWindow().
3489         (WebCore::GLContextEGL::createPixmapContext): Add type cast.
3490
3491 2015-06-15  Jon Honeycutt  <jhoneycutt@apple.com>
3492
3493         [iOS] Crash long pressing on <input type=file>
3494         https://bugs.webkit.org/show_bug.cgi?id=146009
3495         <rdar://problem/21234453>
3496
3497         Reviewed by Ryosuke Niwa.
3498
3499         * dom/Position.cpp:
3500         (WebCore::Position::atStartOfTree):
3501         (WebCore::Position::atEndOfTree):
3502         Null check the container node before passing it to findParent().
3503
3504 2015-06-15  Chris Fleizach  <cfleizach@apple.com>
3505
3506         AX:  iOS accessibility tests are not running because we need WKTR support
3507         https://bugs.webkit.org/show_bug.cgi?id=145991
3508
3509         Reviewed by Daniel Bates.
3510
3511         Make some minor modifications to support notification handling in WKTR.
3512
3513         * accessibility/ios/AXObjectCacheIOS.mm:
3514         (WebCore::AXObjectCache::postPlatformNotification):
3515         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
3516         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3517         (-[WebAccessibilityObjectWrapper accessibilityClickPoint]):
3518         (-[WebAccessibilityObjectWrapper description]):
3519         (-[WebAccessibilityObjectWrapper accessibilitySetPostedNotificationCallback:withContext:]): Deleted.
3520         (-[WebAccessibilityObjectWrapper accessibilityPostedNotification:]): Deleted.
3521
3522 2015-06-16  Mark Lam  <mark.lam@apple.com>
3523
3524         Use NakedPtr<Exception>& to return exception results.
3525         https://bugs.webkit.org/show_bug.cgi?id=145870
3526
3527         Reviewed by Anders Carlsson and Filip Pizlo.
3528
3529         No new WebCore tests because this functionality is already covered by existing tests.
3530         API tests added for WTF::NakedPtr.
3531
3532         * bindings/js/JSCallbackData.cpp:
3533         (WebCore::JSCallbackData::invokeCallback):
3534         * bindings/js/JSCustomXPathNSResolver.cpp:
3535         (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
3536         * bindings/js/JSErrorHandler.cpp:
3537         (WebCore::JSErrorHandler::handleEvent):
3538         * bindings/js/JSEventListener.cpp:
3539         (WebCore::JSEventListener::handleEvent):
3540         * bindings/js/JSMainThreadExecState.cpp:
3541         (WebCore::JSMainThreadExecState::didLeaveScriptContext):
3542         (WebCore::functionCallHandlerFromAnyThread):
3543         (WebCore::evaluateHandlerFromAnyThread):
3544         * bindings/js/JSMainThreadExecState.h:
3545         (WebCore::JSMainThreadExecState::currentState):
3546         (WebCore::JSMainThreadExecState::call):
3547         (WebCore::JSMainThreadExecState::evaluate):
3548         * bindings/js/JSMutationCallback.cpp:
3549         (WebCore::JSMutationCallback::call):
3550         * bindings/js/ScheduledAction.cpp:
3551         (WebCore::ScheduledAction::executeFunctionInContext):
3552         * bindings/js/ScriptController.cpp:
3553         (WebCore::ScriptController::evaluateInWorld):
3554         * bindings/js/WorkerScriptController.cpp:
3555         (WebCore::WorkerScriptController::evaluate):
3556         (WebCore::WorkerScriptController::setException):
3557         * bindings/js/WorkerScriptController.h:
3558         (WebCore::WorkerScriptController::workerGlobalScopeWrapper):
3559         * bindings/objc/WebScriptObject.mm:
3560         (-[WebScriptObject callWebScriptMethod:withArguments:]):
3561         * workers/WorkerGlobalScope.cpp:
3562         (WebCore::WorkerGlobalScope::importScripts):
3563
3564 2015-06-16  Brent Fulgham  <bfulgham@apple.com>
3565
3566         CSS Scroll Snap - support snapping to nested elements
3567         https://bugs.webkit.org/show_bug.cgi?id=145843
3568         <rdar://problem/21339581>
3569
3570         Reviewed by Darin Adler.
3571
3572         Tested by css3/scroll-snap/nested-elements.html
3573
3574         The Scroll Snap Point implementation was not properly handling nested elements.
3575         This could be resolved by recursively calling 'appendChildSnapOffsets', but this
3576         seemed like an inefficient approach, especially considering how often this method
3577         is called during various scaling and other operations.
3578         
3579         Instead, do the following:
3580         (1) Add a new HashSet to RenderView that holds a collection of RenderElements that
3581             have scroll-snap-coordinates.
3582         (2) During RenderElement::styleWillChange, register all elements that have the
3583             scroll-snap-coordinates style with the RenderView.
3584         (3) When performing 'appendChildSnapOffsets', refer to the HashSet of elements, select the
3585             subset of these entries relevant to the current scrolling container, and build up the
3586             set of scroll-snap-coordinates needed for the current scrolling container.
3587
3588         * page/scrolling/AxisScrollSnapOffsets.cpp:
3589         (WebCore::appendChildSnapOffsets): Check the scroll-snap-coordinate RenderElement HashSet
3590         for the RenderView to find all elements that are children of the current scrolling container.
3591         Add the scroll-snap-coordinates for these RenderElements to the current set of snap points.
3592         * rendering/RenderElement.cpp:
3593         (WebCore::findEnclosingScrollableContainer): New helper function.
3594         (WebCore::RenderElement::styleWillChange): If the current element has scroll-snap-coordinate
3595         defined, remember it for later so we can use it with the relevant scrolling container
3596         after layout completes.
3597         (WebCore::RenderElement::willBeRemovedFromTree): Unregister the current element from the
3598         RenderView.
3599         (WebCore::RenderElement::findEnclosingScrollableContainer): Added. Locate the relevant
3600         scrolling container for the current object.
3601         * rendering/RenderElement.h:
3602         * rendering/RenderView.cpp:
3603         (WebCore::Document::registerRenderElementWithScrollSnapCoordinates): Added.
3604         (WebCore::Document::unregisterRenderElementWithScrollSnapCoordinates): Added.
3605         * rendering/RenderView.h:
3606
3607 2015-06-16  Brady Eidson  <beidson@apple.com>
3608
3609         [IndexedDB] array index keys are concatenated across cursor lifetime
3610         <rdar://problem/19684902> and https://bugs.webkit.org/show_bug.cgi?id=138504
3611
3612         Reviewed by Brady Eidson, patch by Mark Dixon <mark@lowla.io>
3613
3614         Tested by:
3615         storage/indexeddb/keypath-arrays.html
3616
3617         IDBKeyData and IDBKeyPath need to clear any existing array values before calling
3618         decodeObjects to update the value of an existing object.
3619         
3620         * Modules/indexeddb/IDBKeyData.cpp:
3621         (WebCore::IDBKeyData::decode):
3622         * Modules/indexeddb/IDBKeyPath.cpp:
3623         (WebCore::IDBKeyPath::decode):
3624
3625 2015-06-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
3626
3627         Canvas dimensions should be limited to 4096x4096 pixels on iOS devices.
3628         https://bugs.webkit.org/show_bug.cgi?id=145998
3629
3630         Reviewed by Darin Adler.
3631
3632         The value of MaxCanvasArea should depend on the platform. If the platform
3633         is iOS, the limit should be 64M. Otherwise the limit should be 1G.
3634
3635         Test: fast/canvas/pattern-too-large-to-create-2.html
3636
3637         * html/HTMLCanvasElement.cpp: Change MaxCanvasArea value based on the platform. 
3638         
3639         * rendering/svg/RenderSVGShape.h:
3640         (WebCore::RenderSVGShape::graphicsElement): Remove un-implemented constructor.
3641
3642 2015-06-16  Chris Dumez  <cdumez@apple.com>
3643
3644         REGRESSION(r185012): chat frame in Gmail now says "Something's not right"
3645         https://bugs.webkit.org/show_bug.cgi?id=146025
3646         <rdar://problem/21391412>
3647
3648         Reviewed by Darin Adler.
3649
3650         Only throttle timers in non-visible iframes once they've reached the
3651         max nesting level to avoid throttling critical one-shot timers. This is
3652         consistent with the default DOMTimer throttling behavior that is
3653         defined in the specification.
3654
3655         Power-wise, we are mostly interested in DOMTimers that fire frequently
3656         and cause high CPU usage over an extended period of time anyway.
3657
3658         * dom/Document.cpp:
3659         (WebCore::Document::setTimerThrottlingEnabled):
3660         (WebCore::Document::timerAlignmentInterval):
3661         * dom/Document.h:
3662         * dom/ScriptExecutionContext.cpp:
3663         (WebCore::ScriptExecutionContext::timerAlignmentInterval):
3664         * dom/ScriptExecutionContext.h:
3665         * page/DOMTimer.cpp:
3666         (WebCore::DOMTimer::alignedFireTime):
3667
3668 2015-06-16  sylvain-galineau  <galineau@adobe.com>
3669
3670         Incorrect order of arguments in initial-letter property
3671         https://bugs.webkit.org/show_bug.cgi?id=139667
3672
3673         Reviewed by Sam Weinig.
3674
3675         The CSS specification swapped the order of the initial-letters numeric values.
3676         The drop cap's height now comes first, followed by its optional vertical position.
3677         See http://www.w3.org/TR/css-inline/#sizing-drop-initials.
3678          
3679         No new tests. Existing tests updated.
3680
3681         * css/CSSParser.cpp:
3682         (WebCore::CSSParser::parseValue): swap arguments to reflect new spec order.
3683
3684 2015-06-16  Alex Christensen  <achristensen@webkit.org>
3685
3686         Remove some unused values.
3687         https://bugs.webkit.org/show_bug.cgi?id=145997
3688
3689         Reviewed by Gyuyoung Kim.
3690
3691         This patch should have no change in behavior.
3692
3693         * accessibility/AccessibilityObject.cpp:
3694         (WebCore::computeBestScrollOffset):
3695         (WebCore::AccessibilityObject::scrollToMakeVisibleWithSubFocus):
3696         (WebCore::AccessibilityObject::scrollToGlobalPoint):
3697         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3698         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
3699         * html/canvas/WebGL2RenderingContext.cpp:
3700         (WebCore::WebGL2RenderingContext::validateTexFuncData):
3701         * html/canvas/WebGLRenderingContext.cpp:
3702         (WebCore::WebGLRenderingContext::validateTexFuncData):
3703         * platform/graphics/StringTruncator.cpp:
3704         (WebCore::leftTruncateToBuffer):
3705         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3706         (WebCore::MediaPlayerPrivateQTKit::paintCurrentFrameInContext):
3707         * rendering/InlineTextBox.cpp:
3708         (WebCore::InlineTextBox::localSelectionRect):
3709         * rendering/RenderElement.cpp:
3710         (WebCore::RenderElement::anchorRect):
3711         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
3712         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
3713         * rendering/svg/SVGTextQuery.cpp:
3714         (WebCore::SVGTextQuery::modifyStartEndPositionsRespectingLigatures):
3715         Remove unused values.
3716
3717 2015-06-16  Youenn Fablet <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar  <calvaris@igalia.com>
3718
3719         [Streams API] Calling controller.error() should trigger storing an undefined error
3720         https://bugs.webkit.org/show_bug.cgi?id=145976
3721
3722         Reviewed by Darin Adler.
3723
3724         Covered by rebased test.
3725
3726         * bindings/js/JSReadableStreamControllerCustom.cpp:
3727         (WebCore::JSReadableStreamController::error): Storing undefined if no error value passed.
3728         * bindings/js/ReadableJSStream.cpp: Removed storeError(ExecState*).
3729         (WebCore::ReadableJSStream::ReadableJSStream):
3730
3731 2015-06-16  Chris Dumez  <cdumez@apple.com>
3732
3733         Purge StyledElement's presentation attribute cache on memory pressure
3734         https://bugs.webkit.org/show_bug.cgi?id=145999
3735         <rdar://problem/21359252>
3736
3737         Reviewed by Andreas Kling.
3738
3739         Purge StyledElement's presentation attribute cache on memory pressure.
3740
3741         * dom/StyledElement.cpp:
3742         (WebCore::presentationAttributeCache):
3743         (WebCore::presentationAttributeCacheCleaner):
3744         (WebCore::StyledElement::clearPresentationAttributeCache):
3745         * dom/StyledElement.h:
3746         * platform/MemoryPressureHandler.cpp:
3747         (WebCore::MemoryPressureHandler::releaseNoncriticalMemory):
3748
3749 2015-06-15  Brent Fulgham  <bfulgham@apple.com>
3750
3751         REGRESSION(r175251, Mavericks Only): Playback may stall
3752         https://bugs.webkit.org/show_bug.cgi?id=145989
3753         <rdar://problem/21271919>
3754
3755         Unreviewed post-review correction.
3756
3757         Dave Kilzer pointed out that the macro around the waitForVideoOutputMediaDataWillChange
3758         call was incorrect. This patch corrects this error.
3759
3760         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3761         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput): Correct the
3762         macro definition.
3763
3764 2015-06-15  Chris Fleizach  <cfleizach@apple.com>
3765
3766         AX: Changing state of radio buttons causes VoiceOver to go busy for a short time.
3767         https://bugs.webkit.org/show_bug.cgi?id=145933
3768
3769         Reviewed by Dean Jackson.
3770
3771         When radio buttons animate the new focus selection state, the thread activity looks a lot like short burst of
3772         activity to draw, then wait on CoreAnimation to apply those changes.
3773
3774         Since those periods of activity during animation are so short, VoiceOver is not able to query for all the
3775         attributes it needs, and gets stuck in the queue behind rendering.
3776
3777         The fix here is to turn off button state animations while VoiceOver is running.
3778
3779         * platform/mac/ThemeMac.mm:
3780         (WebCore::updateStates):
3781
3782 2015-06-15  Zalan Bujtas  <zalan@apple.com>
3783
3784         RootInlineBox::m_lineBreakObj becomes invalid when a child renderer is removed and the line does not get marked dirty.
3785         https://bugs.webkit.org/show_bug.cgi?id=145988
3786         rdar://problem/20959137
3787
3788         Reviewed by David Hyatt.
3789
3790         This patch ensures that we find the right first inline box so that we can dirty the
3791         the appropriate line boxes.
3792         With marking the right line boxes dirty, now we can update RootInlineBox::m_lineBreakObj at the next layout.
3793
3794         Test: fast/inline/crash-when-child-renderer-is-removed-and-line-stays-clean.html
3795
3796         * rendering/RenderInline.cpp:
3797         (WebCore::RenderInline::culledInlineFirstLineBox):
3798         (WebCore::RenderInline::culledInlineLastLineBox):
3799         * rendering/RootInlineBox.cpp:
3800         (WebCore::RootInlineBox::setLineBreakInfo): Deleted. Remove misleading assert and comment.
3801
3802 2015-06-15  Matt Rajca  <mrajca@apple.com>
3803
3804         Media Session: Improve the safety of playback toggling
3805         https://bugs.webkit.org/show_bug.cgi?id=145986
3806
3807         Reviewed by Darin Adler.
3808
3809         * Modules/mediasession/MediaSession.cpp:
3810         (WebCore::MediaSession::togglePlayback): Improved the safety of the loop so that we don't re-visit elements that
3811           may have been deleted underneath us.
3812         * Modules/mediasession/MediaSession.h: Added a pointer to the set of iterated active participating elements so
3813           we can remove any elements that are deleted from the underlying "real" set.
3814
3815 2015-06-15  Brent Fulgham  <bfulgham@apple.com>
3816
3817         REGRESSION(r175251, Mavericks Only): Playback may stall
3818         https://bugs.webkit.org/show_bug.cgi?id=145989
3819         <rdar://problem/21271919>
3820
3821         Reviewed by Dean Jackson.
3822
3823         Revert r175251 for Mavericks build targets.
3824
3825         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3826         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer):
3827         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput):
3828         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
3829
3830 2015-06-15  Darin Adler  <darin@apple.com>
3831
3832         REGRESSION (r182215): Reproducible crash at drawsvg.org due to reentrant layout
3833         https://bugs.webkit.org/show_bug.cgi?id=145964
3834
3835         Reviewed by Simon Fraser.
3836
3837         Test: svg/as-object/mutate-on-load.html
3838
3839         * page/FrameView.cpp:
3840         (WebCore::FrameView::forceLayoutParentViewIfNeeded): Don't do a synchronous layout here,
3841         because it can lead indirectly to unwanted layout reentrancy. Instead schedule a layout.
3842
3843 2015-06-15  Matt Rajca  <mrajca@apple.com>
3844
3845         Media Session: Active participating elements can change while being iterated 
3846         https://bugs.webkit.org/show_bug.cgi?id=145978
3847
3848         Reviewed by Alex Christensen.
3849
3850         * Modules/mediasession/MediaSession.cpp:
3851         (WebCore::MediaSession::togglePlayback): Iterate through a copy of m_activeParticipatingElements since its contents
3852           can be modified in the loop.
3853
3854 2015-06-15  Chris Fleizach  <cfleizach@apple.com>
3855
3856         AX: no accessibility support for details element
3857         https://bugs.webkit.org/show_bug.cgi?id=131111
3858
3859         Reviewed by Darin Adler.
3860
3861         Add accessibility support for Mac for details element by:
3862            1) Returning new subroles for <details> and <summary>
3863            2) Exposing isExpanded property for <details> element.
3864
3865         Test: platform/mac/accessibility/details-summary.html
3866
3867         * accessibility/AccessibilityObject.cpp:
3868         (WebCore::AccessibilityObject::supportsARIAPressed):
3869         (WebCore::AccessibilityObject::supportsExpanded):
3870         (WebCore::AccessibilityObject::isExpanded):
3871         (WebCore::AccessibilityObject::supportsARIAExpanded): Deleted.
3872         * accessibility/AccessibilityObject.h:
3873         (WebCore::AccessibilityObject::canvasHasFallbackContent):
3874         * accessibility/AccessibilityRenderObject.cpp:
3875         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
3876         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
3877         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3878         (-[WebAccessibilityObjectWrapper accessibilitySupportsARIAExpanded]):
3879         (-[WebAccessibilityObjectWrapper accessibilityIsExpanded]):
3880         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3881         (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
3882         (createAccessibilityRoleMap):
3883         (-[WebAccessibilityObjectWrapper subrole]):
3884         * html/HTMLDetailsElement.h:
3885         * inspector/InspectorDOMAgent.cpp:
3886         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
3887
3888 2015-06-15  Alex Christensen  <achristensen@webkit.org>
3889
3890         [Content Extensions] Limit number of rules.
3891         https://bugs.webkit.org/show_bug.cgi?id=145663
3892
3893         Reviewed by Benjamin Poulain.
3894
3895         Added an API test to make sure that parsing fails when there are too many rules.
3896
3897         * contentextensions/ContentExtensionError.cpp:
3898         (WebCore::ContentExtensions::contentExtensionErrorCategory):
3899         * contentextensions/ContentExtensionError.h:
3900         * contentextensions/ContentExtensionParser.cpp:
3901         (WebCore::ContentExtensions::loadEncodedRules):
3902         Fail to parse a content extension with more than 50000 rules.
3903
3904 2015-06-12  Alexey Proskuryakov  <ap@apple.com>
3905
3906         -[WKWebView evaluateJavaScript] provides a misleading error when the return cannot be serialized
3907         https://bugs.webkit.org/show_bug.cgi?id=145900
3908
3909         Reviewed by Sam Weinig.
3910
3911         * English.lproj/Localizable.strings:
3912
3913 2015-06-15  Carlos Garcia Campos  <cgarcia@igalia.com>
3914
3915         [SOUP] Custom URI schemes don't work for requests containing a fragment identifier
3916         https://bugs.webkit.org/show_bug.cgi?id=145969
3917
3918         Reviewed by Sergio Villar Senin.
3919
3920         For URIs like foo:bar#baz, what the custom protocol manager
3921         receives in the UI process is foo:bar, so the user can't handle fragments.
3922
3923         * platform/network/soup/ResourceRequestSoup.cpp:
3924         (WebCore::ResourceRequest::updateSoupRequest): If the SoupRequest
3925         is a WebKitSoupRequestGeneric, call
3926         webkitSoupRequestGenericSetRequest with the ResourceRequest.
3927         * platform/network/soup/WebKitSoupRequestGeneric.cpp:
3928         (webkitSoupRequestGenericSetRequest):
3929         (webkitSoupRequestGenericGetRequest):
3930         * platform/network/soup/WebKitSoupRequestGeneric.h:
3931
3932 2015-06-15  Carlos Garcia Campos  <cgarcia@igalia.com>
3933
3934         [SOUP] Move WebKitSoupRequestGeneric to platform layer
3935         https://bugs.webkit.org/show_bug.cgi?id=145968
3936
3937         Reviewed by Sergio Villar Senin.
3938
3939         * PlatformEfl.cmake:
3940         * PlatformGTK.cmake:
3941         * platform/network/soup/WebKitSoupRequestGeneric.cpp: Renamed from Source/WebKit2/WebProcess/soup/WebKitSoupRequestGeneric.cpp.
3942         (webkitSoupRequestGenericFinalize):
3943         (webkit_soup_request_generic_init):
3944         (webkitSoupRequestGenericSendAsync):
3945         (webkitSoupRequestGenericSendFinish):
3946         (webkitSoupRequestGenericGetContentLength):
3947         (webkitSoupRequestGenericGetContentType):
3948         (webkit_soup_request_generic_class_init):
3949         (webkitSoupRequestGenericSetContentLength):
3950         (webkitSoupRequestGenericSetContentType):
3951         * platform/network/soup/WebKitSoupRequestGeneric.h: Renamed from Source/WebKit2/WebProcess/soup/WebKitSoupRequestGeneric.h.
3952         * platform/network/soup/WebKitSoupRequestGenericClient.h: Renamed from Source/WebKit2/WebProcess/soup/WebKitSoupRequestGenericClient.h.
3953
3954 2015-06-13  Chris Dumez  <cdumez@apple.com>
3955
3956         [WK2] API::Navigation objects are leaked on history navigation to HistoryItems in PageCache
3957         https://bugs.webkit.org/show_bug.cgi?id=145948
3958
3959         Reviewed by Darin Adler.
3960
3961         API::Navigation objects were leaked on history navigation to
3962         HistoryItems in PageCache. In such case, we would create 2 Navigation
3963         objects instead of 1 and the first one would be leaked. The reason
3964         we create the second one is because we fail to pass along the
3965         navigationID from the UIProcess to the WebProcess and then back to the
3966         UIProcess. On the IPC back to the UIProcess, the navigationID ends up
3967         being 0 so the UIProcess creates a new Navigation object, thinking that
3968         the load was triggered by the WebContent process.
3969
3970         We now pass along the navigationID, even if the HistoryItem is in the
3971         PageCache and we end up reusing the cached DocumentLoader, instead of
3972         creating a new one. A new updateCachedDocumentLoader() delegate is
3973         added to the FrameLoaderClient, similarly to the pre-existing
3974         createDocumentLoader() but for the case where the DocumentLoader gets
3975         reused.
3976
3977         * loader/EmptyClients.h:
3978         * loader/FrameLoader.cpp:
3979         (WebCore::FrameLoader::loadDifferentDocumentItem):
3980         * loader/FrameLoaderClient.h:
3981
3982 2015-06-13  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
3983
3984         [Streams API] ReadableJSStream should handle promises returned by JS source start callback
3985         https://bugs.webkit.org/show_bug.cgi?id=145792
3986
3987         Reviewed by Darin Adler.
3988
3989         Covered by rebased tests.
3990
3991         When calling start callback, the returned value is checked.
3992         If it is not a promise, we do as if it is a resolved promise.
3993         If it is a promise, we call its then() method with two resolve/reject JS functions.
3994
3995         * Modules/streams/ReadableStream.cpp:
3996         * bindings/js/ReadableJSStream.cpp:
3997         (WebCore::ReadableJSStream::invoke): Returns a JSPromise* if any is returned by the JS source callback.
3998         (WebCore::thenPromise): Utility method to call the promise.
3999         (WebCore::createStartResultFulfilledFunction): The promise resolve callback.
4000         (WebCore::ReadableJSStream::doStart): Calls thenPromise if a JSPromise* is returned by invoke.