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