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