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