Fix iOS internal build after r182132.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-03-30  Simon Fraser  <simon.fraser@apple.com>
2
3         Fix iOS internal build after r182132.
4
5         * page/scrolling/ScrollingCoordinator.cpp:
6         (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion):
7
8 2015-03-30  Jer Noble  <jer.noble@apple.com>
9
10         [iOS] When Web Audio is interrupted by a phone call, it cannot be restarted.
11         https://bugs.webkit.org/show_bug.cgi?id=143190
12
13         Reviewed by Darin Adler.
14
15         Tests: webaudio/audiocontext-state-interrupted.html
16                webaudio/audiocontext-state.html
17
18         Implement the following methods and properties from the Web Audio spec:
19         close(), suspend(), resume(), onstatechange.
20
21         AudioContext will take more responsibility for tracking state and interruptions (and
22         AudioDestination will give up that responsibility). This means AudioContext must be a
23         MediaSessionClient, and own its own MediaSession. In return, AudioDestinationIOS and 
24         AudioDestinationMac relinquish both.
25
26         * Modules/webaudio/AudioContext.cpp:
27         (WebCore::AudioContext::AudioContext): Set default values in header.
28         (WebCore::AudioContext::uninitialize): Call setState() instead of setting m_state.
29         (WebCore::AudioContext::addReaction): Added. Append the callback to the appropriate vector for the state.
30         (WebCore::AudioContext::setState): Added. Fire events and resolve the appropriate reaction callbacks for the new state.
31         (WebCore::AudioContext::state): Return a string representing the context's state.
32         (WebCore::AudioContext::stop): Close the event queue.
33         (WebCore::AudioContext::startRendering): Call setState().
34         (WebCore::AudioContext::fireCompletionEvent): Call setState().
35         (WebCore::AudioContext::suspendContext): Added. Add reaction callback and call suspend() on the destination node.
36         (WebCore::AudioContext::resumeContext): Added. Add reaction callback and call resume() on the destination node.
37         (WebCore::AudioContext::closeContext): Added. Add reaction callback and call close() on the destination node.
38         (WebCore::AudioContext::suspendPlayback): Added. Suspend playback and set state to interrupted.
39         (WebCore::AudioContext::mayResumePlayback): Added. Conditionally resume playback.
40         * bindings/js/JSAudioContextCustom.cpp:
41         (WebCore::JSAudioContext::suspend): Added. Create and return a new Promise object.
42         (WebCore::JSAudioContext::resume): Ditto.
43         (WebCore::JSAudioContext::close): Ditto.
44         * Modules/webaudio/AudioContext.idl: Add new methods and properties.
45
46         Extensive organizational changes were made to AudioContext.h to group instance
47         variables together and add C++11 initializers in their declarations:
48
49         * Modules/webaudio/AudioContext.h:
50         (WebCore::AudioContext::mediaType): Moved from AudioDestinationNode.
51         (WebCore::AudioContext::presentationType): Ditto.
52         (WebCore::AudioContext::canReceiveRemoteControlCommands): Ditto.
53         (WebCore::AudioContext::didReceiveRemoteControlCommand): Ditto.
54         (WebCore::AudioContext::overrideBackgroundPlaybackRestriction): Ditto.
55         
56         Other changes to support the new AudioContext methods:
57
58         * Modules/webaudio/AudioDestinationNode.h:
59         (WebCore::AudioDestinationNode::resume): Add empty default virtual method.
60         (WebCore::AudioDestinationNode::suspend): Ditto.
61         (WebCore::AudioDestinationNode::close): Ditto.
62         * Modules/webaudio/DefaultAudioDestinationNode.cpp:
63         (WebCore::DefaultAudioDestinationNode::resume): Added. Pass to AudioDestination.
64         (WebCore::DefaultAudioDestinationNode::suspend): Ditto.
65         (WebCore::DefaultAudioDestinationNode::close): Ditto.
66         * Modules/webaudio/DefaultAudioDestinationNode.h:
67         * bindings/js/JSDOMPromise.h:
68         (WebCore::DeferredWrapper::resolve): Add an overload for a nullptr resolve value.
69         * dom/EventNames.h: Added 'statechange'.
70         * dom/ScriptExecutionContext.h:
71         (WebCore::ScriptExecutionContext::Task::Task): Add a constructor which takes a void() callback.
72
73         Modify MediaSession, AudioSession, and MediaSessionManager to support the new
74         interruption behavior.
75
76         * html/HTMLMediaElement.cpp:
77         (WebCore::HTMLMediaElement::suspendPlayback): Renamed from pausePlayback().
78         (WebCore::HTMLMediaElement::mayResumePlayback): Renamed from resumePlayback().
79         * html/HTMLMediaElement.h:
80         * platform/audio/AudioSession.cpp:
81         (WebCore::AudioSession::tryToSetActive): Renamed from setActive. Return true by default.
82         (WebCore::AudioSession::setActive): Deleted.
83         * platform/audio/AudioSession.h:
84         * platform/audio/MediaSession.cpp:
85         (WebCore::MediaSession::beginInterruption): pausePlayback() was renamed to suspendPlayback().
86         (WebCore::MediaSession::endInterruption): Always notify the client, telling it whether to resume.
87         (WebCore::MediaSession::clientWillBeginPlayback): Bail early if reentrant.  Check the (new) 
88             return value of sessionWillBeginPlayback() and remember to resume once the interruption ends.
89         (WebCore::MediaSession::clientWillPausePlayback): Bail early if reentrant.
90         (WebCore::MediaSession::pauseSession): pausePlayback() was renamed to suspendPlayback().
91         * platform/audio/MediaSession.h:
92         * platform/audio/MediaSessionManager.cpp:
93         (WebCore::MediaSessionManager::sessionWillBeginPlayback): Return false if not allowed to break interruption or 
94             if activating the audio session failed. Otherwise, end the interruption.
95         * platform/audio/MediaSessionManager.h:
96         * platform/audio/ios/AudioDestinationIOS.cpp:
97         (WebCore::AudioDestinationIOS::AudioDestinationIOS): m_mediaSession was removed.
98         (WebCore::AudioDestinationIOS::start): Ditto.
99         * platform/audio/ios/AudioDestinationIOS.h:
100         * platform/audio/ios/AudioSessionIOS.mm:
101         (WebCore::AudioSession::tryToSetActive): Renamed from setActive. Return false if the AVAudioSession could not be activated.
102         (WebCore::AudioSession::setActive): Deleted.
103         * platform/audio/ios/MediaSessionManagerIOS.h:
104         * platform/audio/ios/MediaSessionManagerIOS.mm:
105         (WebCore::MediaSessionManageriOS::sessionWillBeginPlayback): Do not update the now playing info if session playback was blocked.
106         * platform/audio/mac/AudioDestinationMac.cpp:
107         (WebCore::AudioDestinationMac::AudioDestinationMac): m_mediaSession was removed.
108         * platform/audio/mac/AudioDestinationMac.h:
109         * platform/audio/mac/AudioSessionMac.cpp:
110         (WebCore::AudioSession::tryToSetActive): Renamed from setActive(). Return true by default.
111         (WebCore::AudioSession::setActive): Deleted.
112         * platform/audio/mac/MediaSessionManagerMac.cpp:
113         (MediaSessionManager::updateSessionState): No longer attempt to activate the session, as this is done
114             MediaSessionManager::sessionWillBeginPlayback().
115         * testing/Internals.cpp:
116         (WebCore::Internals::setMediaSessionRestrictions): Add "InterruptedPlaybackNotPermitted".
117
118 2015-03-25 Xabier Rodriguez Calvar <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
119
120         [Streams API] Error storage should be moved from source to stream/reader
121         https://bugs.webkit.org/show_bug.cgi?id=143048
122
123         Reviewed by Benjamin Poulain.
124
125         This patch removes error storage from the source as it should be stored at the stream level as error access goes through the reader.
126         It removes abstract ReadableStreamSource::isErrored and the storage of JavaScript errors from ReadableStreamJSSource.
127
128         Existing tests cover most of the changes.
129         Added test case for creating readable stream from empty JS object.
130
131         * Modules/streams/ReadableStreamSource.h: Removing isErrored().
132         * bindings/js/JSReadableStreamCustom.cpp:
133         (WebCore::constructJSReadableStream): Added JS stream constructor parameters checking.
134         * bindings/js/ReadableStreamJSSource.cpp:
135         (WebCore::ReadableStreamJSSource::ReadableStreamJSSource): Removed JS stream constructor parameters checking.
136         (WebCore::ReadableStreamJSSource::start): Changed prototype of start so that start can throw errors directly.
137         (WebCore::ReadableStreamJSSource::setInternalError): Deleted.
138         * bindings/js/ReadableStreamJSSource.h: Removed m_error, setInternalError and updated start declaration.
139
140 2015-03-30  Philippe Normand  <pnormand@igalia.com>
141
142         [GStreamer] More GL shared context fixes
143         https://bugs.webkit.org/show_bug.cgi?id=143216
144
145         Reviewed by Carlos Garcia Campos.
146
147         Moved the GLX/EGL context tests to be done at runtime rather than
148         using build-time macros because in the GTK port at least, both EGL
149         and GLX support are mutually exclusive. Also fixed a couple wrong
150         defines (USE(GLES2) doesn't exist).
151
152         * platform/graphics/GLContext.h: Simple utility method to check if
153         the platform context is compatible with EGL APIs or not.
154         * platform/graphics/egl/GLContextEGL.h:
155         (WebCore::GLContextEGL::isEGLContext):
156         * platform/graphics/glx/GLContextGLX.h:
157         (WebCore::GLContextGLX::isEGLContext):
158         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
159         (WebCore::MediaPlayerPrivateGStreamer::ensureGstGLContext): Do
160         runtime checks and properly ensure GLES2/GL API usage.
161
162 2015-03-30  Marcos Chavarría Teijeiro  <chavarria1991@gmail.com>
163
164         Add support for deleting emoji on GTK
165         https://bugs.webkit.org/show_bug.cgi?id=141419
166
167         Reviewed by Gustavo Noronha Silva.
168
169         The code for deleting special group of characters was specific for
170         COCOA and EFL platforms. The fix consists on add GTK to the #if
171         preprocessor directive.
172
173         * rendering/RenderText.cpp:
174         (WebCore::RenderText::previousOffsetForBackwardDeletion):
175
176 2015-03-30  Benjamin Poulain  <benjamin@webkit.org>
177
178         Start the features.json files
179         https://bugs.webkit.org/show_bug.cgi?id=143207
180
181         Reviewed by Darin Adler.
182
183         * features.json: Added.
184
185 2015-03-29  Simon Fraser  <simon.fraser@apple.com>
186
187         Convert arguments to ScrollingCoordinator functions to references
188         https://bugs.webkit.org/show_bug.cgi?id=143198
189
190         Reviewed by Darin Adler.
191
192         Convert all the FrameView* and ScrollableArea* arguments to ScrollingCoordinator functions to
193         references, and use references in a few other places.
194
195         * dom/Document.cpp:
196         (WebCore::wheelEventHandlerCountChanged):
197         * loader/HistoryController.cpp:
198         (WebCore::HistoryController::restoreScrollPositionAndViewState):
199         * page/DebugPageOverlays.cpp:
200         (WebCore::NonFastScrollableRegionOverlay::updateRegion):
201         * page/Frame.cpp:
202         (WebCore::Frame::willDetachPage):
203         * page/FrameView.cpp:
204         (WebCore::FrameView::prepareForDetach):
205         (WebCore::FrameView::addSlowRepaintObject):
206         (WebCore::FrameView::removeSlowRepaintObject):
207         (WebCore::FrameView::addViewportConstrainedObject):
208         (WebCore::FrameView::removeViewportConstrainedObject):
209         (WebCore::FrameView::requestScrollPositionUpdate):
210         (WebCore::FrameView::performPostLayoutTasks):
211         (WebCore::FrameView::scrollableAreaSetChanged):
212         (WebCore::FrameView::wheelEvent):
213         * page/Page.cpp:
214         (WebCore::Page::nonFastScrollableRects):
215         * page/Page.h:
216         * page/scrolling/AsyncScrollingCoordinator.cpp:
217         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
218         (WebCore::AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged):
219         (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
220         (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
221         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
222         (WebCore::AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange):
223         (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
224         (WebCore::AsyncScrollingCoordinator::updateMainFrameScrollLayerPosition):
225         (WebCore::AsyncScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView):
226         * page/scrolling/AsyncScrollingCoordinator.h:
227         * page/scrolling/ScrollingCoordinator.cpp:
228         (WebCore::ScrollingCoordinator::pageDestroyed):
229         (WebCore::ScrollingCoordinator::coordinatesScrollingForFrameView):
230         (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion):
231         (WebCore::ScrollingCoordinator::frameViewWheelEventHandlerCountChanged):
232         (WebCore::ScrollingCoordinator::frameViewHasSlowRepaintObjectsDidChange):
233         (WebCore::ScrollingCoordinator::frameViewFixedObjectsDidChange):
234         (WebCore::ScrollingCoordinator::scrollLayerForScrollableArea):
235         (WebCore::ScrollingCoordinator::scrollLayerForFrameView):
236         (WebCore::ScrollingCoordinator::headerLayerForFrameView):
237         (WebCore::ScrollingCoordinator::footerLayerForFrameView):
238         (WebCore::ScrollingCoordinator::counterScrollingLayerForFrameView):
239         (WebCore::ScrollingCoordinator::insetClipLayerForFrameView):
240         (WebCore::ScrollingCoordinator::contentShadowLayerForFrameView):
241         (WebCore::ScrollingCoordinator::rootContentLayerForFrameView):
242         (WebCore::ScrollingCoordinator::frameViewRootLayerDidChange):
243         (WebCore::ScrollingCoordinator::hasVisibleSlowRepaintViewportConstrainedObjects):
244         (WebCore::ScrollingCoordinator::synchronousScrollingReasons):
245         (WebCore::ScrollingCoordinator::updateSynchronousScrollingReasons):
246         (WebCore::ScrollingCoordinator::setForceSynchronousScrollLayerPositionUpdates):
247         (WebCore::ScrollingCoordinator::shouldUpdateScrollLayerPositionSynchronously):
248         (WebCore::ScrollingCoordinator::replaySessionStateDidChange):
249         (WebCore::ScrollingCoordinator::synchronousScrollingReasonsAsText):
250         * page/scrolling/ScrollingCoordinator.h: Align the bitmask enums to make mistakes easier to spot.
251         (WebCore::ScrollingCoordinator::frameViewLayoutUpdated):
252         (WebCore::ScrollingCoordinator::frameViewNonFastScrollableRegionChanged):
253         (WebCore::ScrollingCoordinator::requestScrollPositionUpdate):
254         (WebCore::ScrollingCoordinator::handleWheelEvent):
255         (WebCore::ScrollingCoordinator::willDestroyScrollableArea):
256         (WebCore::ScrollingCoordinator::scrollableAreaScrollLayerDidChange):
257         (WebCore::ScrollingCoordinator::scrollableAreaScrollbarLayerDidChange):
258         (WebCore::ScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView):
259         * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
260         (WebCore::ScrollingCoordinatorCoordinatedGraphics::scrollableAreaScrollLayerDidChange):
261         (WebCore::ScrollingCoordinatorCoordinatedGraphics::willDestroyScrollableArea):
262         (WebCore::ScrollingCoordinatorCoordinatedGraphics::requestScrollPositionUpdate):
263         * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h:
264         * page/scrolling/ios/ScrollingCoordinatorIOS.h:
265         * page/scrolling/mac/ScrollingCoordinatorMac.h:
266         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
267         (WebCore::ScrollingCoordinatorMac::handleWheelEvent):
268         * rendering/RenderLayer.cpp:
269         (WebCore::RenderLayer::~RenderLayer):
270         * rendering/RenderLayerBacking.cpp:
271         (WebCore::RenderLayerBacking::updateOverflowControlsLayers):
272         * rendering/RenderLayerCompositor.cpp:
273         (WebCore::RenderLayerCompositor::updateBacking):
274         (WebCore::RenderLayerCompositor::hasCoordinatedScrolling):
275         (WebCore::RenderLayerCompositor::scrollingLayerDidChange):
276         (WebCore::RenderLayerCompositor::updateLayerForHeader):
277         (WebCore::RenderLayerCompositor::updateLayerForFooter):
278         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
279         (WebCore::RenderLayerCompositor::destroyRootLayer):
280         (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
281         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
282         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
283         (WebCore::RenderLayerCompositor::didAddScrollingLayer):
284         * testing/Internals.cpp:
285         (WebCore::Internals::nonFastScrollableRects):
286
287 2015-03-29  Benjamin Poulain  <benjamin@webkit.org>
288
289         Use :matches() instead of :-webkit-any() for the sections and headings default style
290         https://bugs.webkit.org/show_bug.cgi?id=143197
291
292         Reviewed by Darin Adler.
293
294         We no longer need to use the :-webkit-any() hack in the default stylesheet.
295
296         The pseudo class :matches() also support correct specificity. This is not observable
297         since those selector do not conflict with any other rule in the default stylesheet.
298
299         * css/CSSSelector.h:
300         * css/SelectorChecker.cpp:
301         (WebCore::SelectorChecker::determineLinkMatchType):
302         * css/html.css:
303         (:matches(article, aside, nav, section) h1):
304         (:matches(article, aside, nav, section) :matches(article, aside, nav, section) h1):
305         (:matches(article, aside, nav, section) :matches(article, aside, nav, section) :matches(article, aside, nav, section) h1):
306         (:matches(article, aside, nav, section) :matches(article, aside, nav, section) :matches(article, aside, nav, section) :matches(article, aside, nav, section) h1):
307         (:matches(article, aside, nav, section) :matches(article, aside, nav, section) :matches(article, aside, nav, section) :matches(article, aside, nav, section) :matches(article, aside, nav, section) h1):
308         (:-webkit-any(article,aside,nav,section) h1): Deleted.
309         (:-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) h1): Deleted.
310         (:-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) h1): Deleted.
311         (:-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) h1): Deleted.
312         (:-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) h1): Deleted.
313
314 2015-03-29  Benjamin Poulain  <benjamin@webkit.org>
315
316         `currentColor` computes to the same colour on all elements, even if 'color' is inherited differently
317         https://bugs.webkit.org/show_bug.cgi?id=133420
318
319         Reviewed by Darin Adler.
320
321         When resolving a style with the help of the property cache, we were
322         completely ignoring currentColor.
323
324         Since you can set currentColor on properties that are not inherited,
325         those properties would just be copied from the cached style, which
326         may have a completely different inherited color.
327
328         This pacth fixes the issue by preventing any MatchResult from hitting
329         the cache if it contains any non-inherited property that would require
330         resolution by the cache:
331         -Using the inherit value.
332         -Using the currentColor value.
333
334         Tests: fast/css/currentColor-on-before-after-pseudo-elements.html
335                fast/css/currentColor-style-update-reftest.html
336                fast/css/currentColor-value-style-update.html
337
338         * css/ElementRuleCollector.cpp:
339         (WebCore::ElementRuleCollector::addElementStyleProperties):
340         (WebCore::ElementRuleCollector::matchAuthorRules):
341         (WebCore::ElementRuleCollector::matchUserRules):
342         (WebCore::ElementRuleCollector::matchUARules):
343         * css/StyleResolver.cpp:
344         (WebCore::StyleResolver::MatchResult::addMatchedProperties):
345         (WebCore::StyleResolver::styleForKeyframe):
346         (WebCore::StyleResolver::pseudoStyleForElement):
347         (WebCore::StyleResolver::styleForPage):
348         (WebCore::StyleResolver::findFromMatchedPropertiesCache):
349         (WebCore::StyleResolver::addToMatchedPropertiesCache):
350         (WebCore::extractDirectionAndWritingMode):
351         (WebCore::StyleResolver::applyMatchedProperties):
352         (WebCore::StyleResolver::CascadedProperties::addStyleProperties):
353         (WebCore::StyleResolver::CascadedProperties::addMatches):
354         * css/StyleResolver.h:
355         (WebCore::StyleResolver::MatchResult::matchedProperties):
356
357 2015-03-29  Benjamin Poulain  <benjamin@webkit.org>
358
359         Enable :any-link by default
360         https://bugs.webkit.org/show_bug.cgi?id=143201
361
362         Reviewed by Sam Weinig.
363
364         The pseudo class :any-link has been stable for a while. This patch enables
365         it by default and remove the -webkit- prefix on the default style.
366
367         * css/CSSDefaultStyleSheets.cpp:
368         * css/CSSSelector.cpp:
369         (WebCore::CSSSelector::selectorText):
370         * css/CSSSelector.h:
371         * css/RuleSet.cpp:
372         (WebCore::RuleSet::addRule):
373         * css/SelectorChecker.cpp:
374         (WebCore::SelectorChecker::checkOne):
375         * css/SelectorChecker.h:
376         (WebCore::SelectorChecker::isCommonPseudoClassSelector):
377         * css/SelectorPseudoClassAndCompatibilityElementMap.in:
378         * css/html.css:
379         (a:any-link):
380         (a:any-link:active):
381         (:any-link img):
382         (a:-webkit-any-link): Deleted.
383         (a:-webkit-any-link:active): Deleted.
384         (:-webkit-any-link img): Deleted.
385         * cssjit/SelectorCompiler.cpp:
386         (WebCore::SelectorCompiler::addPseudoClassType):
387         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementLinkMatching):
388
389 2015-03-29  Joonghun Park  <jh718.park@samsung.com>
390
391         nullptr cleanup in RenderFooBox classes
392         https://bugs.webkit.org/show_bug.cgi?id=143182
393
394         Reviewed by Ryosuke Niwa.
395
396         No new tests, no behavior changes
397
398         Replace 0 with nullptr in RenderFooBox classes.
399
400         * rendering/RenderBox.cpp:
401         (WebCore::RenderBox::RenderBox):
402         (WebCore::RenderBox::paintFillLayer):
403         (WebCore::RenderBox::shrinkLogicalWidthToAvoidFloats):
404         (WebCore::RenderBox::containingBlockAvailableLineWidthInRegion):
405         (WebCore::RenderBox::renderBoxRegionInfo):
406         (WebCore::RenderBox::computePositionedLogicalWidthUsing):
407         (WebCore::RenderBox::computePositionedLogicalHeightUsing):
408         (WebCore::RenderBox::computePositionedLogicalWidthReplaced):
409         (WebCore::RenderBox::positionForPoint):
410         (WebCore::RenderBox::layoutOverflowRectForPropagation):
411         * rendering/RenderBox.h:
412         (WebCore::RenderBox::setMarginBefore):
413         (WebCore::RenderBox::setMarginAfter):
414         (WebCore::RenderBox::setMarginStart):
415         (WebCore::RenderBox::setMarginEnd):
416         (WebCore::RenderBox::createAnonymousBoxWithSameTypeAs):
417         (WebCore::RenderBox::setInlineBoxWrapper):
418         * rendering/RenderBoxModelObject.cpp:
419         (WebCore::RenderBoxModelObject::willBeDestroyed):
420         (WebCore::RenderBoxModelObject::paintMaskForTextFillBox):
421         (WebCore::RenderBoxModelObject::paintBorderSides):
422         (WebCore::RenderBoxModelObject::firstLetterRemainingText):
423         * rendering/RenderBoxModelObject.h:
424         (WebCore::RenderBoxModelObject::moveChildTo):
425         (WebCore::RenderBoxModelObject::moveAllChildrenTo):
426         (WebCore::RenderBoxModelObject::moveChildrenTo):
427         * rendering/RenderDeprecatedFlexibleBox.cpp:
428         (WebCore::FlexBoxIterator::reset):
429         (WebCore::FlexBoxIterator::next):
430         * rendering/RenderDeprecatedFlexibleBox.h:
431         * rendering/RenderFlexibleBox.cpp:
432         (WebCore::RenderFlexibleBox::firstLineBaseline):
433         (WebCore::RenderFlexibleBox::computeMainAxisExtentForChild):
434         * rendering/RenderLineBoxList.cpp:
435         (WebCore::RenderLineBoxList::deleteLineBoxTree):
436         (WebCore::RenderLineBoxList::extractLineBox):
437         (WebCore::RenderLineBoxList::deleteLineBoxes):
438         (WebCore::RenderLineBoxList::checkConsistency):
439         * rendering/RenderLineBoxList.h:
440         (WebCore::RenderLineBoxList::RenderLineBoxList):
441         * rendering/RenderListBox.cpp:
442         (WebCore::RenderListBox::enclosingScrollableArea):
443         (WebCore::RenderListBox::setHasVerticalScrollbar):
444         * rendering/RenderListBox.h:
445
446 2015-03-29  Darin Adler  <darin@apple.com>
447
448         HTMLCollection caches incorrect length if item(0) is called before length on an empty collection
449         https://bugs.webkit.org/show_bug.cgi?id=143203
450         rdar://problem/18460462
451
452         Reviewed by Antti Koivisto.
453
454         Test: fast/dom/htmlcollection-length-after-item-2.html
455
456         * dom/CollectionIndexCache.h:
457         (CollectionIndexCache::nodeAt): If we hit the end looking for index 0, cache a length
458         of 0, not a length of 1.
459
460 2015-03-29  Darin Adler  <darin@apple.com>
461
462         Remove unneeded SVG code, including most isSupportedAttribute functions
463         https://bugs.webkit.org/show_bug.cgi?id=143194
464
465         Reviewed by Antti Koivisto.
466
467         - Removed most implementations of isSupportedAttribute. Others can be removed in
468           future patches. The ones left behind are now all private static member functions.
469           It's dangerous for them to be public because they tend to indicate which attributes
470           are supported at a particular level in the class hierarchy and they are not virtual
471           functions; might want to rethink the function name if we keep any of these long term.
472
473         - Removed unneeded includes, especially of Attr.h and Attribute.h.
474
475         - Changed most parseAttribute and svgAttributeChanged functions so they no longer
476           rely on checking attribute names against a set. Also removed lots of unneeded calls
477           to SVGLangSpace::parseAttribute, which is called by SVGElement::parseAttribute and
478           need not be called by derived classes.
479
480         - Removed return values from parseAttribute functions. Skipping other parseAttribute
481           logic is not an important optimization and makes functions needlessly complex.
482
483         - Moved use of InstanceInvalidationGuard closer to where they are needed. Eventually
484           we may be able to remove many of these.
485
486         - Used auto in a few places where the same type is repeated twice on the same line of
487           code, and auto makes it a bit smaller.
488
489         - Got rid of protected sections in some final classes; doesn't make sense to combine
490           these two. Also moved a few functions from protected to private in other classes.
491
492         - Made a number of functions into static member functions in the base classes such
493           as SVGLangSpace; they were not making any use of the object, and so it was wasteful
494           to compile them as non-static member functions.
495
496         * rendering/svg/RenderSVGImage.cpp: Removed unneeded includes.
497         * svg/SVGAElement.cpp: Removed unneeded includes.
498         (WebCore::SVGAElement::isSupportedAttribute): Deleted.
499         (WebCore::SVGAElement::parseAttribute): Don't use isSupportedAttribute.
500         (WebCore::SVGAElement::svgAttributeChanged): Don't use isSupportedAttribute.
501         * svg/SVGAElement.h: Removed isSupportedAttribute.
502         * svg/SVGAnimateMotionElement.cpp: Removed unneeded includes.
503         (WebCore::SVGAnimateMotionElement::isSupportedAttribute): Deleted.
504         (WebCore::SVGAnimateMotionElement::parseAttribute): Don't use isSupportedAttribute.
505         * svg/SVGAnimateMotionElement.h: Removed isSupportedAttribute.
506         * svg/SVGAnimateTransformElement.cpp:
507         (WebCore::SVGAnimateTransformElement::isSupportedAttribute): Deleted.
508         (WebCore::SVGAnimateTransformElement::parseAttribute): Don't use isSupportedAttribute.
509         * svg/SVGAnimateTransformElement.h: Removed isSupportedAttribute.
510         * svg/SVGAnimationElement.cpp:
511         (WebCore::SVGAnimationElement::parseAttribute): Don't use isSupportedAttribute.
512         * svg/SVGCircleElement.cpp:
513         (WebCore::SVGCircleElement::isSupportedAttribute): Deleted.
514         (WebCore::SVGCircleElement::parseAttribute): Don't use isSupportedAttribute.
515         (WebCore::SVGCircleElement::svgAttributeChanged): Don't use isSupportedAttribute.
516         * svg/SVGCircleElement.h: Removed isSupportedAttribute.
517         * svg/SVGClipPathElement.cpp: Removed unneeded includes.
518         (WebCore::SVGClipPathElement::parseAttribute): Don't use isSupportedAttribute.
519         * svg/SVGComponentTransferFunctionElement.cpp:
520         (WebCore::SVGComponentTransferFunctionElement::parseAttribute): Don't use isSupportedAttribute.
521         * svg/SVGCursorElement.cpp: Removed unneeded includes.
522         (WebCore::SVGCursorElement::parseAttribute): Don't use isSupportedAttribute.
523         (WebCore::SVGCursorElement::svgAttributeChanged): Don't use isSupportedAttribute.
524         * svg/SVGElement.cpp: Removed unneeded includes.
525         * svg/SVGEllipseElement.cpp: Removed unneeded includes.
526         (WebCore::SVGEllipseElement::isSupportedAttribute): Deleted.
527         (WebCore::SVGEllipseElement::parseAttribute): Don't use isSupportedAttribute.
528         (WebCore::SVGEllipseElement::svgAttributeChanged): Don't use isSupportedAttribute.
529         * svg/SVGEllipseElement.h: Removed isSupportedAttribute.
530         * svg/SVGExternalResourcesRequired.cpp: Removed unneeded includes.
531         (WebCore::SVGExternalResourcesRequired::parseAttribute): Don't return a boolean.
532         * svg/SVGExternalResourcesRequired.h: Don't return a boolean.
533         * svg/SVGFEBlendElement.cpp: Removed unneeded includes.
534         (WebCore::SVGFEBlendElement::isSupportedAttribute): Deleted.
535         (WebCore::SVGFEBlendElement::parseAttribute): Don't use isSupportedAttribute.
536         (WebCore::SVGFEBlendElement::svgAttributeChanged): Don't use isSupportedAttribute.
537         * svg/SVGFEBlendElement.h: Removed isSupportedAttribute.
538         * svg/SVGFEColorMatrixElement.cpp: Removed unneeded includes.
539         (WebCore::SVGFEColorMatrixElement::isSupportedAttribute): Deleted.
540         (WebCore::SVGFEColorMatrixElement::parseAttribute): Don't use isSupportedAttribute.
541         (WebCore::SVGFEColorMatrixElement::svgAttributeChanged): Don't use isSupportedAttribute.
542         * svg/SVGFEColorMatrixElement.h: Removed isSupportedAttribute.
543         * svg/SVGFEComponentTransferElement.cpp: Removed unneeded includes.
544         (WebCore::SVGFEComponentTransferElement::isSupportedAttribute): Deleted.
545         (WebCore::SVGFEComponentTransferElement::parseAttribute): Don't use isSupportedAttribute.
546         * svg/SVGFEComponentTransferElement.h: Removed unneeded includes.
547         * svg/SVGFECompositeElement.cpp: Removed unneeded includes.
548         (WebCore::SVGFECompositeElement::isSupportedAttribute): Deleted.
549         (WebCore::SVGFECompositeElement::parseAttribute): Don't use isSupportedAttribute.
550         (WebCore::SVGFECompositeElement::svgAttributeChanged): Don't use isSupportedAttribute.
551         * svg/SVGFECompositeElement.h:
552         * svg/SVGFEConvolveMatrixElement.cpp: Removed unneeded includes.
553         (WebCore::SVGFEConvolveMatrixElement::isSupportedAttribute): Deleted.
554         (WebCore::SVGFEConvolveMatrixElement::parseAttribute): Don't use isSupportedAttribute.
555         (WebCore::SVGFEConvolveMatrixElement::svgAttributeChanged): Don't use isSupportedAttribute.
556         * svg/SVGFEConvolveMatrixElement.h:
557         * svg/SVGFEDiffuseLightingElement.cpp: Removed unneeded includes.
558         (WebCore::SVGFEDiffuseLightingElement::isSupportedAttribute): Deleted.
559         (WebCore::SVGFEDiffuseLightingElement::parseAttribute): Don't use isSupportedAttribute.
560         (WebCore::SVGFEDiffuseLightingElement::svgAttributeChanged): Don't use isSupportedAttribute.
561         * svg/SVGFEDiffuseLightingElement.h:
562         * svg/SVGFEDisplacementMapElement.cpp: Removed unneeded includes.
563         (WebCore::SVGFEDisplacementMapElement::isSupportedAttribute): Deleted.
564         (WebCore::SVGFEDisplacementMapElement::parseAttribute): Don't use isSupportedAttribute.
565         (WebCore::SVGFEDisplacementMapElement::svgAttributeChanged): Don't use isSupportedAttribute.
566         * svg/SVGFEDisplacementMapElement.h:
567         * svg/SVGFEDropShadowElement.cpp: Removed unneeded includes.
568         (WebCore::SVGFEDropShadowElement::isSupportedAttribute): Deleted.
569         (WebCore::SVGFEDropShadowElement::parseAttribute): Don't use isSupportedAttribute.
570         (WebCore::SVGFEDropShadowElement::svgAttributeChanged): Don't use isSupportedAttribute.
571         * svg/SVGFEDropShadowElement.h:
572         * svg/SVGFEFloodElement.cpp: Removed unneeded includes.
573         * svg/SVGFEGaussianBlurElement.cpp: Removed unneeded includes.
574         (WebCore::SVGFEGaussianBlurElement::isSupportedAttribute): Deleted.
575         (WebCore::SVGFEGaussianBlurElement::parseAttribute): Don't use isSupportedAttribute.
576         (WebCore::SVGFEGaussianBlurElement::svgAttributeChanged): Don't use isSupportedAttribute.
577         * svg/SVGFEGaussianBlurElement.h:
578         * svg/SVGFEImageElement.cpp: Removed unneeded includes.
579         (WebCore::SVGFEImageElement::isSupportedAttribute): Deleted.
580         (WebCore::SVGFEImageElement::parseAttribute): Don't use isSupportedAttribute.
581         (WebCore::SVGFEImageElement::svgAttributeChanged): Don't use isSupportedAttribute.
582         * svg/SVGFEImageElement.h:
583         * svg/SVGFELightElement.cpp: Removed unneeded includes.
584         (WebCore::SVGFELightElement::isSupportedAttribute): Deleted.
585         (WebCore::SVGFELightElement::parseAttribute): Don't use isSupportedAttribute.
586         (WebCore::SVGFELightElement::svgAttributeChanged): Don't use isSupportedAttribute.
587         * svg/SVGFELightElement.h:
588         * svg/SVGFEMergeNodeElement.cpp: Removed unneeded includes.
589         (WebCore::SVGFEMergeNodeElement::isSupportedAttribute): Deleted.
590         (WebCore::SVGFEMergeNodeElement::parseAttribute): Don't use isSupportedAttribute.
591         (WebCore::SVGFEMergeNodeElement::svgAttributeChanged): Don't use isSupportedAttribute.
592         * svg/SVGFEMergeNodeElement.h:
593         * svg/SVGFEMorphologyElement.cpp: Removed unneeded includes.
594         (WebCore::SVGFEMorphologyElement::isSupportedAttribute): Deleted.
595         (WebCore::SVGFEMorphologyElement::parseAttribute): Don't use isSupportedAttribute.
596         (WebCore::SVGFEMorphologyElement::svgAttributeChanged): Don't use isSupportedAttribute.
597         * svg/SVGFEMorphologyElement.h:
598         * svg/SVGFEOffsetElement.cpp: Removed unneeded includes.
599         (WebCore::SVGFEOffsetElement::isSupportedAttribute): Deleted.
600         (WebCore::SVGFEOffsetElement::parseAttribute): Don't use isSupportedAttribute.
601         (WebCore::SVGFEOffsetElement::svgAttributeChanged): Don't use isSupportedAttribute.
602         * svg/SVGFEOffsetElement.h:
603         * svg/SVGFESpecularLightingElement.cpp: Removed unneeded includes.
604         (WebCore::SVGFESpecularLightingElement::isSupportedAttribute): Deleted.
605         (WebCore::SVGFESpecularLightingElement::parseAttribute): Don't use isSupportedAttribute.
606         (WebCore::SVGFESpecularLightingElement::svgAttributeChanged): Don't use isSupportedAttribute.
607         * svg/SVGFESpecularLightingElement.h:
608         * svg/SVGFETileElement.cpp: Removed unneeded includes.
609         (WebCore::SVGFETileElement::isSupportedAttribute): Deleted.
610         (WebCore::SVGFETileElement::parseAttribute): Don't use isSupportedAttribute.
611         (WebCore::SVGFETileElement::svgAttributeChanged): Don't use isSupportedAttribute.
612         * svg/SVGFETileElement.h:
613         * svg/SVGFETurbulenceElement.cpp: Removed unneeded includes.
614         (WebCore::SVGFETurbulenceElement::isSupportedAttribute): Deleted.
615         (WebCore::SVGFETurbulenceElement::parseAttribute): Don't use isSupportedAttribute.
616         (WebCore::SVGFETurbulenceElement::svgAttributeChanged): Don't use isSupportedAttribute.
617         * svg/SVGFETurbulenceElement.h:
618         * svg/SVGFilterElement.cpp: Removed unneeded includes.
619         (WebCore::SVGFilterElement::parseAttribute): Don't use isSupportedAttribute.
620         * svg/SVGFilterPrimitiveStandardAttributes.cpp: Removed unneeded includes.
621         (WebCore::SVGFilterPrimitiveStandardAttributes::parseAttribute): Don't use isSupportedAttribute.
622         * svg/SVGFilterPrimitiveStandardAttributes.h: Removed isSupportedAttribute and also moved a
623         couple functions out of the class definition.
624         * svg/SVGFitToViewBox.cpp: Removed unneeded includes.
625         * svg/SVGFontFaceElement.cpp: Removed unneeded includes.
626         * svg/SVGFontFaceUriElement.cpp: Removed unneeded includes.
627         * svg/SVGForeignObjectElement.cpp: Removed unneeded includes.
628         (WebCore::SVGForeignObjectElement::parseAttribute): Don't use isSupportedAttribute.
629         * svg/SVGGElement.cpp: Removed unneeded includes.
630         (WebCore::SVGGElement::parseAttribute): Don't use isSupportedAttribute.
631         * svg/SVGGlyphElement.cpp: Removed unneeded includes.
632         * svg/SVGGlyphRefElement.cpp: Removed unneeded includes.
633         (WebCore::SVGGlyphRefElement::hasValidGlyphElement): Rewrote to use is<> instead of hasTagName.
634         (WebCore::SVGGlyphRefElement::parseAttribute): Don't use return value from SVGURIReference::parseAttribute.
635         * svg/SVGGradientElement.cpp: Removed unneeded includes.
636         (WebCore::SVGGradientElement::parseAttribute): Don't use isSupportedAttribute.
637         * svg/SVGGraphicsElement.cpp: Removed unneeded includes.
638         (WebCore::SVGGraphicsElement::parseAttribute): Don't use isSupportedAttribute.
639         * svg/SVGImageElement.cpp: Removed unneeded includes.
640         (WebCore::SVGImageElement::parseAttribute): Don't use isSupportedAttribute.
641         * svg/SVGLangSpace.cpp: Removed unneeded includes.
642         (WebCore::SVGLangSpace::parseAttribute): Removed the return value.
643         * svg/SVGLangSpace.h: Converted functions to static member functions and removed the
644         return value from parseAttribute.
645         * svg/SVGLineElement.cpp: Removed unneeded includes.
646         (WebCore::SVGLineElement::parseAttribute): Don't use isSupportedAttribute.
647         * svg/SVGLinearGradientElement.cpp: Removed unneeded includes.
648         (WebCore::SVGLinearGradientElement::parseAttribute): Don't use isSupportedAttribute.
649         * svg/SVGMPathElement.cpp: Removed unneeded includes.
650         (WebCore::SVGMPathElement::isSupportedAttribute): Deleted.
651         (WebCore::SVGMPathElement::parseAttribute): Don't use isSupportedAttribute.
652         (WebCore::SVGMPathElement::svgAttributeChanged): Don't use isSupportedAttribute.
653         * svg/SVGMPathElement.h: Removed isSupportedAttribute and made didNotifySubtreeInsertions
654         private instead of protected.
655         * svg/SVGMarkerElement.cpp: Removed unneeded includes.
656         (WebCore::SVGMarkerElement::parseAttribute): Don't use isSupportedAttribute.
657         * svg/SVGMaskElement.cpp: Removed unneeded includes.
658         (WebCore::SVGMaskElement::parseAttribute): Don't use isSupportedAttribute.
659         * svg/SVGPathElement.cpp: Removed unneeded includes.
660         (WebCore::SVGPathElement::parseAttribute): Don't use isSupportedAttribute.
661         * svg/SVGPatternElement.cpp: Removed unneeded includes.
662         (WebCore::SVGPatternElement::parseAttribute): Don't use isSupportedAttribute.
663         * svg/SVGPolyElement.cpp: Removed unneeded includes.
664         (WebCore::SVGPolyElement::isSupportedAttribute): Deleted.
665         (WebCore::SVGPolyElement::parseAttribute): Don't use isSupportedAttribute.
666         (WebCore::SVGPolyElement::svgAttributeChanged): Don't use isSupportedAttribute.
667         * svg/SVGPolyElement.h:
668         * svg/SVGRadialGradientElement.cpp: Removed unneeded includes.
669         (WebCore::SVGRadialGradientElement::parseAttribute): Don't use isSupportedAttribute.
670         * svg/SVGRectElement.cpp: Removed unneeded includes.
671         (WebCore::SVGRectElement::isSupportedAttribute): Deleted.
672         (WebCore::SVGRectElement::parseAttribute): Don't use isSupportedAttribute.
673         (WebCore::SVGRectElement::svgAttributeChanged): Don't use isSupportedAttribute.
674         * svg/SVGRectElement.h:
675         * svg/SVGSVGElement.cpp: Removed unneeded includes.
676         (WebCore::SVGSVGElement::parseAttribute): Don't use isSupportedAttribute.
677         * svg/SVGScriptElement.cpp: Removed unneeded includes.
678         * svg/SVGStopElement.cpp: Removed unneeded includes.
679         (WebCore::SVGStopElement::isSupportedAttribute): Deleted.
680         (WebCore::SVGStopElement::parseAttribute): Don't use isSupportedAttribute.
681         (WebCore::SVGStopElement::svgAttributeChanged): Don't use isSupportedAttribute.
682         * svg/SVGStopElement.h: Removed isSupportedAttribute.
683         * svg/SVGStyleElement.cpp: Removed unneeded includes.
684         (WebCore::SVGStyleElement::isSupportedAttribute): Deleted.
685         (WebCore::SVGStyleElement::parseAttribute): Don't use isSupportedAttribute.
686         * svg/SVGStyleElement.h: Removed isSupportedAttribute.
687         * svg/SVGSymbolElement.cpp: Removed unneeded includes.
688         (WebCore::SVGSymbolElement::isSupportedAttribute): Deleted.
689         (WebCore::SVGSymbolElement::parseAttribute): Don't use isSupportedAttribute.
690         (WebCore::SVGSymbolElement::svgAttributeChanged): Don't use isSupportedAttribute.
691         * svg/SVGSymbolElement.h: Removed isSupportedAttribute.
692         * svg/SVGTRefElement.cpp: Removed unneeded includes.
693         (WebCore::SVGTRefElement::isSupportedAttribute): Deleted.
694         (WebCore::SVGTRefElement::parseAttribute): Don't use isSupportedAttribute.
695         (WebCore::SVGTRefElement::svgAttributeChanged): Don't use isSupportedAttribute.
696         * svg/SVGTRefElement.h: Removed isSupportedAttribute and made didNotifySubtreeInsertions
697         private instead of protected.
698         * svg/SVGTests.cpp: Removed unneeded includes.
699         (WebCore::SVGTests::parseAttribute): Removed return value.
700         * svg/SVGTests.h: Removed return value of parseAttribute.
701         * svg/SVGTextContentElement.cpp: Removed unneeded includes.
702         (WebCore::SVGTextContentElement::collectStyleForPresentationAttribute): Don't use
703         isSupportedAttribute. Also removed global to optimize comparing attribute value against
704         the string "preserve".
705         (WebCore::SVGTextContentElement::parseAttribute): Don't use isSupportedAttribute.
706         (WebCore::SVGTextContentElement::svgAttributeChanged): Don't use isSupportedAttribute.
707         * svg/SVGTextContentElement.h: Made isSupportedAttribute private instead of protected.
708         * svg/SVGTextElement.cpp: Removed unneeded includes.
709         * svg/SVGTextPathElement.cpp: Removed unneeded includes.
710         (WebCore::SVGTextPathElement::parseAttribute): Don't use isSupportedAttribute.
711         * svg/SVGTextPositioningElement.cpp: Removed unneeded includes.
712         (WebCore::SVGTextPositioningElement::isSupportedAttribute): Deleted.
713         (WebCore::SVGTextPositioningElement::parseAttribute): Don't use isSupportedAttribute.
714         (WebCore::SVGTextPositioningElement::svgAttributeChanged): Don't use isSupportedAttribute.
715         * svg/SVGTextPositioningElement.h: Removed isSupportedAttribute and made some functions
716         private insetad of protected.
717         * svg/SVGURIReference.cpp: Removed unneeded includes.
718         (WebCore::SVGURIReference::parseAttribute): Don't use isSupportedAttribute.
719         * svg/SVGURIReference.h:
720         (WebCore::SVGURIReference::isExternalURIReference):
721         * svg/SVGUseElement.cpp: Removed unneeded includes.
722         (WebCore::SVGUseElement::parseAttribute): Don't use isSupportedAttribute.
723         * svg/SVGViewElement.h: Removed isSupportedAttribute.
724         * svg/animation/SVGSMILElement.cpp: Removed unneeded includes.
725
726 2015-03-29  Darin Adler  <darin@apple.com>
727
728         Remove unneeded includes of "Attribute.h"
729         https://bugs.webkit.org/show_bug.cgi?id=143195
730
731         Reviewed by Antti Koivisto.
732
733         * css/StyleResolver.cpp:
734         * html/HTMLAnchorElement.cpp:
735         * html/HTMLAreaElement.cpp:
736         * html/HTMLBRElement.cpp:
737         * html/HTMLBaseElement.cpp:
738         * html/HTMLBodyElement.cpp:
739         * html/HTMLButtonElement.cpp:
740         * html/HTMLCanvasElement.cpp:
741         * html/HTMLDivElement.cpp:
742         * html/HTMLElement.cpp:
743         * html/HTMLEmbedElement.cpp:
744         * html/HTMLFontElement.cpp:
745         * html/HTMLFormControlElement.cpp:
746         * html/HTMLFormElement.cpp:
747         * html/HTMLFrameElement.cpp:
748         * html/HTMLFrameElementBase.cpp:
749         * html/HTMLFrameSetElement.cpp:
750         * html/HTMLHRElement.cpp:
751         * html/HTMLIFrameElement.cpp:
752         * html/HTMLImageElement.cpp:
753         * html/HTMLOListElement.cpp:
754         * html/HTMLOptionElement.cpp:
755         * html/HTMLParagraphElement.cpp:
756         * html/HTMLParamElement.cpp:
757         * html/HTMLPlugInElement.cpp:
758         * html/HTMLPreElement.cpp:
759         * html/HTMLProgressElement.cpp:
760         * html/HTMLScriptElement.cpp:
761         * html/HTMLSelectElement.cpp:
762         * html/HTMLStyleElement.cpp:
763         * html/HTMLTableCaptionElement.cpp:
764         * html/HTMLTableCellElement.cpp:
765         * html/HTMLTableColElement.cpp:
766         * html/HTMLTableElement.cpp:
767         * html/HTMLTablePartElement.cpp:
768         * html/HTMLTextAreaElement.cpp:
769         * html/HTMLTextFormControlElement.cpp:
770         * html/HTMLUListElement.cpp:
771         * html/HTMLVideoElement.cpp:
772         * html/parser/HTMLScriptRunner.cpp:
773         * inspector/InspectorNodeFinder.cpp:
774         Removed includes of "Attribute.h".
775
776 2015-03-28  Eric Carlson  <eric.carlson@apple.com>
777
778         [Mac] Update for output device API change
779         https://bugs.webkit.org/show_bug.cgi?id=143187
780
781         Reviewed by Zalan Bujtas.
782
783         The API used for output device is being deprecated, update to the replacement.
784
785         * WebCore.xcodeproj/project.pbxproj: Add SPI headers.
786
787         * platform/graphics/MediaPlaybackTarget.h:
788         (WebCore::MediaPlaybackTarget::MediaPlaybackTarget): Update for API change.
789         (WebCore::MediaPlaybackTarget::setDevicePickerContext):
790         (WebCore::MediaPlaybackTarget::devicePickerContext):
791
792         * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
793         (WebCore::MediaPlaybackTarget::encode):
794         (WebCore::MediaPlaybackTarget::decode):
795
796         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
797         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
798         (WebCore::MediaPlaybackTargetPickerMac::MediaPlaybackTargetPickerMac):
799         (WebCore::MediaPlaybackTargetPickerMac::~MediaPlaybackTargetPickerMac):
800         (WebCore::MediaPlaybackTargetPickerMac::outputeDeviceAvailabilityChangedTimerFired):
801         (WebCore::MediaPlaybackTargetPickerMac::devicePicker):
802         (WebCore::MediaPlaybackTargetPickerMac::currentDeviceDidChange):
803         (WebCore::MediaPlaybackTargetPickerMac::stopMonitoringPlaybackTargets):
804         (-[WebAVOutputDeviceMenuControllerHelper observeValueForKeyPath:ofObject:change:context:]):
805         (-[WebAVOutputDevicePickerMenuControllerHelper observeValueForKeyPath:ofObject:change:context:]): Deleted.
806
807         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
808         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
809         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
810         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
811         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget):
812         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
813
814         * platform/spi/cocoa/AVKitSPI.h: Copied from Source/WebCore/platform/spi/ios/AVKitSPI.h. Moved
815             from ios directory, added Mac includes and prototypes.
816         * platform/spi/ios/AVKitSPI.h: Removed.
817
818         * platform/spi/mac/AVFoundationSPI.h: Added.
819
820 2015-03-28  Simon Fraser  <simon.fraser@apple.com>
821
822         Optimize RenderLayer::intersectsDamageRect() slightly
823         https://bugs.webkit.org/show_bug.cgi?id=143186
824
825         Reviewed by Zalan Bujtas.
826
827         We can early return from RenderLayer::intersectsDamageRect() if the
828         damageRect is empty, since nothing will intersect with the empty rect.
829         
830         Slight performance gain when scrolling overflow-scroll with lots of nested,
831         clipping layers.
832
833         * rendering/RenderLayer.cpp:
834         (WebCore::RenderLayer::calculateClipRects):
835
836 2015-03-28  Anders Carlsson  <andersca@apple.com>
837
838         Remove an unused SPI method from WebKitLegacy
839         https://bugs.webkit.org/show_bug.cgi?id=143185
840
841         Reviewed by Sam Weinig.
842
843         * loader/appcache/ApplicationCacheStorage.cpp:
844         (WebCore::ApplicationCacheStorage::storeCopyOfCache): Deleted.
845         * loader/appcache/ApplicationCacheStorage.h:
846
847 2015-03-28  Joonghun Park  <jh718.park@samsung.com>
848
849         nullptr cleanup in InlineFooBox classes
850         https://bugs.webkit.org/show_bug.cgi?id=143178
851
852         Reviewed by Csaba Osztrogonác.
853
854         No new tests, no behavior changes
855
856         Replace 0 with nullptr in InlineFooBox classes.
857
858         * rendering/InlineBox.cpp:
859         (WebCore::InlineBox::prevLeafChildIgnoringLineBreak):
860         * rendering/InlineFlowBox.cpp:
861         (WebCore::InlineFlowBox::removeChild):
862         (WebCore::InlineFlowBox::deleteLine):
863         (WebCore::InlineFlowBox::placeBoxesInInlineDirection):
864         (WebCore::InlineFlowBox::addTextBoxVisualOverflow):
865         * rendering/InlineFlowBox.h:
866         (WebCore::InlineFlowBox::InlineFlowBox):
867         * rendering/InlineTextBox.h:
868         (WebCore::InlineTextBox::InlineTextBox):
869         * rendering/RootInlineBox.cpp:
870         (WebCore::RootInlineBox::getLogicalStartBoxWithNode):
871         (WebCore::RootInlineBox::getLogicalEndBoxWithNode):
872         * rendering/RootInlineBox.h:
873         * rendering/svg/SVGInlineTextBox.cpp:
874         (WebCore::SVGInlineTextBox::SVGInlineTextBox):
875         (WebCore::SVGInlineTextBox::releasePaintingResource):
876         (WebCore::SVGInlineTextBox::restoreGraphicsContextAfterTextPainting):
877         * rendering/svg/SVGRootInlineBox.cpp:
878         (WebCore::SVGRootInlineBox::closestLeafChildForPosition):
879         (WebCore::findFirstAndLastAttributesInVector):
880         * rendering/svg/SVGRootInlineBox.h:
881
882 2015-03-27  Simon Fraser  <simon.fraser@apple.com>
883
884         More modern loops in RenderLayer.cpp
885         https://bugs.webkit.org/show_bug.cgi?id=143175
886
887         Reviewed by Ryosuke Niwa.
888
889         Use modern loops in more places in RenderLayer.app.
890
891         * rendering/RenderLayer.cpp:
892         (WebCore::RenderLayer::update3DTransformedDescendantStatus):
893         (WebCore::RenderLayer::paint):
894         (WebCore::performOverlapTests):
895         (WebCore::RenderLayer::paintFixedLayersInNamedFlows):
896         (WebCore::RenderLayer::paintList):
897         (WebCore::RenderLayer::collectFragments):
898         (WebCore::RenderLayer::updatePaintingInfoForFragments):
899         (WebCore::RenderLayer::paintTransformedLayerIntoFragments):
900         (WebCore::RenderLayer::calculateClipRects):
901
902 2015-03-27  Simon Fraser  <simon.fraser@apple.com>
903
904         nullptr cleanup in RenderLayer
905         https://bugs.webkit.org/show_bug.cgi?id=143174
906
907         Reviewed by Ryosuke Niwa.
908
909         Replace 0 with nullptr in RenderLayer.cpp.
910
911         * rendering/RenderLayer.cpp:
912         (WebCore::RenderLayer::filterRenderer):
913         (WebCore::RenderLayer::updateLayerPositionsAfterLayout):
914         (WebCore::RenderLayer::updateLayerPositionsAfterOverflowScroll):
915         (WebCore::RenderLayer::positionNewlyCreatedOverflowControls):
916         (WebCore::RenderLayer::enclosingOverflowClipLayer):
917         (WebCore::RenderLayer::enclosingCompositingLayer):
918         (WebCore::RenderLayer::enclosingCompositingLayerForRepaint):
919         (WebCore::RenderLayer::enclosingFilterLayer):
920         (WebCore::RenderLayer::enclosingFilterRepaintLayer):
921         (WebCore::RenderLayer::clippingRootForPainting):
922         (WebCore::RenderLayer::transparentPaintingAncestor):
923         (WebCore::transparencyClipBox):
924         (WebCore::RenderLayer::removeChild):
925         (WebCore::RenderLayer::removeOnlyThisLayer):
926         (WebCore::RenderLayer::insertOnlyThisLayer):
927         (WebCore::accumulateOffsetTowardsAncestor):
928         (WebCore::RenderLayer::enclosingScrollableArea):
929         (WebCore::RenderLayer::enclosingPaginationLayerInSubtree):
930         (WebCore::RenderLayer::enclosingElement):
931         (WebCore::RenderLayer::enclosingFlowThreadAncestor):
932         (WebCore::RenderLayer::hitTestFixedLayersInNamedFlows):
933         (WebCore::RenderLayer::hitTestLayer):
934         (WebCore::RenderLayer::hitTestTransformedLayerInFragments):
935         (WebCore::RenderLayer::hitTestLayerByApplyingTransform):
936         (WebCore::RenderLayer::hitTestList):
937         (WebCore::RenderLayer::updateClipRects):
938         (WebCore::RenderLayer::clipRects):
939         (WebCore::RenderLayer::calculateClipRects):
940
941 2015-03-27  Gwang Yoon Hwang  <yoon@igalia.com>
942
943         [TexMap] Seperate BitmapTexture related classes implementations from TextureMapper
944         https://bugs.webkit.org/show_bug.cgi?id=142386
945
946         Reviewed by Žan Doberšek.
947
948         TextureMapper and TextureMapperGL are bloated and tightly coupled with
949         BitmapTexture. We should move these classes to seperated file of their own.
950         Also, this patch removes friend relationship from TextureMapperGL and  its
951         subsidiary classes.
952
953         The main purpose of this refactoring is to expose BitmapTexturePool to
954         renderers of platformlayers like Video and Canvas. By doing this, each
955         renderer can acquire textures from the global texture pool to paint
956         their contents directly.
957
958         No new tests needed.
959
960         * PlatformEfl.cmake:
961         * PlatformGTK.cmake:
962         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
963         Include BitmapTextureGL and BitmapTexturePool explicitly
964
965         * platform/graphics/texmap/BitmapTexture.cpp: Added.
966         * platform/graphics/texmap/BitmapTexture.h: Added.
967         (WebCore::BitmapTexture::updateContents):
968         Exclude BitmapTexture class from TextureMapper
969
970         * platform/graphics/texmap/BitmapTextureGL.cpp: Added.
971         * platform/graphics/texmap/BitmapTextureGL.h: Added.
972         Exclude BitmapTextureGL class from TextureMapperGL
973         (WebCore::BitmapTextureGL::clipStack): Added.
974         Add the getter for clipStack for TextureMapperGL
975         (WebCore::BitmapTextureGL::Bind): Deleted.
976         (WebCore::BitmapTextureGL::BindAsSurface): Added.
977         Bind used TextureMapperGL's internal data directly to compute projection matrix as a friend class,
978         However, TextureMapperGL can compute projection matrix itself after binding job, so this
979         friend ship is not needed. Also, this patch renames Bind to BindAsSurface to remove ambiguity.
980
981         * platform/graphics/texmap/BitmapTextureImageBuffer.cpp: Added.
982         * platform/graphics/texmap/BitmapTextureImageBuffer.h: Added.
983         Exclude BitmapTextureImageBuffer class from TextureMapperImageBuffer
984
985         * platform/graphics/texmap/BitmapTexturePool.cpp: Added.
986         * platform/graphics/texmap/BitmapTexturePool.h: Added.
987         Exclude BitmapTexturePool class from TextureMapperGL
988         (WebCore::BitmapTexturePool::acquireTexture):
989         Modified to use passed GraphicsContext3D instead of TextureMapperGL to remove redundant coupling
990
991         * platform/graphics/texmap/TextureMapper.cpp:
992         * platform/graphics/texmap/TextureMapper.h:
993         Remove BitmapTexturePool and BitmapTexture from its implementation.
994
995         * platform/graphics/texmap/TextureMapperGL.cpp:
996         * platform/graphics/texmap/TextureMapperGL.h:
997         Remove BitmapTextureGL from its implementation.
998         (WebCore::TextureMapperGL::TextureMapperGL):
999         (WebCore::TextureMapperGL::clipStack):
1000         (WebCore::TextureMapperGL::bindSurface):
1001         (WebCore::TextureMapperGL::currentSurface):
1002         Add a getter of the current surface for filtering operation in BitmapTextureGL.
1003         It would be clear to move filtering operation from BitmapTextureGL to TextureMapperGL later.
1004
1005         (WebCore::TextureMapperGL::ClipStack):
1006         Move inner class declaration to public.
1007
1008         * platform/graphics/texmap/TextureMapperImageBuffer.cpp:
1009         * platform/graphics/texmap/TextureMapperImageBuffer.h:
1010         Remove BitmapTextureImageBuffer from its implementation.
1011
1012 2015-03-27  Tim Horton  <timothy_horton@apple.com>
1013
1014         WebProcess started by editable WKWebView spends 15% of its initialization time loading DataDetectors
1015         https://bugs.webkit.org/show_bug.cgi?id=143142
1016         <rdar://problem/20324495>
1017
1018         Reviewed by Anders Carlsson.
1019
1020         Calling DataDetectorsLibrary() is expensive; we should avoid doing it
1021         until actually necessary. When loading a page that makes a caret selection,
1022         ServicesOverlayController was calling DataDetectorsLibrary() (ignoring the fact
1023         that a caret selection can't have any services associated with it) to avoid
1024         crashing on systems where DataDetectors is not available. Instead, we should
1025         first check if there's anything to do, and then check for the existence
1026         of DataDetectors.
1027
1028         * page/mac/ServicesOverlayController.mm:
1029         (WebCore::ServicesOverlayController::buildPhoneNumberHighlights):
1030         Build the list of phone number ranges, and bail (clearing the potential highlights)
1031         if it is empty, before calling DataDetectorsLibrary().
1032
1033         (WebCore::ServicesOverlayController::buildSelectionHighlight):
1034         Check the list of selection rects, and bail (clearing the potential highlights)
1035         if it is empty, before calling DataDetectorsLibrary().
1036
1037 2015-03-27  Jer Noble  <jer.noble@apple.com>
1038
1039         [Mac] Safari fails to fire page "load" event with video[preload=none]
1040         https://bugs.webkit.org/show_bug.cgi?id=143147
1041
1042         Reviewed by Simon Fraser.
1043
1044         Test: media/video-page-load-preload-none.html
1045
1046         When told to load() when preload == None, set the networkState to Idle.
1047         This causes HTMLMediaElement to set the shouldDelayLoadEvent flag to
1048         false, and allows the page's 'load' event to fire.
1049
1050         Drive-by fix: add setNetworkState() and setReadyState() methods to
1051         MediaPlayerPrivateAVFoundation, reducing a bunch of code duplication.
1052
1053         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1054         (WebCore::MediaPlayerPrivateAVFoundation::load):
1055         (WebCore::MediaPlayerPrivateAVFoundation::setNetworkState):
1056         (WebCore::MediaPlayerPrivateAVFoundation::setReadyState):
1057         (WebCore::MediaPlayerPrivateAVFoundation::updateStates):
1058         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
1059
1060 2015-03-27  Alexey Proskuryakov  <ap@apple.com>
1061
1062         Calling crypto.webkitSubtle.generateKey causes page memory to never be released
1063         https://bugs.webkit.org/show_bug.cgi?id=143151
1064         rdar://problem/18940687
1065
1066         Reviewed by Tim Horton.
1067
1068         * crypto/mac/CryptoKeyRSAMac.cpp: (WebCore::CryptoKeyRSA::generatePair): Don't.
1069
1070 2015-03-27  Brent Fulgham  <bfulgham@apple.com>
1071
1072         Null dereference in InbandMetadataTextTrack handling
1073         https://bugs.webkit.org/show_bug.cgi?id=143144
1074         <rdar://problem/18983250>
1075
1076         Reviewed by Eric Carlson.
1077
1078         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp:
1079         (WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes): Check for null return value from
1080         'client()', just like we do in all other methods.
1081
1082 2015-03-27  Oliver Hunt  <oliver@apple.com>
1083
1084         Forward additional CFNetwork ATS information to child processes
1085         https://bugs.webkit.org/show_bug.cgi?id=143136
1086
1087         Reviewed by Anders Carlsson.
1088
1089         Declare SPI.
1090
1091         * platform/spi/cf/CFNetworkSPI.h:
1092
1093 2015-03-27  Chris Dumez  <cdumez@apple.com>
1094
1095         [WK2][NetworkCache] We only cache responses with status codes that are cacheable by default
1096         https://bugs.webkit.org/show_bug.cgi?id=143125
1097         <rdar://problem/20321172>
1098
1099         Reviewed by Antti Koivisto.
1100
1101         Export a couple of extra symbols.
1102
1103         * platform/network/ResourceResponseBase.h:
1104
1105 2015-03-27  Jer Noble  <jer.noble@apple.com>
1106
1107         HTMLMediaElement will fire 'seeked' before seek completes, leading to currentTime discontinuities.
1108         https://bugs.webkit.org/show_bug.cgi?id=143132
1109
1110         Reviewed by Eric Carlson.
1111
1112         When seeking, if the ready state rises to >= HAVE_CURRENT_DATA, we will fire the 'seeked'
1113         event and continue playback. However, if a media engine updates the ready state before its
1114         seek operation actually completes, the currentTime it returns may still be the time before
1115         the seek.
1116
1117         Wait until both the ready state rises to HAVE_CURRENT_DATA and m_player->seeking() returns
1118         false before firing the 'seeked' event.
1119
1120         * html/HTMLMediaElement.cpp:
1121         (WebCore::HTMLMediaElement::parseAttribute):
1122
1123 2015-03-26  Geoffrey Garen  <ggaren@apple.com>
1124
1125         Make some more objects use FastMalloc
1126         https://bugs.webkit.org/show_bug.cgi?id=143122
1127
1128         Reviewed by Csaba Osztrogonác.
1129
1130         * Modules/geolocation/GeolocationController.h:
1131         * Modules/geolocation/NavigatorGeolocation.h:
1132         * Modules/indexeddb/DOMWindowIndexedDatabase.h:
1133         * Modules/notifications/NotificationController.h:
1134         * Modules/webdatabase/DatabaseServer.h:
1135         * css/CSSFontFaceSource.h:
1136         * html/HTMLMediaSession.h:
1137         * inspector/InspectorIndexedDBAgent.h:
1138         * inspector/InspectorReplayAgent.h:
1139         * page/CaptionUserPreferencesMediaAF.h:
1140         * page/PageConsoleClient.h:
1141         * page/PageDebuggable.h:
1142         * page/animation/CSSPropertyAnimation.cpp:
1143         * page/mac/ServicesOverlayController.h:
1144         * platform/RemoteCommandListener.h:
1145         * platform/Timer.h:
1146         * platform/audio/MediaSessionManager.h:
1147         * platform/mac/SystemSleepListenerMac.h:
1148         * platform/mac/ThemeMac.h:
1149         * rendering/svg/RenderSVGResourceSolidColor.h:
1150         * replay/ReplayController.h:
1151
1152 2015-03-27  Said Abou-Hallawa  <sabouhallawa@apple.com>
1153
1154         FEMorphology::platformApplyGeneric() should bail out if the radius is less than or equal to zero.
1155         https://bugs.webkit.org/show_bug.cgi?id=142885.
1156
1157         Reviewed by Dean Jackson.
1158
1159         FEMorphology class implementation code clean up.
1160         
1161         Tests: svg/filters/feMorphology-radius-cases.svg
1162
1163         * platform/graphics/filters/FEMorphology.cpp:
1164         (WebCore::shouldSupersedeExtremum): Reuse code instead of repeating it and
1165         use < and > instead of =< and >=.
1166         
1167         (WebCore::pixelArrayIndex): Returns the array index of a pixel in an image
1168         buffer, given: position(x, y), image width and the color channel.
1169         
1170         (WebCore::columnExtremum): Returns the extremum of a column of pixels.
1171         
1172         (WebCore::kernelExtremum): Returns the extremum of a filter kernel.
1173         
1174         (WebCore::FEMorphology::platformApplyGeneric): Apply some code clean-up.
1175         The kernel size should be equal to radius of the filter. The extra pixel
1176         was causing the resulted image to be asymmetric in some cases.
1177         
1178         (WebCore::FEMorphology::platformApplyDegenerate):
1179         (WebCore::FEMorphology::platformApplySoftware): After applying scaling, we
1180         still need to check the resulted radius is negative (overflow case) or less
1181         than one (zero radius case) and treat these cases differently.
1182         
1183         (WebCore::FEMorphology::morphologyOperator): Deleted.
1184         (WebCore::FEMorphology::radiusX): Deleted.
1185         (WebCore::FEMorphology::radiusY): Deleted.
1186         * platform/graphics/filters/FEMorphology.h:
1187         (WebCore::FEMorphology::morphologyOperator):
1188         (WebCore::FEMorphology::radiusX):
1189         (WebCore::FEMorphology::radiusY):
1190         Move a single line functions from the source file to the header file.
1191
1192 2015-03-27  Antti Koivisto  <antti@apple.com>
1193
1194         Move CacheValidation to platform
1195         https://bugs.webkit.org/show_bug.cgi?id=143133
1196
1197         Reviewed by Chris Dumez.
1198
1199         It deals with platform types only and is currently violating layering.
1200
1201         * WebCore.xcodeproj/project.pbxproj:
1202         * loader/cache/CacheValidation.cpp: Removed.
1203         * loader/cache/CacheValidation.h: Removed.
1204         * platform/network/CacheValidation.cpp: Copied from Source/WebCore/loader/cache/CacheValidation.cpp.
1205         * platform/network/CacheValidation.h: Copied from Source/WebCore/loader/cache/CacheValidation.h.
1206
1207 2015-03-27  Commit Queue  <commit-queue@webkit.org>
1208
1209         Unreviewed, rolling out r177896.
1210         https://bugs.webkit.org/show_bug.cgi?id=142978
1211
1212         Loading libgstclutter.so in-process hangs web process
1213         (Requested by mcatanzaro on #webkit).
1214
1215         Reverted changeset:
1216
1217         "[GStreamer] Disable gst-plugin-scanner if seccomp filters are
1218         enabled"
1219         https://bugs.webkit.org/show_bug.cgi?id=140069
1220         http://trac.webkit.org/changeset/177896
1221
1222 2015-03-26  Antti Koivisto  <antti@apple.com>
1223
1224         Respect cache-control directives in request
1225         https://bugs.webkit.org/show_bug.cgi?id=143121
1226         rdar://problem/19714040
1227
1228         Reviewed by Chris Dumez.
1229
1230         Test: http/tests/cache/disk-cache/disk-cache-request-headers.html
1231
1232         * loader/cache/CacheValidation.cpp:
1233         (WebCore::isCacheHeaderSeparator):
1234         (WebCore::isControlCharacter):
1235         (WebCore::trimToNextSeparator):
1236         (WebCore::parseCacheHeader):
1237         (WebCore::parseCacheControlDirectives):
1238
1239             Factor Cache-control parsing here so it can be used for both requests and responses.
1240
1241         * loader/cache/CacheValidation.h:
1242         * platform/network/ResourceRequestBase.h:
1243         * platform/network/ResourceResponseBase.cpp:
1244         (WebCore::ResourceResponseBase::ResourceResponseBase):
1245         (WebCore::ResourceResponseBase::parseCacheControlDirectives):
1246         (WebCore::ResourceResponseBase::cacheControlContainsNoCache):
1247         (WebCore::ResourceResponseBase::cacheControlContainsNoStore):
1248         (WebCore::ResourceResponseBase::cacheControlContainsMustRevalidate):
1249         (WebCore::ResourceResponseBase::cacheControlMaxAge):
1250         (WebCore::isCacheHeaderSeparator): Deleted.
1251         (WebCore::isControlCharacter): Deleted.
1252         (WebCore::trimToNextSeparator): Deleted.
1253         (WebCore::parseCacheHeader): Deleted.
1254         * platform/network/ResourceResponseBase.h:
1255
1256 2015-03-27  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
1257
1258         [GStreamer] share GL context in pipeline, part 2
1259         https://bugs.webkit.org/show_bug.cgi?id=143049
1260
1261         Reviewed by Carlos Garcia Campos.
1262
1263         This patch, instead of cluttering the GstGL attributes creation in
1264         ::handleSyncMessage(), creates a new method ::ensureGstGLContext(),
1265         where those attributes are defined. This method is guarded by
1266         USE(GSTREAMER_GL)
1267
1268         ::handlSyncMessage() shall return nothing, according to GStreamer
1269         documentation, not a boolean.
1270
1271         The GstGL attributes are now GRefPtr<> to avoid memory leaks.
1272
1273         The GstGLAPI and GstGLPlatform are now set given by the pre-processor
1274         directives, and the code in ::ensureGstGLContext() is simpler.
1275
1276         No new tests because this is platform specific and it depends in the
1277         run-time availability and configurations of GstGL elements.
1278
1279         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1280         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
1281         Don't initialise the GstGL attributes since are GRefPtr<>
1282         (WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage): Changed the
1283         signature to use void instead of gboolean.
1284         (WebCore::MediaPlayerPrivateGStreamer::ensureGstGLContext): New method.
1285         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
1286
1287 2015-03-26  Jeremy Jones  <jeremyj@apple.com>
1288
1289         Optimized Fullscreen fails to cleanup because of no longer necessary release of m_playerController in exitFullscreen()
1290         https://bugs.webkit.org/show_bug.cgi?id=143120
1291
1292         Reviewed by Eric Carlson.
1293
1294         We used to release m_playerController in WebVideoFullscreenInterfaceAVKit::exitFullscreen() in order to make sure 
1295         media state was reset. This is no longer necessary as we now have a way the model can explicitly request resetting the
1296         media state via resetMediaState(). m_playerController is already released in 
1297         WebVideoFullscreenInterfaceAVKit::cleanupFullscreenInternal(). Releasing it prematurely can actually prevent the exit
1298         fullscreen process from completing successfully.
1299
1300         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1301         (WebVideoFullscreenInterfaceAVKit::exitFullscreen):
1302
1303 2015-03-26  Zalan Bujtas  <zalan@apple.com>
1304
1305         Inline continuation code should not take anonymous containing wrapper granted.
1306         https://bugs.webkit.org/show_bug.cgi?id=133312
1307
1308         Reviewed by Dave Hyatt.
1309
1310         It's wrong to assume that when RenderInline is part of an inline continuation, its containing block
1311         is an anonymous wrapper and its sibling might be a block level renderer.
1312         When the inline continuation is no longer needed, for example when the block level renderer that initiated the continuation
1313         is detached from the render tree, the inline renderes still continue to form continuation.(however they no longer require
1314         anonymous wrappers)
1315
1316         Test: fast/inline/crash-when-position-property-is-changed-and-no-longer-in-continuation.html
1317
1318         * rendering/RenderInline.cpp:
1319         (WebCore::updateStyleOfAnonymousBlockContinuations):
1320         (WebCore::RenderInline::styleDidChange):
1321
1322 2015-03-26  Tim Horton  <timothy_horton@apple.com>
1323
1324         REGRESSION (r181358 and r181507): Lots of sites think that we support touch events on OS X
1325         https://bugs.webkit.org/show_bug.cgi?id=142888
1326         <rdar://problem/20227304>
1327
1328         Reviewed by Beth Dakin.
1329
1330         * dom/Document.idl:
1331         * dom/Element.idl:
1332         * html/HTMLBodyElement.idl:
1333         * html/HTMLFrameSetElement.idl:
1334         * page/DOMWindow.idl:
1335         Re-conditionalize a lot of event listeners; sites test ("ontouchstart" in window), which
1336         is not covered by NotEnumerable, and so r181358 and r181507 broke a bunch of sites
1337         (apple.com, blaze.com, anything using nicescroll.js, etc.) by causing them to think
1338         that (Mac) Safari was touch-enabled.
1339
1340 2015-03-26  Geoffrey Garen  <ggaren@apple.com>
1341
1342         "lineNo" does not match WebKit coding style guidelines
1343         https://bugs.webkit.org/show_bug.cgi?id=143119
1344
1345         Reviewed by Michael Saboff.
1346
1347         We can afford to use whole words.
1348
1349         * bindings/js/JSLazyEventListener.cpp:
1350         (WebCore::JSLazyEventListener::initializeJSFunction):
1351         * bindings/js/JSMainThreadExecStateInstrumentation.h:
1352         (WebCore::JSMainThreadExecState::instrumentFunctionCall):
1353         * inspector/InspectorDOMAgent.cpp:
1354         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
1355         * testing/Internals.cpp:
1356         (WebCore::Internals::parserMetaData):
1357
1358 2015-03-26  Roger Fong  <roger_fong@apple.com>
1359
1360         Apply blur effect to media control background.
1361         https://bugs.webkit.org/show_bug.cgi?id=143116.
1362         <rdar://problem/20316964>.
1363
1364         Reviewed by Brent Fulgham.
1365
1366         There are still a few issues, like the borders of the controls being blurred with black,
1367         and the volume slider background not showing the blur effect. Will fix those separately.
1368
1369         Add CSS for new divs to create blur effect using back drop filters and blend modes.
1370         * Modules/mediacontrols/mediaControlsApple.css:
1371         (audio::-webkit-media-controls-panel):
1372         (audio::-webkit-media-controls-panel-tint):
1373         (audio::-webkit-media-controls-panel-background):
1374         (audio::-webkit-media-controls-panel .volume-box):
1375         (audio::-webkit-media-controls-volume-slider-container-background):
1376         (audio::-webkit-media-controls-volume-slider-container-tint):
1377         (audio::-webkit-media-controls-toggle-closed-captions-button): Adjust fill.
1378         (audio::-webkit-media-controls-fullscreen-button): Adjust fill.
1379         (audio::-webkit-media-controls-fullscreen-button.exit): Adjust fill.
1380         (video:-webkit-full-screen::-webkit-media-controls-panel):
1381         (audio:-webkit-full-screen::-webkit-media-controls-panel-tint):
1382         (audio:-webkit-full-screen::-webkit-media-controls-panel-background):
1383         (video:-webkit-full-screen::-webkit-media-controls-panel .volume-box):
1384         (video:-webkit-full-screen::-webkit-media-controls-play-button):
1385         (video:-webkit-full-screen::-webkit-media-controls-seek-back-button):
1386         (video:-webkit-full-screen::-webkit-media-controls-seek-forward-button):
1387         (video:-webkit-full-screen::-webkit-media-controls-timeline-container):
1388         (video:-webkit-full-screen::-webkit-media-controls-status-display):
1389         (audio::-webkit-media-controls-panel .volume-box:active): Deleted.
1390         * Modules/mediacontrols/mediaControlsApple.js:
1391         (Controller.prototype.createControls):
1392         (Controller.prototype.configureInlineControls): Add new divs for blurred background effect.
1393         (Controller.prototype.configureFullScreenControls): Ditto.
1394         (Controller.prototype.handlePanelMouseDown): The tint div is now in front.
1395         (Controller.prototype.drawTimelineBackground): Adjust colors to make border look better with new background.
1396         (Controller.prototype.drawVolumeBackground): Ditto.
1397
1398 2015-03-26  Geoffrey Garen  <ggaren@apple.com>
1399
1400         Assertion firing in JavaScriptCore/parser/parser.h for statesman.com site
1401         https://bugs.webkit.org/show_bug.cgi?id=142974
1402
1403         Reviewed by Joseph Pecoraro.
1404
1405         * bindings/js/JSLazyEventListener.cpp:
1406         (WebCore::JSLazyEventListener::initializeJSFunction): Use the new override
1407         line number API to guarantee that errors will map to the .html file locations
1408         that we like.
1409
1410         * bindings/js/ScriptController.cpp:
1411         (WebCore::ScriptController::eventHandlerPosition): Added a FIXME to cover
1412         some cases where our line and column numbers are still nonsense.
1413
1414 2015-03-26  Beth Dakin  <bdakin@apple.com>
1415
1416         Relevant repainted objects callback is inaccurate and inconsistent for PDF 
1417         documents
1418         https://bugs.webkit.org/show_bug.cgi?id=143118
1419         -and corresponding-
1420         rdar://problem/13371582
1421
1422         Reviewed by Tim Horton.
1423
1424         Investigating this bug resulted in finding two things that should change for the 
1425         relevant repainted objects heuristic. First, we should not count any objects 
1426         painted while updating control tints. And secondly, we should not use it at all 
1427         for plugin documents. In other documents, we count the plugin area as “painted” 
1428         when we get to paint whether or not the plugin has actually loaded. This is 
1429         intentional because it allows us to account for chunks of the page that will be 
1430         filled in by possibly slow-loading ads. However, if the plugin is the whole 
1431         document, then the heuristic just doesn’t make any sense and it leads to 
1432         inconsistent behavior at different window sizes. So we’ll only count plugins when 
1433         the document is not a plugin document. 
1434
1435         Don’t count objects during this paint!
1436         * page/FrameView.cpp:
1437         (WebCore::FrameView::updateControlTints):
1438         * page/Page.h:
1439         (WebCore::Page::setIsCountingRelevantRepaintedObjects):
1440
1441         Make sure the document is not a plugin document.
1442         * rendering/RenderEmbeddedObject.cpp:
1443         (WebCore::RenderEmbeddedObject::paint):
1444
1445 2015-03-26  Alex Christensen  <achristensen@webkit.org>
1446
1447         Progress towards CMake on Mac.
1448         https://bugs.webkit.org/show_bug.cgi?id=143112
1449
1450         Reviewed by Chris Dumez.
1451
1452         * CMakeLists.txt:
1453         * PlatformEfl.cmake:
1454         * PlatformGTK.cmake:
1455         * PlatformMac.cmake:
1456         * platform/graphics/mac/IconMac.mm:
1457
1458 2015-03-26  Jer Noble  <jer.noble@apple.com>
1459
1460         [iOS] Accessibility crashing because MediaPlayer is laying out UI off the main thread
1461         https://bugs.webkit.org/show_bug.cgi?id=142970
1462
1463         Reviewed by Eric Carlson.
1464
1465         isMainThread() will (ironically) return true if called from the web thread. Rather than dispatch
1466         synchronously to the main thread to allocate the _volumeView, dispatch asynchronously and handle
1467         the case where the MPVolumeView has not yet been created.
1468
1469         * platform/audio/ios/MediaSessionManagerIOS.mm:
1470         (-[WebMediaSessionHelper allocateVolumeView]): Dispatch to the main thread to allocate. Move notification
1471             registration to -setVolumeView:.
1472         (-[WebMediaSessionHelper setVolumeView:]): Added. Register/Unregister for route availablitiy notifications.
1473         (-[WebMediaSessionHelper hasWirelessTargetsAvailable]): Handle the possibility of a nil _volumeView.
1474
1475 2015-03-26  Benjamin Poulain  <bpoulain@apple.com>
1476
1477         Fix state maching debugging after r181964
1478         https://bugs.webkit.org/show_bug.cgi?id=143082
1479
1480         Reviewed by Alex Christensen.
1481
1482         * contentextensions/ContentExtensionCompiler.cpp:
1483         (WebCore::ContentExtensions::compileRuleList):
1484
1485 2015-03-25  David Hyatt  <hyatt@apple.com>
1486
1487         Improve the offsetWidth/Height layout optimization
1488         https://bugs.webkit.org/show_bug.cgi?id=143008
1489
1490         Reviewed by Zalan Bujtas.
1491
1492         * dom/Document.cpp:
1493         (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
1494         * dom/Document.h:
1495         Change Element* to Element&. Clean up the dimension bits to use shifting. Remove both the inline and
1496         the positioning restrictions on the optimization check.
1497
1498         * dom/Element.cpp:
1499         (WebCore::Element::offsetWidth):
1500         (WebCore::Element::offsetHeight):
1501         Change to use Element& instead of Element*.
1502
1503         (WebCore::Element::clientWidth):
1504         (WebCore::Element::clientHeight):
1505         (WebCore::Element::scrollWidth):
1506         (WebCore::Element::scrollHeight):
1507         Turn on the optimization for clientWidth/Height and scrollWidth/Height.
1508
1509 2015-03-26  Brady Eidson  <beidson@apple.com>
1510
1511         Apply ContentExtension actions after redirects.
1512         <rdar://problem/20062613> and https://bugs.webkit.org/show_bug.cgi?id=143055
1513
1514         Reviewed by Alex Christensen.
1515
1516         Tests: http/tests/contentextensions/loading/main-resource-redirect-blocked.php
1517                http/tests/contentextensions/subresource-redirect-blocked.html
1518
1519         This patch moves the "run a URL against the content extension" code from CachedResourceLoader to
1520         the ContentExtensionsBackend.
1521
1522         That allows it to be shared between the CachedResourceLoader where loads are initiated and 
1523         ResourceLoader where redirects are handled.
1524
1525         * contentextensions/ContentExtension.cpp:
1526         (WebCore::ContentExtensions::ContentExtension::globalDisplayNoneStyleSheet):
1527
1528         * contentextensions/ContentExtensionsBackend.cpp:
1529         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
1530         (WebCore::ContentExtensions::ContentExtensionsBackend::displayNoneCSSRule):
1531         * contentextensions/ContentExtensionsBackend.h:
1532
1533         * loader/NetscapePlugInStreamLoader.cpp:
1534         (WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader):
1535
1536         * loader/ResourceLoadInfo.h:
1537
1538         * loader/ResourceLoader.cpp:
1539         (WebCore::ResourceLoader::ResourceLoader):
1540         (WebCore::ResourceLoader::willSendRequest):
1541         * loader/ResourceLoader.h:
1542
1543         * loader/SubresourceLoader.cpp:
1544         (WebCore::SubresourceLoader::SubresourceLoader):
1545
1546         * loader/cache/CachedResourceLoader.cpp:
1547         (WebCore::CachedResourceLoader::requestResource):
1548
1549         * page/UserContentController.cpp:
1550         (WebCore::UserContentController::processContentExtensionRulesForLoad):
1551         (WebCore::UserContentController::actionsForResourceLoad): Deleted.
1552         (WebCore::UserContentController::globalDisplayNoneStyleSheet): Deleted.
1553         (WebCore::UserContentController::displayNoneCSSRule): Deleted.
1554         * page/UserContentController.h:
1555
1556 2015-03-26  Myles C. Maxfield  <mmaxfield@apple.com>
1557
1558         Crash when laying out (char)0
1559         https://bugs.webkit.org/show_bug.cgi?id=143103
1560
1561         Reviewed by Dean Jackson.
1562
1563         We currently cache a character -> Font mapping in a HashMap.
1564         However, keys in Hashmaps can't be 0. This patch simply skips
1565         the cache in this case.
1566
1567         No new tests, for now. I'm having trouble creating a test because
1568         the site that causes this bug generates their page using script,
1569         and the script is all minified, and difficult to understand. I
1570         will contact the owner of the site and ask for and unminified
1571         version of their sources. However, I don't want to that to block
1572         this tiny fix from going in.
1573
1574         * platform/graphics/Font.cpp:
1575         (WebCore::Font::systemFallbackFontForCharacter):
1576
1577 2015-03-26  Jer Noble  <jer.noble@apple.com>
1578
1579         [Mac][EME] Crash at com.apple.WebCore: WebCore::CDMSessionMediaSourceAVFObjC::releaseKeys + 177
1580         https://bugs.webkit.org/show_bug.cgi?id=143080
1581
1582         Reviewed by Eric Carlson.
1583
1584         Null-check m_certificate before dereferencing.
1585
1586         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
1587         (WebCore::CDMSessionMediaSourceAVFObjC::releaseKeys):
1588
1589 2015-03-26  Chris Fleizach  <cfleizach@apple.com>
1590
1591         AX: [role="button"][aria-pressed] should be exposed as AXCheckbox:AXToggleButton, with role description of "toggle button"
1592         https://bugs.webkit.org/show_bug.cgi?id=115298
1593
1594         Reviewed by Mario Sanchez Prada.
1595
1596         A role=button + aria-pressed object should be exposed as AXCheckbox on Mac now. It should also convert the
1597         aria-pressed state into a 0, 1, 2 number value for the Mac.
1598
1599         Test: platform/mac/accessibility/aria-pressed-button-attributes.html
1600
1601         * accessibility/AccessibilityObject.cpp:
1602         (WebCore::AccessibilityObject::checkboxOrRadioValue):
1603         * accessibility/AccessibilityObject.h:
1604         (WebCore::AccessibilityObject::isToggleButton):
1605         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1606         (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
1607         (createAccessibilityRoleMap):
1608         (-[WebAccessibilityObjectWrapper subrole]):
1609         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1610
1611 2015-03-25  Dean Jackson  <dino@apple.com>
1612
1613         CSS blend modes do not parse when in the shadow tree
1614         https://bugs.webkit.org/show_bug.cgi?id=143067
1615         <rdar://problem/20302662>
1616
1617         Reviewed by Anders Carlson.
1618
1619         The media controls style sheets are injected as UA stylesheets
1620         when we come across a <video> or <audio> element. These stylesheets
1621         have a different parsing context than the document stylesheets -
1622         one that uses the default constructor, which initializes some
1623         features like cssCompositingEnabled to false without checking
1624         the runtime state.
1625
1626         The easy fix is to use the global state to initialize the context.
1627
1628         Unfortunately we can't test this since it only occurs in the shadow
1629         tree.
1630
1631         * css/CSSParser.cpp:
1632         (WebCore::CSSParserContext::CSSParserContext): Check the state
1633         of RuntimeEnabledFeatures to initialize CSS Regions and
1634         CSS Compositing (Blending).
1635
1636 2015-03-25  Chris Fleizach  <cfleizach@apple.com>
1637
1638         AX: table cells that use display:block render the table inaccessible to VoiceOver
1639         https://bugs.webkit.org/show_bug.cgi?id=143007
1640
1641         Reviewed by Mario Sanchez Prada.
1642
1643         When display:block is used on a table cell, it was being ignored because it was anonymous.
1644         This is still a valid scenario however if it's still inside of a valid table.
1645
1646         Test: accessibility/table-cell-display-block.html
1647
1648         * accessibility/AccessibilityTableCell.cpp:
1649         (WebCore::AccessibilityTableCell::computeAccessibilityIsIgnored):
1650
1651 2015-03-25  Tim Horton  <timothy_horton@apple.com>
1652
1653         Add a preference to prevent "user-scalable=no" from having any effect
1654         https://bugs.webkit.org/show_bug.cgi?id=143032
1655
1656         Reviewed by Sam Weinig.
1657
1658         * page/ViewportConfiguration.cpp:
1659         (WebCore::ViewportConfiguration::ViewportConfiguration):
1660         (WebCore::ViewportConfiguration::allowsUserScaling):
1661         * page/ViewportConfiguration.h:
1662         (WebCore::ViewportConfiguration::setForceAlwaysUserScalable):
1663         If forceAlwaysUserScalable is set to true, force "user-scalable=yes".
1664
1665 2015-03-25  Dan Bernstein  <mitz@apple.com>
1666
1667         Another attempt to get the iOS EWS building again.
1668
1669         * WebCore.xcodeproj/project.pbxproj:
1670
1671 2015-03-25  Alex Christensen  <achristensen@webkit.org>
1672
1673         Add case-insensitive checks to DFA bytecode.
1674         https://bugs.webkit.org/show_bug.cgi?id=142977
1675
1676         Reviewed by Benjamin Poulain.
1677
1678         * contentextensions/DFABytecode.h:
1679         (WebCore::ContentExtensions::instructionSizeWithArguments):
1680         * contentextensions/DFABytecodeCompiler.cpp:
1681         (WebCore::ContentExtensions::DFABytecodeCompiler::emitCheckValue):
1682         (WebCore::ContentExtensions::DFABytecodeCompiler::emitCheckValueRange):
1683         Add case-insensitive bytecode.
1684         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNodeTransitions):
1685         Check to see if case-insensitive bytecodes can be used.
1686         (WebCore::ContentExtensions::DFABytecodeCompiler::compileCheckForRange):
1687         * contentextensions/DFABytecodeCompiler.h:
1688         (WebCore::ContentExtensions::DFABytecodeCompiler::Range::Range):
1689         Added Range structure to be able to count the ranges in a future patch deciding if we want to use jump tables.
1690         * contentextensions/DFABytecodeInterpreter.cpp:
1691         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
1692         Interpret case-insensitive bytecodes.
1693
1694 2015-03-25  Sam Weinig  <sam@webkit.org>
1695
1696         Address additional review feedback from https://bugs.webkit.org/show_bug.cgi?id=143059.
1697
1698         * contentextensions/ContentExtensionCompiler.cpp:
1699         (WebCore::ContentExtensions::compileRuleList):
1700         * contentextensions/ContentExtensionCompiler.h:
1701         * contentextensions/ContentExtensionParser.cpp:
1702         (WebCore::ContentExtensions::getTypeFlags):
1703
1704 2015-03-25  Sam Weinig  <sam@webkit.org>
1705
1706         [Content Extensions] Convert content extension compiling to return error codes and write its output using a client
1707         https://bugs.webkit.org/show_bug.cgi?id=143059
1708
1709         Reviewed by Alex Christensen.
1710
1711         * WebCore.xcodeproj/project.pbxproj:
1712         Add ContentExtensionError.h/cpp.
1713
1714         * contentextensions/ContentExtensionError.cpp: Added.
1715         (WebCore::ContentExtensions::contentExtensionErrorCategory):
1716         * contentextensions/ContentExtensionError.h: Added.
1717         (WebCore::ContentExtensions::make_error_code):
1718         Add ContentExtensionError enum and std::error_code adaptor.
1719
1720         * contentextensions/ContentExtensionCompiler.h:
1721         Instead of returning CompiledContentExtensionData, use a client interface
1722         to pass data. Eventually, this should be turned into a direct streaming 
1723         interface so we can write directly to a file.
1724
1725         * contentextensions/ContentExtensionCompiler.cpp:
1726         (WebCore::ContentExtensions::compileRuleList):
1727         * contentextensions/ContentExtensionParser.cpp:
1728         (WebCore::ContentExtensions::getTypeFlags):
1729         (WebCore::ContentExtensions::loadTrigger):
1730         (WebCore::ContentExtensions::loadAction):
1731         (WebCore::ContentExtensions::loadRule):
1732         (WebCore::ContentExtensions::loadEncodedRules):
1733         (WebCore::ContentExtensions::parseRuleList):
1734         * contentextensions/ContentExtensionParser.h:
1735         Convert to return an error.
1736
1737 2015-03-25  Beth Dakin  <bdakin@apple.com>
1738
1739         REGRESSION (r181660): Safari navigates to link after a starting and canceling a 
1740         force preview
1741         https://bugs.webkit.org/show_bug.cgi?id=143057
1742         -and corresponding-
1743         rdar://problem/20251436
1744
1745         Reviewed by Tim Horton.
1746
1747         This patch adds a value for ActionUpdated to the ImmediateActionStage enum. Now if 
1748         m_immediateActionStage indicates that an immediate action has either begun or 
1749         completed then we can have the same behavior.
1750         * page/EventHandler.cpp:
1751         (WebCore::EventHandler::handleMouseReleaseEvent):
1752         * page/EventHandler.h:
1753
1754 2015-03-25  Dean Jackson  <dino@apple.com>
1755
1756         MediaControls: Use font with fixed number width
1757         https://bugs.webkit.org/show_bug.cgi?id=143018
1758         <rdar://problem/20245415>
1759
1760         Reviewed by Eric Carlson.
1761
1762         Add a new font-family, specific to Apple platforms,
1763         called -apple-system-font-monospaced-numbers. This is
1764         a special variant of the system font which uses monospaced
1765         forms for the number glyphs - allowing a time reading that
1766         doesn't bounce around as the time changes.
1767
1768         * Modules/mediacontrols/mediaControlsApple.css: Media controls should
1769         use the new font.
1770         (audio::-webkit-media-controls-time-remaining-display):
1771         * Modules/mediacontrols/mediaControlsiOS.css:
1772         (audio::-webkit-media-controls-time-remaining-display):
1773
1774         * platform/graphics/ios/FontCacheIOS.mm: Request a new CTFontRef with
1775         the appropriate attributes.
1776         (WebCore::createCTFontWithFamilyNameAndWeight):
1777         * platform/graphics/mac/FontCacheMac.mm: Ditto, but NSFont.
1778         (WebCore::fontWithFamily):
1779         * platform/spi/cocoa/CoreTextSPI.h: Expose the constants for
1780         the new form so that the public SDK can build.
1781
1782 2015-03-25  Alex Christensen  <achristensen@webkit.org>
1783
1784         [Content Extensions] Add multi-DFA compiling and interpreting.
1785         https://bugs.webkit.org/show_bug.cgi?id=143010
1786
1787         Reviewed by Benjamin Poulain.
1788
1789         * contentextensions/ContentExtensionCompiler.cpp:
1790         (WebCore::ContentExtensions::compileRuleList):
1791         Compile multiple NFAs to DFAs.
1792         * contentextensions/ContentExtensionsBackend.cpp:
1793         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
1794         Fixed a bug when there are no non-universal actions.
1795         We still need to report that no ignore-previous-rules was hit to apply the
1796         universal actions which are now accessed through DFABytecodeInterpreter::actionsFromDFARoot
1797         and skipped in DFABytecodeInterpreter::interpret.
1798         * contentextensions/DFABytecodeCompiler.cpp:
1799         (WebCore::ContentExtensions::DFABytecodeCompiler::compile):
1800         Add a header for each DFA.
1801         * contentextensions/DFABytecodeInterpreter.cpp:
1802         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsFromDFARoot):
1803         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
1804         Interpret as many DFAs as there are in the bytecode.
1805
1806 2015-03-25  Per Arne Vollan  <peavo@outlook.com>
1807
1808         [Win] Illegal character in project file.
1809         https://bugs.webkit.org/show_bug.cgi?id=143051
1810
1811         Reviewed by Brent Fulgham.
1812
1813         There is an illegal character in the WebCore project filter.
1814         WebCore files are shown unfiltered.
1815
1816         * WebCore.vcxproj/WebCore.vcxproj.filters:
1817
1818 2015-03-25  David Hyatt  <hyatt@apple.com>
1819
1820         Add a pref to enable the new block-inside-inline model
1821         https://bugs.webkit.org/show_bug.cgi?id=143050
1822
1823         Reviewed by Sam Weinig.
1824
1825         * page/Settings.in:
1826
1827 2015-03-25  Dan Bernstein  <mitz@apple.com>
1828
1829         iOS Simulator build fix.
1830
1831         * platform/spi/cocoa/IOSurfaceSPI.h:
1832
1833 2015-03-25  Commit Queue  <commit-queue@webkit.org>
1834
1835         Unreviewed, rolling out r181932.
1836         https://bugs.webkit.org/show_bug.cgi?id=143041
1837
1838         The test fails most of the time on bots (Requested by ap on
1839         #webkit).
1840
1841         Reverted changeset:
1842
1843         "[Content Extensions] Add multi-DFA compiling and
1844         interpreting."
1845         https://bugs.webkit.org/show_bug.cgi?id=143010
1846         http://trac.webkit.org/changeset/181932
1847
1848 2015-03-24  Dean Jackson  <dino@apple.com>
1849
1850         Source/WebCore/rendering/RenderThemeMac.mm:2181:118: error: null passed to a callee that requires a non-null argument [-Werror,-Wnonnull]
1851         https://bugs.webkit.org/show_bug.cgi?id=143039
1852
1853         Unreviewed build fix for newer versions of OS X.
1854
1855         * rendering/RenderThemeMac.mm: Define a null language parameter. This
1856         seemed better than turning the clang warning off for just that
1857         function.
1858         (WebCore::AttachmentLayout::layOutTitle):
1859         (WebCore::AttachmentLayout::layOutSubtitle):
1860
1861 2015-03-24  Dan Bernstein  <mitz@apple.com>
1862
1863         Another attempt to fix the build.
1864
1865         * WebCore.xcodeproj/project.pbxproj:
1866         * platform/spi/cocoa/QuartzCoreSPI.h:
1867
1868 2015-03-24  Alex Christensen  <achristensen@webkit.org>
1869
1870         [Content Extensions] Add multi-DFA compiling and interpreting.
1871         https://bugs.webkit.org/show_bug.cgi?id=143010
1872
1873         Reviewed by Benjamin Poulain.
1874
1875         * contentextensions/ContentExtensionCompiler.cpp:
1876         (WebCore::ContentExtensions::compileRuleList):
1877         Compile multiple NFAs to DFAs.
1878         * contentextensions/ContentExtensionsBackend.cpp:
1879         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
1880         Fixed a bug when there are no non-universal actions.
1881         We still need to report that no ignore-previous-rules was hit to apply the
1882         universal actions which are now accessed through DFABytecodeInterpreter::actionsFromDFARoot
1883         and skipped in DFABytecodeInterpreter::interpret.
1884         * contentextensions/DFABytecodeCompiler.cpp:
1885         (WebCore::ContentExtensions::DFABytecodeCompiler::compile):
1886         Add a header for each DFA.
1887         * contentextensions/DFABytecodeInterpreter.cpp:
1888         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsFromDFARoot):
1889         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
1890         Interpret as many DFAs as there are in the bytecode.
1891
1892 2015-03-24  Dan Bernstein  <mitz@apple.com>
1893
1894         Tried to fix the EWS build.
1895
1896         * platform/spi/cocoa/QuartzCoreSPI.h:
1897
1898 2015-03-24  Commit Queue  <commit-queue@webkit.org>
1899
1900         Unreviewed, rolling out r181898 and r181909.
1901         https://bugs.webkit.org/show_bug.cgi?id=143034
1902
1903         Broke fast/regions/auto-size/autoheight-two-pass-layout-
1904         complex-002.html (Requested by ap on #webkit).
1905
1906         Reverted changesets:
1907
1908         "Improve the offsetWidth/Height layout optimization"
1909         https://bugs.webkit.org/show_bug.cgi?id=143008
1910         http://trac.webkit.org/changeset/181898
1911
1912         "Disable layout dimensions optimization for RenderRegions"
1913         https://bugs.webkit.org/show_bug.cgi?id=143017
1914         http://trac.webkit.org/changeset/181909
1915
1916 2015-03-24  Zhuo Li  <zachli@apple.com>
1917
1918         Scripts running in isolated world should not subject to a page's CSP about 'eval'.
1919         https://bugs.webkit.org/show_bug.cgi?id=141316.
1920
1921         Reviewed by Geoffrey Garen.
1922
1923         * bindings/js/ScriptController.cpp:
1924         (WebCore::ScriptController::initScript):
1925         We should not impose the main world Content Security Policy onto the isolated world.
1926
1927 2015-03-24  Chris Dumez  <cdumez@apple.com>
1928
1929         [Mac] Use .cpp file extension instead of .mm for SharedTimerCF and PowerObserverMac
1930         https://bugs.webkit.org/show_bug.cgi?id=143026
1931
1932         Reviewed by Andy Estes.
1933
1934         Use .cpp file extension instead of .mm for SharedTimerCF and
1935         PowerObserverMac.
1936
1937         * WebCore.xcodeproj/project.pbxproj:
1938         * platform/cf/SharedTimerCF.cpp: Renamed from Source/WebCore/platform/cf/SharedTimerCF.mm.
1939         (WebCore::timerFired):
1940         Use WTF::AutodrainedPool instead of @autoreleasepool {}.
1941
1942         * platform/mac/PowerObserverMac.cpp: Renamed from Source/WebCore/platform/mac/PowerObserverMac.mm.
1943
1944 2015-03-24  Yusuke Suzuki  <utatane.tea@gmail.com>
1945
1946         REGRESSION (r181458): Heap use-after-free in JSSetIterator destructor
1947         https://bugs.webkit.org/show_bug.cgi?id=142696
1948
1949         Reviewed and tweaked by Geoffrey Garen.
1950
1951         Use JSSetIterator/JSMapIterator to iterate over JSSet and JSMap.
1952
1953         * ForwardingHeaders/runtime/JSMapIterator.h: Added.
1954         * ForwardingHeaders/runtime/JSSetIterator.h: Added.
1955         * bindings/js/SerializedScriptValue.cpp:
1956         (WebCore::CloneSerializer::serialize):
1957
1958 2015-03-24  Dan Bernstein  <mitz@apple.com>
1959
1960         Tried to fix the iOS Simulator build.
1961
1962         * platform/spi/cocoa/QuartzCoreSPI.h:
1963
1964 2015-03-24  Benjamin Poulain  <bpoulain@apple.com>
1965
1966         Make URL filter patterns matching consistent and add a simple canonicalization step
1967         https://bugs.webkit.org/show_bug.cgi?id=142998
1968
1969         Reviewed by Alex Christensen.
1970
1971         This patch makes two changes to the url filter input:
1972         -Make the matching "Search" by default, the pattern can now appear anywhere
1973          in the URL by default.
1974         -Make the input a little less fragile: do not explode on valid input
1975          that is not formatted in a certain way.
1976
1977         To implement the search behavior, I simply add an implict ".*" in front of the patterns
1978         when that make sense.
1979
1980         To make the input more solid, we do some little modification on the input:
1981         -Remove duplicated ".*".
1982         -Remove matching suffixes that do not bring new information.
1983         -Unify all the ".*" in the same format.
1984
1985         Why do that here? That should be done through a graph analysis on the machine.
1986
1987         The reason is this is incredibly cheap compared to the graph analysis. Any state
1988         removed upfront will save the handling of several hundred nodes in the deterministic
1989         graph.
1990
1991         * contentextensions/URLFilterParser.cpp:
1992         (WebCore::ContentExtensions::Term::isKnownToMatchAnyString):
1993         (WebCore::ContentExtensions::Term::isUniversalTransition):
1994         (WebCore::ContentExtensions::GraphBuilder::finalize):
1995         (WebCore::ContentExtensions::GraphBuilder::assertionBOL):
1996         (WebCore::ContentExtensions::GraphBuilder::fail):
1997         (WebCore::ContentExtensions::GraphBuilder::simplifySunkTerms):
1998
1999 2015-03-24  Chris Dumez  <cdumez@apple.com>
2000
2001         Regression(r181671): Caused Timer-related crashes on iOS / WK1
2002         https://bugs.webkit.org/show_bug.cgi?id=143025
2003
2004         Reviewed by Andy Estes.
2005
2006         Call CFRunLoopAddTimer() on WebThreadRunLoop() instead of
2007         CFRunLoopGetCurrent() for iOS, as we did before r181671.
2008
2009         I inadvertently changed this in r181671 when merging the Mac
2010         and iOS implementations.
2011
2012         No new tests, already covered by existing tests.
2013
2014         * platform/cf/SharedTimerCF.mm:
2015         (WebCore::setSharedTimerFireInterval):
2016
2017 2015-03-24  Dan Bernstein  <mitz@apple.com>
2018
2019         WebCore part of <rdar://problem/20282863> Transforms are flattened in snapshots of on-screen WKWebViews
2020         https://bugs.webkit.org/show_bug.cgi?id=143023
2021
2022         Reviewed by Tim Horton.
2023
2024         * platform/spi/cocoa/QuartzCoreSPI.h: Added the declaration of
2025         CARenderServerRenderLayerWithTransform.
2026
2027 2015-03-24  David Hyatt  <hyatt@apple.com>
2028
2029         Disable layout dimensions optimization for RenderRegions
2030         https://bugs.webkit.org/show_bug.cgi?id=143017
2031
2032         Reviewed by Dean Jackson.
2033
2034         * dom/Document.cpp:
2035         (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
2036         Turn off the optimization for regions, since auto height regions can change size
2037         without needing a layout.
2038
2039 2015-03-24  Beth Dakin  <bdakin@apple.com>
2040
2041         Add events related to force click gesture
2042         https://bugs.webkit.org/show_bug.cgi?id=142836
2043         -and corresponding-
2044         rdar://problem/20210239
2045
2046         Reviewed by Dean Jackson.
2047
2048         This patch adds six new events for the force click gesture:
2049
2050         webkitmouseforcewillbegin -> Event is sent just before mousedown to indicate that 
2051         force can be perceived if the user presses any harder. The author should prevent 
2052         default on this event to both prevent the user agent’s default force click 
2053         features and to receive the other 5 events.
2054
2055         webkitmouseforcechanged -> This event fires whenever force changes between the 
2056         mousedown and mouseup. It is a new type of mouse event that includes a force 
2057         variable which is a normalized number between 0 (corresponds to click) and 1 
2058         (corresponds to force click). In this patch, I have only added code to send this 
2059         event between mousedown and mouseforcedown, but as a followup patch, we plan to 
2060         send it through mouseup.
2061
2062         webkitmouseforcecancelled -> If the user releases their finger from the trackpad 
2063         after pressing hard enough to send webkitmouseforcewillbegin events but not hard 
2064         enough to force click, this event will be sent to indicate that the user bailed 
2065         out on the gesture.
2066
2067         webkitmouseforcedown -> The down part of the force click.
2068
2069         webkitmouseforceup -> The up part of the force click. This event is added in this 
2070         patch, but does not yet fire. That is work for a follow-up patch.
2071
2072         webkitmouseforceclick -> The equivalent of the click event for the force click. 
2073         Should fire just after webkitmouseforceup. This event is added in this patch, but 
2074         does not yet fire. That is work for a follow-up patch.
2075
2076         Add new files for WebKitMouseForceEvent to build systems.
2077         * DerivedSources.cpp:
2078         * DerivedSources.make:
2079         * WebCore.vcxproj/WebCore.vcxproj:
2080         * WebCore.vcxproj/WebCore.vcxproj.filters:
2081         * WebCore.xcodeproj/project.pbxproj:
2082         * WebCore.xcodeproj/project.pbxproj:
2083
2084         Plumbing for new events.
2085         * dom/Document.idl:
2086
2087         Code to dispatch the new events. Currently the code that calls these functions is 
2088         in WebKit2.
2089         * dom/Element.cpp:
2090         (WebCore::Element::dispatchMouseForceWillBegin):
2091         (WebCore::Element::dispatchMouseForceChanged):
2092         (WebCore::Element::dispatchMouseForceDown):
2093         (WebCore::Element::dispatchMouseForceUp):
2094         (WebCore::Element::dispatchMouseForceClick):
2095         (WebCore::Element::dispatchMouseForceCancelled):
2096         * dom/Element.h:
2097
2098         More plumbing.
2099         * dom/Element.idl:
2100         * dom/EventNames.h:
2101         * dom/EventNames.in:
2102
2103         Our new type of mouse event that includes force.
2104         * dom/WebKitMouseForceEvent.cpp: Added.
2105         (WebCore::WebKitMouseForceEventInit::WebKitMouseForceEventInit):
2106         (WebCore::WebKitMouseForceEvent::WebKitMouseForceEvent):
2107         (WebCore::WebKitMouseForceEvent::~WebKitMouseForceEvent):
2108         (WebCore::WebKitMouseForceEvent::eventInterface):
2109         * dom/WebKitMouseForceEvent.h: Added.
2110         * dom/WebKitMouseForceEvent.idl: Added.
2111
2112         More plumbing.
2113         * html/HTMLAttributeNames.in:
2114         * html/HTMLBodyElement.cpp:
2115         (WebCore::HTMLBodyElement::createWindowEventHandlerNameMap):
2116         * html/HTMLBodyElement.idl:
2117         * html/HTMLElement.cpp:
2118         (WebCore::HTMLElement::createEventHandlerNameMap):
2119         * page/DOMWindow.idl:
2120         * page/EventHandler.h:
2121         (WebCore::EventHandler::lastMouseDownEvent):
2122
2123 2015-03-24  Anders Carlsson  <andersca@apple.com>
2124
2125         Fix designated initializer violations
2126         https://bugs.webkit.org/show_bug.cgi?id=143016
2127         rdar://problem/20268858
2128
2129         Reviewed by Dan Bernstein.
2130
2131         Mark -[DOMObject init] as unavailable.
2132
2133         * bindings/objc/DOMObject.h:
2134         * bindings/objc/DOMObject.mm:
2135         (-[DOMObject init]):
2136
2137 2015-03-24  Benjamin Poulain  <benjamin@webkit.org>
2138
2139         CSS Selectors Level 4: enable case-insensitive attribute matching by default
2140         https://bugs.webkit.org/show_bug.cgi?id=142960
2141
2142         Reviewed by Andreas Kling.
2143
2144         All open issues have been resolved, enable the feature by default.
2145
2146         Test: fast/css/attribute-selector-case-insensitive.html
2147
2148         * css/CSSGrammar.y.in:
2149
2150 2015-03-24  Dean Jackson  <dino@apple.com>
2151
2152         MediaControls: Scrubber and Time displays have the incorrect blending
2153         https://bugs.webkit.org/show_bug.cgi?id=143011
2154         <rdar://problem/20245251>
2155
2156         Reviewed by Eric Carlson.
2157
2158         The scrubber in media controls should use plus-darker blending. Then
2159         the scrubber itself should use a slightly transparent black (55% opacity)
2160         when drawing.
2161
2162         * Modules/mediacontrols/mediaControlsiOS.css:
2163         (audio::-webkit-media-controls-timeline): Add the blend mode.
2164         * Modules/mediacontrols/mediaControlsiOS.js:
2165         (ControllerIOS.prototype.drawTimelineBackground): Start drawing with
2166         transparency. I changed the order of rendering to make it
2167         more clear we draw the three parts in left to right order.
2168
2169 2015-03-24  David Hyatt  <hyatt@apple.com>
2170
2171         Improve the offsetWidth/Height layout optimization
2172         https://bugs.webkit.org/show_bug.cgi?id=143008
2173
2174         Reviewed by Dean Jackson.
2175
2176         * dom/Document.cpp:
2177         (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
2178         * dom/Document.h:
2179         Change Element* to Element&. Clean up the dimension bits to use shifting. Remove both the inline and
2180         the positioning restrictions on the optimization check.
2181
2182         * dom/Element.cpp:
2183         (WebCore::Element::offsetWidth):
2184         (WebCore::Element::offsetHeight):
2185         Change to use Element& instead of Element*.
2186
2187         (WebCore::Element::clientWidth):
2188         (WebCore::Element::clientHeight):
2189         (WebCore::Element::scrollWidth):
2190         (WebCore::Element::scrollHeight):
2191         Turn on the optimization for clientWidth/Height and scrollWidth/Height.
2192
2193 2015-03-24  Yoav Weiss  <yoav@yoav.ws>
2194
2195         Stop image from displaying when src attribute is removed or emptied
2196         https://bugs.webkit.org/show_bug.cgi?id=142677
2197
2198         Reviewed by Chris Dumez.
2199
2200         Previously, we ignored empty attribute as failed URL, and didn't update the
2201         renderer when an image was removed. This patch fixes that.
2202
2203         Tests: fast/dom/HTMLImageElement/image-empty-src.html
2204                fast/dom/HTMLImageElement/image-remove-src.html
2205
2206         * loader/ImageLoader.cpp:
2207         (WebCore::ImageLoader::updateFromElement):
2208
2209 2015-03-17  Philippe Normand  <pnormand@igalia.com>
2210
2211         [OpenWebRTC] RealtimeMediaSourceCenter implementation
2212         https://bugs.webkit.org/show_bug.cgi?id=142476
2213
2214         Reviewed by Eric Carlson.
2215
2216         The old GStreamer MediaStreamCenter is replaced by the OpenWebRTC
2217         RealtimeMediaSourceCenter. It is not yet able to correctly assess
2218         MediaConstraints so it selects the first audio/video sources
2219         available through OpenWebRTC.
2220
2221         * PlatformEfl.cmake: Add new files to the build.
2222         * PlatformGTK.cmake: Ditto.
2223         * platform/mediastream/gstreamer/MediaStreamCenterGStreamer.cpp: Removed.
2224         * platform/mediastream/openwebrtc/OpenWebRTCUtilities.cpp: Added.
2225         (WebCore::initializeOpenWebRTC): Simple function to initialize the
2226         framework, it is going to be used by the PeerConnection backend as well.
2227         * platform/mediastream/openwebrtc/OpenWebRTCUtilities.h: Added.
2228         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp: Added.
2229         (WebCore::mediaSourcesAvailableCallback): Function invoked once
2230         the media sources discovery succeeded within OpenWebRTC.
2231         (WebCore::RealtimeMediaSourceCenter::platformCenter): Instantiate
2232         the OpenWebRTC RealtimeMediaSourceCenter.
2233         (WebCore::RealtimeMediaSourceCenterOwr::RealtimeMediaSourceCenterOwr):
2234         (WebCore::RealtimeMediaSourceCenterOwr::~RealtimeMediaSourceCenterOwr):
2235         (WebCore::RealtimeMediaSourceCenterOwr::validateRequestConstraints):
2236         Schedule a discovery process for the capture sources.
2237         (WebCore::RealtimeMediaSourceCenterOwr::createMediaStream): Pick
2238         the first audio/video sources and create a MediaStream accordingly.
2239         (WebCore::RealtimeMediaSourceCenterOwr::getMediaStreamTrackSources):
2240         Not yet implemented.
2241         (WebCore::RealtimeMediaSourceCenterOwr::mediaSourcesAvailable):
2242         Method invoked once the capture sources process succeeded. Parse
2243         them and create an internal cache of RealtimeMediaSources accordingly.
2244         (WebCore::RealtimeMediaSourceCenterOwr::firstSource): Utility
2245         function to fetch the first source of the given type from the
2246         RealtimeMediaSources cache.
2247         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h: Renamed from Source/WebCore/platform/mediastream/gstreamer/MediaStreamCenterGStreamer.h.
2248         * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h: Added.
2249
2250 2015-03-24  Csaba Osztrogonác  <ossy@webkit.org>
2251
2252         [EFL] Add OpenWebRTC in jhbuild
2253         https://bugs.webkit.org/show_bug.cgi?id=142778
2254
2255         Reviewed by Gyuyoung Kim.
2256
2257         Original patch by Philippe Normand <pnormand@igalia.com>
2258
2259         * PlatformEfl.cmake: Add OpenWebRTC CFLAGS and LDFLAGS.
2260
2261 2015-03-23 Yoav Weiss  <yoav@yoav.ws>
2262
2263         Update empty image canvas tests and fix a related bug
2264         https://bugs.webkit.org/show_bug.cgi?id=142694
2265
2266         Reviewed by Chris Dumez.
2267
2268         During the work on https://bugs.webkit.org/show_bug.cgi?id=142677
2269         we encountered an issue with canvas tests related to empty image handling
2270         when drawn or used as a pattern. After updating these tests, an issue with
2271         pattern handling was encountered.
2272
2273         The spec, as well as Chrome's implementation, say that when an empty image
2274         is used as a pattern, createPattern should return null. See
2275         https://html.spec.whatwg.org/multipage/scripting.html#fill-and-stroke-styles:check-the-usability-of-the-image-argument
2276         Instead, createPattern returned an exception in this case.
2277         This patch fixes that and makes sure that it returns a null when image loading hasn't started.
2278
2279         Tests: canvas/philip/tests/2d.drawImage.incomplete.emptysrc.html
2280                canvas/philip/tests/2d.drawImage.incomplete.nosrc.html
2281                canvas/philip/tests/2d.drawImage.incomplete.removedsrc.html
2282                canvas/philip/tests/2d.pattern.image.incomplete.emptysrc.html
2283                canvas/philip/tests/2d.pattern.image.incomplete.removedsrc.html
2284
2285         * html/canvas/CanvasRenderingContext2D.cpp:
2286         (WebCore::CanvasRenderingContext2D::createPattern): Return "null" if image is not fully decodeable.
2287
2288 2015-03-23  Alex Christensen  <achristensen@webkit.org>
2289
2290         Fix api tests after r181876.
2291
2292         * contentextensions/ContentExtensionsBackend.cpp:
2293         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
2294         Always append a CSSDisplayNoneStyleSheet action if no ignore-previous-rules is seen.
2295         * loader/cache/CachedResourceLoader.cpp:
2296         (WebCore::CachedResourceLoader::requestResource):
2297         Changed an assertion to a null check.
2298
2299 2015-03-23  Dean Jackson  <dino@apple.com>
2300
2301         Timelines are sharing the same canvas background
2302         https://bugs.webkit.org/show_bug.cgi?id=142994
2303         <rdar://problem/20209466>
2304
2305         Reviewed by Brent Fulgham.
2306
2307         Since each MediaControl lives in an isolated world, we
2308         can't rely on a global variable to provide a unique
2309         identifier for a named canvas. The fix is to expose
2310         WebCore's UUID generator, and have each canvas use
2311         that for a name.
2312
2313         * Modules/mediacontrols/MediaControlsHost.cpp:
2314         (WebCore::MediaControlsHost::generateUUID): New method on the
2315         MediaControlsHost that generates a UUID.
2316         * Modules/mediacontrols/MediaControlsHost.h:
2317         * Modules/mediacontrols/MediaControlsHost.idl:
2318
2319         * Modules/mediacontrols/mediaControlsApple.js: Remove the global
2320         variable unique ID that wasn't working, and instead get
2321         an ID from the MediaControlsHost.
2322         (Controller.prototype.createControls):
2323         * Modules/mediacontrols/mediaControlsiOS.js:
2324         (ControllerIOS):
2325
2326 2015-03-23  Brent Fulgham  <bfulgham@apple.com>
2327
2328         Scroll latching logic can get stuck in 'scrollable="no"' iframes
2329         https://bugs.webkit.org/show_bug.cgi?id=142789
2330         <rdar://problem/20129494>
2331
2332         Reviewed by Dean Jackson.
2333
2334         Clean up the EventHandler and latching code as follows:
2335         (1) Do not handle iframe elements as part of the normal latching logic. Instead, iframes should
2336             be evaluated during the 'platformCompleteWheelEvent' phase of processing as top-level scrolling
2337             frames.
2338         (2) Get rid of the ill-conceived notation that we should process non-mainframe and main-frame frames
2339             different.
2340         (3) Modify code to reflect that the scroll latching code really deals with overflow scrolling. Consequently,
2341             the 'findEnclosingScrollableContainer' was renamed to 'findEnclosingOverflowScroll' and does not
2342             treat iframe as a suitable target.
2343         (4) Do not create a latching state object when the container being evaluated is already scrolled to the
2344             extreme position in the direction of the mouse gesture. In this case, we want the enclosing frame
2345             to be the latching target.
2346         (5) Do not treat the state where the mouse wheel gesture has ended manual scrolling, but has not ended
2347             momentum scrolling, as an appropriate time to select a latching target.
2348
2349         * page/EventHandler.cpp:
2350         (WebCore::EventHandler::platformCompleteWheelEvent): Modify signature to remove unneeded argument.
2351         (WebCore::EventHandler::handleWheelEvent): Modify call to 'platformCompleteWheelEvent' to remove unused argument.
2352         * page/EventHandler.h:
2353         * page/mac/EventHandlerMac.mm:
2354         (WebCore::findEnclosingOverflowScroll): Renamed from 'findEnclosingScrollableContainer' and revised per the
2355         notes above.
2356         (WebCore::EventHandler::platformPrepareForWheelEvents): Remove mainFrame vs. non-mainFrame code paths and
2357         consolidate logic.
2358         (WebCore::EventHandler::platformCompleteWheelEvent): Remove unused argument. The wheel event target is no
2359         longer needed here, now that iframes are not processed by this code.
2360         (WebCore::findEnclosingScrollableContainer): Deleted.
2361         * page/scrolling/ScrollLatchingState.cpp:
2362         (WebCore::ScrollLatchingState::setPreviousWheelScrolledElement:) Switch to move operator for passing
2363         a temporary RefPtr to the the function.
2364         * page/scrolling/ScrollLatchingState.h:
2365         * platform/PlatformWheelEvent.h:
2366         (WebCore::PlatformWheelEvent::useLatchedEventElement): Recognize 'phase=ended, momentum=none' as a state
2367         that should not cause latching state to be revised.
2368
2369 2015-03-23  Anders Carlsson  <andersca@apple.com>
2370
2371         Try to fix the iOS build.
2372
2373         * platform/network/mac/CookieJarMac.mm:
2374
2375 2015-03-23  Brady Eidson  <beidson@apple.com>
2376
2377         Content extensions should apply css selectors
2378         https://bugs.webkit.org/show_bug.cgi?id=142604
2379
2380         Reviewed by Alex Christensen.
2381
2382         Tests: http/tests/contentextensions/css-display-none.html
2383
2384         * WebCore.xcodeproj/project.pbxproj:
2385
2386         * contentextensions/ContentExtension.cpp:
2387         (WebCore::ContentExtensions::ContentExtension::create):
2388         (WebCore::ContentExtensions::ContentExtension::ContentExtension):
2389         (WebCore::ContentExtensions::ContentExtension::globalDisplayNoneStyleSheet):
2390         * contentextensions/ContentExtension.h:
2391         (WebCore::ContentExtensions::ContentExtension::identifier):
2392         (WebCore::ContentExtensions::ContentExtension::compiledExtension):
2393
2394         * contentextensions/ContentExtensionsBackend.cpp:
2395         (WebCore::ContentExtensions::ContentExtensionsBackend::addContentExtension):
2396         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
2397         (WebCore::ContentExtensions::ContentExtensionsBackend::globalDisplayNoneStyleSheet):
2398         * contentextensions/ContentExtensionsBackend.h:
2399
2400         * contentextensions/DFABytecodeInterpreter.cpp:
2401         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
2402
2403         * dom/DocumentStyleSheetCollection.cpp:
2404         (WebCore::DocumentStyleSheetCollection::maybeAddContentExtensionSheet):
2405         * dom/DocumentStyleSheetCollection.h:
2406
2407         * loader/DocumentLoader.cpp:
2408         (WebCore::DocumentLoader::commitData):
2409         (WebCore::DocumentLoader::startLoadingMainResource):
2410         (WebCore::DocumentLoader::addPendingContentExtensionSheet):
2411         * loader/DocumentLoader.h:
2412
2413         * loader/cache/CachedResourceLoader.cpp:
2414         (WebCore::CachedResourceLoader::requestResource):
2415
2416         * loader/cache/CachedResourceRequest.cpp:
2417         (WebCore::CachedResourceRequest::setInitiator):
2418         * loader/cache/CachedResourceRequest.h:
2419         (WebCore::CachedResourceRequest::initiatingDocumentLoader):
2420
2421         * page/UserContentController.cpp:
2422         (WebCore::UserContentController::globalDisplayNoneStyleSheet):
2423         (WebCore::UserContentController::displayNoneCSSRule):
2424         * page/UserContentController.h:
2425
2426 2015-03-23  Anders Carlsson  <andersca@apple.com>
2427
2428         -[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:] doesn't remove cookies
2429         https://bugs.webkit.org/show_bug.cgi?id=142990
2430         rdar://problem/20241645
2431
2432         Reviewed by Andreas Kling.
2433
2434         Use the Mac version of deleteAllCookiesModifiedSince on iOS as well.
2435
2436         * platform/network/cf/CookieJarCFNet.cpp:
2437         * platform/network/mac/CookieJarMac.mm:
2438
2439 2015-03-23  Conrad Shultz  <conrad_shultz@apple.com>
2440
2441         Replace uses of kCTFontSystemFontType
2442         https://bugs.webkit.org/show_bug.cgi?id=142984
2443
2444         Reviewed by Tim Horton.
2445
2446         * rendering/RenderThemeMac.mm:
2447         (WebCore::AttachmentLayout::layOutTitle):
2448         (WebCore::AttachmentLayout::layOutSubtitle):
2449
2450 2015-03-23  Dean Jackson  <dino@apple.com>
2451
2452         kCTFontSystemFontType is deprecated in CoreText
2453         https://bugs.webkit.org/show_bug.cgi?id=142981
2454         <rdar://problem/20261171>
2455
2456         Reviewed by Beth Dakin.
2457
2458         Update to the non-deprecated version.
2459
2460         * rendering/RenderThemeIOS.mm: kCTFontSystemFontType -> kCTFontUIFontSystem
2461         (WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
2462
2463 2015-03-23  Eric Carlson  <eric.carlson@apple.com>
2464
2465         [Mac] Enable fullscreen for MSE-based videos
2466         https://bugs.webkit.org/show_bug.cgi?id=142971
2467
2468         Reviewed by Jer Noble.
2469
2470         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2471         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsFullscreen): Return true;
2472
2473 2015-03-23  Alex Christensen  <achristensen@webkit.org>
2474
2475         [MediaFoundation] Implement seek.
2476         https://bugs.webkit.org/show_bug.cgi?id=142594
2477
2478         Reviewed by Darin Adler.
2479
2480         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
2481         (WebCore::MediaPlayerPrivateMediaFoundation::seeking):
2482         (WebCore::MediaPlayerPrivateMediaFoundation::seekDouble):
2483         (WebCore::MediaPlayerPrivateMediaFoundation::durationDouble):
2484         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
2485
2486 2015-03-23  Dan Bernstein  <mitz@apple.com>
2487
2488         Fixed the build.
2489
2490         * platform/graphics/cocoa/FontCocoa.mm:
2491         (WebCore::Font::platformBoundsForGlyph): Switched to non-deprecated CTFontOrientation values.
2492         (WebCore::Font::platformWidthForGlyph): Ditto.
2493
2494 2015-03-23  Jer Noble  <jer.noble@apple.com>
2495
2496         [iOS] Accessibility crashing because MediaPlayer is laying out UI off the main thread
2497         https://bugs.webkit.org/show_bug.cgi?id=142970
2498
2499         Reviewed by Eric Carlson.
2500
2501         Return early after synchronously calling to the main thread to allocate the volume
2502         view, to avoid re-allocating the volume view again on the web thread.
2503
2504         * platform/audio/ios/MediaSessionManagerIOS.mm:
2505         (-[WebMediaSessionHelper allocateVolumeView]):
2506
2507 2015-03-23  Tim Horton  <timothy_horton@apple.com>
2508
2509         Add a share item to the link action menu
2510         https://bugs.webkit.org/show_bug.cgi?id=142961
2511         <rdar://problem/19198374>
2512
2513         Reviewed by Beth Dakin.
2514
2515         * English.lproj/Localizable.strings:
2516         Remove some now-unused strings.
2517
2518         * platform/spi/mac/NSMenuSPI.h:
2519         Add some SPI.
2520
2521 2015-03-23  David Kilzer  <ddkilzer@apple.com>
2522
2523         [iOS] Build fix: CoreText deprecated kCTFontSystemFontType
2524
2525         Fix tracked by:  <rdar://problem/20261171>
2526
2527         * rendering/RenderThemeIOS.mm:
2528         (WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
2529         Add clang pragmas.
2530
2531 2015-03-23  Brent Fulgham  <bfulgham@apple.com>
2532
2533         Unreviewed test fix.
2534
2535         * css/CSSParser.cpp:
2536         (WebCore::CSSParser::parseScrollSnapDestination): Remove new assertion.
2537
2538 2015-03-23  Brent Fulgham  <bfulgham@apple.com>
2539
2540         scroll-snap-destination and scroll-snap-coordinate do not seem to work together properly
2541         https://bugs.webkit.org/show_bug.cgi?id=142552
2542         <rdar://problem/20114743>
2543
2544         Reviewed by Dean Jackson.
2545
2546         Revise the snap point logic as follows:
2547         (1) Put the snap point destination handling in a helper function to make the rest of the code
2548             easier to read.
2549         (2) Make sure we always have a left-hand snap point (i.e., position 0), but don't add multiple
2550             left-hand snap points.
2551         (3) Create a helper function to determine if we should be working with the scroll snap 'elements'
2552             behavior. We want to use this for scroll-snap-destination/scroll-snap-coordinate markup.
2553         (4) Create per-element snap point offsets when using scroll-snap-destination/scroll-snap-coordinate.
2554
2555         * css/CSSParser.cpp:
2556         (WebCore::CSSParser::parseScrollSnapDestination): Add assertion to try to catch bad parser state.
2557         * page/scrolling/AxisScrollSnapOffsets.cpp:
2558         (WebCore::destinationOffsetForViewSize): Added helper function to consolidate logic for handling
2559         destination coordinates.
2560         (WebCore::updateFromStyle): Make sure a left-hand snap point is always provided.
2561         (WebCore::styleUsesElements): Added helper function.
2562         (WebCore::updateSnapOffsetsForScrollableArea): Revise logic to generate 'per-element' snap point
2563         offsets.
2564
2565 2015-03-23  Yoav Weiss  <yoav@yoav.ws>
2566
2567         Refactor ImageLoader's setting of CachedImage
2568         https://bugs.webkit.org/show_bug.cgi?id=142825
2569
2570         Reviewed by Chris Dumez.
2571
2572         No new tests, since there's no functional change.
2573
2574         setImage and setImageWithoutConsideringPendingLoadEvent were not called with new
2575         CachedImages and were not used as originally intended. That resulted in some dead code,
2576         and confusion when going over the code.
2577         This patch renames these methods into equivalent clearImage* methods, and deletes resulting dead code.
2578
2579         * html/HTMLObjectElement.cpp:
2580         (WebCore::HTMLObjectElement::renderFallbackContent): Changed setImage call to clearImage.
2581         * loader/ImageLoader.cpp:
2582         (WebCore::ImageLoader::clearImage):
2583         (WebCore::ImageLoader::clearImageWithoutConsideringPendingLoadEvent):
2584         (WebCore::ImageLoader::notifyFinished):
2585         (WebCore::ImageLoader::elementDidMoveToNewDocument):
2586         (WebCore::ImageLoader::setImage): Deleted.
2587         (WebCore::ImageLoader::setImageWithoutConsideringPendingLoadEvent): Deleted.
2588         * loader/ImageLoader.h:
2589
2590 2015-03-22  Benjamin Poulain  <benjamin@webkit.org>
2591
2592         CSS Selectors: fix attribute case-insensitive matching of Contain and List
2593         https://bugs.webkit.org/show_bug.cgi?id=142932
2594
2595         Reviewed by Darin Adler.
2596
2597         Fix the last two attribute selectors that were using full case-insensitive
2598         match:
2599             -Contain ([foo*=bar]).
2600             -List (foo~=bar]).
2601
2602         Tests: fast/selectors/attribute-contains-value-matching-is-ascii-case-insensitive.html
2603                fast/selectors/attribute-list-value-matching-is-ascii-case-insensitive.html
2604
2605         * css/SelectorChecker.cpp:
2606         (WebCore::attributeValueMatches):
2607         * cssjit/SelectorCompiler.cpp:
2608         (WebCore::SelectorCompiler::attributeValueContains):
2609         (WebCore::SelectorCompiler::attributeValueSpaceSeparetedListContains):
2610
2611 2015-03-22  Benjamin Poulain  <bpoulain@apple.com>
2612
2613         Detect when url filter pattern with groups match the empty string
2614         https://bugs.webkit.org/show_bug.cgi?id=142930
2615
2616         Reviewed by Sam Weinig.
2617
2618         The previous test was only accounting for simple atoms. This patch extends
2619         it to groups.
2620
2621         * contentextensions/URLFilterParser.cpp:
2622         (WebCore::ContentExtensions::Term::quantify):
2623         (WebCore::ContentExtensions::Term::matchesAtLeastOneCharacter):
2624         (WebCore::ContentExtensions::GraphBuilder::finalize):
2625         (WebCore::ContentExtensions::Term::quantifier): Deleted.
2626
2627 2015-03-22  Eric Carlson  <eric.carlson@apple.com>
2628
2629         [Mac] Enable WIRELESS_PLAYBACK_TARGET for WK1
2630         https://bugs.webkit.org/show_bug.cgi?id=142940
2631
2632         Reviewed by Sam Weinig.
2633
2634         * dom/Document.cpp:
2635         (WebCore::Document::didChoosePlaybackTarget): const-ify the didChoosePlaybackTarget argument.
2636         * dom/Document.h:
2637
2638         * html/HTMLMediaSession.cpp:
2639         (WebCore::HTMLMediaSession::didChoosePlaybackTarget): Ditto.
2640         * html/HTMLMediaSession.h:
2641
2642         * page/Page.cpp:
2643         (WebCore::Page::didChoosePlaybackTarget):  Ditto.
2644         * page/Page.h:
2645
2646         * platform/audio/MediaSession.h:
2647         * platform/graphics/MediaPlaybackTargetPickerClient.h:
2648         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm: 
2649         (WebCore::MediaPlaybackTargetPickerMac::devicePicker):  Ditto.
2650
2651 2015-03-22  Anders Carlsson  <andersca@apple.com>
2652
2653         _WKWebsiteDataStore should clear WebSQL databases
2654         https://bugs.webkit.org/show_bug.cgi?id=142947
2655
2656         Reviewed by Sam Weinig.
2657
2658         * Modules/webdatabase/DatabaseTracker.cpp:
2659         (WebCore::DatabaseTracker::trackerWithDatabasePath):
2660         Add a hack so we can get at a tracker from the UI process.
2661
2662         (WebCore::DatabaseTracker::deleteDatabasesModifiedSince):
2663         New function that deletes all databases modified after a given time.
2664
2665         * Modules/webdatabase/DatabaseTracker.h:
2666         Add new members and export the ones we want to call from WebKit2.
2667
2668         * Modules/webdatabase/OriginLock.h:
2669         Export the destructor.
2670
2671 2015-03-21  Dean Jackson  <dino@apple.com>
2672
2673         Remove the prefix for CSS Transforms
2674         https://bugs.webkit.org/show_bug.cgi?id=142927
2675         <rdar://problem/11568151>
2676
2677         Reviewed by Simon Fraser.
2678
2679         Support the bare form of:
2680         - transform
2681         - transform-style
2682         - transform-origin
2683         - perspective
2684         - perspective-origin
2685
2686         For transform-style, we also still differentiate the prefixed property
2687         because we may want to use that as an indicator of legacy content.
2688
2689         This is mostly a find and replace, but with some related naming
2690         changes. The DOM interface for WebKitCSSTransformValue remains
2691         unchanged.
2692
2693         Tests: transforms/2d/transform-2d-prefixed.html
2694                transforms/3d/general/prefixed-3dtransform-values.html
2695
2696         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
2697         (WebCore::propertyChangeMayRepaintNonDescendants):
2698         * css/CSSComputedStyleDeclaration.cpp:
2699         (WebCore::isLayoutDependent):
2700         (WebCore::ComputedStyleExtractor::propertyValue):
2701         * css/CSSParser.cpp:
2702         (WebCore::isValidKeywordPropertyAndValue):
2703         (WebCore::isKeywordPropertyID):
2704         (WebCore::parseTranslateTransformValue):
2705         (WebCore::CSSParser::parseValue):
2706         (WebCore::CSSParser::parseTransformOrigin):
2707         (WebCore::CSSParser::parsePerspectiveOrigin):
2708         * css/CSSPropertyNames.in:
2709         * css/StyleProperties.cpp:
2710         (WebCore::StyleProperties::getPropertyValue):
2711         (WebCore::StyleProperties::asText):
2712         * css/WebKitCSSMatrix.cpp:
2713         (WebCore::WebKitCSSMatrix::setMatrixValue):
2714         * html/track/VTTCue.cpp:
2715         (WebCore::VTTCueBox::applyCSSProperties):
2716         * page/animation/AnimationController.cpp:
2717         (WebCore::AnimationControllerPrivate::computeExtentOfAnimation):
2718         * page/animation/CSSPropertyAnimation.cpp:
2719         (WebCore::PropertyWrapperAcceleratedTransform::PropertyWrapperAcceleratedTransform):
2720         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2721         * page/animation/CompositeAnimation.cpp:
2722         (WebCore::CompositeAnimation::computeExtentOfTransformAnimation):
2723         * page/animation/ImplicitAnimation.cpp:
2724         (WebCore::ImplicitAnimation::computeExtentOfTransformAnimation):
2725         * page/animation/KeyframeAnimation.cpp:
2726         (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation):
2727         (WebCore::KeyframeAnimation::validateTransformFunctionList):
2728         * platform/graphics/GraphicsLayer.cpp:
2729         (WebCore::GraphicsLayer::validateTransformOperations):
2730         * platform/graphics/GraphicsLayerClient.h:
2731         * platform/graphics/ca/GraphicsLayerCA.cpp:
2732         (WebCore::propertyIdToString):
2733         (WebCore::GraphicsLayerCA::moveOrCopyAnimations):
2734         (WebCore::GraphicsLayerCA::addAnimation):
2735         (WebCore::GraphicsLayerCA::isRunningTransformAnimation):
2736         (WebCore::GraphicsLayerCA::createAnimationFromKeyframes):
2737         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
2738         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
2739         (WebCore::GraphicsLayerTextureMapper::addAnimation):
2740         * platform/graphics/texmap/TextureMapperAnimation.cpp:
2741         (WebCore::TextureMapperAnimation::applyInternal):
2742         * platform/graphics/texmap/TextureMapperLayer.cpp:
2743         (WebCore::TextureMapperLayer::syncAnimations):
2744         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2745         (WebCore::CoordinatedGraphicsLayer::selfOrAncestorHasActiveTransformAnimation):
2746         (WebCore::CoordinatedGraphicsLayer::selfOrAncestorHaveNonAffineTransforms):
2747         (WebCore::CoordinatedGraphicsLayer::addAnimation):
2748         * rendering/RenderLayerBacking.cpp:
2749         (WebCore::RenderLayerBacking::updateGeometry):
2750         (WebCore::RenderLayerBacking::startAnimation):
2751         (WebCore::RenderLayerBacking::startTransition):
2752         (WebCore::RenderLayerBacking::graphicsLayerToCSSProperty):
2753         (WebCore::RenderLayerBacking::cssToGraphicsLayerProperty):
2754         * rendering/RenderLayerCompositor.cpp:
2755         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation):
2756         (WebCore::RenderLayerCompositor::isRunningTransformAnimation):
2757         * svg/SVGElement.cpp:
2758         (WebCore::populateAttributeNameToCSSPropertyIDMap):
2759
2760 2015-03-21  Commit Queue  <commit-queue@webkit.org>
2761
2762         Unreviewed, rolling out r181824.
2763         https://bugs.webkit.org/show_bug.cgi?id=142935
2764
2765         Broke Windows build (Requested by ap on #webkit).
2766
2767         Reverted changeset:
2768
2769         "Remove the prefix for CSS Transforms"
2770         https://bugs.webkit.org/show_bug.cgi?id=142927
2771         http://trac.webkit.org/changeset/181824
2772
2773 2015-03-20  Dean Jackson  <dino@apple.com>
2774
2775         Remove the prefix for CSS Transforms
2776         https://bugs.webkit.org/show_bug.cgi?id=142927
2777         <rdar://problem/11568151>
2778
2779         Reviewed by Simon Fraser.
2780
2781         Support the bare form of:
2782         - transform
2783         - transform-style
2784         - transform-origin
2785         - perspective
2786         - perspective-origin
2787
2788         For transform-style, we also still differentiate the prefixed property
2789         because we may want to use that as an indicator of legacy content.
2790
2791         This is mostly a find and replace, but with some related naming
2792         changes. The DOM interface for WebKitCSSTransformValue remains
2793         unchanged.
2794
2795         Tests: transforms/2d/transform-2d-prefixed.html
2796                transforms/3d/general/prefixed-3dtransform-values.html
2797
2798         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
2799         (WebCore::propertyChangeMayRepaintNonDescendants):
2800         * css/CSSComputedStyleDeclaration.cpp:
2801         (WebCore::isLayoutDependent):
2802         (WebCore::ComputedStyleExtractor::propertyValue):
2803         * css/CSSParser.cpp:
2804         (WebCore::isValidKeywordPropertyAndValue):
2805         (WebCore::isKeywordPropertyID):
2806         (WebCore::parseTranslateTransformValue):
2807         (WebCore::CSSParser::parseValue):
2808         (WebCore::CSSParser::parseTransformOrigin):
2809         (WebCore::CSSParser::parsePerspectiveOrigin):
2810         * css/CSSPropertyNames.in:
2811         * css/StyleProperties.cpp:
2812         (WebCore::StyleProperties::getPropertyValue):
2813         (WebCore::StyleProperties::asText):
2814         * css/WebKitCSSMatrix.cpp:
2815         (WebCore::WebKitCSSMatrix::setMatrixValue):
2816         * html/track/VTTCue.cpp:
2817         (WebCore::VTTCueBox::applyCSSProperties):
2818         * page/animation/AnimationController.cpp:
2819         (WebCore::AnimationControllerPrivate::computeExtentOfAnimation):
2820         * page/animation/CSSPropertyAnimation.cpp:
2821         (WebCore::PropertyWrapperAcceleratedTransform::PropertyWrapperAcceleratedTransform):
2822         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2823         * page/animation/CompositeAnimation.cpp:
2824         (WebCore::CompositeAnimation::computeExtentOfTransformAnimation):
2825         * page/animation/ImplicitAnimation.cpp:
2826         (WebCore::ImplicitAnimation::computeExtentOfTransformAnimation):
2827         * page/animation/KeyframeAnimation.cpp:
2828         (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation):
2829         (WebCore::KeyframeAnimation::validateTransformFunctionList):
2830         * platform/graphics/GraphicsLayer.cpp:
2831         (WebCore::GraphicsLayer::validateTransformOperations):
2832         * platform/graphics/GraphicsLayerClient.h:
2833         * platform/graphics/ca/GraphicsLayerCA.cpp:
2834         (WebCore::propertyIdToString):
2835         (WebCore::GraphicsLayerCA::moveOrCopyAnimations):
2836         (WebCore::GraphicsLayerCA::addAnimation):
2837         (WebCore::GraphicsLayerCA::isRunningTransformAnimation):
2838         (WebCore::GraphicsLayerCA::createAnimationFromKeyframes):
2839         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
2840         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
2841         (WebCore::GraphicsLayerTextureMapper::addAnimation):
2842         * platform/graphics/texmap/TextureMapperAnimation.cpp:
2843         (WebCore::TextureMapperAnimation::applyInternal):
2844         * platform/graphics/texmap/TextureMapperLayer.cpp:
2845         (WebCore::TextureMapperLayer::syncAnimations):
2846         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2847         (WebCore::CoordinatedGraphicsLayer::selfOrAncestorHasActiveTransformAnimation):
2848         (WebCore::CoordinatedGraphicsLayer::selfOrAncestorHaveNonAffineTransforms):
2849         (WebCore::CoordinatedGraphicsLayer::addAnimation):
2850         * rendering/RenderLayerBacking.cpp:
2851         (WebCore::RenderLayerBacking::updateGeometry):
2852         (WebCore::RenderLayerBacking::startAnimation):
2853         (WebCore::RenderLayerBacking::startTransition):
2854         (WebCore::RenderLayerBacking::graphicsLayerToCSSProperty):
2855         (WebCore::RenderLayerBacking::cssToGraphicsLayerProperty):
2856         * rendering/RenderLayerCompositor.cpp:
2857         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation):
2858         (WebCore::RenderLayerCompositor::isRunningTransformAnimation):
2859         * svg/SVGElement.cpp:
2860         (WebCore::populateAttributeNameToCSSPropertyIDMap):
2861
2862 2015-03-20  Yusuke Suzuki  <utatane.tea@gmail.com>
2863
2864         REGRESSION (r179429): Potential Use after free in JavaScriptCore`WTF::StringImpl::ref + 83
2865         https://bugs.webkit.org/show_bug.cgi?id=142410
2866
2867         Reviewed by Geoffrey Garen.
2868
2869         The same issues are found in the existing code; PropertyName does not have ownership.
2870         This patch rewrite the point that should have ownership to Identifier.
2871
2872         * bindings/js/JSDOMWindowCustom.cpp:
2873         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
2874         (WebCore::JSDOMWindow::putByIndex):
2875         * bindings/js/ReadableStreamJSSource.cpp:
2876         (WebCore::getInternalSlotFromObject):
2877         * bindings/scripts/CodeGeneratorJS.pm:
2878         (GenerateImplementation):
2879         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
2880         (WebCore::JSTestCustomNamedGetter::getOwnPropertySlotByIndex):
2881         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2882         (WebCore::JSTestEventTarget::getOwnPropertySlotByIndex):
2883         * bindings/scripts/test/JS/JSTestInterface.cpp:
2884         (WebCore::JSTestInterface::putByIndex):
2885
2886 2015-03-20  Simon Fraser  <simon.fraser@apple.com>
2887
2888         Log the slow-scrolling reasons (if any) on first commit of a ScrollingTreeFrameScrollingNodeMac
2889         https://bugs.webkit.org/show_bug.cgi?id=142917
2890
2891         Reviewed by Beth Dakin.
2892         
2893         The scrollperf test would fail to detect transitions between slow and fast scrolling
2894         for new pages, because there was no logging when slow-scrolling scrolling tree was
2895         torn down, and a new fast-scrolling tree constructed.
2896         
2897         Fix by always logging the slow-scrolling reasons in the first update of the
2898         ScrollingTreeFrameScrollingNodeMac, even when the slow-scrolling reasons haven't
2899         changed.
2900
2901         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
2902         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2903         (WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac):
2904         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
2905
2906 2015-03-19  Geoffrey Garen  <ggaren@apple.com>
2907
2908         Function.prototype.toString should not decompile the AST
2909         https://bugs.webkit.org/show_bug.cgi?id=142853
2910
2911         Reviewed by Sam Weinig.
2912
2913         * bindings/js/JSLazyEventListener.cpp:
2914         (WebCore::JSLazyEventListener::initializeJSFunction): Adjust the line
2915         number of attribute event listeners to account for the leading newline
2916         now added by JavaScriptCore.
2917
2918         This solution is not perfect, but there are a lot of pre-existing problems
2919         with line and column reporting for attribute event listeners, and this
2920         preserves existing behavior with reasonable reliability.
2921
2922 2015-03-20  Alex Christensen  <achristensen@webkit.org>
2923
2924         Progress towards CMake on Mac.
2925         https://bugs.webkit.org/show_bug.cgi?id=136003
2926
2927         Reviewed by Chris Dumez.
2928
2929         * PlatformMac.cmake:
2930         Added some directories to create forwarding headers from.
2931         Generate ObjC bindings.
2932
2933 2015-03-20  Per Arne Vollan  <peavo@outlook.com>
2934
2935         [WinCairo] Crash when leaving page while video is playing.
2936         https://bugs.webkit.org/show_bug.cgi?id=142578
2937
2938         Reviewed by Alex Christensen.
2939
2940         This can happen when there is an asynchronous event invoked from a video worker
2941         thread, accessing the media player object after it has been deleted.
2942         This is solved by resetting the media player pointer in the event object,
2943         when the media player is deleted.
2944
2945         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
2946         (WebCore::MediaPlayerPrivateMediaFoundation::~MediaPlayerPrivateMediaFoundation):
2947         (WebCore::MediaPlayerPrivateMediaFoundation::addListener):
2948         (WebCore::MediaPlayerPrivateMediaFoundation::removeListener):
2949         (WebCore::MediaPlayerPrivateMediaFoundation::notifyDeleted):
2950         (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::AsyncCallback):
2951         (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::~AsyncCallback):
2952         (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::Invoke):
2953         (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::onMediaPlayerDeleted):
2954         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
2955         (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerListener::MediaPlayerListener):
2956         (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerListener::~MediaPlayerListener):
2957         (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerListener::onMediaPlayerDeleted):
2958
2959 2015-03-20  Chris Dumez  <cdumez@apple.com>
2960
2961         Regression(r181782): Caused WebKit2.RestoreSessionStateContainingFormData API test to crash
2962         https://bugs.webkit.org/show_bug.cgi?id=142911
2963
2964         Reviewed by Antti Koivisto.
2965
2966         Drop the isBackForwardLoadType(m_loadType) assertion in
2967         FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad(). This assertion
2968         used to hold true when goToBackForwardItem() was only called with
2969         history navigation load types. However, after r181782, we use a Standard
2970         load in the cases where we do not wish to display stale content (e.g.
2971         restoring session state).
2972
2973         The assertion comment says "We only use cache-only loads to avoid
2974         resubmitting forms". However, we then call loadDifferentDocumentItem()
2975         which already takes care of using the ReturnCacheDataElseLoad cache
2976         policy as the HistoryItem has form data and we pass
2977         MayNotAttemptCacheOnlyLoadForFormSubmissionItem as parameter.
2978
2979         No new tests, covered by WebKit2.RestoreSessionStateContainingFormData
2980         API test.
2981
2982         * loader/FrameLoader.cpp:
2983         (WebCore::FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad):
2984
2985 2015-03-20  Andy Estes  <aestes@apple.com>
2986
2987         [Content Filtering] Adopt NEFilterSource unblock handling
2988         https://bugs.webkit.org/show_bug.cgi?id=142904
2989
2990         Reviewed by Andreas Kling.
2991
2992         * platform/cocoa/NetworkExtensionContentFilter.mm:
2993         (WebCore::NetworkExtensionContentFilter::unblockHandler):
2994         Returned an unblock handler that calls -[NEFilterSource remediateWithDecisionHandler:].
2995         * platform/cocoa/ParentalControlsContentFilter.mm:
2996         (WebCore::ParentalControlsContentFilter::unblockHandler): Used ASCIILiteral.
2997
2998 2015-03-19  Andy Estes  <aestes@apple.com>
2999
3000         [Content Filtering] Add tests for unblock requests
3001         https://bugs.webkit.org/show_bug.cgi?id=142900
3002
3003         Reviewed by Andreas Kling.
3004
3005         Currently the iOS Parental Controls content filter has a mechanism for requesting that a page be unblocked.
3006         WebKit implements this by listening for navigations originating from the filter's error page to a special URL,
3007         and requesting the page be unblocked via platform API, which might cause UI to be displayed. If the unblock is
3008         successful then we schedule a reload of the frame in order to display the unblocked document.
3009
3010         NetworkExtension also supports unblock requests, so in preparation for adopting its API, this patch allows
3011         content filters to specify their own unblock request method, teaches MockContentFilter to provide such a method,
3012         and writes tests to cover both allowed and denied unblock requests.
3013
3014         The content filter that blocks a load creates a ContentFilterUnblockHandler, passing it a lambda that is executed
3015         when a navigation matches the filter's special unblock URL. Filters can also specify that a script be executed in
3016         the context of its error page if the unblock is denied.
3017
3018         All platform content filters can handle unblock requests like this with the exception of iOS Parental Controls in WebKit2.
3019         Since UI can be displayed by the system in this case, the request must be made from within the UI process. Therefore the
3020         existing method is retained of serializing a WebFilterEvaluator and intercepting navigation policy calls in the UI process.
3021
3022         Tests: contentfiltering/allow-after-unblock-request.html
3023                contentfiltering/block-after-unblock-request.html
3024
3025         * bindings/js/JSMockContentFilterSettingsCustom.cpp:
3026         (WebCore::JSMockContentFilterSettings::decisionPoint): Added some using statements for clarity.
3027         (WebCore::JSMockContentFilterSettings::setDecisionPoint): Ditto.
3028         (WebCore::toJSValue): Returns a JSValue from a Decision.
3029         (WebCore::toDecision): Returns a Decision from a JSValue.
3030         (WebCore::JSMockContentFilterSettings::decision): Used toJSValue.
3031         (WebCore::JSMockContentFilterSettings::setDecision): Used toDecision.
3032         (WebCore::JSMockContentFilterSettings::unblockRequestDecision): Used toJSValue.
3033         (WebCore::JSMockContentFilterSettings::setUnblockRequestDecision): Used toDecision.
3034         * loader/ContentFilter.cpp:
3035         (WebCore::ContentFilter::createIfNeeded): Passed a reference to the owning DocumentLoader.
3036         (WebCore::ContentFilter::ContentFilter): Ditto.
3037         (WebCore::ContentFilter::unblockHandler): If the unblockHandler requests that a script be executed when an
3038         unblock request is denied, create a wrapper unblockHandler that executes that script in m_documentLoader's frame.
3039         * loader/ContentFilter.h:
3040         * loader/DocumentLoader.cpp:
3041         (WebCore::DocumentLoader::responseReceived): Passed this to ContentFilter::createIfNeeded.
3042         * loader/FrameLoader.cpp:
3043         (WebCore::FrameLoader::prepareForLoadStart): Called PolicyChecker::prepareForLoadStart.
3044         * loader/PolicyChecker.cpp:
3045         (WebCore::PolicyChecker::prepareForLoadStart): Reset m_contentFilterUnblockHandler.
3046         (WebCore::PolicyChecker::checkNavigationPolicy): Moved logic to here from WebKit1's WebFrameLoaderClient.
3047         Placing it here allows it to be shared between WebKit1 and WebKit2 (when the unblock handler does not need to
3048         be called in the UI process).
3049         * loader/PolicyChecker.h:
3050         (WebCore::PolicyChecker::setContentFilterUnblockHandler): Added.
3051         * page/Frame.h: Made Frame ThreadSafeRefCounted, since RefPtr<Frames> are captured in lambdas that can be
3052         copied by background threads managed by the underlying platform.
3053         * platform/ContentFilterUnblockHandler.h:
3054         (WebCore::ContentFilterUnblockHandler::unblockURLScheme): Returned the Apple content filter scheme.
3055         (WebCore::ContentFilterUnblockHandler::unblockURLHost): Returned the unblock URL host.
3056         (WebCore::ContentFilterUnblockHandler::clear): Deleted.
3057         * platform/PlatformContentFilter.h:
3058         (WebCore::PlatformContentFilter::unblockRequestDeniedScript): Returned the unblock request denied script.
3059         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
3060         (WebCore::ContentFilterUnblockHandler::ContentFilterUnblockHandler): Added a constructor that takes an
3061         unblockURLHost and a UnblockRequesterFunction. Added an alternate constructor for iOS Parental Controls on
3062         WebKit2 that takes an unblockURLHost and a WebFilterEvaluator.
3063         (WebCore::ContentFilterUnblockHandler::needsUIProcess): Returned true if m_webFilterEvaluator is non-null.
3064         (WebCore::ContentFilterUnblockHandler::encode): Encoded m_unblockURLHost in addition to m_webFilterEvaluator.
3065         (WebCore::ContentFilterUnblockHandler::decode): Decoded m_unblockURLHost in addition to m_webFilterEvaluator.
3066         (WebCore::ContentFilterUnblockHandler::canHandleRequest): Returned true if there is a either a m_unblockRequester
3067         or a m_webFilterEvaluator and the request's host and scheme match those of the unblock request URL.
3068         (WebCore::dispatchToMainThread): Added a helper to dispatch a block to the main thread. Then if the web thread
3069         is enabled on iOS, dispatch it there.
3070         (WebCore::ContentFilterUnblockHandler::requestUnblockAsync): Renamed from handleUnblockRequestAndDispatchIfSuccessful.
3071         Requested an unblock using either m_unblockRequester or m_webFilterEvaluator, then called decisionHandler with the response.
3072         (WebCore::scheme): Moved to ContentFilterUnblockHandler::unblockURLScheme.
3073         (WebCore::ContentFilterUnblockHandler::handleUnblockRequestAndDispatchIfSuccessful): Renamed to requestUnblockAsync.
3074         * platform/cocoa/ParentalControlsContentFilter.mm:
3075         (WebCore::ParentalControlsContentFilter::unblockHandler): Returned an unblock handler using the WebFilterEvaluator constructor.
3076         * testing/MockContentFilter.cpp: Added using statments for clarity.
3077         (WebCore::settings): Added a helper to get MockContentFilterSettings::singleton().
3078         (WebCore::MockContentFilter::canHandleResponse): Used the helper.
3079         (WebCore::MockContentFilter::MockContentFilter): Took advantage of the using statements.
3080         (WebCore::MockContentFilter::addData): Ditto.
3081         (WebCore::MockContentFilter::finishedAddingData): Ditto.
3082         (WebCore::MockContentFilter::unblockHandler): Returned a ContentFilterUnblockHandler that checks settings() for its decision.
3083         (WebCore::MockContentFilter::unblockRequestDeniedScript): Returned the script to execute in MockContentFilter's
3084         error page when an unblock request is denied.
3085         (WebCore::MockContentFilter::maybeDetermineStatus): Took advantage of settings() and using statements.
3086         * testing/MockContentFilterSettings.cpp:
3087         (WebCore::MockContentFilterSettings::unblockRequestURL): Constructed a static unblock URL and returned it.
3088         * testing/MockContentFilterSettings.h:
3089         (WebCore::MockContentFilterSettings::unblockURLHost): Returned the filter's unblock URL host.
3090         (WebCore::MockContentFilterSettings::unblockRequestDecision): Returns the decision to make for an unblock request.
3091         (WebCore::MockContentFilterSettings::setUnblockRequestDecision): Sets the decision to make for an unblock request.
3092         * testing/MockContentFilterSettings.idl: Added the unblockRequestDecision and unblockRequestURL attributes.
3093
3094 2015-03-20  Carlos Garcia Campos  <cgarcia@igalia.com>
3095
3096         [GTK] Crash due to empty drag image during drag-and-drop
3097         https://bugs.webkit.org/show_bug.cgi?id=142671
3098
3099         Reviewed by Philippe Normand.
3100
3101         Return early from ImageBuffer constructor if an empty size is
3102         given. This is a speculative fix for a crash while starting a drag
3103         and drop operation, that I haven't been able to reproduce.
3104
3105         * platform/graphics/cairo/ImageBufferCairo.cpp:
3106         (WebCore::ImageBuffer::ImageBuffer):
3107
3108 2015-03-19  Chris Dumez  <cdumez@apple.com>
3109
3110         [WK2] We should allow stale content when restoring a killed / crashed WebProcess
3111         https://bugs.webkit.org/show_bug.cgi?id=142893
3112         <rdar://problem/19633737>
3113         <rdar://problem/19869257>
3114
3115         Reviewed by Antti Koivisto.
3116
3117         Always use ReturnCacheDataElseLoad cache policy for history navigations.
3118         Previously, we would use the default protocol cache policy for history
3119         navigations if m_stateMachine.committedFirstRealDocumentLoad() returned
3120         false so that we do not display stale content when restoring the session
3121         state of Safari statup (rdar://problem/8131355). This is now handled
3122         before reaching this method by no longer using "IndexedBackForward"
3123         FrameLoadType when restoring session tabs, and using "Standard" load
3124         type instead.
3125
3126         * loader/FrameLoader.cpp:
3127         (WebCore::FrameLoader::loadDifferentDocumentItem):
3128
3129 2015-03-19  Andy Estes  <aestes@apple.com>
3130
3131         [Content Filtering] Move ContentFilter to from platform/ to loader/
3132         https://bugs.webkit.org/show_bug.cgi?id=142897
3133
3134         Reviewed by Dan Bernstein.
3135
3136         ContentFilterCollection never contained any platform code, so it doesn't make sense for it to be in platform.
3137         Move it to loader/, since ContentFilters are owned by DocumentLoaders, and just call it ContentFilter. Extract
3138         the abstract part of ContentFilter into a new base class called PlatformContentFilter that each of the
3139         individual filters inherit from.
3140
3141         * WebCore.xcodeproj/project.pbxproj:
3142         * loader/ContentFilter.cpp: Renamed from Source/WebCore/platform/ContentFilter.cpp.
3143         (WebCore::ContentFilter::types): Moved from ContentFilterCollection.
3144         (WebCore::ContentFilter::createIfNeeded): Ditto.
3145         (WebCore::ContentFilter::ContentFilter): Ditto.
3146         (WebCore::ContentFilter::addData): Ditto.
3147         (WebCore::ContentFilter::finishedAddingData): Ditto.
3148         (WebCore::ContentFilter::needsMoreData): Ditto.
3149         (WebCore::ContentFilter::didBlockData): Ditto.
3150         (WebCore::ContentFilter::getReplacementData): Ditto.
3151         (WebCore::ContentFilter::unblockHandler): Ditto.
3152         * loader/ContentFilter.h: Copied from Source/WebCore/platform/ContentFilter.h.
3153         (WebCore::ContentFilter::type): Replaced a use of ContentFilterCollection.
3154         * platform/PlatformContentFilter.h: Renamed from Source/WebCore/platform/ContentFilter.h.
3155         * platform/cocoa/NetworkExtensionContentFilter.h: Inherited from PlatformContentFilter.
3156         * platform/cocoa/ParentalControlsContentFilter.h: Ditto.
3157         * testing/MockContentFilter.h: Ditto.
3158
3159 2015-03-19  Dean Jackson  <dino@apple.com>
3160
3161         CSS Animations with triggers should map scroll position to duration
3162         https://bugs.webkit.org/show_bug.cgi?id=142870
3163         <rdar://problem/20227244>
3164
3165         Reviewed by Simon Fraser.
3166
3167         Expose a prototype implementation of what will eventually be called
3168         animation-timebase, mapping the scroll location to the duration of an
3169         animation. This only applies if the animation has a start and end
3170         trigger.
3171
3172         Test: animations/trigger-container-scroll-boundaries.html
3173
3174         * css/CSSComputedStyleDeclaration.cpp:
3175         (WebCore::createAnimationTriggerValue): Change to downcast.
3176
3177         * css/CSSToStyleMap.cpp:
3178         (WebCore::CSSToStyleMap::mapAnimationTrigger): Fix a bug where I wasn't
3179         telling the ScrollAnimationTrigger object whether or not it had
3180         an end value. This wasn't visible before because we were not using
3181         the end value.
3182
3183         * page/animation/AnimationBase.cpp:
3184         (WebCore::AnimationBase::fireAnimationEventsIfNeeded): Add a comment and
3185         change to using a downcast.
3186         (WebCore::AnimationBase::timeToNextService): Change to downcast.
3187         (WebCore::AnimationBase::freezeAtTime): Whitespace cleanup.
3188         (WebCore::AnimationBase::getElapsedTime): Calculate the elapsedTime based
3189         on the scroll position relative to the start and end trigger spots.
3190
3191         * page/animation/AnimationController.cpp:
3192         (WebCore::AnimationControllerPrivate::updateAnimations): Since this
3193         can potentially call into beginAnimationUpdateTime, it should have
3194         an update blocker. This fixes the assert we were seeing in tests.
3195         (WebCore::AnimationControllerPrivate::scrollWasUpdated): Keep track of the scroll
3196         position so we don't need to ask for it all the time.
3197         * page/animation/AnimationControllerPrivate.h:
3198         (WebCore::AnimationControllerPrivate::scrollPosition): New accessor.
3199
3200         * platform/animation/AnimationTrigger.h: Add downcast macros.
3201         (WebCore::ScrollAnimationTrigger::create): Calculate hasEndValue from the passed
3202         parameters rather than a separate value.
3203         (WebCore::ScrollAnimationTrigger::hasEndValue):
3204         (WebCore::ScrollAnimationTrigger::ScrollAnimationTrigger):
3205         (WebCore::ScrollAnimationTrigger::setHasEndValue): Deleted.
3206
3207         * platform/graphics/ca/GraphicsLayerCA.cpp:
3208         (WebCore::GraphicsLayerCA::animationCanBeAccelerated): If we have an
3209         animation of this sort, we can't use a CAAnimation.
3210
3211 2015-03-19  Eric Carlson  <eric.carlson@apple.com>
3212
3213         [Mac] Move MediaPlaybackTargetPicker
3214         https://bugs.webkit.org/show_bug.cgi?id=142889
3215
3216         Move WebMediaPlaybackTargetPickerProxy from WK2 and rename as MediaPlaybackTargetPicker so it
3217         can be used by both WK2 and WK1.
3218
3219         Reviewed by Tim Horton.
3220
3221         * WebCore.xcodeproj/project.pbxproj:
3222         * platform/graphics/MediaPlaybackTargetPicker.cpp: Copied from Source/WebKit2/UIProcess/WebMediaPlaybackTargetPickerProxy.cpp.
3223         * platform/graphics/MediaPlaybackTargetPicker.h: Copied from Source/WebKit2/UIProcess/WebMediaPlaybackTargetPickerProxy.h.
3224         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h: Copied from Source/WebKit2/UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.h.
3225         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm: Copied from Source/WebKit2/UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.mm.
3226
3227 2015-03-19  Enrica Casucci  <enrica@apple.com>
3228
3229         REGRESSION (r109593): Clicking after last inline element could cause a crash.
3230         https://bugs.webkit.org/show_bug.cgi?id=142880
3231         rdar://problem/17222294
3232
3233         Reviewed by Ryosuke Niwa.
3234
3235         Test: editing/selection/click-after-last-inline-crash.html
3236
3237         * rendering/RootInlineBox.cpp:
3238         (WebCore::RootInlineBox::closestLeafChildForLogicalLeftPosition):
3239
3240 2015-03-19  Enrica Casucci  <enrica@apple.com>
3241
3242         One more build fix after r181760.
3243
3244         * page/EventHandler.cpp:
3245         (WebCore::EventHandler::handleDrag):
3246
3247 2015-03-19  Jessie Berlin  <jberlin@webkit.org>
3248
3249         Build fix after r181760.
3250
3251         * rendering/RenderAttachment.h:
3252
3253 2015-03-19  Jer Noble  <jer.noble@apple.com>
3254
3255         [WK2][Mac] Fullscreen animations with mismatched aspect ratios are "squished".
3256         https://bugs.webkit.org/show_bug.cgi?id=142132
3257
3258         Reviewed by Tim Horton.
3259
3260         Add a new utility method to calculate a rect with a specific aspect ratio wrapping a smaller one.
3261
3262         * platform/graphics/GeometryUtilities.cpp:
3263         (WebCore::smallestRectWithAspectRatioAroundRect):
3264         * platform/graphics/GeometryUtilities.h:
3265
3266 2015-03-19  Chris Dumez  <cdumez@apple.com>
3267
3268         Get rid of "CachePolicyCache" cache policy
3269         https://bugs.webkit.org/show_bug.cgi?id=142881
3270
3271         Reviewed by Antti Koivisto.
3272
3273         Get rid of "CachePolicyCache" cache policy as it is unused.
3274
3275         * loader/cache/CachePolicy.h:
3276         * loader/cache/CachedResource.cpp:
3277         (WebCore::CachedResource::mustRevalidateDueToCacheHeaders):
3278         * page/DiagnosticLoggingKeys.cpp:
3279         (WebCore::DiagnosticLoggingKeys::mustRevalidateIsExpiredKey): Deleted.
3280         * page/DiagnosticLoggingKeys.h:
3281
3282 2015-03-19  Alex Christensen  <achristensen@webkit.org>
3283
3284         [Content Extensions] Test regular expression parse failures.
3285         https://bugs.webkit.org/show_bug.cgi?id=142872
3286
3287         Reviewed by Benjamin Poulain.
3288
3289         * contentextensions/URLFilterParser.cpp:
3290         (WebCore::ContentExtensions::GraphBuilder::finalize):
3291         (WebCore::ContentExtensions::GraphBuilder::quantifyAtom):
3292         (WebCore::ContentExtensions::URLFilterParser::addPattern):
3293         (WebCore::ContentExtensions::URLFilterParser::statusString):
3294         * contentextensions/URLFilterParser.h:
3295         Changed failures that can never happen to assertions.
3296
3297 2015-03-19  Enrica Casucci  <enrica@apple.com>
3298
3299         Release build fix after https://trac.webkit.org/r181760.
3300
3301         Unreviewed.
3302
3303         * page/EventHandler.cpp:
3304         (WebCore::EventHandler::handleDrag):
3305
3306 2015-03-19  Enrica Casucci  <enrica@apple.com>
3307
3308         <attachment> should put URLs on the pasteboard so that Finder can accept drops.
3309         https://bugs.webkit.org/show_bug.cgi?id=142801
3310         rdar://problem/19982527
3311
3312         Reviewed by Tim Horton.
3313
3314         Test: editing/pasteboard/drag-and-drop-attachment-contenteditable.html
3315
3316         This patch adds all the necessary support to write attachment elements into
3317         the pasteboard, including the promised type.
3318
3319         * WebCore.xcodeproj/project.pbxproj:
3320         * page/DragActions.h:
3321         * page/DragClient.h:
3322         (WebCore::DragClient::declareAndWriteAttachment):
3323         * page/DragController.cpp:
3324         (WebCore::DragController::draggableElement):
3325         (WebCore::DragController::startDrag):
3326         * page/DragController.h:
3327         (WebCore::DragController::draggingAttachmentURL):
3328         * page/EventHandler.cpp:
3329         (WebCore::EventHandler::dragHysteresisExceeded):
3330         (WebCore::EventHandler::handleDrag):
3331         * page/mac/DragControllerMac.mm:
3332         (WebCore::DragController::declareAndWriteAttachment):
3333         * page/win/DragControllerWin.cpp:
3334         (WebCore::DragController::declareAndWriteAttachment):
3335         * platform/URL.cpp:
3336         (WebCore::URL::fileURLWithFileSystemPath):
3337         * platform/URL.h:
3338         * rendering/HitTestResult.cpp:
3339         (WebCore::HitTestResult::absoluteAttachmentURL):
3340         * rendering/HitTestResult.h:
3341
3342 2015-03-19  Chris Dumez  <cdumez@apple.com>
3343
3344         Unreviewed, fix linking error after r181753.
3345
3346         Drop WEBCORE_EXPORT for Settings::minimumDOMTimerInterval() as it is
3347         now inlined.
3348
3349         * page/Settings.h:
3350         (WebCore::Settings::minimumDOMTimerInterval):
3351
3352 2015-03-19  Brady Eidson  <beidson@apple.com>
3353
3354         Part of content extensions should apply css selectors
3355         https://bugs.webkit.org/show_bug.cgi?id=142604
3356
3357         Reviewed by Alex Christensen.
3358
3359         Add a new action for applying the cached global stylesheet.
3360
3361         * contentextensions/CompiledContentExtension.cpp:
3362         (WebCore::ContentExtensions::CompiledContentExtension::globalDisplayNoneSelectors):
3363
3364         * contentextensions/ContentExtensionActions.h:
3365
3366         * contentextensions/ContentExtensionCompiler.cpp:
3367         (WebCore::ContentExtensions::serializeActions):
3368
3369         * contentextensions/ContentExtensionParser.cpp:
3370         (WebCore::ContentExtensions::loadAction):
3371
3372         * contentextensions/ContentExtensionRule.cpp:
3373         (WebCore::ContentExtensions::Action::deserialize):
3374         * contentextensions/ContentExtensionRule.h:
3375         (WebCore::ContentExtensions::Action::Action):
3376         (WebCore::ContentExtensions::Action::operator==):
3377         (WebCore::ContentExtensions::Action::stringArgument):
3378         (WebCore::ContentExtensions::Action::cssSelector): Deleted.
3379
3380         * contentextensions/ContentExtensionsBackend.cpp:
3381         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
3382
3383         * loader/cache/CachedResourceLoader.cpp:
3384         (WebCore::CachedResourceLoader::requestResource):
3385
3386 2015-03-19  Chris Dumez  <cdumez@apple.com>
3387
3388         Clean up DOMTimer related settings
3389         https://bugs.webkit.org/show_bug.cgi?id=142837
3390
3391         Reviewed by Darin Adler.
3392
3393         Clean up DOMTimer related settings:
3394         - Make default minimum timer interval 4ms instead of 10ms as all ports
3395           were setting it to 4ms and the specifications says 4ms.
3396         - Get rid of setters for default DOMTimer interval values as they are
3397           not set anymore.
3398         - Move default DOMTimer interval values from Settings to DOMTimer as
3399           those are global (not per-page) and not really settings.
3400         - Stop using abbreviations in the names (e.g. min -> minimum).
3401         - Move DOMTimer settings members from Page to Settings. There is no
3402           reason for those to be stored on the Page. The getters were private
3403           so call-sites had to go via Settings anyway. Also, call-sites already
3404           had to do a null check on the page to get the settings. It seems
3405           unfortunate for the settings to do another null-check on the page for
3406           retrieving the setting value from the page.
3407         - Inline the DOMTimer settings getters as these are trivial.
3408
3409         * dom/Document.cpp:
3410         (WebCore::Document::minimumTimerInterval):
3411         (WebCore::Document::timerAlignmentInterval):
3412         * dom/ScriptExecutionContext.cpp:
3413         (WebCore::ScriptExecutionContext::minimumTimerInterval):
3414         (WebCore::ScriptExecutionContext::timerAlignmentInterval):
3415         * page/DOMTimer.h:
3416         * page/Page.cpp:
3417         (WebCore::Page::Page):
3418         (WebCore::Page::setTimerThrottlingEnabled):
3419         (WebCore::Page::setMinimumTimerInterval): Deleted.
3420         (WebCore::Page::minimumTimerInterval): Deleted.
3421         * page/Page.h:
3422         (WebCore::Page::timerAlignmentInterval): Deleted.
3423         * page/Settings.cpp:
3424         (WebCore::Settings::Settings):
3425         (WebCore::Settings::setMinimumDOMTimerInterval):
3426         (WebCore::Settings::setDOMTimerAlignmentInterval):
3427         (WebCore::Settings::setHiddenPageDOMTimerAlignmentInterval): Deleted.
3428         (WebCore::Settings::hiddenPageDOMTimerAlignmentInterval): Deleted.
3429         (WebCore::Settings::setDefaultMinDOMTimerInterval): Deleted.
3430         (WebCore::Settings::defaultMinDOMTimerInterval): Deleted.
3431         (WebCore::Settings::setMinDOMTimerInterval): Deleted.
3432         (WebCore::Settings::minDOMTimerInterval): Deleted.
3433         (WebCore::Settings::setDefaultDOMTimerAlignmentInterval): Deleted.
3434         (WebCore::Settings::defaultDOMTimerAlignmentInterval): Deleted.
3435         (WebCore::Settings::domTimerAlignmentInterval): Deleted.
3436         * page/Settings.h:
3437         (WebCore::Settings::minimumDOMTimerInterval):
3438         (WebCore::Settings::domTimerAlignmentInterval):
3439         * testing/InternalSettings.cpp:
3440         (WebCore::InternalSettings::Backup::Backup):
3441         (WebCore::InternalSettings::Backup::restoreTo):
3442         (WebCore::InternalSettings::setMinimumTimerInterval):
3443
3444 2015-03-19  Carlos Garcia Campos  <cgarcia@igalia.com>
3445
3446         [GTK] Scrollbars look bad with GTK+ 3.16
3447         https://bugs.webkit.org/show_bug.cgi?id=140800
3448
3449         Reviewed by Sergio Villar Senin.
3450
3451         Take margin into account when rendering scrollbars. This fixes the
3452         huge scrollbars rendered with GTK+ 3.16. We don't need to check
3453         the GTK+ version because in previous versions the marging were 0,
3454         so the same code just works.
3455
3456         * platform/gtk/ScrollbarThemeGtk.cpp:
3457         (WebCore::adjustRectAccordingToMargin):
3458         (WebCore::ScrollbarThemeGtk::paintTrackBackground):
3459         (WebCore::ScrollbarThemeGtk::paintThumb):
3460
3461 2015-03-19  Xabier Rodriguez Calvar <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
3462
3463         [Streams API] Update ReadableStream API according new version of the specification
3464         https://bugs.webkit.org/show_bug.cgi?id=142822
3465
3466         Reviewed by Benjamin Poulain.
3467
3468         This patch updates the IDL of ReadableStream according the new version of the spec, which splits functionality between ReadableStream and ReadableStreamReader.
3469         In particular, this patch removes read(), ready, closed and state from ReadableStream and it adds the getReader method.
3470
3471         Covered by updated readablestream-constructor.html test.
3472
3473         * Modules/streams/ReadableStream.cpp:
3474         (WebCore::ReadableStream::ReadableStream):
3475         (WebCore::ReadableStream::state): Deleted.
3476         (WebCore::ReadableStream::closed): Deleted.
3477         (WebCore::ReadableStream::ready): Deleted.
3478         * Modules/streams/ReadableStream.h:
3479         (WebCore::ReadableStream::internalState): Added to make mac build system happy, to be used by ReadableStreamReader.
3480         * Modules/streams/ReadableStream.idl:
3481         * bindings/js/JSReadableStreamCustom.cpp:
3482         (WebCore::JSReadableStream::cancel):
3483         (WebCore::JSReadableStream::getReader):
3484         (WebCore::JSReadableStream::read): Deleted.
3485         (WebCore::getOrCreatePromiseDeferredFromObject): Deleted.
3486         (WebCore::readyPromiseSlotName): Deleted.
3487         (WebCore::JSReadableStream::ready): Deleted.
3488         (WebCore::closedPromiseSlotName): Deleted.
3489         (WebCore::JSReadableStream::closed): Deleted.
3490
3491 2015-03-18  Manuel Rego Casasnovas  <rego@igalia.com>
3492
3493         Unreviewed. GTK build fix after r181720.
3494
3495         * rendering/RenderImage.cpp:
3496         (WebCore::RenderImage::styleDidChange):
3497
3498 2015-03-18  Antti Koivisto  <antti@apple.com>
3499
3500         Test disk cache behavior when using back navigation cache policy
3501         https://bugs.webkit.org/show_bug.cgi?id=142848
3502
3503         Reviewed by Chris Dumez.
3504
3505         Add a way to override the normal cache policy so we can test reload behavior of cache without actually reloading.
3506
3507         Test: http/tests/cache/disk-cache-validation-back-navigation-policy.html
3508
3509         * loader/FrameLoader.cpp:
3510         (WebCore::FrameLoader::addExtraFieldsToRequest):
3511         * loader/FrameLoader.h:
3512         (WebCore::FrameLoader::setOverrideCachePolicyForTesting):
3513         * testing/Internals.cpp:
3514         (WebCore::Internals::setOverrideCachePolicy):
3515         * testing/Internals.h:
3516         * testing/Internals.idl:
3517
3518 2015-03-18  Yusuke Suzuki  <utatane.tea@gmail.com>
3519
3520         TextFragment#start() is always >= 0 since its type is unsigned
3521         https://bugs.webkit.org/show_bug.cgi?id=142860
3522
3523         Reviewed by Andreas Kling.
3524
3525         Since TextFragment::m_start is unsigned, the result of
3526         TextFragment::start() is always >= 0 and assertion is not effective.
3527         This patch removes this assertion to suppress warnings.
3528
3529         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
3530         (WebCore::SimpleLineLayout::TextFragmentIterator::revertToFragment):
3531
3532 2015-03-18  Alex Christensen  <achristensen@webkit.org>
3533
3534         [ContentExtensions] Prepare for compiling stylesheets of selectors to be used on every page.
3535         https://bugs.webkit.org/show_bug.cgi?id=142799
3536
3537         Reviewed by Brady Eidson.
3538
3539         * WebCore.xcodeproj/project.pbxproj:
3540         Make private headers to use with API tests.
3541         * contentextensions/CompiledContentExtension.cpp:
3542         (WebCore::ContentExtensions::CompiledContentExtension::globalDisplayNoneSelectors):
3543         * contentextensions/CompiledContentExtension.h:
3544         Added method to get only the selectors from the root of the DFA, which apply to all URLs.
3545         * contentextensions/ContentExtensionCompiler.cpp:
3546         (WebCore::ContentExtensions::compileRuleList):
3547         Added checking if the trigger will match everything.
3548         These actions can be put directly on the root of the DFA without adding extra epsilon transitions to the NFA.
3549         * contentextensions/DFA.h:
3550         (WebCore::ContentExtensions::DFA::nodeAt):
3551         * contentextensions/DFABytecodeInterpreter.cpp:
3552         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsFromDFARoot):
3553         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
3554         * contentextensions/DFABytecodeInterpreter.h:
3555         * contentextensions/NFA.h:
3556         * contentextensions/URLFilterParser.cpp:
3557         (WebCore::ContentExtensions::Term::quantifier):
3558         Sink terms to a vector then add nodes to NFA when finalizing after checking for regexes that match everything.
3559         (WebCore::ContentExtensions::GraphBuilder::GraphBuilder):
3560         (WebCore::ContentExtensions::GraphBuilder::finalize):
3561         (WebCore::ContentExtensions::GraphBuilder::parseStatus):
3562         (WebCore::ContentExtensions::GraphBuilder::atomPatternCharacter):
3563         (WebCore::ContentExtensions::GraphBuilder::atomBuiltInCharacterClass):
3564         (WebCore::ContentExtensions::GraphBuilder::quantifyAtom):
3565         (WebCore::ContentExtensions::GraphBuilder::atomBackReference):
3566         (WebCore::ContentExtensions::GraphBuilder::assertionBOL):
3567         (WebCore::ContentExtensions::GraphBuilder::assertionWordBoundary):
3568         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassAtom):
3569         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassRange):
3570         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassBuiltIn):
3571         (WebCore::ContentExtensions::GraphBuilder::atomParentheticalAssertionBegin):
3572         (WebCore::ContentExtensions::GraphBuilder::disjunction):
3573         (WebCore::ContentExtensions::GraphBuilder::hasError):
3574         (WebCore::ContentExtensions::GraphBuilder::fail):
3575         (WebCore::ContentExtensions::GraphBuilder::sinkFloatingTermIfNecessary):
3576         (WebCore::ContentExtensions::URLFilterParser::addPattern):
3577         (WebCore::ContentExtensions::URLFilterParser::statusString):
3578         (WebCore::ContentExtensions::GraphBuilder::errorMessage): Deleted.
3579         * contentextensions/URLFilterParser.h:
3580         Use an enum instead of strings for the status to avoid checking strings when we have a regex that matches everything.
3581
3582 2015-03-18  Yusuke Suzuki  <utatane.tea@gmail.com>
3583
3584         Fix build failure due to FALLTHROUGH in unreachable code
3585         https://bugs.webkit.org/show_bug.cgi?id=142703
3586
3587         Reviewed by Benjamin Poulain.
3588
3589         FALLTHROUGH should not exist in unreachable code marked by
3590         ASSERT_NOT_REACHABLE.
3591
3592         When !ENABLE(CSS_SELECTOR_JIT) and Debug mode is enabled,
3593         both ASSERT_NOT_REACHED and FALLTHROUGH are instantiated
3594         and it cause build failure.
3595
3596         Here, since CompiledSingle/CompiledSingleWithRootFilter are
3597         not set when !ENABLE(CSS_SELECTOR_JIT). So dropping FALLTHROUGH
3598         and leave ASSERT_NOT_REACHED.
3599         And since ASSERT_NOT_ReACHED is stripped when Release build,
3600         I've inserted FALLTHROUGH() if ASSERT_DISABLED.
3601         This fix is the same to r162906.
3602
3603         * dom/SelectorQuery.cpp:
3604         (WebCore::SelectorDataList::execute):
3605
3606 2015-03-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
3607
3608         Switching between two SVG images with no intrinsic sizes causes them to get the default SVG size instead of the container size.
3609         https://bugs.webkit.org/show_bug.cgi?id=142805.
3610
3611         Reviewed by Darin Adler.
3612         
3613         The bug happens due to wrong logic in RenderImage::imageDimensionsChanged().
3614         This function decides to setNeedsLayout() if the intrinsic size of the image
3615         changes. If the size does not change, it only repaints the image rectangle.
3616         When switching the src of the an image between two SVG images and both of
3617         them have no intrinsic size, we do not updateInnerContentRect() and this
3618         means an SVGImageForContainer is not going to be created for this image.
3619         When the image is drawn, it is drawn directly from the SVGImage. And this
3620         means the drawing has to be scaled by container_size / SVG_default_intrinsic_size
3621         
3622         After figuring out that I need to updateInnerContentRect() to fix this bug,
3623         I found out Blink has already changed this code to do the same thing. But 
3624         they also did more clean-up in this function. Here is the link
3625         https://codereview.chromium.org/114323004. I think their change seems correct
3626         although they did not say what exactly they were trying to fix.
3627         
3628         The plan for repaintOrMarkForLayout(), which is the new name of this function,
3629         is the following:
3630             -- setNeedLayout() if the intrinsic size changes and it affects the size
3631                of the image.
3632             -- updateInnerContentRect() if the intrinsic size did not change but the
3633                image has exiting layout.
3634             -- repaint the image rectangle if layout is not needed.
3635             
3636         This change also removes the call to computeLogicalWidthInRegion(), which is
3637         almost running a layout for the image. This call figures out whether the image
3638         needs to setNeedsLayout(). This call is unnecessary; the image needs to run a
3639         layout if the intrinsic size has changed and it affects the size of the image.
3640                     
3641         Test: svg/as-image/svg-no-intrinsic-size-switching.html
3642
3643         * rendering/RenderImage.cpp:
3644         (WebCore::RenderImage::styleDidChange): Change the function call.
3645         (WebCore::RenderImage::imageChanged): Rename local variable and change the
3646         function call.
3647         
3648         (WebCore::RenderImage::updateIntrinsicSizeIfNeeded): Simplify this function.
3649         Call setIntrinsicSize() with the new size unless the image is in error state.
3650         
3651         (WebCore::RenderImage::repaintOrMarkForLayout): This a better name for this
3652         function since it is called even if the intrinsic size was not changed.
3653         (WebCore::RenderImage::imageDimensionsChanged): Deleted.
3654         
3655         * rendering/RenderImage.h: Rename imageDimensionsChanged() and change the 
3656         updateIntrinsicSizeIfNeeded() to return void.
3657         
3658         * rendering/svg/RenderSVGForeignObject.cpp:
3659         (WebCore::RenderSVGForeignObject::paint): Code cleanup. This function can
3660         only handle the paint phases PaintPhaseForeground and PaintPhaseSelection.
3661         Use this information to simplify the logic and order of painting there.
3662
3663 2015-03-18  Jeremy Jones  <jeremyj@apple.com>
3664
3665         Fix typo in playerViewControllerWillCancelOptimizedFullscree.
3666         https://bugs.webkit.org/show_bug.cgi?id=142745
3667
3668         Reviewed by Darin Adler.
3669
3670         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3671         (-[WebAVPlayerController playerViewControllerWillCancelOptimizedFullscreen:]):
3672         (-[WebAVPlayerController playerViewControllerWillCancelOptimizedFullscree:]): Deleted.
3673
3674 2015-03-18  Simon Fraser  <simon.fraser@apple.com>
3675
3676         Avoid repaints when changing transform on an element with multiple background images
3677         https://bugs.webkit.org/show_bug.cgi?id=142841
3678
3679         Reviewed by Zalan Bujtas.
3680         
3681         Replace the cheap test for changed images in RenderElement::updateFillImages()
3682         with an exhaustive test that walks the entire list of background images,
3683         since any ensuing repaint is way more expensive than a slightly more expensive check here.
3684         
3685         Test: fast/repaint/multiple-backgrounds-style-change.html
3686
3687         * rendering/RenderElement.cpp:
3688         (WebCore::RenderElement::updateFillImages):
3689         * rendering/style/FillLayer.cpp:
3690         (WebCore::layerImagesIdentical): See if both images are the same (either none
3691         or both mask images, and same image pointer).
3692         (WebCore::FillLayer::imagesIdentical): Walk the two FillLayer lists, checking the images
3693         on each one. Returns false if we reach the end of one list before the other, or the images
3694         are different.
3695         * rendering/style/FillLayer.h: New static function; static because
3696         it compares two FillLayer lists, and I think that makes more sense than
3697         a member function.
3698
3699 2015-03-18  Anders Carlsson  <andersca@apple.com>
3700
3701         Pass cookies by reference in CookieHash functions
3702         https://bugs.webkit.org/show_bug.cgi?id=142839
3703
3704         Reviewed by Sam Weinig.
3705
3706         * platform/Cookie.h:
3707         (WebCore::CookieHash::hash):
3708         (WebCore::CookieHash::equal):
3709
3710 2015-03-18  Tim Horton  <timothy_horton@apple.com>
3711
3712         Temporarily fix the !ENABLE(CSS_SELECTOR_JIT) and assertions-enabled build
3713
3714         * dom/SelectorQuery.cpp:
3715         (WebCore::SelectorDataList::execute):
3716
3717 2015-03-18  Myles C. Maxfield  <mmaxfield@apple.com>
3718
3719         Call CTFontSetRenderingParameters before rendering text
3720         https://bugs.webkit.org/show_bug.cgi?id=142816
3721
3722         Reviewed by Darin Adler.
3723
3724         No new tests.
3725
3726         * platform/graphics/cocoa/FontCascadeCocoa.mm:
3727         (WebCore::showGlyphsWithAdvances):
3728         * platform/spi/cocoa/CoreTextSPI.h:
3729
3730 2015-03-18  Chris Dumez  <cdumez@apple.com>
3731
3732         [WK2] Log the number of network cache requests that we have never seen before
3733         https://bugs.webkit.org/show_bug.cgi?id=142828
3734         <rdar://problem/19632130>
3735
3736         Reviewed by Antti Koivisto.
3737
3738         Add diagnostic logging key for network cache efficacy logging.
3739
3740         * page/DiagnosticLoggingKeys.cpp:
3741         (WebCore::DiagnosticLoggingKeys::neverSeenBeforeKey):
3742         (WebCore::DiagnosticLoggingKeys::requestKey):
3743         * page/DiagnosticLoggingKeys.h:
3744
3745 2015-03-18  Yusuke Suzuki  <utatane.tea@gmail.com>
3746
3747         Use filterRootId in SelectorQuery even if CSS JIT is not enabled
3748         https://bugs.webkit.org/show_bug.cgi?id=142703
3749
3750         Reviewed by Benjamin Poulain.
3751
3752         filterRootId pruning path is not inherently related to CSS JIT.
3753         This patch enables filterRootId even in the environment
3754         where CSS JIT is not enabled.
3755
3756         * dom/SelectorQuery.cpp:
3757         (WebCore::filterRootById):
3758         (WebCore::SelectorDataList::executeSingleSelectorData):
3759         (WebCore::SelectorDataList::execute):
3760         * dom/SelectorQuery.h:
3761
3762 2015-03-18  Zalan Bujtas  <zalan@apple.com>
3763
3764         Simple line layout: Use Vector<>::const_iterator instead of custom FlowContents::Iterator.
3765         https://bugs.webkit.org/show_bug.cgi?id=142809
3766
3767         Reviewed by Antti Koivisto.
3768
3769         FlowContents::Iterator simply iterates on a vector<>. No need to custom implement it.
3770
3771         No change in functionality.
3772
3773         * rendering/SimpleLineLayoutFlowContents.h:
3774         (WebCore::SimpleLineLayout::FlowContents::begin):
3775         (WebCore::SimpleLineLayout::FlowContents::end):
3776         (WebCore::SimpleLineLayout::FlowContents::Iterator::Iterator): Deleted.
3777         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator++): Deleted.
3778         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator--): Deleted.
3779         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator==): Deleted.
3780         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator!=): Deleted.
3781         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator*): Deleted.
3782         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator->): Deleted.
3783         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
3784         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
3785
3786 2015-03-18  Zalan Bujtas  <zalan@apple.com>
3787
3788         Simple line layout: Change FlowContents::segmentForPosition() to segmentForRun().
3789         https://bugs.webkit.org/show_bug.cgi?id=142785
3790
3791         Reviewed by Antti Koivisto.
3792
3793         This is in transition to support <br>. A particular position could point to multiple
3794         segments when <br> is directly followed by text.
3795
3796         No change in functionality.
3797
3798         * rendering/SimpleLineLayoutFlowContents.cpp:
3799         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForRunSlow):
3800         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForPositionSlow): Deleted.
3801         * rendering/SimpleLineLayoutFlowContents.h:
3802         (WebCore::SimpleLineLayout::FlowContents::segmentForRun):
3803         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForPosition): Deleted.
3804         (WebCore::SimpleLineLayout::FlowContents::segmentForPosition): Deleted.
3805         * rendering/SimpleLineLayoutResolver.cpp:
3806         (WebCore::SimpleLineLayout::RunResolver::Run::text):
3807
3808 2015-03-17  Simon Fraser  <simon.fraser@apple.com>
3809
3810         Skip trying to paint overlay scrollbars when there are none or they are clipped out
3811         https://bugs.webkit.org/show_bug.cgi?id=142811
3812         rdar://problem/20200725
3813
3814         Reviewed by Darin Adler.
3815
3816         In some content with lots of layers and overflow:scroll, we could spend 20% of
3817         the time under paintOverflowControlsForFragments() setting up an (empty) clip,
3818         and then trying to draw scrollbars that we don't have.
3819         
3820         Avoid calling paintOverflowControlsForFragments() if there are no scrollbars,
3821         and don't both setting up an empty clip just to paint nothing.
3822
3823         * rendering/RenderLayer.cpp:
3824         (WebCore::RenderLayer::paintLayerContents):
3825         (WebCore::RenderLayer::paintOverflowControlsForFragments):
3826
3827 2015-03-18  Per Arne Vollan  <peavo@outlook.com>
3828
3829         [WinCairo] Unreviewed build fix after r181665.
3830
3831         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
3832         (WebCore::MediaPlayerPrivateMediaFoundation::setSize):
3833
3834 2015-03-18  Joseph Pecoraro  <pecoraro@apple.com>
3835
3836         Remove unused "preprocessor" parameter to sub-CodeGenerators
3837         https://bugs.webkit.org/show_bug.cgi?id=142793
3838
3839         Reviewed by Darin Adler.
3840
3841         * bindings/scripts/CodeGenerator.pm:
3842         (ProcessDocument):
3843         (FileNamePrefix):
3844         * bindings/scripts/CodeGeneratorObjC.pm:
3845
3846 2015-03-18  Zalan Bujtas  <zalan@apple.com>
3847
3848         Simple line layout: Split fragments on renderer boundary on the fly.
3849         https://bugs.webkit.org/show_bug.cgi?id=142579
3850
3851         Reviewed by Antti Koivisto.
3852
3853         Fragment splitting at renderers' boundary at the end of the line is no longer needed.
3854         This patch ensures that TextFragmentIterator::nextTextFragment() does not concatenate
3855         fragments across renderer boundary.
3856
3857         Test: fast/text/simple-line-with-multiple-renderers.html
3858
3859         * rendering/SimpleLineLayout.cpp:
3860         (WebCore::SimpleLineLayout::revertRuns):
3861         (WebCore::SimpleLineLayout::LineState::isEmpty):
3862         (WebCore::SimpleLineLayout::LineState::appendFragmentAndCreateRunIfNeeded): Check if fragments need a new run and
3863         whether neighboring fragments need collapsing.
3864         (WebCore::SimpleLineLayout::LineState::revertUncommitted): Revert fragments over multiple renderers if they form
3865         a fragment continuation.
3866         (WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace):
3867         (WebCore::SimpleLineLayout::forceFragmentToLine): Ensure that if a fragment has continuation across multiple renderers,
3868         they all get added to the current line.
3869         (WebCore::SimpleLineLayout::createLineRuns):
3870         (WebCore::SimpleLineLayout::LineState::appendFragment): Deleted.
3871         (WebCore::SimpleLineLayout::FragmentForwardIterator::FragmentForwardIterator): Deleted.
3872         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator++): Deleted.
3873         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator!=): Deleted.
3874         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator*): Deleted.
3875         (WebCore::SimpleLineLayout::begin): Deleted.
3876         (WebCore::SimpleLineLayout::end): Deleted.
3877         (WebCore::SimpleLineLayout::preWrap): Deleted.
3878         (WebCore::SimpleLineLayout::removeTrailingWhitespace): Deleted.
3879         (WebCore::SimpleLineLayout::updateLineConstrains): Deleted.
3880         (WebCore::SimpleLineLayout::splitRunsAtRendererBoundary): Deleted.
3881         (WebCore::SimpleLineLayout::createTextRuns): Deleted.
3882         (WebCore::SimpleLineLayout::create): Deleted.
3883         (WebCore::SimpleLineLayout::Layout::create): Deleted.
3884         * rendering/SimpleLineLayoutFlowContents.h:
3885         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator+):
3886         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator*):
3887         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator->):
3888         * rendering/SimpleLineLayoutFunctions.cpp:
3889         (WebCore::SimpleLineLayout::paintFlow): Unrelated fix on non-collapsed tab position.
3890         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
3891         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragmentIterator):
3892         (WebCore::SimpleLineLayout::TextFragmentIterator::nextTextFragment):
3893         (WebCore::SimpleLineLayout::TextFragmentIterator::revertToFragment):
3894         (WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
3895         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
3896         * rendering/SimpleLineLayoutTextFragmentIterator.h:
3897         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::TextFragment):
3898         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::overlapsToNextRenderer):
3899         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isCollapsible):
3900         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::operator==):
3901         (WebCore::SimpleLineLayout::TextFragmentIterator::isLineBreak):
3902         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::split): Deleted.
3903
3904 2015-03-18  Manuel Rego Casasnovas  <rego@igalia.com>
3905
3906         Flex and grid items should be painted as inline-blocks
3907         https://bugs.webkit.org/show_bug.cgi?id=142266
3908
3909         Reviewed by Darin Adler.
3910
3911         Based on Blink r157004 by <cbiesinger@chromium.org>.
3912         https://src.chromium.org/viewvc/blink?revision=157004&view=revision
3913
3914         Both flexbox and grid specs define that the painting order of flex/grid
3915         items is the same as inline blocks. See
3916         http://dev.w3.org/csswg/css-flexbox/#painting and
3917         http://dev.w3.org/csswg/css-grid/#z-order.
3918
3919         Extracted inline blocks painting code from InlineElementBox and moved to
3920         a helper method that will be reused for flexboxes and grids.
3921
3922         Tests: css3/flexbox/flex-item-text-background-not-interleaved.html
3923                fast/css-grid-layout/grid-item-text-background-not-interleaved.html
3924
3925         * rendering/InlineElementBox.cpp:
3926         (WebCore::InlineElementBox::paint): Move code to
3927         RenderElement::paintAsInlineBlock().
3928         * rendering/RenderBlock.cpp:
3929         (WebCore::RenderBlock::paintChild): Add new argument to paint children
3930         as inline blocks.
3931         * rendering/RenderBlock.h: Define PaintType enmu and modify paintChild()
3932         signature to add the new argument.
3933         * rendering/RenderElement.cpp:
3934         (WebCore::paintPhase): Paint element in a phase.
3935         (WebCore::RenderElement::paintAsInlineBlock): Code extracted from
3936         InlineElementBox::paint().
3937         * rendering/RenderElement.h: Add new method signature.
3938         * rendering/RenderFlexibleBox.cpp:
3939         (WebCore::RenderFlexibleBox::paintChildren): Call
3940         RenderBlock::paintChild() with the new argument.
3941         * rendering/RenderGrid.cpp:
3942         (WebCore::RenderGrid::paintChildren): Ditto.
3943
3944 2015-03-18  Chris Dumez  <cdumez@apple.com>
3945
3946         [WK2] Log total number of network cache queries using diagnostic logging
3947         https://bugs.webkit.org/show_bug.cgi?id=142803
3948         <rdar://problem/19632130>
394