b043fba8e50b1ae4a997b7f877b4be23ad4947bd
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-06-07  Darin Adler  <darin@apple.com>
2
3         REGRESSION (r181720): Unnecessary layout triggered any time animated GIF advances to a new frame
4         https://bugs.webkit.org/show_bug.cgi?id=145733
5
6         Reviewed by Andreas Kling.
7
8         Test: fast/images/animated-gif-no-layout.html
9
10         * rendering/RenderImage.cpp:
11         (WebCore::RenderImage::styleDidChange): Correctly pass ImageSizeChangeNone in cases
12         where we don't need to report a change in intrinsic size that happened outside the
13         repaintOrMarkForLayout function.
14         (WebCore::RenderImage::repaintOrMarkForLayout): Move work that should only be done
15         when size changed inside the if statement.
16
17         * testing/Internals.cpp:
18         (WebCore::Internals::layoutCount): Added.
19         * testing/Internals.h: Added layoutCount.
20         * testing/Internals.idl: Ditto.
21
22 2015-06-07  Michael Catanzaro  <mcatanzaro@igalia.com>
23
24         Fix strncpy use in WebCore::Text::formatForDebugger
25         https://bugs.webkit.org/show_bug.cgi?id=145608
26
27         Reviewed by Darin Adler.
28
29         r185137 replaced a call to strncpy with a call to strlcpy, which broke the build on Linux
30         since strlcpy does not exist there. r185148 reverted this to use strncpy again, but got the
31         size argument off by one, "introducing" a buffer overrun. But this code has always been
32         wrong, since it used strncpy without ensuring that the buffer is null-terminated after the
33         call to strncpy. Fix this as well.
34
35         * dom/Text.cpp:
36         (WebCore::Text::formatForDebugger):
37
38 2015-06-07  Antti Koivisto  <antti@apple.com>
39
40         CrashTracer: [USER] com.apple.WebKit.WebContent.Development at com.apple.WebCore: WebCore::FrameLoader::subresourceCachePolicy const + 11
41         https://bugs.webkit.org/show_bug.cgi?id=145736
42         rdar://problem/21246971
43
44         Reviewed by David Kilzer.
45
46         No repro, no test.
47
48         * html/HTMLLinkElement.cpp:
49         (WebCore::HTMLLinkElement::setCSSStyleSheet):
50
51             Null check frame. It may be null during frame teardown.
52
53 2015-06-06  Anders Carlsson  <andersca@apple.com>
54
55         Remove support from getting plug-in information from Carbon resources
56         https://bugs.webkit.org/show_bug.cgi?id=145730
57
58         Reviewed by Dan Bernstein.
59
60         Remove a now unused function.
61
62         * platform/mac/WebCoreNSStringExtras.h:
63         * platform/mac/WebCoreNSStringExtras.mm:
64         (stringEncodingForResource): Deleted.
65
66 2015-06-06  Commit Queue  <commit-queue@webkit.org>
67
68         Unreviewed, rolling out r185284.
69         https://bugs.webkit.org/show_bug.cgi?id=145723
70
71         it needs some discussion before landing (Requested by dino on
72         #webkit).
73
74         Reverted changeset:
75
76         "[iOS] Don't force compositing layers for no-op 3D transforms
77         on low-memory devices."
78         https://bugs.webkit.org/show_bug.cgi?id=145719
79         http://trac.webkit.org/changeset/185284
80
81 2015-06-06  Ryosuke Niwa  <rniwa@webkit.org>
82
83         Typing is slow in Gmail on iPads
84         https://bugs.webkit.org/show_bug.cgi?id=145686
85
86         Reviewed by Enrica Casucci.
87
88         The bug was caused by nextCandidate and nextVisuallyDistinctCandidate traversing through each character
89         in a text node without a renderer. Skip any node that doesn't have a renderer in both of those functions
90         and corresponding previous* functions.
91
92         It's fine to skip unrendered nodes in PositionIterator because only other clients of PositionIterator
93         are Position::upstream and Position::downstream and they don't care about un-rendered nodes either.
94
95         * dom/PositionIterator.cpp:
96         (WebCore::PositionIterator::increment):
97         (WebCore::PositionIterator::decrement):
98         * editing/htmlediting.cpp:
99         (WebCore::nextVisuallyDistinctCandidate):
100         (WebCore::previousVisuallyDistinctCandidate):
101
102 2015-06-06  Mark Lam  <mark.lam@apple.com>
103
104         Returned Exception* values need to be initialized to nullptr when no exceptions are thrown.
105         https://bugs.webkit.org/show_bug.cgi?id=145720
106
107         Reviewed by Dan Bernstein.
108
109         No new tests because this issue is already covered by the existing inspector-protocol tests.
110
111         * bindings/js/WorkerScriptController.cpp:
112         (WebCore::WorkerScriptController::evaluate):
113
114 2015-06-05  Andreas Kling  <akling@apple.com>
115
116         [iOS] Don't force compositing layers for no-op 3D transforms on low-memory devices.
117         <https://webkit.org/b/145719>
118         <rdar://problem/19973042>
119
120         Reviewed by Geoffrey Garen.
121
122         We put elements with 3D identity transforms onto compositing layers because
123         we anticipate that they will somehow animate in the future.
124
125         This can get extremely expensive, especially on low-memory devices.
126         This patch makes WebKit stop handing out compositing layers for this kinda thing:
127
128             -webkit-transform: translate3d(0,0,0)
129
130         ..on devices with 512MB or less. This dramatically improves stability on some
131         web pages.
132
133         * rendering/RenderLayerCompositor.cpp:
134         (WebCore::RenderLayerCompositor::requiresCompositingForTransform):
135
136 2015-06-05  Matt Baker  <mattbaker@apple.com>
137
138         Web Inspector: "Other" time in the framerate table is often negative
139         https://bugs.webkit.org/show_bug.cgi?id=145712
140
141         Reviewed by Timothy Hatcher.
142
143         The Inspector frontend flattens the timeline event tree it receives from the backend, which can contain nested
144         paint records. The nested records represent a single paint event, but were being interpreted as two separate
145         events for purposes of calculating total layout time. This caused the calculated "other" time to be less than
146         it should be (and in some cases negative).
147
148         * inspector/InspectorTimelineAgent.cpp:
149         (WebCore::InspectorTimelineAgent::addRecordToTimeline):
150         Paint records are no longer nested, we simply drop the child paint event.
151
152 2015-06-05  Chris Dumez  <cdumez@apple.com>
153
154         Unreviewed, speculative Windows build fix after r185273.
155
156         * platform/VNodeTracker.h:
157
158 2015-06-05  Chris Dumez  <cdumez@apple.com>
159
160         [WK2][iOS] Limit the number of vnodes used by the WebContent processes
161         https://bugs.webkit.org/show_bug.cgi?id=145672
162         <rdar://problem/21126637>
163
164         Reviewed by Antti Koivisto.
165
166         Limit the number of vnodes used by the WebContent processes to reduce
167         the chance of getting killed due to the system running out of vnodes.
168         We sometimes see the WebContent process use up to 50% of the system's
169         vnode limit on some tests on iOS, which seems excessive. Most vnodes
170         are due to CachedResources which are mmap'd from the WebKit disk cache
171         and kept alive due to caches such as the Memory Cache / PageCache.
172
173         This patch adds tracking for the number of SharedBuffer objects that are
174         backed by a CFDataRef as this should track most of the vnodes used by
175         the process. The WebContent process registers a vnode pressure handler
176         upon initialization (likely it already does for memory pressure
177         handling). This handler gets called when the process uses over 15% of
178         of system's vnode limit and the "critical" flag is set if it uses over
179         20% of the system limit. The vnode pressure handler currently calls the
180         memory pressure handler as freeing our caches (especially PageCache,
181         MemoryCache) and doing a JS GC frees up vnodes.
182
183         On iPhone 6 Plus, the system limit is at 3000, which would lead to the
184         following limits being used:
185         soft: 450 / hard: 600
186
187         However, on older hardware, the system limit can be as low as 2000,
188         which would lead to the following limits being used:
189         soft: 300 / hard: 400
190
191         vnode tracking is currently only enabled on iOS because system vnode
192         limits are usually much higher on Mac (e.g. 473695 on Mac Pro, 9984
193         on a 2011 MacBook Air) and we normally don't get killed.
194
195         * WebCore.xcodeproj/project.pbxproj:
196
197         Add new files to the XCode project.
198
199         * platform/SharedBuffer.h:
200
201         Add a VNodeTracker::Token member next to the CFDataRef member that we
202         initialize if the SharedBuffer is constructed from a CFDataRef.
203
204         * platform/VNodeTracker.cpp: Added.
205         (WebCore::VNodeTracker::singleton):
206         (WebCore::VNodeTracker::VNodeTracker):
207         (WebCore::VNodeTracker::checkPressureState):
208         (WebCore::VNodeTracker::pressureWarningTimerFired):
209         (WebCore::VNodeTracker::nextPressureWarningInterval):
210         (WebCore::VNodeTracker::platformInitialize):
211         * platform/VNodeTracker.h: Added.
212         (WebCore::VNodeTracker::setPressureHandler):
213
214         Add a new VNodeTracker singleton to keep track the number of vnodes
215         used by the process since the system does not issue warnings before
216         reaching its vnode limit. Call sites should request Tokens for
217         every vnode they use for tracking purposes. Each process can then
218         set a vnode pressure handler function that will be called when the
219         process is over the designated limits.
220
221         * platform/cf/SharedBufferCF.cpp:
222         (WebCore::SharedBuffer::SharedBuffer):
223
224         Take a VNodeToken from the VNodeTracker when constructing the
225         SharedBuffer from a CFDataRef as these usually use mmap.
226
227         * platform/cocoa/VNodeTrackerCocoa.cpp: Added.
228         (WebCore::VNodeTracker::platformInitialize):
229
230         Get the system's vnode limit and uses 15% of that value as soft
231         limit for the process and 20% of that value as hard limit.
232
233 2015-06-05  Dean Jackson  <dino@apple.com>
234
235         Lingering checkbox animations when rapidly switching between views on WK1
236         https://bugs.webkit.org/show_bug.cgi?id=145715
237         <rdar://problem/17381121>
238
239         Reviewed by Simon Fraser.
240
241         On WK1, the NSView we use for NSButtonCells is parented in the ScrollView.
242         Our checkbox and radiobutton animations cause AppKit to create a CALayer which
243         is parented into that view. As we render the animations, we see the CALayer getting
244         drawn also.
245
246         The fix was to use an unparented layer on WK1 when drawing these controls, the same
247         way WK2 does. This technique may apply to all controls, but restricting it
248         to just the buttons at the moment is less risky.
249
250         This only happens during the swap between a checked and non-checked state,
251         and we have no way to test it :(
252
253         * platform/mac/ThemeMac.h: New optional parameter to ensuredView.
254         * platform/mac/ThemeMac.mm:
255         (WebCore::paintToggleButton): If we're on Yosemite or highter, use an unparented view.
256         (WebCore::ThemeMac::ensuredView): Return either a parented or unparented view.
257
258 2015-06-05  Matt Rajca  <mrajca@apple.com>
259
260         MediaSessions should keep track of their participating media elements.
261         https://bugs.webkit.org/show_bug.cgi?id=145703
262
263         Reviewed by Eric Carlson.
264
265         * Modules/mediasession/MediaSession.cpp:
266         (WebCore::MediaSession::addMediaElement): Add the given media element to the media session.
267         (WebCore::MediaSession::removeMediaElement): Remove the given media element from the media session.
268         (WebCore::MediaSession::activeParticipatingElements): Dynamically build a vector of actively-playing media
269           elements.
270         * Modules/mediasession/MediaSession.h:
271         * html/HTMLMediaElement.cpp:
272         (WebCore::HTMLMediaElement::~HTMLMediaElement): Ensure the element is removed from its media session.
273         (WebCore::HTMLMediaElement::setSession): Update sessions' references to their media elements.
274
275 2015-06-05  Chris Dumez  <cdumez@apple.com>
276
277         Regression(r176212): Broke app switching on iCloud.com
278         https://bugs.webkit.org/show_bug.cgi?id=145708
279         <rdar://problem/21235277>
280
281         Reviewed by Simon Fraser.
282
283         Roll out r176212 and follow-up fixes for now, to fix iCloud.com.
284         We can reconsider later how to do this in a safer way.
285
286         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
287         (WebCore::JSCSSStyleDeclaration::putDelegate): Deleted.
288         (WebCore::JSCSSStyleDeclaration::getOwnPropertyNames): Deleted.
289         * dom/Element.cpp:
290         * dom/Element.h:
291         * dom/ElementRareData.cpp:
292         * dom/ElementRareData.h:
293         (WebCore::ElementRareData::ElementRareData):
294         (WebCore::ElementRareData::~ElementRareData): Deleted.
295         * dom/Node.cpp:
296         (WebCore::Node::materializeRareData):
297         * html/HTMLCanvasElement.cpp:
298         (WebCore::HTMLCanvasElement::notifyObserversCanvasChanged): Deleted.
299         * page/DOMTimer.cpp:
300         (WebCore::DOMTimerFireState::scriptMadeNonUserObservableChanges): Deleted.
301         (WebCore::DOMTimerFireState::scriptMadeUserObservableChanges): Deleted.
302         (WebCore::NestedTimersMap::instanceForContext): Deleted.
303         (WebCore::DOMTimer::install): Deleted.
304         (WebCore::DOMTimer::fired): Deleted.
305         (WebCore::DOMTimer::alignedFireTime): Deleted.
306         (WebCore::DOMTimer::activeDOMObjectName): Deleted.
307         * page/DOMTimer.h:
308         * page/FrameView.cpp:
309         (WebCore::FrameView::reset): Deleted.
310         (WebCore::FrameView::viewportContentsChanged): Deleted.
311         (WebCore::FrameView::autoSizeIfEnabled): Deleted.
312         * page/FrameView.h:
313
314 2015-06-05  Myles C. Maxfield  <mmaxfield@apple.com>
315
316         [iOS] Emoji overlap preceeding lines
317         https://bugs.webkit.org/show_bug.cgi?id=145678
318         <rdar://problem/10684914>
319
320         Reviewed by Enrica Casucci.
321
322         In WebKit, we first lay out lines, and then we lay out text inside those lines. Text is vertically centered in
323         its containing line. If the author has not specified a particular line-height, the height of a line comes from
324         the font metrics for the primary font of the line.
325
326         In iOS, we were specifically hardcoding the line height metric of Apple Color Emoji to be 0. This means that,
327         if Apple Color Emoji is the primary font for a line, and an explicit line-height was not specified, the lines
328         are laid out with 0 height. Then, when we vertically center the text inside the line, the top half of the text
329         overlaps the preceeding line.
330
331         I'm not sure exactly why were were hardcoding this value to 0, as it is surely wrong. I'm going to ask Enrica
332         to review this patch; hopefully she knows the answer.
333
334         Test: fast/text/emoji.html
335
336         * platform/graphics/cocoa/FontCocoa.mm:
337         (WebCore::Font::platformInit):
338
339 2015-06-05  Alex Christensen  <achristensen@webkit.org>
340
341         [Web Timing] Use new SPI to enable data collection.
342         https://bugs.webkit.org/show_bug.cgi?id=145650
343         rdar://problem/21203358
344
345         Reviewed by Chris Dumez.
346
347         * platform/network/cf/ResourceHandleCFNet.cpp:
348         (WebCore::ResourceHandle::createCFURLConnection):
349         Gather web timing data on iOS.
350         * platform/network/mac/ResourceHandleMac.mm:
351         (WebCore::ResourceHandle::createNSURLConnection):
352         (WebCore::ResourceHandle::setCollectsTimingData):
353         Gather web timing data on Mac.
354
355 2015-06-05  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
356
357         [Streams API] ReadableStream should store callbacks as a Deque
358         https://bugs.webkit.org/show_bug.cgi?id=145641
359
360         Reviewed by Darin Adler.
361
362         Covered by existing tests.
363
364         * Modules/streams/ReadableStream.cpp:
365         (WebCore::ReadableStream::resolveReadCallback): Use of Deque.takeFirst
366         * Modules/streams/ReadableStream.h: Using Deque in lieu of Vector for storing callbacks.
367
368 2015-06-05  Mark Lam  <mark.lam@apple.com>
369
370         finally blocks should not set the exception stack trace when re-throwing the exception.
371         https://bugs.webkit.org/show_bug.cgi?id=145525
372
373         Reviewed by Geoffrey Garen.
374
375         Update to use the new JSC::Exception object.
376
377         Test: inspector/debugger/break-on-exceptions.html
378
379         * ForwardingHeaders/runtime/Exception.h: Added.
380         * bindings/js/JSCallbackData.cpp:
381         (WebCore::JSCallbackData::invokeCallback):
382         * bindings/js/JSCustomXPathNSResolver.cpp:
383         (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
384         * bindings/js/JSDOMBinding.cpp:
385         (WebCore::jsArray):
386         (WebCore::reportException):
387         (WebCore::reportCurrentException):
388         * bindings/js/JSDOMBinding.h:
389         * bindings/js/JSErrorHandler.cpp:
390         (WebCore::JSErrorHandler::handleEvent):
391         * bindings/js/JSEventListener.cpp:
392         (WebCore::JSEventListener::handleEvent):
393         * bindings/js/JSMainThreadExecState.cpp:
394         (WebCore::JSMainThreadExecState::didLeaveScriptContext):
395         (WebCore::functionCallHandlerFromAnyThread):
396         (WebCore::evaluateHandlerFromAnyThread):
397         * bindings/js/JSMainThreadExecState.h:
398         (WebCore::JSMainThreadExecState::currentState):
399         (WebCore::JSMainThreadExecState::call):
400         (WebCore::JSMainThreadExecState::evaluate):
401         (WebCore::JSMainThreadExecState::runTask):
402
403         * bindings/js/JSMediaDevicesCustom.cpp:
404         (WebCore::JSMediaDevices::getUserMedia):
405         - Fixed a bug where the exception was not cleared before entering the VM to
406           call JS code.
407
408         * bindings/js/JSMutationCallback.cpp:
409         (WebCore::JSMutationCallback::call):
410         * bindings/js/ReadableJSStream.cpp:
411         (WebCore::getPropertyFromObject):
412         (WebCore::callFunction):
413         (WebCore::ReadableJSStream::Source::start):
414         * bindings/js/ScheduledAction.cpp:
415         (WebCore::ScheduledAction::executeFunctionInContext):
416         * bindings/js/ScriptController.cpp:
417         (WebCore::ScriptController::evaluateInWorld):
418         * bindings/js/SerializedScriptValue.cpp:
419         (WebCore::SerializedScriptValue::create):
420         (WebCore::SerializedScriptValue::deserialize):
421         * bindings/js/WorkerScriptController.cpp:
422         (WebCore::WorkerScriptController::evaluate):
423         (WebCore::WorkerScriptController::setException):
424         (WebCore::WorkerScriptController::scheduleExecutionTermination):
425         * bindings/js/WorkerScriptController.h:
426         (WebCore::WorkerScriptController::workerGlobalScopeWrapper):
427         * bindings/js/WorkerScriptDebugServer.cpp:
428         (WebCore::WorkerScriptDebugServer::runEventLoopWhilePaused):
429         (WebCore::WorkerScriptDebugServer::reportException):
430         * bindings/js/WorkerScriptDebugServer.h:
431         * bindings/objc/WebScriptObject.mm:
432         (WebCore::createJSWrapper):
433         (WebCore::addExceptionToConsole):
434         (-[WebScriptObject callWebScriptMethod:withArguments:]):
435         (-[WebScriptObject evaluateWebScript:]):
436         - Changed to call a version of JSMainThreadExecState::evaluate() that provides
437           a stub returnedException because evaluateWebScript: doesn't need the exception.
438
439         * inspector/PageScriptDebugServer.cpp:
440         (WebCore::PageScriptDebugServer::isContentScript):
441         (WebCore::PageScriptDebugServer::reportException):
442         * inspector/PageScriptDebugServer.h:
443         * workers/WorkerGlobalScope.cpp:
444         (WebCore::WorkerGlobalScope::importScripts):
445
446 2015-06-05  Eric Carlson  <eric.carlson@apple.com>
447
448         Layout tests fullscreen/video-controls-drag.html and media/video-fullscreeen-only-controls.html
449         fail on WK1 and WK2
450         https://bugs.webkit.org/show_bug.cgi?id=145675
451
452         Reviewed by Dean Jackson.
453
454         No new tests, changes covered by existing tests.
455
456         * Modules/mediacontrols/mediaControlsApple.js:
457         (Controller.prototype.updateControls): Use shouldHaveControls() to test if controls should
458           be visible.
459         (Controller.prototype.handleWrapperMouseMove): Don't return early when in fullscreen.
460         (Controller.prototype.updateFullscreenButtons): Drive-by fix: always show the (exit) fullscreen
461           button when in fullscreen.
462           
463
464 2015-06-04  David Hyatt  <hyatt@apple.com>
465
466         Underlines too close in vertical Chinese text.
467         https://bugs.webkit.org/show_bug.cgi?id=145651
468         <rdar://problem/11105920>
469
470         Reviewed by Simon Fraser.
471
472         Added fast/text/decorations-vertical-underline.html
473
474         * style/InlineTextBoxStyle.cpp:
475         (WebCore::computeUnderlineOffset):
476         Make sure the to map text-underline-position: auto to under when a line has an ideographic baseline.
477
478 2015-06-05  Carlos Alberto Lopez Perez  <clopez@igalia.com>
479
480         [GTK] [Wayland] The MiniBrowser crashes inside Weston.
481         https://bugs.webkit.org/show_bug.cgi?id=145645
482
483         Reviewed by Žan Doberšek.
484
485         No new tests, no behavior changes.
486
487         The issue was caused because we were not properly initializing the
488         Wayland display, and we were returning a nullptr in PlatformDisplayWayland::create(),
489         therefore a crash was happening on WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp:1136
490         <http://trac.webkit.org/browser/trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp?rev=185245#L1136>
491
492         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
493         (WebCore::PlatformDisplayWayland::create): When connecting to the Wayland
494         server socket we should use the default value (NULL). This allows the value
495         to be overwritten at run-time by the environment variables WAYLAND_DISPLAY or
496         WAYLAND_SOCKET that the Wayland compositor should define. Also add a couple
497         of warnings to get information about what is going wrong when we fail to
498         initialize the display instead of just crashing without giving more information.
499         * platform/graphics/wayland/PlatformDisplayWayland.h:
500         (WebCore::PlatformDisplayWayland::isInitialized): Not longer check for m_webkitgtk
501         to signal that the display is ready because the UIProcess embedded Wayland
502         subcompositer is still not implemented. Added a FIXME note about it.
503
504 2015-06-05  Dean Jackson  <dino@apple.com>
505
506         [Mac] Popup focus is cut off
507         https://bugs.webkit.org/show_bug.cgi?id=145688
508         <rdar://problem/18313375>
509
510         Reviewed by Brent Fulgham.
511
512         Yosemite increased the width of focus rings, causing
513         some ugly clipping on Yosemite. The solution was to
514         not set a clip (which was code introduced for Leopard).
515
516         Test: fast/forms/select-element-focus-ring.html
517
518         * rendering/RenderThemeMac.mm:
519         (WebCore::RenderThemeMac::paintMenuList): Don't clip on Yosemite.
520
521 2015-06-05  Manuel Rego Casasnovas  <rego@igalia.com>
522
523         [CSS Grid Layout] Support dots sequences in grid-template-areas
524         https://bugs.webkit.org/show_bug.cgi?id=145693
525
526         Reviewed by Sergio Villar Senin.
527
528         The CSS WG agreed to consider a sequence of "." characters a single null
529         cell token for grid-template-areas. That way authors can match the
530         number of dots to the width of the column.
531
532         For more information see:
533         https://lists.w3.org/Archives/Public/www-style/2015May/0175.html
534
535         Added new test cases to check the new behavior.
536
537         * css/CSSParser.cpp:
538         (WebCore::containsOnlyDots): New helper function to check that the grid
539         area name is composed by only dots.
540         (WebCore::CSSParser::parseGridTemplateAreasRow): Use the new helper
541         function to look for unnamed areas.
542
543 2015-06-04  Joonghun Park  <jh718.park@samsung.com>
544
545         Purge PassRefPtr create() factory functions in WebCore/css
546         https://bugs.webkit.org/show_bug.cgi?id=144905
547
548         Reviewed by Darin Adler.
549
550         Return Ref instead of PassRefPtr in create() factory functions in css,
551         because the factory can't return null.
552
553         No new tests, no new behaviours.
554
555         * css/BasicShapeFunctions.cpp:
556         (WebCore::valueForCenterCoordinate):
557         (WebCore::basicShapeRadiusToCSSValue):
558         (WebCore::valueForBasicShape):
559         * css/BasicShapeFunctions.h:
560         * css/CSSBasicShapes.h:
561         * css/CSSCalculationValue.cpp:
562         (WebCore::createCSS):
563         (WebCore::CSSCalcValue::create):
564         * css/CSSCalculationValue.h:
565         * css/CSSCharsetRule.h:
566         * css/CSSComputedStyleDeclaration.cpp:
567         (WebCore::valueForNinePieceImageSlice):
568         (WebCore::valueForNinePieceImageQuad):
569         (WebCore::zoomAdjustedPixelValue):
570         (WebCore::zoomAdjustedNumberValue):
571         (WebCore::zoomAdjustedPixelValueForLength):
572         (WebCore::valueForReflection):
573         (WebCore::createPositionListForLayer):
574         (WebCore::positionOffsetValue):
575         (WebCore::percentageOrZoomAdjustedValue):
576         (WebCore::autoOrZoomAdjustedValue):
577         (WebCore::getBorderRadiusCornerValues):
578         (WebCore::getBorderRadiusCornerValue):
579         (WebCore::getBorderRadiusShorthandValue):
580         (WebCore::matrixTransformValue):
581         (WebCore::computedTransform):
582         (WebCore::adjustLengthForZoom):
583         (WebCore::ComputedStyleExtractor::valueForShadow):
584         (WebCore::ComputedStyleExtractor::valueForFilter):
585         (WebCore::specifiedValueForGridTrackBreadth):
586         (WebCore::specifiedValueForGridTrackSize):
587         (WebCore::valueForGridTrackList):
588         (WebCore::scrollSnapDestination):
589         (WebCore::scrollSnapPoints):
590         (WebCore::scrollSnapCoordinates):
591         (WebCore::createAnimationTriggerValue):
592         (WebCore::getAnimationTriggerValue):
593         (WebCore::ComputedStyleExtractor::getFontSizeCSSValuePreferringKeyword):
594         (WebCore::fillSizeToCSSValue):
595         (WebCore::lineHeightFromStyle):
596         (WebCore::fontSizeFromStyle):
597         (WebCore::zoomAdjustedPaddingOrMarginPixelValue):
598         (WebCore::shapePropertyValue):
599         (WebCore::ComputedStyleExtractor::propertyValue):
600         * css/CSSComputedStyleDeclaration.h:
601         * css/CSSFontFace.h:
602         (WebCore::CSSFontFace::create):
603         * css/CSSFontFaceLoadEvent.h:
604         * css/CSSFontFaceRule.h:
605         * css/CSSGrammar.y.in:
606         * css/CSSGridLineNamesValue.cpp:
607         (WebCore::CSSGridLineNamesValue::cloneForCSSOM):
608         * css/CSSGridLineNamesValue.h:
609         (WebCore::CSSGridLineNamesValue::create):
610         * css/CSSImportRule.h:
611         * css/CSSKeyframeRule.h:
612         (WebCore::StyleKeyframe::create):
613         * css/CSSKeyframesRule.h:
614         * css/CSSMediaRule.h:
615         * css/CSSPageRule.h:
616         * css/CSSParser.cpp:
617         (WebCore::CSSParser::parseGridLineNames):
618         (WebCore::CSSParser::parseDashboardRegions):
619         (WebCore::CSSParser::parseClipShape):
620         (WebCore::CSSParser::parseBasicShape):
621         (WebCore::BorderImageSliceParseContext::commitBorderImageSlice):
622         (WebCore::BorderImageQuadParseContext::commitBorderImageQuad):
623         * css/CSSParser.h:
624         (WebCore::CSSParser::ValueWithCalculation::calculation):
625         * css/CSSPrimitiveValue.cpp:
626         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
627         (WebCore::CSSPrimitiveValue::init):
628         (WebCore::CSSPrimitiveValue::cloneForCSSOM):
629         * css/CSSPrimitiveValue.h:
630         (WebCore::CSSPrimitiveValue::create):
631         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
632         * css/CSSPropertySourceData.h:
633         (WebCore::CSSStyleSourceData::create):
634         (WebCore::CSSRuleSourceData::create):
635         (WebCore::CSSRuleSourceData::createUnknown):
636         * css/CSSRuleList.h:
637         * css/CSSSegmentedFontFace.h:
638         (WebCore::CSSSegmentedFontFace::create):
639         * css/CSSSelector.cpp:
640         (WebCore::CSSSelector::createRareData):
641         * css/CSSSelector.h:
642         (WebCore::CSSSelector::RareData::create):
643         * css/CSSStyleRule.h:
644         * css/CSSSupportsRule.h:
645         * css/CSSValuePool.h:
646         (WebCore::CSSValuePool::createValue):
647         * css/FontLoader.cpp:
648         (WebCore::LoadFontCallback::create):
649         * css/LengthRepeat.h:
650         (WebCore::LengthRepeat::create):
651         (WebCore::LengthRepeat::cloneForCSSOM):
652         * css/MediaList.h:
653         (WebCore::MediaQuerySet::create):
654         (WebCore::MediaQuerySet::createAllowingDescriptionSyntax):
655         (WebCore::MediaList::create):
656         * css/MediaQueryList.cpp:
657         (WebCore::MediaQueryList::create):
658         * css/MediaQueryList.h:
659         * css/MediaQueryMatcher.h:
660         (WebCore::MediaQueryMatcher::create):
661         * css/Pair.h:
662         (WebCore::Pair::create):
663         * css/Rect.h:
664         (WebCore::Rect::create):
665         (WebCore::Rect::cloneForCSSOM):
666         (WebCore::Quad::create):
667         (WebCore::Quad::cloneForCSSOM):
668         * css/SVGCSSComputedStyleDeclaration.cpp:
669         (WebCore::paintOrder):
670         (WebCore::ComputedStyleExtractor::svgPropertyValue):
671         * css/StyleMedia.h:
672         (WebCore::StyleMedia::create):
673         * css/StyleResolver.cpp:
674         (WebCore::StyleResolver::keyframeStylesForAnimation):
675         * css/StyleSheetList.h:
676         (WebCore::StyleSheetList::create):
677         * css/ViewportStyleResolver.h:
678         (WebCore::ViewportStyleResolver::create):
679         * css/WebKitCSSMatrix.h:
680         * css/WebKitCSSRegionRule.h:
681         * css/WebKitCSSViewportRule.h:
682         * page/animation/CSSPropertyAnimation.cpp:
683         (WebCore::blendFilter):
684         * rendering/style/RenderStyle.h:
685         (WebCore::adjustFloatForAbsoluteZoom):
686         * rendering/style/StyleInheritedData.h:
687
688 2015-06-04  Benjamin Poulain  <bpoulain@apple.com>
689
690         The last 2 merged DFAs are not minimized by DFACombiner
691
692         * contentextensions/DFACombiner.cpp:
693         (WebCore::ContentExtensions::DFACombiner::combineDFAs):
694         I introduced a bug when I made minimization conditional: the last merge
695         does not minimize if we do not reach the minimum size.
696
697 2015-06-04  Brent Fulgham  <bfulgham@apple.com>
698
699         Latching algorithm in findEnclosingOverflowScroll is broken
700         https://bugs.webkit.org/show_bug.cgi?id=145642
701         <rdar://problem/21242308>
702
703         Reviewed by Simon Fraser.
704
705         Test: platform/mac-wk2/tiled-drawing/scrolling/iframe_in_iframe.html
706
707         * page/mac/EventHandlerMac.mm:
708         (WebCore::scrollableAreaForBox): Added helper function.
709         (WebCore::findEnclosingScrollableContainer): Renamed from findEnclosingOverflowScroll.
710         Only identify something as our scroll element if it can be scrolled in either
711         axis of the gesture's motion.
712         (WebCore::scrollableAreaForContainerNode): Use new helper function.
713         (WebCore::EventHandler::platformPrepareForWheelEvents): Use new function
714         name, and pass horizontal and vertical deltas.
715         (WebCore::findEnclosingOverflowScroll): Deleted.
716
717 2015-06-04  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
718
719         REGRESSION(r185091): Crash happens on indexdb tests
720         https://bugs.webkit.org/show_bug.cgi?id=145549
721
722         Reviewed by Darin Adler.
723
724         * Modules/indexeddb/IDBDatabaseError.h:
725         (WebCore::IDBDatabaseError::create): Revert Ref usage of IDBDatabaseError::create().
726
727 2015-06-04  Simon Fraser  <simon.fraser@apple.com>
728
729         Crash in EventDispatcher::dispatchEvent entering a location on Google Maps
730         https://bugs.webkit.org/show_bug.cgi?id=145677
731         rdar://problem/20698280
732
733         Reviewed by Dean Jackson.
734
735         If a transition is running on a pseudo-element, and the host element is removed
736         from the DOM just as the transition ends, and there is a transition event listener,
737         then we'd crash with a null dereference in event dispatch code.
738         
739         AnimationController tries to clean up running animations when renderers are destroyed,
740         but omitted to remove the element from two vectors that store element references.
741         Elements are only added to these vectors briefly on animation end, before firing
742         events, but failure to remove the vector entries could result in attempting
743         to fire an event on a pseudo-element with no host element.
744         
745         Also convert EventDispatcher code to be more robust to potentially null event
746         targets, since it's not clear that eventTargetRespectingTargetRules() can always
747         manage to return a non-null node.
748         
749         Hard to make a test because this is timing sensitive.
750
751         * dom/EventDispatcher.cpp:
752         (WebCore::eventTargetRespectingTargetRules):
753         (WebCore::EventDispatcher::dispatchScopedEvent):
754         (WebCore::EventDispatcher::dispatchEvent):
755         (WebCore::EventPath::EventPath):
756         * page/animation/AnimationController.cpp:
757         (WebCore::AnimationControllerPrivate::clear):
758
759 2015-06-04  Hunseop Jeong  <hs85.jeong@samsung.com>
760
761         Replace 0 with nullptr in WebCore/Page.
762         https://bugs.webkit.org/show_bug.cgi?id=145631
763
764         Reviewed by Darin Adler.
765
766         No new tests, no behavior changes.
767
768         * page/AutoscrollController.cpp:
769         (WebCore::AutoscrollController::AutoscrollController):
770         (WebCore::AutoscrollController::stopAutoscrollTimer):
771         * page/ContentSecurityPolicy.cpp:
772         (WebCore::CSPSourceList::parseSource):
773         * page/ContentSecurityPolicy.h:
774         * page/ContextMenuController.cpp:
775         (WebCore::ContextMenuController::clearContextMenu):
776         * page/DOMSelection.cpp:
777         (WebCore::DOMSelection::clearTreeScope):
778         * page/DOMWindow.cpp:
779         (WebCore::DOMWindow::resetDOMWindowProperties):
780         (WebCore::DOMWindow::localStorage):
781         (WebCore::DOMWindow::focus):
782         * page/DOMWindow.h:
783         * page/DOMWindowExtension.cpp:
784         (WebCore::DOMWindowExtension::reconnectFrameFromPageCache):
785         (WebCore::DOMWindowExtension::willDestroyGlobalObjectInCachedFrame):
786         * page/DOMWindowProperty.cpp:
787         (WebCore::DOMWindowProperty::DOMWindowProperty):
788         (WebCore::DOMWindowProperty::~DOMWindowProperty):
789         (WebCore::DOMWindowProperty::disconnectFrameForPageCache):
790         (WebCore::DOMWindowProperty::willDestroyGlobalObjectInCachedFrame):
791         (WebCore::DOMWindowProperty::willDestroyGlobalObjectInFrame):
792         * page/DragController.cpp:
793         (WebCore::DragController::dragEnded):
794         (WebCore::DragController::performDragOperation):
795         (WebCore::DragController::tryDocumentDrag):
796         (WebCore::DragController::concludeEditDrag):
797         (WebCore::DragController::startDrag):
798         * page/EventHandler.cpp:
799         (WebCore::EventHandler::EventHandler):
800         (WebCore::EventHandler::resizeLayerDestroyed):
801         (WebCore::EventHandler::freeDataTransfer):
802         (WebCore::EventHandler::dragSourceEndedAt):
803         (WebCore::EventHandler::handleDrag):
804         * page/EventHandler.h:
805         * page/FocusController.cpp:
806         (WebCore::FocusController::advanceFocusInDocumentOrder):
807         * page/Frame.cpp:
808         (WebCore::Frame::~Frame):
809         (WebCore::Frame::searchForLabelsBeforeElement):
810         (WebCore::Frame::willDetachPage):
811         (WebCore::Frame::createView):
812         * page/Frame.h:
813         (WebCore::Frame::detachFromPage):
814         * page/FrameDestructionObserver.cpp:
815         (WebCore::FrameDestructionObserver::FrameDestructionObserver):
816         (WebCore::FrameDestructionObserver::~FrameDestructionObserver):
817         (WebCore::FrameDestructionObserver::frameDestroyed):
818         * page/FrameTree.cpp:
819         (WebCore::FrameTree::~FrameTree):
820         (WebCore::FrameTree::removeChild):
821         * page/FrameTree.h:
822         (WebCore::FrameTree::FrameTree):
823         (WebCore::FrameTree::detachFromParent):
824         * page/History.cpp:
825         (WebCore::History::History):
826         * page/Page.cpp:
827         (WebCore::Page::Page):
828         (WebCore::Page::~Page):
829         (WebCore::Page::findStringMatchingRanges):
830         * page/PageGroup.cpp:
831         * page/Performance.cpp:
832         (WebCore::Performance::Performance):
833         * page/PointerLockController.cpp:
834         (WebCore::PointerLockController::didLosePointerLock):
835         (WebCore::PointerLockController::clearElement):
836         * page/SecurityOrigin.h:
837         (WebCore::SecurityOrigin::canAccessDatabase):
838         * page/Settings.cpp:
839         (WebCore::Settings::Settings):
840         * page/SpatialNavigation.cpp:
841         (WebCore::FocusCandidate::FocusCandidate):
842         * page/SpatialNavigation.h:
843         (WebCore::FocusCandidate::FocusCandidate):
844         * page/scrolling/ScrollingTreeNode.cpp:
845         (WebCore::ScrollingTreeNode::ScrollingTreeNode):
846         * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
847         (WebCore::ScrollingCoordinatorCoordinatedGraphics::willDestroyScrollableArea):
848
849 2015-06-04  Benjamin Poulain  <bpoulain@apple.com>
850
851         Combine tiny DFAs into slightly larger ones
852         https://bugs.webkit.org/show_bug.cgi?id=145572
853
854         Reviewed by Alex Christensen.
855
856         This patch changes the ContentExtensions compiler to combine tiny DFA
857         until they reach a minimum size.
858
859         The main tool introduced here is DFAMerger. It combines 2 DFAs into
860         a single DFA that represent the union of the two machines.
861         That is done by a simple subset construction on the "name" of the nodes
862         in each DFAs.
863
864         Since we only merge 2 machines, and they are both deterministic, we know that
865         we can only be in one state of each machine, or a state in one machine without
866         equivalent in the other machine.
867         We exploit that to identify the mapping between nodes. To identify a node in
868         the new machine from nodes in the original machines, we just concatenate the node
869         IDs into a single 64 bits number. If there is no node in one of the machine, we
870         use a special tag.
871
872         The current algorithm does not have any subgraph pruning, machines grow very very
873         quickly. Because of that, we only merge very small DFAs at the moment.
874
875         Test: http/tests/contentextensions/filters-with-quantifiers-combined.html
876
877         * WebCore.xcodeproj/project.pbxproj:
878         * contentextensions/ContentExtensionCompiler.cpp:
879         (WebCore::ContentExtensions::compileRuleList):
880         * contentextensions/ContentExtensionsDebugging.h:
881         * contentextensions/DFA.cpp:
882         (WebCore::ContentExtensions::DFA::graphSize):
883         (WebCore::ContentExtensions::DFA::debugPrintDot):
884         * contentextensions/DFA.h:
885         * contentextensions/DFACombiner.cpp: Added.
886         (WebCore::ContentExtensions::DFAMerger::DFAMerger):
887         (WebCore::ContentExtensions::DFAMerger::merge):
888         (WebCore::ContentExtensions::DFAMerger::signatureForIndices):
889         (WebCore::ContentExtensions::DFAMerger::extractIndexA):
890         (WebCore::ContentExtensions::DFAMerger::extractIndexB):
891         (WebCore::ContentExtensions::DFAMerger::getOrCreateCombinedNode):
892         (WebCore::ContentExtensions::DFAMerger::setHalfSignature):
893         (WebCore::ContentExtensions::DFAMerger::populateTransitions):
894         (WebCore::ContentExtensions::DFAMerger::populateFromFallbackTransitions):
895         (WebCore::ContentExtensions::DFAMerger::createTransitions):
896         (WebCore::ContentExtensions::DFAMerger::createFallbackTransitionIfNeeded):
897         (WebCore::ContentExtensions::DFACombiner::combineDFAs):
898         * contentextensions/DFACombiner.h: Copied from Source/WebCore/contentextensions/DFA.h.
899         (WebCore::ContentExtensions::DFACombiner::addDFA):
900
901 2015-06-04  Matt Rajca  <mrajca@apple.com>
902
903         Rename MediaSessionManager to PlatformMediaSessionManager for consistency with PlatformMediaSession.
904         https://bugs.webkit.org/show_bug.cgi?id=145648
905
906         Reviewed by Eric Carlson.
907
908         * WebCore.vcxproj/WebCore.vcxproj:
909         * WebCore.vcxproj/WebCore.vcxproj.filters:
910         * WebCore.xcodeproj/project.pbxproj:
911         * html/HTMLMediaElement.cpp:
912         * html/MediaElementSession.cpp:
913         (WebCore::MediaElementSession::effectivePreloadForElement):
914         (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
915         * platform/audio/PlatformMediaSession.cpp:
916         (WebCore::PlatformMediaSession::PlatformMediaSession):
917         (WebCore::PlatformMediaSession::~PlatformMediaSession):
918         (WebCore::PlatformMediaSession::clientWillBeginPlayback):
919         (WebCore::PlatformMediaSession::clientWillPausePlayback):
920         (WebCore::PlatformMediaSession::clientDataBufferingTimerFired):
921         (WebCore::PlatformMediaSession::updateClientDataBuffering):
922         * platform/audio/PlatformMediaSessionManager.cpp: Renamed from Source/WebCore/platform/audio/MediaSessionManager.cpp.
923         (WebCore::PlatformMediaSessionManager::sharedManager):
924         (WebCore::PlatformMediaSessionManager::PlatformMediaSessionManager):
925         (WebCore::PlatformMediaSessionManager::resetRestrictions):
926         (WebCore::PlatformMediaSessionManager::has):
927         (WebCore::PlatformMediaSessionManager::activeAudioSessionRequired):
928         (WebCore::PlatformMediaSessionManager::count):
929         (WebCore::PlatformMediaSessionManager::beginInterruption):
930         (WebCore::PlatformMediaSessionManager::endInterruption):
931         (WebCore::PlatformMediaSessionManager::addSession):
932         (WebCore::PlatformMediaSessionManager::removeSession):
933         (WebCore::PlatformMediaSessionManager::addRestriction):
934         (WebCore::PlatformMediaSessionManager::removeRestriction):
935         (WebCore::PlatformMediaSessionManager::restrictions):
936         (WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback):
937         (WebCore::PlatformMediaSessionManager::sessionWillEndPlayback):
938         (WebCore::PlatformMediaSessionManager::setCurrentSession):
939         (WebCore::PlatformMediaSessionManager::currentSession):
940         (WebCore::PlatformMediaSessionManager::sessionRestrictsInlineVideoPlayback):
941         (WebCore::PlatformMediaSessionManager::sessionCanLoadMedia):
942         (WebCore::PlatformMediaSessionManager::applicationWillEnterBackground):
943         (WebCore::PlatformMediaSessionManager::applicationWillEnterForeground):
944         (WebCore::PlatformMediaSessionManager::updateSessionState):
945         (WebCore::PlatformMediaSessionManager::didReceiveRemoteControlCommand):
946         (WebCore::PlatformMediaSessionManager::systemWillSleep):
947         (WebCore::PlatformMediaSessionManager::systemDidWake):
948         (WebCore::PlatformMediaSessionManager::audioOutputDeviceChanged):
949         * platform/audio/PlatformMediaSessionManager.h: Renamed from Source/WebCore/platform/audio/MediaSessionManager.h.
950         (WebCore::PlatformMediaSessionManager::~PlatformMediaSessionManager):
951         (WebCore::PlatformMediaSessionManager::configureWireLessTargetMonitoring):
952         (WebCore::PlatformMediaSessionManager::hasWirelessTargetsAvailable):
953         (WebCore::PlatformMediaSessionManager::sessions):
954         * platform/audio/mac/AudioDestinationMac.cpp:
955         * platform/audio/mac/MediaSessionManagerMac.cpp:
956         (PlatformMediaSessionManager::updateSessionState):
957         (MediaSessionManager::updateSessionState): Deleted.
958         * testing/Internals.cpp:
959
960 2015-06-04  Eric Carlson  <eric.carlson@apple.com>
961
962         [Mac] Don't show default controls after playing to wireless target, again
963         https://bugs.webkit.org/show_bug.cgi?id=145620
964         <rdar://problem/21145806>
965
966         Reviewed by Dean Jackson.
967
968         Follow up to fix two tests broken by r185207.
969
970         * Modules/mediacontrols/mediaControlsApple.js:
971         (Controller.prototype.updateControls): Always show controls when the video element
972           is the fullscreen element because custom controls aren't possible.
973
974 2015-06-04  Myles C. Maxfield  <mmaxfield@apple.com>
975
976         [Cocoa] Add ASSERT to FontPlatformData::ctFont()
977         https://bugs.webkit.org/show_bug.cgi?id=145659
978
979         Reviewed by Dean Jackson.
980
981         The new ASSERT needs to be guarded with CORETEXT_WEB_FONTS, which is defined in FontCustomPlatformData.h,
982         and is not accessible to FontPlatformData. Therefore, I've moved the definition into TextFlags.h, which
983         both files include.
984
985         No new tests because there is no behavior change.
986
987         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
988         (WebCore::FontPlatformData::ctFont): Add the ASSERT.
989         * platform/graphics/mac/FontCustomPlatformData.h: Move the CORETEXT_WEB_FONTS preprocessor
990         macro from here ...
991         * platform/text/TextFlags.h: ... to here.
992
993 2015-06-04  Commit Queue  <commit-queue@webkit.org>
994
995         Unreviewed, rolling out r185208.
996         https://bugs.webkit.org/show_bug.cgi?id=145655
997
998         platform/mac-wk2/tiled-drawing/scrolling/fast-scroll-iframe-
999         latched-select.html (Requested by shallawa on #webkit).
1000
1001         Reverted changeset:
1002
1003         "Latching algorithm in findEnclosingOverflowScroll is broken"
1004         https://bugs.webkit.org/show_bug.cgi?id=145642
1005         http://trac.webkit.org/changeset/185208
1006
1007 2015-06-04  Myles C. Maxfield  <mmaxfield@apple.com>
1008
1009         [Cocoa] Remove unnecessary code from FontPlatformData::ctFont()
1010         https://bugs.webkit.org/show_bug.cgi?id=145652
1011
1012         Hoefler Text Italic no longer has initial and final swashes by default, so there
1013         is no reason to explicitly disable them.
1014
1015         Reviewed by Andreas Kling.
1016
1017         No new tests because there is no behavior change.
1018
1019         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1020         (WebCore::FontPlatformData::ctFont):
1021         (WebCore::createFeatureSettingDictionary): Deleted.
1022         (WebCore::cascadeToLastResortAndDisableSwashesFontDescriptor): Deleted.
1023
1024 2015-06-04  Brent Fulgham  <bfulgham@apple.com>
1025
1026         Latching algorithm in findEnclosingOverflowScroll is broken
1027         https://bugs.webkit.org/show_bug.cgi?id=145642
1028         <rdar://problem/21242308>
1029
1030         Reviewed by Simon Fraser.
1031
1032         Test: platform/mac-wk2/tiled-drawing/scrolling/iframe_in_iframe.html
1033
1034         * page/mac/EventHandlerMac.mm:
1035         (WebCore::findEnclosingOverflowScrollForDominantDirection): Renamed from
1036         'findEnclosingOverflowScroll'. Only identify element as our overflow
1037         scroll element if it can be scrolled in either axis of the gesture's
1038         motion.
1039         (WebCore::scrolledToEdgeInDominantDirection): Renamed.
1040         (WebCore::EventHandler::platformPrepareForWheelEvents): Use new function
1041         name, and pass horizontal and vertical deltas.
1042         (WebCore::findEnclosingOverflowScroll): Deleted.
1043
1044 2015-06-04  Eric Carlson  <eric.carlson@apple.com>
1045
1046         [Mac] Don't show default controls after playing to wireless target, again
1047         https://bugs.webkit.org/show_bug.cgi?id=145620
1048         <rdar://problem/21145806>
1049
1050         Reviewed by Dean Jackson.
1051
1052         * Modules/mediacontrols/mediaControlsApple.js:
1053         (Controller.prototype.updateControls): Show or hide the panel as appropriate.
1054         (Controller.prototype.handleWrapperMouseMove): Early return if !video.controls.
1055         (Controller.prototype.addControls): Call updateControls instead of this.setNeedsTimelineMetricsUpdate
1056           so all needed setup is done.
1057         (Controller.prototype.resetHideControlsTimer): Only start the hide timer if playing.
1058
1059 2015-06-04  Chris Dumez  <cdumez@apple.com>
1060
1061         [WK2] Prune more resources from the MemoryCache before process suspension
1062         https://bugs.webkit.org/show_bug.cgi?id=145633
1063
1064         Reviewed by Andreas Kling.
1065
1066         Prune more resources from the MemoryCache before process suspension or
1067         on simulated memory warning by doing a synchronous JS garbage collection
1068         and sweep *before* pruning dead resources from the memory cache.
1069         Previously, we would do the garbage collection after pruning the
1070         MemoryCache which meant that a lot of resources became dead after we
1071         tried to prune them.
1072
1073         At the end a basic browsing on apple.com, we are able to remove ~17%
1074         more resources from the MemoryCache on simulated memory warning with this
1075         change.
1076
1077         Pruning as much as we can from the memory cache on critical memory
1078         pressure or before process suspension is not only useful to free up
1079         memory but also to make room in the vnode table as a lot of
1080         CachedResources are mmmap'd from the network disk cache.
1081
1082         * platform/MemoryPressureHandler.cpp:
1083         (WebCore::MemoryPressureHandler::MemoryPressureHandler):
1084         (WebCore::MemoryPressureHandler::releaseCriticalMemory):
1085
1086         - Pass 'synchronous' argument so that we know if we need to do a
1087           synchronous JS garbage collection.
1088         - Move here code from in the Cocoa handler that is doing a JS garbage
1089           collection as well as a sweep, and make this code cross-platform.
1090           This code used to be iOS specific but I see no reason we shouldn't
1091           do this on Mac.
1092
1093         (WebCore::MemoryPressureHandler::releaseMemory):
1094         * platform/MemoryPressureHandler.h:
1095
1096         Use enum class arguments for critical / synchronous. The 'synchronous'
1097         argument is new so that the call site can let us know if memory needs
1098         to be freed synchronously (e.g. in case of imminent process suspension).
1099
1100         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
1101         (WebCore::MemoryPressureHandler::platformReleaseMemory):
1102
1103         Remove iOS-specific code that was doing a JS garbage collection and
1104         sweep as this code is now in the generic memory pressure handler.
1105
1106         (WebCore::MemoryPressureHandler::install):
1107
1108         On simulated memory pressure, set 'synchronous' argument to Yes so that
1109         a synchronous GC is done by the generic memory pressure handler. This
1110         way, we no longer need to do a sync GC after calling the memory pressure
1111         handler. This avoids code duplication and makes sure the GC is done
1112         before pruning the memory cache.
1113
1114
1115 2015-06-04  Myles C. Maxfield  <mmaxfield@apple.com>
1116
1117         [Cocoa] Clean up m_isEmoji in FontPlatformData
1118         https://bugs.webkit.org/show_bug.cgi?id=145644
1119
1120         Reviewed by Andreas Kling.
1121
1122         m_isEmoji used to be a public member variable only defined on iOS. This
1123         means that, whenever it was consulted, the sites were surrounded by
1124         PLATFORM(IOS) guards. A cleaner design is to use a getter and setter,
1125         which on non-iOS platforms, always return false / do nothing. Then, the
1126         use sites can just use these functions without having ugly guards.
1127
1128         No new tests because there is no behavior change.
1129
1130         * platform/graphics/FontPlatformData.h:
1131         (WebCore::FontPlatformData::hash): Simplify isEmoji use site.
1132         (WebCore::FontPlatformData::isEmoji): Getter. Returns false on Mac.
1133         (WebCore::FontPlatformData::setIsEmoji): Setter. Does nothing on Mac.
1134         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1135         (WebCore::pointAdjustedForEmoji): Simplify isEmoji use site.
1136         (WebCore::FontCascade::drawGlyphs): Ditto.
1137         * platform/graphics/cocoa/FontCocoa.mm:
1138         (WebCore::Font::platformInit): Ditto.
1139         (WebCore::canUseFastGlyphAdvanceGetter): Ditto.
1140         (WebCore::isEmoji): Deleted.
1141         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1142         (WebCore::FontPlatformData::platformDataInit): Simplify isEmoji use
1143         site.
1144         (WebCore::FontPlatformData::platformDataAssign): Ditto.
1145         (WebCore::FontPlatformData::platformIsEqual): Ditto.
1146         (WebCore::FontPlatformData::ctFontSize): Ditto.
1147         * platform/graphics/ios/FontCacheIOS.mm:
1148         (WebCore::FontCache::getSystemFontFallbackForCharacters): Ditto.
1149         (WebCore::FontCache::createFontPlatformData): Ditto.
1150         * platform/graphics/mac/ComplexTextController.cpp:
1151         (WebCore::ComplexTextController::adjustGlyphsAndAdvances): Ditto.
1152
1153 2015-06-03  Brent Fulgham  <bfulgham@apple.com>
1154
1155         REGRESSION (r181879): Scrolling order on pages with focused iframe is broken.
1156         https://bugs.webkit.org/show_bug.cgi?id=145637
1157         <rdar://problem/20635581>
1158
1159         Reviewed by Zalan Bujtas.
1160
1161         Test: platform/mac-wk2/tiled-drawing/scrolling/iframe_in_iframe.html
1162
1163         This page revealed a bug in our RenderBox code caused by the mismatch between
1164         our scrolling units, which are all integrally snapped, with our client height
1165         and widths, which are not snapped at all. 
1166         
1167         In certain cases, the client height would have a small subpixel difference compared
1168         to the scroll height, which would cause WebKit to believe it was scrollable. When
1169         this happened, it would get stuck latched to this element and block scrolling events. 
1170
1171         * page/Frame.cpp:
1172         (WebCore::Frame::scrollOverflowLayer): Use roundToInt for clientWidth and clientHeight,
1173         rather than integer truncation.
1174         * rendering/RenderBox.cpp:
1175         (WebCore::RenderBox::canBeScrolledAndHasScrollableArea): Need to round clientWidth
1176         and clientHeight to compare with scrollWidth/scrollHeight.
1177         * rendering/RenderBox.h:
1178         (WebCore::RenderBox::hasScrollableOverflowX): Ditto.
1179         (WebCore::RenderBox::hasScrollableOverflowY): Ditto.
1180         * rendering/RenderMarquee.cpp:
1181         (WebCore::RenderMarquee::computePosition): Use roundToInt for clientWidth and
1182         clientHeight, rather than integer truncation.
1183
1184 2015-06-04  Myles C. Maxfield  <mmaxfield@apple.com>
1185
1186         [Cocoa] Clean up m_font inside FontPlatformData
1187         https://bugs.webkit.org/show_bug.cgi?id=145634
1188
1189         Reviewed by Andreas Kling.
1190
1191         FontPlatformDatas are used as keys in a HashMap. This means that they need
1192         to be able to represent a "deleted" value. Previously, this "deleted" value
1193         was represented as setting the pointer value of m_font to -1, and guarding
1194         all uses of m_font to make sure it wasn't -1 before dereferencing it.
1195
1196         This patch simplifies FontPlatformData to represent a "deleted" value using
1197         a separate boolean member variable. This class is already big enough that
1198         the increased space is negligable (the class already contains two CoreText
1199         fonts in addition to a CoreGraphics font). Because of this simplification,
1200         m_font can now be a RetainPtr, instead of being manually retained and
1201         released.
1202
1203         There is still a long way to go before FontPlatformData is acceptably
1204         clean and understandable. This patch improves one aspect of it, and more
1205         improvements will eventually follow.
1206
1207         No new tests because there is no behavior change.
1208
1209         * platform/graphics/FontCache.cpp: Remove unused variable.
1210         * platform/graphics/FontPlatformData.cpp:
1211         (WebCore::FontPlatformData::FontPlatformData): Clean up all the PLATFORM
1212         macros in favor of a single bool. Also, update to include new state.
1213         (WebCore::FontPlatformData::operator=): Update to include new state.
1214         * platform/graphics/FontPlatformData.h:
1215         (WebCore::FontPlatformData::font): Update to account for RetainPtr.
1216         (WebCore::FontPlatformData::nsFont): Ditto.
1217         (WebCore::FontPlatformData::setNSFont): Ditto.
1218         (WebCore::FontPlatformData::hash): Update to include new state.
1219         (WebCore::FontPlatformData::operator==): Ditto.
1220         (WebCore::FontPlatformData::isHashTableDeletedValue): Use new state.
1221         (WebCore::FontPlatformData::hashTableDeletedFontValue): Deleted.
1222         (WebCore::FontPlatformData::isValidCTFontRef): Deleted.
1223         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1224         (WebCore::FontPlatformData::platformDataInit): No need for manual retain
1225         and release.
1226         (WebCore::FontPlatformData::platformDataAssign): Ditto.
1227         (WebCore::FontPlatformData::platformIsEqual): Update to account for
1228         RetanPtr.
1229         (WebCore::FontPlatformData::setFont): No need for manual retain and
1230         release.
1231         (WebCore::FontPlatformData::FontPlatformData): Deleted.
1232         (WebCore::FontPlatformData::~FontPlatformData): Deleted.
1233         * platform/graphics/win/FontPlatformDataCairoWin.cpp:
1234         (WebCore::FontPlatformData::~FontPlatformData): m_scaledFont is always
1235         valid.
1236         (WebCore::FontPlatformData::platformDataAssign): Ditto.
1237
1238 2015-06-03  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1239
1240         [GTK] [Wayland] Build is broken on trunk
1241         https://bugs.webkit.org/show_bug.cgi?id=142879
1242
1243         Reviewed by Carlos Garcia Campos.
1244
1245         No new tests, no behavior changes.
1246
1247         Patch on GLContext.h picked from bug 136831 by
1248         Iago Toral <itoral@igalia.com> and Zan Dobersek <zdobersek@igalia.com>
1249
1250         * platform/graphics/GLContext.h: Include wayland-egl.h before eglplatform.h
1251         to use the Wayland platform when building for Wayland.
1252         * platform/graphics/PlatformDisplay.cpp: Fix the include of GDK
1253         headers for the different targets.
1254         * platform/graphics/wayland/WaylandSurface.cpp: Fix build after r183731.
1255         (WebCore::WaylandSurface::~WaylandSurface):
1256
1257 2015-06-04  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
1258
1259         [Streams API] Implement ReadableStreamController enqueue
1260         https://bugs.webkit.org/show_bug.cgi?id=145210
1261
1262         Reviewed by Darin Adler.
1263
1264         Added possibility to enqueue any JSValue within ReadableJSStream.
1265         They are stored in a Vector of strongified JSValue.
1266
1267         Added support for streams that contain data but are asked to close.
1268         This is done through m_closeRequested boolean and splitting actual closing of the stream from changeStateToClosed().
1269
1270         Chunk size and backpressure mechanism is not yet implemented.
1271         Neither is pulling once enqueued data is processed.
1272
1273         Covered by rebased tests.
1274
1275         * Modules/streams/ReadableStream.cpp:
1276         (WebCore::ReadableStream::changeStateToClosed): Split method with newly added close().
1277         (WebCore::ReadableStream::close): Does the actual closing of stream once stream has no more values.
1278         (WebCore::ReadableStream::read): Close the stream when stream is emptied and close is requested.
1279         (WebCore::ReadableStream::resolveReadCallback): Added to enable ReadableJSStream to resolve read callbacks immediatly at enqueue time.
1280         * Modules/streams/ReadableStream.h:
1281         (WebCore::ReadableStream::isErrored): Getter added for the custom binding code.
1282         (WebCore::ReadableStream::isCloseRequested): Ditto.
1283         * bindings/js/JSReadableStreamControllerCustom.cpp:
1284         (WebCore::JSReadableStreamController::enqueue): binding code for enqueue, taking care of raising exception if readable stream cannot enqueue.
1285         * bindings/js/ReadableJSStream.cpp:
1286         (WebCore::ReadableJSStream::hasValue):
1287         (WebCore::ReadableJSStream::read):
1288         (WebCore::ReadableJSStream::enqueue):
1289         * bindings/js/ReadableJSStream.h:
1290
1291 2015-06-04  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
1292
1293         [Streams API] ReadableJSStream does not need a ReadableStreamSource
1294         https://bugs.webkit.org/show_bug.cgi?id=145601
1295
1296         Reviewed by Darin Adler.
1297
1298         Covered by existing tests.
1299
1300         * Modules/streams/ReadableStream.cpp:
1301         (WebCore::ReadableStream::ReadableStream): Remoed m_source.
1302         * Modules/streams/ReadableStream.h: Ditto
1303         * Modules/streams/ReadableStreamSource.h: Deleted.
1304         * WebCore.vcxproj/WebCore.vcxproj: Removing Modules/streams/ReadableStreamSource.h.
1305         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
1306         * WebCore.xcodeproj/project.pbxproj: Ditto.
1307         * bindings/js/ReadableJSStream.cpp:
1308         (WebCore::ReadableJSStream::globalObject):
1309         (WebCore::ReadableJSStream::doStart): Equivalent of ReadableJSStream::Source::start().
1310         (WebCore::ReadableJSStream::create): Updated according new constructor.
1311         (WebCore::ReadableJSStream::ReadableJSStream):
1312         (WebCore::startReadableStreamAsync): Deleted.
1313         (WebCore::ReadableJSStream::jsController): Deleted.
1314         (WebCore::ReadableJSStream::storeError): Deleted.
1315         * bindings/js/ReadableJSStream.h: Added m_source member to store the JS source as a JS object.
1316
1317 2015-06-04  Zan Dobersek  <zdobersek@igalia.com>
1318
1319         Shrink the ArabicCharShapingMode enum in SVGGlyph.cpp
1320         https://bugs.webkit.org/show_bug.cgi?id=145564
1321
1322         Reviewed by Darin Adler.
1323
1324         Shrink the ArabicCharShapingMode enum to just one byte.
1325         This drops the size of the static s_arabicCharShapingMode
1326         array of  ArabicCharShapingMode values from 888 bytes to 222.
1327
1328         * platform/graphics/SVGGlyph.cpp:
1329         (WebCore::processArabicFormDetection):
1330
1331 2015-06-03  Zalan Bujtas  <zalan@apple.com>
1332
1333         Use borderBoxRect instead of contentBoxRect for backdrop filter.
1334         https://bugs.webkit.org/show_bug.cgi?id=145606
1335
1336         Reviewed by Simon Fraser.
1337
1338         Backdrop filter should use border box rect. It also needs to take css clip into account.
1339
1340         Tests: css3/filters/backdrop/backdrop-filter-with-cliprect.html
1341                css3/filters/backdrop/backdrop-filter-with-mask.html
1342
1343         * rendering/RenderLayerBacking.cpp:
1344         (WebCore::RenderLayerBacking::updateBackdropFiltersGeometry):
1345
1346 2015-06-03  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1347
1348         MediaDevices.getUserMedia should put promises in resolve/reject state synchronously
1349         https://bugs.webkit.org/show_bug.cgi?id=145308
1350
1351         Reviewed by Darin Adler.
1352
1353         Removed the calls to callToMainThread in which were resolved and rejected promises.
1354         Cleaned up the code to remove unneeded callback copies.
1355
1356         Covered by existing tests.
1357
1358         * Modules/mediastream/UserMediaRequest.cpp:
1359         (WebCore::UserMediaRequest::create):
1360         (WebCore::UserMediaRequest::UserMediaRequest):
1361         (WebCore::UserMediaRequest::didCreateStream):
1362         (WebCore::UserMediaRequest::failedToCreateStreamWithConstraintsError):
1363         (WebCore::UserMediaRequest::failedToCreateStreamWithPermissionError):
1364         * Modules/mediastream/UserMediaRequest.h:
1365
1366 2015-06-03  Simon Fraser  <simon.fraser@apple.com>
1367
1368         REGRESSION (r184968): missing media player buttons (control bar exists, but no buttons)
1369         https://bugs.webkit.org/show_bug.cgi?id=145630
1370
1371         Reviewed by Zalan Bujtas.
1372
1373         r184968 changed the initial value of m_intersectsCoverageRect to false. However,
1374         this triggered a bug with mask layers, whose value of m_intersectsCoverageRect was never
1375         updated.
1376
1377         Fix by copying the value of m_intersectsCoverageRect from the main layer to its
1378         mask layer, just as we do for m_visibleRect and m_coverageRect.
1379
1380         Test: compositing/visible-rect/mask-layer-coverage.html
1381
1382         * platform/graphics/ca/GraphicsLayerCA.cpp:
1383         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
1384
1385 2015-06-03  Simon Fraser  <simon.fraser@apple.com>
1386
1387         Layer tree dumps should include mask layers
1388         https://bugs.webkit.org/show_bug.cgi?id=145629
1389
1390         Reviewed by Zalan Bujtas.
1391
1392         Dumping the layer tree omitted to dump the mask layer, so fix 
1393         GraphicsLayer::dumpProperties() to dump this layer.
1394
1395         * platform/graphics/GraphicsLayer.cpp:
1396         (WebCore::GraphicsLayer::dumpProperties):
1397
1398 2015-06-03  Greg Hughes  <ghughes@apple.com>
1399
1400         AX: Expose field sets to accessibility clients
1401         https://bugs.webkit.org/show_bug.cgi?id=145585
1402    
1403         Expose fieldsets to the accessibility API via a subrole of AXFieldset.
1404
1405         Reviewed by Chris Fleizach.
1406
1407         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1408         (-[WebAccessibilityObjectWrapper subrole]):
1409
1410 2015-06-03  Myles C. Maxfield  <mmaxfield@apple.com>
1411
1412         Remove dead code FontPlatformData::roundsGlyphAdvances()
1413         https://bugs.webkit.org/show_bug.cgi?id=145628
1414
1415         Reviewed by Simon Fraser.
1416
1417         No new tests because there is no behavior change.
1418
1419         * WebCore.order:
1420         * platform/graphics/FontPlatformData.h:
1421         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1422         (WebCore::FontPlatformData::roundsGlyphAdvances): Deleted.
1423
1424 2015-06-03  Ryuan Choi  <ryuan.choi@navercorp.com>
1425
1426         [CoordinatedGraphics] Merge CoordinatedTile into Tile
1427         https://bugs.webkit.org/show_bug.cgi?id=145602
1428
1429         Reviewed by Darin Adler.
1430
1431         CoordinatedTile only implements Tile since Qt and WebKit1/Efl were dropped.
1432         So, there is no reason that CoordinatedTile inherits Tile interface.
1433
1434         No new tests, no behavior changes.
1435
1436         * PlatformEfl.cmake:
1437         * PlatformGTK.cmake:
1438         * WebCore.vcxproj/WebCore.vcxproj:
1439         * WebCore.vcxproj/WebCore.vcxproj.filters:
1440         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1441         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
1442         * platform/graphics/texmap/coordinated/CoordinatedTile.cpp: Renamed to Tile.cpp
1443         * platform/graphics/texmap/coordinated/CoordinatedTile.h: Merged into Tile.h
1444         (WebCore::CoordinatedTile::coordinate): Deleted.
1445         (WebCore::CoordinatedTile::rect): Deleted.
1446         * platform/graphics/texmap/coordinated/Tile.cpp: Renamed from CoordinatedTile.cpp.
1447         * platform/graphics/texmap/coordinated/Tile.h:
1448         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
1449         (WebCore::TiledBackingStore::createTiles):
1450
1451 2015-06-03  Matt Rajca  <mrajca@apple.com>
1452
1453         Add basic Media Session support to HTMLMediaElement.
1454         https://bugs.webkit.org/show_bug.cgi?id=145581
1455
1456         Reviewed by Eric Carlson.
1457
1458         HTMLMediaElements now have:
1459
1460         - a 'kind' attribute representing the intrinsic media category
1461         - a 'session' attribute representing the current media session, if any
1462
1463         * CMakeLists.txt: Include the new HTMLMediaElementMediaSession sources.
1464         * DerivedSources.make: Include the new IDL file.
1465         * Modules/mediasession/HTMLMediaElementMediaSession.cpp: Added.
1466         (WebCore::HTMLMediaElementMediaSession::session):
1467         * Modules/mediasession/HTMLMediaElementMediaSession.h: Added basic translation of the IDL file.
1468         (WebCore::HTMLMediaElementMediaSession::kind):
1469         (WebCore::HTMLMediaElementMediaSession::setKind):
1470         (WebCore::HTMLMediaElementMediaSession::setSession):
1471         * Modules/mediasession/HTMLMediaElementMediaSession.idl: Added from the Media Session spec.
1472         * PlatformMac.cmake: Include DOMHTMLMediaElementMediaSession.cpp.
1473         * WebCore.xcodeproj/project.pbxproj: Include the new HTMLMediaElementMediaSession sources.
1474         * html/HTMLMediaElement.h: Added accessors for 'kind' and 'session'.
1475         (WebCore::HTMLMediaElement::kind):
1476         (WebCore::HTMLMediaElement::setKind):
1477         (WebCore::HTMLMediaElement::session):
1478         (WebCore::HTMLMediaElement::setSession):
1479
1480 2015-06-03  Myles C. Maxfield  <mmaxfield@apple.com>
1481
1482         Cleanup after r185175.
1483         https://bugs.webkit.org/show_bug.cgi?id=145569
1484         <rdar://problem/20671711>
1485
1486         Unreviewed.
1487
1488         No new tests because there is no behavior change.
1489
1490         * platform/graphics/WidthIterator.h:
1491
1492 2015-06-02  Myles C. Maxfield  <mmaxfield@apple.com>
1493
1494         SoftBank Emoji are not transformed by shaping when in a run of their own
1495         https://bugs.webkit.org/show_bug.cgi?id=145569
1496         <rdar://problem/20671711>
1497
1498         Reviewed by Dean Jackson.
1499
1500         Normally, we don't perform shaping on single glyphs. However, these particular codepoints
1501         need to have shaping run on them, even if they are alone.
1502
1503         Test: fast/text/softbank-emoji.html Note that this test may fail in different locales on
1504         different platforms. This patch disables the test on iOS.
1505
1506         * Source/WebCore/platform/graphics/WidthIterator.cpp:
1507         (WebCore::applyFontTransforms): Move the length-of-1 check into shouldApplyFontTransforms()
1508         (WebCore::shouldApplyFontTransforms): Return true if we have one of these emoji characters in
1509         a run of its own
1510         (WebCore::advanceInternal): Keep track of the previous character, and use it to call
1511         shouldApplyFontTransforms. 
1512         * Source/WebCore/platform/graphics/WidthIterator.h: shouldApplyFontTransforms() needs
1513         some more information to perform its duties.
1514
1515 2015-06-03  Daniel Bates  <dabates@apple.com>
1516
1517         Caps lock indicator should not be shown in read-only or disabled field
1518         https://bugs.webkit.org/show_bug.cgi?id=145612
1519         <rdar://problem/21227454>
1520
1521         Reviewed by Darin Adler.
1522
1523         * html/TextFieldInputType.cpp:
1524         (WebCore::TextFieldInputType::disabledAttributeChanged): Update caps lock indicator state.
1525         (WebCore::TextFieldInputType::readonlyAttributeChanged): Ditto.
1526         (WebCore::TextFieldInputType::shouldDrawCapsLockIndicator): Do not draw the caps lock indicator
1527         when the field is read-only or disabled.
1528
1529 2015-06-03  Dean Jackson  <dino@apple.com>
1530
1531         Crash in GraphicsContext3D::getInternalFramebufferSize
1532         https://bugs.webkit.org/show_bug.cgi?id=145479
1533         <rdar://problem/16461048>
1534
1535         Reviewed by Eric Carlson.
1536
1537         If we are in an unitialized or lost state, don't try to access the context.
1538
1539         In order to test this, I added an Internal setting that always
1540         forces WebGL into a pending state.
1541
1542         Test: fast/canvas/webgl/useWhilePending.html
1543
1544         * html/canvas/WebGLRenderingContextBase.cpp:
1545         (WebCore::WebGLRenderingContextBase::create): Check internal settings for
1546         a forced pending state.
1547         (WebCore::WebGLRenderingContextBase::drawingBufferWidth): Guard against a pending state.
1548         (WebCore::WebGLRenderingContextBase::drawingBufferHeight): Ditto.
1549         * page/Settings.cpp: New Internal setting for forcing a pending policy.
1550         (WebCore::Settings::Settings):
1551         (WebCore::Settings::setForcePendingWebGLPolicy):
1552         * page/Settings.h:
1553         (WebCore::Settings::isForcePendingWebGLPolicy):
1554         * testing/InternalSettings.cpp:
1555         (WebCore::InternalSettings::Backup::Backup):
1556         (WebCore::InternalSettings::Backup::restoreTo):
1557         (WebCore::InternalSettings::setForcePendingWebGLPolicy):
1558         * testing/InternalSettings.h:
1559         * testing/InternalSettings.idl:
1560
1561 2015-06-03  Hunseop Jeong  <hs85.jeong@samsung.com>
1562
1563         Use modern for-loops in WebCore/page.
1564         https://bugs.webkit.org/show_bug.cgi?id=145455
1565
1566         Reviewed by Darin Adler.
1567
1568         No new tests, no behavior changes.
1569
1570         * page/Chrome.cpp:
1571         (WebCore::Chrome::notifyPopupOpeningObservers):
1572         * page/ContentSecurityPolicy.cpp:
1573         (WebCore::CSPSourceList::matches):
1574         (WebCore::CSPDirectiveList::gatherReportURIs):
1575         (WebCore::ContentSecurityPolicy::copyStateFrom):
1576         (WebCore::isAllowedByAll):
1577         (WebCore::isAllowedByAllWithState):
1578         (WebCore::isAllowedByAllWithContext):
1579         (WebCore::isAllowedByAllWithURL):
1580         (WebCore::ContentSecurityPolicy::evalDisabledErrorMessage):
1581         (WebCore::ContentSecurityPolicy::allowPluginType):
1582         (WebCore::ContentSecurityPolicy::reflectedXSSDisposition):
1583         (WebCore::ContentSecurityPolicy::gatherReportURIs):
1584         * page/ContextMenuController.cpp:
1585         (WebCore::ContextMenuController::populate):
1586         * page/DOMWindow.cpp:
1587         (WebCore::DOMWindow::dispatchAllPendingBeforeUnloadEvents):
1588         (WebCore::DOMWindow::dispatchAllPendingUnloadEvents):
1589         (WebCore::DOMWindow::willDestroyCachedFrame):
1590         (WebCore::DOMWindow::willDestroyDocumentInFrame):
1591         (WebCore::DOMWindow::willDetachDocumentFromFrame):
1592         (WebCore::DOMWindow::disconnectDOMWindowProperties):
1593         (WebCore::DOMWindow::reconnectDOMWindowProperties):
1594         (WebCore::DOMWindow::getMatchedCSSRules):
1595         * page/DeviceController.cpp:
1596         (WebCore::DeviceController::dispatchDeviceEvent):
1597         (WebCore::DeviceController::fireDeviceEvent):
1598         * page/EventHandler.cpp:
1599         (WebCore::EventHandler::updateMouseEventTargetNode):
1600         (WebCore::EventHandler::handleTouchEvent):
1601         * page/FocusController.cpp:
1602         (WebCore::FocusController::setIsVisibleAndActiveInternal):
1603         * page/Frame.cpp:
1604         (WebCore::Frame::orientationChanged):
1605         (WebCore::Frame::injectUserScriptsForWorld):
1606         * page/FrameView.cpp:
1607         (WebCore::FrameView::scrollContentsFastPath):
1608         (WebCore::FrameView::serviceScriptedAnimations):
1609         (WebCore::FrameView::trackedRepaintRectsAsText):
1610         (WebCore::FrameView::updateWidgetPositions):
1611         (WebCore::FrameView::notifyWidgets):
1612         * page/Page.cpp:
1613         (WebCore::networkStateChanged):
1614         (WebCore::Page::stringToViewMode):
1615         (WebCore::Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment):
1616         (WebCore::Page::refreshPlugins):
1617         (WebCore::Page::lockAllOverlayScrollbarsToHidden):
1618         (WebCore::Page::pluginViews):
1619         (WebCore::Page::storageBlockingStateChanged):
1620         (WebCore::Page::setIsVisibleInternal):
1621         * page/PageGroup.cpp:
1622         (WebCore::PageGroup::captionPreferencesChanged):
1623         * page/PageGroupLoadDeferrer.cpp:
1624         (WebCore::PageGroupLoadDeferrer::PageGroupLoadDeferrer):
1625         (WebCore::PageGroupLoadDeferrer::~PageGroupLoadDeferrer):
1626         * page/PageSerializer.cpp:
1627         (WebCore::PageSerializer::serializeFrame):
1628         * page/Performance.cpp:
1629         (WebCore::Performance::webkitGetEntriesByType):
1630         (WebCore::Performance::webkitGetEntriesByName):
1631         * page/PerformanceResourceTiming.cpp:
1632         (WebCore::passesTimingAllowCheck):
1633         * page/PerformanceUserTiming.cpp:
1634         (WebCore::convertToEntrySequence):
1635         * page/SecurityPolicy.cpp:
1636         (WebCore::SecurityPolicy::isAccessWhiteListed):
1637         * page/UserContentURLPattern.cpp:
1638         (WebCore::UserContentURLPattern::matchesPatterns):
1639         * page/WindowFeatures.cpp:
1640         (WebCore::WindowFeatures::parseDialogFeatures):
1641         * page/animation/AnimationController.cpp:
1642         (WebCore::AnimationControllerPrivate::updateAnimations):
1643         (WebCore::AnimationControllerPrivate::fireEventsAndUpdateStyle):
1644         (WebCore::AnimationControllerPrivate::suspendAnimationsForDocument):
1645         (WebCore::AnimationControllerPrivate::resumeAnimationsForDocument):
1646         (WebCore::AnimationControllerPrivate::numberOfActiveAnimations):
1647         * page/animation/CSSPropertyAnimation.cpp:
1648         (WebCore::ShorthandPropertyWrapper::equals):
1649         (WebCore::ShorthandPropertyWrapper::blend):
1650         * page/scrolling/AsyncScrollingCoordinator.cpp:
1651         (WebCore::setStateScrollingNodeSnapOffsetsAsFloat):
1652         * page/scrolling/ScrollingCoordinator.cpp:
1653         (WebCore::ScrollingCoordinator::absoluteNonFastScrollableRegionForFrame):
1654         (WebCore::ScrollingCoordinator::hasVisibleSlowRepaintViewportConstrainedObjects):
1655
1656 2015-06-03  Daniel Bates  <dabates@apple.com>
1657
1658         AutoFill button should not be shown in read-only or disabled field
1659         https://bugs.webkit.org/show_bug.cgi?id=145579
1660         <rdar://problem/21212494>
1661
1662         Reviewed by Darin Adler.
1663
1664         Fixes an issue where the AutoFill button is shown in a read-only or disabled
1665         field. We should not show the AutoFill button in such cases.
1666
1667         Tests: fast/forms/auto-fill-button/hide-auto-fill-button-when-input-becomes-disabled.html
1668                fast/forms/auto-fill-button/hide-auto-fill-button-when-input-becomes-readonly.html
1669                fast/forms/auto-fill-button/input-auto-fill-button.html
1670                fast/forms/auto-fill-button/input-disabled-auto-fill-button.html
1671                fast/forms/auto-fill-button/input-readonly-auto-fill-button.html
1672                fast/forms/auto-fill-button/input-readonly-non-empty-auto-fill-button.html
1673
1674         * html/TextFieldInputType.cpp:
1675         (WebCore::TextFieldInputType::disabledAttributeChanged): Update AutoFill button state.
1676         (WebCore::TextFieldInputType::readonlyAttributeChanged): Ditto.
1677         (WebCore::TextFieldInputType::shouldDrawAutoFillButton): Do not draw AutoFill button
1678         when the field is disabled or read-only.
1679
1680 2015-06-03  Brent Fulgham  <bfulgham@apple.com>
1681
1682         REGRESSION: (r181879): Scrolling in select/option region in iFrame scrolls both select and iframe
1683         https://bugs.webkit.org/show_bug.cgi?id=145574
1684         <rdar://problem/20966828>
1685
1686         Reviewed by Simon Fraser.
1687
1688         Tested by platform/mac-wk2/tiled-drawing/scrolling/fast-scroll-iframe-latched-select.html
1689
1690         When the scroll gesture is started when the latched scrollable container is not at the limit of its
1691         scroll region, we are NOT supposed to propagate the scroll event to the enclosing region. However,
1692         we were doing two things wrong:
1693         (1) When we recognized we were latching, we were using the right wheel event target, but not using
1694             the latched scrollable container.
1695         (2) Likewise, we were not using latched ScrollableArea when handling wheel events.
1696
1697         Instead, we were using the current scrollable container and ScrollableArea under the mouse pointer,
1698         which could be different from the point we started latching as the content scrolled.
1699         
1700         The fix was to properly track the scrollable container and scrollable area during latching.
1701
1702         I attempted to store the latched ScrollableArea in the latchingState object, like we already do for the
1703         scrollable container, but found that this did not work properly. I think the life cycle of the
1704         ScrollableArea may not match the scrollable container, and since they are not reference counted I
1705         simply retrieve the ScrollableArea when needed.
1706
1707         * page/mac/EventHandlerMac.mm:
1708         (WebCore::scrollableAreaForContainerNode): Helper function to return the correct ScrollableArea
1709         for the two types of RenderBox elements.
1710         (WebCore::latchedToFrameOrBody): Helper predicate to identify Frame and Body elements.
1711         (WebCore::EventHandler::platformPrepareForWheelEvents): Use the correct ScrollableArea for the given
1712         ContainerNode. When latching, make sure to use the ScrollableArea that is related to the latched scrollable
1713         container, not the area currently underneath the mouse pointer.
1714
1715 2015-06-03  Brady Eidson  <beidson@apple.com>
1716
1717         REGRESSION (r183498): Certain types of frame loads in iframes with <base target="_blank"> can open urls in new window/tabs
1718         https://bugs.webkit.org/show_bug.cgi?id=145580
1719
1720         Reviewed by Mark Lam.
1721
1722         Tests: fast/loader/fragment-navigation-base-blank.html
1723                fast/loader/iframe-meta-refresh-base-blank.html
1724                fast/loader/iframe-set-location-base-blank.html
1725                fast/loader/refresh-iframe-base-blank.html
1726
1727         Before 183498, callers of FrameLoader::changeLocation() got automatically assigned a frame name of "_self".
1728         After 183498, many remained without a frame name.
1729         
1730         Later on, FrameLoader applies the <base> target as their frame name if they don't already have one. 
1731         
1732         When the <base> target is "_blank", that causes a new window/tab.
1733         
1734         Restoring "_self" to these call sites fixes this.
1735
1736         * inspector/InspectorFrontendClientLocal.cpp:
1737         (WebCore::InspectorFrontendClientLocal::openInNewTab):
1738         
1739         * inspector/InspectorPageAgent.cpp:
1740         (WebCore::InspectorPageAgent::navigate):
1741         
1742         * loader/FrameLoadRequest.h:
1743         (WebCore::FrameLoadRequest::FrameLoadRequest):
1744         
1745         * loader/NavigationScheduler.cpp:
1746         (WebCore::NavigationScheduler::scheduleLocationChange):
1747         
1748         * page/DOMWindow.cpp:
1749         (WebCore::DOMWindow::createWindow):
1750
1751 2015-06-03  Alexey Proskuryakov  <ap@apple.com>
1752
1753         More iOS build fixing.
1754
1755         * platform/spi/mac/AVFoundationSPI.h:
1756
1757 2015-06-03  Zalan Bujtas  <zalan@apple.com>
1758
1759         Subpixel rendering: Composited layer with subpixel gap does not get painted properly when its position changes.
1760         https://bugs.webkit.org/show_bug.cgi?id=145587
1761
1762         Reviewed by Simon Fraser.
1763
1764         The composited layer always snaps to an enclosing device pixel (floors) while the renderer rounds.
1765         At certain positions (for example 0.5px on a 1x display), a gap is formed between the layer(0px) and its renderer(1px).
1766         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
1767         in order to get the renderering right.
1768
1769         Test: compositing/child-layer-with-subpixel-gap-needs-repaint-when-parent-moves.html
1770
1771         * rendering/RenderLayerBacking.cpp:
1772         (WebCore::RenderLayerBacking::updateAfterLayout):
1773         (WebCore::devicePixelFractionGapFromRendererChanged):
1774         (WebCore::RenderLayerBacking::updateGeometry):
1775         * rendering/RenderLayerBacking.h:
1776
1777 2015-06-03  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
1778
1779         [Streams API] ReadableStreamReader::closed() should be called once by binding code
1780         https://bugs.webkit.org/show_bug.cgi?id=145551
1781
1782         Reviewed by Darin Adler.
1783
1784         Covered by existing tests.
1785
1786         * bindings/js/JSReadableStreamReaderCustom.cpp:
1787         (WebCore::JSReadableStreamReader::closed): Calling ReadableStreamReader::closed only at creation of the promise.
1788
1789 2015-06-02  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1790
1791         [EFL][GTK] Fix build error since r185137
1792         https://bugs.webkit.org/show_bug.cgi?id=145596
1793
1794         Unreviewed, fix build break on EFL and GTK port.
1795
1796         * dom/Text.cpp:
1797         (WebCore::Text::formatForDebugger): Use strncpy() instead of strlcpy().
1798
1799 2015-06-02  Sergio Villar Senin  <svillar@igalia.com>
1800
1801         [CSS Grid Layout] Switch from parenthesis to brackets for grid line names
1802         https://bugs.webkit.org/show_bug.cgi?id=144996
1803
1804         Reviewed by Darin Adler.
1805
1806         Grid line names are now enclosed by brackets instead of parentheses
1807         as mentioned in the latest version of the spec. Appartently the CSS
1808         code is now more readable and avoids issues with tools like SASS.
1809
1810         * css/CSSGrammar.y.in:
1811         * css/CSSGridLineNamesValue.cpp:
1812         (WebCore::CSSGridLineNamesValue::customCSSText):
1813
1814 2015-06-02  Alexey Proskuryakov  <ap@apple.com>
1815
1816         iOS build fix
1817
1818         * platform/spi/mac/AVFoundationSPI.h:
1819
1820 2015-06-02  Commit Queue  <commit-queue@webkit.org>
1821
1822         Unreviewed, rolling out r185128 and r185132.
1823         https://bugs.webkit.org/show_bug.cgi?id=145597
1824
1825         The new test hits a bad assertion (Requested by ap on
1826         #webkit).
1827
1828         Reverted changesets:
1829
1830         "Crash in GraphicsContext3D::getInternalFramebufferSize"
1831         https://bugs.webkit.org/show_bug.cgi?id=145479
1832         http://trac.webkit.org/changeset/185128
1833
1834         "Skip webgl/useWhilePending.html on WebKit 1."
1835         http://trac.webkit.org/changeset/185132
1836
1837 2015-06-02  Ryuan Choi  <ryuan.choi@navercorp.com>
1838
1839         [CoordinatedGraphics] Refactor TiledBackingStoreClient
1840         https://bugs.webkit.org/show_bug.cgi?id=145577
1841
1842         Reviewed by Gyuyoung Kim.
1843
1844         This patch removes and simplifies unnecessary virtual methods of TiledBackingStoreClient.
1845
1846         No new tests, no behavior changes.
1847
1848         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1849         (WebCore::CoordinatedGraphicsLayer::didUpdateTileBuffers): Renamed from tiledBackingStorePaintEnd.
1850         (WebCore::CoordinatedGraphicsLayer::tiledBackingStorePaintBegin): Deleted.
1851         (WebCore::CoordinatedGraphicsLayer::tiledBackingStorePaintEnd): Deleted.
1852         (WebCore::CoordinatedGraphicsLayer::tiledBackingStoreBackgroundColor):
1853         Deleted because tiledBackingStoreBackgroundColor() is not used anywhere.
1854         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
1855         * platform/graphics/texmap/coordinated/CoordinatedTile.cpp:
1856         (WebCore::CoordinatedTile::updateBackBuffer):
1857         Simplified not to call unnecessary methods. In addition, used modern for loop.
1858         (WebCore::CoordinatedTile::swapBackBufferToFront): Deleted.
1859         * platform/graphics/texmap/coordinated/CoordinatedTile.h:
1860         * platform/graphics/texmap/coordinated/Tile.h:
1861         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
1862         (WebCore::TiledBackingStore::updateTileBuffers):
1863         * platform/graphics/texmap/coordinated/TiledBackingStoreClient.h:
1864
1865 2015-06-02  Doug Russell  <d_russell@apple.com>
1866
1867         AX: debugging attributes for text markers
1868         https://bugs.webkit.org/show_bug.cgi?id=145283
1869
1870         Reviewed by Chris Fleizach.
1871
1872         AXTextMarkerDebugDescription: returns the result of
1873         VisiblePosition::formatForDebugger() for the visible position that a text marker
1874         represents.
1875         AXTextMarkerNodeDebugDescription: calls Node::showNode() and
1876         Node::showNodePathForThis() for the visible position that a text marker
1877         represents.
1878         AXTextMarkerNodeTreeDebugDescription: calls Node::showTreeForThis() for the
1879         visible position that a text marker represents.
1880         AXTextMarkerRangeDebugDescription: returns the result of
1881         formatForDebugger(VisiblePositionRange) for the visible position range that a text
1882         marker range represents.
1883
1884         This is debug only tooling. Tests would be flakey and not very helpful.
1885
1886         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1887         (-[WebAccessibilityObjectWrapper debugDescriptionForTextMarker:]):
1888         (-[WebAccessibilityObjectWrapper debugDescriptionForTextMarkerRange:]):
1889         (-[WebAccessibilityObjectWrapper showNodeForTextMarker:]):
1890         (-[WebAccessibilityObjectWrapper showNodeTreeForTextMarker:]):
1891         (formatForDebugger):
1892         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
1893         * dom/Text.cpp:
1894         (WebCore::Text::formatForDebugger):
1895
1896 2015-06-02  Matt Rajca  <mrajca@apple.com>
1897
1898         MediaSessions should keep track of their current state.
1899         https://bugs.webkit.org/show_bug.cgi?id=145575
1900
1901         Reviewed by Alex Christensen.
1902
1903         * Modules/mediasession/MediaSession.h: Per the Media Session spec, the state can be 'Idle', 'Active', or
1904           'Interrupted'. Sessions are created in an 'Idle' state.
1905
1906 2015-06-02  Jon Lee  <jonlee@apple.com>
1907
1908         Build fix when building with internal SDKs
1909         https://bugs.webkit.org/show_bug.cgi?id=145576
1910         rdar://problem/21089476
1911
1912         Reviewed by Alexey Proskuryakov.
1913
1914         * platform/spi/mac/AVFoundationSPI.h: Include the right header.
1915
1916 2015-06-02  Dean Jackson  <dino@apple.com>
1917
1918         No need to guard the sizes attribute against PICTURE_SIZES in preload scanner.
1919         https://bugs.webkit.org/show_bug.cgi?id=145573
1920         <rdar://problem/21210038>
1921
1922         Reviewed by Myles Maxfield.
1923
1924         The PICTURE_SIZES feature flag doesn't need to be used to
1925         guard preloading of the sizes attribute.
1926
1927         * html/parser/HTMLPreloadScanner.cpp:
1928         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes): Deleted.
1929         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): Deleted.
1930
1931 2015-06-02  Anders Carlsson  <andersca@apple.com>
1932
1933         Use UUIDs for WebSQL database filenames instead of a sequential number
1934         https://bugs.webkit.org/show_bug.cgi?id=145571
1935
1936         Reviewed by Dan Bernstein.
1937
1938         This is a first step towards getting rid of the iOS specific code path where we truncate
1939         database files instead of deleting them (in order to avoid file corruption).
1940
1941         * Modules/webdatabase/DatabaseTracker.cpp:
1942         (WebCore::generateDatabaseFileName):
1943         (WebCore::DatabaseTracker::fullPathForDatabaseNoLock):
1944         * platform/sql/SQLiteFileSystem.cpp:
1945         (WebCore::SQLiteFileSystem::getFileNameForNewDatabase): Deleted.
1946         * platform/sql/SQLiteFileSystem.h:
1947
1948 2015-06-02  Dean Jackson  <dino@apple.com>
1949
1950         Crash in GraphicsContext3D::getInternalFramebufferSize
1951         https://bugs.webkit.org/show_bug.cgi?id=145479
1952         <rdar://problem/16461048>
1953
1954         Reviewed by Eric Carlson.
1955
1956         If we are in an unitialized or lost state, don't try to access the context.
1957
1958         In order to test this, I added an Internal setting that always
1959         forces WebGL into a pending state.
1960
1961         Test: fast/canvas/webgl/useWhilePending.html
1962
1963         * html/canvas/WebGLRenderingContextBase.cpp:
1964         (WebCore::WebGLRenderingContextBase::create): Check internal settings for
1965         a forced pending state.
1966         (WebCore::WebGLRenderingContextBase::drawingBufferWidth): Guard against a pending state.
1967         (WebCore::WebGLRenderingContextBase::drawingBufferHeight): Ditto.
1968         * page/Settings.cpp: New Internal setting for forcing a pending policy.
1969         (WebCore::Settings::Settings):
1970         (WebCore::Settings::setForcePendingWebGLPolicy):
1971         * page/Settings.h:
1972         (WebCore::Settings::isForcePendingWebGLPolicy):
1973         * testing/InternalSettings.cpp:
1974         (WebCore::InternalSettings::Backup::Backup):
1975         (WebCore::InternalSettings::Backup::restoreTo):
1976         (WebCore::InternalSettings::setForcePendingWebGLPolicy):
1977         * testing/InternalSettings.h:
1978         * testing/InternalSettings.idl:
1979
1980 2015-06-02  Matt Rajca  <mrajca@apple.com>
1981
1982         Added a stub implementation of MediaSession, part of the Media Session spec.
1983         https://bugs.webkit.org/show_bug.cgi?id=145530
1984
1985         Reviewed by Eric Carlson.
1986
1987         * CMakeLists.txt: Added new MediaSession sources.
1988         * DerivedSources.make:
1989         * Modules/mediasession/MediaSession.cpp: Added stub implementation.
1990         (WebCore::MediaSession::MediaSession): Per the Media Session spec, a Media Remote Controls object should only be
1991           set for 'content' sessions; it is null otherwise.
1992         (WebCore::MediaSession::~MediaSession):
1993         (WebCore::MediaSession::controls):
1994         (WebCore::MediaSession::releaseSession):
1995         * Modules/mediasession/MediaSession.h: Added basic translation of IDL file.
1996         * Modules/mediasession/MediaSession.idl: Added from the Media Session spec.
1997         * WebCore.xcodeproj/project.pbxproj: Added new MediaSession sources.
1998
1999 2015-06-02  Zalan Bujtas  <zalan@apple.com>
2000
2001         Backdrop filter is pulling in content from behind the window.
2002         https://bugs.webkit.org/show_bug.cgi?id=145561
2003         rdar://problem/20909309
2004
2005         Reviewed by Simon Fraser.
2006
2007         This patch ensures that the backdrop filter layer is positioned and sized properly.
2008
2009         The backdrop filter layer should take its size and position from its renderer and not
2010         directly from the composited layer.
2011         In certain cases the composited layer's size is expanded to cover items like box shadow or an absolute positioned descendant.
2012         In such cases, we ended up applying the backdrop filter to those areas as well.
2013
2014         Tests: css3/filters/backdrop/backdrop-filter-does-not-size-properly-absolute.html
2015                css3/filters/backdrop/backdrop-filter-does-not-size-properly-border-and-padding.html
2016
2017         * platform/graphics/GraphicsLayer.h:
2018         (WebCore::GraphicsLayer::setBackdropFiltersRect):
2019         (WebCore::GraphicsLayer::backdropFiltersRect):
2020         * platform/graphics/ca/GraphicsLayerCA.cpp:
2021         (WebCore::GraphicsLayerCA::setBackdropFiltersRect):
2022         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
2023         (WebCore::GraphicsLayerCA::updateBackdropFilters):
2024         (WebCore::GraphicsLayerCA::updateBackdropFiltersRect):
2025         (WebCore::GraphicsLayerCA::updateContentsRects):
2026         (WebCore::GraphicsLayerCA::updateGeometry): Deleted.
2027         * platform/graphics/ca/GraphicsLayerCA.h:
2028         * rendering/RenderLayerBacking.cpp:
2029         (WebCore::RenderLayerBacking::updateBackdropFiltersGeometry):
2030         (WebCore::RenderLayerBacking::updateGeometry):
2031         * rendering/RenderLayerBacking.h:
2032
2033 2015-06-02  Eric Carlson  <eric.carlson@apple.com>
2034
2035         [Mac] occasional crash in Document::playbackTargetAvailabilityDidChange
2036         https://bugs.webkit.org/show_bug.cgi?id=145559
2037
2038         Reviewed by Darin Adler.
2039
2040         No new tests, covered by existing tests.
2041
2042         * html/HTMLMediaElement.cpp:
2043         (WebCore::HTMLMediaElement::registerWithDocument): Pass document to m_mediaSession->registerWithDocument.
2044         (WebCore::HTMLMediaElement::unregisterWithDocument): Pass document to m_mediaSession->unRegisterWithDocument.
2045         (WebCore::HTMLMediaElement::documentWillSuspendForPageCache): Ditto.
2046         (WebCore::HTMLMediaElement::documentDidResumeFromPageCache): Ditto.
2047
2048         * html/MediaElementSession.cpp:
2049         (WebCore::MediaElementSession::registerWithDocument): Take a document.
2050         (WebCore::MediaElementSession::unregisterWithDocument): Ditto.
2051         * html/MediaElementSession.h:
2052
2053 2015-06-02  Chris Dumez  <cdumez@apple.com>
2054
2055         Calling FrameView::viewportContentsChanged() after style recalcs is too expensive
2056         https://bugs.webkit.org/show_bug.cgi?id=145554
2057         <rdar://problem/21189478>
2058
2059         Reviewed by Darin Adler and Simon Fraser.
2060
2061         Only call FrameView::viewportContentsChanged() after a style recalc if
2062         composited layers have been updated (and there is no pending layout).
2063
2064         We already viewportContentsChanged() after layout so we only need to
2065         call viewportContentsChanged() after a style recalc if it did not cause
2066         a layout but may have caused an element to become visible. In
2067         particular, this can happen in the case of composited animations (e.g.
2068         using -webkit-transform to move an element inside the viewport).
2069         Therefore, we now only call viewportContentsChanged() after a style
2070         recalc if it caused composited layers to be updated. This avoids a lot
2071         of unnecessary calls to viewportContentsChanged(), which is expensive.
2072
2073         No new tests, already covered by:
2074         fast/images/animated-gif-webkit-transform.html
2075
2076         * dom/Document.cpp:
2077         (WebCore::Document::recalcStyle):
2078         * page/FrameView.cpp:
2079         (WebCore::FrameView::updateCompositingLayersAfterStyleChange):
2080         * page/FrameView.h:
2081         * rendering/RenderLayerCompositor.cpp:
2082         (WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout):
2083         (WebCore::RenderLayerCompositor::updateCompositingLayers):
2084         * rendering/RenderLayerCompositor.h:
2085
2086 2015-06-02  Myles C. Maxfield  <mmaxfield@apple.com>
2087
2088         Remove use of CTFontSetRenderingParameters()
2089         https://bugs.webkit.org/show_bug.cgi?id=145560
2090
2091         Reviewed by Simon Fraser.
2092
2093         Instead, always use CTFontSetRenderingStyle().
2094
2095         No new tests because there is no behavior change.
2096
2097         * platform/graphics/cocoa/FontCascadeCocoa.mm:
2098         (WebCore::RenderingStyleSaver::RenderingStyleSaver): Deleted.
2099         (WebCore::RenderingStyleSaver::~RenderingStyleSaver): Deleted.
2100
2101 2015-06-02  Anders Carlsson  <andersca@apple.com>
2102
2103         Move WKFontAntialiasingStateSaver to its own file
2104         https://bugs.webkit.org/show_bug.cgi?id=145557
2105         rdar://problem/21134776
2106
2107         Reviewed by Dan Bernstein.
2108
2109         Also rename it to FontAntialiasingStateSaver. Also, change it to use the CoreGraphicsSPI.h header for its
2110         CGFontAntialiasingStyle definition instead of using an explicit typedef.
2111
2112         * WebCore.xcodeproj/project.pbxproj:
2113         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
2114         (PlatformCALayer::drawLayerContents):
2115         * platform/graphics/ios/FontAntialiasingStateSaver.h: Copied from Source/WebCore/platform/ios/wak/WKGraphics.h.
2116         (WebCore::FontAntialiasingStateSaver::FontAntialiasingStateSaver):
2117         (WebCore::FontAntialiasingStateSaver::setup):
2118         (WebCore::FontAntialiasingStateSaver::restore):
2119         * platform/ios/LegacyTileCache.mm:
2120         (WebCore::LegacyTileCache::drawWindowContent):
2121         * platform/ios/wak/WKGraphics.h:
2122         (WKFontAntialiasingStateSaver::WKFontAntialiasingStateSaver): Deleted.
2123         * platform/ios/wak/WKGraphics.mm:
2124         (WKFontAntialiasingStateSaver::setup): Deleted.
2125         (WKFontAntialiasingStateSaver::restore): Deleted.
2126
2127 2015-06-02  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
2128
2129         [Streams API] Implement ReadableStreamReader read method in closed and errored state
2130         https://bugs.webkit.org/show_bug.cgi?id=144790
2131
2132         Reviewed by Darin Adler.
2133
2134         Reader delegates read() promise handling to its stream except if reader is no longer locking the stream and stream is readable.
2135         Storing of reader read() promise callbacks as a Vector in ReadableStream.
2136         Added resolution/rejection of read() promises in case of errored/closed streams.
2137
2138         Test: streams/readable-stream-reader-read.html
2139
2140         * ForwardingHeaders/runtime/IteratorOperations.h: Added.
2141         * Modules/streams/ReadableStream.cpp:
2142         (WebCore::ReadableStream::cleanCallbacks): Clean the read requests.
2143         (WebCore::ReadableStream::changeStateToClosed): Run success callbacks with undefined for read requests.
2144         (WebCore::ReadableStream::changeStateToErrored): Run failure callbacks with the errors for read requests.
2145         (WebCore::ReadableStream::closed): Parameter name changed.
2146         (WebCore::ReadableStream::read): Added. Succeeds with empty when closed, fails with error when errored, reads a
2147         value if there is one and pushes the callbacks to the queue otherwise.
2148         * Modules/streams/ReadableStream.h:
2149         (WebCore::ReadableStream::ReadCallbacks::ReadCallbacks): Struct containing success and failure callbacks.
2150         * Modules/streams/ReadableStreamReader.cpp:
2151         (WebCore::ReadableStreamReader::closed): Parameter name changed.
2152         (WebCore::ReadableStreamReader::read): Invoke success with empty if we streams if we don't have the right reader
2153         and call the stream otherwise to read.
2154         * Modules/streams/ReadableStreamReader.h:
2155         * bindings/js/JSReadableStreamReaderCustom.cpp:
2156         (WebCore::JSReadableStreamReader::read): Create the callback lambdas and invoke read. Failure rejects the
2157         promise and success creates the result from the read value.
2158         * bindings/js/ReadableJSStream.cpp:
2159         (WebCore::ReadableJSStream::hasValue):
2160         (WebCore::ReadableJSStream::read): Not implemented yet.
2161         * bindings/js/ReadableJSStream.h:
2162
2163 2015-06-01  Myles C. Maxfield  <mmaxfield@apple.com>
2164
2165         [Cocoa] FontPlatformData's equality check should always use reference URLs
2166         https://bugs.webkit.org/show_bug.cgi?id=144168
2167
2168         Reviewed by Tim Horton.
2169
2170         <rdar://problem/18985642> is not fixed, so we need to continue using the older
2171         objectForEqualityCheck().
2172
2173         No new tests because there is no behavior change.
2174
2175         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
2176         (WebCore::FontPlatformData::objectForEqualityCheck):
2177
2178 2015-06-02  Andy Estes  <aestes@apple.com>
2179
2180         [Mac] REGRESSION (r175941): Max.app crashes when adding a sound file to a patch due to removing cursor resources from WebCore.framework
2181         https://bugs.webkit.org/show_bug.cgi?id=145555
2182
2183         Reviewed by Darin Adler.
2184
2185         Re-added the cursor resources used by Max.app and ran sort-Xcode-project-file.
2186
2187         * Resources/copyCursor.png: Added.
2188         * Resources/moveCursor.png: Added.
2189         * Resources/northEastSouthWestResizeCursor.png: Added.
2190         * Resources/northSouthResizeCursor.png: Added.
2191         * Resources/northWestSouthEastResizeCursor.png: Added.
2192         * WebCore.xcodeproj/project.pbxproj:
2193
2194 2015-06-02  Brady Eidson  <beidson@apple.com>
2195
2196         WebKit policy delegate should suggest if a navigation should be allowed to open URLs externally.
2197         rdar://problem/21025301 and https://bugs.webkit.org/show_bug.cgi?id=145280
2198
2199         Reviewed by Alex Christensen.
2200
2201         Tests: loader/navigation-policy/should-open-external-urls/main-frame-click.html
2202                loader/navigation-policy/should-open-external-urls/main-frame-navigated-programatically-by-subframe.html
2203                loader/navigation-policy/should-open-external-urls/main-frame-with-flag-progamatic.html
2204                loader/navigation-policy/should-open-external-urls/main-frame-without-flag-programatic.html
2205                loader/navigation-policy/should-open-external-urls/subframe-click-target-self.html
2206                loader/navigation-policy/should-open-external-urls/subframe-click-target-top.html
2207                loader/navigation-policy/should-open-external-urls/user-gesture-target-blank-with-flag-from-subframe.html
2208                loader/navigation-policy/should-open-external-urls/user-gesture-target-blank-with-flag.html
2209                loader/navigation-policy/should-open-external-urls/user-gesture-target-blank-without-flag-from-subframe.html
2210                loader/navigation-policy/should-open-external-urls/user-gesture-target-blank-without-flag.html
2211                loader/navigation-policy/should-open-external-urls/user-gesture-window-open-with-flag-from-subframe.html
2212                loader/navigation-policy/should-open-external-urls/user-gesture-window-open-with-flag.html
2213                loader/navigation-policy/should-open-external-urls/user-gesture-window-open-without-flag-from-subframe.html
2214                loader/navigation-policy/should-open-external-urls/user-gesture-window-open-without-flag.html
2215                loader/navigation-policy/should-open-external-urls/window-open-with-flag-from-subframe.html
2216                loader/navigation-policy/should-open-external-urls/window-open-with-flag.html
2217                loader/navigation-policy/should-open-external-urls/window-open-without-flag-from-subframe.html
2218                loader/navigation-policy/should-open-external-urls/window-open-without-flag.html
2219
2220         The "should open external URLs" flag is only for main frames.
2221         It doesn't enforce any sort of policy internal to WebKit, but rather is for notifications to the policy delegate.
2222         
2223         It is set from one of two places:
2224         1 - A main frame is navigated by any frame as the result of a user gesture.
2225         2 - WebKit2 API explicitly states the flag is true.
2226         
2227         The flag value propagates when:
2228         1 - When a main frame document is navigated to a new main frame document.
2229         2 - When a new window is opened from a page whose main frame had the flag set.
2230         3 - When a new window is opened as the result of a user gesture.
2231         
2232         The flag resets to false when:
2233         1 - A subframe navigates a main frame without a user gesture.
2234         
2235         This patch is large, but does little more than the following:
2236         1 - Adds a ShouldOpenExternalURLs flag to both FrameLoadRequest and NavigationAction.
2237         2 - Makes sure anybody who creates either of those objects sets a sensible for that flag.
2238         3 - When FrameLoader creates a new DocumentLoader, it sets its flag based on whether or not the load is in a main frame,
2239             whether or not the load is from a user gesture, and based on the initiator's value of the flag. 
2240             
2241         * dom/Document.cpp:
2242         (WebCore::Document::processHttpEquiv):
2243         (WebCore::Document::shouldOpenExternalURLsPolicyToPropagate):
2244         * dom/Document.h:
2245         
2246         * html/HTMLAnchorElement.cpp:
2247         (WebCore::HTMLAnchorElement::handleClick):
2248         
2249         * html/HTMLLinkElement.cpp:
2250         (WebCore::HTMLLinkElement::handleClick):
2251         
2252         * html/parser/XSSAuditorDelegate.cpp:
2253         (WebCore::XSSAuditorDelegate::didBlockScript):
2254         
2255         * inspector/InspectorFrontendClientLocal.cpp:
2256         (WebCore::InspectorFrontendClientLocal::openInNewTab):
2257         
2258         * inspector/InspectorPageAgent.cpp:
2259         (WebCore::InspectorPageAgent::navigate):
2260         
2261         * loader/DocumentLoader.cpp:
2262         (WebCore::DocumentLoader::setTriggeringAction):
2263         (WebCore::DocumentLoader::shouldOpenExternalURLsPolicyToPropagate):
2264         * loader/DocumentLoader.h:
2265         (WebCore::DocumentLoader::shouldOpenExternalURLsPolicy): Deleted.
2266         
2267         * loader/FrameLoadRequest.cpp:
2268         (WebCore::FrameLoadRequest::FrameLoadRequest):
2269         * loader/FrameLoadRequest.h:
2270         (WebCore::FrameLoadRequest::FrameLoadRequest):
2271         
2272         * loader/FrameLoader.cpp:
2273         (WebCore::FrameLoader::urlSelected):
2274         (WebCore::FrameLoader::receivedFirstData):
2275         (WebCore::FrameLoader::loadURLIntoChildFrame):
2276         (WebCore::FrameLoader::loadURL):
2277         (WebCore::FrameLoader::load):
2278         (WebCore::FrameLoader::loadWithNavigationAction):
2279         (WebCore::FrameLoader::reloadWithOverrideEncoding):
2280         (WebCore::FrameLoader::reload):
2281         (WebCore::FrameLoader::loadPostRequest):
2282         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
2283         (WebCore::FrameLoader::applyShouldOpenExternalURLsPolicyToNewDocumentLoader):
2284         * loader/FrameLoader.h:
2285         
2286         * loader/NavigationAction.cpp:
2287         (WebCore::NavigationAction::NavigationAction):
2288         (WebCore::NavigationAction::copyWithShouldOpenExternalURLsPolicy):
2289         * loader/NavigationAction.h:
2290         (WebCore::NavigationAction::setShouldOpenExternalURLsPolicy): Deleted.
2291         
2292         * loader/NavigationScheduler.cpp:
2293         (WebCore::ScheduledURLNavigation::ScheduledURLNavigation):
2294         (WebCore::ScheduledRedirect::ScheduledRedirect):
2295         (WebCore::ScheduledLocationChange::ScheduledLocationChange):
2296         (WebCore::ScheduledRefresh::ScheduledRefresh):
2297         (WebCore::ScheduledFormSubmission::ScheduledFormSubmission):
2298         (WebCore::NavigationScheduler::scheduleRedirect):
2299         (WebCore::NavigationScheduler::scheduleLocationChange):
2300         (WebCore::NavigationScheduler::scheduleRefresh):
2301         * loader/NavigationScheduler.h:
2302         
2303         * loader/PolicyChecker.cpp:
2304         (WebCore::PolicyChecker::checkNavigationPolicy):
2305         
2306         * loader/SubframeLoader.cpp:
2307         (WebCore::SubframeLoader::loadOrRedirectSubframe):
2308         
2309         * loader/appcache/ApplicationCacheGroup.cpp:
2310         (WebCore::ApplicationCacheGroup::selectCache):
2311         
2312         * page/ContextMenuController.cpp:
2313         (WebCore::openNewWindow):
2314         (WebCore::ContextMenuController::contextMenuItemSelected):
2315         
2316         * page/DOMWindow.cpp:
2317         (WebCore::DOMWindow::setLocation):
2318         (WebCore::DOMWindow::createWindow):
2319         (WebCore::DOMWindow::open):
2320         
2321         * page/DragController.cpp:
2322         (WebCore::DragController::performDragOperation):
2323         
2324         * page/Location.cpp:
2325         (WebCore::Location::reload):
2326         
2327         * replay/ReplayInputDispatchMethods.cpp:
2328         (WebCore::InitialNavigation::dispatch):
2329         
2330         * svg/SVGAElement.cpp:
2331         (WebCore::SVGAElement::defaultEventHandler):
2332
2333 2015-06-02  Yusuke Suzuki  <utatane.tea@gmail.com>
2334
2335         Heap-use-after-free read of size 4 in JavaScriptCore: WTF::StringImpl::isSymbol() (StringImpl.h:496)
2336         https://bugs.webkit.org/show_bug.cgi?id=145532
2337
2338         Reviewed by Geoffrey Garen.
2339
2340         Hold the ownership of AtomicStringImpl*.
2341
2342         * bindings/scripts/CodeGeneratorJS.pm:
2343         (GenerateParametersCheck):
2344         * dom/TreeScope.cpp:
2345         (WebCore::TreeScope::getElementById):
2346
2347 2015-06-02  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2348
2349         SharedBuffer::copy should return a Ref<SharedBuffer>
2350         https://bugs.webkit.org/show_bug.cgi?id=145499
2351
2352         Reviewed by Andreas Kling.
2353
2354         Changing SharedBuffer::copy to return a Ref<> and adapting some code accordingly.
2355
2356         Covered by existing tests.
2357
2358         * loader/SubresourceLoader.cpp:
2359         (WebCore::SubresourceLoader::didReceiveResponse):
2360         * loader/appcache/ApplicationCacheResource.cpp:
2361         (WebCore::ApplicationCacheResource::deliver):
2362         * platform/SharedBuffer.cpp:
2363         (WebCore::SharedBuffer::copy):
2364         * platform/SharedBuffer.h:
2365
2366 2015-06-01  Hunseop Jeong  <hs85.jeong@samsung.com>
2367
2368         Use modern for-loops in WebCore/Modules - 1
2369         https://bugs.webkit.org/show_bug.cgi?id=145507
2370
2371         Reviewed by Darin Adler.
2372
2373         No new tests, no behavior changes.
2374
2375         * Modules/battery/BatteryController.cpp:
2376         (WebCore::BatteryController::~BatteryController):
2377         (WebCore::BatteryController::updateBatteryStatus):
2378         (WebCore::BatteryController::didChangeBatteryStatus):
2379         * Modules/encryptedmedia/CDM.cpp:
2380         (WebCore::CDMFactoryForKeySystem):
2381         * Modules/encryptedmedia/MediaKeys.cpp:
2382         (WebCore::MediaKeys::~MediaKeys):
2383         * Modules/geolocation/Geolocation.cpp:
2384         (WebCore::Geolocation::resumeTimerFired):
2385         (WebCore::Geolocation::resetAllGeolocationPermission):
2386         (WebCore::Geolocation::makeCachedPositionCallbacks):
2387         (WebCore::Geolocation::sendError):
2388         (WebCore::Geolocation::sendPosition):
2389         (WebCore::Geolocation::stopTimer):
2390         (WebCore::Geolocation::cancelRequests):
2391         (WebCore::Geolocation::extractNotifiersWithCachedPosition):
2392         (WebCore::Geolocation::copyToSet):
2393         (WebCore::Geolocation::handlePendingPermissionNotifiers):
2394         * Modules/geolocation/GeolocationController.cpp:
2395         (WebCore::GeolocationController::positionChanged):
2396         (WebCore::GeolocationController::errorOccurred):
2397         * Modules/indexeddb/IDBDatabase.cpp:
2398         (WebCore::IDBDatabase::objectStoreNames):
2399         (WebCore::IDBDatabase::transaction):
2400         (WebCore::IDBDatabase::forceClose):
2401         (WebCore::IDBDatabase::closeConnection):
2402         (WebCore::IDBDatabase::findObjectStoreId):
2403         * Modules/indexeddb/IDBDatabaseBackend.cpp:
2404         (WebCore::IDBDatabaseBackend::runIntVersionChangeTransaction):
2405         (WebCore::IDBDatabaseBackend::deleteDatabase):
2406         (WebCore::IDBDatabaseBackend::close):
2407         * Modules/indexeddb/IDBDatabaseMetadata.cpp:
2408         (WebCore::IDBDatabaseMetadata::isolatedCopy):
2409         (WebCore::IDBObjectStoreMetadata::isolatedCopy):
2410         * Modules/indexeddb/IDBKey.cpp:
2411         (WebCore::IDBKey::isValid):
2412         * Modules/indexeddb/IDBKey.h:
2413         (WebCore::IDBKey::createMultiEntryArray):
2414         (WebCore::IDBKey::createArray):
2415         * Modules/indexeddb/IDBKeyPath.cpp:
2416         (WebCore::IDBKeyPath::IDBKeyPath):
2417         (WebCore::IDBKeyPath::isValid):
2418         (WebCore::IDBKeyPath::isolatedCopy):
2419         * Modules/indexeddb/IDBObjectStore.cpp:
2420         (WebCore::IDBObjectStore::indexNames):
2421         (WebCore::IDBObjectStore::put):
2422         Rename the two 'i's to 'keyData' and 'indexKeyData'.
2423         (WebCore::IDBObjectStore::index):
2424         (WebCore::IDBObjectStore::findIndexId):
2425         * Modules/indexeddb/IDBPendingTransactionMonitor.cpp:
2426         (WebCore::IDBPendingTransactionMonitor::deactivateNewTransactions):
2427         * Modules/indexeddb/IDBRequest.cpp:
2428         (WebCore::IDBRequest::abort):
2429         * Modules/indexeddb/IDBTransaction.cpp:
2430         (WebCore::IDBTransaction::closeOpenCursors):
2431         (WebCore::IDBTransaction::onAbort):
2432         (WebCore::IDBTransaction::dispatchEvent):
2433         * Modules/indexeddb/IDBTransactionBackend.cpp:
2434         (WebCore::IDBTransactionBackend::create):
2435         (WebCore::IDBTransactionBackend::closeOpenCursors):
2436         * Modules/mediasource/MediaSource.cpp:
2437         (WebCore::MediaSource::onReadyStateChange):
2438         * Modules/mediastream/MediaConstraintsImpl.cpp:
2439         (WebCore::MediaConstraintsImpl::initialize):
2440         (WebCore::MediaConstraintsImpl::getMandatoryConstraints):
2441         (WebCore::MediaConstraintsImpl::getOptionalConstraintValue):
2442         * Modules/mediastream/MediaStream.cpp:
2443         (WebCore::MediaStream::create):
2444         (WebCore::MediaStream::cloneMediaStreamTrackVector):
2445         (WebCore::MediaStream::addTrack):
2446         (WebCore::MediaStream::removeTrack):
2447         (WebCore::MediaStream::haveTrackWithSource):
2448         (WebCore::MediaStream::getTrackById):
2449         (WebCore::MediaStream::getTracks):
2450         (WebCore::MediaStream::trackDidEnd):
2451         (WebCore::MediaStream::scheduledEventTimerFired):
2452         * Modules/mediastream/MediaStreamCapabilities.cpp:
2453         (WebCore::MediaStreamCapabilities::sourceType):
2454         (WebCore::MediaStreamCapabilities::sourceId):
2455         (WebCore::MediaStreamCapabilities::facingMode):
2456         * Modules/mediastream/MediaStreamTrack.cpp:
2457         (WebCore::MediaStreamTrack::trackDidEnd):
2458         * Modules/mediastream/MediaStreamTrackSourcesRequest.cpp:
2459         (WebCore::MediaStreamTrackSourcesRequest::didCompleteRequest):
2460
2461 2015-06-01  Myles C. Maxfield  <mmaxfield@apple.com>
2462
2463         [SVG -> OTF Converter] Remove unnecessary hacks
2464         https://bugs.webkit.org/show_bug.cgi?id=145088
2465
2466         Reviewed by Simon Fraser.
2467
2468         Not needed anymore.
2469
2470         Test: svg/text/offset-square-svg-font.html
2471
2472         * svg/SVGToOTFFontConversion.cpp:
2473         (WebCore::SVGToOTFFontConverter::appendKERNTable):
2474         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):
2475
2476 2015-06-01  Andreas Kling  <akling@apple.com>
2477
2478         CSS animations in filling-forwards state shouldn't force compositing.
2479         <https://webkit.org/b/145389>
2480         <rdar://problem/17923642>
2481
2482         Reviewed by Simon Fraser.
2483
2484         Stop checking if a CSS animation is filling forwards when computing
2485         compositing requirements.
2486
2487         This prevents finished animations from pinning elements in composited
2488         state, and frees up a bunch of IOSurface memory on some content.
2489
2490         * page/animation/AnimationBase.h:
2491         (WebCore::AnimationBase::isAnimatingProperty): Deleted.
2492         * rendering/RenderLayerBacking.cpp:
2493         (WebCore::RenderLayerBacking::updateGeometry):
2494         * rendering/RenderLayerCompositor.cpp:
2495         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation):
2496
2497 2015-06-01  Myles C. Maxfield  <mmaxfield@apple.com>
2498
2499         Out of bounds read in WebCore::ComplexTextController::adjustGlyphsAndAdvances
2500         https://bugs.webkit.org/show_bug.cgi?id=145537
2501         <rdar://problem/20959267>
2502
2503         Reviewed by Darin Adler.
2504
2505         U16_IS_SURROGATE_LEAD(ch) assumes U16_IS_SURROGATE(ch). In this case, that isn't true.
2506
2507         Test: fast/text/crash-complex-text-surrogate.html
2508
2509         * platform/graphics/mac/ComplexTextController.cpp:
2510         (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
2511
2512 2015-05-30  Zalan Bujtas  <zalan@apple.com>
2513
2514         REGRESSION (179771): zooming on facebook images covers image
2515         https://bugs.webkit.org/show_bug.cgi?id=145485
2516
2517         Reviewed by Simon Fraser.
2518
2519         Scaling an infinite rect should always produce an infinite rect.
2520         (Based on Simon Fraser's patch)
2521
2522         Test: compositing/layer-creation/zoomed-clip-intersection.html
2523
2524         * platform/graphics/LayoutRect.cpp:
2525         (WebCore::LayoutRect::scale):
2526
2527 2015-06-01  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2528
2529         Purge PassRefPtr in WebCore/Modules - 3
2530         https://bugs.webkit.org/show_bug.cgi?id=145508
2531
2532         Reviewed by Darin Adler.
2533
2534         As a step to purge PassRefPtr, this patch removes PassRefPtr, then use Ref or RefPtr.
2535
2536         * Modules/indexeddb/IDBCursor.cpp:
2537         (WebCore::IDBCursor::create):
2538         * Modules/indexeddb/IDBCursor.h:
2539         * Modules/indexeddb/IDBCursorBackend.h:
2540         (WebCore::IDBCursorBackend::create):
2541         * Modules/indexeddb/IDBCursorBackendOperations.h:
2542         (WebCore::CursorIterationOperation::create):
2543         (WebCore::CursorAdvanceOperation::create):
2544         * Modules/indexeddb/IDBDatabase.cpp:
2545         (WebCore::IDBDatabase::create):
2546         * Modules/indexeddb/IDBDatabase.h:
2547         * Modules/indexeddb/IDBDatabaseBackend.cpp:
2548         (WebCore::IDBDatabaseBackend::create):
2549         * Modules/indexeddb/IDBDatabaseBackend.h:
2550         * Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp:
2551         (WebCore::IDBDatabaseCallbacksImpl::create):
2552         * Modules/indexeddb/IDBDatabaseCallbacksImpl.h:
2553         * Modules/indexeddb/IDBDatabaseError.h:
2554         (WebCore::IDBDatabaseError::create):
2555         * Modules/indexeddb/IDBIndex.h:
2556         (WebCore::IDBIndex::create):
2557         * Modules/indexeddb/IDBKey.h:
2558         (WebCore::IDBKey::createInvalid):
2559         (WebCore::IDBKey::createNumber):
2560         (WebCore::IDBKey::createString):
2561         (WebCore::IDBKey::createDate):
2562         (WebCore::IDBKey::createArray):
2563         * Modules/indexeddb/IDBKeyRange.cpp:
2564         (WebCore::IDBKeyRange::create):
2565         * Modules/indexeddb/IDBKeyRange.h:
2566         (WebCore::IDBKeyRange::create):
2567         * Modules/indexeddb/IDBObjectStore.cpp:
2568         * Modules/indexeddb/IDBObjectStore.h:
2569         (WebCore::IDBObjectStore::create):
2570         * Modules/indexeddb/IDBOpenDBRequest.cpp:
2571         (WebCore::IDBOpenDBRequest::create):
2572         * Modules/indexeddb/IDBOpenDBRequest.h:
2573         * Modules/indexeddb/IDBRecordIdentifier.h:
2574         (WebCore::IDBRecordIdentifier::create):
2575         * Modules/indexeddb/IDBRequest.cpp:
2576         (WebCore::IDBRequest::create):
2577         (WebCore::IDBRequest::getResultCursor):
2578         * Modules/indexeddb/IDBRequest.h:
2579         * Modules/indexeddb/IDBTransaction.cpp:
2580         (WebCore::IDBTransaction::create):
2581         * Modules/indexeddb/IDBTransaction.h:
2582         * Modules/indexeddb/IDBTransactionBackend.cpp:
2583         (WebCore::IDBTransactionBackend::create):
2584         * Modules/indexeddb/IDBTransactionBackend.h:
2585         * Modules/indexeddb/IDBTransactionBackendOperations.h:
2586         (WebCore::CreateObjectStoreOperation::create):
2587         (WebCore::DeleteObjectStoreOperation::create):
2588         (WebCore::IDBDatabaseBackend::VersionChangeOperation::create):
2589         (WebCore::CreateObjectStoreAbortOperation::create):
2590         (WebCore::DeleteObjectStoreAbortOperation::create):
2591         (WebCore::IDBDatabaseBackend::VersionChangeAbortOperation::create):
2592         (WebCore::CreateIndexOperation::create):
2593         (WebCore::CreateIndexAbortOperation::create):
2594         (WebCore::DeleteIndexOperation::create):
2595         (WebCore::DeleteIndexAbortOperation::create):
2596         (WebCore::GetOperation::create):
2597         (WebCore::PutOperation::create):
2598         (WebCore::SetIndexesReadyOperation::create):
2599         (WebCore::OpenCursorOperation::create):
2600         (WebCore::CountOperation::create):
2601         (WebCore::DeleteRangeOperation::create):
2602         (WebCore::ClearObjectStoreOperation::create):
2603         * Modules/mediasource/VideoPlaybackQuality.cpp:
2604         (WebCore::VideoPlaybackQuality::create):
2605         * Modules/mediasource/VideoPlaybackQuality.h:
2606         * Modules/mediastream/MediaConstraintsImpl.cpp:
2607         (WebCore::MediaConstraintsImpl::create):
2608         * Modules/mediastream/MediaConstraintsImpl.h:
2609         * Modules/mediastream/MediaStream.cpp:
2610         (WebCore::MediaStream::create):
2611         * Modules/mediastream/MediaStream.h:
2612         * Modules/mediastream/RTCDTMFSender.cpp:
2613         (WebCore::RTCDTMFSender::create):
2614         * Modules/mediastream/RTCDTMFSender.h:
2615         * Modules/mediastream/RTCOfferAnswerOptions.cpp:
2616         (WebCore::RTCOfferAnswerOptions::create):
2617         (WebCore::RTCOfferOptions::create):
2618         * Modules/mediastream/RTCOfferAnswerOptions.h:
2619         * Modules/mediastream/RTCPeerConnection.cpp:
2620         (WebCore::RTCPeerConnection::parseConfiguration):
2621         (WebCore::RTCPeerConnection::create):
2622         * Modules/mediastream/RTCPeerConnection.h:
2623         * Modules/webaudio/AudioContext.cpp:
2624         (WebCore::AudioContext::create):
2625         * Modules/webdatabase/AbstractDatabaseServer.h:
2626         * Modules/webdatabase/DOMWindowWebDatabase.cpp:
2627         (WebCore::DOMWindowWebDatabase::openDatabase):
2628         * Modules/webdatabase/DOMWindowWebDatabase.h:
2629         * Modules/webdatabase/DatabaseManager.cpp:
2630         (WebCore::DatabaseManager::existingDatabaseContextFor):
2631         (WebCore::DatabaseManager::databaseContextFor):
2632         (WebCore::DatabaseManager::openDatabase):
2633         * Modules/webdatabase/DatabaseManager.h:
2634         * Modules/webdatabase/DatabaseServer.cpp:
2635         (WebCore::DatabaseServer::openDatabase):
2636         (WebCore::DatabaseServer::createDatabase):
2637         * Modules/webdatabase/DatabaseServer.h:
2638
2639 2015-06-01  Daniel Bates  <dabates@apple.com>
2640
2641         Notify client that we began editing when text field is focused
2642         https://bugs.webkit.org/show_bug.cgi?id=145439
2643         <rdar://problem/21142108>
2644
2645         Reviewed by Anders Carlsson.
2646
2647         Inform the editor client that we began editing when a text field is focused either
2648         by being explicitly focused (programmatically or by user interaction) or implicitly
2649         focused when the window became active.
2650
2651         Currently we only notify the editor client that we began editing a text field when
2652         when a person actually changes the value of the field. And we always notify the
2653         client that we ended editing when a text field is defocused regardless of whether
2654         we executed a began editing callback. Moreover we notify a client that we
2655         ended editing when the field is defocused (either explicitly or implicitly when the
2656         window becomes inactive). Instead we should always notify the client that we began
2657         editing when the field is focused so that this callback is symmetric with the end
2658         editing callback.
2659
2660         * html/SearchInputType.cpp:
2661         (WebCore::SearchInputType::didSetValueByUserEdit): Remove parameter for ValueChangeState,
2662         which was used to determine whether we should notify the client that we began editing, because
2663         we we will notify the client that editing began when the text field is focused as opposed to
2664         when the value of text field first changes.
2665         * html/SearchInputType.h: Ditto.
2666         * html/TextFieldInputType.cpp:
2667         (WebCore::TextFieldInputType::forwardEvent): Notify the client that we began editing when
2668         the text field is focused.
2669         (WebCore::TextFieldInputType::subtreeHasChanged): Update call site of didSetValueByUserEdit()
2670         following the removal of its parameter.
2671         (WebCore::TextFieldInputType::didSetValueByUserEdit): Ditto.
2672         * html/TextFieldInputType.h:
2673
2674 2015-06-01  Anders Carlsson  <andersca@apple.com>
2675
2676         WAKScrollView.h cannot be imported standalone
2677         https://bugs.webkit.org/show_bug.cgi?id=145529
2678
2679         Reviewed by Dan Bernstein.
2680
2681         * page/mac/WebCoreFrameView.h:
2682         Remove the __cplusplus #ifdefs since WebCoreFrameView.h is only used by Objective-C++ code.
2683         (The different non-C++ method declarations were wrong anyway!)
2684
2685         * platform/ScrollTypes.h:
2686         Remove the #ifdef __cplusplus surrounding the code, add header includes to make the file self-contained,
2687         and reformat the enum definitions.
2688
2689 2015-06-01  Alex Christensen  <achristensen@webkit.org>
2690
2691         [Content Extensions] resource-type and load-type should be independent.
2692         https://bugs.webkit.org/show_bug.cgi?id=145528
2693         rdar://problem/21190765
2694
2695         Reviewed by Benjamin Poulain.
2696
2697         Covered by existing tests and a new API test.
2698         
2699         Right now we use the same uint16_t to store all the load-type and resource-type flags,
2700         then we just do a bitwise and to check both at the same time. This results in a trigger
2701         with load-type and resource-type firing if either condition is met, not both conditions.
2702         A trigger with both resource-type and load-type conditions should only fire if both conditions are met.
2703
2704         * contentextensions/DFABytecodeInterpreter.cpp:
2705         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretTestFlagsAndAppendAction):
2706         Check and correctly handle rules with both resource-type and load-type flags.
2707         * loader/ResourceLoadInfo.h:
2708         Add masks to separate flags from resource-type and load-type.
2709
2710 2015-06-01  Alex Christensen  <achristensen@webkit.org>
2711
2712         [Content Extensions] Reduce DFA memory usage.
2713         https://bugs.webkit.org/show_bug.cgi?id=145526
2714
2715         Reviewed by Benjamin Poulain.
2716
2717         * contentextensions/DFA.cpp:
2718         (WebCore::ContentExtensions::DFA::memoryUsed):
2719         (WebCore::ContentExtensions::DFANode::transitions):
2720         (WebCore::ContentExtensions::DFANode::fallbackTransitionDestination):
2721         (WebCore::ContentExtensions::DFANode::changeFallbackTransition):
2722         (WebCore::ContentExtensions::DFANode::addFallbackTransition):
2723         (WebCore::ContentExtensions::DFANode::containsTransition):
2724         (WebCore::ContentExtensions::DFANode::kill):
2725         * contentextensions/DFA.h:
2726         * contentextensions/DFAMinimizer.cpp:
2727         (WebCore::ContentExtensions::DFAMinimizer::minimize):
2728         * contentextensions/NFAToDFA.cpp:
2729         (WebCore::ContentExtensions::NFAToDFA::convert):
2730         Use separate Vectors for the transition characters and destinations to avoid wasting memory to padding a std::pair.
2731
2732 2015-06-01  Matt Rajca  <mrajca@apple.com>
2733
2734         Implemented the `eventTargetInterface` and `scriptExecutionContext` methods required by EventTarget, as well as
2735         some required infrastructure.
2736         https://bugs.webkit.org/show_bug.cgi?id=145523
2737
2738         Reviewed by Eric Carlson.
2739
2740         * Modules/mediasession/MediaRemoteControls.cpp:
2741         (WebCore::MediaRemoteControls::MediaRemoteControls): Initialize all instance variables.
2742         * Modules/mediasession/MediaRemoteControls.h: MediaRemoteControl's constructor now takes a script execution
2743           context, which we provide to EventTarget. The required eventTargetInterface method has also been implemented.
2744         (WebCore::MediaRemoteControls::create):
2745         * Modules/mediasession/MediaRemoteControls.idl: Indicate MediaRemoteControls now takes a constructor that is
2746           passed in a script execution context. To prevent build errors, event handlers have been removed until they are
2747           implemented.
2748         * WebCore.xcodeproj/project.pbxproj: We should be building the derived JSMediaRemoteControls class with WebCore.
2749         * dom/EventTargetFactory.in: Ensure a MediaRemoteControlsEventTargetInterfaceType is generated.
2750
2751 2015-06-01  Benjamin Poulain  <bpoulain@apple.com>
2752
2753         [CSS JIT] Fail to compile when we are out of executable memory
2754         https://bugs.webkit.org/show_bug.cgi?id=145483
2755         rdar://problem/21166612
2756
2757         Reviewed by Andreas Kling.
2758
2759         We should use a soft failure when the Linker fails to allocate
2760         executable memory for the CSS JIT. We will just fallback to slow
2761         code when that happen, better slow CSS than crashing.
2762
2763         Credit to Chris for finding this problem.
2764
2765         * cssjit/SelectorCompiler.cpp:
2766         (WebCore::SelectorCompiler::SelectorCodeGenerator::compile):
2767
2768 2015-06-01  Chris Dumez  <cdumez@apple.com>
2769
2770         ASSERT(revalidatingResource.inCache()) in MemoryCache when reloading tumblr.com
2771         https://bugs.webkit.org/show_bug.cgi?id=145518
2772         <rdar://problem/21168573>
2773
2774         Reviewed by Darin Adler.
2775
2776         There was an assertion in MemoryCache::revalidationSucceeded() making
2777         sure that the resource that was revalidated is still in the memory
2778         cache. However, nothing prevents this resource from being pruned while
2779         it is being revalidated. We do make sure that the resource in question
2780         cannot be destroyed though (see CachedResource::canDelete()).
2781
2782         This patch gets rid of this assertion as it is incorrect. Also, the
2783         fact that the resource is no longer in the memory cache is not an
2784         issue. We are merely going to call MemoryCache::remove() to remove
2785         it from the memory cache before re-adding it and updating its
2786         HTTP response. The call to MemoryCache::remove() will simply be a
2787         no-op in this case and we will not have any problem adding the
2788         resource back to the memory cache because the resource is kept alive.
2789
2790         Test: http/tests/cache/memory-cache-pruning-during-revalidation.html
2791
2792         * loader/cache/MemoryCache.cpp:
2793         (WebCore::MemoryCache::revalidationSucceeded): Deleted.
2794
2795 2015-06-01  Matt Rajca  <mrajca@apple.com>
2796
2797         Add stub implementation of MediaRemoteControls, part of the Media Session spec.
2798         https://bugs.webkit.org/show_bug.cgi?id=145462
2799
2800         Reviewed by Eric Carlson.
2801
2802         * CMakeLists.txt: Added IDL file as well as the corresponding implementation file.
2803         * DerivedSources.make: Included the new IDL file.
2804         * Modules/mediasession/MediaRemoteControls.cpp: Added an empty implementation file.
2805         (MediaRemoteControls::~MediaRemoteControls):
2806         * Modules/mediasession/MediaRemoteControls.h: Added a stubbed header file with accessors for the four attributes declared in the IDL file.
2807         (WebCore::MediaRemoteControls::previousTrackEnabled):
2808         (WebCore::MediaRemoteControls::setPreviousTrackEnabled):
2809         (WebCore::MediaRemoteControls::nextTrackEnabled):
2810         (WebCore::MediaRemoteControls::setNextTrackEnabled):
2811         (WebCore::MediaRemoteControls::seekForwardEnabled):
2812         (WebCore::MediaRemoteControls::setSeekForwardEnabled):
2813         (WebCore::MediaRemoteControls::seekBackwardEnabled):
2814         (WebCore::MediaRemoteControls::setSeekBackwardEnabled):
2815         * Modules/mediasession/MediaRemoteControls.idl: Added from the Media Session spec.
2816         * WebCore.xcodeproj/project.pbxproj: Included the new IDL file and MediaRemoteControls.cpp/.h sources.
2817
2818 2015-06-01  Sergio Villar Senin  <svillar@igalia.com>
2819
2820         [CSS Grid Layout] Simplify the interface of GridResolvedPosition
2821         https://bugs.webkit.org/show_bug.cgi?id=139077
2822
2823         Reviewed by Darin Adler.
2824
2825         The interface of GridResolvedPosition is full of static methods
2826         that are used only internally, we should not expose them.
2827
2828         Apart from that resolveGridPositionsFromStyle() do always return
2829         a valid GridSpan from now on meaning that the caller has to ensure
2830         that the resolution does not require running the auto-placement
2831         algorithm. A new class called GridUnresolvedSpan was added for
2832         that purpose.
2833
2834         No new tests as this is a refactoring.
2835
2836         * rendering/RenderGrid.cpp:
2837         (WebCore::RenderGrid::placeItemsOnGrid):
2838         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
2839         (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
2840         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
2841         * rendering/style/GridPosition.h:
2842         * rendering/style/GridResolvedPosition.cpp:
2843         (WebCore::gridLinesForSide):
2844         (WebCore::implicitNamedGridLineForSide):
2845         (WebCore::isNonExistentNamedLineOrArea):
2846         (WebCore::GridUnresolvedSpan::requiresAutoPlacement):
2847         (WebCore::GridUnresolvedSpan::adjustGridPositionsFromStyle):
2848         (WebCore::adjustGridPositionForRowEndColumnEndSide):
2849         (WebCore::adjustGridPositionForSide):
2850         (WebCore::resolveNamedGridLinePositionFromStyle):
2851         (WebCore::firstNamedGridLineBeforePosition):
2852         (WebCore::resolveRowStartColumnStartNamedGridLinePositionAgainstOppositePosition):
2853         (WebCore::resolveRowEndColumnEndNamedGridLinePositionAgainstOppositePosition):
2854         (WebCore::resolveNamedGridLinePositionAgainstOppositePosition):
2855         (WebCore::resolveGridPositionAgainstOppositePosition):
2856         (WebCore::GridResolvedPosition::resolveGridPositionsFromAutoPlacementPosition):
2857         (WebCore::resolveGridPositionFromStyle):
2858         (WebCore::GridResolvedPosition::GridResolvedPosition):
2859         (WebCore::GridResolvedPosition::unresolvedSpanFromStyle):
2860         (WebCore::GridResolvedPosition::resolveGridPositionsFromStyle):
2861         (WebCore::GridResolvedPosition::adjustGridPositionsFromStyle): Deleted.
2862         (WebCore::GridResolvedPosition::resolveNamedGridLinePositionFromStyle): Deleted.
2863         (WebCore::GridResolvedPosition::resolveGridPositionFromStyle): Deleted.
2864         (WebCore::GridResolvedPosition::resolveGridPositionAgainstOppositePosition): Deleted.
2865         (WebCore::GridResolvedPosition::resolveNamedGridLinePositionAgainstOppositePosition): Deleted.
2866         (WebCore::GridResolvedPosition::resolveRowStartColumnStartNamedGridLinePositionAgainstOppositePosition): Deleted.
2867         (WebCore::GridResolvedPosition::resolveRowEndColumnEndNamedGridLinePositionAgainstOppositePosition): Deleted.
2868         * rendering/style/GridResolvedPosition.h:
2869         (WebCore::GridUnresolvedSpan::GridUnresolvedSpan): New class.
2870         (WebCore::GridUnresolvedSpan::initialPosition):
2871         (WebCore::GridUnresolvedSpan::finalPosition):
2872         (WebCore::GridUnresolvedSpan::initialPositionSide):
2873         (WebCore::GridUnresolvedSpan::finalPositionSide):
2874         (WebCore::GridResolvedPosition::adjustGridPositionForRowEndColumnEndSide): Deleted.
2875         (WebCore::GridResolvedPosition::adjustGridPositionForSide): Deleted.
2876         (WebCore::GridResolvedPosition::GridResolvedPosition): Deleted.
2877
2878 2015-06-01  Csaba Osztrogonác  <ossy@webkit.org>
2879
2880         Fix the !ENABLE(VIDEO_TRACK) build after r184799
2881         https://bugs.webkit.org/show_bug.cgi?id=145510
2882
2883         Reviewed by Eric Carlson.
2884
2885         * testing/Internals.cpp:
2886         (WebCore::Internals::userPreferredAudioCharacteristics):
2887         (WebCore::Internals::setUserPreferredAudioCharacteristic):
2888
2889 2015-06-01  Csaba Osztrogonác  <ossy@webkit.org>
2890
2891         Fix logical-not-parentheses warning in CachedScript.cpp
2892         https://bugs.webkit.org/show_bug.cgi?id=145254
2893
2894         Reviewed by Sam Weinig.
2895
2896         * loader/cache/CachedScript.cpp:
2897         (WebCore::CachedScript::mimeTypeAllowedByNosniff): "!X==Y" should be "X!=Y" here.
2898
2899 2015-05-31  Dan Bernstein  <mitz@apple.com>
2900
2901         Remove Panther support
2902         https://bugs.webkit.org/show_bug.cgi?id=145506
2903
2904         Reviewed by Sam Weinig.
2905
2906         * platform/ios/wak/WAKAppKitStubs.h: Don't check for pre-Tiger SDKs.
2907
2908 2015-05-31  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2909
2910         Remove unused variable kZoomTicks.
2911         https://bugs.webkit.org/show_bug.cgi?id=145504
2912
2913         Reviewed by Sam Weinig.
2914
2915         No new tests, no behavior changes.
2916
2917         * platform/ScrollAnimatorNone.cpp:
2918
2919 2015-05-31  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2920
2921         Async XMLHttpRequest should get access to AppCache resources stored as flat files
2922         https://bugs.webkit.org/show_bug.cgi?id=138506
2923
2924         Reviewed by Darin Adler.
2925
2926         This patch reads flat file data when DocumentLoader substituteResource delivery timer is fired.
2927         Refactoring to remove ApplicationCacheHost/DocumentLoader friend link.
2928         Added ResourceLoader::deliverResponseAndData helper function, taking a SharedBuffer as input to remove an unneeded copy for flat files (no change for other files). 
2929
2930         Test: http/tests/appcache/simple-video-async.html
2931
2932         * loader/DocumentLoader.cpp:
2933         (WebCore::DocumentLoader::substituteResourceDeliveryTimerFired):
2934         (WebCore::DocumentLoader::scheduleArchiveLoad):
2935         (WebCore::DocumentLoader::scheduleSubstituteResourceLoad): Helper function to remove ApplicationCacheHost friend link.
2936         * loader/DocumentLoader.h:
2937         * loader/ResourceLoader.cpp:
2938         (WebCore::ResourceLoader::deliverResponseAndData): Helper function, code mostly moved from DocumentLoader::substituteResourceDeliveryTimerFired.
2939         * loader/ResourceLoader.h:
2940         * loader/SubstituteResource.h:
2941         (WebCore::SubstituteResource::deliver): Introduced to be overriden by ApplicationCacheResource to take care of flat file case.
2942         * loader/appcache/ApplicationCacheHost.cpp:
2943         (WebCore::ApplicationCacheHost::maybeLoadResource):
2944         (WebCore::ApplicationCacheHost::scheduleLoadFallbackResourceFromApplicationCache):
2945         * loader/appcache/ApplicationCacheResource.cpp:
2946         (WebCore::ApplicationCacheResource::deliver): Use SharedBuffer::createWithContentsOfFile to load data stored in flat file.
2947         * loader/appcache/ApplicationCacheResource.h:
2948
2949 2015-05-31  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
2950
2951         [Streams API] Implement ReadableStreamController constructor
2952         https://bugs.webkit.org/show_bug.cgi?id=143752
2953
2954         Reviewed by Darin Adler.
2955
2956         Covered by rebased test and expectation.
2957
2958         * Modules/streams/ReadableStreamController.idl: Adding CustomConstructor.
2959         * bindings/js/JSReadableStreamControllerCustom.cpp:
2960         (WebCore::constructJSReadableStreamController): Throws an exception whenever called.
2961
2962 2015-05-30  Brady Eidson  <beidson@apple.com>
2963
2964         Make FrameLoader methods that take PassRefPtr<Event> take raw pointers instead.
2965         https://bugs.webkit.org/show_bug.cgi?id=145495
2966
2967         Reviewed by Alexey Proskuryakov.
2968
2969         No new tests (No change in behavior).
2970
2971         In most cases ownership of the Event is not actually being transferred, and these functions are all rarely called anyways.
2972         
2973         * html/HTMLLinkElement.cpp:
2974         (WebCore::HTMLLinkElement::handleClick):
2975         
2976         * loader/FrameLoader.cpp:
2977         (WebCore::FrameLoader::urlSelected):
2978         (WebCore::FrameLoader::loadFrameRequest):
2979         (WebCore::FrameLoader::loadURL):
2980         (WebCore::FrameLoader::loadPostRequest):
2981         * loader/FrameLoader.h:
2982
2983 2015-05-30  Andreas Kling  <akling@apple.com>
2984
2985         [iOS] Tiling coverage sometimes inflated by outdated scale factor.
2986         <https://webkit.org/b/145494>
2987         <rdar://problem/20989389>
2988
2989         Reviewed by Benjamin Poulain.
2990
2991         Have GraphicsLayerCA plumb the current contents scale through to TileController::adjustCoverageRect()
2992         instead of TileController getting it from TileGrid.
2993
2994         This avoids a situation where adjustCoverageRect() could cause temporarily oversized tiling coverage
2995         if called while TileGrid's content scale is outdated, and we're neither zooming or pinching, following
2996         a pinch zoom that increased the scale factor.
2997
2998         Specifically, if all the velocity data is zero, we pad the coverage rect by a horizontal and vertical
2999         margin computed like so:
3000
3001             margin = defaultTileSize / tileGrid.scale
3002
3003         If the actual scale is 5, but the TileGrid's outdated scale is e.g 0.8, you'll get a much larger
3004         margin than you really wanted. Then the whole thing gets scaled up by 5x later on, and we explode
3005         in a fiery feast of IOSurface allocations.
3006
3007         * platform/graphics/TiledBacking.h:
3008         * platform/graphics/ca/GraphicsLayerCA.cpp:
3009         (WebCore::GraphicsLayerCA::adjustCoverageRect):
3010         * platform/graphics/ca/TileController.cpp:
3011         (WebCore::TileController::computeTileCoverageRect):
3012         * platform/graphics/ca/TileController.h:
3013
3014 2015-05-30  Brady Eidson  <beidson@apple.com>
3015
3016         Fix Windows tests broken by r185007.
3017         https://bugs.webkit.org/show_bug.cgi?id=145472
3018
3019         Unreviewed. Discussed with Alexey Proskuryakov.
3020
3021         No new tests (Fixing the four broken ones should suffice).
3022
3023         The bug was that evaluating arguments in a method/constructor call has no guaranteed sequencing.
3024         
3025         Clang seems to always do LTR, allowing the PassRefPtr to be evaluated as a bool in the call to
3026         navigationType() before it is "consumed" by the PassRefPtr argument.
3027         
3028         In Visual Studio the PassRefPtr consumption happened before the bool evaluation, meaning `false`
3029         was always passed in to navigationType(), breaking the four tests.
3030         
3031         The fix? Using PassRefPtr here was silly in the first place.
3032         No ownership is being transferred.
3033         Raw pointers it is.
3034         
3035         * loader/FrameLoader.cpp:
3036         (WebCore::FrameLoader::loadURL):
3037         (WebCore::FrameLoader::loadPostRequest):
3038         * loader/NavigationAction.cpp:
3039
3040         (WebCore::NavigationAction::NavigationAction):
3041         * loader/NavigationAction.h: Nobody is actually transferring ownership of these Events.
3042           Raw pointers will work just fine, thanks.
3043
3044 2015-05-29  Joseph Pecoraro  <pecoraro@apple.com>
3045
3046         Unreviewed bindings test rebaseline after r185023.
3047
3048         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3049         (WebCore::isObservable): Deleted.
3050         (WebCore::JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots): Deleted.
3051
3052 2015-05-29  Andreas Kling  <akling@apple.com>
3053
3054         [iOS] Reduce tiling coverage when doing a pure pinch zoom with no panning.
3055         <https://webkit.org/b/145481>
3056         <rdar://problem/20989389>
3057
3058         Reviewed by Benjamin Poulain.
3059
3060         When we're zooming in with a pinch gesture but not panning the page
3061         at the same time, make the coverage rect be the visible rect.
3062
3063         This reduces memory pressure during zooming, especially on slower
3064         devices that struggle to keep up with the current viewport.
3065
3066         * platform/graphics/ca/TileController.cpp:
3067         (WebCore::TileController::computeTileCoverageRect):
3068
3069 2015-05-29  Keith Miller  <keith_miller@apple.com>
3070
3071         WeakMap reference w/ DOM element as key does not survive long enough.
3072         https://bugs.webkit.org/show_bug.cgi?id=137651
3073
3074         Reviewed by Geoffrey Garen.
3075
3076         Remove isObservable functions as an "unobservable wrappers"
3077         optimization is invalid with WeakMaps. Performance testing
3078         will be done after the code is commited. If major
3079         performance issues occur the patch will be rolled out.
3080
3081         Test: js/dom/weakmap-gc-unobservable-dom-nodes.html
3082
3083         * bindings/js/JSNodeCustom.cpp:
3084         (WebCore::isReachableFromDOM):
3085         (WebCore::JSNodeOwner::isReachableFromOpaqueRoots):
3086         (WebCore::JSNode::insertBefore):
3087         (WebCore::isObservable): Deleted.
3088         * bindings/scripts/CodeGeneratorJS.pm:
3089         (GenerateImplementation):
3090
3091 2015-05-29  Anders Carlsson  <andersca@apple.com>
3092
3093         Get rid of WAKViewPrivate.h
3094         https://bugs.webkit.org/show_bug.cgi?id=145482
3095         rdar://problem/21162149
3096
3097         Reviewed by Dan Bernstein.
3098
3099         Merge WAKViewPrivate.h into WAKViewInternal.h and move the NSView sizing enum
3100         to WAKView.h since that was the only thing WebKit used (indirectly) from WAKViewPrivate.h.
3101
3102         * WebCore.xcodeproj/project.pbxproj:
3103         * platform/WAKViewInternal.h:
3104         (WAKViewForWKViewRef):
3105         * platform/ios/ScrollViewIOS.mm:
3106         * platform/ios/wak/WAKResponder.m:
3107         * platform/ios/wak/WAKView.h:
3108         * platform/ios/wak/WAKView.mm:
3109         * platform/ios/wak/WAKViewPrivate.h: Removed.
3110         (WAKViewForWKViewRef): Deleted.
3111         * platform/ios/wak/WAKWindow.mm:
3112         * platform/ios/wak/WKView.h:
3113         * platform/ios/wak/WKView.mm:
3114
3115 2015-05-29  Daniel Bates  <dabates@apple.com>
3116
3117         Clean up logic for updating caps lock indicator state
3118         https://bugs.webkit.org/show_bug.cgi?id=145329
3119
3120         Reviewed by Sam Weinig.
3121
3122         Remove logic to explicitly update the state of the caps lock indicator, which was used
3123         when the caps logic indicator was implemented as part of RenderTextControl. Currently,
3124         the caps logic indicator is implemented as part of a shadow DOM and we have existing
3125         logic to forward DOM focus and blur events to it so that it may update its state.
3126
3127         No change in behavior.
3128
3129         * editing/FrameSelection.cpp:
3130         (WebCore::FrameSelection::focusedOrActiveStateChanged): Deleted.
3131         * editing/FrameSelection.h:
3132         * page/EventHandler.cpp:
3133         (WebCore::EventHandler::keyEvent): Inline the code from EventHandler::capsLockStateMayHaveChanged()
3134         into this function because it is the only caller of EventHandler::capsLockStateMayHaveChanged() after
3135         we removed the call site in FrameSelection::focusedOrActiveStateChanged().
3136         (WebCore::EventHandler::capsLockStateMayHaveChanged): Deleted.
3137         * page/EventHandler.h:
3138
3139 2015-05-29  Zalan Bujtas  <zalan@apple.com>
3140
3141         Text disappears shortly after page load on Nexus 7 site.
3142         https://bugs.webkit.org/show_bug.cgi?id=145467
3143         rdar://problem/18327239
3144
3145         Reviewed by Simon Fraser.
3146
3147         This patch ensures that overlap testing for composited layers works properly when the sibling
3148         layer gets composited through its child.
3149
3150         When a layer gets composited through its child content, the recursive overlap testing should build up the
3151         overlapmap stack so that sibling content is intersected both against the child and its parent bounds.
3152
3153         Tests: compositing/sibling-layer-does-not-get-composited-overflow-hidden-case.html
3154                compositing/sibling-layer-does-not-get-composited-transform-case.html
3155
3156         * rendering/RenderLayerCompositor.cpp:
3157         (WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
3158         (WebCore::RenderLayerCompositor::OverlapMap::contains): Deleted.
3159
3160 2015-05-29  Brady Eidson  <beidson@apple.com>
3161
3162         Review feedback followup for r185003.
3163         https://bugs.webkit.org/show_bug.cgi?id=145463
3164
3165         Reviewed by Darin Adler.
3166
3167         * platform/sql/SQLiteDatabase.cpp:
3168         (WebCore::SQLiteDatabase::overrideUnauthorizedFunctions): `static const` one thing, c++-style cast another.
3169
3170 2015-05-29  Chris Dumez  <cdumez@apple.com>
3171
3172         WebContent crash in WebCore::Page::sessionID() const + 0 (Page.cpp:1660)
3173         https://bugs.webkit.org/show_bug.cgi?id=145422
3174         <rdar://problem/20613631>
3175
3176         Reviewed by Brady Eidson.
3177
3178         We sometimes crash when destroying a PageCache CachedFrame because its
3179         DocumentLoader is still loading. This should never happen as we are not
3180         supposed to let pages are still have pending loads into the PageCache.
3181
3182         However, we were using DocumentLoader::isLoadingInAPISense() as check
3183         in PageCache::canCachePageContainingThisFrame() which is not exactly
3184         what we want. isLoadingInAPISense() no longer considers subresource
3185         loads once the frame as loaded. This means if the JS triggers a new
3186         load in a subframe after it has been loaded, then isLoadingInAPISense()
3187         will return false, despite the pending load.
3188
3189         This patch replaces the isLoadingInAPISense() check with isLoading()
3190         as this will consider all pending loads, even after the frame is
3191         loaded.
3192
3193         In most cases, using isLoadingInAPISense() was not an issue because
3194         we call DocumentLoader::stopLoading() in all subframes before starting
3195         a provisional load. However, nothing seems to prevent JS from
3196         triggering a new load after that and before the new load gets committed
3197         (which is when we save the page into PageCache).
3198
3199         No new test as we don't have a reliable reproduction case and the
3200         issue is timing related.
3201
3202         * history/PageCache.cpp:
3203         (WebCore::logCanCacheFrameDecision):
3204         (WebCore::PageCache::canCachePageContainingThisFrame):
3205         * page/DiagnosticLoggingKeys.cpp:
3206         (WebCore::DiagnosticLoggingKeys::isLoading):
3207         (WebCore::DiagnosticLoggingKeys::loadingAPISenseKey): Deleted.
3208         * page/DiagnosticLoggingKeys.h:
3209
3210 2015-05-29  Chris Dumez  <cdumez@apple.com>
3211
3212         Consider throttling DOM timers in iframes outside the viewport
3213         https://bugs.webkit.org/show_bug.cgi?id=145465
3214         <rdar://problem/20768957>
3215
3216         Reviewed by Darin Adler.
3217
3218         Throttle DOM timers in iframes that are outside the viewport to decrease
3219         CPU usage, improve performance and reduce power use.
3220
3221         The approach is similar to what we already did for requestAnimationFrame
3222         in r183998.
3223
3224         We already has support for throttling DOM timers at:
3225         - Page level: for backgound pages
3226         - DOM timer level: for timers changing the style of an element outside
3227           the viewport or drawing on a canvas outside the viewport.
3228
3229         This patch adds support for throttling DOM timers at Document level so
3230         we can throttle all timers inside a specific iframe / Document. It relies
3231         on the same timerAlignmentInterval that is used for throttling at Page
3232         level with tweaks so that different Documents inside the same Page can
3233         have a different timerAlignmentInterval.
3234
3235         Test: fast/dom/timer-throttling-subframe.html
3236
3237         * dom/Document.cpp:
3238         (WebCore::Document::setTimerThrottlingEnabled):
3239         (WebCore::Document::timerAlignmentInterval):
3240         * dom/Document.h:
3241         (WebCore::Document::isTimerThrottlingEnabled):
3242         * page/DOMTimer.cpp:
3243         (WebCore::DOMTimer::alignedFireTime):
3244         The previous code was not throttling the timer if its fireTime was in
3245         the past. This was causing some aggressive timers on mashable.com to
3246         not be throttled so I got rid of this behavior. I don't see any reason
3247         why we would not throttle a timer simply because it is supposed to have
3248         fired already.
3249
3250         * page/FrameView.cpp:
3251         (WebCore::FrameView::viewportContentsChanged):
3252         (WebCore::FrameView::updateScriptedAnimationsAndTimersThrottlingState):
3253         * page/FrameView.h:
3254
3255         * testing/Internals.cpp:
3256         (WebCore::Internals::areTimersThrottled):
3257         * testing/Internals.h:
3258         * testing/Internals.idl:
3259         Add API to facilitate layout testing of this functionality.
3260
3261 2015-05-29  Brady Eidson  <beidson@apple.com>
3262
3263         NavigationAction constructor cleanup.
3264         https://bugs.webkit.org/show_bug.cgi?id=145472
3265
3266         Reviewed by Alex Christensen.
3267
3268         No new tests (Refactor, no change in behavior).
3269
3270         * loader/NavigationAction.cpp:
3271         (WebCore::NavigationAction::NavigationAction): Delegate many of the various constructors
3272           to a single full-featured constructor.
3273         * loader/NavigationAction.h:
3274
3275 2015-05-29  Matt Rajca  <mrajca@apple.com>
3276
3277         Rename MediaSession and MediaSessionClient to PlatformMediaSession and PlatformMediaSessionClient so we can use MediaSession for the formal implementation of the Media Session spec.
3278         https://bugs.webkit.org/show_bug.cgi?id=145447
3279
3280         Reviewed by Eric Carlson.
3281
3282         * Modules/webaudio/AudioContext.cpp:
3283         (WebCore::AudioContext::AudioContext):
3284         (WebCore::AudioContext::suspendPlayback):
3285         * Modules/webaudio/AudioContext.h:
3286         * WebCore.vcxproj/WebCore.vcxproj:
3287         * WebCore.vcxproj/WebCore.vcxproj.filters:
3288         * WebCore.xcodeproj/project.pbxproj:
3289         * html/HTMLAudioElement.h:
3290         * html/HTMLMediaElement.cpp:
3291         (WebCore::HTMLMediaElement::pausedForUserInteraction):
3292         (WebCore::HTMLMediaElement::mediaType):
3293         (WebCore::HTMLMediaElement::presentationType):
3294         (WebCore::HTMLMediaElement::displayType):
3295         (WebCore::HTMLMediaElement::didReceiveRemoteControlCommand):
3296         * html/HTMLMediaElement.h:
3297         * html/HTMLMediaSession.cpp:
3298         (WebCore::HTMLMediaSession::HTMLMediaSession):
3299         (WebCore::HTMLMediaSession::requiresFullscreenForVideoPlayback):
3300         * html/HTMLMediaSession.h:
3301         * html/HTMLVideoElement.h:
3302         * platform/RemoteCommandListener.h:
3303         * platform/audio/MediaSessionManager.cpp:
3304         (WebCore::MediaSessionManager::resetRestrictions):
3305         (WebCore::MediaSessionManager::has):
3306         (WebCore::MediaSessionManager::activeAudioSessionRequired):
3307         (WebCore::MediaSessionManager::count):
3308         (WebCore::MediaSessionManager::beginInterruption):
3309         (WebCore::MediaSessionManager::endInterruption):
3310         (WebCore::MediaSessionManager::addSession):
3311         (WebCore::MediaSessionManager::removeSession):
3312         (WebCore::MediaSessionManager::addRestriction):
3313         (WebCore::MediaSessionManager::removeRestriction):
3314         (WebCore::MediaSessionManager::restrictions):
3315         (WebCore::MediaSessionManager::sessionWillBeginPlayback):
3316         (WebCore::MediaSessionManager::sessionWillEndPlayback):
3317         (WebCore::MediaSessionManager::setCurrentSession):
3318         (WebCore::MediaSessionManager::currentSession):
3319         (WebCore::MediaSessionManager::sessionRestrictsInlineVideoPlayback):
3320         (WebCore::MediaSessionManager::sessionCanLoadMedia):
3321         (WebCore::MediaSessionManager::applicationWillEnterBackground):
3322         (WebCore::MediaSessionManager::applicationWillEnterForeground):
3323         (WebCore::MediaSessionManager::didReceiveRemoteControlCommand):
3324         (WebCore::MediaSessionManager::systemWillSleep):
3325         (WebCore::MediaSessionManager::systemDidWake):
3326         * platform/audio/MediaSessionManager.h:
3327         (WebCore::MediaSessionManager::sessions):
3328         * platform/audio/PlatformMediaSession.cpp: Renamed from Source/WebCore/platform/audio/MediaSession.cpp.
3329         (WebCore::stateName):
3330         (WebCore::PlatformMediaSession::create):
3331         (WebCore::PlatformMediaSession::PlatformMediaSession):
3332         (WebCore::PlatformMediaSession::~PlatformMediaSession):
3333         (WebCore::PlatformMediaSession::setState):
3334         (WebCore::PlatformMediaSession::beginInterruption):
3335         (WebCore::PlatformMediaSession::endInterruption):
3336         (WebCore::PlatformMediaSession::clientWillBeginPlayback):
3337         (WebCore::PlatformMediaSession::clientWillPausePlayback):
3338         (WebCore::PlatformMediaSession::pauseSession):
3339         (WebCore::PlatformMediaSession::mediaType):
3340         (WebCore::PlatformMediaSession::presentationType):
3341         (WebCore::PlatformMediaSession::title):
3342         (WebCore::PlatformMediaSession::duration):
3343         (WebCore::PlatformMediaSession::currentTime):
3344         (WebCore::PlatformMediaSession::canReceiveRemoteControlCommands):
3345         (WebCore::PlatformMediaSession::didReceiveRemoteControlCommand):
3346         (WebCore::PlatformMediaSession::visibilityChanged):
3347         (WebCore::PlatformMediaSession::clientDataBufferingTimerFired):
3348         (WebCore::PlatformMediaSession::updateClientDataBuffering):
3349         (WebCore::PlatformMediaSession::isHidden):
3350         (WebCore::PlatformMediaSession::displayType):
3351         (WebCore::PlatformMediaSessionClient::mediaSessionTitle):
3352         (WebCore::PlatformMediaSessionClient::mediaSessionDuration):
3353         (WebCore::PlatformMediaSessionClient::mediaSessionCurrentTime):
3354         * platform/audio/PlatformMediaSession.h: Renamed from Source/WebCore/platform/audio/MediaSession.h.
3355         (WebCore::PlatformMediaSession::state):
3356         (WebCore::PlatformMediaSession::canPlayToWirelessPlaybackTarget):
3357         (WebCore::PlatformMediaSession::isPlayingToWirelessPlaybackTarget):
3358         (WebCore::PlatformMediaSession::requiresPlaybackTargetRouteMonitoring):
3359         (WebCore::PlatformMediaSession::client):
3360         (WebCore::PlatformMediaSessionClient::PlatformMediaSessionClient):
3361         (WebCore::PlatformMediaSessionClient::displayType):
3362         (WebCore::PlatformMediaSessionClient::setShouldBufferData):
3363         (WebCore::PlatformMediaSessionClient::elementIsHidden):
3364         (WebCore::PlatformMediaSessionClient::wirelessRoutesAvailableDidChange):
3365         (WebCore::PlatformMediaSessionClient::setWirelessPlaybackTarget):
3366         (WebCore::PlatformMediaSessionClient::canPlayToWirelessPlaybackTarget):
3367         (WebCore::PlatformMediaSessionClient::isPlayingToWirelessPlaybackTarget):
3368         (WebCore::PlatformMediaSessionClient::setShouldPlayToPlaybackTarget):
3369         (WebCore::PlatformMediaSessionClient::~PlatformMediaSessionClient):
3370         * platform/audio/ios/MediaSessionManagerIOS.h:
3371         * platform/audio/ios/MediaSessionManagerIOS.mm:
3372         (WebCore::MediaSessionManageriOS::resetRestrictions):
3373         (WebCore::MediaSessionManageriOS::sessionWillBeginPlayback):
3374         (WebCore::MediaSessionManageriOS::sessionWillEndPlayback):
3375         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo):
3376         (WebCore::MediaSessionManageriOS::sessionCanLoadMedia):
3377         (-[WebMediaSessionHelper interruption:]):
3378         * platform/audio/mac/MediaSessionManagerMac.cpp:
3379         (MediaSessionManager::updateSessionState):
3380         * platform/graphics/MediaPlayer.cpp:
3381         (WebCore::MediaPlayer::handlePlaybackCommand):
3382         * platform/graphics/MediaPlayer.h:
3383         (WebCore::MediaPlayerClient::mediaPlayerHandlePlaybackCommand):
3384         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
3385         (WebCore::MediaPlayerPrivateAVFoundation::rateChanged):
3386         * platform/ios/RemoteCommandListenerIOS.mm:
3387         (WebCore::RemoteCommandListenerIOS::RemoteCommandListenerIOS):
3388         * testing/Internals.cpp:
3389         (WebCore::Internals::beginMediaSessionInterruption):
3390         (WebCore::Internals::endMediaSessionInterruption):
3391         (WebCore::Internals::setMediaSessionRestrictions):
3392         (WebCore::Internals::postRemoteControlCommand):
3393
3394 2015-05-29  Alex Christensen  <achristensen@webkit.org>
3395
3396         [Content Extensions] Decrease maxNFASize
3397         https://bugs.webkit.org/show_bug.cgi?id=145461
3398
3399         Reviewed by Gavin Barraclough.
3400
3401         * contentextensions/ContentExtensionCompiler.cpp:
3402         (WebCore::ContentExtensions::compileRuleList):
3403         Decrease maxNFASize based on analysis of memory usage and compiling and interpreting time.
3404
3405 2015-05-29  Brady Eidson  <beidson@apple.com>
3406
3407         WebSQL default functions can bypass authorizer.
3408         <rdar://problem/21048994> and https://bugs.webkit.org/show_bug.cgi?id=145463
3409
3410         Reviewed by Sam Weinig and Alexey Proskuryakov.
3411
3412         No new tests yet.
3413
3414         * platform/sql/SQLiteDatabase.cpp:
3415         (WebCore::unauthorizedSQLFunction): Function to install into SQLite to override some built-in functions.
3416         (WebCore::SQLiteDatabase::open):
3417         (WebCore::SQLiteDatabase::overrideUnauthorizedFunctions): Install function overrides for functions that
3418            take arbitrary input that are also meant to be disabled by virtue of them not being whitelisted.
3419         * platform/sql/SQLiteDatabase.h:
3420
3421 2015-05-29  Roger Fong  <roger_fong@apple.com>
3422
3423         Unreviewed. Shift fullscreen controls down 20px.
3424         <rdar://problem/21161523>
3425
3426         * Modules/mediacontrols/mediaControlsApple.css:
3427         (video:-webkit-full-screen::-webkit-media-controls-panel):
3428         Fullscreen control panel is too high and overlaps with caption menu.
3429         Shift it down 20px.
3430
3431 2015-05-28  Simon Fraser  <simon.fraser@apple.com>
3432
3433         Some assertion failures in compositing code after r183820
3434         https://bugs.webkit.org/show_bug.cgi?id=144630
3435
3436         Reviewed by Alexey Proskuryakov.
3437
3438         Reinstate the assertion commented out in r183843. Fixed by having blending no longer
3439         escape the media elements, which was fixed via bug 145420.
3440
3441         * rendering/RenderLayerCompositor.cpp:
3442         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
3443
3444 2015-05-29  Hunseop Jeong  <hs85.jeong@samsung.com>
3445
3446         Use modern for-loops in WebCore/plugins, storage, style, testing and workers.
3447         https://bugs.webkit.org/show_bug.cgi?id=145425
3448
3449         Reviewed by Darin Adler.
3450
3451         No new tests, no behavior changes.
3452
3453         * plugins/DOMMimeTypeArray.cpp:
3454         (WebCore::DOMMimeTypeArray::canGetItemsForName):
3455         * plugins/DOMPlugin.cpp:
3456         (WebCore::DOMPlugin::canGetItemsForName):
3457         * plugins/DOMPluginArray.cpp:
3458         (WebCore::DOMPluginArray::canGetItemsForName):
3459         * plugins/PluginData.cpp:
3460         (WebCore::PluginData::getWebVisibleMimesAndPluginIndices):
3461         * plugins/PluginMainThreadScheduler.cpp:
3462         (WebCore::PluginMainThreadScheduler::dispatchCallsForPlugin):
3463         (WebCore::PluginMainThreadScheduler::dispatchCalls):
3464         * storage/StorageEventDispatcher.cpp:
3465         (WebCore::StorageEventDispatcher::dispatchLocalStorageEvents):
3466         (WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames):
3467         (WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames):
3468         * storage/StorageMap.cpp:
3469         (WebCore::StorageMap::importItems):
3470         * style/StyleResolveTree.cpp:
3471         (WebCore::Style::pseudoStyleCacheIsInvalid):
3472         * testing/Internals.cpp:
3473         (WebCore::Internals::nodesFromRect):
3474         * workers/Worker.cpp:
3475         (WebCore::networkStateChanged):
3476         * workers/WorkerGlobalScope.cpp:
3477         (WebCore::WorkerGlobalScope::importScripts):
3478
3479 2015-05-29  Alex Christensen  <achristensen@webkit.org>
3480
3481         Unreviewed build fix when using content extensions debugging.
3482
3483         * contentextensions/ContentExtensionCompiler.cpp:
3484         (WebCore::ContentExtensions::compileRuleList):
3485         Update variable name.
3486
3487 2015-05-29  Brady Eidson  <beidson@apple.com>
3488
3489         Typo followup to r184987
3490
3491         Unreviewed.
3492
3493         * loader/FrameLoader.cpp:
3494         (WebCore::FrameLoader::loadURLIntoChildFrame): Misplaced brace.
3495
3496 2015-05-29  Brady Eidson  <beidson@apple.com>
3497
3498         Small FrameLoader refactoring.
3499         https://bugs.webkit.org/show_bug.cgi?id=145459
3500
3501         Reviewed by Alex Christensen.
3502
3503         No new tests (No behavior change).
3504
3505         * loader/FrameLoader.cpp:
3506         (WebCore::FrameLoader::loadURLIntoChildFrame):
3507         (WebCore::FrameLoader::loadFrameRequest):
3508         (WebCore::FrameLoader::loadURL):
3509         (WebCore::FrameLoader::loadPostRequest):
3510         * loader/FrameLoader.h:
3511
3512 2015-05-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3513
3514         MediaDevices.getUserMedia should reject promise instead of throwing exceptions
3515         https://bugs.webkit.org/show_bug.cgi?id=145282
3516
3517         Reviewed by Darin Adler.
3518
3519         Ensuring at the custom binding level that all potential errors are used to reject promise.
3520         Cleaned up the wrappers by removing unneeded RefPtr.
3521
3522         Covered by modified test.
3523
3524         * Modules/mediastream/MediaDevices.cpp:
3525         (WebCore::MediaDevices::getUserMedia):
3526         * Modules/mediastream/MediaDevices.h:
3527         * Modules/mediastream/UserMediaRequest.cpp:
3528         (WebCore::UserMediaRequest::create):
3529         * bindings/js/JSMediaDevicesCustom.cpp:
3530         (WebCore::JSMediaDevices::getUserMedia):
3531
3532 2015-05-28  Hunseop Jeong  <hs85.jeong@samsung.com>
3533
3534         Replaced 0 with nullptr in WebCore/accessibility.
3535         https://bugs.webkit.org/show_bug.cgi?id=145309
3536
3537         Reviewed by Chris Fleizach.
3538
3539         No new tests, no behavior change.
3540
3541         * accessibility/AccessibilityRenderObject.cpp:
3542         (WebCore::AccessibilityRenderObject::mathPrescripts):
3543         (WebCore::AccessibilityRenderObject::mathPostscripts):
3544         * accessibility/AccessibilityScrollView.cpp:
3545         (WebCore::AccessibilityScrollView::scrollBar):
3546         * accessibility/atk/AXObjectCacheAtk.cpp:
3547         (WebCore::notifyChildrenSelectionChange):
3548         * accessibility/atk/WebKitAccessibleHyperlink.cpp:
3549         (webkitAccessibleHyperlinkInit):
3550         * accessibility/atk/WebKitAccessibleInterfaceDocument.cpp:
3551         (webkitAccessibleDocumentGetAttributes):
3552         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
3553         (getAttributeSetForAccessibilityObject):
3554         (attributeSetDifference):
3555         * accessibility/atk/WebKitAccessibleUtil.h:
3556         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
3557         (webkitAccessibleRefChild):
3558         (webkitAccessibleGetAttributes):
3559         (webkitAccessibleGetObjectLocale):
3560         (getInterfaceMaskFromObject):
3561         (objectFocusedAndCaretOffsetUnignored):
3562         (cacheAndReturnAtkProperty):
3563
3564 2015-05-28  Zalan Bujtas  <zalan@apple.com>
3565
3566         Subpixel rendering: Pixel crack in text selection of simple text in <textarea>.
3567         https://bugs.webkit.org/show_bug.cgi?id=145393
3568         rdar://problem/19918941
3569
3570         Reviewed by Darin Adler.
3571
3572         Float to LayoutUnit conversion is lossy. To ensure that selection
3573         painting always lines up (snaps) properly, the calculated width needs to
3574         be adjusted by ceiling the float to the next LayoutUnit value.
3575
3576         Test: fast/text/hidpi-text-selection-gap-between-words.html
3577
3578         * platform/graphics/FontCascade.cpp:
3579         (WebCore::FontCascade::adjustSelectionRectForSimpleText):
3580         * platform/graphics/cocoa/FontCascadeCocoa.mm:
3581         (WebCore::FontCascade::adjustSelectionRectForComplexText):
3582
3583 2015-05-28  Andreas Kling  <akling@apple.com>
3584
3585         GraphicsLayerCA should start out with m_intersectsCoverageRect=false
3586         <https://webkit.org/b/145443>
3587         <rdar://problem/19685798>
3588
3589         Reviewed by Simon Fraser.
3590
3591         Since the coverage rect of a newly-constructed GraphicsLayerCA is always empty,
3592         there's no way that the layer's own bounding box can intersect with it.
3593         Hence the m_intersectsCoverageRect flag should be false after construction.
3594
3595         This fixes an issue where compositing layers in subframes would be marked as
3596         non-volatile, despite being far outside the viewport and coverage rect.
3597
3598         Test: compositing/visible-rect/iframe-with-layers-outside-viewport.html
3599
3600         * platform/graphics/ca/GraphicsLayerCA.cpp:
3601         (WebCore::GraphicsLayerCA::GraphicsLayerCA):
3602
3603 2015-05-28  Commit Queue  <commit-queue@webkit.org>
3604
3605         Unreviewed, rolling out r184796 and r184832.
3606         https://bugs.webkit.org/show_bug.cgi?id=145449
3607
3608         2% performance regression (Requested by litherum on #webkit).
3609
3610         Reverted changesets:
3611
3612         "[Cocoa] Use CTFontDrawGlyphs() instead of
3613         CGContextShowGlyphsWithAdvances()/CGContextShowGlyphsAtPositions()"
3614         https://bugs.webkit.org/show_bug.cgi?id=145234
3615         http://trac.webkit.org/changeset/184796
3616
3617         "Cleanup after r184796"
3618         https://bugs.webkit.org/show_bug.cgi?id=145333
3619         http://trac.webkit.org/changeset/184832
3620
3621 2015-05-28  Matt Rajca  <mrajca@apple.com>
3622
3623         Rename HTMLMediaSession to MediaElementSession to reserve "media session" for the Media Session API.
3624         https://bugs.webkit.org/show_bug.cgi?id=145440
3625
3626         Reviewed by Eric Carlson.
3627
3628         * CMakeLists.txt:
3629         * WebCore.vcxproj/WebCore.vcxproj:
3630         * WebCore.vcxproj/WebCore.vcxproj.filters:
3631         * WebCore.xcodeproj/project.pbxproj:
3632         * html/HTMLMediaElement.cpp:
3633         (WebCore::HTMLMediaElement::HTMLMediaElement):
3634         (WebCore::HTMLMediaElement::loadInternal):
3635         (WebCore::HTMLMediaElement::loadResource):
3636         (WebCore::HTMLMediaElement::suspend):
3637         (WebCore::HTMLMediaElement::resume):
3638         (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture):
3639         (WebCore::HTMLMediaElement::mediaState):
3640         * html/HTMLMediaElement.h:
3641         (WebCore::HTMLMediaElement::mediaSession):
3642         * html/MediaElementSession.cpp: Renamed from Source/WebCore/html/HTMLMediaSession.cpp.
3643         (WebCore::restrictionName):
3644         (WebCore::MediaElementSession::MediaElementSession):
3645         (WebCore::MediaElementSession::registerWithDocument):
3646         (WebCore::MediaElementSession::unregisterWithDocument):
3647         (WebCore::MediaElementSession::addBehaviorRestriction):
3648         (WebCore::MediaElementSession::removeBehaviorRestriction):
3649         (WebCore::MediaElementSession::playbackPermitted):
3650         (WebCore::MediaElementSession::dataLoadingPermitted):
3651         (WebCore::MediaElementSession::fullscreenPermitted):
3652         (WebCore::MediaElementSession::pageAllowsDataLoading):
3653         (WebCore::MediaElementSession::pageAllowsPlaybackAfterResuming):
3654         (WebCore::MediaElementSession::showPlaybackTargetPicker):
3655         (WebCore::MediaElementSession::hasWirelessPlaybackTargets):
3656         (WebCore::MediaElementSession::wirelessVideoPlaybackDisabled):
3657         (WebCore::MediaElementSession::setWirelessVideoPlaybackDisabled):
3658         (WebCore::MediaElementSession::setHasPlaybackTargetAvailabilityListeners):
3659         (WebCore::MediaElementSession::setPlaybackTarget):
3660         (WebCore::MediaElementSession::targetAvailabilityChangedTimerFired):
3661         (WebCore::MediaElementSession::externalOutputDeviceAvailableDidChange):
3662         (WebCore::MediaElementSession::canPlayToWirelessPlaybackTarget):
3663         (WebCore::MediaElementSession::isPlayingToWirelessPlaybackTarget):
3664         (WebCore::MediaElementSession::setShouldPlayToPlaybackTarget):
3665         (WebCore::MediaElementSession::mediaStateDidChange):
3666         (WebCore::MediaElementSession::effectivePreloadForElement):
3667         (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
3668         (WebCore::MediaElementSession::mediaEngineUpdated):
3669         (WebCore::MediaElementSession::allowsAlternateFullscreen):
3670         (WebCore::MediaElementSession::maximumMediaSourceBufferSize):
3671         * html/MediaElementSession.h: Renamed from Source/WebCore/html/HTMLMediaSession.h.
3672         * testing/Internals.cpp:
3673         (WebCore::Internals::setMediaElementRestrictions):
3674         (WebCore::Internals::setAudioContextRestrictions):
3675
3676 2015-05-28  Myles C. Maxfield  <mmaxfield@apple.com>
3677
3678         Crash under ICU with ASAN during editing/selection/move-by-word-visually-crash-test-5.html
3679         https://bugs.webkit.org/show_bug.cgi?id=145429
3680         <rdar://problem/20992218>
3681
3682         Reviewed by Alexey Proskuryakov.
3683
3684         WebKit uses some strings which contain the lower 8-bits of UTF-16 (thereby saving space). However,
3685         ICU doesn't understand this encoding. When we want to use ICU functions with strings in this encoding,
3686         we create a UTextProvider which converts our encoded strings to UTF-16 for ICU, one chunk at a time.
3687         This object contains a vtable which we populate to perform the conversion.
3688
3689         The WebKit function which actually returns the UTF-16 chunks has two relevant arguments: an index into
3690         the encoded string which ICU is requesting, and a direction from that index which ICU is interested
3691         in. This function populates a "chunk" which is characterized by a pointer to a buffer, the length of
3692         the populated data in the buffer, and an offset into the chunk which represents the index that the
3693         requested character was put into.
3694
3695         When ICU requests data going backward, we fill in the chunk accordingly, with the requested character
3696         all the way at the end. We then set the offset equal to the length of the buffer. However, this length
3697         value is stale from the previous time the function ran. Therefore, ICU was reading the wrong index in
3698         the chunk when expecting the requested character.
3699
3700         Covered by editing/selection/move-by-word-visually-crash-test-5.html.
3701
3702         * platform/text/icu/UTextProviderLatin1.cpp:
3703         (WebCore::uTextLatin1Access):
3704
3705 2015-05-28  Eric Carlson  <eric.carlson@apple.com>
3706
3707         [iOS] Fix controls bug caused by r184794
3708         https://bugs.webkit.org/show_bug.cgi?id=145445
3709
3710         Reviewed by Dean Jackson.
3711
3712         * Modules/mediacontrols/mediaControlsiOS.js:
3713         (ControllerIOS.prototype.showControls): Check video.controls instead of trying to call
3714         showInlinePlaybackPlaceholderOnly, which doesn't exist.
3715
3716 2015-05-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
3717
3718         Code clean up for extracting information from the mix of WritingMode and TextDirection
3719         https://bugs.webkit.org/show_bug.cgi?id=143399
3720
3721         Reviewed by Darin Adler.
3722         
3723         There should be eight TextFlows. A TextFlow consists of two directions.
3724         The first one controls the inline growing direction and the second one
3725         controls the block growing direction. We are going to use the cardinal
3726         directions to define these combinations.
3727
3728         We need to extract the following information easily from the TextFlow
3729
3730         -- isTextFlowReversed() // RTL
3731         -- isTextFlowFlipped()  // the opposite direction to normal
3732         -- isTextFlowVertical() // The line grows vertically
3733         
3734         Mixing WritingMode and TextDirection into TextFlow and choosing their values
3735         carefully to ease implementing the above functions can make things clearer.
3736
3737         * Modules/notifications/Notification.h:
3738         * platform/graphics/TextRun.h:
3739         * platform/ios/SelectionRect.h:
3740         * platform/text/BidiResolver.h:
3741         * platform/text/StringWithDirection.h:
3742         * platform/text/TextFlags.h:
3743         (WebCore::isLeftToRightDirection): Deleted.
3744         enum TextDirection is moved from TextFlags.h to WritingMode.h. So include
3745         WritingMode.h instead of including TextFlags.h.
3746         
3747         * css/CSSProperty.cpp:
3748         (WebCore::resolveToPhysicalProperty): Instead of handling the eight possible
3749         cases of the text flows one by one, we can map from a LogicalSide to a
3750         PhysicalSide using the TextFlow value.
3751         
3752         * platform/LengthBox.h:
3753         (WebCore::BoxExtent::before):
3754         (WebCore::BoxExtent::after):
3755         (WebCore::BoxExtent::start):
3756         (WebCore::BoxExtent::end):
3757         Use mapLogicalSideToPhysicalSide() to convert from a LogicalSide to a PhysicalSide.
3758         
3759         * platform/text/WritingMode.h:
3760         (WebCore::isLeftToRightDirection): Usually the default enum is defined
3761         first. And usually the default value is equal to zero. Since LTR is the
3762         default for the text direction, it should be defined before RTL.
3763         
3764         (WebCore::makeTextFlow): Returns a TextFlow given a WritingMode and a
3765         TextDirection.
3766         
3767         (WebCore::isReversedTextFlow): Returns true if the text direction is RTL.
3768         
3769         (WebCore::isFlippedTextFlow):
3770         (WebCore::isFlippedWritingMode): Returns true if the block growing direction
3771         is in the opposite direction of normal.
3772         
3773         (WebCore::isVerticalTextFlow):
3774         (WebCore::isVerticalWritingMode): Returns true if the line grows vertically.
3775                
3776         (WebCore::isHorizontalWritingMode):
3777         (WebCore::isFlippedLinesWritingMode): Use isVerticalWritingMode() and 
3778         isFlippedWritingMode() to answer these questions.
3779         
3780         (WebCore::isHorizontalPhysicalSide): 
3781         (WebCore::mirrorPhysicalSide): top <-> bottom and left <-> right conversion.
3782         (WebCore::rotatePhysicalSide): top <-> left and right <-> bottom conversion.
3783         
3784         (WebCore::mapLogicalSideToPhysicalSide): Maps a LogicalSide to a PhysicalSide
3785         using either the TextFlow or the WritingMode.
3786         
3787         (WebCore::isFlippedBlocksWritingMode): Deleted.
3788         * rendering/RenderMultiColumnSet.cpp:
3789         (WebCore::RenderMultiColumnSet::collectLayerFragments):
3790         (WebCore::RenderMultiColumnSet::columnTranslationForOffset):
3791         * rendering/shapes/Shape.cpp:
3792         (WebCore::physicalRectToLogical):
3793         (WebCore::physicalPointToLogical):
3794         * rendering/style/RenderStyle.h:
3795         Rename isFlippedBlocksWritingMode() to be isFlippedWritingMode() so we can
3796         be consistent with other WritingMode query functions.
3797
3798 2015-05-28  Matt Rajca  <mrajca@apple.com>
3799
3800         Add ENABLE_MEDIA_SESSION feature flag (which is off by default).
3801         https://bugs.webkit.org/show_bug.cgi?id=145415
3802
3803         Reviewed by Eric Carlson.
3804
3805         * Configurations/FeatureDefines.xcconfig:
3806
3807 2015-05-28  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
3808
3809         [Streams API] ReadableStreamReader should not be exposed
3810         https://bugs.webkit.org/show_bug.cgi?id=143564
3811
3812         Reviewed by Darin Adler.
3813
3814         Covered by rebased tests.
3815
3816         * Modules/streams/ReadableStreamReader.idl: Adding NoInterfaceObject to ReadableStreamReader.idl.
3817
3818 2015-05-28  Carlos Alberto Lopez Perez  <clopez@igalia.com>
3819
3820         [CMake] Improve detection and usage of GL/GLES/EGL libraries.
3821         https://bugs.webkit.org/show_bug.cgi?id=145408
3822
3823         Reviewed by Carlos Garcia Campos.
3824
3825         No new tests, no behavior changes.
3826
3827         * CMakeLists.txt: Ensure that we include the libraries and includes
3828         for the GL/GLESv2/EGL libraries before including the ANGLE directories.
3829         Define also any CFLAG that the system GL/GLESv2/EGL libraries may need.
3830         * PlatformEfl.cmake: Remove some includes that are now unneeded,
3831         because we are including now the EGL libraries on CMakeLists.txt
3832         * PlatformGTK.cmake: Remove unneeded include (We are including the EGL
3833         libraries now on CMakeLists.txt)
3834
3835 2015-05-28  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3836
3837         Binding generator should support interfaces with CustomConstructor and NoInterfaceObject
3838         https://bugs.webkit.org/show_bug.cgi?id=145016
3839
3840         Reviewed by Darin Adler.
3841
3842         Updated code generator to generate the necessary declarations (constructor property in the prototype, the constructor class).
3843         In the case of CustomConstructor with NoInterfaceObject, the implementation of the constructor property related JS function is changed as follow:
3844         It creates a constructor object and shadows the constructor property JS function with this object.
3845         This ensures that only one constructor object is created per prototype.
3846         The constructor is not exposed as it is not added to the global object constructor map.
3847
3848         NoInterfaceObject is asking to not make the interface visible, which is contradictory with having a visible constructor of the interface.
3849         The case for having NoInterfaceObject and CustomConstructor is the following:
3850         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.
3851         One such case is https://streams.spec.whatwg.org/#globals
3852
3853         Added TestCustomConstructorWithNoInterfaceObject.idl to check that case.
3854
3855         * bindings/scripts/CodeGeneratorJS.pm:
3856         (GenerateHeader):
3857         (GenerateAttributesHashTable):
3858         (GenerateImplementation):
3859         (HasConstructorProperty):
3860         * bindings/scripts/test/GObject/WebKitDOMTestCustomConstructorWithNoInterfaceObject.cpp: Added.
3861         (WebKit::kit):
3862         (WebKit::core):
3863         (WebKit::wrapTestCustomConstructorWithNoInterfaceObject):
3864         (webkit_dom_test_custom_constructor_with_no_interface_object_finalize):
3865         (webkit_dom_test_custom_constructor_with_no_interface_object_constructor):
3866         (webkit_dom_test_custom_constructor_with_no_interface_object_class_init):
3867         (webkit_dom_test_custom_constructor_with_no_interface_object_init):
3868         * bindings/scripts/test/GObject/WebKitDOMTestCustomConstructorWithNoInterfaceObject.h: Added.
3869         * bindings/scripts/test/GObject/WebKitDOMTestCustomConstructorWithNoInterfaceObjectPrivate.h: Added.
3870         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: Added.
3871         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::create):
3872         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::createStructure):
3873         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::JSTestCustomConstructorWithNoInterfaceObjectPrototype):
3874         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::create):
3875         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::createStructure):
3876         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::JSTestCustomConstructorWithNoInterfaceObjectConstructor):
3877         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::finishCreation):
3878         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::getConstructData):
3879         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::finishCreation):
3880         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::JSTestCustomConstructorWithNoInterfaceObject):
3881         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::createPrototype):
3882         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::getPrototype):
3883         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::destroy):
3884         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::~JSTestCustomConstructorWithNoInterfaceObject):
3885         (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
3886         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::getConstructor):
3887         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectOwner::isReachableFromOpaqueRoots):
3888         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectOwner::finalize):
3889         (WebCore::toJS):
3890         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::toWrapped):
3891         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h: Added.
3892         (WebCore::wrapperOwner):
3893         (WebCore::toJS):
3894         * bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObject.h: Added.
3895         * bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObject.mm: Added.
3896         (-[DOMTestCustomConstructorWithNoInterfaceObject dealloc]):
3897         (-[DOMTestCustomConstructorWithNoInterfaceObject finalize]):
3898         (core):
3899         (kit):
3900         * bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObjectInternal.h: Added.
3901         * bindings/scripts/test/TestCustomConstructor.idl: Added.
3902
3903 2015-05-19  Jon Honeycutt  <jhoneycutt@apple.com>
3904
3905         [iOS] When viewing an MJPEG stream as the main resource, only the first
3906         frame paints
3907
3908         <https://bugs.webkit.org/show_bug.cgi?id=145185>
3909         <rdar://problem/20124694>
3910
3911         This bug is caused by state not being restored between successive loads
3912         of multipart/x-mixed-replace content. Each part of the stream is not
3913         treated as a wholly new load, so if state is cleared as part of the
3914         previous page being destroyed, it may not be restored when loading
3915         the next stream part.
3916
3917         On WK1, tile cache updates are disabled in FrameView::clear(), which is
3918         called as the previous page is destroyed, but were not being
3919         reenabled when loading new replacement content from the stream.
3920
3921         On WK2, the exposed content rect was being reset to an empty rect as
3922         the previous page was destroyed, but it was not being reset by loading
3923         replacement content.
3924
3925         To fix these issues, I added two WebFrameLoaderClient callbacks;
3926         willReplaceMultipartContent() and didReplaceMultipartContent(). These
3927         are used to save and restore state between successive loads.
3928
3929         Reviewed by Darin Adler.
3930
3931         * loader/DocumentLoader.cpp:
3932         Call the new client callbacks.
3933         (WebCore::DocumentLoader::commitLoad):
3934         If replacing content in a multipart/x-mixed-replace stream, call the
3935         WebFrameLoaderClient's didReplaceMultipartContent().
3936
3937         (WebCore::DocumentLoader::setupForReplace):
3938         Call the WebFrameLoaderClient's willReplaceMultipartContent().
3939
3940         * loader/EmptyClients.h:
3941
3942         * loader/FrameLoaderClient.h:
3943
3944         * page/FrameView.cpp:
3945         (WebCore::FrameView::didReplaceMultipartContent):
3946         Re-enable tile cache updates that were disabled in FrameView::clear().
3947         This fixes the issue for WK1.
3948
3949         * page/FrameView.h:
3950         Declare an exported function, didReplaceMultipartContent(), that WebKit
3951         can call.
3952
3953 2015-05-27  Brady Eidson  <beidson@apple.com>
3954
3955         Remove unused ResourceRequest "user initiated" flag.
3956         https://bugs.webkit.org/show_bug.cgi?id=145428
3957
3958         Reviewed by Alexey Proskuryakov.
3959
3960         No new tests (No change in behavior).
3961
3962         * platform/ios/WebCoreSystemInterfaceIOS.mm:
3963         * platform/mac/WebCoreSystemInterface.mm:
3964
3965         * platform/network/ResourceRequestBase.h:
3966         (WebCore::ResourceRequestBase::initiatedByUserGesture): Deleted.
3967         (WebCore::ResourceRequestBase::setInitiatedByUserGesture): Deleted.
3968         (WebCore::ResourceRequestBase::encodeWithoutPlatformData): Deleted.
3969         (WebCore::ResourceRequestBase::decodeWithoutPlatformData): Deleted.
3970
3971         * platform/network/cf/ResourceRequestCFNet.cpp:
3972         (WebCore::ResourceRequest::doUpdatePlatformRequest): Deleted.
3973         (WebCore::ResourceRequest::doUpdateResourceRequest): Deleted.
3974
3975         * platform/network/cocoa/ResourceRequestCocoa.mm:
3976         (WebCore::ResourceRequest::doUpdateResourceRequest): Deleted.
3977         (WebCore::ResourceRequest::doUpdatePlatformRequest): Deleted.
3978
3979 2015-05-27  Brady Eidson  <beidson@apple.com>
3980
3981         Add a "should open urls externally" flag to DocumentLoader.
3982         rdar://problem/21025301 and https://bugs.webkit.org/show_bug.cgi?id=145417
3983
3984         Reviewed by Geoff Garen.
3985
3986         No new tests (No change in behavior, testable at API level with a followup patch)
3987
3988         * loader/DocumentLoader.cpp:
3989         (WebCore::DocumentLoader::setTriggeringAction): Apply the current flag value to the 
3990           new NavigationAction so it can be used later.
3991         * loader/DocumentLoader.h:
3992         (WebCore::DocumentLoader::setShouldOpenExternalURLsPolicy):
3993         (WebCore::DocumentLoader::shouldOpenExternalURLsPolicy):
3994         (WebCore::DocumentLoader::setTriggeringAction): Deleted.
3995
3996         FrameLoadRequest should hold the new flag to pass into FrameLoader machinery:
3997         * loader/FrameLoadRequest.h:
3998         (WebCore::FrameLoadRequest::setShouldOpenExternalURLsPolicy):