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