REGRESSION (r184968): missing media player buttons (control bar exists, but no buttons)
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-06-03  Simon Fraser  <simon.fraser@apple.com>
2
3         REGRESSION (r184968): missing media player buttons (control bar exists, but no buttons)
4         https://bugs.webkit.org/show_bug.cgi?id=145630
5
6         Reviewed by Zalan Bujtas.
7
8         r184968 changed the initial value of m_intersectsCoverageRect to false. However,
9         this triggered a bug with mask layers, whose value of m_intersectsCoverageRect was never
10         updated.
11
12         Fix by copying the value of m_intersectsCoverageRect from the main layer to its
13         mask layer, just as we do for m_visibleRect and m_coverageRect.
14
15         Test: compositing/visible-rect/mask-layer-coverage.html
16
17         * platform/graphics/ca/GraphicsLayerCA.cpp:
18         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
19
20 2015-06-03  Simon Fraser  <simon.fraser@apple.com>
21
22         Layer tree dumps should include mask layers
23         https://bugs.webkit.org/show_bug.cgi?id=145629
24
25         Reviewed by Zalan Bujtas.
26
27         Dumping the layer tree omitted to dump the mask layer, so fix 
28         GraphicsLayer::dumpProperties() to dump this layer.
29
30         * platform/graphics/GraphicsLayer.cpp:
31         (WebCore::GraphicsLayer::dumpProperties):
32
33 2015-06-03  Greg Hughes  <ghughes@apple.com>
34
35         AX: Expose field sets to accessibility clients
36         https://bugs.webkit.org/show_bug.cgi?id=145585
37    
38         Expose fieldsets to the accessibility API via a subrole of AXFieldset.
39
40         Reviewed by Chris Fleizach.
41
42         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
43         (-[WebAccessibilityObjectWrapper subrole]):
44
45 2015-06-03  Myles C. Maxfield  <mmaxfield@apple.com>
46
47         Remove dead code FontPlatformData::roundsGlyphAdvances()
48         https://bugs.webkit.org/show_bug.cgi?id=145628
49
50         Reviewed by Simon Fraser.
51
52         No new tests because there is no behavior change.
53
54         * WebCore.order:
55         * platform/graphics/FontPlatformData.h:
56         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
57         (WebCore::FontPlatformData::roundsGlyphAdvances): Deleted.
58
59 2015-06-03  Ryuan Choi  <ryuan.choi@navercorp.com>
60
61         [CoordinatedGraphics] Merge CoordinatedTile into Tile
62         https://bugs.webkit.org/show_bug.cgi?id=145602
63
64         Reviewed by Darin Adler.
65
66         CoordinatedTile only implements Tile since Qt and WebKit1/Efl were dropped.
67         So, there is no reason that CoordinatedTile inherits Tile interface.
68
69         No new tests, no behavior changes.
70
71         * PlatformEfl.cmake:
72         * PlatformGTK.cmake:
73         * WebCore.vcxproj/WebCore.vcxproj:
74         * WebCore.vcxproj/WebCore.vcxproj.filters:
75         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
76         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
77         * platform/graphics/texmap/coordinated/CoordinatedTile.cpp: Renamed to Tile.cpp
78         * platform/graphics/texmap/coordinated/CoordinatedTile.h: Merged into Tile.h
79         (WebCore::CoordinatedTile::coordinate): Deleted.
80         (WebCore::CoordinatedTile::rect): Deleted.
81         * platform/graphics/texmap/coordinated/Tile.cpp: Renamed from CoordinatedTile.cpp.
82         * platform/graphics/texmap/coordinated/Tile.h:
83         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
84         (WebCore::TiledBackingStore::createTiles):
85
86 2015-06-03  Matt Rajca  <mrajca@apple.com>
87
88         Add basic Media Session support to HTMLMediaElement.
89         https://bugs.webkit.org/show_bug.cgi?id=145581
90
91         Reviewed by Eric Carlson.
92
93         HTMLMediaElements now have:
94
95         - a 'kind' attribute representing the intrinsic media category
96         - a 'session' attribute representing the current media session, if any
97
98         * CMakeLists.txt: Include the new HTMLMediaElementMediaSession sources.
99         * DerivedSources.make: Include the new IDL file.
100         * Modules/mediasession/HTMLMediaElementMediaSession.cpp: Added.
101         (WebCore::HTMLMediaElementMediaSession::session):
102         * Modules/mediasession/HTMLMediaElementMediaSession.h: Added basic translation of the IDL file.
103         (WebCore::HTMLMediaElementMediaSession::kind):
104         (WebCore::HTMLMediaElementMediaSession::setKind):
105         (WebCore::HTMLMediaElementMediaSession::setSession):
106         * Modules/mediasession/HTMLMediaElementMediaSession.idl: Added from the Media Session spec.
107         * PlatformMac.cmake: Include DOMHTMLMediaElementMediaSession.cpp.
108         * WebCore.xcodeproj/project.pbxproj: Include the new HTMLMediaElementMediaSession sources.
109         * html/HTMLMediaElement.h: Added accessors for 'kind' and 'session'.
110         (WebCore::HTMLMediaElement::kind):
111         (WebCore::HTMLMediaElement::setKind):
112         (WebCore::HTMLMediaElement::session):
113         (WebCore::HTMLMediaElement::setSession):
114
115 2015-06-03  Myles C. Maxfield  <mmaxfield@apple.com>
116
117         Cleanup after r185175.
118         https://bugs.webkit.org/show_bug.cgi?id=145569
119         <rdar://problem/20671711>
120
121         Unreviewed.
122
123         No new tests because there is no behavior change.
124
125         * platform/graphics/WidthIterator.h:
126
127 2015-06-02  Myles C. Maxfield  <mmaxfield@apple.com>
128
129         SoftBank Emoji are not transformed by shaping when in a run of their own
130         https://bugs.webkit.org/show_bug.cgi?id=145569
131         <rdar://problem/20671711>
132
133         Reviewed by Dean Jackson.
134
135         Normally, we don't perform shaping on single glyphs. However, these particular codepoints
136         need to have shaping run on them, even if they are alone.
137
138         Test: fast/text/softbank-emoji.html Note that this test may fail in different locales on
139         different platforms. This patch disables the test on iOS.
140
141         * Source/WebCore/platform/graphics/WidthIterator.cpp:
142         (WebCore::applyFontTransforms): Move the length-of-1 check into shouldApplyFontTransforms()
143         (WebCore::shouldApplyFontTransforms): Return true if we have one of these emoji characters in
144         a run of its own
145         (WebCore::advanceInternal): Keep track of the previous character, and use it to call
146         shouldApplyFontTransforms. 
147         * Source/WebCore/platform/graphics/WidthIterator.h: shouldApplyFontTransforms() needs
148         some more information to perform its duties.
149
150 2015-06-03  Daniel Bates  <dabates@apple.com>
151
152         Caps lock indicator should not be shown in read-only or disabled field
153         https://bugs.webkit.org/show_bug.cgi?id=145612
154         <rdar://problem/21227454>
155
156         Reviewed by Darin Adler.
157
158         * html/TextFieldInputType.cpp:
159         (WebCore::TextFieldInputType::disabledAttributeChanged): Update caps lock indicator state.
160         (WebCore::TextFieldInputType::readonlyAttributeChanged): Ditto.
161         (WebCore::TextFieldInputType::shouldDrawCapsLockIndicator): Do not draw the caps lock indicator
162         when the field is read-only or disabled.
163
164 2015-06-03  Dean Jackson  <dino@apple.com>
165
166         Crash in GraphicsContext3D::getInternalFramebufferSize
167         https://bugs.webkit.org/show_bug.cgi?id=145479
168         <rdar://problem/16461048>
169
170         Reviewed by Eric Carlson.
171
172         If we are in an unitialized or lost state, don't try to access the context.
173
174         In order to test this, I added an Internal setting that always
175         forces WebGL into a pending state.
176
177         Test: fast/canvas/webgl/useWhilePending.html
178
179         * html/canvas/WebGLRenderingContextBase.cpp:
180         (WebCore::WebGLRenderingContextBase::create): Check internal settings for
181         a forced pending state.
182         (WebCore::WebGLRenderingContextBase::drawingBufferWidth): Guard against a pending state.
183         (WebCore::WebGLRenderingContextBase::drawingBufferHeight): Ditto.
184         * page/Settings.cpp: New Internal setting for forcing a pending policy.
185         (WebCore::Settings::Settings):
186         (WebCore::Settings::setForcePendingWebGLPolicy):
187         * page/Settings.h:
188         (WebCore::Settings::isForcePendingWebGLPolicy):
189         * testing/InternalSettings.cpp:
190         (WebCore::InternalSettings::Backup::Backup):
191         (WebCore::InternalSettings::Backup::restoreTo):
192         (WebCore::InternalSettings::setForcePendingWebGLPolicy):
193         * testing/InternalSettings.h:
194         * testing/InternalSettings.idl:
195
196 2015-06-03  Hunseop Jeong  <hs85.jeong@samsung.com>
197
198         Use modern for-loops in WebCore/page.
199         https://bugs.webkit.org/show_bug.cgi?id=145455
200
201         Reviewed by Darin Adler.
202
203         No new tests, no behavior changes.
204
205         * page/Chrome.cpp:
206         (WebCore::Chrome::notifyPopupOpeningObservers):
207         * page/ContentSecurityPolicy.cpp:
208         (WebCore::CSPSourceList::matches):
209         (WebCore::CSPDirectiveList::gatherReportURIs):
210         (WebCore::ContentSecurityPolicy::copyStateFrom):
211         (WebCore::isAllowedByAll):
212         (WebCore::isAllowedByAllWithState):
213         (WebCore::isAllowedByAllWithContext):
214         (WebCore::isAllowedByAllWithURL):
215         (WebCore::ContentSecurityPolicy::evalDisabledErrorMessage):
216         (WebCore::ContentSecurityPolicy::allowPluginType):
217         (WebCore::ContentSecurityPolicy::reflectedXSSDisposition):
218         (WebCore::ContentSecurityPolicy::gatherReportURIs):
219         * page/ContextMenuController.cpp:
220         (WebCore::ContextMenuController::populate):
221         * page/DOMWindow.cpp:
222         (WebCore::DOMWindow::dispatchAllPendingBeforeUnloadEvents):
223         (WebCore::DOMWindow::dispatchAllPendingUnloadEvents):
224         (WebCore::DOMWindow::willDestroyCachedFrame):
225         (WebCore::DOMWindow::willDestroyDocumentInFrame):
226         (WebCore::DOMWindow::willDetachDocumentFromFrame):
227         (WebCore::DOMWindow::disconnectDOMWindowProperties):
228         (WebCore::DOMWindow::reconnectDOMWindowProperties):
229         (WebCore::DOMWindow::getMatchedCSSRules):
230         * page/DeviceController.cpp:
231         (WebCore::DeviceController::dispatchDeviceEvent):
232         (WebCore::DeviceController::fireDeviceEvent):
233         * page/EventHandler.cpp:
234         (WebCore::EventHandler::updateMouseEventTargetNode):
235         (WebCore::EventHandler::handleTouchEvent):
236         * page/FocusController.cpp:
237         (WebCore::FocusController::setIsVisibleAndActiveInternal):
238         * page/Frame.cpp:
239         (WebCore::Frame::orientationChanged):
240         (WebCore::Frame::injectUserScriptsForWorld):
241         * page/FrameView.cpp:
242         (WebCore::FrameView::scrollContentsFastPath):
243         (WebCore::FrameView::serviceScriptedAnimations):
244         (WebCore::FrameView::trackedRepaintRectsAsText):
245         (WebCore::FrameView::updateWidgetPositions):
246         (WebCore::FrameView::notifyWidgets):
247         * page/Page.cpp:
248         (WebCore::networkStateChanged):
249         (WebCore::Page::stringToViewMode):
250         (WebCore::Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment):
251         (WebCore::Page::refreshPlugins):
252         (WebCore::Page::lockAllOverlayScrollbarsToHidden):
253         (WebCore::Page::pluginViews):
254         (WebCore::Page::storageBlockingStateChanged):
255         (WebCore::Page::setIsVisibleInternal):
256         * page/PageGroup.cpp:
257         (WebCore::PageGroup::captionPreferencesChanged):
258         * page/PageGroupLoadDeferrer.cpp:
259         (WebCore::PageGroupLoadDeferrer::PageGroupLoadDeferrer):
260         (WebCore::PageGroupLoadDeferrer::~PageGroupLoadDeferrer):
261         * page/PageSerializer.cpp:
262         (WebCore::PageSerializer::serializeFrame):
263         * page/Performance.cpp:
264         (WebCore::Performance::webkitGetEntriesByType):
265         (WebCore::Performance::webkitGetEntriesByName):
266         * page/PerformanceResourceTiming.cpp:
267         (WebCore::passesTimingAllowCheck):
268         * page/PerformanceUserTiming.cpp:
269         (WebCore::convertToEntrySequence):
270         * page/SecurityPolicy.cpp:
271         (WebCore::SecurityPolicy::isAccessWhiteListed):
272         * page/UserContentURLPattern.cpp:
273         (WebCore::UserContentURLPattern::matchesPatterns):
274         * page/WindowFeatures.cpp:
275         (WebCore::WindowFeatures::parseDialogFeatures):
276         * page/animation/AnimationController.cpp:
277         (WebCore::AnimationControllerPrivate::updateAnimations):
278         (WebCore::AnimationControllerPrivate::fireEventsAndUpdateStyle):
279         (WebCore::AnimationControllerPrivate::suspendAnimationsForDocument):
280         (WebCore::AnimationControllerPrivate::resumeAnimationsForDocument):
281         (WebCore::AnimationControllerPrivate::numberOfActiveAnimations):
282         * page/animation/CSSPropertyAnimation.cpp:
283         (WebCore::ShorthandPropertyWrapper::equals):
284         (WebCore::ShorthandPropertyWrapper::blend):
285         * page/scrolling/AsyncScrollingCoordinator.cpp:
286         (WebCore::setStateScrollingNodeSnapOffsetsAsFloat):
287         * page/scrolling/ScrollingCoordinator.cpp:
288         (WebCore::ScrollingCoordinator::absoluteNonFastScrollableRegionForFrame):
289         (WebCore::ScrollingCoordinator::hasVisibleSlowRepaintViewportConstrainedObjects):
290
291 2015-06-03  Daniel Bates  <dabates@apple.com>
292
293         AutoFill button should not be shown in read-only or disabled field
294         https://bugs.webkit.org/show_bug.cgi?id=145579
295         <rdar://problem/21212494>
296
297         Reviewed by Darin Adler.
298
299         Fixes an issue where the AutoFill button is shown in a read-only or disabled
300         field. We should not show the AutoFill button in such cases.
301
302         Tests: fast/forms/auto-fill-button/hide-auto-fill-button-when-input-becomes-disabled.html
303                fast/forms/auto-fill-button/hide-auto-fill-button-when-input-becomes-readonly.html
304                fast/forms/auto-fill-button/input-auto-fill-button.html
305                fast/forms/auto-fill-button/input-disabled-auto-fill-button.html
306                fast/forms/auto-fill-button/input-readonly-auto-fill-button.html
307                fast/forms/auto-fill-button/input-readonly-non-empty-auto-fill-button.html
308
309         * html/TextFieldInputType.cpp:
310         (WebCore::TextFieldInputType::disabledAttributeChanged): Update AutoFill button state.
311         (WebCore::TextFieldInputType::readonlyAttributeChanged): Ditto.
312         (WebCore::TextFieldInputType::shouldDrawAutoFillButton): Do not draw AutoFill button
313         when the field is disabled or read-only.
314
315 2015-06-03  Brent Fulgham  <bfulgham@apple.com>
316
317         REGRESSION: (r181879): Scrolling in select/option region in iFrame scrolls both select and iframe
318         https://bugs.webkit.org/show_bug.cgi?id=145574
319         <rdar://problem/20966828>
320
321         Reviewed by Simon Fraser.
322
323         Tested by platform/mac-wk2/tiled-drawing/scrolling/fast-scroll-iframe-latched-select.html
324
325         When the scroll gesture is started when the latched scrollable container is not at the limit of its
326         scroll region, we are NOT supposed to propagate the scroll event to the enclosing region. However,
327         we were doing two things wrong:
328         (1) When we recognized we were latching, we were using the right wheel event target, but not using
329             the latched scrollable container.
330         (2) Likewise, we were not using latched ScrollableArea when handling wheel events.
331
332         Instead, we were using the current scrollable container and ScrollableArea under the mouse pointer,
333         which could be different from the point we started latching as the content scrolled.
334         
335         The fix was to properly track the scrollable container and scrollable area during latching.
336
337         I attempted to store the latched ScrollableArea in the latchingState object, like we already do for the
338         scrollable container, but found that this did not work properly. I think the life cycle of the
339         ScrollableArea may not match the scrollable container, and since they are not reference counted I
340         simply retrieve the ScrollableArea when needed.
341
342         * page/mac/EventHandlerMac.mm:
343         (WebCore::scrollableAreaForContainerNode): Helper function to return the correct ScrollableArea
344         for the two types of RenderBox elements.
345         (WebCore::latchedToFrameOrBody): Helper predicate to identify Frame and Body elements.
346         (WebCore::EventHandler::platformPrepareForWheelEvents): Use the correct ScrollableArea for the given
347         ContainerNode. When latching, make sure to use the ScrollableArea that is related to the latched scrollable
348         container, not the area currently underneath the mouse pointer.
349
350 2015-06-03  Brady Eidson  <beidson@apple.com>
351
352         REGRESSION (r183498): Certain types of frame loads in iframes with <base target="_blank"> can open urls in new window/tabs
353         https://bugs.webkit.org/show_bug.cgi?id=145580
354
355         Reviewed by Mark Lam.
356
357         Tests: fast/loader/fragment-navigation-base-blank.html
358                fast/loader/iframe-meta-refresh-base-blank.html
359                fast/loader/iframe-set-location-base-blank.html
360                fast/loader/refresh-iframe-base-blank.html
361
362         Before 183498, callers of FrameLoader::changeLocation() got automatically assigned a frame name of "_self".
363         After 183498, many remained without a frame name.
364         
365         Later on, FrameLoader applies the <base> target as their frame name if they don't already have one. 
366         
367         When the <base> target is "_blank", that causes a new window/tab.
368         
369         Restoring "_self" to these call sites fixes this.
370
371         * inspector/InspectorFrontendClientLocal.cpp:
372         (WebCore::InspectorFrontendClientLocal::openInNewTab):
373         
374         * inspector/InspectorPageAgent.cpp:
375         (WebCore::InspectorPageAgent::navigate):
376         
377         * loader/FrameLoadRequest.h:
378         (WebCore::FrameLoadRequest::FrameLoadRequest):
379         
380         * loader/NavigationScheduler.cpp:
381         (WebCore::NavigationScheduler::scheduleLocationChange):
382         
383         * page/DOMWindow.cpp:
384         (WebCore::DOMWindow::createWindow):
385
386 2015-06-03  Alexey Proskuryakov  <ap@apple.com>
387
388         More iOS build fixing.
389
390         * platform/spi/mac/AVFoundationSPI.h:
391
392 2015-06-03  Zalan Bujtas  <zalan@apple.com>
393
394         Subpixel rendering: Composited layer with subpixel gap does not get painted properly when its position changes.
395         https://bugs.webkit.org/show_bug.cgi?id=145587
396
397         Reviewed by Simon Fraser.
398
399         The composited layer always snaps to an enclosing device pixel (floors) while the renderer rounds.
400         At certain positions (for example 0.5px on a 1x display), a gap is formed between the layer(0px) and its renderer(1px).
401         In such cases, when the the renderer moves to a position (1.1px) where the gap is closed, we need to issue repaint on the layer
402         in order to get the renderering right.
403
404         Test: compositing/child-layer-with-subpixel-gap-needs-repaint-when-parent-moves.html
405
406         * rendering/RenderLayerBacking.cpp:
407         (WebCore::RenderLayerBacking::updateAfterLayout):
408         (WebCore::devicePixelFractionGapFromRendererChanged):
409         (WebCore::RenderLayerBacking::updateGeometry):
410         * rendering/RenderLayerBacking.h:
411
412 2015-06-03  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
413
414         [Streams API] ReadableStreamReader::closed() should be called once by binding code
415         https://bugs.webkit.org/show_bug.cgi?id=145551
416
417         Reviewed by Darin Adler.
418
419         Covered by existing tests.
420
421         * bindings/js/JSReadableStreamReaderCustom.cpp:
422         (WebCore::JSReadableStreamReader::closed): Calling ReadableStreamReader::closed only at creation of the promise.
423
424 2015-06-02  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
425
426         [EFL][GTK] Fix build error since r185137
427         https://bugs.webkit.org/show_bug.cgi?id=145596
428
429         Unreviewed, fix build break on EFL and GTK port.
430
431         * dom/Text.cpp:
432         (WebCore::Text::formatForDebugger): Use strncpy() instead of strlcpy().
433
434 2015-06-02  Sergio Villar Senin  <svillar@igalia.com>
435
436         [CSS Grid Layout] Switch from parenthesis to brackets for grid line names
437         https://bugs.webkit.org/show_bug.cgi?id=144996
438
439         Reviewed by Darin Adler.
440
441         Grid line names are now enclosed by brackets instead of parentheses
442         as mentioned in the latest version of the spec. Appartently the CSS
443         code is now more readable and avoids issues with tools like SASS.
444
445         * css/CSSGrammar.y.in:
446         * css/CSSGridLineNamesValue.cpp:
447         (WebCore::CSSGridLineNamesValue::customCSSText):
448
449 2015-06-02  Alexey Proskuryakov  <ap@apple.com>
450
451         iOS build fix
452
453         * platform/spi/mac/AVFoundationSPI.h:
454
455 2015-06-02  Commit Queue  <commit-queue@webkit.org>
456
457         Unreviewed, rolling out r185128 and r185132.
458         https://bugs.webkit.org/show_bug.cgi?id=145597
459
460         The new test hits a bad assertion (Requested by ap on
461         #webkit).
462
463         Reverted changesets:
464
465         "Crash in GraphicsContext3D::getInternalFramebufferSize"
466         https://bugs.webkit.org/show_bug.cgi?id=145479
467         http://trac.webkit.org/changeset/185128
468
469         "Skip webgl/useWhilePending.html on WebKit 1."
470         http://trac.webkit.org/changeset/185132
471
472 2015-06-02  Ryuan Choi  <ryuan.choi@navercorp.com>
473
474         [CoordinatedGraphics] Refactor TiledBackingStoreClient
475         https://bugs.webkit.org/show_bug.cgi?id=145577
476
477         Reviewed by Gyuyoung Kim.
478
479         This patch removes and simplifies unnecessary virtual methods of TiledBackingStoreClient.
480
481         No new tests, no behavior changes.
482
483         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
484         (WebCore::CoordinatedGraphicsLayer::didUpdateTileBuffers): Renamed from tiledBackingStorePaintEnd.
485         (WebCore::CoordinatedGraphicsLayer::tiledBackingStorePaintBegin): Deleted.
486         (WebCore::CoordinatedGraphicsLayer::tiledBackingStorePaintEnd): Deleted.
487         (WebCore::CoordinatedGraphicsLayer::tiledBackingStoreBackgroundColor):
488         Deleted because tiledBackingStoreBackgroundColor() is not used anywhere.
489         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
490         * platform/graphics/texmap/coordinated/CoordinatedTile.cpp:
491         (WebCore::CoordinatedTile::updateBackBuffer):
492         Simplified not to call unnecessary methods. In addition, used modern for loop.
493         (WebCore::CoordinatedTile::swapBackBufferToFront): Deleted.
494         * platform/graphics/texmap/coordinated/CoordinatedTile.h:
495         * platform/graphics/texmap/coordinated/Tile.h:
496         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
497         (WebCore::TiledBackingStore::updateTileBuffers):
498         * platform/graphics/texmap/coordinated/TiledBackingStoreClient.h:
499
500 2015-06-02  Doug Russell  <d_russell@apple.com>
501
502         AX: debugging attributes for text markers
503         https://bugs.webkit.org/show_bug.cgi?id=145283
504
505         Reviewed by Chris Fleizach.
506
507         AXTextMarkerDebugDescription: returns the result of
508         VisiblePosition::formatForDebugger() for the visible position that a text marker
509         represents.
510         AXTextMarkerNodeDebugDescription: calls Node::showNode() and
511         Node::showNodePathForThis() for the visible position that a text marker
512         represents.
513         AXTextMarkerNodeTreeDebugDescription: calls Node::showTreeForThis() for the
514         visible position that a text marker represents.
515         AXTextMarkerRangeDebugDescription: returns the result of
516         formatForDebugger(VisiblePositionRange) for the visible position range that a text
517         marker range represents.
518
519         This is debug only tooling. Tests would be flakey and not very helpful.
520
521         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
522         (-[WebAccessibilityObjectWrapper debugDescriptionForTextMarker:]):
523         (-[WebAccessibilityObjectWrapper debugDescriptionForTextMarkerRange:]):
524         (-[WebAccessibilityObjectWrapper showNodeForTextMarker:]):
525         (-[WebAccessibilityObjectWrapper showNodeTreeForTextMarker:]):
526         (formatForDebugger):
527         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
528         * dom/Text.cpp:
529         (WebCore::Text::formatForDebugger):
530
531 2015-06-02  Matt Rajca  <mrajca@apple.com>
532
533         MediaSessions should keep track of their current state.
534         https://bugs.webkit.org/show_bug.cgi?id=145575
535
536         Reviewed by Alex Christensen.
537
538         * Modules/mediasession/MediaSession.h: Per the Media Session spec, the state can be 'Idle', 'Active', or
539           'Interrupted'. Sessions are created in an 'Idle' state.
540
541 2015-06-02  Jon Lee  <jonlee@apple.com>
542
543         Build fix when building with internal SDKs
544         https://bugs.webkit.org/show_bug.cgi?id=145576
545         rdar://problem/21089476
546
547         Reviewed by Alexey Proskuryakov.
548
549         * platform/spi/mac/AVFoundationSPI.h: Include the right header.
550
551 2015-06-02  Dean Jackson  <dino@apple.com>
552
553         No need to guard the sizes attribute against PICTURE_SIZES in preload scanner.
554         https://bugs.webkit.org/show_bug.cgi?id=145573
555         <rdar://problem/21210038>
556
557         Reviewed by Myles Maxfield.
558
559         The PICTURE_SIZES feature flag doesn't need to be used to
560         guard preloading of the sizes attribute.
561
562         * html/parser/HTMLPreloadScanner.cpp:
563         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes): Deleted.
564         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): Deleted.
565
566 2015-06-02  Anders Carlsson  <andersca@apple.com>
567
568         Use UUIDs for WebSQL database filenames instead of a sequential number
569         https://bugs.webkit.org/show_bug.cgi?id=145571
570
571         Reviewed by Dan Bernstein.
572
573         This is a first step towards getting rid of the iOS specific code path where we truncate
574         database files instead of deleting them (in order to avoid file corruption).
575
576         * Modules/webdatabase/DatabaseTracker.cpp:
577         (WebCore::generateDatabaseFileName):
578         (WebCore::DatabaseTracker::fullPathForDatabaseNoLock):
579         * platform/sql/SQLiteFileSystem.cpp:
580         (WebCore::SQLiteFileSystem::getFileNameForNewDatabase): Deleted.
581         * platform/sql/SQLiteFileSystem.h:
582
583 2015-06-02  Dean Jackson  <dino@apple.com>
584
585         Crash in GraphicsContext3D::getInternalFramebufferSize
586         https://bugs.webkit.org/show_bug.cgi?id=145479
587         <rdar://problem/16461048>
588
589         Reviewed by Eric Carlson.
590
591         If we are in an unitialized or lost state, don't try to access the context.
592
593         In order to test this, I added an Internal setting that always
594         forces WebGL into a pending state.
595
596         Test: fast/canvas/webgl/useWhilePending.html
597
598         * html/canvas/WebGLRenderingContextBase.cpp:
599         (WebCore::WebGLRenderingContextBase::create): Check internal settings for
600         a forced pending state.
601         (WebCore::WebGLRenderingContextBase::drawingBufferWidth): Guard against a pending state.
602         (WebCore::WebGLRenderingContextBase::drawingBufferHeight): Ditto.
603         * page/Settings.cpp: New Internal setting for forcing a pending policy.
604         (WebCore::Settings::Settings):
605         (WebCore::Settings::setForcePendingWebGLPolicy):
606         * page/Settings.h:
607         (WebCore::Settings::isForcePendingWebGLPolicy):
608         * testing/InternalSettings.cpp:
609         (WebCore::InternalSettings::Backup::Backup):
610         (WebCore::InternalSettings::Backup::restoreTo):
611         (WebCore::InternalSettings::setForcePendingWebGLPolicy):
612         * testing/InternalSettings.h:
613         * testing/InternalSettings.idl:
614
615 2015-06-02  Matt Rajca  <mrajca@apple.com>
616
617         Added a stub implementation of MediaSession, part of the Media Session spec.
618         https://bugs.webkit.org/show_bug.cgi?id=145530
619
620         Reviewed by Eric Carlson.
621
622         * CMakeLists.txt: Added new MediaSession sources.
623         * DerivedSources.make:
624         * Modules/mediasession/MediaSession.cpp: Added stub implementation.
625         (WebCore::MediaSession::MediaSession): Per the Media Session spec, a Media Remote Controls object should only be
626           set for 'content' sessions; it is null otherwise.
627         (WebCore::MediaSession::~MediaSession):
628         (WebCore::MediaSession::controls):
629         (WebCore::MediaSession::releaseSession):
630         * Modules/mediasession/MediaSession.h: Added basic translation of IDL file.
631         * Modules/mediasession/MediaSession.idl: Added from the Media Session spec.
632         * WebCore.xcodeproj/project.pbxproj: Added new MediaSession sources.
633
634 2015-06-02  Zalan Bujtas  <zalan@apple.com>
635
636         Backdrop filter is pulling in content from behind the window.
637         https://bugs.webkit.org/show_bug.cgi?id=145561
638         rdar://problem/20909309
639
640         Reviewed by Simon Fraser.
641
642         This patch ensures that the backdrop filter layer is positioned and sized properly.
643
644         The backdrop filter layer should take its size and position from its renderer and not
645         directly from the composited layer.
646         In certain cases the composited layer's size is expanded to cover items like box shadow or an absolute positioned descendant.
647         In such cases, we ended up applying the backdrop filter to those areas as well.
648
649         Tests: css3/filters/backdrop/backdrop-filter-does-not-size-properly-absolute.html
650                css3/filters/backdrop/backdrop-filter-does-not-size-properly-border-and-padding.html
651
652         * platform/graphics/GraphicsLayer.h:
653         (WebCore::GraphicsLayer::setBackdropFiltersRect):
654         (WebCore::GraphicsLayer::backdropFiltersRect):
655         * platform/graphics/ca/GraphicsLayerCA.cpp:
656         (WebCore::GraphicsLayerCA::setBackdropFiltersRect):
657         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
658         (WebCore::GraphicsLayerCA::updateBackdropFilters):
659         (WebCore::GraphicsLayerCA::updateBackdropFiltersRect):
660         (WebCore::GraphicsLayerCA::updateContentsRects):
661         (WebCore::GraphicsLayerCA::updateGeometry): Deleted.
662         * platform/graphics/ca/GraphicsLayerCA.h:
663         * rendering/RenderLayerBacking.cpp:
664         (WebCore::RenderLayerBacking::updateBackdropFiltersGeometry):
665         (WebCore::RenderLayerBacking::updateGeometry):
666         * rendering/RenderLayerBacking.h:
667
668 2015-06-02  Eric Carlson  <eric.carlson@apple.com>
669
670         [Mac] occasional crash in Document::playbackTargetAvailabilityDidChange
671         https://bugs.webkit.org/show_bug.cgi?id=145559
672
673         Reviewed by Darin Adler.
674
675         No new tests, covered by existing tests.
676
677         * html/HTMLMediaElement.cpp:
678         (WebCore::HTMLMediaElement::registerWithDocument): Pass document to m_mediaSession->registerWithDocument.
679         (WebCore::HTMLMediaElement::unregisterWithDocument): Pass document to m_mediaSession->unRegisterWithDocument.
680         (WebCore::HTMLMediaElement::documentWillSuspendForPageCache): Ditto.
681         (WebCore::HTMLMediaElement::documentDidResumeFromPageCache): Ditto.
682
683         * html/MediaElementSession.cpp:
684         (WebCore::MediaElementSession::registerWithDocument): Take a document.
685         (WebCore::MediaElementSession::unregisterWithDocument): Ditto.
686         * html/MediaElementSession.h:
687
688 2015-06-02  Chris Dumez  <cdumez@apple.com>
689
690         Calling FrameView::viewportContentsChanged() after style recalcs is too expensive
691         https://bugs.webkit.org/show_bug.cgi?id=145554
692         <rdar://problem/21189478>
693
694         Reviewed by Darin Adler and Simon Fraser.
695
696         Only call FrameView::viewportContentsChanged() after a style recalc if
697         composited layers have been updated (and there is no pending layout).
698
699         We already viewportContentsChanged() after layout so we only need to
700         call viewportContentsChanged() after a style recalc if it did not cause
701         a layout but may have caused an element to become visible. In
702         particular, this can happen in the case of composited animations (e.g.
703         using -webkit-transform to move an element inside the viewport).
704         Therefore, we now only call viewportContentsChanged() after a style
705         recalc if it caused composited layers to be updated. This avoids a lot
706         of unnecessary calls to viewportContentsChanged(), which is expensive.
707
708         No new tests, already covered by:
709         fast/images/animated-gif-webkit-transform.html
710
711         * dom/Document.cpp:
712         (WebCore::Document::recalcStyle):
713         * page/FrameView.cpp:
714         (WebCore::FrameView::updateCompositingLayersAfterStyleChange):
715         * page/FrameView.h:
716         * rendering/RenderLayerCompositor.cpp:
717         (WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout):
718         (WebCore::RenderLayerCompositor::updateCompositingLayers):
719         * rendering/RenderLayerCompositor.h:
720
721 2015-06-02  Myles C. Maxfield  <mmaxfield@apple.com>
722
723         Remove use of CTFontSetRenderingParameters()
724         https://bugs.webkit.org/show_bug.cgi?id=145560
725
726         Reviewed by Simon Fraser.
727
728         Instead, always use CTFontSetRenderingStyle().
729
730         No new tests because there is no behavior change.
731
732         * platform/graphics/cocoa/FontCascadeCocoa.mm:
733         (WebCore::RenderingStyleSaver::RenderingStyleSaver): Deleted.
734         (WebCore::RenderingStyleSaver::~RenderingStyleSaver): Deleted.
735
736 2015-06-02  Anders Carlsson  <andersca@apple.com>
737
738         Move WKFontAntialiasingStateSaver to its own file
739         https://bugs.webkit.org/show_bug.cgi?id=145557
740         rdar://problem/21134776
741
742         Reviewed by Dan Bernstein.
743
744         Also rename it to FontAntialiasingStateSaver. Also, change it to use the CoreGraphicsSPI.h header for its
745         CGFontAntialiasingStyle definition instead of using an explicit typedef.
746
747         * WebCore.xcodeproj/project.pbxproj:
748         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
749         (PlatformCALayer::drawLayerContents):
750         * platform/graphics/ios/FontAntialiasingStateSaver.h: Copied from Source/WebCore/platform/ios/wak/WKGraphics.h.
751         (WebCore::FontAntialiasingStateSaver::FontAntialiasingStateSaver):
752         (WebCore::FontAntialiasingStateSaver::setup):
753         (WebCore::FontAntialiasingStateSaver::restore):
754         * platform/ios/LegacyTileCache.mm:
755         (WebCore::LegacyTileCache::drawWindowContent):
756         * platform/ios/wak/WKGraphics.h:
757         (WKFontAntialiasingStateSaver::WKFontAntialiasingStateSaver): Deleted.
758         * platform/ios/wak/WKGraphics.mm:
759         (WKFontAntialiasingStateSaver::setup): Deleted.
760         (WKFontAntialiasingStateSaver::restore): Deleted.
761
762 2015-06-02  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
763
764         [Streams API] Implement ReadableStreamReader read method in closed and errored state
765         https://bugs.webkit.org/show_bug.cgi?id=144790
766
767         Reviewed by Darin Adler.
768
769         Reader delegates read() promise handling to its stream except if reader is no longer locking the stream and stream is readable.
770         Storing of reader read() promise callbacks as a Vector in ReadableStream.
771         Added resolution/rejection of read() promises in case of errored/closed streams.
772
773         Test: streams/readable-stream-reader-read.html
774
775         * ForwardingHeaders/runtime/IteratorOperations.h: Added.
776         * Modules/streams/ReadableStream.cpp:
777         (WebCore::ReadableStream::cleanCallbacks): Clean the read requests.
778         (WebCore::ReadableStream::changeStateToClosed): Run success callbacks with undefined for read requests.
779         (WebCore::ReadableStream::changeStateToErrored): Run failure callbacks with the errors for read requests.
780         (WebCore::ReadableStream::closed): Parameter name changed.
781         (WebCore::ReadableStream::read): Added. Succeeds with empty when closed, fails with error when errored, reads a
782         value if there is one and pushes the callbacks to the queue otherwise.
783         * Modules/streams/ReadableStream.h:
784         (WebCore::ReadableStream::ReadCallbacks::ReadCallbacks): Struct containing success and failure callbacks.
785         * Modules/streams/ReadableStreamReader.cpp:
786         (WebCore::ReadableStreamReader::closed): Parameter name changed.
787         (WebCore::ReadableStreamReader::read): Invoke success with empty if we streams if we don't have the right reader
788         and call the stream otherwise to read.
789         * Modules/streams/ReadableStreamReader.h:
790         * bindings/js/JSReadableStreamReaderCustom.cpp:
791         (WebCore::JSReadableStreamReader::read): Create the callback lambdas and invoke read. Failure rejects the
792         promise and success creates the result from the read value.
793         * bindings/js/ReadableJSStream.cpp:
794         (WebCore::ReadableJSStream::hasValue):
795         (WebCore::ReadableJSStream::read): Not implemented yet.
796         * bindings/js/ReadableJSStream.h:
797
798 2015-06-01  Myles C. Maxfield  <mmaxfield@apple.com>
799
800         [Cocoa] FontPlatformData's equality check should always use reference URLs
801         https://bugs.webkit.org/show_bug.cgi?id=144168
802
803         Reviewed by Tim Horton.
804
805         <rdar://problem/18985642> is not fixed, so we need to continue using the older
806         objectForEqualityCheck().
807
808         No new tests because there is no behavior change.
809
810         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
811         (WebCore::FontPlatformData::objectForEqualityCheck):
812
813 2015-06-02  Andy Estes  <aestes@apple.com>
814
815         [Mac] REGRESSION (r175941): Max.app crashes when adding a sound file to a patch due to removing cursor resources from WebCore.framework
816         https://bugs.webkit.org/show_bug.cgi?id=145555
817
818         Reviewed by Darin Adler.
819
820         Re-added the cursor resources used by Max.app and ran sort-Xcode-project-file.
821
822         * Resources/copyCursor.png: Added.
823         * Resources/moveCursor.png: Added.
824         * Resources/northEastSouthWestResizeCursor.png: Added.
825         * Resources/northSouthResizeCursor.png: Added.
826         * Resources/northWestSouthEastResizeCursor.png: Added.
827         * WebCore.xcodeproj/project.pbxproj:
828
829 2015-06-02  Brady Eidson  <beidson@apple.com>
830
831         WebKit policy delegate should suggest if a navigation should be allowed to open URLs externally.
832         rdar://problem/21025301 and https://bugs.webkit.org/show_bug.cgi?id=145280
833
834         Reviewed by Alex Christensen.
835
836         Tests: loader/navigation-policy/should-open-external-urls/main-frame-click.html
837                loader/navigation-policy/should-open-external-urls/main-frame-navigated-programatically-by-subframe.html
838                loader/navigation-policy/should-open-external-urls/main-frame-with-flag-progamatic.html
839                loader/navigation-policy/should-open-external-urls/main-frame-without-flag-programatic.html
840                loader/navigation-policy/should-open-external-urls/subframe-click-target-self.html
841                loader/navigation-policy/should-open-external-urls/subframe-click-target-top.html
842                loader/navigation-policy/should-open-external-urls/user-gesture-target-blank-with-flag-from-subframe.html
843                loader/navigation-policy/should-open-external-urls/user-gesture-target-blank-with-flag.html
844                loader/navigation-policy/should-open-external-urls/user-gesture-target-blank-without-flag-from-subframe.html
845                loader/navigation-policy/should-open-external-urls/user-gesture-target-blank-without-flag.html
846                loader/navigation-policy/should-open-external-urls/user-gesture-window-open-with-flag-from-subframe.html
847                loader/navigation-policy/should-open-external-urls/user-gesture-window-open-with-flag.html
848                loader/navigation-policy/should-open-external-urls/user-gesture-window-open-without-flag-from-subframe.html
849                loader/navigation-policy/should-open-external-urls/user-gesture-window-open-without-flag.html
850                loader/navigation-policy/should-open-external-urls/window-open-with-flag-from-subframe.html
851                loader/navigation-policy/should-open-external-urls/window-open-with-flag.html
852                loader/navigation-policy/should-open-external-urls/window-open-without-flag-from-subframe.html
853                loader/navigation-policy/should-open-external-urls/window-open-without-flag.html
854
855         The "should open external URLs" flag is only for main frames.
856         It doesn't enforce any sort of policy internal to WebKit, but rather is for notifications to the policy delegate.
857         
858         It is set from one of two places:
859         1 - A main frame is navigated by any frame as the result of a user gesture.
860         2 - WebKit2 API explicitly states the flag is true.
861         
862         The flag value propagates when:
863         1 - When a main frame document is navigated to a new main frame document.
864         2 - When a new window is opened from a page whose main frame had the flag set.
865         3 - When a new window is opened as the result of a user gesture.
866         
867         The flag resets to false when:
868         1 - A subframe navigates a main frame without a user gesture.
869         
870         This patch is large, but does little more than the following:
871         1 - Adds a ShouldOpenExternalURLs flag to both FrameLoadRequest and NavigationAction.
872         2 - Makes sure anybody who creates either of those objects sets a sensible for that flag.
873         3 - When FrameLoader creates a new DocumentLoader, it sets its flag based on whether or not the load is in a main frame,
874             whether or not the load is from a user gesture, and based on the initiator's value of the flag. 
875             
876         * dom/Document.cpp:
877         (WebCore::Document::processHttpEquiv):
878         (WebCore::Document::shouldOpenExternalURLsPolicyToPropagate):
879         * dom/Document.h:
880         
881         * html/HTMLAnchorElement.cpp:
882         (WebCore::HTMLAnchorElement::handleClick):
883         
884         * html/HTMLLinkElement.cpp:
885         (WebCore::HTMLLinkElement::handleClick):
886         
887         * html/parser/XSSAuditorDelegate.cpp:
888         (WebCore::XSSAuditorDelegate::didBlockScript):
889         
890         * inspector/InspectorFrontendClientLocal.cpp:
891         (WebCore::InspectorFrontendClientLocal::openInNewTab):
892         
893         * inspector/InspectorPageAgent.cpp:
894         (WebCore::InspectorPageAgent::navigate):
895         
896         * loader/DocumentLoader.cpp:
897         (WebCore::DocumentLoader::setTriggeringAction):
898         (WebCore::DocumentLoader::shouldOpenExternalURLsPolicyToPropagate):
899         * loader/DocumentLoader.h:
900         (WebCore::DocumentLoader::shouldOpenExternalURLsPolicy): Deleted.
901         
902         * loader/FrameLoadRequest.cpp:
903         (WebCore::FrameLoadRequest::FrameLoadRequest):
904         * loader/FrameLoadRequest.h:
905         (WebCore::FrameLoadRequest::FrameLoadRequest):
906         
907         * loader/FrameLoader.cpp:
908         (WebCore::FrameLoader::urlSelected):
909         (WebCore::FrameLoader::receivedFirstData):
910         (WebCore::FrameLoader::loadURLIntoChildFrame):
911         (WebCore::FrameLoader::loadURL):
912         (WebCore::FrameLoader::load):
913         (WebCore::FrameLoader::loadWithNavigationAction):
914         (WebCore::FrameLoader::reloadWithOverrideEncoding):
915         (WebCore::FrameLoader::reload):
916         (WebCore::FrameLoader::loadPostRequest):
917         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
918         (WebCore::FrameLoader::applyShouldOpenExternalURLsPolicyToNewDocumentLoader):
919         * loader/FrameLoader.h:
920         
921         * loader/NavigationAction.cpp:
922         (WebCore::NavigationAction::NavigationAction):
923         (WebCore::NavigationAction::copyWithShouldOpenExternalURLsPolicy):
924         * loader/NavigationAction.h:
925         (WebCore::NavigationAction::setShouldOpenExternalURLsPolicy): Deleted.
926         
927         * loader/NavigationScheduler.cpp:
928         (WebCore::ScheduledURLNavigation::ScheduledURLNavigation):
929         (WebCore::ScheduledRedirect::ScheduledRedirect):
930         (WebCore::ScheduledLocationChange::ScheduledLocationChange):
931         (WebCore::ScheduledRefresh::ScheduledRefresh):
932         (WebCore::ScheduledFormSubmission::ScheduledFormSubmission):
933         (WebCore::NavigationScheduler::scheduleRedirect):
934         (WebCore::NavigationScheduler::scheduleLocationChange):
935         (WebCore::NavigationScheduler::scheduleRefresh):
936         * loader/NavigationScheduler.h:
937         
938         * loader/PolicyChecker.cpp:
939         (WebCore::PolicyChecker::checkNavigationPolicy):
940         
941         * loader/SubframeLoader.cpp:
942         (WebCore::SubframeLoader::loadOrRedirectSubframe):
943         
944         * loader/appcache/ApplicationCacheGroup.cpp:
945         (WebCore::ApplicationCacheGroup::selectCache):
946         
947         * page/ContextMenuController.cpp:
948         (WebCore::openNewWindow):
949         (WebCore::ContextMenuController::contextMenuItemSelected):
950         
951         * page/DOMWindow.cpp:
952         (WebCore::DOMWindow::setLocation):
953         (WebCore::DOMWindow::createWindow):
954         (WebCore::DOMWindow::open):
955         
956         * page/DragController.cpp:
957         (WebCore::DragController::performDragOperation):
958         
959         * page/Location.cpp:
960         (WebCore::Location::reload):
961         
962         * replay/ReplayInputDispatchMethods.cpp:
963         (WebCore::InitialNavigation::dispatch):
964         
965         * svg/SVGAElement.cpp:
966         (WebCore::SVGAElement::defaultEventHandler):
967
968 2015-06-02  Yusuke Suzuki  <utatane.tea@gmail.com>
969
970         Heap-use-after-free read of size 4 in JavaScriptCore: WTF::StringImpl::isSymbol() (StringImpl.h:496)
971         https://bugs.webkit.org/show_bug.cgi?id=145532
972
973         Reviewed by Geoffrey Garen.
974
975         Hold the ownership of AtomicStringImpl*.
976
977         * bindings/scripts/CodeGeneratorJS.pm:
978         (GenerateParametersCheck):
979         * dom/TreeScope.cpp:
980         (WebCore::TreeScope::getElementById):
981
982 2015-06-02  Youenn Fablet  <youenn.fablet@crf.canon.fr>
983
984         SharedBuffer::copy should return a Ref<SharedBuffer>
985         https://bugs.webkit.org/show_bug.cgi?id=145499
986
987         Reviewed by Andreas Kling.
988
989         Changing SharedBuffer::copy to return a Ref<> and adapting some code accordingly.
990
991         Covered by existing tests.
992
993         * loader/SubresourceLoader.cpp:
994         (WebCore::SubresourceLoader::didReceiveResponse):
995         * loader/appcache/ApplicationCacheResource.cpp:
996         (WebCore::ApplicationCacheResource::deliver):
997         * platform/SharedBuffer.cpp:
998         (WebCore::SharedBuffer::copy):
999         * platform/SharedBuffer.h:
1000
1001 2015-06-01  Hunseop Jeong  <hs85.jeong@samsung.com>
1002
1003         Use modern for-loops in WebCore/Modules - 1
1004         https://bugs.webkit.org/show_bug.cgi?id=145507
1005
1006         Reviewed by Darin Adler.
1007
1008         No new tests, no behavior changes.
1009
1010         * Modules/battery/BatteryController.cpp:
1011         (WebCore::BatteryController::~BatteryController):
1012         (WebCore::BatteryController::updateBatteryStatus):
1013         (WebCore::BatteryController::didChangeBatteryStatus):
1014         * Modules/encryptedmedia/CDM.cpp:
1015         (WebCore::CDMFactoryForKeySystem):
1016         * Modules/encryptedmedia/MediaKeys.cpp:
1017         (WebCore::MediaKeys::~MediaKeys):
1018         * Modules/geolocation/Geolocation.cpp:
1019         (WebCore::Geolocation::resumeTimerFired):
1020         (WebCore::Geolocation::resetAllGeolocationPermission):
1021         (WebCore::Geolocation::makeCachedPositionCallbacks):
1022         (WebCore::Geolocation::sendError):
1023         (WebCore::Geolocation::sendPosition):
1024         (WebCore::Geolocation::stopTimer):
1025         (WebCore::Geolocation::cancelRequests):
1026         (WebCore::Geolocation::extractNotifiersWithCachedPosition):
1027         (WebCore::Geolocation::copyToSet):
1028         (WebCore::Geolocation::handlePendingPermissionNotifiers):
1029         * Modules/geolocation/GeolocationController.cpp:
1030         (WebCore::GeolocationController::positionChanged):
1031         (WebCore::GeolocationController::errorOccurred):
1032         * Modules/indexeddb/IDBDatabase.cpp:
1033         (WebCore::IDBDatabase::objectStoreNames):
1034         (WebCore::IDBDatabase::transaction):
1035         (WebCore::IDBDatabase::forceClose):
1036         (WebCore::IDBDatabase::closeConnection):
1037         (WebCore::IDBDatabase::findObjectStoreId):
1038         * Modules/indexeddb/IDBDatabaseBackend.cpp:
1039         (WebCore::IDBDatabaseBackend::runIntVersionChangeTransaction):
1040         (WebCore::IDBDatabaseBackend::deleteDatabase):
1041         (WebCore::IDBDatabaseBackend::close):
1042         * Modules/indexeddb/IDBDatabaseMetadata.cpp:
1043         (WebCore::IDBDatabaseMetadata::isolatedCopy):
1044         (WebCore::IDBObjectStoreMetadata::isolatedCopy):
1045         * Modules/indexeddb/IDBKey.cpp:
1046         (WebCore::IDBKey::isValid):
1047         * Modules/indexeddb/IDBKey.h:
1048         (WebCore::IDBKey::createMultiEntryArray):
1049         (WebCore::IDBKey::createArray):
1050         * Modules/indexeddb/IDBKeyPath.cpp:
1051         (WebCore::IDBKeyPath::IDBKeyPath):
1052         (WebCore::IDBKeyPath::isValid):
1053         (WebCore::IDBKeyPath::isolatedCopy):
1054         * Modules/indexeddb/IDBObjectStore.cpp:
1055         (WebCore::IDBObjectStore::indexNames):
1056         (WebCore::IDBObjectStore::put):
1057         Rename the two 'i's to 'keyData' and 'indexKeyData'.
1058         (WebCore::IDBObjectStore::index):
1059         (WebCore::IDBObjectStore::findIndexId):
1060         * Modules/indexeddb/IDBPendingTransactionMonitor.cpp:
1061         (WebCore::IDBPendingTransactionMonitor::deactivateNewTransactions):
1062         * Modules/indexeddb/IDBRequest.cpp:
1063         (WebCore::IDBRequest::abort):
1064         * Modules/indexeddb/IDBTransaction.cpp:
1065         (WebCore::IDBTransaction::closeOpenCursors):
1066         (WebCore::IDBTransaction::onAbort):
1067         (WebCore::IDBTransaction::dispatchEvent):
1068         * Modules/indexeddb/IDBTransactionBackend.cpp:
1069         (WebCore::IDBTransactionBackend::create):
1070         (WebCore::IDBTransactionBackend::closeOpenCursors):
1071         * Modules/mediasource/MediaSource.cpp:
1072         (WebCore::MediaSource::onReadyStateChange):
1073         * Modules/mediastream/MediaConstraintsImpl.cpp:
1074         (WebCore::MediaConstraintsImpl::initialize):
1075         (WebCore::MediaConstraintsImpl::getMandatoryConstraints):
1076         (WebCore::MediaConstraintsImpl::getOptionalConstraintValue):
1077         * Modules/mediastream/MediaStream.cpp:
1078         (WebCore::MediaStream::create):
1079         (WebCore::MediaStream::cloneMediaStreamTrackVector):
1080         (WebCore::MediaStream::addTrack):
1081         (WebCore::MediaStream::removeTrack):
1082         (WebCore::MediaStream::haveTrackWithSource):
1083         (WebCore::MediaStream::getTrackById):
1084         (WebCore::MediaStream::getTracks):
1085         (WebCore::MediaStream::trackDidEnd):
1086         (WebCore::MediaStream::scheduledEventTimerFired):
1087         * Modules/mediastream/MediaStreamCapabilities.cpp:
1088         (WebCore::MediaStreamCapabilities::sourceType):
1089         (WebCore::MediaStreamCapabilities::sourceId):
1090         (WebCore::MediaStreamCapabilities::facingMode):
1091         * Modules/mediastream/MediaStreamTrack.cpp:
1092         (WebCore::MediaStreamTrack::trackDidEnd):
1093         * Modules/mediastream/MediaStreamTrackSourcesRequest.cpp:
1094         (WebCore::MediaStreamTrackSourcesRequest::didCompleteRequest):
1095
1096 2015-06-01  Myles C. Maxfield  <mmaxfield@apple.com>
1097
1098         [SVG -> OTF Converter] Remove unnecessary hacks
1099         https://bugs.webkit.org/show_bug.cgi?id=145088
1100
1101         Reviewed by Simon Fraser.
1102
1103         Not needed anymore.
1104
1105         Test: svg/text/offset-square-svg-font.html
1106
1107         * svg/SVGToOTFFontConversion.cpp:
1108         (WebCore::SVGToOTFFontConverter::appendKERNTable):
1109         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):
1110
1111 2015-06-01  Andreas Kling  <akling@apple.com>
1112
1113         CSS animations in filling-forwards state shouldn't force compositing.
1114         <https://webkit.org/b/145389>
1115         <rdar://problem/17923642>
1116
1117         Reviewed by Simon Fraser.
1118
1119         Stop checking if a CSS animation is filling forwards when computing
1120         compositing requirements.
1121
1122         This prevents finished animations from pinning elements in composited
1123         state, and frees up a bunch of IOSurface memory on some content.
1124
1125         * page/animation/AnimationBase.h:
1126         (WebCore::AnimationBase::isAnimatingProperty): Deleted.
1127         * rendering/RenderLayerBacking.cpp:
1128         (WebCore::RenderLayerBacking::updateGeometry):
1129         * rendering/RenderLayerCompositor.cpp:
1130         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation):
1131
1132 2015-06-01  Myles C. Maxfield  <mmaxfield@apple.com>
1133
1134         Out of bounds read in WebCore::ComplexTextController::adjustGlyphsAndAdvances
1135         https://bugs.webkit.org/show_bug.cgi?id=145537
1136         <rdar://problem/20959267>
1137
1138         Reviewed by Darin Adler.
1139
1140         U16_IS_SURROGATE_LEAD(ch) assumes U16_IS_SURROGATE(ch). In this case, that isn't true.
1141
1142         Test: fast/text/crash-complex-text-surrogate.html
1143
1144         * platform/graphics/mac/ComplexTextController.cpp:
1145         (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
1146
1147 2015-05-30  Zalan Bujtas  <zalan@apple.com>
1148
1149         REGRESSION (179771): zooming on facebook images covers image
1150         https://bugs.webkit.org/show_bug.cgi?id=145485
1151
1152         Reviewed by Simon Fraser.
1153
1154         Scaling an infinite rect should always produce an infinite rect.
1155         (Based on Simon Fraser's patch)
1156
1157         Test: compositing/layer-creation/zoomed-clip-intersection.html
1158
1159         * platform/graphics/LayoutRect.cpp:
1160         (WebCore::LayoutRect::scale):
1161
1162 2015-06-01  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1163
1164         Purge PassRefPtr in WebCore/Modules - 3
1165         https://bugs.webkit.org/show_bug.cgi?id=145508
1166
1167         Reviewed by Darin Adler.
1168
1169         As a step to purge PassRefPtr, this patch removes PassRefPtr, then use Ref or RefPtr.
1170
1171         * Modules/indexeddb/IDBCursor.cpp:
1172         (WebCore::IDBCursor::create):
1173         * Modules/indexeddb/IDBCursor.h:
1174         * Modules/indexeddb/IDBCursorBackend.h:
1175         (WebCore::IDBCursorBackend::create):
1176         * Modules/indexeddb/IDBCursorBackendOperations.h:
1177         (WebCore::CursorIterationOperation::create):
1178         (WebCore::CursorAdvanceOperation::create):
1179         * Modules/indexeddb/IDBDatabase.cpp:
1180         (WebCore::IDBDatabase::create):
1181         * Modules/indexeddb/IDBDatabase.h:
1182         * Modules/indexeddb/IDBDatabaseBackend.cpp:
1183         (WebCore::IDBDatabaseBackend::create):
1184         * Modules/indexeddb/IDBDatabaseBackend.h:
1185         * Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp:
1186         (WebCore::IDBDatabaseCallbacksImpl::create):
1187         * Modules/indexeddb/IDBDatabaseCallbacksImpl.h:
1188         * Modules/indexeddb/IDBDatabaseError.h:
1189         (WebCore::IDBDatabaseError::create):
1190         * Modules/indexeddb/IDBIndex.h:
1191         (WebCore::IDBIndex::create):
1192         * Modules/indexeddb/IDBKey.h:
1193         (WebCore::IDBKey::createInvalid):
1194         (WebCore::IDBKey::createNumber):
1195         (WebCore::IDBKey::createString):
1196         (WebCore::IDBKey::createDate):
1197         (WebCore::IDBKey::createArray):
1198         * Modules/indexeddb/IDBKeyRange.cpp:
1199         (WebCore::IDBKeyRange::create):
1200         * Modules/indexeddb/IDBKeyRange.h:
1201         (WebCore::IDBKeyRange::create):
1202         * Modules/indexeddb/IDBObjectStore.cpp:
1203         * Modules/indexeddb/IDBObjectStore.h:
1204         (WebCore::IDBObjectStore::create):
1205         * Modules/indexeddb/IDBOpenDBRequest.cpp:
1206         (WebCore::IDBOpenDBRequest::create):
1207         * Modules/indexeddb/IDBOpenDBRequest.h:
1208         * Modules/indexeddb/IDBRecordIdentifier.h:
1209         (WebCore::IDBRecordIdentifier::create):
1210         * Modules/indexeddb/IDBRequest.cpp:
1211         (WebCore::IDBRequest::create):
1212         (WebCore::IDBRequest::getResultCursor):
1213         * Modules/indexeddb/IDBRequest.h:
1214         * Modules/indexeddb/IDBTransaction.cpp:
1215         (WebCore::IDBTransaction::create):
1216         * Modules/indexeddb/IDBTransaction.h:
1217         * Modules/indexeddb/IDBTransactionBackend.cpp:
1218         (WebCore::IDBTransactionBackend::create):
1219         * Modules/indexeddb/IDBTransactionBackend.h:
1220         * Modules/indexeddb/IDBTransactionBackendOperations.h:
1221         (WebCore::CreateObjectStoreOperation::create):
1222         (WebCore::DeleteObjectStoreOperation::create):
1223         (WebCore::IDBDatabaseBackend::VersionChangeOperation::create):
1224         (WebCore::CreateObjectStoreAbortOperation::create):
1225         (WebCore::DeleteObjectStoreAbortOperation::create):
1226         (WebCore::IDBDatabaseBackend::VersionChangeAbortOperation::create):
1227         (WebCore::CreateIndexOperation::create):
1228         (WebCore::CreateIndexAbortOperation::create):
1229         (WebCore::DeleteIndexOperation::create):
1230         (WebCore::DeleteIndexAbortOperation::create):
1231         (WebCore::GetOperation::create):
1232         (WebCore::PutOperation::create):
1233         (WebCore::SetIndexesReadyOperation::create):
1234         (WebCore::OpenCursorOperation::create):
1235         (WebCore::CountOperation::create):
1236         (WebCore::DeleteRangeOperation::create):
1237         (WebCore::ClearObjectStoreOperation::create):
1238         * Modules/mediasource/VideoPlaybackQuality.cpp:
1239         (WebCore::VideoPlaybackQuality::create):
1240         * Modules/mediasource/VideoPlaybackQuality.h:
1241         * Modules/mediastream/MediaConstraintsImpl.cpp:
1242         (WebCore::MediaConstraintsImpl::create):
1243         * Modules/mediastream/MediaConstraintsImpl.h:
1244         * Modules/mediastream/MediaStream.cpp:
1245         (WebCore::MediaStream::create):
1246         * Modules/mediastream/MediaStream.h:
1247         * Modules/mediastream/RTCDTMFSender.cpp:
1248         (WebCore::RTCDTMFSender::create):
1249         * Modules/mediastream/RTCDTMFSender.h:
1250         * Modules/mediastream/RTCOfferAnswerOptions.cpp:
1251         (WebCore::RTCOfferAnswerOptions::create):
1252         (WebCore::RTCOfferOptions::create):
1253         * Modules/mediastream/RTCOfferAnswerOptions.h:
1254         * Modules/mediastream/RTCPeerConnection.cpp:
1255         (WebCore::RTCPeerConnection::parseConfiguration):
1256         (WebCore::RTCPeerConnection::create):
1257         * Modules/mediastream/RTCPeerConnection.h:
1258         * Modules/webaudio/AudioContext.cpp:
1259         (WebCore::AudioContext::create):
1260         * Modules/webdatabase/AbstractDatabaseServer.h:
1261         * Modules/webdatabase/DOMWindowWebDatabase.cpp:
1262         (WebCore::DOMWindowWebDatabase::openDatabase):
1263         * Modules/webdatabase/DOMWindowWebDatabase.h:
1264         * Modules/webdatabase/DatabaseManager.cpp:
1265         (WebCore::DatabaseManager::existingDatabaseContextFor):
1266         (WebCore::DatabaseManager::databaseContextFor):
1267         (WebCore::DatabaseManager::openDatabase):
1268         * Modules/webdatabase/DatabaseManager.h:
1269         * Modules/webdatabase/DatabaseServer.cpp:
1270         (WebCore::DatabaseServer::openDatabase):
1271         (WebCore::DatabaseServer::createDatabase):
1272         * Modules/webdatabase/DatabaseServer.h:
1273
1274 2015-06-01  Daniel Bates  <dabates@apple.com>
1275
1276         Notify client that we began editing when text field is focused
1277         https://bugs.webkit.org/show_bug.cgi?id=145439
1278         <rdar://problem/21142108>
1279
1280         Reviewed by Anders Carlsson.
1281
1282         Inform the editor client that we began editing when a text field is focused either
1283         by being explicitly focused (programmatically or by user interaction) or implicitly
1284         focused when the window became active.
1285
1286         Currently we only notify the editor client that we began editing a text field when
1287         when a person actually changes the value of the field. And we always notify the
1288         client that we ended editing when a text field is defocused regardless of whether
1289         we executed a began editing callback. Moreover we notify a client that we
1290         ended editing when the field is defocused (either explicitly or implicitly when the
1291         window becomes inactive). Instead we should always notify the client that we began
1292         editing when the field is focused so that this callback is symmetric with the end
1293         editing callback.
1294
1295         * html/SearchInputType.cpp:
1296         (WebCore::SearchInputType::didSetValueByUserEdit): Remove parameter for ValueChangeState,
1297         which was used to determine whether we should notify the client that we began editing, because
1298         we we will notify the client that editing began when the text field is focused as opposed to
1299         when the value of text field first changes.
1300         * html/SearchInputType.h: Ditto.
1301         * html/TextFieldInputType.cpp:
1302         (WebCore::TextFieldInputType::forwardEvent): Notify the client that we began editing when
1303         the text field is focused.
1304         (WebCore::TextFieldInputType::subtreeHasChanged): Update call site of didSetValueByUserEdit()
1305         following the removal of its parameter.
1306         (WebCore::TextFieldInputType::didSetValueByUserEdit): Ditto.
1307         * html/TextFieldInputType.h:
1308
1309 2015-06-01  Anders Carlsson  <andersca@apple.com>
1310
1311         WAKScrollView.h cannot be imported standalone
1312         https://bugs.webkit.org/show_bug.cgi?id=145529
1313
1314         Reviewed by Dan Bernstein.
1315
1316         * page/mac/WebCoreFrameView.h:
1317         Remove the __cplusplus #ifdefs since WebCoreFrameView.h is only used by Objective-C++ code.
1318         (The different non-C++ method declarations were wrong anyway!)
1319
1320         * platform/ScrollTypes.h:
1321         Remove the #ifdef __cplusplus surrounding the code, add header includes to make the file self-contained,
1322         and reformat the enum definitions.
1323
1324 2015-06-01  Alex Christensen  <achristensen@webkit.org>
1325
1326         [Content Extensions] resource-type and load-type should be independent.
1327         https://bugs.webkit.org/show_bug.cgi?id=145528
1328         rdar://problem/21190765
1329
1330         Reviewed by Benjamin Poulain.
1331
1332         Covered by existing tests and a new API test.
1333         
1334         Right now we use the same uint16_t to store all the load-type and resource-type flags,
1335         then we just do a bitwise and to check both at the same time. This results in a trigger
1336         with load-type and resource-type firing if either condition is met, not both conditions.
1337         A trigger with both resource-type and load-type conditions should only fire if both conditions are met.
1338
1339         * contentextensions/DFABytecodeInterpreter.cpp:
1340         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretTestFlagsAndAppendAction):
1341         Check and correctly handle rules with both resource-type and load-type flags.
1342         * loader/ResourceLoadInfo.h:
1343         Add masks to separate flags from resource-type and load-type.
1344
1345 2015-06-01  Alex Christensen  <achristensen@webkit.org>
1346
1347         [Content Extensions] Reduce DFA memory usage.
1348         https://bugs.webkit.org/show_bug.cgi?id=145526
1349
1350         Reviewed by Benjamin Poulain.
1351
1352         * contentextensions/DFA.cpp:
1353         (WebCore::ContentExtensions::DFA::memoryUsed):
1354         (WebCore::ContentExtensions::DFANode::transitions):
1355         (WebCore::ContentExtensions::DFANode::fallbackTransitionDestination):
1356         (WebCore::ContentExtensions::DFANode::changeFallbackTransition):
1357         (WebCore::ContentExtensions::DFANode::addFallbackTransition):
1358         (WebCore::ContentExtensions::DFANode::containsTransition):
1359         (WebCore::ContentExtensions::DFANode::kill):
1360         * contentextensions/DFA.h:
1361         * contentextensions/DFAMinimizer.cpp:
1362         (WebCore::ContentExtensions::DFAMinimizer::minimize):
1363         * contentextensions/NFAToDFA.cpp:
1364         (WebCore::ContentExtensions::NFAToDFA::convert):
1365         Use separate Vectors for the transition characters and destinations to avoid wasting memory to padding a std::pair.
1366
1367 2015-06-01  Matt Rajca  <mrajca@apple.com>
1368
1369         Implemented the `eventTargetInterface` and `scriptExecutionContext` methods required by EventTarget, as well as
1370         some required infrastructure.
1371         https://bugs.webkit.org/show_bug.cgi?id=145523
1372
1373         Reviewed by Eric Carlson.
1374
1375         * Modules/mediasession/MediaRemoteControls.cpp:
1376         (WebCore::MediaRemoteControls::MediaRemoteControls): Initialize all instance variables.
1377         * Modules/mediasession/MediaRemoteControls.h: MediaRemoteControl's constructor now takes a script execution
1378           context, which we provide to EventTarget. The required eventTargetInterface method has also been implemented.
1379         (WebCore::MediaRemoteControls::create):
1380         * Modules/mediasession/MediaRemoteControls.idl: Indicate MediaRemoteControls now takes a constructor that is
1381           passed in a script execution context. To prevent build errors, event handlers have been removed until they are
1382           implemented.
1383         * WebCore.xcodeproj/project.pbxproj: We should be building the derived JSMediaRemoteControls class with WebCore.
1384         * dom/EventTargetFactory.in: Ensure a MediaRemoteControlsEventTargetInterfaceType is generated.
1385
1386 2015-06-01  Benjamin Poulain  <bpoulain@apple.com>
1387
1388         [CSS JIT] Fail to compile when we are out of executable memory
1389         https://bugs.webkit.org/show_bug.cgi?id=145483
1390         rdar://problem/21166612
1391
1392         Reviewed by Andreas Kling.
1393
1394         We should use a soft failure when the Linker fails to allocate
1395         executable memory for the CSS JIT. We will just fallback to slow
1396         code when that happen, better slow CSS than crashing.
1397
1398         Credit to Chris for finding this problem.
1399
1400         * cssjit/SelectorCompiler.cpp:
1401         (WebCore::SelectorCompiler::SelectorCodeGenerator::compile):
1402
1403 2015-06-01  Chris Dumez  <cdumez@apple.com>
1404
1405         ASSERT(revalidatingResource.inCache()) in MemoryCache when reloading tumblr.com
1406         https://bugs.webkit.org/show_bug.cgi?id=145518
1407         <rdar://problem/21168573>
1408
1409         Reviewed by Darin Adler.
1410
1411         There was an assertion in MemoryCache::revalidationSucceeded() making
1412         sure that the resource that was revalidated is still in the memory
1413         cache. However, nothing prevents this resource from being pruned while
1414         it is being revalidated. We do make sure that the resource in question
1415         cannot be destroyed though (see CachedResource::canDelete()).
1416
1417         This patch gets rid of this assertion as it is incorrect. Also, the
1418         fact that the resource is no longer in the memory cache is not an
1419         issue. We are merely going to call MemoryCache::remove() to remove
1420         it from the memory cache before re-adding it and updating its
1421         HTTP response. The call to MemoryCache::remove() will simply be a
1422         no-op in this case and we will not have any problem adding the
1423         resource back to the memory cache because the resource is kept alive.
1424
1425         Test: http/tests/cache/memory-cache-pruning-during-revalidation.html
1426
1427         * loader/cache/MemoryCache.cpp:
1428         (WebCore::MemoryCache::revalidationSucceeded): Deleted.
1429
1430 2015-06-01  Matt Rajca  <mrajca@apple.com>
1431
1432         Add stub implementation of MediaRemoteControls, part of the Media Session spec.
1433         https://bugs.webkit.org/show_bug.cgi?id=145462
1434
1435         Reviewed by Eric Carlson.
1436
1437         * CMakeLists.txt: Added IDL file as well as the corresponding implementation file.
1438         * DerivedSources.make: Included the new IDL file.
1439         * Modules/mediasession/MediaRemoteControls.cpp: Added an empty implementation file.
1440         (MediaRemoteControls::~MediaRemoteControls):
1441         * Modules/mediasession/MediaRemoteControls.h: Added a stubbed header file with accessors for the four attributes declared in the IDL file.
1442         (WebCore::MediaRemoteControls::previousTrackEnabled):
1443         (WebCore::MediaRemoteControls::setPreviousTrackEnabled):
1444         (WebCore::MediaRemoteControls::nextTrackEnabled):
1445         (WebCore::MediaRemoteControls::setNextTrackEnabled):
1446         (WebCore::MediaRemoteControls::seekForwardEnabled):
1447         (WebCore::MediaRemoteControls::setSeekForwardEnabled):
1448         (WebCore::MediaRemoteControls::seekBackwardEnabled):
1449         (WebCore::MediaRemoteControls::setSeekBackwardEnabled):
1450         * Modules/mediasession/MediaRemoteControls.idl: Added from the Media Session spec.
1451         * WebCore.xcodeproj/project.pbxproj: Included the new IDL file and MediaRemoteControls.cpp/.h sources.
1452
1453 2015-06-01  Sergio Villar Senin  <svillar@igalia.com>
1454
1455         [CSS Grid Layout] Simplify the interface of GridResolvedPosition
1456         https://bugs.webkit.org/show_bug.cgi?id=139077
1457
1458         Reviewed by Darin Adler.
1459
1460         The interface of GridResolvedPosition is full of static methods
1461         that are used only internally, we should not expose them.
1462
1463         Apart from that resolveGridPositionsFromStyle() do always return
1464         a valid GridSpan from now on meaning that the caller has to ensure
1465         that the resolution does not require running the auto-placement
1466         algorithm. A new class called GridUnresolvedSpan was added for
1467         that purpose.
1468
1469         No new tests as this is a refactoring.
1470
1471         * rendering/RenderGrid.cpp:
1472         (WebCore::RenderGrid::placeItemsOnGrid):
1473         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
1474         (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
1475         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
1476         * rendering/style/GridPosition.h:
1477         * rendering/style/GridResolvedPosition.cpp:
1478         (WebCore::gridLinesForSide):
1479         (WebCore::implicitNamedGridLineForSide):
1480         (WebCore::isNonExistentNamedLineOrArea):
1481         (WebCore::GridUnresolvedSpan::requiresAutoPlacement):
1482         (WebCore::GridUnresolvedSpan::adjustGridPositionsFromStyle):
1483         (WebCore::adjustGridPositionForRowEndColumnEndSide):
1484         (WebCore::adjustGridPositionForSide):
1485         (WebCore::resolveNamedGridLinePositionFromStyle):
1486         (WebCore::firstNamedGridLineBeforePosition):
1487         (WebCore::resolveRowStartColumnStartNamedGridLinePositionAgainstOppositePosition):
1488         (WebCore::resolveRowEndColumnEndNamedGridLinePositionAgainstOppositePosition):
1489         (WebCore::resolveNamedGridLinePositionAgainstOppositePosition):
1490         (WebCore::resolveGridPositionAgainstOppositePosition):
1491         (WebCore::GridResolvedPosition::resolveGridPositionsFromAutoPlacementPosition):
1492         (WebCore::resolveGridPositionFromStyle):
1493         (WebCore::GridResolvedPosition::GridResolvedPosition):
1494         (WebCore::GridResolvedPosition::unresolvedSpanFromStyle):
1495         (WebCore::GridResolvedPosition::resolveGridPositionsFromStyle):
1496         (WebCore::GridResolvedPosition::adjustGridPositionsFromStyle): Deleted.
1497         (WebCore::GridResolvedPosition::resolveNamedGridLinePositionFromStyle): Deleted.
1498         (WebCore::GridResolvedPosition::resolveGridPositionFromStyle): Deleted.
1499         (WebCore::GridResolvedPosition::resolveGridPositionAgainstOppositePosition): Deleted.
1500         (WebCore::GridResolvedPosition::resolveNamedGridLinePositionAgainstOppositePosition): Deleted.
1501         (WebCore::GridResolvedPosition::resolveRowStartColumnStartNamedGridLinePositionAgainstOppositePosition): Deleted.
1502         (WebCore::GridResolvedPosition::resolveRowEndColumnEndNamedGridLinePositionAgainstOppositePosition): Deleted.
1503         * rendering/style/GridResolvedPosition.h:
1504         (WebCore::GridUnresolvedSpan::GridUnresolvedSpan): New class.
1505         (WebCore::GridUnresolvedSpan::initialPosition):
1506         (WebCore::GridUnresolvedSpan::finalPosition):
1507         (WebCore::GridUnresolvedSpan::initialPositionSide):
1508         (WebCore::GridUnresolvedSpan::finalPositionSide):
1509         (WebCore::GridResolvedPosition::adjustGridPositionForRowEndColumnEndSide): Deleted.
1510         (WebCore::GridResolvedPosition::adjustGridPositionForSide): Deleted.
1511         (WebCore::GridResolvedPosition::GridResolvedPosition): Deleted.
1512
1513 2015-06-01  Csaba Osztrogon√°c  <ossy@webkit.org>
1514
1515         Fix the !ENABLE(VIDEO_TRACK) build after r184799
1516         https://bugs.webkit.org/show_bug.cgi?id=145510
1517
1518         Reviewed by Eric Carlson.
1519
1520         * testing/Internals.cpp:
1521         (WebCore::Internals::userPreferredAudioCharacteristics):
1522         (WebCore::Internals::setUserPreferredAudioCharacteristic):
1523
1524 2015-06-01  Csaba Osztrogon√°c  <ossy@webkit.org>
1525
1526         Fix logical-not-parentheses warning in CachedScript.cpp
1527         https://bugs.webkit.org/show_bug.cgi?id=145254
1528
1529         Reviewed by Sam Weinig.
1530
1531         * loader/cache/CachedScript.cpp:
1532         (WebCore::CachedScript::mimeTypeAllowedByNosniff): "!X==Y" should be "X!=Y" here.
1533
1534 2015-05-31  Dan Bernstein  <mitz@apple.com>
1535
1536         Remove Panther support
1537         https://bugs.webkit.org/show_bug.cgi?id=145506
1538
1539         Reviewed by Sam Weinig.
1540
1541         * platform/ios/wak/WAKAppKitStubs.h: Don't check for pre-Tiger SDKs.
1542
1543 2015-05-31  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1544
1545         Remove unused variable kZoomTicks.
1546         https://bugs.webkit.org/show_bug.cgi?id=145504
1547
1548         Reviewed by Sam Weinig.
1549
1550         No new tests, no behavior changes.
1551
1552         * platform/ScrollAnimatorNone.cpp:
1553
1554 2015-05-31  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1555
1556         Async XMLHttpRequest should get access to AppCache resources stored as flat files
1557         https://bugs.webkit.org/show_bug.cgi?id=138506
1558
1559         Reviewed by Darin Adler.
1560
1561         This patch reads flat file data when DocumentLoader substituteResource delivery timer is fired.
1562         Refactoring to remove ApplicationCacheHost/DocumentLoader friend link.
1563         Added ResourceLoader::deliverResponseAndData helper function, taking a SharedBuffer as input to remove an unneeded copy for flat files (no change for other files). 
1564
1565         Test: http/tests/appcache/simple-video-async.html
1566
1567         * loader/DocumentLoader.cpp:
1568         (WebCore::DocumentLoader::substituteResourceDeliveryTimerFired):
1569         (WebCore::DocumentLoader::scheduleArchiveLoad):
1570         (WebCore::DocumentLoader::scheduleSubstituteResourceLoad): Helper function to remove ApplicationCacheHost friend link.
1571         * loader/DocumentLoader.h:
1572         * loader/ResourceLoader.cpp:
1573         (WebCore::ResourceLoader::deliverResponseAndData): Helper function, code mostly moved from DocumentLoader::substituteResourceDeliveryTimerFired.
1574         * loader/ResourceLoader.h:
1575         * loader/SubstituteResource.h:
1576         (WebCore::SubstituteResource::deliver): Introduced to be overriden by ApplicationCacheResource to take care of flat file case.
1577         * loader/appcache/ApplicationCacheHost.cpp:
1578         (WebCore::ApplicationCacheHost::maybeLoadResource):
1579         (WebCore::ApplicationCacheHost::scheduleLoadFallbackResourceFromApplicationCache):
1580         * loader/appcache/ApplicationCacheResource.cpp:
1581         (WebCore::ApplicationCacheResource::deliver): Use SharedBuffer::createWithContentsOfFile to load data stored in flat file.
1582         * loader/appcache/ApplicationCacheResource.h:
1583
1584 2015-05-31  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
1585
1586         [Streams API] Implement ReadableStreamController constructor
1587         https://bugs.webkit.org/show_bug.cgi?id=143752
1588
1589         Reviewed by Darin Adler.
1590
1591         Covered by rebased test and expectation.
1592
1593         * Modules/streams/ReadableStreamController.idl: Adding CustomConstructor.
1594         * bindings/js/JSReadableStreamControllerCustom.cpp:
1595         (WebCore::constructJSReadableStreamController): Throws an exception whenever called.
1596
1597 2015-05-30  Brady Eidson  <beidson@apple.com>
1598
1599         Make FrameLoader methods that take PassRefPtr<Event> take raw pointers instead.
1600         https://bugs.webkit.org/show_bug.cgi?id=145495
1601
1602         Reviewed by Alexey Proskuryakov.
1603
1604         No new tests (No change in behavior).
1605
1606         In most cases ownership of the Event is not actually being transferred, and these functions are all rarely called anyways.
1607         
1608         * html/HTMLLinkElement.cpp:
1609         (WebCore::HTMLLinkElement::handleClick):
1610         
1611         * loader/FrameLoader.cpp:
1612         (WebCore::FrameLoader::urlSelected):
1613         (WebCore::FrameLoader::loadFrameRequest):
1614         (WebCore::FrameLoader::loadURL):
1615         (WebCore::FrameLoader::loadPostRequest):
1616         * loader/FrameLoader.h:
1617
1618 2015-05-30  Andreas Kling  <akling@apple.com>
1619
1620         [iOS] Tiling coverage sometimes inflated by outdated scale factor.
1621         <https://webkit.org/b/145494>
1622         <rdar://problem/20989389>
1623
1624         Reviewed by Benjamin Poulain.
1625
1626         Have GraphicsLayerCA plumb the current contents scale through to TileController::adjustCoverageRect()
1627         instead of TileController getting it from TileGrid.
1628
1629         This avoids a situation where adjustCoverageRect() could cause temporarily oversized tiling coverage
1630         if called while TileGrid's content scale is outdated, and we're neither zooming or pinching, following
1631         a pinch zoom that increased the scale factor.
1632
1633         Specifically, if all the velocity data is zero, we pad the coverage rect by a horizontal and vertical
1634         margin computed like so:
1635
1636             margin = defaultTileSize / tileGrid.scale
1637
1638         If the actual scale is 5, but the TileGrid's outdated scale is e.g 0.8, you'll get a much larger
1639         margin than you really wanted. Then the whole thing gets scaled up by 5x later on, and we explode
1640         in a fiery feast of IOSurface allocations.
1641
1642         * platform/graphics/TiledBacking.h:
1643         * platform/graphics/ca/GraphicsLayerCA.cpp:
1644         (WebCore::GraphicsLayerCA::adjustCoverageRect):
1645         * platform/graphics/ca/TileController.cpp:
1646         (WebCore::TileController::computeTileCoverageRect):
1647         * platform/graphics/ca/TileController.h:
1648
1649 2015-05-30  Brady Eidson  <beidson@apple.com>
1650
1651         Fix Windows tests broken by r185007.
1652         https://bugs.webkit.org/show_bug.cgi?id=145472
1653
1654         Unreviewed. Discussed with Alexey Proskuryakov.
1655
1656         No new tests (Fixing the four broken ones should suffice).
1657
1658         The bug was that evaluating arguments in a method/constructor call has no guaranteed sequencing.
1659         
1660         Clang seems to always do LTR, allowing the PassRefPtr to be evaluated as a bool in the call to
1661         navigationType() before it is "consumed" by the PassRefPtr argument.
1662         
1663         In Visual Studio the PassRefPtr consumption happened before the bool evaluation, meaning `false`
1664         was always passed in to navigationType(), breaking the four tests.
1665         
1666         The fix? Using PassRefPtr here was silly in the first place.
1667         No ownership is being transferred.
1668         Raw pointers it is.
1669         
1670         * loader/FrameLoader.cpp:
1671         (WebCore::FrameLoader::loadURL):
1672         (WebCore::FrameLoader::loadPostRequest):
1673         * loader/NavigationAction.cpp:
1674
1675         (WebCore::NavigationAction::NavigationAction):
1676         * loader/NavigationAction.h: Nobody is actually transferring ownership of these Events.
1677           Raw pointers will work just fine, thanks.
1678
1679 2015-05-29  Joseph Pecoraro  <pecoraro@apple.com>
1680
1681         Unreviewed bindings test rebaseline after r185023.
1682
1683         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1684         (WebCore::isObservable): Deleted.
1685         (WebCore::JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots): Deleted.
1686
1687 2015-05-29  Andreas Kling  <akling@apple.com>
1688
1689         [iOS] Reduce tiling coverage when doing a pure pinch zoom with no panning.
1690         <https://webkit.org/b/145481>
1691         <rdar://problem/20989389>
1692
1693         Reviewed by Benjamin Poulain.
1694
1695         When we're zooming in with a pinch gesture but not panning the page
1696         at the same time, make the coverage rect be the visible rect.
1697
1698         This reduces memory pressure during zooming, especially on slower
1699         devices that struggle to keep up with the current viewport.
1700
1701         * platform/graphics/ca/TileController.cpp:
1702         (WebCore::TileController::computeTileCoverageRect):
1703
1704 2015-05-29  Keith Miller  <keith_miller@apple.com>
1705
1706         WeakMap reference w/ DOM element as key does not survive long enough.
1707         https://bugs.webkit.org/show_bug.cgi?id=137651
1708
1709         Reviewed by Geoffrey Garen.
1710
1711         Remove isObservable functions as an "unobservable wrappers"
1712         optimization is invalid with WeakMaps. Performance testing
1713         will be done after the code is commited. If major
1714         performance issues occur the patch will be rolled out.
1715
1716         Test: js/dom/weakmap-gc-unobservable-dom-nodes.html
1717
1718         * bindings/js/JSNodeCustom.cpp:
1719         (WebCore::isReachableFromDOM):
1720         (WebCore::JSNodeOwner::isReachableFromOpaqueRoots):
1721         (WebCore::JSNode::insertBefore):
1722         (WebCore::isObservable): Deleted.
1723         * bindings/scripts/CodeGeneratorJS.pm:
1724         (GenerateImplementation):
1725
1726 2015-05-29  Anders Carlsson  <andersca@apple.com>
1727
1728         Get rid of WAKViewPrivate.h
1729         https://bugs.webkit.org/show_bug.cgi?id=145482
1730         rdar://problem/21162149
1731
1732         Reviewed by Dan Bernstein.
1733
1734         Merge WAKViewPrivate.h into WAKViewInternal.h and move the NSView sizing enum
1735         to WAKView.h since that was the only thing WebKit used (indirectly) from WAKViewPrivate.h.
1736
1737         * WebCore.xcodeproj/project.pbxproj:
1738         * platform/WAKViewInternal.h:
1739         (WAKViewForWKViewRef):
1740         * platform/ios/ScrollViewIOS.mm:
1741         * platform/ios/wak/WAKResponder.m:
1742         * platform/ios/wak/WAKView.h:
1743         * platform/ios/wak/WAKView.mm:
1744         * platform/ios/wak/WAKViewPrivate.h: Removed.
1745         (WAKViewForWKViewRef): Deleted.
1746         * platform/ios/wak/WAKWindow.mm:
1747         * platform/ios/wak/WKView.h:
1748         * platform/ios/wak/WKView.mm:
1749
1750 2015-05-29  Daniel Bates  <dabates@apple.com>
1751
1752         Clean up logic for updating caps lock indicator state
1753         https://bugs.webkit.org/show_bug.cgi?id=145329
1754
1755         Reviewed by Sam Weinig.
1756
1757         Remove logic to explicitly update the state of the caps lock indicator, which was used
1758         when the caps logic indicator was implemented as part of RenderTextControl. Currently,
1759         the caps logic indicator is implemented as part of a shadow DOM and we have existing
1760         logic to forward DOM focus and blur events to it so that it may update its state.
1761
1762         No change in behavior.
1763
1764         * editing/FrameSelection.cpp:
1765         (WebCore::FrameSelection::focusedOrActiveStateChanged): Deleted.
1766         * editing/FrameSelection.h:
1767         * page/EventHandler.cpp:
1768         (WebCore::EventHandler::keyEvent): Inline the code from EventHandler::capsLockStateMayHaveChanged()
1769         into this function because it is the only caller of EventHandler::capsLockStateMayHaveChanged() after
1770         we removed the call site in FrameSelection::focusedOrActiveStateChanged().
1771         (WebCore::EventHandler::capsLockStateMayHaveChanged): Deleted.
1772         * page/EventHandler.h:
1773
1774 2015-05-29  Zalan Bujtas  <zalan@apple.com>
1775
1776         Text disappears shortly after page load on Nexus 7 site.
1777         https://bugs.webkit.org/show_bug.cgi?id=145467
1778         rdar://problem/18327239
1779
1780         Reviewed by Simon Fraser.
1781
1782         This patch ensures that overlap testing for composited layers works properly when the sibling
1783         layer gets composited through its child.
1784
1785         When a layer gets composited through its child content, the recursive overlap testing should build up the
1786         overlapmap stack so that sibling content is intersected both against the child and its parent bounds.
1787
1788         Tests: compositing/sibling-layer-does-not-get-composited-overflow-hidden-case.html
1789                compositing/sibling-layer-does-not-get-composited-transform-case.html
1790
1791         * rendering/RenderLayerCompositor.cpp:
1792         (WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
1793         (WebCore::RenderLayerCompositor::OverlapMap::contains): Deleted.
1794
1795 2015-05-29  Brady Eidson  <beidson@apple.com>
1796
1797         Review feedback followup for r185003.
1798         https://bugs.webkit.org/show_bug.cgi?id=145463
1799
1800         Reviewed by Darin Adler.
1801
1802         * platform/sql/SQLiteDatabase.cpp:
1803         (WebCore::SQLiteDatabase::overrideUnauthorizedFunctions): `static const` one thing, c++-style cast another.
1804
1805 2015-05-29  Chris Dumez  <cdumez@apple.com>
1806
1807         WebContent crash in WebCore::Page::sessionID() const + 0 (Page.cpp:1660)
1808         https://bugs.webkit.org/show_bug.cgi?id=145422
1809         <rdar://problem/20613631>
1810
1811         Reviewed by Brady Eidson.
1812
1813         We sometimes crash when destroying a PageCache CachedFrame because its
1814         DocumentLoader is still loading. This should never happen as we are not
1815         supposed to let pages are still have pending loads into the PageCache.
1816
1817         However, we were using DocumentLoader::isLoadingInAPISense() as check
1818         in PageCache::canCachePageContainingThisFrame() which is not exactly
1819         what we want. isLoadingInAPISense() no longer considers subresource
1820         loads once the frame as loaded. This means if the JS triggers a new
1821         load in a subframe after it has been loaded, then isLoadingInAPISense()
1822         will return false, despite the pending load.
1823
1824         This patch replaces the isLoadingInAPISense() check with isLoading()
1825         as this will consider all pending loads, even after the frame is
1826         loaded.
1827
1828         In most cases, using isLoadingInAPISense() was not an issue because
1829         we call DocumentLoader::stopLoading() in all subframes before starting
1830         a provisional load. However, nothing seems to prevent JS from
1831         triggering a new load after that and before the new load gets committed
1832         (which is when we save the page into PageCache).
1833
1834         No new test as we don't have a reliable reproduction case and the
1835         issue is timing related.
1836
1837         * history/PageCache.cpp:
1838         (WebCore::logCanCacheFrameDecision):
1839         (WebCore::PageCache::canCachePageContainingThisFrame):
1840         * page/DiagnosticLoggingKeys.cpp:
1841         (WebCore::DiagnosticLoggingKeys::isLoading):
1842         (WebCore::DiagnosticLoggingKeys::loadingAPISenseKey): Deleted.
1843         * page/DiagnosticLoggingKeys.h:
1844
1845 2015-05-29  Chris Dumez  <cdumez@apple.com>
1846
1847         Consider throttling DOM timers in iframes outside the viewport
1848         https://bugs.webkit.org/show_bug.cgi?id=145465
1849         <rdar://problem/20768957>
1850
1851         Reviewed by Darin Adler.
1852
1853         Throttle DOM timers in iframes that are outside the viewport to decrease
1854         CPU usage, improve performance and reduce power use.
1855
1856         The approach is similar to what we already did for requestAnimationFrame
1857         in r183998.
1858
1859         We already has support for throttling DOM timers at:
1860         - Page level: for backgound pages
1861         - DOM timer level: for timers changing the style of an element outside
1862           the viewport or drawing on a canvas outside the viewport.
1863
1864         This patch adds support for throttling DOM timers at Document level so
1865         we can throttle all timers inside a specific iframe / Document. It relies
1866         on the same timerAlignmentInterval that is used for throttling at Page
1867         level with tweaks so that different Documents inside the same Page can
1868         have a different timerAlignmentInterval.
1869
1870         Test: fast/dom/timer-throttling-subframe.html
1871
1872         * dom/Document.cpp:
1873         (WebCore::Document::setTimerThrottlingEnabled):
1874         (WebCore::Document::timerAlignmentInterval):
1875         * dom/Document.h:
1876         (WebCore::Document::isTimerThrottlingEnabled):
1877         * page/DOMTimer.cpp:
1878         (WebCore::DOMTimer::alignedFireTime):
1879         The previous code was not throttling the timer if its fireTime was in
1880         the past. This was causing some aggressive timers on mashable.com to
1881         not be throttled so I got rid of this behavior. I don't see any reason
1882         why we would not throttle a timer simply because it is supposed to have
1883         fired already.
1884
1885         * page/FrameView.cpp:
1886         (WebCore::FrameView::viewportContentsChanged):
1887         (WebCore::FrameView::updateScriptedAnimationsAndTimersThrottlingState):
1888         * page/FrameView.h:
1889
1890         * testing/Internals.cpp:
1891         (WebCore::Internals::areTimersThrottled):
1892         * testing/Internals.h:
1893         * testing/Internals.idl:
1894         Add API to facilitate layout testing of this functionality.
1895
1896 2015-05-29  Brady Eidson  <beidson@apple.com>
1897
1898         NavigationAction constructor cleanup.
1899         https://bugs.webkit.org/show_bug.cgi?id=145472
1900
1901         Reviewed by Alex Christensen.
1902
1903         No new tests (Refactor, no change in behavior).
1904
1905         * loader/NavigationAction.cpp:
1906         (WebCore::NavigationAction::NavigationAction): Delegate many of the various constructors
1907           to a single full-featured constructor.
1908         * loader/NavigationAction.h:
1909
1910 2015-05-29  Matt Rajca  <mrajca@apple.com>
1911
1912         Rename MediaSession and MediaSessionClient to PlatformMediaSession and PlatformMediaSessionClient so we can use MediaSession for the formal implementation of the Media Session spec.
1913         https://bugs.webkit.org/show_bug.cgi?id=145447
1914
1915         Reviewed by Eric Carlson.
1916
1917         * Modules/webaudio/AudioContext.cpp:
1918         (WebCore::AudioContext::AudioContext):
1919         (WebCore::AudioContext::suspendPlayback):
1920         * Modules/webaudio/AudioContext.h:
1921         * WebCore.vcxproj/WebCore.vcxproj:
1922         * WebCore.vcxproj/WebCore.vcxproj.filters:
1923         * WebCore.xcodeproj/project.pbxproj:
1924         * html/HTMLAudioElement.h:
1925         * html/HTMLMediaElement.cpp:
1926         (WebCore::HTMLMediaElement::pausedForUserInteraction):
1927         (WebCore::HTMLMediaElement::mediaType):
1928         (WebCore::HTMLMediaElement::presentationType):
1929         (WebCore::HTMLMediaElement::displayType):
1930         (WebCore::HTMLMediaElement::didReceiveRemoteControlCommand):
1931         * html/HTMLMediaElement.h:
1932         * html/HTMLMediaSession.cpp:
1933         (WebCore::HTMLMediaSession::HTMLMediaSession):
1934         (WebCore::HTMLMediaSession::requiresFullscreenForVideoPlayback):
1935         * html/HTMLMediaSession.h:
1936         * html/HTMLVideoElement.h:
1937         * platform/RemoteCommandListener.h:
1938         * platform/audio/MediaSessionManager.cpp:
1939         (WebCore::MediaSessionManager::resetRestrictions):
1940         (WebCore::MediaSessionManager::has):
1941         (WebCore::MediaSessionManager::activeAudioSessionRequired):
1942         (WebCore::MediaSessionManager::count):
1943         (WebCore::MediaSessionManager::beginInterruption):
1944         (WebCore::MediaSessionManager::endInterruption):
1945         (WebCore::MediaSessionManager::addSession):
1946         (WebCore::MediaSessionManager::removeSession):
1947         (WebCore::MediaSessionManager::addRestriction):
1948         (WebCore::MediaSessionManager::removeRestriction):
1949         (WebCore::MediaSessionManager::restrictions):
1950         (WebCore::MediaSessionManager::sessionWillBeginPlayback):
1951         (WebCore::MediaSessionManager::sessionWillEndPlayback):
1952         (WebCore::MediaSessionManager::setCurrentSession):
1953         (WebCore::MediaSessionManager::currentSession):
1954         (WebCore::MediaSessionManager::sessionRestrictsInlineVideoPlayback):
1955         (WebCore::MediaSessionManager::sessionCanLoadMedia):
1956         (WebCore::MediaSessionManager::applicationWillEnterBackground):
1957         (WebCore::MediaSessionManager::applicationWillEnterForeground):
1958         (WebCore::MediaSessionManager::didReceiveRemoteControlCommand):
1959         (WebCore::MediaSessionManager::systemWillSleep):
1960         (WebCore::MediaSessionManager::systemDidWake):
1961         * platform/audio/MediaSessionManager.h:
1962         (WebCore::MediaSessionManager::sessions):
1963         * platform/audio/PlatformMediaSession.cpp: Renamed from Source/WebCore/platform/audio/MediaSession.cpp.
1964         (WebCore::stateName):
1965         (WebCore::PlatformMediaSession::create):
1966         (WebCore::PlatformMediaSession::PlatformMediaSession):
1967         (WebCore::PlatformMediaSession::~PlatformMediaSession):
1968         (WebCore::PlatformMediaSession::setState):
1969         (WebCore::PlatformMediaSession::beginInterruption):
1970         (WebCore::PlatformMediaSession::endInterruption):
1971         (WebCore::PlatformMediaSession::clientWillBeginPlayback):
1972         (WebCore::PlatformMediaSession::clientWillPausePlayback):
1973         (WebCore::PlatformMediaSession::pauseSession):
1974         (WebCore::PlatformMediaSession::mediaType):
1975         (WebCore::PlatformMediaSession::presentationType):
1976         (WebCore::PlatformMediaSession::title):
1977         (WebCore::PlatformMediaSession::duration):
1978         (WebCore::PlatformMediaSession::currentTime):
1979         (WebCore::PlatformMediaSession::canReceiveRemoteControlCommands):
1980         (WebCore::PlatformMediaSession::didReceiveRemoteControlCommand):
1981         (WebCore::PlatformMediaSession::visibilityChanged):
1982         (WebCore::PlatformMediaSession::clientDataBufferingTimerFired):
1983         (WebCore::PlatformMediaSession::updateClientDataBuffering):
1984         (WebCore::PlatformMediaSession::isHidden):
1985         (WebCore::PlatformMediaSession::displayType):
1986         (WebCore::PlatformMediaSessionClient::mediaSessionTitle):
1987         (WebCore::PlatformMediaSessionClient::mediaSessionDuration):
1988         (WebCore::PlatformMediaSessionClient::mediaSessionCurrentTime):
1989         * platform/audio/PlatformMediaSession.h: Renamed from Source/WebCore/platform/audio/MediaSession.h.
1990         (WebCore::PlatformMediaSession::state):
1991         (WebCore::PlatformMediaSession::canPlayToWirelessPlaybackTarget):
1992         (WebCore::PlatformMediaSession::isPlayingToWirelessPlaybackTarget):
1993         (WebCore::PlatformMediaSession::requiresPlaybackTargetRouteMonitoring):
1994         (WebCore::PlatformMediaSession::client):
1995         (WebCore::PlatformMediaSessionClient::PlatformMediaSessionClient):
1996         (WebCore::PlatformMediaSessionClient::displayType):
1997         (WebCore::PlatformMediaSessionClient::setShouldBufferData):
1998         (WebCore::PlatformMediaSessionClient::elementIsHidden):
1999         (WebCore::PlatformMediaSessionClient::wirelessRoutesAvailableDidChange):
2000         (WebCore::PlatformMediaSessionClient::setWirelessPlaybackTarget):
2001         (WebCore::PlatformMediaSessionClient::canPlayToWirelessPlaybackTarget):
2002         (WebCore::PlatformMediaSessionClient::isPlayingToWirelessPlaybackTarget):
2003         (WebCore::PlatformMediaSessionClient::setShouldPlayToPlaybackTarget):
2004         (WebCore::PlatformMediaSessionClient::~PlatformMediaSessionClient):
2005         * platform/audio/ios/MediaSessionManagerIOS.h:
2006         * platform/audio/ios/MediaSessionManagerIOS.mm:
2007         (WebCore::MediaSessionManageriOS::resetRestrictions):
2008         (WebCore::MediaSessionManageriOS::sessionWillBeginPlayback):
2009         (WebCore::MediaSessionManageriOS::sessionWillEndPlayback):
2010         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo):
2011         (WebCore::MediaSessionManageriOS::sessionCanLoadMedia):
2012         (-[WebMediaSessionHelper interruption:]):
2013         * platform/audio/mac/MediaSessionManagerMac.cpp:
2014         (MediaSessionManager::updateSessionState):
2015         * platform/graphics/MediaPlayer.cpp:
2016         (WebCore::MediaPlayer::handlePlaybackCommand):
2017         * platform/graphics/MediaPlayer.h:
2018         (WebCore::MediaPlayerClient::mediaPlayerHandlePlaybackCommand):
2019         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
2020         (WebCore::MediaPlayerPrivateAVFoundation::rateChanged):
2021         * platform/ios/RemoteCommandListenerIOS.mm:
2022         (WebCore::RemoteCommandListenerIOS::RemoteCommandListenerIOS):
2023         * testing/Internals.cpp:
2024         (WebCore::Internals::beginMediaSessionInterruption):
2025         (WebCore::Internals::endMediaSessionInterruption):
2026         (WebCore::Internals::setMediaSessionRestrictions):
2027         (WebCore::Internals::postRemoteControlCommand):
2028
2029 2015-05-29  Alex Christensen  <achristensen@webkit.org>
2030
2031         [Content Extensions] Decrease maxNFASize
2032         https://bugs.webkit.org/show_bug.cgi?id=145461
2033
2034         Reviewed by Gavin Barraclough.
2035
2036         * contentextensions/ContentExtensionCompiler.cpp:
2037         (WebCore::ContentExtensions::compileRuleList):
2038         Decrease maxNFASize based on analysis of memory usage and compiling and interpreting time.
2039
2040 2015-05-29  Brady Eidson  <beidson@apple.com>
2041
2042         WebSQL default functions can bypass authorizer.
2043         <rdar://problem/21048994> and https://bugs.webkit.org/show_bug.cgi?id=145463
2044
2045         Reviewed by Sam Weinig and Alexey Proskuryakov.
2046
2047         No new tests yet.
2048
2049         * platform/sql/SQLiteDatabase.cpp:
2050         (WebCore::unauthorizedSQLFunction): Function to install into SQLite to override some built-in functions.
2051         (WebCore::SQLiteDatabase::open):
2052         (WebCore::SQLiteDatabase::overrideUnauthorizedFunctions): Install function overrides for functions that
2053            take arbitrary input that are also meant to be disabled by virtue of them not being whitelisted.
2054         * platform/sql/SQLiteDatabase.h:
2055
2056 2015-05-29  Roger Fong  <roger_fong@apple.com>
2057
2058         Unreviewed. Shift fullscreen controls down 20px.
2059         <rdar://problem/21161523>
2060
2061         * Modules/mediacontrols/mediaControlsApple.css:
2062         (video:-webkit-full-screen::-webkit-media-controls-panel):
2063         Fullscreen control panel is too high and overlaps with caption menu.
2064         Shift it down 20px.
2065
2066 2015-05-28  Simon Fraser  <simon.fraser@apple.com>
2067
2068         Some assertion failures in compositing code after r183820
2069         https://bugs.webkit.org/show_bug.cgi?id=144630
2070
2071         Reviewed by Alexey Proskuryakov.
2072
2073         Reinstate the assertion commented out in r183843. Fixed by having blending no longer
2074         escape the media elements, which was fixed via bug 145420.
2075
2076         * rendering/RenderLayerCompositor.cpp:
2077         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2078
2079 2015-05-29  Hunseop Jeong  <hs85.jeong@samsung.com>
2080
2081         Use modern for-loops in WebCore/plugins, storage, style, testing and workers.
2082         https://bugs.webkit.org/show_bug.cgi?id=145425
2083
2084         Reviewed by Darin Adler.
2085
2086         No new tests, no behavior changes.
2087
2088         * plugins/DOMMimeTypeArray.cpp:
2089         (WebCore::DOMMimeTypeArray::canGetItemsForName):
2090         * plugins/DOMPlugin.cpp:
2091         (WebCore::DOMPlugin::canGetItemsForName):
2092         * plugins/DOMPluginArray.cpp:
2093         (WebCore::DOMPluginArray::canGetItemsForName):
2094         * plugins/PluginData.cpp:
2095         (WebCore::PluginData::getWebVisibleMimesAndPluginIndices):
2096         * plugins/PluginMainThreadScheduler.cpp:
2097         (WebCore::PluginMainThreadScheduler::dispatchCallsForPlugin):
2098         (WebCore::PluginMainThreadScheduler::dispatchCalls):
2099         * storage/StorageEventDispatcher.cpp:
2100         (WebCore::StorageEventDispatcher::dispatchLocalStorageEvents):
2101         (WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames):
2102         (WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames):
2103         * storage/StorageMap.cpp:
2104         (WebCore::StorageMap::importItems):
2105         * style/StyleResolveTree.cpp:
2106         (WebCore::Style::pseudoStyleCacheIsInvalid):
2107         * testing/Internals.cpp:
2108         (WebCore::Internals::nodesFromRect):
2109         * workers/Worker.cpp:
2110         (WebCore::networkStateChanged):
2111         * workers/WorkerGlobalScope.cpp:
2112         (WebCore::WorkerGlobalScope::importScripts):
2113
2114 2015-05-29  Alex Christensen  <achristensen@webkit.org>
2115
2116         Unreviewed build fix when using content extensions debugging.
2117
2118         * contentextensions/ContentExtensionCompiler.cpp:
2119         (WebCore::ContentExtensions::compileRuleList):
2120         Update variable name.
2121
2122 2015-05-29  Brady Eidson  <beidson@apple.com>
2123
2124         Typo followup to r184987
2125
2126         Unreviewed.
2127
2128         * loader/FrameLoader.cpp:
2129         (WebCore::FrameLoader::loadURLIntoChildFrame): Misplaced brace.
2130
2131 2015-05-29  Brady Eidson  <beidson@apple.com>
2132
2133         Small FrameLoader refactoring.
2134         https://bugs.webkit.org/show_bug.cgi?id=145459
2135
2136         Reviewed by Alex Christensen.
2137
2138         No new tests (No behavior change).
2139
2140         * loader/FrameLoader.cpp:
2141         (WebCore::FrameLoader::loadURLIntoChildFrame):
2142         (WebCore::FrameLoader::loadFrameRequest):
2143         (WebCore::FrameLoader::loadURL):
2144         (WebCore::FrameLoader::loadPostRequest):
2145         * loader/FrameLoader.h:
2146
2147 2015-05-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2148
2149         MediaDevices.getUserMedia should reject promise instead of throwing exceptions
2150         https://bugs.webkit.org/show_bug.cgi?id=145282
2151
2152         Reviewed by Darin Adler.
2153
2154         Ensuring at the custom binding level that all potential errors are used to reject promise.
2155         Cleaned up the wrappers by removing unneeded RefPtr.
2156
2157         Covered by modified test.
2158
2159         * Modules/mediastream/MediaDevices.cpp:
2160         (WebCore::MediaDevices::getUserMedia):
2161         * Modules/mediastream/MediaDevices.h:
2162         * Modules/mediastream/UserMediaRequest.cpp:
2163         (WebCore::UserMediaRequest::create):
2164         * bindings/js/JSMediaDevicesCustom.cpp:
2165         (WebCore::JSMediaDevices::getUserMedia):
2166
2167 2015-05-28  Hunseop Jeong  <hs85.jeong@samsung.com>
2168
2169         Replaced 0 with nullptr in WebCore/accessibility.
2170         https://bugs.webkit.org/show_bug.cgi?id=145309
2171
2172         Reviewed by Chris Fleizach.
2173
2174         No new tests, no behavior change.
2175
2176         * accessibility/AccessibilityRenderObject.cpp:
2177         (WebCore::AccessibilityRenderObject::mathPrescripts):
2178         (WebCore::AccessibilityRenderObject::mathPostscripts):
2179         * accessibility/AccessibilityScrollView.cpp:
2180         (WebCore::AccessibilityScrollView::scrollBar):
2181         * accessibility/atk/AXObjectCacheAtk.cpp:
2182         (WebCore::notifyChildrenSelectionChange):
2183         * accessibility/atk/WebKitAccessibleHyperlink.cpp:
2184         (webkitAccessibleHyperlinkInit):
2185         * accessibility/atk/WebKitAccessibleInterfaceDocument.cpp:
2186         (webkitAccessibleDocumentGetAttributes):
2187         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
2188         (getAttributeSetForAccessibilityObject):
2189         (attributeSetDifference):
2190         * accessibility/atk/WebKitAccessibleUtil.h:
2191         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2192         (webkitAccessibleRefChild):
2193         (webkitAccessibleGetAttributes):
2194         (webkitAccessibleGetObjectLocale):
2195         (getInterfaceMaskFromObject):
2196         (objectFocusedAndCaretOffsetUnignored):
2197         (cacheAndReturnAtkProperty):
2198
2199 2015-05-28  Zalan Bujtas  <zalan@apple.com>
2200
2201         Subpixel rendering: Pixel crack in text selection of simple text in <textarea>.
2202         https://bugs.webkit.org/show_bug.cgi?id=145393
2203         rdar://problem/19918941
2204
2205         Reviewed by Darin Adler.
2206
2207         Float to LayoutUnit conversion is lossy. To ensure that selection
2208         painting always lines up (snaps) properly, the calculated width needs to
2209         be adjusted by ceiling the float to the next LayoutUnit value.
2210
2211         Test: fast/text/hidpi-text-selection-gap-between-words.html
2212
2213         * platform/graphics/FontCascade.cpp:
2214         (WebCore::FontCascade::adjustSelectionRectForSimpleText):
2215         * platform/graphics/cocoa/FontCascadeCocoa.mm:
2216         (WebCore::FontCascade::adjustSelectionRectForComplexText):
2217
2218 2015-05-28  Andreas Kling  <akling@apple.com>
2219
2220         GraphicsLayerCA should start out with m_intersectsCoverageRect=false
2221         <https://webkit.org/b/145443>
2222         <rdar://problem/19685798>
2223
2224         Reviewed by Simon Fraser.
2225
2226         Since the coverage rect of a newly-constructed GraphicsLayerCA is always empty,
2227         there's no way that the layer's own bounding box can intersect with it.
2228         Hence the m_intersectsCoverageRect flag should be false after construction.
2229
2230         This fixes an issue where compositing layers in subframes would be marked as
2231         non-volatile, despite being far outside the viewport and coverage rect.
2232
2233         Test: compositing/visible-rect/iframe-with-layers-outside-viewport.html
2234
2235         * platform/graphics/ca/GraphicsLayerCA.cpp:
2236         (WebCore::GraphicsLayerCA::GraphicsLayerCA):
2237
2238 2015-05-28  Commit Queue  <commit-queue@webkit.org>
2239
2240         Unreviewed, rolling out r184796 and r184832.
2241         https://bugs.webkit.org/show_bug.cgi?id=145449
2242
2243         2% performance regression (Requested by litherum on #webkit).
2244
2245         Reverted changesets:
2246
2247         "[Cocoa] Use CTFontDrawGlyphs() instead of
2248         CGContextShowGlyphsWithAdvances()/CGContextShowGlyphsAtPositions()"
2249         https://bugs.webkit.org/show_bug.cgi?id=145234
2250         http://trac.webkit.org/changeset/184796
2251
2252         "Cleanup after r184796"
2253         https://bugs.webkit.org/show_bug.cgi?id=145333
2254         http://trac.webkit.org/changeset/184832
2255
2256 2015-05-28  Matt Rajca  <mrajca@apple.com>
2257
2258         Rename HTMLMediaSession to MediaElementSession to reserve "media session" for the Media Session API.
2259         https://bugs.webkit.org/show_bug.cgi?id=145440
2260
2261         Reviewed by Eric Carlson.
2262
2263         * CMakeLists.txt:
2264         * WebCore.vcxproj/WebCore.vcxproj:
2265         * WebCore.vcxproj/WebCore.vcxproj.filters:
2266         * WebCore.xcodeproj/project.pbxproj:
2267         * html/HTMLMediaElement.cpp:
2268         (WebCore::HTMLMediaElement::HTMLMediaElement):
2269         (WebCore::HTMLMediaElement::loadInternal):
2270         (WebCore::HTMLMediaElement::loadResource):
2271         (WebCore::HTMLMediaElement::suspend):
2272         (WebCore::HTMLMediaElement::resume):
2273         (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture):
2274         (WebCore::HTMLMediaElement::mediaState):
2275         * html/HTMLMediaElement.h:
2276         (WebCore::HTMLMediaElement::mediaSession):
2277         * html/MediaElementSession.cpp: Renamed from Source/WebCore/html/HTMLMediaSession.cpp.
2278         (WebCore::restrictionName):
2279         (WebCore::MediaElementSession::MediaElementSession):
2280         (WebCore::MediaElementSession::registerWithDocument):
2281         (WebCore::MediaElementSession::unregisterWithDocument):
2282         (WebCore::MediaElementSession::addBehaviorRestriction):
2283         (WebCore::MediaElementSession::removeBehaviorRestriction):
2284         (WebCore::MediaElementSession::playbackPermitted):
2285         (WebCore::MediaElementSession::dataLoadingPermitted):
2286         (WebCore::MediaElementSession::fullscreenPermitted):
2287         (WebCore::MediaElementSession::pageAllowsDataLoading):
2288         (WebCore::MediaElementSession::pageAllowsPlaybackAfterResuming):
2289         (WebCore::MediaElementSession::showPlaybackTargetPicker):
2290         (WebCore::MediaElementSession::hasWirelessPlaybackTargets):
2291         (WebCore::MediaElementSession::wirelessVideoPlaybackDisabled):
2292         (WebCore::MediaElementSession::setWirelessVideoPlaybackDisabled):
2293         (WebCore::MediaElementSession::setHasPlaybackTargetAvailabilityListeners):
2294         (WebCore::MediaElementSession::setPlaybackTarget):
2295         (WebCore::MediaElementSession::targetAvailabilityChangedTimerFired):
2296         (WebCore::MediaElementSession::externalOutputDeviceAvailableDidChange):
2297         (WebCore::MediaElementSession::canPlayToWirelessPlaybackTarget):
2298         (WebCore::MediaElementSession::isPlayingToWirelessPlaybackTarget):
2299         (WebCore::MediaElementSession::setShouldPlayToPlaybackTarget):
2300         (WebCore::MediaElementSession::mediaStateDidChange):
2301         (WebCore::MediaElementSession::effectivePreloadForElement):
2302         (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
2303         (WebCore::MediaElementSession::mediaEngineUpdated):
2304         (WebCore::MediaElementSession::allowsAlternateFullscreen):
2305         (WebCore::MediaElementSession::maximumMediaSourceBufferSize):
2306         * html/MediaElementSession.h: Renamed from Source/WebCore/html/HTMLMediaSession.h.
2307         * testing/Internals.cpp:
2308         (WebCore::Internals::setMediaElementRestrictions):
2309         (WebCore::Internals::setAudioContextRestrictions):
2310
2311 2015-05-28  Myles C. Maxfield  <mmaxfield@apple.com>
2312
2313         Crash under ICU with ASAN during editing/selection/move-by-word-visually-crash-test-5.html
2314         https://bugs.webkit.org/show_bug.cgi?id=145429
2315         <rdar://problem/20992218>
2316
2317         Reviewed by Alexey Proskuryakov.
2318
2319         WebKit uses some strings which contain the lower 8-bits of UTF-16 (thereby saving space). However,
2320         ICU doesn't understand this encoding. When we want to use ICU functions with strings in this encoding,
2321         we create a UTextProvider which converts our encoded strings to UTF-16 for ICU, one chunk at a time.
2322         This object contains a vtable which we populate to perform the conversion.
2323
2324         The WebKit function which actually returns the UTF-16 chunks has two relevant arguments: an index into
2325         the encoded string which ICU is requesting, and a direction from that index which ICU is interested
2326         in. This function populates a "chunk" which is characterized by a pointer to a buffer, the length of
2327         the populated data in the buffer, and an offset into the chunk which represents the index that the
2328         requested character was put into.
2329
2330         When ICU requests data going backward, we fill in the chunk accordingly, with the requested character
2331         all the way at the end. We then set the offset equal to the length of the buffer. However, this length
2332         value is stale from the previous time the function ran. Therefore, ICU was reading the wrong index in
2333         the chunk when expecting the requested character.
2334
2335         Covered by editing/selection/move-by-word-visually-crash-test-5.html.
2336
2337         * platform/text/icu/UTextProviderLatin1.cpp:
2338         (WebCore::uTextLatin1Access):
2339
2340 2015-05-28  Eric Carlson  <eric.carlson@apple.com>
2341
2342         [iOS] Fix controls bug caused by r184794
2343         https://bugs.webkit.org/show_bug.cgi?id=145445
2344
2345         Reviewed by Dean Jackson.
2346
2347         * Modules/mediacontrols/mediaControlsiOS.js:
2348         (ControllerIOS.prototype.showControls): Check video.controls instead of trying to call
2349         showInlinePlaybackPlaceholderOnly, which doesn't exist.
2350
2351 2015-05-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
2352
2353         Code clean up for extracting information from the mix of WritingMode and TextDirection
2354         https://bugs.webkit.org/show_bug.cgi?id=143399
2355
2356         Reviewed by Darin Adler.
2357         
2358         There should be eight TextFlows. A TextFlow consists of two directions.
2359         The first one controls the inline growing direction and the second one
2360         controls the block growing direction. We are going to use the cardinal
2361         directions to define these combinations.
2362
2363         We need to extract the following information easily from the TextFlow
2364
2365         -- isTextFlowReversed() // RTL
2366         -- isTextFlowFlipped()  // the opposite direction to normal
2367         -- isTextFlowVertical() // The line grows vertically
2368         
2369         Mixing WritingMode and TextDirection into TextFlow and choosing their values
2370         carefully to ease implementing the above functions can make things clearer.
2371
2372         * Modules/notifications/Notification.h:
2373         * platform/graphics/TextRun.h:
2374         * platform/ios/SelectionRect.h:
2375         * platform/text/BidiResolver.h:
2376         * platform/text/StringWithDirection.h:
2377         * platform/text/TextFlags.h:
2378         (WebCore::isLeftToRightDirection): Deleted.
2379         enum TextDirection is moved from TextFlags.h to WritingMode.h. So include
2380         WritingMode.h instead of including TextFlags.h.
2381         
2382         * css/CSSProperty.cpp:
2383         (WebCore::resolveToPhysicalProperty): Instead of handling the eight possible
2384         cases of the text flows one by one, we can map from a LogicalSide to a
2385         PhysicalSide using the TextFlow value.
2386         
2387         * platform/LengthBox.h:
2388         (WebCore::BoxExtent::before):
2389         (WebCore::BoxExtent::after):
2390         (WebCore::BoxExtent::start):
2391         (WebCore::BoxExtent::end):
2392         Use mapLogicalSideToPhysicalSide() to convert from a LogicalSide to a PhysicalSide.
2393         
2394         * platform/text/WritingMode.h:
2395         (WebCore::isLeftToRightDirection): Usually the default enum is defined
2396         first. And usually the default value is equal to zero. Since LTR is the
2397         default for the text direction, it should be defined before RTL.
2398         
2399         (WebCore::makeTextFlow): Returns a TextFlow given a WritingMode and a
2400         TextDirection.
2401         
2402         (WebCore::isReversedTextFlow): Returns true if the text direction is RTL.
2403         
2404         (WebCore::isFlippedTextFlow):
2405         (WebCore::isFlippedWritingMode): Returns true if the block growing direction
2406         is in the opposite direction of normal.
2407         
2408         (WebCore::isVerticalTextFlow):
2409         (WebCore::isVerticalWritingMode): Returns true if the line grows vertically.
2410                
2411         (WebCore::isHorizontalWritingMode):
2412         (WebCore::isFlippedLinesWritingMode): Use isVerticalWritingMode() and 
2413         isFlippedWritingMode() to answer these questions.
2414         
2415         (WebCore::isHorizontalPhysicalSide): 
2416         (WebCore::mirrorPhysicalSide): top <-> bottom and left <-> right conversion.
2417         (WebCore::rotatePhysicalSide): top <-> left and right <-> bottom conversion.
2418         
2419         (WebCore::mapLogicalSideToPhysicalSide): Maps a LogicalSide to a PhysicalSide
2420         using either the TextFlow or the WritingMode.
2421         
2422         (WebCore::isFlippedBlocksWritingMode): Deleted.
2423         * rendering/RenderMultiColumnSet.cpp:
2424         (WebCore::RenderMultiColumnSet::collectLayerFragments):
2425         (WebCore::RenderMultiColumnSet::columnTranslationForOffset):
2426         * rendering/shapes/Shape.cpp:
2427         (WebCore::physicalRectToLogical):
2428         (WebCore::physicalPointToLogical):
2429         * rendering/style/RenderStyle.h:
2430         Rename isFlippedBlocksWritingMode() to be isFlippedWritingMode() so we can
2431         be consistent with other WritingMode query functions.
2432
2433 2015-05-28  Matt Rajca  <mrajca@apple.com>
2434
2435         Add ENABLE_MEDIA_SESSION feature flag (which is off by default).
2436         https://bugs.webkit.org/show_bug.cgi?id=145415
2437
2438         Reviewed by Eric Carlson.
2439
2440         * Configurations/FeatureDefines.xcconfig:
2441
2442 2015-05-28  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
2443
2444         [Streams API] ReadableStreamReader should not be exposed
2445         https://bugs.webkit.org/show_bug.cgi?id=143564
2446
2447         Reviewed by Darin Adler.
2448
2449         Covered by rebased tests.
2450
2451         * Modules/streams/ReadableStreamReader.idl: Adding NoInterfaceObject to ReadableStreamReader.idl.
2452
2453 2015-05-28  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2454
2455         [CMake] Improve detection and usage of GL/GLES/EGL libraries.
2456         https://bugs.webkit.org/show_bug.cgi?id=145408
2457
2458         Reviewed by Carlos Garcia Campos.
2459
2460         No new tests, no behavior changes.
2461
2462         * CMakeLists.txt: Ensure that we include the libraries and includes
2463         for the GL/GLESv2/EGL libraries before including the ANGLE directories.
2464         Define also any CFLAG that the system GL/GLESv2/EGL libraries may need.
2465         * PlatformEfl.cmake: Remove some includes that are now unneeded,
2466         because we are including now the EGL libraries on CMakeLists.txt
2467         * PlatformGTK.cmake: Remove unneeded include (We are including the EGL
2468         libraries now on CMakeLists.txt)
2469
2470 2015-05-28  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2471
2472         Binding generator should support interfaces with CustomConstructor and NoInterfaceObject
2473         https://bugs.webkit.org/show_bug.cgi?id=145016
2474
2475         Reviewed by Darin Adler.
2476
2477         Updated code generator to generate the necessary declarations (constructor property in the prototype, the constructor class).
2478         In the case of CustomConstructor with NoInterfaceObject, the implementation of the constructor property related JS function is changed as follow:
2479         It creates a constructor object and shadows the constructor property JS function with this object.
2480         This ensures that only one constructor object is created per prototype.
2481         The constructor is not exposed as it is not added to the global object constructor map.
2482
2483         NoInterfaceObject is asking to not make the interface visible, which is contradictory with having a visible constructor of the interface.
2484         The case for having NoInterfaceObject and CustomConstructor is the following:
2485         We do not want to expose the interface but we still want to have a constructor property on the prototype of objects implementing the interface.
2486         One such case is https://streams.spec.whatwg.org/#globals
2487
2488         Added TestCustomConstructorWithNoInterfaceObject.idl to check that case.
2489
2490         * bindings/scripts/CodeGeneratorJS.pm:
2491         (GenerateHeader):
2492         (GenerateAttributesHashTable):
2493         (GenerateImplementation):
2494         (HasConstructorProperty):
2495         * bindings/scripts/test/GObject/WebKitDOMTestCustomConstructorWithNoInterfaceObject.cpp: Added.
2496         (WebKit::kit):
2497         (WebKit::core):
2498         (WebKit::wrapTestCustomConstructorWithNoInterfaceObject):
2499         (webkit_dom_test_custom_constructor_with_no_interface_object_finalize):
2500         (webkit_dom_test_custom_constructor_with_no_interface_object_constructor):
2501         (webkit_dom_test_custom_constructor_with_no_interface_object_class_init):
2502         (webkit_dom_test_custom_constructor_with_no_interface_object_init):
2503         * bindings/scripts/test/GObject/WebKitDOMTestCustomConstructorWithNoInterfaceObject.h: Added.
2504         * bindings/scripts/test/GObject/WebKitDOMTestCustomConstructorWithNoInterfaceObjectPrivate.h: Added.
2505         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: Added.
2506         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::create):
2507         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::createStructure):
2508         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::JSTestCustomConstructorWithNoInterfaceObjectPrototype):
2509         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::create):
2510         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::createStructure):
2511         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::JSTestCustomConstructorWithNoInterfaceObjectConstructor):
2512         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::finishCreation):
2513         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::getConstructData):
2514         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::finishCreation):
2515         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::JSTestCustomConstructorWithNoInterfaceObject):
2516         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::createPrototype):
2517         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::getPrototype):
2518         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::destroy):
2519         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::~JSTestCustomConstructorWithNoInterfaceObject):
2520         (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
2521         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::getConstructor):
2522         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectOwner::isReachableFromOpaqueRoots):
2523         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectOwner::finalize):
2524         (WebCore::toJS):
2525         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::toWrapped):
2526         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h: Added.
2527         (WebCore::wrapperOwner):
2528         (WebCore::toJS):
2529         * bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObject.h: Added.
2530         * bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObject.mm: Added.
2531         (-[DOMTestCustomConstructorWithNoInterfaceObject dealloc]):
2532         (-[DOMTestCustomConstructorWithNoInterfaceObject finalize]):
2533         (core):
2534         (kit):
2535         * bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObjectInternal.h: Added.
2536         * bindings/scripts/test/TestCustomConstructor.idl: Added.
2537
2538 2015-05-19  Jon Honeycutt  <jhoneycutt@apple.com>
2539
2540         [iOS] When viewing an MJPEG stream as the main resource, only the first
2541         frame paints
2542
2543         <https://bugs.webkit.org/show_bug.cgi?id=145185>
2544         <rdar://problem/20124694>
2545
2546         This bug is caused by state not being restored between successive loads
2547         of multipart/x-mixed-replace content. Each part of the stream is not
2548         treated as a wholly new load, so if state is cleared as part of the
2549         previous page being destroyed, it may not be restored when loading
2550         the next stream part.
2551
2552         On WK1, tile cache updates are disabled in FrameView::clear(), which is
2553         called as the previous page is destroyed, but were not being
2554         reenabled when loading new replacement content from the stream.
2555
2556         On WK2, the exposed content rect was being reset to an empty rect as
2557         the previous page was destroyed, but it was not being reset by loading
2558         replacement content.
2559
2560         To fix these issues, I added two WebFrameLoaderClient callbacks;
2561         willReplaceMultipartContent() and didReplaceMultipartContent(). These
2562         are used to save and restore state between successive loads.
2563
2564         Reviewed by Darin Adler.
2565
2566         * loader/DocumentLoader.cpp:
2567         Call the new client callbacks.
2568         (WebCore::DocumentLoader::commitLoad):
2569         If replacing content in a multipart/x-mixed-replace stream, call the
2570         WebFrameLoaderClient's didReplaceMultipartContent().
2571
2572         (WebCore::DocumentLoader::setupForReplace):
2573         Call the WebFrameLoaderClient's willReplaceMultipartContent().
2574
2575         * loader/EmptyClients.h:
2576
2577         * loader/FrameLoaderClient.h:
2578
2579         * page/FrameView.cpp:
2580         (WebCore::FrameView::didReplaceMultipartContent):
2581         Re-enable tile cache updates that were disabled in FrameView::clear().
2582         This fixes the issue for WK1.
2583
2584         * page/FrameView.h:
2585         Declare an exported function, didReplaceMultipartContent(), that WebKit
2586         can call.
2587
2588 2015-05-27  Brady Eidson  <beidson@apple.com>
2589
2590         Remove unused ResourceRequest "user initiated" flag.
2591         https://bugs.webkit.org/show_bug.cgi?id=145428
2592
2593         Reviewed by Alexey Proskuryakov.
2594
2595         No new tests (No change in behavior).
2596
2597         * platform/ios/WebCoreSystemInterfaceIOS.mm:
2598         * platform/mac/WebCoreSystemInterface.mm:
2599
2600         * platform/network/ResourceRequestBase.h:
2601         (WebCore::ResourceRequestBase::initiatedByUserGesture): Deleted.
2602         (WebCore::ResourceRequestBase::setInitiatedByUserGesture): Deleted.
2603         (WebCore::ResourceRequestBase::encodeWithoutPlatformData): Deleted.
2604         (WebCore::ResourceRequestBase::decodeWithoutPlatformData): Deleted.
2605
2606         * platform/network/cf/ResourceRequestCFNet.cpp:
2607         (WebCore::ResourceRequest::doUpdatePlatformRequest): Deleted.
2608         (WebCore::ResourceRequest::doUpdateResourceRequest): Deleted.
2609
2610         * platform/network/cocoa/ResourceRequestCocoa.mm:
2611         (WebCore::ResourceRequest::doUpdateResourceRequest): Deleted.
2612         (WebCore::ResourceRequest::doUpdatePlatformRequest): Deleted.
2613
2614 2015-05-27  Brady Eidson  <beidson@apple.com>
2615
2616         Add a "should open urls externally" flag to DocumentLoader.
2617         rdar://problem/21025301 and https://bugs.webkit.org/show_bug.cgi?id=145417
2618
2619         Reviewed by Geoff Garen.
2620
2621         No new tests (No change in behavior, testable at API level with a followup patch)
2622
2623         * loader/DocumentLoader.cpp:
2624         (WebCore::DocumentLoader::setTriggeringAction): Apply the current flag value to the 
2625           new NavigationAction so it can be used later.
2626         * loader/DocumentLoader.h:
2627         (WebCore::DocumentLoader::setShouldOpenExternalURLsPolicy):
2628         (WebCore::DocumentLoader::shouldOpenExternalURLsPolicy):
2629         (WebCore::DocumentLoader::setTriggeringAction): Deleted.
2630
2631         FrameLoadRequest should hold the new flag to pass into FrameLoader machinery:
2632         * loader/FrameLoadRequest.h:
2633         (WebCore::FrameLoadRequest::setShouldOpenExternalURLsPolicy):
2634         (WebCore::FrameLoadRequest::shouldOpenExternalURLsPolicy):
2635
2636         * loader/FrameLoader.cpp:
2637         (WebCore::FrameLoader::load): Set the flag on the newly created DocumentLoader but
2638           only if it is for the main frame.
2639
2640         * loader/FrameLoaderTypes.h: Add a new enum for the flag.
2641
2642         Navigation action should hold the new flag to pass to the policy delegate:
2643         * loader/NavigationAction.cpp:
2644         (WebCore::NavigationAction::NavigationAction):
2645         * loader/NavigationAction.h:
2646         (WebCore::NavigationAction::shouldOpenExternalURLsPolicy):
2647         (WebCore::NavigationAction::setShouldOpenExternalURLsPolicy):
2648
2649         * loader/PolicyChecker.cpp:
2650         (WebCore::PolicyChecker::checkNavigationPolicy): Include the flag from the DocumentLoader
2651           in the NavigationAction.
2652
2653 2015-05-27  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2654
2655         Purge PassRefPtr in WebCore/Modules - 2
2656         https://bugs.webkit.org/show_bug.cgi?id=145304
2657
2658         Reviewed by Darin Adler.
2659
2660         As a step to remove PassRefPtr, this patch replaces PassRefPtr with Ref or RefPtr.
2661
2662         No new tests, no behavior changes
2663
2664         * Modules/mediasource/SourceBufferList.h:
2665         * Modules/mediastream/AllAudioCapabilities.h:
2666         (WebCore::AllAudioCapabilities::create):
2667         * Modules/mediastream/AllVideoCapabilities.h:
2668         (WebCore::AllVideoCapabilities::create):
2669         * Modules/mediastream/CapabilityRange.cpp:
2670         (WebCore::CapabilityRange::create):
2671         * Modules/mediastream/CapabilityRange.h:
2672         * Modules/mediastream/MediaSourceStates.cpp:
2673         (WebCore::MediaSourceStates::create):
2674         * Modules/mediastream/MediaStream.cpp:
2675         (WebCore::MediaStream::create):
2676         * Modules/mediastream/MediaStreamTrack.cpp:
2677         (WebCore::MediaStreamTrack::create):
2678         * Modules/mediastream/MediaStreamTrackSourcesRequest.cpp:
2679         (WebCore::MediaStreamTrackSourcesRequest::create):
2680         * Modules/mediastream/MediaTrackConstraint.cpp:
2681         (WebCore::MediaTrackConstraint::create):
2682         * Modules/mediastream/MediaTrackConstraint.h:
2683         * Modules/mediastream/RTCConfiguration.h:
2684         (WebCore::RTCConfiguration::create):
2685         * Modules/mediastream/RTCIceServer.h:
2686         (WebCore::RTCIceServer::create):
2687         * Modules/mediastream/RTCSessionDescription.cpp:
2688         (WebCore::RTCSessionDescription::create):
2689         * Modules/mediastream/RTCSessionDescription.h:
2690         * Modules/mediastream/RTCSessionDescriptionRequestImpl.cpp:
2691         (WebCore::RTCSessionDescriptionRequestImpl::create):
2692         * Modules/mediastream/RTCStatsReport.cpp:
2693         (WebCore::RTCStatsReport::create):
2694         * Modules/mediastream/RTCStatsReport.h:
2695         * Modules/mediastream/RTCStatsRequestImpl.cpp:
2696         (WebCore::RTCStatsRequestImpl::create):
2697         * Modules/mediastream/RTCStatsRequestImpl.h:
2698         * Modules/mediastream/RTCStatsResponse.cpp:
2699         (WebCore::RTCStatsResponse::create):
2700         * Modules/mediastream/RTCStatsResponse.h:
2701         * Modules/mediastream/RTCVoidRequestImpl.cpp:
2702         (WebCore::RTCVoidRequestImpl::create):
2703         * Modules/mediastream/RTCVoidRequestImpl.h:
2704         * Modules/mediastream/SourceInfo.cpp:
2705         (WebCore::SourceInfo::create):
2706         * Modules/mediastream/SourceInfo.h:
2707         * Modules/mediastream/UserMediaRequest.cpp:
2708         (WebCore::UserMediaRequest::create):
2709         * Modules/mediastream/UserMediaRequest.h:
2710         * Modules/quota/StorageInfo.h:
2711         (WebCore::StorageInfo::create):
2712         * Modules/quota/StorageQuota.h:
2713         (WebCore::StorageQuota::create):
2714         * Modules/speech/SpeechSynthesis.cpp:
2715         (WebCore::SpeechSynthesis::create):
2716         * Modules/speech/SpeechSynthesis.h:
2717         * Modules/speech/SpeechSynthesisUtterance.cpp:
2718         (WebCore::SpeechSynthesisUtterance::create):
2719         * Modules/speech/SpeechSynthesisUtterance.h:
2720         * Modules/speech/SpeechSynthesisVoice.cpp:
2721         (WebCore::SpeechSynthesisVoice::create):
2722         * Modules/speech/SpeechSynthesisVoice.h:
2723         * Modules/webaudio/ChannelMergerNode.cpp:
2724         (WebCore::ChannelMergerNode::create):
2725         * Modules/webaudio/ChannelMergerNode.h:
2726         * Modules/webaudio/ChannelSplitterNode.cpp:
2727         (WebCore::ChannelSplitterNode::create):
2728         * Modules/webaudio/ChannelSplitterNode.h:
2729         * Modules/webaudio/DefaultAudioDestinationNode.h:
2730         (WebCore::DefaultAudioDestinationNode::create):
2731         * Modules/webaudio/GainNode.h:
2732         (WebCore::GainNode::create):
2733         * Modules/webaudio/MediaElementAudioSourceNode.cpp:
2734         (WebCore::MediaElementAudioSourceNode::create):
2735         * Modules/webaudio/MediaElementAudioSourceNode.h:
2736         * Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
2737         (WebCore::MediaStreamAudioDestinationNode::create):
2738         * Modules/webaudio/MediaStreamAudioDestinationNode.h:
2739         * Modules/webaudio/MediaStreamAudioSource.cpp:
2740         (WebCore::MediaStreamAudioSource::create):
2741         * Modules/webaudio/MediaStreamAudioSource.h:
2742         * Modules/webaudio/MediaStreamAudioSourceNode.cpp:
2743         (WebCore::MediaStreamAudioSourceNode::create):
2744         * Modules/webaudio/MediaStreamAudioSourceNode.h:
2745         * Modules/webaudio/OscillatorNode.cpp:
2746         (WebCore::OscillatorNode::setType):
2747         * Modules/webaudio/PannerNode.h:
2748         (WebCore::PannerNode::create):
2749         * Modules/webaudio/PeriodicWave.cpp:
2750         (WebCore::PeriodicWave::create):
2751         (WebCore::PeriodicWave::createSine):
2752         (WebCore::PeriodicWave::createSquare):
2753         (WebCore::PeriodicWave::createSawtooth):
2754         (WebCore::PeriodicWave::createTriangle):
2755         * Modules/webaudio/PeriodicWave.h:
2756         * Modules/webaudio/ScriptProcessorNode.cpp:
2757         (WebCore::ScriptProcessorNode::create):
2758         * Modules/webaudio/ScriptProcessorNode.h:
2759         * Modules/webaudio/WaveShaperNode.h:
2760         (WebCore::WaveShaperNode::create):
2761
2762 2015-05-27  Simon Fraser  <simon.fraser@apple.com>
2763
2764         REGRESSION (r183820): webkit.org/blog/ background painting issue on reload, when the page contains videos
2765         https://bugs.webkit.org/show_bug.cgi?id=145420
2766
2767         Reviewed by Dean Jackson.
2768
2769         After r183820, the media controls no longer had a wrapper that created CSS stacking context.
2770         The media controls on Mac use mix-blend-mode, which causes the compositing code to look for
2771         a stacking context ancestor and make it composited. After this change, it would walk up
2772         to a layer outside of the media element (e.g. the document element's layer), and make
2773         that composited. This triggered bugs with root background painting.
2774
2775         Prevent mix-blend-mode affecting content outside the media elements by having the media element's
2776         layer act as a stacking context.
2777
2778         Test: media/controls-layers.html
2779
2780         * rendering/RenderLayer.cpp:
2781         (WebCore::RenderLayer::RenderLayer):
2782         * rendering/RenderLayer.h:
2783
2784 2015-05-27  Andreas Kling  <akling@apple.com>
2785
2786         [WK2] Local storage areas should get torn down when they have no remaining references.
2787         <https://webkit.org/b/143339>
2788         <rdar://problem/20156436>
2789
2790         Reviewed by Darin Adler.
2791
2792         Add StorageArea::securityOrigin() implementations.
2793
2794         * loader/EmptyClients.cpp:
2795         * storage/StorageArea.h:
2796
2797 2015-05-27  Dean Jackson  <dino@apple.com>
2798
2799         img.currentSrc problem in strict mode with old picturefill
2800         https://bugs.webkit.org/show_bug.cgi?id=144095
2801         <rdar://problem/21087013>
2802
2803         Reviewed by Simon Fraser.
2804
2805         Add a PICTURE_SIZES flag. This allows us to easily remove the currentSrc
2806         attribute on HTMLImageElement, which is causing some issues with
2807         <picture> polyfills.
2808
2809         * Configurations/FeatureDefines.xcconfig:
2810         * html/HTMLImageElement.cpp:
2811         (WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate): Add guard around use of m_currentSrc.
2812         * html/HTMLImageElement.h:
2813         * html/HTMLImageElement.idl: Guard the currentSrc attribute.
2814         * html/parser/HTMLPreloadScanner.cpp:
2815         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
2816         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
2817
2818 2015-05-27  Daniel Bates  <dabates@apple.com>
2819
2820         Attempt to fix internal build following <http://trac.webkit.org/changeset/184760>
2821         (https://bugs.webkit.org/show_bug.cgi?id=145289)
2822
2823         Reviewed by Jer Noble.
2824
2825         * platform/spi/mac/AVFoundationSPI.h:
2826
2827 2015-05-27  Jeremy Jones  <jeremyj@apple.com>
2828
2829         Refactor WebKit1 specific threading code out of WebVideoFullscreen code that is shared with WebKit2.
2830         https://bugs.webkit.org/show_bug.cgi?id=143954
2831
2832         Reviewed by Darin Adler.
2833
2834         WebVideoFullscreenInterfaceAVKit is used in both WebKit1 and WebKit2. In WebKit1, the model runs in the WebThread, while
2835         the interface is on the main thread. So there is code to dispatch between these two thread when communicating between the
2836         interface and the model. In WebKit2, this is handled automatically by the IPC mechanism. As a result, the threading code
2837         in WebVideoFullscreenbInterfaceAVKit and in WebVideoFullscreenModelVideoElement is redundant in WebKit2 and relies on
2838         WebThreadRun being a no-op in WebKit2.
2839
2840         This change clarifies this and simplifies the WebKit2 path by moving the WebKit1 specific threading code into
2841         WebVideoFullscreenControllerContext, which is the WebKit1 specific controller.
2842
2843         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
2844         (WebVideoFullscreenControllerContext::WebVideoFullscreenControllerContext):
2845         (WebVideoFullscreenControllerContext::setController):
2846         (WebVideoFullscreenControllerContext::didSetupFullscreen):
2847         (WebVideoFullscreenControllerContext::didExitFullscreen):
2848         (WebVideoFullscreenControllerContext::didCleanupFullscreen):
2849         (WebVideoFullscreenControllerContext::fullscreenMayReturnToInline):
2850         (WebVideoFullscreenControllerContext::resetMediaState):
2851         (WebVideoFullscreenControllerContext::setDuration):
2852         (WebVideoFullscreenControllerContext::setCurrentTime):
2853         (WebVideoFullscreenControllerContext::setBufferedTime):
2854         (WebVideoFullscreenControllerContext::setRate):
2855         (WebVideoFullscreenControllerContext::setVideoDimensions):
2856         (WebVideoFullscreenControllerContext::setSeekableRanges):
2857         (WebVideoFullscreenControllerContext::setCanPlayFastReverse):
2858         (WebVideoFullscreenControllerContext::setAudioMediaSelectionOptions):
2859         (WebVideoFullscreenControllerContext::setLegibleMediaSelectionOptions):
2860         (WebVideoFullscreenControllerContext::setExternalPlayback):
2861         (WebVideoFullscreenControllerContext::play):
2862         (WebVideoFullscreenControllerContext::pause):
2863         (WebVideoFullscreenControllerContext::togglePlayState):
2864         (WebVideoFullscreenControllerContext::beginScrubbing):
2865         (WebVideoFullscreenControllerContext::endScrubbing):
2866         (WebVideoFullscreenControllerContext::seekToTime):
2867         (WebVideoFullscreenControllerContext::fastSeek):
2868         (WebVideoFullscreenControllerContext::beginScanningForward):
2869         (WebVideoFullscreenControllerContext::beginScanningBackward):
2870         (WebVideoFullscreenControllerContext::endScanning):
2871         (WebVideoFullscreenControllerContext::requestExitFullscreen):
2872         (WebVideoFullscreenControllerContext::setVideoLayerFrame):
2873         (WebVideoFullscreenControllerContext::setVideoLayerGravity):
2874         (WebVideoFullscreenControllerContext::selectAudioMediaOption):
2875         (WebVideoFullscreenControllerContext::selectLegibleMediaOption):
2876         (WebVideoFullscreenControllerContext::fullscreenModeChanged):
2877         (WebVideoFullscreenControllerContext::setupFullscreen):
2878         (WebVideoFullscreenControllerContext::exitFullscreen):
2879         (WebVideoFullscreenControllerContext::requestHideAndExitFullscreen):
2880         (-[WebVideoFullscreenController init]):
2881         (-[WebVideoFullscreenController dealloc]):
2882         (-[WebVideoFullscreenController enterFullscreen:mode:]):
2883         (-[WebVideoFullscreenController exitFullscreen]):
2884         (-[WebVideoFullscreenController requestHideAndExitFullscreen]):
2885         (-[WebVideoFullscreenController didFinishFullscreen:]):
2886         (WebVideoFullscreenControllerChangeObserver::setTarget): Deleted.
2887         (-[WebVideoFullscreenController didSetupFullscreen]): Deleted.
2888         (-[WebVideoFullscreenController didEnterFullscreen]): Deleted.
2889         (-[WebVideoFullscreenController didExitFullscreen]): Deleted.
2890         (-[WebVideoFullscreenController didCleanupFullscreen]): Deleted.
2891         (-[WebVideoFullscreenController fullscreenMayReturnToInline]): Deleted.
2892         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
2893         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2894         (-[WebAVVideoLayer setBounds:]):
2895         (-[WebAVVideoLayer resolveBounds]):
2896         (WebVideoFullscreenInterfaceAVKit::resetMediaState):
2897         (WebVideoFullscreenInterfaceAVKit::setDuration):
2898         (WebVideoFullscreenInterfaceAVKit::setCurrentTime):
2899         (WebVideoFullscreenInterfaceAVKit::setBufferedTime):
2900         (WebVideoFullscreenInterfaceAVKit::setRate):
2901         (WebVideoFullscreenInterfaceAVKit::setVideoDimensions):
2902         (WebVideoFullscreenInterfaceAVKit::setSeekableRanges):
2903         (WebVideoFullscreenInterfaceAVKit::setCanPlayFastReverse):
2904         (WebVideoFullscreenInterfaceAVKit::setAudioMediaSelectionOptions):
2905         (WebVideoFullscreenInterfaceAVKit::setLegibleMediaSelectionOptions):
2906         (WebVideoFullscreenInterfaceAVKit::setExternalPlayback):
2907         (WebVideoFullscreenInterfaceAVKit::setupFullscreen):
2908         (WebVideoFullscreenInterfaceAVKit::enterFullscreen):
2909         (WebVideoFullscreenInterfaceAVKit::enterFullscreenStandard):
2910         (WebVideoFullscreenInterfaceAVKit::exitFullscreen):
2911         (WebVideoFullscreenInterfaceAVKit::exitFullscreenInternal):
2912         (WebVideoFullscreenInterfaceAVKit::cleanupFullscreen):
2913         (WebVideoFullscreenInterfaceAVKit::cleanupFullscreenInternal):
2914         (WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen):
2915         (WebVideoFullscreenInterfaceAVKit::preparedToReturnToInline):
2916         (WebVideoFullscreenInterfaceAVKit::willStartOptimizedFullscreen):
2917         (WebVideoFullscreenInterfaceAVKit::didStartOptimizedFullscreen):
2918         (WebVideoFullscreenInterfaceAVKit::willStopOptimizedFullscreen):
2919         (WebVideoFullscreenInterfaceAVKit::didStopOptimizedFullscreen):
2920         (WebVideoFullscreenInterfaceAVKit::willCancelOptimizedFullscreen):
2921         (WebVideoFullscreenInterfaceAVKit::didCancelOptimizedFullscreen):
2922         (WebVideoFullscreenInterfaceAVKit::setVideoLayerFrame):
2923         (WebVideoFullscreenInterfaceAVKit::setupFullscreenInternal): Deleted.
2924         * platform/ios/WebVideoFullscreenModel.h:
2925         * platform/ios/WebVideoFullscreenModelVideoElement.h:
2926         * platform/ios/WebVideoFullscreenModelVideoElement.mm:
2927         (WebVideoFullscreenModelVideoElement::setVideoFullscreenLayer):
2928         (WebVideoFullscreenModelVideoElement::play):
2929         (WebVideoFullscreenModelVideoElement::pause):
2930         (WebVideoFullscreenModelVideoElement::togglePlayState):
2931         (WebVideoFullscreenModelVideoElement::beginScrubbing):
2932         (WebVideoFullscreenModelVideoElement::endScrubbing):
2933         (WebVideoFullscreenModelVideoElement::seekToTime):
2934         (WebVideoFullscreenModelVideoElement::fastSeek):
2935         (WebVideoFullscreenModelVideoElement::beginScanningForward):
2936         (WebVideoFullscreenModelVideoElement::beginScanningBackward):
2937         (WebVideoFullscreenModelVideoElement::endScanning):
2938         (WebVideoFullscreenModelVideoElement::requestExitFullscreen):
2939         (WebVideoFullscreenModelVideoElement::fullscreenModeChanged):
2940         (WebVideoFullscreenModelVideoElement::videoLayerFrame): Deleted.
2941         (WebVideoFullscreenModelVideoElement::videoLayerGravity): Deleted.
2942
2943 2015-05-27  Eric Carlson  <eric.carlson@apple.com>
2944
2945         [Mac] short-circuit MIME type lookup when possible
2946         https://bugs.webkit.org/show_bug.cgi?id=145362
2947
2948         Reviewed by Jer Noble.
2949
2950         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2951         (WebCore::isUnsupportedMIMEType): Renamed from unsupportedMIMEType. Convert type to lower case
2952         once instead of calling equalIgnoringCase many times.
2953         (WebCore::staticMIMETypeList): Renamed from staticMimeTypeCache. Initialize static set in a lambda,
2954         using an array of C strings in a loop.
2955         (WebCore::avfMIMETypes): Renamed from avfMimeTypeCache. Initialize static set in a lambda.
2956         (WebCore::MediaPlayerPrivateAVFoundationObjC::getSupportedTypes): avfMimeTypeCache -> avfMIMETypes.
2957         (WebCore::keySystemIsSupported): equalIgnoringCase -> equalIgnoringASCIICase.
2958         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType): Ditto.
2959         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem): unsupportedMIMEType -> 
2960         isUnsupportedMIMEType, equalIgnoringCase -> equalIgnoringASCIICase, staticMimeTypeCache -> 
2961         staticMIMETypeList, avfMimeTypeCache -> avfMIMETypes.
2962         (WebCore::unsupportedMIMEType): Deleted.
2963         (WebCore::staticMimeTypeCache): Deleted.
2964         (WebCore::avfMimeTypeCache): Deleted.
2965
2966 2015-05-27  Eric Carlson  <eric.carlson@apple.com>
2967
2968         [Mac] short-circuit MIME type lookup when possible
2969         https://bugs.webkit.org/show_bug.cgi?id=145362
2970
2971         Reviewed by Dean Jackson.
2972
2973         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2974         (WebCore::unsupportedMIMEType): New, reject types known to not be supported.
2975         (WebCore::staticMimeTypeCache): Accept MIME types known to be supported.
2976         (WebCore::avfMimeTypeCache): Renamed from mimeTypeCache.
2977         (WebCore::MediaPlayerPrivateAVFoundationObjC::getSupportedTypes): mimeTypeCache -> staticMimeTypeCache.
2978         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType): Return immediately if
2979         unsupportedMIMEType returns true, don't call AVFoundation if staticMimeTypeCache returns true.
2980         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem): Ditto.
2981         (WebCore::mimeTypeCache): Deleted.
2982
2983 2015-05-27  Eric Carlson  <eric.carlson@apple.com>
2984
2985         [Mac] occasional crash in MediaPlayerPrivateAVFoundationObjC::didStopLoadingRequest
2986         https://bugs.webkit.org/show_bug.cgi?id=145409
2987
2988         Reviewed by Dean Jackson.
2989
2990         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
2991         (WebCore::WebCoreAVFResourceLoader::stopLoading): NULL-check m_avRequest.
2992
2993 2015-05-26  Dean Jackson  <dino@apple.com>
2994
2995         Backdrop filters don't animate
2996         https://bugs.webkit.org/show_bug.cgi?id=145386
2997         <rdar://problem/21110037>
2998
2999         Reviewed by Simon Fraser.
3000
3001         Add support for animation of backdrop filters.
3002
3003         Note that, at the moment, we can only animate/transition
3004         backdrop-filter if it is already present on the element. See
3005         https://bugs.webkit.org/show_bug.cgi?id=145107
3006
3007         Test: css3/filters/backdrop/animation.html
3008
3009         * page/animation/AnimationBase.h: Add m_backdropFilterFunctionListsMatch and backdropFilterFunctionListsMatch.
3010         (WebCore::AnimationBase::backdropFilterFunctionListsMatch):
3011
3012         * page/animation/CSSPropertyAnimation.cpp:
3013         (WebCore::blendFunc): backdrop-filter is also supported.
3014         (WebCore::PropertyWrapperAcceleratedBackdropFilter::PropertyWrapperAcceleratedBackdropFilter): Added. Works
3015         similarly to the PropertyWrapperAcceleratedFilter.
3016         (WebCore::PropertyWrapperAcceleratedBackdropFilter::animationIsAccelerated):
3017         (WebCore::PropertyWrapperAcceleratedBackdropFilter::blend):
3018         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): Construct the
3019         PropertyWrapperAcceleratedBackdropFilter.
3020
3021         * page/animation/ImplicitAnimation.cpp:
3022         (WebCore::ImplicitAnimation::reset): Call checkForMatchingBackdropFilterFunctionLists.
3023         (WebCore::ImplicitAnimation::validateTransformFunctionList): Fix typo.
3024         (WebCore::ImplicitAnimation::checkForMatchingFilterFunctionLists): Remove whitespace.
3025         (WebCore::ImplicitAnimation::checkForMatchingBackdropFilterFunctionLists): New method that
3026         checks if the individual filters in a filter list match.
3027         * page/animation/ImplicitAnimation.h: Add checkForMatchingBackdropFilterFunctionLists.
3028
3029         * page/animation/KeyframeAnimation.cpp:
3030         (WebCore::KeyframeAnimation::KeyframeAnimation): Call checkForMatchingBackdropFilterFunctionLists.
3031         (WebCore::KeyframeAnimation::checkForMatchingBackdropFilterFunctionLists): Copied from
3032         checkForMatchingFilterFunctionLists, but calls backdropFilter() instead of filter().
3033         (WebCore::KeyframeAnimation::checkForMatchingFilterFunctionLists): This was accidentally checking
3034         for backdrop filters as well, but it wouldn't have worked.
3035         * page/animation/KeyframeAnimation.h: Add checkForMatchingBackdropFilterFunctionLists.
3036
3037         * platform/graphics/GraphicsLayer.cpp:
3038         (WebCore::GraphicsLayer::validateFilterOperations): Modify the ASSERT to allow AnimatedPropertyWebkitBackdropFilter.
3039         * platform/graphics/GraphicsLayerClient.h: Add AnimatedPropertyWebkitBackdropFilter to the enum.
3040
3041         * platform/graphics/ca/GraphicsLayerCA.cpp:
3042         (WebCore::propertyIdToString): Support new enum.
3043         (WebCore::GraphicsLayerCA::addAnimation): Support AnimatedPropertyWebkitBackdropFilter.
3044         (WebCore::GraphicsLayerCA::createFilterAnimationsFromKeyframes): Ditto.
3045         (WebCore::GraphicsLayerCA::animatedLayer): Use a switch statement now that we have more than
3046         two options, and handle AnimatedPropertyWebkitBackdropFilter.
3047         (WebCore::GraphicsLayerCA::updateAnimations): Deleted a blank line.
3048
3049         * rendering/RenderLayerBacking.cpp:
3050         (WebCore::RenderLayerBacking::startAnimation): Support animation of backdrop-filter.
3051         (WebCore::RenderLayerBacking::startTransition): Ditto. Copied the code from the filter transition.
3052         (WebCore::RenderLayerBacking::graphicsLayerToCSSProperty):
3053         (WebCore::RenderLayerBacking::cssToGraphicsLayerProperty):
3054         * rendering/RenderLayerCompositor.cpp:
3055         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation):
3056
3057 2015-05-27  Jeremy Jones  <jeremyj@apple.com>
3058
3059         Handle case where -startOptimizedFullscreen fails.
3060         https://bugs.webkit.org/show_bug.cgi?id=145340
3061
3062         Reviewed by Eric Carlson.
3063
3064         Add new AVPlayerViewController delegate methods and remove old ones.
3065         -startOptimizedFullscreen can either fail silently because it is not allowed or it will call a delegate.
3066         We prevent silent failure by testing preconditions in enterFullscreenOptimized, and add the 
3067         delegate -playerViewControllerFailedToStartOptimizedFullscreen to handle explicitly failure.
3068
3069         * platform/ios/WebVideoFullscreenInterfaceAVKit.h: added/removed method declarations.
3070         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: 
3071         (-[WebAVPlayerController playerViewControllerFailedToStartOptimizedFullscreen:withError:]): Added.
3072         (WebVideoFullscreenInterfaceAVKit::enterFullscreenOptimized): Handle silent failure.
3073         (WebVideoFullscreenInterfaceAVKit::didStartOptimizedFullscreen): Hide window on main thread.
3074         (WebVideoFullscreenInterfaceAVKit::failedToStartOptimizedFullscreen): Added
3075         (-[WebAVPlayerController playerViewControllerWillCancelOptimizedFullscreen:]): Deleted.
3076         (-[WebAVPlayerController playerViewControllerDidCancelOptimizedFullscreen:]): Deleted.
3077         (WebVideoFullscreenInterfaceAVKit::willCancelOptimizedFullscreen): Deleted.
3078         (WebVideoFullscreenInterfaceAVKit::didCancelOptimizedFullscreen): Deleted.
3079         * platform/spi/cocoa/AVKitSPI.h: Remove dead SPI. Add isOptimizedFullscreenPossible.
3080
3081 2015-05-27  Myles C. Maxfield  <mmaxfield@apple.com>
3082
3083         [iOS] Arabic ligatures are broken in Google Maps
3084         https://bugs.webkit.org/show_bug.cgi?id=145336
3085         <rdar://problem/20689607>
3086
3087         Reviewed by Darin Adler.
3088
3089         When we fall off the end of the font fallback list, we ask the platform for which particular font we should use
3090         to display a particular codepoint. When we do this, we supply the font which is first in the fallback list so
3091         that the platform can try to match it as best it can. However, web fonts' FontPlatformData have a null m_font
3092         property, which means that we were passing nullptr to this platform fallback function.
3093
3094         The solution is something I've wanted to do for a while, which is migrate webfonts from using
3095         CGDataProviderCreateWithCFData() to using CTFontManagerCreateFontDescriptorFromData(). This call creates a
3096         CoreText font for an in-memory buffer (the old call was creating a CoreGraphics front from the same thing).
3097         This means that we can use the FontPlatformData constructor which accepts a CoreText font, thereby making web
3098         fonts not have a null m_font property. Note that not all platforms can use this call, which means that this
3099         new codepath is gated to only certain OSes (which is okay because only certain OSes use the
3100         CTFontCreatePhysicalFontDescriptorForCharactersWithLanguage() call inside FontCache). Because web fonts are the
3101         only user of the constructor which just takes a CG font, we can make the constructor private to the
3102         FontPlatformData class (as soon as all platforms can use this new codepath).
3103
3104         Test: platform/ios-simulator/fast/text/arabic-with-no-supporting-webfont.html
3105
3106         * platform/graphics/FontPlatformData.h: Make the FontPlatformData constructor which takes a CGFontRef private.
3107         * platform/graphics/mac/FontCustomPlatformData.cpp:
3108         (WebCore::FontCustomPlatformData::fontPlatformData): Use the CoreText type instead of the CoreGraphics type.
3109         (WebCore::createFontCustomPlatformData): Migrate to CTFontManagerCreateFontDescriptorFromData().
3110         * platform/graphics/mac/FontCustomPlatformData.h:
3111         (WebCore::FontCustomPlatformData::FontCustomPlatformData): Store a CTFontDescriptorRef instead of a CGFontRef.
3112
3113 2015-05-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
3114
3115         An SVG with no intrinsic size does not draw correct slices when used as a border-image for an HTML element.
3116         https://bugs.webkit.org/show_bug.cgi?id=139405
3117
3118         Reviewed by Darin Adler.
3119         
3120         When using a non-intrinsic-sized image as an image-border, all the source
3121         slices have to be extracted from the top-left corner of the source image.
3122         This is because the right and bottom sides of the image can not be known.
3123         Also all the slices should not be stretched. In other words, the sizes of
3124         source slices for a non-intrinsic-sized image should be equal to the sizes
3125         of the destination container slices.
3126
3127         This is not compliant with the css3 w3c specs. I think the specs makes it
3128         harder to predict what exactly will be drawn for the image-border in this
3129         case. See http://www.w3.org/TR/css3-background/#border-image-slice. This
3130         approach is implemented by FireFox. And I think it gives a more predictable 
3131         rendering for image-border in the case of non-intrinsic-sized images.
3132         
3133         Test: fast/borders/border-image-fill-no-intrinsic-size.html
3134
3135         * CMakeLists.txt:
3136         * WebCore.vcxproj/WebCore.vcxproj:
3137         * WebCore.vcxproj/WebCore.vcxproj.filters:
3138         * WebCore.xcodeproj/project.pbxproj:
3139         * platform/LengthBox.cpp: Removed.
3140         * platform/graphics/LayoutBoxExtent.cpp: Removed.
3141         * platform/graphics/LayoutBoxExtent.h: Removed.
3142         * platform/graphics/LayoutRect.h:
3143         Delete LengthBox.cpp and move all the functionalities to LengthBox.h.
3144         Delete LayoutBoxExtent.cpp since it is the same class as LengthBox.
3145         
3146         * css/CSSProperty.cpp:
3147         * platform/text/WritingMode.h:
3148         Move the enums LogicalBoxSide and PhysicalBoxSide
3149         from CSSProperty.cpp to WritingMode.h so it can be used by other classes.
3150         
3151         * css/CSSToStyleMap.cpp:
3152         (WebCore::CSSToStyleMap::mapNinePieceImageSlice):
3153         (WebCore::CSSToStyleMap::mapNinePieceImageQuad):
3154         * css/CSSToStyleMap.h:
3155         * inspector/InspectorOverlay.cpp:
3156         (WebCore::buildRendererHighlight):
3157         * rendering/InlineFlowBox.cpp:
3158         (WebCore::InlineFlowBox::addBorderOutsetVisualOverflow):
3159         * rendering/RenderBox.h:
3160         (WebCore::RenderBox::marginLogicalLeft):
3161         (WebCore::RenderBox::marginLogicalRight):
3162         (WebCore::RenderBox::setMarginBefore):
3163         (WebCore::RenderBox::setMarginAfter):
3164         (WebCore::RenderBox::setMarginStart):
3165         (WebCore::RenderBox::setMarginEnd):
3166         * rendering/style/RenderStyle.cpp:
3167         (WebCore::RenderStyle::setClip):
3168         (WebCore::RenderStyle::noneDashboardRegions):
3169         * rendering/style/RenderStyle.h:
3170         Use the new BoxExtent access methods for getting and settings the sides of
3171         LengthBox and LayoutBoxExtent.
3172         
3173         * platform/LengthBox.h:
3174         (WebCore::BoxExtent::BoxExtent):
3175         (WebCore::BoxExtent::at):
3176         (WebCore::BoxExtent::top):
3177         (WebCore::BoxExtent::right):
3178         (WebCore::BoxExtent::bottom):
3179         (WebCore::BoxExtent::left):
3180         (WebCore::BoxExtent::setAt):
3181         (WebCore::BoxExtent::setTop):
3182         (WebCore::BoxExtent::setRight):
3183         (WebCore::BoxExtent::setBottom):
3184         (WebCore::BoxExtent::setLeft):
3185         (WebCore::BoxExtent::before):
3186         (WebCore::BoxExtent::end):
3187         (WebCore::BoxExtent::after):
3188         (WebCore::BoxExtent::start):
3189         (WebCore::BoxExtent::setBefore):
3190         (WebCore::BoxExtent::setEnd):
3191         (WebCore::BoxExtent::setAfter):
3192         (WebCore::BoxExtent::setStart):
3193         (WebCore::BoxExtent::operator==):
3194         (WebCore::BoxExtent::operator!=):
3195         (WebCore::LengthBox::LengthBox):
3196         (WebCore::LengthBox::isZero):
3197         (WebCore::LengthBox::left): Deleted.
3198         (WebCore::LengthBox::right): Deleted.
3199         (WebCore::LengthBox::top): Deleted.
3200         (WebCore::LengthBox::bottom): Deleted.
3201         (WebCore::LengthBox::operator==): Deleted.
3202         (WebCore::LengthBox::operator!=): Deleted.
3203         (WebCore::LengthBox::nonZero): Deleted.
3204         Define a new template class for 'BoxExtent'. A 'BoxExtent' represents the
3205         extent of four sides of a box. Use this class template to define the exiting 
3206         classes 'LengthBox' and 'LayoutBoxExtent'. Use it also to and define the
3207         new class FloatBoxExtent
3208             
3209         * rendering/RenderBoxModelObject.cpp:
3210         (WebCore::RenderBoxModelObject::calculateImageIntrinsicDimensions):
3211         * rendering/RenderBoxModelObject.h:
3212         (WebCore::RenderBoxModelObject::calculateFillTileSize):
3213         * rendering/RenderListMarker.cpp:
3214         (WebCore::RenderListMarker::updateContent):
3215         * rendering/shapes/ShapeOutsideInfo.cpp:
3216         (WebCore::ShapeOutsideInfo::createShapeForImage):
3217         Change the return value of calculateImageIntrinsicDimensions() to be a
3218         bool which indicates whether the image has an intrinsic size or not. Add
3219         a new reference argument to this function receive the resolved image size.
3220         
3221         (WebCore::RenderBoxModelObject::paintNinePieceImage): Move all the painting
3222         code of this function to NinePieceImage::paint()
3223         
3224         (WebCore::computeBorderImageSide): Deleted.
3225         Renamed to be NinePieceImage::computeSlice().
3226         
3227         * rendering/style/BorderData.h:
3228         (WebCore::BorderData::borderWidth): Add a new method to return the extents
3229         of the border in a FloatBoxExtent.
3230         
3231         * rendering/style/NinePieceImage.cpp:
3232         (WebCore::NinePieceImage::computeSlice): Moved from NinePieceImage::computeSlice().
3233         
3234         (WebCore::NinePieceImage::computeSlices): The first version of this function
3235         computes the slices given their lengths. The slices have to be clamped to
3236         the container size. The second version of this function computes the slices
3237         given their lengths, their actual extents and their source slices.
3238         
3239         (WebCore::NinePieceImage::scaleSlicesIfNeeded):  Reduce the slices if they
3240         are too large.
3241         
3242         (WebCore::NinePieceImage::isEmptyPieceRect): Returns true if an ImagePiece
3243         should not be drawn.
3244         
3245         (WebCore::NinePieceImage::horizontalTileRules):
3246         (WebCore::NinePieceImage::verticalTileRules):
3247         Fill vectors of tiling rules to be passed to GraphicsContext::drawTiledImage()
3248         
3249         (WebCore::NinePieceImage::computeIntrinsicRects): Computes the nine pieces
3250         rectangles for an intrinsic-sized container.
3251         
3252         (WebCore::NinePieceImage::computeNonIntrinsicRects): Computes the nine
3253         pieces rectangles for an non-intrinsic-sized source image. The computed
3254         rectangles have to start at (0, 0) and their sizes should be equal to
3255         the sizes of the nine pieces rectangles of the destination container.
3256         
3257         (WebCore::NinePieceImage::computeIntrinsicSideTileScale):
3258         (WebCore::NinePieceImage::computeIntrinsicMiddleTileScale):
3259         (WebCore::NinePieceImage::computeIntrinsicTileScales):
3260         (WebCore::NinePieceImage::computeNonIntrinsicTileScales):
3261         Computes the scaling factors for drawing the tiles. For non-intrinsic source
3262         images, there should not be any scaling factors. 
3263         
3264         (WebCore::NinePieceImage::paint): Moved from RenderBoxModelObject::paintNinePieceImage()
3265         but simplified and restructured.
3266         
3267         (WebCore::NinePieceImageData::NinePieceImageData): Use nullptr instead of 0.
3268         
3269         * rendering/style/NinePieceImage.h:
3270         (WebCore::operator++):
3271         (WebCore::isCornerPiece): 
3272         (WebCore::isMiddlePiece):
3273         (WebCore::imagePieceHorizontalSide):
3274         (WebCore::imagePieceVerticalSide):
3275         Add helper functions for the enum ImagePiece.
3276
3277 2015-05-26  Andreas Kling  <akling@apple.com>
3278
3279         <font face> doesn't support plus character in font family names.
3280         <https://webkit.org/b/145400>
3281         <rdar://problem/21097484>
3282
3283         Reviewed by Darin Adler.
3284
3285         Turn CSSParser::parseFontFaceValue() into a fast-path parser for
3286         <font face> attributes.
3287         Going through the full CSS parser was hurting us here, as it would
3288         misunderstand unquoted family names and choke on e.g '+'.
3289
3290         Test: fast/dom/HTMLFontElement/face-attribute.html
3291
3292         * css/CSSParser.cpp:
3293         (WebCore::CSSParser::parseFontFaceValue):
3294
3295 2015-05-26  Chris Fleizach  <cfleizach@apple.com>
3296
3297         AX: display:none content exposed to accessibility when aria-hidden is toggled on ancestor element
3298         https://bugs.webkit.org/show_bug.cgi?id=139142
3299
3300         Reviewed by Darin Adler.
3301      
3302         Amend the code that determines when an invisible, but aria-hidden=false, element is exposed to accessibility.
3303
3304         The new guideline is that you must have aria-hidden=false on every node that is not rendered (except text which inherits)
3305         otherwise the element will not be visible.
3306
3307         Modified existing test: accessibility/aria-hidden-false-works-in-subtrees.html
3308
3309         * accessibility/AXObjectCache.cpp:
3310         (WebCore::isNodeAriaVisible):
3311         (WebCore::AXObjectCache::rootWebArea):
3312
3313 2015-05-26  Roger Fong  <roger_fong@apple.com>
3314
3315         Enable element unsigned index in WebGL2 again.
3316         https://bugs.webkit.org/show_bug.cgi?id=145392
3317         <rdar://problem/21112585>.
3318
3319         Reviewed by Dean Jackson.
3320
3321         * html/canvas/WebGLRenderingContextBase.cpp:
3322         (WebCore::WebGLRenderingContextBase::validateDrawElements):
3323         Fix some incorrect logic that disables the feature for WebGL2.
3324
3325 2015-05-26  Chris Dumez  <cdumez@apple.com>
3326
3327         Add assertions to make sure pages in the PageCache are not loading
3328         https://bugs.webkit.org/show_bug.cgi?id=145397
3329         <rdar://problem/20613631>
3330
3331         Reviewed by Antti Koivisto.
3332
3333         Add assertions to make sure pages in the PageCache are not loading.
3334         These will hopefully help track down why PacheCache entries sometimes
3335         have pending subresource loads when being destroyed.
3336
3337         * history/CachedFrame.cpp:
3338         (WebCore::CachedFrame::CachedFrame):
3339         * loader/DocumentLoader.cpp:
3340         (WebCore::DocumentLoader::stopLoadingSubresources):
3341         (WebCore::DocumentLoader::addSubresourceLoader):
3342
3343 2015-05-26  Commit Queue  <commit-queue@webkit.org>
3344
3345         Unreviewed, rolling out r184872.
3346         https://bugs.webkit.org/show_bug.cgi?id=145396
3347
3348         Bindings tests broken on the bots. (Requested by dethbakin on
3349         #webkit).
3350
3351         Reverted changeset:
3352
3353         "Binding generator should support interfaces with
3354         CustomConstructor and NoInterfaceObject"
3355         https://bugs.webkit.org/show_bug.cgi?id=145016
3356         http://trac.webkit.org/changeset/184872
3357
3358 2015-05-26  Zalan Bujtas  <zalan@apple.com>
3359
3360         Overhanging float sets are not cleaned up properly when floating renderer is destroyed.
3361         https://bugs.webkit.org/show_bug.cgi?id=145323
3362         rdar://problem/20980628
3363
3364         Reviewed by Dave Hyatt.
3365
3366         This patch ensures when an overhanging float renderer is destroyed,
3367         all the sibling containers' floating object set(m_floatingObjects) gets properly cleaned up.
3368
3369         When an overhanging float is present, we cache the renderer on the parent and on the affected
3370         sibling containers too. (RenderBlockFlow::m_floatingObjects) These caches(sets) get cleared and repopulated
3371         during ::layout(). In order to have a float renderer removed from a set, a layout needs to be initiated on the container.
3372         This is normally done through RenderBlockFlow::markSiblingsWithFloatsForLayout() and RenderBlockFlow::markAllDescendantsWithFloatsForLayout().
3373         However, when the float container's parent's writing direction changes (and we promote the children containers to new formatting contexts),
3374         the layout propagation through siblings does not work anymore.
3375
3376         The avoidsFloats() check in RenderBlockFlow::markSiblingsWithFloatsForLayout() has very little performance gain, but it prevents us
3377         from propagating layout to siblings when certain properties of the parent container changes.
3378
3379         Test: fast/block/float/crash-when-floating-object-is-removed.xhtml
3380
3381         * rendering/RenderBlockFlow.cpp:
3382         (WebCore::RenderBlockFlow::markSiblingsWithFloatsForLayout):
3383         * rendering/RenderBox.cpp:
3384         (WebCore::outermostBlockContainingFloatingObject):
3385         (WebCore::RenderBox::removeFloatingOrPositionedChildFromBlockLists):
3386         (WebCore::RenderBox::outermostBlockContainingFloatingObject): Deleted.
3387         * rendering/RenderBox.h:
3388
3389 2015-05-26  Ryuan Choi  <ryuan.choi@navercorp.com>
3390
3391         [EFL][CoordinatedGraphics] Remove CoordinatedTileClient and CoordinatedTileBackend
3392         https://bugs.webkit.org/show_bug.cgi?id=133337
3393
3394         Reviewed by Darin Adler.
3395
3396         This patch simplifies relationship between CoordinatedGraphicsLayer and TiledBackingStore
3397         by removing TiledBackingStoreBackend because TiledBackingStore only support
3398         CoordinatedTileBackend.
3399         And it also moves CoordinatedTileClient interface to TiledBackingStoreClient.
3400