Unreviewed, rolling out r182247.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-04-01  Commit Queue  <commit-queue@webkit.org>
2
3         Unreviewed, rolling out r182247.
4         https://bugs.webkit.org/show_bug.cgi?id=143326
5
6         unfortunately broke some tests (Requested by dino on #webkit).
7
8         Reverted changeset:
9
10         "Async loading of image resources"
11         https://bugs.webkit.org/show_bug.cgi?id=134488
12         http://trac.webkit.org/changeset/182247
13
14 2015-04-01  Alex Christensen  <achristensen@webkit.org>
15
16         [Content Extensions] Only add unique universal action locations.
17         https://bugs.webkit.org/show_bug.cgi?id=143325
18
19         Reviewed by Benjamin Poulain.
20
21         * contentextensions/ContentExtensionCompiler.cpp:
22         (WebCore::ContentExtensions::compileRuleList):
23         Use a HashSet instead of a Vector for the universal action locations to remove duplicates.
24
25 2015-04-01  Roger Fong  <roger_fong@apple.com>
26
27         Fixes to material of inline media controls on OSX.
28         https://bugs.webkit.org/show_bug.cgi?id=143317
29         <rdar://problem/20357847>
30
31         Reviewed by Dean Jackson.
32
33         There are many existing tests for the media controls appearance.
34         They are currently skipped while we are still updating the controls.
35
36         Expand backgrounds of control panel and volume box.
37         Clip the darker edges away.
38         * Modules/mediacontrols/mediaControlsApple.css:
39         (audio::-webkit-media-controls-panel):
40         (audio::-webkit-media-controls-panel-background-container):
41         (audio::-webkit-media-controls-panel-tint):
42         (audio::-webkit-media-controls-panel-background):
43         (audio::-webkit-media-controls-panel .volume-box):
44         (audio::-webkit-media-controls-volume-slider-container-background):
45         (audio::-webkit-media-controls-volume-slider-container-tint):
46         (audio::-webkit-media-controls-panel .volume-box:active):
47         (video::-webkit-media-controls-volume-slider): 
48         This needs to be above the background so it can be interacted with.
49         (video:-webkit-full-screen::-webkit-media-controls-panel .volume-box):
50         * Modules/mediacontrols/mediaControlsApple.js:
51         (Controller.prototype.createControls): Create a new div for the control material.
52         We need to clip the material and not the controls themselves.
53         (Controller.prototype.configureInlineControls): Use new div.
54         Remove some unnecessary logic involving hiding materials here.
55         It just causes the materials to turn on and off at the wrong times. 
56         (Controller.prototype.handlePanelTransitionEnd):
57         (Controller.prototype.setPlaying):
58         (Controller.prototype.showControls):
59         (Controller.prototype.hideControls):
60
61 2015-04-01  Eric Carlson  <eric.carlson@apple.com>
62
63         Media controls should not always auto-hide
64         https://bugs.webkit.org/show_bug.cgi?id=143322
65
66         Reviewed by Dean Jackson.
67
68         * Modules/mediacontrols/mediaControlsApple.js:
69         (Controller): Intialize new properties.
70         (Controller.prototype.hideControls): Do nothing if controlsAlwaysVisible() returns true;
71         (Controller.prototype.controlsAlwaysVisible): New.
72         (Controller.prototype.controlsAreHidden): Consult controlsAlwaysVisible().
73         (Controller.prototype.currentPlaybackTargetIsWireless): Use new properties.
74         (Controller.prototype.updateWirelessTargetAvailable): Cache video.webkitCurrentPlaybackTargetIsWireless
75             and video.webkitWirelessVideoPlaybackDisabled because we know when they change and
76             use them frequently.
77         * Modules/mediacontrols/mediaControlsiOS.js:
78         (ControllerIOS.prototype.controlsAlwaysVisible): New.
79         * platform/graphics/MediaPlaybackTarget.h:
80
81 2015-04-01  Alexey Proskuryakov  <ap@apple.com>
82
83         REGRESSION (r182121): SVG animation macros cause warnings in MSVC
84         https://bugs.webkit.org/show_bug.cgi?id=143313
85
86         Reviewed by Darin Adler.
87
88         * svg/SVGExternalResourcesRequired.h: Undo the change that caused a type mismatch.
89
90 2015-04-01  Eric Carlson  <eric.carlson@apple.com>
91
92         Another attempt to fixi the iOS build after r182240.
93
94         Reviewed by Dean Jackson.
95
96         * platform/graphics/MediaPlaybackTarget.h:
97         (WebCore::MediaPlaybackTarget::hasActiveRoute):
98
99 2015-04-01  Eric Carlson  <eric.carlson@apple.com>
100
101         Fix the iOS build after r182240.
102
103         * platform/graphics/MediaPlaybackTarget.h:
104
105 2015-04-01  Yoav Weiss  <yoav@yoav.ws>
106
107         Async loading of image resources
108         https://bugs.webkit.org/show_bug.cgi?id=134488
109
110         Reviewed by Dean Jackson.
111
112         This patch changes image loading to be asynchronous (per spec), in order
113         for it to be agnostic to property setting order when it comes to src, srcset and crossorigin,
114         as well as to enable future hooking of the <picture>-based selection logic on top of it.
115
116         Tests: fast/dom/HTMLImageElement/image-load-post-onload.html
117         fast/dom/HTMLImageElement/sizes/image-sizes-js-change-reverse.html
118
119         * WebCore.xcodeproj/project.pbxproj: Change MicroTask.h to be private.
120         * bindings/js/JSEventListener.cpp:
121         (WebCore::JSEventListener::handleEvent): Add a microtask checkpoint after event handling.
122         * bindings/js/ScheduledAction.cpp:
123         (WebCore::ScheduledAction::execute): Add a microtask checkpoint after running of a scheduled action.
124         * html/HTMLImageElement.cpp:
125         (WebCore::HTMLImageElement::didMoveToNewDocument): Add the old document to call of elementDidMoveToNewDocument.
126         * html/HTMLImageLoader.cpp:
127         (WebCore::HTMLImageLoader::notifyFinished): Avoid a crash when notifyFinished is called and there's no CachedImage.
128         * html/HTMLInputElement.cpp:
129         (WebCore::HTMLInputElement::didMoveToNewDocument): Add the old document to call of elementDidMoveToNewDocument.
130         * html/HTMLPlugInImageElement.cpp:
131         (WebCore::HTMLPlugInImageElement::didMoveToNewDocument): Add the old document to call of elementDidMoveToNewDocument.
132         * html/HTMLVideoElement.cpp:
133         (WebCore::HTMLVideoElement::didMoveToNewDocument): Add the old document to call of elementDidMoveToNewDocument.
134         * html/parser/HTMLDocumentParser.cpp:
135         (WebCore::HTMLDocumentParser::attemptToRunDeferredScriptsAndEnd): Add a microtask checkpoint.
136         * loader/ImageLoader.cpp: Move image resource loading to be asynchronous.
137         (WebCore::ImageLoader::ImageLoaderTask::create):
138         (WebCore::ImageLoader::ImageLoaderTask::run): Run the image loading microtask and called doUpdateFromElement.
139         (WebCore::ImageLoader::ImageLoaderTask::ImageLoaderTask):
140         (WebCore::ImageLoader::ImageLoader):
141         (WebCore::ImageLoader::doUpdateFromElement): This is split from the previous updateFromElement, and performs the actual resource loading.
142         (WebCore::ImageLoader::updateFromElement): Now only prepares the stage for the actual image resource loading.
143         (WebCore::ImageLoader::shouldLoadImmediately): If this returns true, the image resource is loaded immediately, without queueing a microtask.
144         (WebCore::ImageLoader::notifyFinished): Add asserts.
145         (WebCore::ImageLoader::elementDidMoveToNewDocument): Handle document load event counters decrementing and incrementing.
146         * loader/ImageLoader.h:
147         (WebCore::ImageLoader::imageComplete): Make sure that the image is complete only if there aren't any pending tasks.
148         (WebCore::ImageLoader::hasPendingActivity): Make sure that pending activity takes pending tasks into account.
149         (WebCore::ImageLoader::hasPendingTask): Getter to know if an ImageLoader has a pending task. (Used by the image loading microtask)
150         (WebCore::ImageLoader::createWeakPtr): Create a weakPtr to be used by the microtask, so it can called back the loader if it's still alive.
151         * loader/cache/CachedResourceLoader.cpp:
152         (WebCore::CachedResourceLoader::canRequest): Add a 'shouldBypassMainWorldContentSecurityPolicy' flag and act upon it.
153         (WebCore::CachedResourceLoader::requestImage): Add a 'shouldBypassMainWorldContentSecurityPolicy' flag.
154         (WebCore::CachedResourceLoader::requestResource): Add a 'shouldBypassMainWorldContentSecurityPolicy' flag.
155         * loader/cache/CachedResourceLoader.h:
156         (WebCore::CachedResourceLoader::canRequest): Add a 'shouldBypassMainWorldContentSecurityPolicy' flag and act upon it.
157         (WebCore::CachedResourceLoader::requestImage): Add a 'shouldBypassMainWorldContentSecurityPolicy' flag.
158         (WebCore::CachedResourceLoader::requestResource): Add a 'shouldBypassMainWorldContentSecurityPolicy' flag.
159         * svg/SVGImageElement.cpp:
160         (WebCore::SVGImageElement::didMoveToNewDocument): Add the old document to call of elementDidMoveToNewDocument.
161         * xml/parser/XMLDocumentParser.cpp:
162         (WebCore::XMLDocumentParser::end): Add a microtask checkpoint after XML finishes parsing.
163
164 2015-04-01  Alex Christensen  <achristensen@webkit.org>
165
166         Unreviewed build fix when using content extensions performance reporting.
167
168         * contentextensions/ContentExtensionCompiler.cpp:
169         (WebCore::ContentExtensions::compileRuleList):
170         Time how long it takes to build the DFAs.
171
172 2015-04-01  Alex Christensen  <achristensen@webkit.org>
173
174         Progress towards CMake on Windows and Mac.
175         https://bugs.webkit.org/show_bug.cgi?id=143293
176
177         Reviewed by Filip Pizlo.
178
179         * PlatformMac.cmake:
180         Tell open source builders where to find unicode headers.
181         * PlatformWin.cmake:
182         Include PlatformWinCairo.cmake.
183         * PlatformWinCairo.cmake:
184         Added from bug 115944 by Patrick Gansterer.
185         * bindings/js/JSDOMStringListCustom.cpp:
186         * bindings/js/JSDOMWrapper.cpp:
187         * bindings/js/JSMessageChannelCustom.cpp:
188         * bindings/js/JSPopStateEventCustom.cpp:
189         * bindings/js/JSReadableStreamCustom.cpp:
190         * bindings/js/ReadableStreamJSSource.cpp:
191         * bindings/js/ScriptController.cpp:
192         * css/CSSComputedStyleDeclaration.cpp:
193         * dom/Attr.cpp:
194         * dom/CollectionIndexCache.cpp:
195         * platform/graphics/ANGLEWebKitBridge.h:
196         Fixed include quirks.
197
198 2015-03-31  Simon Fraser  <simon.fraser@apple.com>
199
200         Remove scrolling tree dependency on wheel event handler counts, and use fast scrolling even when there are wheel handlers
201         https://bugs.webkit.org/show_bug.cgi?id=143288
202         rdar://problem/16049624
203
204         Reviewed by Beth Dakin.
205
206         Remove the wheel event counting that Document does, and passes into the scrolling tree.
207         The ScrollingTree now just uses the non-fast scrollable region to determine when to
208         fast scroll on pages with wheel event handlers.
209         
210         If a handler includes position:fixed renderers, we just cover the whole document
211         with the slow-scrolling region currently. This could be improved.
212         
213         * dom/Document.cpp:
214         (WebCore::Document::Document):
215         (WebCore::Document::didBecomeCurrentDocumentInFrame):
216         (WebCore::Document::wheelEventHandlersChanged):
217         (WebCore::Document::didAddWheelEventHandler):
218         (WebCore::Document::didRemoveWheelEventHandler):
219         (WebCore::Document::wheelEventHandlerCount):
220         (WebCore::Document::touchEventHandlerCount):
221         (WebCore::Document::absoluteRegionForEventTargets): Changed to return a pair<Region, bool>
222         where the bool indicates whether any handler includes position:fixed content.
223         (WebCore::pageWheelEventHandlerCountChanged): Deleted.
224         (WebCore::wheelEventHandlerCountChanged): Deleted.
225         * dom/Document.h:
226         (WebCore::Document::wheelEventHandlerCount): Deleted.
227         * loader/EmptyClients.h:
228         * page/ChromeClient.h:
229         * page/DebugPageOverlays.cpp:
230         (WebCore::MouseWheelRegionOverlay::updateRegion):
231         * page/scrolling/AsyncScrollingCoordinator.cpp:
232         (WebCore::AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged):
233         (WebCore::AsyncScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView): Deleted.
234         * page/scrolling/AsyncScrollingCoordinator.h:
235         * page/scrolling/ScrollingCoordinator.cpp:
236         (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion):
237         (WebCore::ScrollingCoordinator::frameViewRootLayerDidChange):
238         (WebCore::ScrollingCoordinator::computeCurrentWheelEventHandlerCount): Deleted.
239         (WebCore::ScrollingCoordinator::frameViewWheelEventHandlerCountChanged): Deleted.
240         * page/scrolling/ScrollingCoordinator.h:
241         (WebCore::ScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView): Deleted.
242         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
243         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
244         (WebCore::ScrollingStateFrameScrollingNode::setWheelEventHandlerCount): Deleted.
245         * page/scrolling/ScrollingStateFrameScrollingNode.h:
246         * page/scrolling/ScrollingTree.cpp:
247         (WebCore::ScrollingTree::ScrollingTree):
248         (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
249         (WebCore::ScrollingTree::commitNewTreeState):
250         * page/scrolling/ScrollingTree.h:
251         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
252         (WebCore::ScrollingCoordinatorMac::updateTiledScrollingIndicator):
253         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
254         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
255         (WebCore::logWheelEventHandlerCountChanged): Deleted.
256         * testing/Internals.cpp:
257         (WebCore::Internals::touchEventHandlerCount):
258
259 2015-04-01  David Hyatt  <hyatt@apple.com>
260
261         [New Block-Inside-Inline Model] Floats need to be allowed to intrude into anonymous inline-blocks.
262         https://bugs.webkit.org/show_bug.cgi?id=143307
263
264         Reviewed by Dean Jackson.
265
266         Added fast/block/inside-inlines/basic-float-intrusion.html
267
268         * rendering/InlineFlowBox.cpp:
269         (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
270         Make sure to exclude the margins of an anonymous inline-block when considering the height of the line.
271
272         * rendering/RenderBlock.cpp:
273         (WebCore::RenderBlock::lineHeight):
274         (WebCore::RenderBlock::baselinePosition):
275         Anonymous inline-block lines ignore line-height and just return the height of the block. For baseline position, the baseline
276         is considered to be at the bottom border edge of the anonymous inline-block.
277
278         * rendering/RenderBlockFlow.cpp:
279         (WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats):
280         (WebCore::RenderBlockFlow::addIntrudingFloats):
281         * rendering/RenderBlockFlow.h:
282         Patch float intrusion to handle the case of anonymous inline-blocks. Instead of collecting the floats from our parent(), we
283         collect them from the containingBlock() in the anonymous inline-block case. Patch addIntrudingFloats to pass in the container
284         that acts as the "parent", since it is not the parent() in the anonymous inline-block case.
285
286         * rendering/RenderBlockLineLayout.cpp:
287         (WebCore::updateLogicalInlinePositions):
288         Make sure to use the full available width for content always in the anonymous inline-block case, since we don't avoid the
289         floats, but instead let them intrude into the inline-block.
290
291         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForLine):
292         Patch callers of updateLogicalInlinePositions to pass in the root line box that we're checking for.
293
294         (WebCore::RenderBlockFlow::layoutLineBoxes):
295         Defer the layout of anonymous inline-blocks, since they need to only lay out once the vertical position to lay them out
296         at is known.
297
298         * rendering/RenderBox.cpp:
299         (WebCore::RenderBox::createsNewFormattingContext):
300         (WebCore::RenderBox::avoidsFloats):
301         Anonymous inline-blocks do not establish a new block formatting context, nor do they avoid floats.
302
303         * rendering/line/BreakingContext.h:
304         (WebCore::BreakingContext::handleReplaced):
305         Add code to do a just-in-time layout of the anonymous inline-block at the time it is being examined (after the break before
306         it was handled).
307
308 2015-04-01  Eric Carlson  <eric.carlson@apple.com>
309
310         [Mac] Do not include route button if element does not support target playback
311         https://bugs.webkit.org/show_bug.cgi?id=143251
312
313         Reviewed by Jer Noble.
314
315         * Modules/mediacontrols/mediaControlsApple.js:
316         (Controller.prototype.currentPlaybackTargetIsWireless): Return false if target playback is disabled.
317         (Controller.prototype.updateWirelessTargetAvailable): Do not show the picker if target 
318             playback is disabled.
319         (Controller.prototype.handleWirelessPlaybackChange): Call updateWirelessTargetAvailable.
320
321         * dom/Document.cpp:
322         (WebCore::Document::showPlaybackTargetPicker): Update for Page::showPlaybackTargetPicker change.
323         (WebCore::Document::didChoosePlaybackTarget): Notify clients in vector-order, lower level code
324             now tracks which one requested the picker.
325
326         * html/HTMLMediaElement.cpp:
327         (WebCore::HTMLMediaElement::loadResource): Don't call applyMediaPlayerRestrictions, it is done
328             in mediaPlayerEngineFailedToLoad.
329         (WebCore::HTMLMediaElement::setReadyState): Enqueue a target availability event if there are
330             listeners readyState reaches HAVE_METADATA so controls are setup correctly.
331         (WebCore::HTMLMediaElement::mediaPlayerEngineFailedToLoad): Call applyMediaPlayerRestrictions.
332         (WebCore::HTMLMediaElement::clearMediaPlayer): Enqueue a target availability event in so controls
333             have a chance to hide the picker.
334         (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsSupported): New, passthrough to the
335             media engine.
336         (WebCore::HTMLMediaElement::canPlayToWirelessPlaybackTarget): Ditto.
337         (WebCore::HTMLMediaElement::startPlayingToPlaybackTarget): Ditto.
338         (WebCore::HTMLMediaElement::stopPlayingToPlaybackTarget): Ditto.
339         * html/HTMLMediaElement.h:
340         * html/HTMLMediaElement.idl:
341
342         * html/HTMLMediaSession.cpp:
343         (WebCore::HTMLMediaSession::HTMLMediaSession): Initialize m_playbackTarget.
344         (WebCore::HTMLMediaSession::currentPlaybackTargetIsSupported): New.
345         (WebCore::HTMLMediaSession::showPlaybackTargetPicker): Pull logic from showingPlaybackTargetPickerPermitted 
346             inline. Don't refuse to show a picker if the element doesn't support target playback, it is up
347             to script to decide which elements can display a picker.
348         (WebCore::HTMLMediaSession::wirelessVideoPlaybackDisabled): Return true if there is no player.
349         (WebCore::HTMLMediaSession::didChoosePlaybackTarget): Call startPlayingToPlaybackTarget or 
350             stopPlayingToPlaybackTarget because setWirelessPlaybackTarget doesn't apply the target.
351         (WebCore::HTMLMediaSession::externalOutputDeviceAvailableDidChange): Add logging.
352         (WebCore::HTMLMediaSession::showingPlaybackTargetPickerPermitted): Deleted.
353         * html/HTMLMediaSession.h:
354
355         * page/Page.cpp:
356         (WebCore::Page::Page): Initialize m_playbackTarget.
357         (WebCore::Page::showPlaybackTargetPicker): Don't set m_documentRequestingPlaybackTargetPicker.
358         (WebCore::Page::didChoosePlaybackTarget): Notify Pages in vector-order, lower level code
359             now tracks which one requested the picker.
360         (WebCore::Page::configurePlaybackTargetMonitoring): Don't track m_requiresPlaybackTargetMonitoring, it
361             is too easy for it to get out of sync with the UI process state.
362         * page/Page.h:
363
364         * platform/audio/MediaSession.cpp:
365         (WebCore::MediaSession::canPlayToWirelessPlaybackTarget): New, client passthrough.
366         (WebCore::MediaSession::startPlayingToPlaybackTarget): Ditto.
367         (WebCore::MediaSession::stopPlayingToPlaybackTarget): Ditto.
368         * platform/audio/MediaSession.h:
369         (WebCore::MediaSessionClient::canPlayToWirelessPlaybackTarget):
370         (WebCore::MediaSessionClient::startPlayingToPlaybackTarget):
371         (WebCore::MediaSessionClient::stopPlayingToPlaybackTarget):
372
373         * platform/audio/MediaSessionManager.cpp:
374         (WebCore::MediaSessionManager::sessionWillBeginPlayback): Call startPlayingToPlaybackTarget &
375             stopPlayingToPlaybackTarget as necessary.
376         * platform/audio/MediaSessionManager.h:
377
378         * platform/graphics/MediaPlaybackTarget.h:
379         (WebCore::MediaPlaybackTarget::hasActiveRoute): New.
380         * platform/graphics/MediaPlaybackTargetPickerClient.h:
381         * platform/graphics/MediaPlayer.cpp:
382         (WebCore::MediaPlayer::isCurrentPlaybackTargetSupported): New, engine passthrough.
383         (WebCore::MediaPlayer::canPlayToWirelessPlaybackTarget): Ditto.
384         (WebCore::MediaPlayer::startPlayingToPlaybackTarget): Ditto.
385         (WebCore::MediaPlayer::stopPlayingToPlaybackTarget): Ditto.
386         * platform/graphics/MediaPlayer.h:
387         * platform/graphics/MediaPlayerPrivate.h:
388         (WebCore::MediaPlayerPrivateInterface::isCurrentPlaybackTargetSupported):
389         (WebCore::MediaPlayerPrivateInterface::wirelessVideoPlaybackDisabled):
390         (WebCore::MediaPlayerPrivateInterface::canPlayToWirelessPlaybackTarget):
391         (WebCore::MediaPlayerPrivateInterface::startPlayingToPlaybackTarget):
392         (WebCore::MediaPlayerPrivateInterface::stopPlayingToPlaybackTarget):
393
394         * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
395         (WebCore::MediaPlaybackTarget::hasActiveRoute): New.
396
397         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
398         (WebCore::MediaPlayerPrivateAVFoundationObjC::canPlayToWirelessPlaybackTarget):
399         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
400         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad): Use playerKVOProperties. Drive-by
401             code cleanup.
402         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): Use playerKVOProperties.
403         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetName): Implement for Mac.
404         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessVideoPlaybackDisabled): Delay callbacks
405             while setting AVPlayer property.
406         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget): Add logging. Don't set
407             the AVPlayer outputContext immediately.
408         (WebCore::MediaPlayerPrivateAVFoundationObjC::startPlayingToPlaybackTarget): New.
409         (WebCore::MediaPlayerPrivateAVFoundationObjC::stopPlayingToPlaybackTarget): New.
410         (WebCore::playerKVOProperties): New.
411         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]): Notify when
412             allowsExternalPlayback changes.
413
414         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
415         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
416         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isCurrentPlaybackTargetSupported): New.
417         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setWirelessPlaybackTarget): Ditto.
418         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::togglePlayingToPlaybackTarget): Ditto.
419         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::startPlayingToPlaybackTarget): Ditto.
420         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::stopPlayingToPlaybackTarget): Ditto.
421
422         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
423         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
424         (WebCore::MediaPlayerPrivateQTKit::isCurrentPlaybackTargetSupported): Ditto.
425         (WebCore::MediaPlayerPrivateQTKit::setWirelessPlaybackTarget): Ditto.
426         (WebCore::MediaPlayerPrivateQTKit::togglePlayingToPlaybackTarget): Ditto.
427         (WebCore::MediaPlayerPrivateQTKit::startPlayingToPlaybackTarget): Ditto.
428         (WebCore::MediaPlayerPrivateQTKit::stopPlayingToPlaybackTarget): Ditto.
429
430 2015-04-01  Alex Christensen  <achristensen@webkit.org>
431
432         [Content Extensions] Properly handle regexes that match everything.
433         https://bugs.webkit.org/show_bug.cgi?id=143281
434
435         Reviewed by Benjamin Poulain.
436
437         * contentextensions/ContentExtensionCompiler.cpp:
438         (WebCore::ContentExtensions::compileRuleList):
439         Make sure we always have at least one NFA for rule lists with triggers that all match everything.
440         * contentextensions/DFABytecodeInterpreter.cpp:
441         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretAppendAction):
442         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretTestFlagsAndAppendAction):
443         Add helper functions to reduce duplicate code.
444         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsFromDFARoot):
445         Get all actions without flags from the DFA root.
446         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
447         Remove branches when interpreting.
448         * contentextensions/DFABytecodeInterpreter.h:
449         Add helper functions to reduce duplicate code.
450
451 2015-04-01  Myles C. Maxfield  <mmaxfield@apple.com>
452
453         Addressing post-review comments.
454         https://bugs.webkit.org/show_bug.cgi?id=143292
455
456         Unreviewed.
457
458         * platform/graphics/FontCascade.cpp:
459         (WebCore::FontCascade::leadingExpansionOpportunity):
460         (WebCore::FontCascade::trailingExpansionOpportunity):
461
462 2015-04-01  Per Arne Vollan  <peavo@outlook.com>
463
464         [WinCairo] Link errors, unresolved texture mapper methods.
465         https://bugs.webkit.org/show_bug.cgi?id=143308
466
467         Reviewed by Alex Christensen.
468
469         New texture mapper files should be included in the project.
470
471         * WebCore.vcxproj/WebCore.vcxproj:
472         * WebCore.vcxproj/WebCore.vcxproj.filters:
473
474 2015-04-01  Myles C. Maxfield  <mmaxfield@apple.com>
475
476         Support forcing expansion opportunities at the beginning and ending of a run
477         https://bugs.webkit.org/show_bug.cgi?id=143292
478
479         Reviewed by David Hyatt.
480
481         Migrate ExpansionBehavior to an enum comprised of two values: one for leading behavior
482         and one for trailing behavior. Each of these two values can take on a value of
483         "force," "forbid," and neither. All calls that interact with justification are
484         migrated to use this new structure.
485
486         Note that in this terminology, "leading" and "trailing" are with respect to the order
487         that elements get laid out in a line. Therefore, leading is always on the left, since
488         lines get laid out that way regardless of their bidi attributes.
489
490         This is getting ready for https://bugs.webkit.org/show_bug.cgi?id=142608
491
492         No new tests because there is no behavior change.
493
494         * platform/graphics/FontCascade.cpp:
495         (WebCore::FontCascade::expansionOpportunityCountInternal): Migrate to these new
496         values.
497         (WebCore::FontCascade::expansionOpportunityCount): Ditto.
498         (WebCore::FontCascade::leadingExpansionOpportunity): Returns whether one is present
499         or not.
500         (WebCore::FontCascade::trailingExpansionOpportunity): Ditto.
501         * platform/graphics/FontCascade.h:
502         * platform/graphics/GlyphBuffer.h: New leading expansion field.
503         (WebCore::GlyphBuffer::setLeadingExpansion):
504         (WebCore::GlyphBuffer::leadingExpansion):
505         * platform/graphics/TextRun.h: m_expansionBehavior needs more bits.
506         (WebCore::TextRun::expansionBehavior):
507         (WebCore::TextRun::allowsLeadingExpansion): Deleted.
508         (WebCore::TextRun::allowsTrailingExpansion): Deleted.
509         * platform/graphics/WidthIterator.cpp: Update to support new type.
510         (WebCore::WidthIterator::WidthIterator):
511         (WebCore::expansionLocation): Where should we insert expansions?
512         (WebCore::WidthIterator::advanceInternal): Use expansionLocation()
513         * platform/graphics/cocoa/FontCascadeCocoa.mm:
514         (WebCore::FontCascade::adjustSelectionRectForComplexText):
515         (WebCore::FontCascade::getGlyphsAndAdvancesForComplexText):
516         * platform/graphics/mac/ComplexTextController.cpp: Same as WidthIterator
517         (WebCore::ComplexTextController::ComplexTextController):
518         (WebCore::ComplexTextController::advance):
519         (WebCore::expansionLocation):
520         (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
521         * platform/graphics/mac/ComplexTextController.h:
522         (WebCore::ComplexTextController::leadingExpansion):
523         * platform/text/TextFlags.h: Add new enum values
524         * rendering/InlineBox.h: Update to include new values.
525         (WebCore::InlineBox::InlineBoxBitfields::InlineBoxBitfields):
526         (WebCore::InlineBox::canHaveTrailingExpansion):
527         (WebCore::InlineBox::setCanHaveTrailingExpansion):
528         (WebCore::InlineBox::setForceTrailingExpansion):
529         (WebCore::InlineBox::forceTrailingExpansion):
530         (WebCore::InlineBox::setForceLeadingExpansion):
531         (WebCore::InlineBox::forceLeadingExpansion):
532         * rendering/InlineTextBox.h:
533         * rendering/RenderBlockLineLayout.cpp: Update to use new FontCascade signatures.
534         (WebCore::expansionBehaviorForInlineTextBox):
535         (WebCore::applyExpansionBehavior):
536         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
537
538 2015-04-01  Zalan Bujtas  <zalan@apple.com>
539
540         Lots of time spent querying table cell borders, when there are none.
541         https://bugs.webkit.org/show_bug.cgi?id=143277
542
543         Reviewed by Simon Fraser.
544
545         This patch speeds up collapsed border queries by using existing collapsed border
546         cache to calculate repaint rects and by introducing a fast path for zero width collapsed borders.
547
548         It reduces the number of calls to recompute collapsed borders from 36 000 to 1 600, while loading a page with a table of 400 rows (1 cell per row).
549         When scrolling the same page all the way down to the bottom, the number of calls to recompute collapsed borders falls from 290 000 to 0.
550
551         Covered by existing tests.
552
553         * rendering/RenderTable.cpp:
554         (WebCore::RenderTable::styleDidChange): This moves invalidation time from RenderTable::layout() to styleDidChange(). 
555         (WebCore::RenderTable::invalidateCollapsedBorders):
556         (WebCore::RenderTable::recalcCollapsedBorders):
557         * rendering/RenderTable.h:
558         (WebCore::RenderTable::collapsedBordersAreValid):
559         (WebCore::RenderTable::invalidateCollapsedBorders): Deleted.
560         * rendering/RenderTableCell.cpp:
561         (WebCore::RenderTableCell::RenderTableCell):
562         (WebCore::RenderTableCell::willBeRemovedFromTree): Invalidate caches so that when repaint rect is calculated, we don't end up using stale values.
563         (WebCore::RenderTableCell::styleDidChange): Same as willBeRemovedFromTree.
564         (WebCore::RenderTableCell::collapsedStartBorder): Check if collapsed border is zero -also query cache. 
565         (WebCore::RenderTableCell::collapsedEndBorder):
566         (WebCore::RenderTableCell::collapsedBeforeBorder):
567         (WebCore::RenderTableCell::collapsedAfterBorder):
568         (WebCore::RenderTableCell::cachedCollapsedLeftBorder):
569         (WebCore::RenderTableCell::cachedCollapsedRightBorder):
570         (WebCore::RenderTableCell::cachedCollapsedTopBorder):
571         (WebCore::RenderTableCell::cachedCollapsedBottomBorder):
572         (WebCore::RenderTableCell::paintCollapsedBorders):
573         (WebCore::RenderTableCell::cellAtLeft): Deleted.
574         (WebCore::RenderTableCell::cellAtRight): Deleted.
575         (WebCore::RenderTableCell::cellAtTop): Deleted.
576         (WebCore::RenderTableCell::cellAtBottom): Deleted.
577         * rendering/RenderTableCell.h:
578         (WebCore::RenderTableCell::invalidateHasEmptyCollapsedBorders):
579         * rendering/RenderTableCol.cpp:
580         (WebCore::RenderTableCol::styleDidChange):
581         * rendering/RenderTableRow.cpp:
582         (WebCore::RenderTableRow::styleDidChange):
583         (WebCore::RenderTableRow::addChild):
584         * rendering/RenderTableSection.cpp:
585         (WebCore::RenderTableSection::styleDidChange):
586         (WebCore::RenderTableSection::clearCachedCollapsedBorders): This is just an extra safety to invalidate collapsed border cache. This is always
587         called together with RenderTable::invalidateCollapsedBorders() -and that should prevent the RenderCells to use the cache.  
588         (WebCore::RenderTableSection::removeCachedCollapsedBorders):
589         (WebCore::RenderTableSection::setCachedCollapsedBorder):
590         (WebCore::RenderTableSection::cachedCollapsedBorder):
591         * rendering/RenderTableSection.h:
592
593 2015-04-01  Carlos Alberto Lopez Perez  <clopez@igalia.com>
594
595         [CMake][GTK] Use the right variable to include the Wayland headers.
596         https://bugs.webkit.org/show_bug.cgi?id=143304
597
598         Reviewed by Carlos Garcia Campos.
599
600         No new tests, no behavior changes.
601
602         * PlatformGTK.cmake: Use the right variable WAYLAND_INCLUDE_DIRS.
603
604 2015-03-30  Philippe Normand  <pnormand@igalia.com>
605
606         [GStreamer] Move synchronous message handler to MediaPlayerPrivateGStreamerBase
607         https://bugs.webkit.org/show_bug.cgi?id=143218
608
609         Reviewed by Carlos Garcia Campos.
610
611         Moved the pipeline pointer to the base class, sub-classes should
612         now invoke setPipeline() when loading a resource. The base class
613         now takes care of configuring the GL shared context, this is more
614         logical because video rendering is also managed by this class.
615
616         No new tests, this is only a code refactoring.
617
618         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
619         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
620         (WebCore::MediaPlayerPrivateGStreamer::load):
621         (WebCore::MediaPlayerPrivateGStreamer::playbackPosition):
622         (WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
623         (WebCore::MediaPlayerPrivateGStreamer::pause):
624         (WebCore::MediaPlayerPrivateGStreamer::duration):
625         (WebCore::MediaPlayerPrivateGStreamer::currentTime):
626         (WebCore::MediaPlayerPrivateGStreamer::seek):
627         (WebCore::MediaPlayerPrivateGStreamer::doSeek):
628         (WebCore::MediaPlayerPrivateGStreamer::updatePlaybackRate):
629         (WebCore::MediaPlayerPrivateGStreamer::paused):
630         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
631         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
632         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText):
633         (WebCore::MediaPlayerPrivateGStreamer::setRate):
634         (WebCore::MediaPlayerPrivateGStreamer::buffered):
635         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
636         (WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):
637         (WebCore::MediaPlayerPrivateGStreamer::didLoadingProgress):
638         (WebCore::MediaPlayerPrivateGStreamer::sourceChanged):
639         (WebCore::MediaPlayerPrivateGStreamer::cancelLoad):
640         (WebCore::MediaPlayerPrivateGStreamer::asyncStateChangeDone):
641         (WebCore::MediaPlayerPrivateGStreamer::updateStates):
642         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
643         (WebCore::MediaPlayerPrivateGStreamer::cacheDuration):
644         (WebCore::MediaPlayerPrivateGStreamer::setDownloadBuffering):
645         (WebCore::MediaPlayerPrivateGStreamer::audioSink):
646         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
647         (WebCore::MediaPlayerPrivateGStreamer::simulateAudioInterruption):
648         (WebCore::mediaPlayerPrivateSyncMessageCallback): Deleted.
649         (WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage): Deleted.
650         (WebCore::MediaPlayerPrivateGStreamer::ensureGstGLContext): Deleted.
651         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
652         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
653         (WebCore::mediaPlayerPrivateNeedContextMessageCallback):
654         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
655         (WebCore::MediaPlayerPrivateGStreamerBase::setPipeline):
656         (WebCore::MediaPlayerPrivateGStreamerBase::handleNeedContextMessage):
657         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
658         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
659
660 2015-03-24  Philippe Normand  <philn@igalia.com>
661
662         [GStreamer] GstGL support in the video sink
663         https://bugs.webkit.org/show_bug.cgi?id=138562
664
665         Use GStreamer's glimagesink for video rendering instead of our
666         custom video sink if a recent-enough version of GstGL is found
667         during the build. When glimagesink is used it passes a texture to
668         the media player which then wraps it inside a TextureMapper
669         texture later used for actual rendering.
670
671         Using this new code path will allow us to remove our custom sink
672         entirely in the long term.
673
674         Reviewed by Carlos Garcia Campos.
675
676         No new test, existing media tests cover video rendering already.
677
678         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
679         (WebCore::mediaPlayerPrivateDrawCallback): client-draw signal callback.
680         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
681         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
682         (WebCore::MediaPlayerPrivateGStreamerBase::naturalSize): Better
683         check for sample validity.
684         (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture): Ditto.
685         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint): Trigger a
686         repaint and wait its completion.
687         (WebCore::MediaPlayerPrivateGStreamerBase::paintToTextureMapper):
688         Extract texture ID and video dimensions from the sample and do actual paint.
689         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink): Use
690         glimagesink if GstGL is available.
691         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
692
693 2015-04-01  Joonghun Park  <jh718.park@samsung.com>
694
695         nullptr cleanup in StyleResolver
696         https://bugs.webkit.org/show_bug.cgi?id=143260
697
698         Reviewed by Ryosuke Niwa.
699
700         No new tests, no behavior changes
701
702         * css/StyleResolver.cpp:
703         (WebCore::StyleResolver::State::initForStyleResolve):
704         (WebCore::StyleResolver::locateCousinList):
705         (WebCore::StyleResolver::locateSharedStyle):
706         (WebCore::StyleResolver::keyframeStylesForAnimation):
707         (WebCore::StyleResolver::pseudoStyleForElement):
708         (WebCore::StyleResolver::pseudoStyleRulesForElement):
709         (WebCore::StyleResolver::findFromMatchedPropertiesCache):
710         (WebCore::StyleResolver::applyMatchedProperties):
711         (WebCore::StyleResolver::applyPropertyToStyle):
712         (WebCore::StyleResolver::MatchedProperties::MatchedProperties):
713         * css/StyleResolver.h:
714         (WebCore::PseudoStyleRequest::PseudoStyleRequest):
715         (WebCore::StyleResolverParentPusher::StyleResolverParentPusher):
716
717 2015-03-31  Simon Fraser  <simon.fraser@apple.com>
718
719         Make it possible to compute a region for elements on the page that have wheel event handlers
720         https://bugs.webkit.org/show_bug.cgi?id=142807
721
722         Reviewed by David Hyatt.
723         
724         Make it possible to compute a region that covers the elements on the page that have
725         a wheel event handler. This region may overestimate, but must not underestimate the area.
726         
727         Elements with wheel handlers are registered on the document, and when a document gains
728         its first wheel handler, it registers the ownerElement in the parent document. Thus, on 
729         the main frame, the region encompasses elements with handlers, and iframes whose subdocuments
730         have handlers.
731         
732         Element gains some functions that allow it to return a rect which is the bounds of the element's
733         renderer, and renders for its descendant elements, which is the size or larger than the event
734         handling region for that element. Some configurations (e.g. position:fixed) require special
735         treatment.
736         
737         Document::absoluteRegionForEventTargets() can then iterate over all elements in the given set,
738         and build a Region for those (short-circuiting if the document itself has a handler).
739         
740         The new code is exercised for the debug MouseWheelRegionOverlay, and also added to the
741         non-fast scrollable region, used by threaded scrolling.
742
743         Tests: platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/handlers-in-iframes.html
744                platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-handler-fixed-child.html
745                platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-handler-in-columns.html
746                platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-handler-in-region.html
747                platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-handler-inside-fixed.html
748                platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-handler-on-document.html
749                platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-handler-on-fixed.html
750                platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-handler-region-basic.html
751
752         * dom/ContainerNode.h:
753         (WebCore::ContainerNode::absoluteEventHandlerBounds): Base class implementation; returns empty rect.
754         * dom/Document.cpp:
755         (WebCore::Document::prepareForDestruction): Unregister from the parent document.
756         (WebCore::Document::didAddWheelEventHandler): Add to the wheel handler set. Tell the parent
757         document if we are adding wheel handlers for the first time. Eventually the wheelEventHandlerCountChanged()
758         code will be removed, now we have the set. Tell debug overlays that we changed.
759         (WebCore::Document::didRemoveWheelEventHandler): Remove from the set, and unregister with the parent
760         document if necessary. Tell debug overlays that we changed.
761         (WebCore::Document::didAddTouchEventHandler): Minor cleanup.
762         (WebCore::Document::didRemoveTouchEventHandler): Ditto.
763         (WebCore::Document::didRemoveEventTargetNode): Remove from wheel targets.
764         (WebCore::Document::absoluteEventHandlerBounds): Implementation of the ContainerNode
765         function, just return the document bounds.
766         (WebCore::Document::absoluteRegionForEventTargets): Iterate over the given event targets,
767         and call absoluteEventHandlerBounds() on each.
768         * dom/Document.h:
769         (WebCore::Document::wheelEventTargets):
770         * dom/Element.cpp:
771         (WebCore::layoutOverflowRectContainsAllDescendants): Return true if we can determine that the
772         layoutOverflow bounds of the given renderer contains the renderers of all descendant elements.
773         (WebCore::Element::eventBounds): Get the "event handling" bounds of this element (excluding
774         descendants), and while doing so, compute whether any descendants are position:fixed, and whether
775         these bounds are known to include descendants.
776         (WebCore::Element::eventBoundsOfElementAndDescendants): Recursive function that short-circuits
777         if it can determine that descendants are enclosed by the bounds.
778         (WebCore::Element::absoluteEventHandlerBounds):
779         * dom/Element.h:
780         * page/DebugPageOverlays.cpp:
781         (WebCore::MouseWheelRegionOverlay::updateRegion): Ask the document for the region of wheel
782         event handlers.
783         * page/scrolling/ScrollingCoordinator.cpp:
784         (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion): Add the wheel handler region
785         to the non-fast scrollable region.
786         * rendering/RenderLayer.cpp:
787         (WebCore::RenderLayer::scrollTo): Overflow scrolling needs to dirty event regions.
788         * rendering/RenderObject.cpp:
789         (WebCore::RenderObject::absoluteBoundingBoxRect): Need to pass the "wasFixed" flag out
790         of this function.
791         (WebCore::RenderObject::localToAbsolute): Ditto.
792         * rendering/RenderObject.h:
793
794 2015-03-31  Alexey Proskuryakov  <ap@apple.com>
795
796         Fix bindings tests results after <http://trac.webkit.org/changeset/182205>.
797
798         * bindings/scripts/test/JS/JSTestObj.cpp:
799         (WebCore::setJSTestObjTestSubObjEnabledBySettingConstructor):
800         (WebCore::setJSTestObjConditionalAttr4Constructor):
801         (WebCore::setJSTestObjConditionalAttr5Constructor):
802         (WebCore::setJSTestObjConditionalAttr6Constructor):
803         (WebCore::setJSTestObjReplaceableAttribute):
804
805 2015-03-31  Benjamin Poulain  <bpoulain@apple.com>
806
807         Content Extensions: split the state machines to minimize prefix states
808         https://bugs.webkit.org/show_bug.cgi?id=143253
809
810         Reviewed by Alex Christensen.
811
812         With this patch, we refine how the URLs are partitioned to make
813         multiple small machines instead of a big one.
814
815         Here, considering each pattern as a language, I took the simplest
816         partitioning: take the union minimizing the states
817         that differentiate languages.
818
819         The idea is the following: every time a subgraph can be skipped
820         or repeated, it is an opportunity for a merged language to start
821         with a distinguishable state.
822         To avoid accumulating those differences, we only merge languages
823         that share the exact same "variable" subgraph as a prefix.
824
825         A side effect is that we could create as many machines as we have patterns.
826         We'll have to address that in a follow-up by merging small machines
827         until they reach a certain size.
828         In the common cases, patterns look very much alike so that is not a problem
829         at the moment.
830
831         * WebCore.xcodeproj/project.pbxproj:
832         * contentextensions/CombinedURLFilters.cpp: Added.
833         I moved the prefix tree and graph construction out of URLFilterParser for clarity.
834
835         CombinedURLFilters maintain the term prefix tree. Instead of generating on the fly
836         as we build the prefix tree, we first generate the entire tree of terms, then generate
837         NFAs for each branch without a variable prefix.
838
839         (WebCore::ContentExtensions::CombinedURLFilters::CombinedURLFilters):
840         (WebCore::ContentExtensions::CombinedURLFilters::~CombinedURLFilters):
841
842         (WebCore::ContentExtensions::CombinedURLFilters::addPattern):
843         Note here that we keep track of which subtree contains a any variable length term.
844         Instead of anotating the edges, the destination vertex is anotated with the information
845         from the edge.
846
847         The flag "inVariableLengthPrefix" is there to simplify traversal.
848
849         (WebCore::ContentExtensions::generateNFAForSubtree):
850         (WebCore::ContentExtensions::CombinedURLFilters::createNFAs):
851         Since we are traversing a tree generated by string, using the stack for recursion
852         is out of the question.
853
854         Fortunately, the entire state is very simple when going depth first: we only need
855         the active vertex and edge, and traverse the edges in order.
856
857         To do keep track of the edges, I used the HashTable iterator on the current term.
858         Since no vertex is modified for generation, storing the iterators is safe.
859
860         * contentextensions/CombinedURLFilters.h:
861         * contentextensions/ContentExtensionCompiler.cpp:
862         (WebCore::ContentExtensions::compileRuleList):
863         * contentextensions/NFA.cpp:
864         (WebCore::ContentExtensions::NFA::setActions):
865         (WebCore::ContentExtensions::NFA::debugPrintDot):
866         (WebCore::ContentExtensions::NFA::setFinal): Deleted.
867         (WebCore::ContentExtensions::NFA::addRuleId): Deleted.
868         * contentextensions/NFA.h:
869         * contentextensions/NFAGraphBuilder.cpp: Added.
870         * contentextensions/NFAGraphBuilder.h: Added.
871         * contentextensions/NFANode.h:
872         * contentextensions/Term.h: Added.
873         Move the Term to its own file since it is now shared between the parser
874         and the CombinedURLFilters.
875
876         (WebCore::ContentExtensions::Term::CharacterSet::operator==):
877         (WebCore::ContentExtensions::Term::CharacterSet::hash):
878         (WebCore::ContentExtensions::Term::Group::operator==):
879         (WebCore::ContentExtensions::Term::Group::hash):
880         (WebCore::ContentExtensions::TermHash::hash):
881         (WebCore::ContentExtensions::TermHash::equal):
882         (WebCore::ContentExtensions::Term::Term):
883         (WebCore::ContentExtensions::Term::~Term):
884         (WebCore::ContentExtensions::Term::isValid):
885         (WebCore::ContentExtensions::Term::addCharacter):
886         (WebCore::ContentExtensions::Term::extendGroupSubpattern):
887         (WebCore::ContentExtensions::Term::quantify):
888         (WebCore::ContentExtensions::Term::Term::generateGraph):
889         (WebCore::ContentExtensions::Term::isEndOfLineAssertion):
890         (WebCore::ContentExtensions::Term::matchesAtLeastOneCharacter):
891         (WebCore::ContentExtensions::Term::isKnownToMatchAnyString):
892         (WebCore::ContentExtensions::Term::hasFixedLength):
893         (WebCore::ContentExtensions::Term::operator=):
894         (WebCore::ContentExtensions::Term::operator==):
895         (WebCore::ContentExtensions::Term::hash):
896         (WebCore::ContentExtensions::Term::isEmptyValue):
897         (WebCore::ContentExtensions::Term::isDeletedValue):
898         (WebCore::ContentExtensions::Term::isUniversalTransition):
899         (WebCore::ContentExtensions::Term::generateSubgraphForAtom):
900         (WebCore::ContentExtensions::Term::destroy):
901         * contentextensions/URLFilterParser.cpp:
902         (WebCore::ContentExtensions::PatternParser::PatternParser):
903         (WebCore::ContentExtensions::PatternParser::finalize):
904         (WebCore::ContentExtensions::PatternParser::assertionBOL):
905         (WebCore::ContentExtensions::URLFilterParser::URLFilterParser):
906         (WebCore::ContentExtensions::URLFilterParser::addPattern):
907         (WebCore::ContentExtensions::Term::Term): Deleted.
908         (WebCore::ContentExtensions::Term::~Term): Deleted.
909         (WebCore::ContentExtensions::Term::isValid): Deleted.
910         (WebCore::ContentExtensions::Term::addCharacter): Deleted.
911         (WebCore::ContentExtensions::Term::extendGroupSubpattern): Deleted.
912         (WebCore::ContentExtensions::Term::quantify): Deleted.
913         (WebCore::ContentExtensions::Term::generateGraph): Deleted.
914         (WebCore::ContentExtensions::Term::isEndOfLineAssertion): Deleted.
915         (WebCore::ContentExtensions::Term::matchesAtLeastOneCharacter): Deleted.
916         (WebCore::ContentExtensions::Term::isKnownToMatchAnyString): Deleted.
917         (WebCore::ContentExtensions::Term::operator=): Deleted.
918         (WebCore::ContentExtensions::Term::operator==): Deleted.
919         (WebCore::ContentExtensions::Term::hash): Deleted.
920         (WebCore::ContentExtensions::Term::isEmptyValue): Deleted.
921         (WebCore::ContentExtensions::Term::isDeletedValue): Deleted.
922         (WebCore::ContentExtensions::Term::isUniversalTransition): Deleted.
923         (WebCore::ContentExtensions::Term::generateSubgraphForAtom): Deleted.
924         (WebCore::ContentExtensions::Term::destroy): Deleted.
925         (WebCore::ContentExtensions::Term::CharacterSet::operator==): Deleted.
926         (WebCore::ContentExtensions::Term::CharacterSet::hash): Deleted.
927         (WebCore::ContentExtensions::Term::Group::operator==): Deleted.
928         (WebCore::ContentExtensions::Term::Group::hash): Deleted.
929         (WebCore::ContentExtensions::TermHash::hash): Deleted.
930         (WebCore::ContentExtensions::TermHash::equal): Deleted.
931         (WebCore::ContentExtensions::GraphBuilder::GraphBuilder): Deleted.
932         (WebCore::ContentExtensions::GraphBuilder::finalize): Deleted.
933         (WebCore::ContentExtensions::GraphBuilder::assertionBOL): Deleted.
934         * contentextensions/URLFilterParser.h:
935
936 2015-03-31  Myles C. Maxfield  <mmaxfield@apple.com>
937
938         Move ExpansionBehaviorFlags and TextDirection to their own file
939         https://bugs.webkit.org/show_bug.cgi?id=143273
940
941         Reviewed by Simon Fraser.
942
943         This is a mechanical change. It just moves code around.
944
945         This is getting ready for https://bugs.webkit.org/show_bug.cgi?id=142608
946
947         No new tests because there is no behavior change.
948
949         * Modules/notifications/Notification.h:
950         * WebCore.vcxproj/WebCore.vcxproj:
951         * WebCore.vcxproj/WebCore.vcxproj.filters:
952         * WebCore.xcodeproj/project.pbxproj:
953         * css/CSSPrimitiveValueMappings.h:
954         * css/CSSProperty.h:
955         * dom/Position.h:
956         * editing/VisiblePosition.h:
957         * editing/VisibleUnits.h:
958         * editing/htmlediting.h:
959         * html/canvas/CanvasRenderingContext2D.cpp:
960         (WebCore::CanvasRenderingContext2D::drawTextInternal):
961         * html/canvas/CanvasRenderingContext2D.h:
962         * platform/LengthBox.h:
963         * platform/PopupMenuStyle.h:
964         * platform/graphics/FontCascade.h:
965         * platform/graphics/LayoutBoxExtent.h:
966         * platform/graphics/TextRun.h:
967         * platform/ios/SelectionRect.h:
968         * platform/text/BidiResolver.h:
969         * platform/text/StringWithDirection.h:
970         * platform/text/TextHelpers.h: Renamed from Source/WebCore/platform/text/TextDirection.h.
971         (WebCore::isLeftToRightDirection):
972         * platform/win/PopupMenuWin.cpp:
973         (WebCore::PopupMenuWin::paint):
974         * rendering/EllipsisBox.cpp:
975         (WebCore::EllipsisBox::paint):
976         (WebCore::EllipsisBox::selectionRect):
977         (WebCore::EllipsisBox::paintSelection):
978         * rendering/HitTestLocation.h:
979         * rendering/HitTestResult.h:
980         * rendering/InlineBox.h:
981         * rendering/InlineTextBox.h:
982         (WebCore::InlineTextBox::expansionBehavior):
983         * rendering/RenderBlock.cpp:
984         (WebCore::constructTextRunInternal):
985         (WebCore::RenderBlock::constructTextRun):
986         * rendering/RenderBlock.h:
987         * rendering/RenderFileUploadControl.cpp:
988         (WebCore::RenderFileUploadControl::paintObject):
989         (WebCore::RenderFileUploadControl::computeIntrinsicLogicalWidths):
990         * rendering/RenderListBox.cpp:
991         (WebCore::RenderListBox::updateFromElement):
992         (WebCore::RenderListBox::paintItemForeground):
993         * rendering/RenderListMarker.cpp:
994         (WebCore::RenderListMarker::computePreferredLogicalWidths):
995         (WebCore::RenderListMarker::getRelativeMarkerRect):
996         * rendering/RenderMenuList.cpp:
997         (RenderMenuList::updateOptionsWidth):
998         * rendering/RenderTextControl.cpp:
999         (WebCore::RenderTextControl::getAverageCharWidth):
1000         * rendering/RenderThemeIOS.mm:
1001         * rendering/style/RenderStyle.h:
1002         * rendering/svg/SVGInlineTextBox.cpp:
1003         (WebCore::SVGInlineTextBox::constructTextRun):
1004         * rendering/svg/SVGTextMetrics.cpp:
1005         (WebCore::SVGTextMetrics::constructTextRun):
1006
1007 2015-03-31  Yusuke Suzuki  <utatane.tea@gmail.com>
1008
1009         Clean up Identifier factories to clarify the meaning of StringImpl*
1010         https://bugs.webkit.org/show_bug.cgi?id=143146
1011
1012         Reviewed by Filip Pizlo.
1013
1014         Just change Identifier creations.
1015
1016         1. If the code creates Identifier from StringImpl*
1017         which is treated as symbol or string(unique id), use Identifier::fromUid.
1018         2. If the code creates Identifier from string, use Identifier::fromString.
1019
1020         * Modules/plugins/QuickTimePluginReplacement.mm:
1021         (WebCore::QuickTimePluginReplacement::ensureReplacementScriptInjected):
1022         (WebCore::QuickTimePluginReplacement::installReplacement):
1023         * bindings/js/IDBBindingUtilities.cpp:
1024         (WebCore::get):
1025         (WebCore::set):
1026         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
1027         (WebCore::JSCSSStyleDeclaration::getOwnPropertyNames):
1028         * bindings/js/JSCallbackData.cpp:
1029         (WebCore::JSCallbackData::invokeCallback):
1030         * bindings/js/JSCommandLineAPIHostCustom.cpp:
1031         (WebCore::getJSListenerFunctions):
1032         (WebCore::JSCommandLineAPIHost::getEventListeners):
1033         * bindings/js/JSCryptoAlgorithmBuilder.cpp:
1034         (WebCore::JSCryptoAlgorithmBuilder::add):
1035         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
1036         (WebCore::getProperty):
1037         (WebCore::getHashAlgorithm):
1038         * bindings/js/JSCryptoKeySerializationJWK.cpp:
1039         (WebCore::getJSArrayFromJSON):
1040         (WebCore::getStringFromJSON):
1041         (WebCore::getBooleanFromJSON):
1042         (WebCore::addToJSON):
1043         (WebCore::buildJSONForRSAComponents):
1044         (WebCore::addBoolToJSON):
1045         (WebCore::addUsagesToJSON):
1046         * bindings/js/JSCustomXPathNSResolver.cpp:
1047         (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
1048         * bindings/js/JSDOMStringMapCustom.cpp:
1049         (WebCore::JSDOMStringMap::getOwnPropertyNames):
1050         * bindings/js/JSDOMWindowCustom.cpp:
1051         (WebCore::JSDOMWindow::defineOwnProperty):
1052         (WebCore::JSDOMWindow::setLocation):
1053         (WebCore::DialogHandler::dialogCreated):
1054         (WebCore::DialogHandler::returnValue):
1055         * bindings/js/JSDeviceMotionEventCustom.cpp:
1056         (WebCore::readAccelerationArgument):
1057         (WebCore::readRotationRateArgument):
1058         (WebCore::createAccelerationObject):
1059         (WebCore::createRotationRateObject):
1060         * bindings/js/JSDictionary.cpp:
1061         (WebCore::JSDictionary::tryGetProperty):
1062         * bindings/js/JSEventListener.cpp:
1063         (WebCore::JSEventListener::handleEvent):
1064         * bindings/js/JSHTMLAllCollectionCustom.cpp:
1065         (WebCore::callHTMLAllCollection):
1066         (WebCore::JSHTMLAllCollection::item):
1067         (WebCore::JSHTMLAllCollection::namedItem):
1068         * bindings/js/JSHTMLDocumentCustom.cpp:
1069         (WebCore::JSHTMLDocument::all):
1070         (WebCore::JSHTMLDocument::setAll):
1071         (WebCore::JSHTMLDocument::open):
1072         * bindings/js/JSHTMLFormControlsCollectionCustom.cpp:
1073         (WebCore::JSHTMLFormControlsCollection::namedItem):
1074         * bindings/js/JSIDBDatabaseCustom.cpp:
1075         (WebCore::JSIDBDatabase::createObjectStore):
1076         * bindings/js/JSIDBObjectStoreCustom.cpp:
1077         (WebCore::JSIDBObjectStore::createIndex):
1078         * bindings/js/JSImageDataCustom.cpp:
1079         (WebCore::toJS):
1080         * bindings/js/JSInspectorFrontendHostCustom.cpp:
1081         (WebCore::populateContextMenuItems):
1082         * bindings/js/JSLazyEventListener.cpp:
1083         (WebCore::JSLazyEventListener::initializeJSFunction):
1084         * bindings/js/JSNodeFilterCondition.cpp:
1085         (WebCore::JSNodeFilterCondition::acceptNode):
1086         * bindings/js/JSSQLResultSetRowListCustom.cpp:
1087         (WebCore::JSSQLResultSetRowList::item):
1088         * bindings/js/JSStorageCustom.cpp:
1089         (WebCore::JSStorage::getOwnPropertyNames):
1090         * bindings/js/ReadableStreamJSSource.cpp:
1091         (WebCore::setInternalSlotToObject):
1092         (WebCore::getInternalSlotFromObject):
1093         * bindings/js/ScriptGlobalObject.cpp:
1094         (WebCore::ScriptGlobalObject::set):
1095         (WebCore::ScriptGlobalObject::get):
1096         (WebCore::ScriptGlobalObject::remove):
1097         * bindings/js/SerializedScriptValue.cpp:
1098         (WebCore::CloneSerializer::CloneSerializer):
1099         (WebCore::CloneSerializer::write):
1100         (WebCore::CloneDeserializer::deserialize):
1101         * bindings/objc/WebScriptObject.mm:
1102         (-[WebScriptObject callWebScriptMethod:withArguments:]):
1103         (-[WebScriptObject setValue:forKey:]):
1104         (-[WebScriptObject valueForKey:]):
1105         (-[WebScriptObject removeWebScriptKey:]):
1106         (-[WebScriptObject hasWebScriptKey:]):
1107         * bindings/scripts/CodeGeneratorJS.pm:
1108         (GenerateImplementation):
1109         * bindings/scripts/test/JS/JSFloat64Array.cpp:
1110         (WebCore::JSFloat64Array::getOwnPropertyNames):
1111         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1112         (WebCore::JSTestEventTarget::getOwnPropertyNames):
1113         * bindings/scripts/test/JS/JSTestObj.cpp:
1114         (WebCore::setJSTestObjTestSubObjEnabledBySettingConstructor):
1115         (WebCore::setJSTestObjConditionalAttr4Constructor):
1116         (WebCore::setJSTestObjConditionalAttr5Constructor):
1117         (WebCore::setJSTestObjConditionalAttr6Constructor):
1118         (WebCore::setJSTestObjReplaceableAttribute):
1119         * bridge/c/c_utility.cpp:
1120         (JSC::Bindings::identifierFromNPIdentifier):
1121         * bridge/objc/objc_runtime.mm:
1122         (JSC::Bindings::ObjcFallbackObjectImp::defaultValue):
1123         * bridge/testbindings.cpp:
1124         (main):
1125         * bridge/testbindings.mm:
1126         (main):
1127         * contentextensions/ContentExtensionParser.cpp:
1128         (WebCore::ContentExtensions::loadTrigger):
1129         (WebCore::ContentExtensions::loadAction):
1130         * html/HTMLMediaElement.cpp:
1131         (WebCore::HTMLMediaElement::parseAttribute):
1132         * html/HTMLPlugInImageElement.cpp:
1133         (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):
1134         * testing/js/WebCoreTestSupport.cpp:
1135         (WebCoreTestSupport::injectInternalsObject):
1136
1137 2015-03-31  Jer Noble  <jer.noble@apple.com>
1138
1139         [Mac] Songza.com fails to play; QTKit path reports it is always "seeking".
1140         https://bugs.webkit.org/show_bug.cgi?id=143274
1141
1142         Rubber-stamped by Eric Carlson.
1143
1144         MediaTime::invalidTime() is always greater than any valid time. So when
1145         checking to see if MediaPlayerPrivateQTKit is seeking, first check if the
1146         m_seekTo time is valid before checking whether it's > 0.
1147
1148         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
1149         (WebCore::MediaPlayerPrivateQTKit::seeking):
1150
1151 2015-03-31  Said Abou-Hallawa  <sabouhallawa@apple.com>
1152
1153         border-image with 'fill' keyword does not fill the middle area unless the border width is greater than zero.
1154         https://bugs.webkit.org/show_bug.cgi?id=142650.
1155
1156         Reviewed by Simon Fraser.
1157
1158         The decoration of a RenderBox, a RenderTable or an InlineFlowBox should be
1159         drawn if its RenderStyle has a non-zero width border or the border-image
1160         has the keyword fill.
1161
1162         Tests: fast/borders/border-image-fill-inline-no-border.html
1163                fast/borders/border-image-fill-no-border.html
1164
1165         * rendering/InlineFlowBox.cpp:
1166         (WebCore::InlineFlowBox::paintBoxDecorations):
1167         * rendering/RenderBox.cpp:
1168         (WebCore::RenderBox::paintBoxDecorations):
1169         * rendering/RenderBoxModelObject.cpp:
1170         (WebCore::RenderBoxModelObject::hasBoxDecorationStyle):
1171         * rendering/RenderTable.cpp:
1172         (WebCore::RenderTable::paintBoxDecorations):
1173         * rendering/style/BorderData.h:
1174         (WebCore::BorderData::hasFill):
1175         * rendering/style/RenderStyle.h:
1176
1177 2015-03-31  Alex Christensen  <achristensen@webkit.org>
1178
1179         [Win] Unreviewed build fix.
1180
1181         * WebCore.vcxproj/WebCore.vcxproj:
1182         Don't include inspector files twice in debug builds.
1183         InspectorAllInOne.cpp is now used on debug builds.
1184
1185 2015-03-31  David Hyatt  <hyatt@apple.com>
1186
1187         [New Block-Inside-Inline Model] Anonymous inline-blocks should size as though they are block-level.
1188         https://bugs.webkit.org/show_bug.cgi?id=143271
1189
1190         Reviewed by Dean Jackson.
1191
1192         Added fast/block/inside-inlines/block-width-check.html.
1193
1194         * rendering/RenderBox.cpp:
1195         (WebCore::RenderBox::sizesLogicalWidthToFitContent):
1196         Return false when an anonymous inline-block is encountered, since we want to treat it like a regular
1197         block instead.
1198
1199 2015-03-31  Commit Queue  <commit-queue@webkit.org>
1200
1201         Unreviewed, rolling out r182186.
1202         https://bugs.webkit.org/show_bug.cgi?id=143270
1203
1204         it crashes all the WebGL tests on the Debug bots (Requested by
1205         dino on #webkit).
1206
1207         Reverted changeset:
1208
1209         "Web Inspector: add 2D/WebGL canvas instrumentation
1210         infrastructure"
1211         https://bugs.webkit.org/show_bug.cgi?id=137278
1212         http://trac.webkit.org/changeset/182186
1213
1214 2015-03-31  Myles C. Maxfield  <mmaxfield@apple.com>
1215
1216         Crash in CGContextShowGlyphsWithAdvances when passing kCGFontIndexInvalid
1217         https://bugs.webkit.org/show_bug.cgi?id=143114
1218
1219         This is a workaround for <rdar://problem/20230073>. Please remove when it is no longer necessary.
1220
1221         Reviewed by Alexey Proskuryakov.
1222
1223         Covered by:
1224         compositing/regions/floated-region-with-transformed-child.html
1225         compositing/regions/floated-region-with-transformed-child-expected.html
1226         fast/regions/counters/extract-ordered-lists-in-regions-explicit-counters-005.html
1227         fast/regions/counters/extract-ordered-lists-in-regions-explicit-counters-005-expected.html
1228         fast/regions/overflow/overflow-content-transform-rotate.html
1229         fast/regions/overflow/overflow-content-transform-rotate-expected.html
1230
1231         * platform/graphics/GlyphBuffer.h:
1232         (WebCore::GlyphBuffer::shrink): Performing shaping may remove glyphs, so we need to shrink the GlyphBuffer.
1233         * platform/graphics/WidthIterator.cpp:
1234         (WebCore::applyFontTransforms): Filter out kCGFontIndexInvalid.
1235         (WebCore::WidthIterator::advanceInternal): Moved code into applyFontTransforms, and trigger the
1236         shrink of the GlyphBuffer.
1237
1238 2015-03-31  Beth Dakin  <bdakin@apple.com>
1239
1240         REGRESSION (r173484): Reducing content of scrollable region does not reset scroll 
1241         position
1242         https://bugs.webkit.org/show_bug.cgi?id=138525
1243         -and corresponding-
1244         rdar://problem/18166043
1245
1246         Reviewed by Simon Fraser.
1247
1248         The change that caused this regression was correct. That change does not allow 
1249         RenderLayer to update scroll position after a layout if a rubber-band is currently 
1250         happening. The change caused this regression because all of the member variables 
1251         in ScrollController that attempt to keep track of the current state of the scroll 
1252         gesture (m_inScrollGesture, m_momentumScrollInProgress, and 
1253         m_snapRubberbandTimerIsActive) all indicated that a momentum scroll gesture was 
1254         still in action for this div even though it very much is not when the bug happens. 
1255         Those variables were never properly re-set because the 
1256         PlatformWheelEventPhaseEnded events never got dispatched to the ScrollController, 
1257         which brought the investigation back to Element.
1258
1259         We must still dispatch events that have zero delta so that the default event 
1260         handlers can handle them, but we should stopPropagation() so that these events are 
1261         not sent to the DOM. Websites will break if they get wheel events with no delta.
1262         * dom/Element.cpp:
1263         (WebCore::Element::dispatchWheelEvent):
1264
1265 2015-03-31  Alex Christensen  <achristensen@webkit.org>
1266
1267         [Win] Unreviewed debug build fix after r182186.
1268
1269         * WebCore.vcxproj/WebCore.vcxproj:
1270         Include InspectorAllInOne.cpp in debug builds.
1271
1272 2015-03-30  David Hyatt  <hyatt@apple.com>
1273
1274         [New Block-Inside-Inline Model] Make sure line breaks occur before and after the anonymous inline-block.
1275         https://bugs.webkit.org/show_bug.cgi?id=143238.
1276
1277         Reviewed by Dean Jackson.
1278
1279         Added fast/blocks/inside-inlines/breaking-behavior.html (and new-model equivalent).
1280
1281         * rendering/InlineFlowBox.h:
1282         (WebCore::InlineFlowBox::InlineFlowBox):
1283         (WebCore::InlineFlowBox::hasAnonymousInlineBlock):
1284         (WebCore::InlineFlowBox::setHasAnonymousInlineBlock):
1285         Add a bit to root line boxes (stored in the InlineFlowBox since it has free bits) that indicates whether
1286         or not a line is an anonymous inline-block line.
1287
1288         * rendering/RenderBlockFlow.cpp:
1289         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths):
1290         Patch the preferred logical width computation to break both before and after an anonymous inline-block.
1291         Also make sure to strip trailing spaces from the line before the anonymous inline-block.
1292
1293         * rendering/RenderBlockLineLayout.cpp:
1294         (WebCore::RenderBlockFlow::constructLine):
1295         Patch line construction so that no intermediate boxes are constructed between the InlineBox for the anonymous
1296         inline-block and the root line box.
1297
1298         * rendering/RootInlineBox.cpp:
1299         (WebCore::RootInlineBox::ascentAndDescentForBox):
1300         The height of a "line" that holds an anonymous inline-block should ignore line-box-contain and also make sure
1301         that the margins of the replaced element are "outside" the line, since those margins will collapse.
1302
1303         * rendering/line/BreakingContext.h:
1304         (WebCore::BreakingContext::handleReplaced):
1305         Patch handleReplaced to make sure breaks occur both before and after an anonymous inline-block. In the case of
1306         a break after the block, we setPreviousLineBrokeCleanly to true so that <br>s that follow the anonymous inline-block
1307         are respected.
1308
1309 2015-03-31  Csaba Osztrogonác  <ossy@webkit.org>
1310
1311         [EFL] Add nullptr check to GraphicsContext3D::makeContextCurrent()
1312         https://bugs.webkit.org/show_bug.cgi?id=143214
1313
1314         Reviewed by Žan Doberšek.
1315
1316         * platform/graphics/efl/GraphicsContext3DEfl.cpp:
1317         (WebCore::GraphicsContext3D::makeContextCurrent):
1318
1319 2015-03-31  Matt Baker  <mattbaker@apple.com>
1320
1321         Web Inspector: add 2D/WebGL canvas instrumentation infrastructure
1322         https://bugs.webkit.org/show_bug.cgi?id=137278
1323
1324         Reviewed by Timothy Hatcher.
1325
1326         Added backend agent for canvas inspection. A canvas is instrumented once its CanvasRenderingContext has been
1327         created. WebGLRenderingContext is instrumented to track the lifetime of shader program objects.
1328
1329         To instrument off-screen rendering contexts (CSS canvases and detached canvas elements), the canvas agent must
1330         track all CanvasRenderingContexts as they are created, even in the absense of the frontend. As far as I know,
1331         there is no practical way to identify rendering contexts belonging to a frame that are not in the DOM. In the
1332         absence of the inspector frontend the agent does only the minimum required to track the lifetime of rendering
1333         contexts and their resources, to avoid creating a negative performance impact.
1334
1335         Tests: inspector/canvas/canvas-add-remove-events.html
1336                inspector/canvas/canvas-context-attributes.html
1337                inspector/canvas/canvas-css-name.html
1338
1339         * CMakeLists.txt:
1340         * WebCore.xcodeproj/project.pbxproj:
1341
1342         * dom/Document.cpp:
1343         (WebCore::Document::getCSSCanvasElement):
1344         Instrumentation for CSS canvases.
1345
1346         * html/HTMLCanvasElement.cpp:
1347         (WebCore::HTMLCanvasElement::getContext):
1348         Instrumentation for context creation.
1349
1350         * html/canvas/WebGLRenderingContextBase.cpp:
1351         (WebCore::WebGLRenderingContextBase::attachShader):
1352         (WebCore::WebGLRenderingContextBase::createProgram):
1353         (WebCore::WebGLRenderingContextBase::deleteProgram):
1354         (WebCore::WebGLRenderingContextBase::detachShader):
1355         Instrumentation for programs and shaders.
1356
1357         * inspector/InspectorAllInOne.cpp:
1358
1359         * inspector/InspectorCanvasAgent.cpp: Added.
1360         (WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
1361         (WebCore::InspectorCanvasAgent::didCreateFrontendAndBackend):
1362         (WebCore::InspectorCanvasAgent::willDestroyFrontendAndBackend):
1363         (WebCore::InspectorCanvasAgent::frameNavigated):
1364         (WebCore::InspectorCanvasAgent::didCreateCSSCanvas):
1365         (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
1366         (WebCore::InspectorCanvasAgent::didAttachShader):
1367         (WebCore::InspectorCanvasAgent::didDetachShader):
1368         (WebCore::InspectorCanvasAgent::didCreateProgram):
1369         (WebCore::InspectorCanvasAgent::didDeleteProgram):
1370         (WebCore::InspectorCanvasAgent::getCanvases):
1371         (WebCore::InspectorCanvasAgent::canvasDestroyed):
1372         (WebCore::InspectorCanvasAgent::canvasDestroyedTimerFired):
1373         (WebCore::InspectorCanvasAgent::reset):
1374         (WebCore::InspectorCanvasAgent::getCanvasEntry):
1375         (WebCore::InspectorCanvasAgent::getProgramEntry):
1376         (WebCore::InspectorCanvasAgent::removeShaderFromShaderMap):
1377         (WebCore::InspectorCanvasAgent::contextTypeJson):
1378         (WebCore::InspectorCanvasAgent::buildObjectForCanvas):
1379         * inspector/InspectorCanvasAgent.h: Added.
1380         New backend agent.
1381
1382         * inspector/InspectorController.cpp:
1383         (WebCore::InspectorController::InspectorController):
1384         Support for new backend agent.
1385
1386         * inspector/InspectorInstrumentation.cpp:
1387         (WebCore::InspectorInstrumentation::didCommitLoadImpl):
1388         (WebCore::InspectorInstrumentation::didCreateCSSCanvasImpl):
1389         (WebCore::InspectorInstrumentation::didCreateCanvasRenderingContextImpl):
1390         (WebCore::InspectorInstrumentation::didAttachShaderImpl):
1391         (WebCore::InspectorInstrumentation::didDetachShaderImpl):
1392         (WebCore::InspectorInstrumentation::didCreateProgramImpl):
1393         (WebCore::InspectorInstrumentation::didDeleteProgramImpl):
1394         (WebCore::InspectorInstrumentation::instrumentingAgentsForRenderingContext):
1395         Plumbing for canvas instrumentation.
1396
1397         * inspector/InspectorInstrumentation.h:
1398         (WebCore::InspectorInstrumentation::didCreateCSSCanvas):
1399         (WebCore::InspectorInstrumentation::didCreateCanvasRenderingContext):
1400         (WebCore::InspectorInstrumentation::didAttachShader):
1401         (WebCore::InspectorInstrumentation::didDetachShader):
1402         (WebCore::InspectorInstrumentation::didCreateProgram):
1403         (WebCore::InspectorInstrumentation::didDeleteProgram):
1404
1405         * inspector/InstrumentingAgents.cpp:
1406         (WebCore::InstrumentingAgents::InstrumentingAgents):
1407         (WebCore::InstrumentingAgents::reset):
1408         * inspector/InstrumentingAgents.h:
1409         (WebCore::InstrumentingAgents::inspectorCanvasAgent):
1410         (WebCore::InstrumentingAgents::setInspectorCanvasAgent):
1411         Support for new backend agent.
1412
1413 2015-03-31  Xabier Rodriguez Calvar <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
1414
1415         [Streams API] Implement a barebone ReadableStreamReader interface
1416         https://bugs.webkit.org/show_bug.cgi?id=142866
1417
1418         Reviewed by Benjamin Poulain.
1419
1420         This patch implements a barebone ReadableStreamReader as described in https://streams.spec.whatwg.org/#reader-class.
1421         It implements the IDL without implementing most of the functionality behind.
1422         It implements ReadableStreamReader JS constructor and the link with ReadableStream.getReader:
1423         - Raise an error if stream is already locked
1424         - Set the stream reader to the newly created ReadableStreamReader instance.
1425
1426         Test: streams/readablestreamreader-constructor.html
1427
1428         * CMakeLists.txt: Adding ReadableStreamReader files.
1429         * DerivedSources.cpp: Ditto.
1430         * DerivedSources.make: Ditto.
1431         * Modules/streams/ReadableStream.cpp:
1432         (WebCore::ReadableStream::createReader): Used by JS binding to get access to the reader.
1433         * Modules/streams/ReadableStream.h: Declaration of createReader, reader and lock.
1434         (WebCore::ReadableStream::reader):
1435         (WebCore::ReadableStream::lock):
1436         * Modules/streams/ReadableStream.idl: Cleaning-up the IDL.
1437         * Modules/streams/ReadableStreamReader.cpp: Added.
1438         (WebCore::ReadableStreamReader::create):
1439         (WebCore::ReadableStreamReader::ReadableStreamReader):
1440         (WebCore::ReadableStreamReader::~ReadableStreamReader):
1441         (WebCore::ReadableStreamReader::closed):
1442         (WebCore::ReadableStreamReader::activeDOMObjectName):
1443         (WebCore::ReadableStreamReader::canSuspend):
1444         * Modules/streams/ReadableStreamReader.h: Added.
1445         (WebCore::ReadableStreamReader::stream):
1446         * Modules/streams/ReadableStreamReader.idl: Added.
1447         * WebCore.vcxproj/WebCore.vcxproj:
1448         * WebCore.vcxproj/WebCore.vcxproj.filters:
1449         * WebCore.xcodeproj/project.pbxproj:
1450         * bindings/js/JSBindingsAllInOne.cpp:
1451         * bindings/js/JSReadableStreamCustom.cpp:
1452         (WebCore::JSReadableStream::getReader):
1453         * bindings/js/JSReadableStreamReaderCustom.cpp: Added.
1454         (WebCore::JSReadableStreamReader::read):
1455         (WebCore::getOrCreatePromiseDeferredFromObject):
1456         (WebCore::closedPromiseSlotName):
1457         (WebCore::JSReadableStreamReader::closed):
1458         (WebCore::JSReadableStreamReader::cancel):
1459         (WebCore::JSReadableStreamReader::releaseLock):
1460         (WebCore::constructJSReadableStreamReader):
1461
1462 2015-03-31  Carlos Garcia Campos  <cgarcia@igalia.com>
1463
1464         [GTK] DnD icon/widget has odd background
1465         https://bugs.webkit.org/show_bug.cgi?id=143217
1466
1467         Reviewed by Martin Robinson.
1468
1469         Remove DragIcon class since it's no longer needed with GTK+3 and
1470         the GTK+2 code there is unused. GTK+ knows what to do with a cairo
1471         surface, I guess we migrated the GTK+2 code to GTK+3 without
1472         realizing that using the surface was enough.
1473
1474         * PlatformGTK.cmake:
1475         * platform/gtk/DragIcon.cpp: Removed.
1476         * platform/gtk/DragIcon.h: Removed.
1477
1478 2015-03-30  Alex Christensen  <achristensen@webkit.org>
1479
1480         Unreviewed build fix after r182168.
1481
1482         * contentextensions/ContentExtensionsBackend.cpp:
1483         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
1484         Explicitly cast to unsigned.
1485
1486 2015-03-30  Alex Christensen  <achristensen@webkit.org>
1487
1488         [Content Extensions] Correctly handle regular expressions matching everything
1489         https://bugs.webkit.org/show_bug.cgi?id=143235
1490
1491         Reviewed by Benjamin Poulain.
1492
1493         Test: http/tests/contentextensions/whitelist.html
1494
1495         * contentextensions/CompiledContentExtension.cpp:
1496         (WebCore::ContentExtensions::CompiledContentExtension::globalDisplayNoneSelectors):
1497         Global actions can have non-css actions.  Only put the selectors into the list of selectors.
1498         * contentextensions/ContentExtensionCompiler.cpp:
1499         (WebCore::ContentExtensions::serializeSelector):
1500         (WebCore::ContentExtensions::serializeActions):
1501         Merge sequential css selectors with identical triggers (usually .*) into one action to reduce the number of actions.
1502         (WebCore::ContentExtensions::compileRuleList):
1503         Fail if a regular expression matches everything after ignore-previous-rules.
1504         * contentextensions/ContentExtensionError.cpp:
1505         (WebCore::ContentExtensions::contentExtensionErrorCategory):
1506         * contentextensions/ContentExtensionError.h:
1507         Add more failure cases.
1508         * contentextensions/ContentExtensionRule.h:
1509         (WebCore::ContentExtensions::Trigger::operator==):
1510         Allow comparing of Triggers to determine if sequential triggers are equal.
1511         * contentextensions/ContentExtensionsBackend.cpp:
1512         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
1513         Put non-css actions that match everything into the list of actions if ignore-previous-rules was not hit.
1514         These actions will be out of order, but order only matters when determining if ignore-previous-rules, and this case is handled correctly.
1515         * contentextensions/DFABytecodeInterpreter.cpp:
1516         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsFromDFARoot):
1517         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
1518         Added an assertion that all actions that match everything should be in the first DFA root.
1519         We should catch them all with URLFilterParser::MatchesEverything.
1520
1521 2015-03-30  Myles C. Maxfield  <mmaxfield@apple.com>
1522
1523         Allow building on Windows without Cygwin
1524         https://bugs.webkit.org/show_bug.cgi?id=143219
1525
1526         Reviewed by Brent Fulgham.
1527
1528         * AVFoundationSupport.py: Renamed from Source/WebCore/WebCore.vcxproj/MigrateScripts.
1529         Move logic from DerivedSources.make to its own script
1530         (lookFor):
1531         * DerivedSources.make: Paths like /usr/bin don't exist on Windows.
1532         Windows uses del instead of rm -f
1533         Windows doesn't have printf
1534         * WebCore.vcxproj/WebCoreGenerated.make: Pass the CC executable to
1535         build-generated-files.pl
1536         * WebCore.vcxproj/build-generated-files.pl: Export the CC executable as an environment
1537         variable. Don't use /usr/bin.
1538         * WebCore.vcxproj/migrate-scripts.pl: Deleted the MigrateScripts makefile. We don't
1539         need a whole Makefile just to copy 5 files. Moved this logic into migrate-scripts.pl.
1540         (copyFile):
1541         * bindings/scripts/preprocessor.pm:
1542         (applyPreprocessor): Support passing preprocessing flags to the Visual Studio
1543         compiler.
1544         * dom/make_names.pl: Ditto.
1545
1546 2015-03-30  Alexey Proskuryakov  <ap@apple.com>
1547
1548         Build fix.
1549
1550         * platform/spi/mac/AVFoundationSPI.h:
1551
1552 2015-03-30  Sam Weinig  <sam@webkit.org>
1553
1554         [Content Extensions] Flesh out the UserContentExtensionStore
1555         https://bugs.webkit.org/show_bug.cgi?id=143123
1556
1557         Reviewed by Benjamin Poulain.
1558
1559         - Adds a variant of getFileSize() that takes a PlatformFileHandle.
1560         - Adds a new file system function, rename() which operates as the POSIX
1561           rename function does.
1562
1563         * platform/FileSystem.h:
1564         Add new functions.
1565
1566         * platform/posix/FileSystemPOSIX.cpp:
1567         (WebCore::renameFile):
1568         (WebCore::getFileSize):
1569         Add implementations.
1570
1571         * platform/gtk/FileSystemGtk.cpp:
1572         (WebCore::renameFile):
1573         (WebCore::getFileSize):
1574         * platform/win/FileSystemWin.cpp:
1575         (WebCore::getFileSize):
1576         (WebCore::renameFile):
1577         Add stubs.
1578
1579 2015-03-30  Per Arne Vollan  <peavo@outlook.com>
1580
1581         [WinCairo] Crash when closing window while video is loading
1582         https://bugs.webkit.org/show_bug.cgi?id=143088
1583
1584         Reviewed by Mark Lam.
1585
1586         When the media player is destroyed, we have to cancel possible calls on the
1587         main thread made by a worker thread. Otherwise the destroyed media player
1588         will be accessed when performing the call.
1589
1590         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
1591         (WebCore::MediaPlayerPrivateMediaFoundation::~MediaPlayerPrivateMediaFoundation):
1592         (WebCore::MediaPlayerPrivateMediaFoundation::endCreatedMediaSource):
1593         (WebCore::MediaPlayerPrivateMediaFoundation::endGetEvent):
1594         (WebCore::MediaPlayerPrivateMediaFoundation::onTopologySet):
1595         (WebCore::MediaPlayerPrivateMediaFoundation::onCreatedMediaSourceCallback):
1596         (WebCore::MediaPlayerPrivateMediaFoundation::onTopologySetCallback):
1597         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
1598
1599 2015-03-30  Gwang Yoon Hwang  <yoon@igalia.com>
1600
1601         [Threaded Compositor] Crash when animation changes frequently.
1602         https://bugs.webkit.org/show_bug.cgi?id=143213
1603
1604         Reviewed by Simon Fraser.
1605
1606         CompositingCoordinator copies CoordinatedGraphicsLayerState when
1607         flushing GraphicsLayer changes, and ThreadedCoordinatedCompositor passes
1608         it to compositing thread.
1609
1610         To ensure thread-safety, we need to provide copy constructor to copy
1611         Animation object in TextureMapperAnimation instead of referencing it.
1612
1613         Since TimingFunction and TransformOperation used by KeyframeValueList are
1614         not ThreadSafeRefCounted, these should be cloned also.
1615
1616         No new tests needed.
1617
1618         * platform/graphics/GraphicsLayer.h:
1619         (WebCore::AnimationValue::AnimationValue):
1620         (WebCore::FloatAnimationValue::FloatAnimationValue):
1621         (WebCore::TransformAnimationValue::TransformAnimationValue):
1622         (WebCore::FilterAnimationValue::FilterAnimationValue):
1623         Adds deep copy constructor.
1624
1625         * platform/graphics/texmap/TextureMapperAnimation.cpp:
1626         (WebCore::TextureMapperAnimation::TextureMapperAnimation):
1627         Because the name of the animation can be AtomicString, we need to create
1628         isolated version of string to ensure thread safty.
1629
1630         * platform/graphics/texmap/TextureMapperAnimation.h:
1631         * platform/graphics/transforms/IdentityTransformOperation.h:
1632         * platform/graphics/transforms/Matrix3DTransformOperation.h:
1633         * platform/graphics/transforms/MatrixTransformOperation.h:
1634         * platform/graphics/transforms/PerspectiveTransformOperation.h:
1635         * platform/graphics/transforms/RotateTransformOperation.h:
1636         * platform/graphics/transforms/ScaleTransformOperation.h:
1637         * platform/graphics/transforms/SkewTransformOperation.h:
1638         * platform/graphics/transforms/TransformOperation.h:
1639         * platform/graphics/transforms/TranslateTransformOperation.h:
1640         Adds TransformOperation::clone() for threadsafety.
1641
1642 2015-03-30  Chris Dumez  <cdumez@apple.com>
1643
1644         Cached "Expires" header is not updated upon successful resource revalidation
1645         https://bugs.webkit.org/show_bug.cgi?id=143228
1646         <rdar://problem/20348059>
1647
1648         Reviewed by Antti Koivisto.
1649
1650         Cached "Expires" header was not updated upon successful resource
1651         revalidation. This affected both our disk cache and our memory cache.
1652         This was caused by shouldUpdateHeaderAfterRevalidation() in
1653         CacheValidation.cpp returning false for the "Expires" header.
1654
1655         There is a comment there stating that the list of ignored headers
1656         matches Chromium's net library but that's not the case, at least not
1657         anymore:
1658         http://osxr.org/android/source/external/chromium/net/http/http_response_headers.cc
1659
1660         HTTP servers such as Apache return an "Expires" header in their 304
1661         responses and the "Expires" header is potentially a new one. However,
1662         our caches were ignoring the updated expiration date and kept using the
1663         old one, which meant that the cached resource expired sooner than it
1664         should have.
1665
1666         See the following Apache bugs that explain the issue:
1667         https://bz.apache.org/bugzilla/show_bug.cgi?id=24884
1668         https://bz.apache.org/bugzilla/show_bug.cgi?id=25123
1669
1670         Test: http/tests/cache/disk-cache/disk-cache-revalidation-new-expire-header.html
1671
1672         * platform/network/CacheValidation.cpp:
1673
1674 2015-03-30  Antti Koivisto  <antti@apple.com>
1675
1676         Don't cache resources that are very unlikely to be reused
1677         https://bugs.webkit.org/show_bug.cgi?id=143226
1678         <rdar://problem/20347160>
1679
1680         Reviewed by Geoff Garen.
1681
1682         Allow overriding resource load priorities via Internals for testing.
1683
1684         * loader/FrameLoader.cpp:
1685         (WebCore::FrameLoader::addExtraFieldsToRequest):
1686         (WebCore::FrameLoader::clearTestingOverrides):
1687         * loader/FrameLoader.h:
1688         (WebCore::FrameLoader::setOverrideResourceLoadPriorityForTesting):
1689         (WebCore::FrameLoader::clearOverrideCachePolicyForTesting): Deleted.
1690         * page/DiagnosticLoggingKeys.cpp:
1691         (WebCore::DiagnosticLoggingKeys::unlikelyToReuseKey):
1692         * page/DiagnosticLoggingKeys.h:
1693
1694             Add a key.
1695
1696         * testing/Internals.cpp:
1697         (WebCore::Internals::resetToConsistentState):
1698         (WebCore::stringToResourceLoadPriority):
1699         (WebCore::Internals::setOverrideResourceLoadPriority):
1700         * testing/Internals.h:
1701         * testing/Internals.idl:
1702
1703 2015-03-30  Javier Fernandez  <jfernandez@igalia.com>
1704
1705         [CSS Grid Layout] Upgrade align-self and align-items parsing to CSS 3
1706         https://bugs.webkit.org/show_bug.cgi?id=133359
1707
1708         Reviewed by David Hyatt.
1709
1710         From Blink r164817 and r165264 by <jchaffraix@chromium.org>
1711
1712         Broaden justify-self's parsing name
1713
1714         This is in preparation of migrating align-self, align-items
1715         and justify-items to the CSS 3 Alignment syntax.
1716
1717         The current naming was too tied to justify-self and needs to
1718         be broadened. This will reduce the follow-up implementations'
1719         patches.
1720
1721         Upgrade align-self and align-items parsing to CSS 3
1722
1723         This change migrates the 2 properties to the CSS 3 Alignment
1724         parsing. The new parsing is identical to how we parse
1725         'justify-self'. The 2 properties need to be migrated together
1726         as they are used in tandem in CSSComputedStyleDeclaration.
1727
1728         This change also removes EAlignItems as it is now unused.
1729
1730         Tests: css3/parse-align-items.html
1731                css3/parse-align-self.html
1732
1733         * css/CSSComputedStyleDeclaration.cpp:
1734         (WebCore::resolveAlignmentAuto): Added. Resolves the "auto" value for the alignment properties.
1735         (WebCore::valueForItemPositionWithOverflowAlignment): Added. Builds the CSSValue for the for the alignment properties.
1736         (WebCore::ComputedStyleExtractor::propertyValue):
1737         * css/CSSParser.cpp:
1738          (WebCore::isValidKeywordPropertyAndValue): Removed align-self, align-items and justify-items.
1739         (WebCore::isKeywordPropertyID): Removed align-self, align-items and justify-items.
1740         (WebCore::isBaselinePositionKeyword): Added. Set of keywords related to baseline value.
1741         (WebCore::CSSParser::parseItemPositionOverflowPosition): Generic parsing fuction for the alignment properties.
1742         (WebCore::CSSParser::parseJustifySelf): Deleted.
1743         (WebCore::CSSParser::parseValue): Added align-items and align-self to the list and call to the generic parsing fuction for the alignment properties.
1744         * css/CSSParser.h:
1745         * css/CSSPrimitiveValueMappings.h:
1746         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Added.
1747         (WebCore::CSSPrimitiveValue::operator ItemPosition): Added. Replace the old EAlignItems enumeration.
1748         (WebCore::CSSPrimitiveValue::operator OverflowAlignment): Added.
1749         (WebCore::CSSPrimitiveValue::operator EAlignItems): Deleted.
1750         (WebCore::CSSPrimitiveValue::operator EJustifySelf): Deleted.
1751         (WebCore::CSSPrimitiveValue::operator EJustifySelfOverflowAlignment): Deleted.
1752         * css/CSSPropertyNames.in:
1753         * css/CSSValueKeywords.in:
1754         * css/StyleBuilderCustom.h:
1755         (WebCore::StyleBuilderCustom::applyInheritAlignSelf): Added.
1756         (WebCore::StyleBuilderCustom::applyInitialAlignSelf): Added.
1757         (WebCore::StyleBuilderCustom::applyValueAlignSelf): Added.
1758         (WebCore::StyleBuilderCustom::applyInheritAlignItems): Added.
1759         (WebCore::StyleBuilderCustom::applyInitialAlignItems): Added.
1760         (WebCore::StyleBuilderCustom::applyValueAlignItems): Added.
1761         (WebCore::StyleBuilderCustom::applyInheritJustifySelf): Added.
1762         (WebCore::StyleBuilderCustom::applyInitialJustifySelf): Added.
1763         (WebCore::StyleBuilderCustom::applyValueJustifySelf): Added.
1764         (WebCore::StyleBuilderCustom::applyValueWebkitJustifySelf): Deleted.
1765         * css/StyleResolver.cpp:
1766         (WebCore::StyleResolver::adjustRenderStyle): isDisplayFlexibleOrGridBox now a RenderStyle function.
1767         (WebCore::isDisplayFlexibleBox): Deleted. Moved to RenderStyle.
1768         (WebCore::isDisplayGridBox): Deleted. Moved to RenderStyle.
1769         (WebCore::isDisplayFlexibleOrGridBox): Deleted. Moved to RenderStyle.
1770         * rendering/RenderBox.cpp:
1771         (WebCore::flexItemHasStretchAlignment): Adapted to the new ItemPostition enum.
1772         * rendering/RenderFlexibleBox.cpp:
1773         (WebCore::RenderFlexibleBox::firstLineBaseline): Adapted to the new ItemPostition enum.
1774         (WebCore::RenderFlexibleBox::styleDidChange): Adapted to the new ItemPostition enum.
1775         (WebCore::RenderFlexibleBox::alignmentForChild): Adapted to the new ItemPostition enum.
1776         (WebCore::RenderFlexibleBox::needToStretchChild): Adapted to the new ItemPostition enum.
1777         (WebCore::RenderFlexibleBox::layoutAndPlaceChildren): Adapted to the new ItemPostition enum.
1778         (WebCore::RenderFlexibleBox::alignChildren): Adapted to the new ItemPostition enum.
1779         (WebCore::resolveAlignment): Deleted. Moved to RenderStyle.
1780         * rendering/RenderFlexibleBox.h:
1781         * rendering/RenderFullScreen.cpp:
1782         (WebCore::createFullScreenStyle): Adapted to the new ItemPostition enum.
1783         * rendering/RenderMenuList.cpp:
1784         (WebCore::RenderMenuList::adjustInnerStyle): Adapted to the new ItemPostition enum.
1785         * rendering/mathml/RenderMathMLRoot.cpp:
1786         (WebCore::RenderMathMLRoot::updateStyle): Adapted to the new ItemPostition enum.
1787         * rendering/mathml/RenderMathMLScripts.cpp:
1788         (WebCore::RenderMathMLScripts::fixAnonymousStyleForSubSupPair): Adapted to the new ItemPostition enum.
1789         (WebCore::RenderMathMLScripts::fixAnonymousStyles): Adapted to the new ItemPostition enum.
1790         * rendering/style/ContentData.h:
1791         * rendering/style/RenderStyle.cpp:
1792         (WebCore::RenderStyle::resolveAlignment): Added.
1793         * rendering/style/RenderStyle.h: Adapted to the new ItemPostition enum.
1794         * rendering/style/RenderStyleConstants.h: Adapted to the new ItemPostition enum.
1795         * rendering/style/StyleRareNonInheritedData.cpp: Adapted to the new ItemPostition enum.
1796         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): Adapted to the new ItemPostition enum.
1797         (WebCore::StyleRareNonInheritedData::operator==): Adapted to the new ItemPostition enum.
1798         * rendering/style/StyleRareNonInheritedData.h: Adapted to the new ItemPostition enum.
1799         * style/StyleResolveTree.cpp:
1800         (WebCore::Style::determineChange): Changes in the alignItems property cause a Detach.
1801
1802 2015-03-27  David Hyatt  <hyatt@apple.com>
1803
1804         [New Block-Inside-Inline Model] Create anonymous inline blocks to hold blocks-inside-inlines.
1805         https://bugs.webkit.org/show_bug.cgi?id=143145
1806
1807         Reviewed by Dean Jackson.
1808
1809         Added fast/block/inside-inlines/ tests.
1810
1811         * rendering/RenderBlock.cpp:
1812         (WebCore::RenderBlock::renderName):
1813         Add support for labeling anonymous inline-blocks when dumped by the render tree.
1814
1815         * rendering/RenderInline.cpp:
1816         (WebCore::RenderInline::addChildIgnoringContinuation):
1817         When the pref is set to use the new block-inside-inline model, create an anonymous inline block to
1818         hold block children of RenderInlines instead of splitting flows or creating continuations.
1819
1820         * rendering/RenderObject.h:
1821         (WebCore::RenderObject::isAnonymousInlineBlock):
1822         Add the definition of isAnonymousInlineBlock (note the exclusion of Ruby, since Ruby creates anonymous
1823         inline-blocks also).
1824
1825 2015-03-30  Chris Dumez  <cdumez@apple.com>
1826
1827         [WK2][NetworkCache] Add support for "Cache-Control: max-stale" request header
1828         https://bugs.webkit.org/show_bug.cgi?id=143159
1829         <rdar://problem/20333296>
1830
1831         Reviewed by Antti Koivisto.
1832
1833         Add support for "Cache-Control: max-stale" request header:
1834         https://tools.ietf.org/html/rfc7234#section-5.2.1.2
1835
1836         Test: http/tests/cache/disk-cache/disk-cache-request-max-stale.html
1837
1838         * platform/network/CacheValidation.cpp:
1839         (WebCore::parseCacheControlDirectives):
1840         * platform/network/CacheValidation.h:
1841
1842 2015-03-30  Simon Fraser  <simon.fraser@apple.com>
1843
1844         Fix iOS internal build after r182132.
1845
1846         * page/scrolling/ScrollingCoordinator.cpp:
1847         (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion):
1848
1849 2015-03-30  Jer Noble  <jer.noble@apple.com>
1850
1851         [iOS] When Web Audio is interrupted by a phone call, it cannot be restarted.
1852         https://bugs.webkit.org/show_bug.cgi?id=143190
1853
1854         Reviewed by Darin Adler.
1855
1856         Tests: webaudio/audiocontext-state-interrupted.html
1857                webaudio/audiocontext-state.html
1858
1859         Implement the following methods and properties from the Web Audio spec:
1860         close(), suspend(), resume(), onstatechange.
1861
1862         AudioContext will take more responsibility for tracking state and interruptions (and
1863         AudioDestination will give up that responsibility). This means AudioContext must be a
1864         MediaSessionClient, and own its own MediaSession. In return, AudioDestinationIOS and 
1865         AudioDestinationMac relinquish both.
1866
1867         * Modules/webaudio/AudioContext.cpp:
1868         (WebCore::AudioContext::AudioContext): Set default values in header.
1869         (WebCore::AudioContext::uninitialize): Call setState() instead of setting m_state.
1870         (WebCore::AudioContext::addReaction): Added. Append the callback to the appropriate vector for the state.
1871         (WebCore::AudioContext::setState): Added. Fire events and resolve the appropriate reaction callbacks for the new state.
1872         (WebCore::AudioContext::state): Return a string representing the context's state.
1873         (WebCore::AudioContext::stop): Close the event queue.
1874         (WebCore::AudioContext::startRendering): Call setState().
1875         (WebCore::AudioContext::fireCompletionEvent): Call setState().
1876         (WebCore::AudioContext::suspendContext): Added. Add reaction callback and call suspend() on the destination node.
1877         (WebCore::AudioContext::resumeContext): Added. Add reaction callback and call resume() on the destination node.
1878         (WebCore::AudioContext::closeContext): Added. Add reaction callback and call close() on the destination node.
1879         (WebCore::AudioContext::suspendPlayback): Added. Suspend playback and set state to interrupted.
1880         (WebCore::AudioContext::mayResumePlayback): Added. Conditionally resume playback.
1881         * bindings/js/JSAudioContextCustom.cpp:
1882         (WebCore::JSAudioContext::suspend): Added. Create and return a new Promise object.
1883         (WebCore::JSAudioContext::resume): Ditto.
1884         (WebCore::JSAudioContext::close): Ditto.
1885         * Modules/webaudio/AudioContext.idl: Add new methods and properties.
1886
1887         Extensive organizational changes were made to AudioContext.h to group instance
1888         variables together and add C++11 initializers in their declarations:
1889
1890         * Modules/webaudio/AudioContext.h:
1891         (WebCore::AudioContext::mediaType): Moved from AudioDestinationNode.
1892         (WebCore::AudioContext::presentationType): Ditto.
1893         (WebCore::AudioContext::canReceiveRemoteControlCommands): Ditto.
1894         (WebCore::AudioContext::didReceiveRemoteControlCommand): Ditto.
1895         (WebCore::AudioContext::overrideBackgroundPlaybackRestriction): Ditto.
1896         
1897         Other changes to support the new AudioContext methods:
1898
1899         * Modules/webaudio/AudioDestinationNode.h:
1900         (WebCore::AudioDestinationNode::resume): Add empty default virtual method.
1901         (WebCore::AudioDestinationNode::suspend): Ditto.
1902         (WebCore::AudioDestinationNode::close): Ditto.
1903         * Modules/webaudio/DefaultAudioDestinationNode.cpp:
1904         (WebCore::DefaultAudioDestinationNode::resume): Added. Pass to AudioDestination.
1905         (WebCore::DefaultAudioDestinationNode::suspend): Ditto.
1906         (WebCore::DefaultAudioDestinationNode::close): Ditto.
1907         * Modules/webaudio/DefaultAudioDestinationNode.h:
1908         * bindings/js/JSDOMPromise.h:
1909         (WebCore::DeferredWrapper::resolve): Add an overload for a nullptr resolve value.
1910         * dom/EventNames.h: Added 'statechange'.
1911         * dom/ScriptExecutionContext.h:
1912         (WebCore::ScriptExecutionContext::Task::Task): Add a constructor which takes a void() callback.
1913
1914         Modify MediaSession, AudioSession, and MediaSessionManager to support the new
1915         interruption behavior.
1916
1917         * html/HTMLMediaElement.cpp:
1918         (WebCore::HTMLMediaElement::suspendPlayback): Renamed from pausePlayback().
1919         (WebCore::HTMLMediaElement::mayResumePlayback): Renamed from resumePlayback().
1920         * html/HTMLMediaElement.h:
1921         * platform/audio/AudioSession.cpp:
1922         (WebCore::AudioSession::tryToSetActive): Renamed from setActive. Return true by default.
1923         (WebCore::AudioSession::setActive): Deleted.
1924         * platform/audio/AudioSession.h:
1925         * platform/audio/MediaSession.cpp:
1926         (WebCore::MediaSession::beginInterruption): pausePlayback() was renamed to suspendPlayback().
1927         (WebCore::MediaSession::endInterruption): Always notify the client, telling it whether to resume.
1928         (WebCore::MediaSession::clientWillBeginPlayback): Bail early if reentrant.  Check the (new) 
1929             return value of sessionWillBeginPlayback() and remember to resume once the interruption ends.
1930         (WebCore::MediaSession::clientWillPausePlayback): Bail early if reentrant.
1931         (WebCore::MediaSession::pauseSession): pausePlayback() was renamed to suspendPlayback().
1932         * platform/audio/MediaSession.h:
1933         * platform/audio/MediaSessionManager.cpp:
1934         (WebCore::MediaSessionManager::sessionWillBeginPlayback): Return false if not allowed to break interruption or 
1935             if activating the audio session failed. Otherwise, end the interruption.
1936         * platform/audio/MediaSessionManager.h:
1937         * platform/audio/ios/AudioDestinationIOS.cpp:
1938         (WebCore::AudioDestinationIOS::AudioDestinationIOS): m_mediaSession was removed.
1939         (WebCore::AudioDestinationIOS::start): Ditto.
1940         * platform/audio/ios/AudioDestinationIOS.h:
1941         * platform/audio/ios/AudioSessionIOS.mm:
1942         (WebCore::AudioSession::tryToSetActive): Renamed from setActive. Return false if the AVAudioSession could not be activated.
1943         (WebCore::AudioSession::setActive): Deleted.
1944         * platform/audio/ios/MediaSessionManagerIOS.h:
1945         * platform/audio/ios/MediaSessionManagerIOS.mm:
1946         (WebCore::MediaSessionManageriOS::sessionWillBeginPlayback): Do not update the now playing info if session playback was blocked.
1947         * platform/audio/mac/AudioDestinationMac.cpp:
1948         (WebCore::AudioDestinationMac::AudioDestinationMac): m_mediaSession was removed.
1949         * platform/audio/mac/AudioDestinationMac.h:
1950         * platform/audio/mac/AudioSessionMac.cpp:
1951         (WebCore::AudioSession::tryToSetActive): Renamed from setActive(). Return true by default.
1952         (WebCore::AudioSession::setActive): Deleted.
1953         * platform/audio/mac/MediaSessionManagerMac.cpp:
1954         (MediaSessionManager::updateSessionState): No longer attempt to activate the session, as this is done
1955             MediaSessionManager::sessionWillBeginPlayback().
1956         * testing/Internals.cpp:
1957         (WebCore::Internals::setMediaSessionRestrictions): Add "InterruptedPlaybackNotPermitted".
1958
1959 2015-03-25 Xabier Rodriguez Calvar <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
1960
1961         [Streams API] Error storage should be moved from source to stream/reader
1962         https://bugs.webkit.org/show_bug.cgi?id=143048
1963
1964         Reviewed by Benjamin Poulain.
1965
1966         This patch removes error storage from the source as it should be stored at the stream level as error access goes through the reader.
1967         It removes abstract ReadableStreamSource::isErrored and the storage of JavaScript errors from ReadableStreamJSSource.
1968
1969         Existing tests cover most of the changes.
1970         Added test case for creating readable stream from empty JS object.
1971
1972         * Modules/streams/ReadableStreamSource.h: Removing isErrored().
1973         * bindings/js/JSReadableStreamCustom.cpp:
1974         (WebCore::constructJSReadableStream): Added JS stream constructor parameters checking.
1975         * bindings/js/ReadableStreamJSSource.cpp:
1976         (WebCore::ReadableStreamJSSource::ReadableStreamJSSource): Removed JS stream constructor parameters checking.
1977         (WebCore::ReadableStreamJSSource::start): Changed prototype of start so that start can throw errors directly.
1978         (WebCore::ReadableStreamJSSource::setInternalError): Deleted.
1979         * bindings/js/ReadableStreamJSSource.h: Removed m_error, setInternalError and updated start declaration.
1980
1981 2015-03-30  Philippe Normand  <pnormand@igalia.com>
1982
1983         [GStreamer] More GL shared context fixes
1984         https://bugs.webkit.org/show_bug.cgi?id=143216
1985
1986         Reviewed by Carlos Garcia Campos.
1987
1988         Moved the GLX/EGL context tests to be done at runtime rather than
1989         using build-time macros because in the GTK port at least, both EGL
1990         and GLX support are mutually exclusive. Also fixed a couple wrong
1991         defines (USE(GLES2) doesn't exist).
1992
1993         * platform/graphics/GLContext.h: Simple utility method to check if
1994         the platform context is compatible with EGL APIs or not.
1995         * platform/graphics/egl/GLContextEGL.h:
1996         (WebCore::GLContextEGL::isEGLContext):
1997         * platform/graphics/glx/GLContextGLX.h:
1998         (WebCore::GLContextGLX::isEGLContext):
1999         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2000         (WebCore::MediaPlayerPrivateGStreamer::ensureGstGLContext): Do
2001         runtime checks and properly ensure GLES2/GL API usage.
2002
2003 2015-03-30  Marcos Chavarría Teijeiro  <chavarria1991@gmail.com>
2004
2005         Add support for deleting emoji on GTK
2006         https://bugs.webkit.org/show_bug.cgi?id=141419
2007
2008         Reviewed by Gustavo Noronha Silva.
2009
2010         The code for deleting special group of characters was specific for
2011         COCOA and EFL platforms. The fix consists on add GTK to the #if
2012         preprocessor directive.
2013
2014         * rendering/RenderText.cpp:
2015         (WebCore::RenderText::previousOffsetForBackwardDeletion):
2016
2017 2015-03-30  Benjamin Poulain  <benjamin@webkit.org>
2018
2019         Start the features.json files
2020         https://bugs.webkit.org/show_bug.cgi?id=143207
2021
2022         Reviewed by Darin Adler.
2023
2024         * features.json: Added.
2025
2026 2015-03-29  Simon Fraser  <simon.fraser@apple.com>
2027
2028         Convert arguments to ScrollingCoordinator functions to references
2029         https://bugs.webkit.org/show_bug.cgi?id=143198
2030
2031         Reviewed by Darin Adler.
2032
2033         Convert all the FrameView* and ScrollableArea* arguments to ScrollingCoordinator functions to
2034         references, and use references in a few other places.
2035
2036         * dom/Document.cpp:
2037         (WebCore::wheelEventHandlerCountChanged):
2038         * loader/HistoryController.cpp:
2039         (WebCore::HistoryController::restoreScrollPositionAndViewState):
2040         * page/DebugPageOverlays.cpp:
2041         (WebCore::NonFastScrollableRegionOverlay::updateRegion):
2042         * page/Frame.cpp:
2043         (WebCore::Frame::willDetachPage):
2044         * page/FrameView.cpp:
2045         (WebCore::FrameView::prepareForDetach):
2046         (WebCore::FrameView::addSlowRepaintObject):
2047         (WebCore::FrameView::removeSlowRepaintObject):
2048         (WebCore::FrameView::addViewportConstrainedObject):
2049         (WebCore::FrameView::removeViewportConstrainedObject):
2050         (WebCore::FrameView::requestScrollPositionUpdate):
2051         (WebCore::FrameView::performPostLayoutTasks):
2052         (WebCore::FrameView::scrollableAreaSetChanged):
2053         (WebCore::FrameView::wheelEvent):
2054         * page/Page.cpp:
2055         (WebCore::Page::nonFastScrollableRects):
2056         * page/Page.h:
2057         * page/scrolling/AsyncScrollingCoordinator.cpp:
2058         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
2059         (WebCore::AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged):
2060         (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
2061         (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
2062         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
2063         (WebCore::AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange):
2064         (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
2065         (WebCore::AsyncScrollingCoordinator::updateMainFrameScrollLayerPosition):
2066         (WebCore::AsyncScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView):
2067         * page/scrolling/AsyncScrollingCoordinator.h:
2068         * page/scrolling/ScrollingCoordinator.cpp:
2069         (WebCore::ScrollingCoordinator::pageDestroyed):
2070         (WebCore::ScrollingCoordinator::coordinatesScrollingForFrameView):
2071         (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion):
2072         (WebCore::ScrollingCoordinator::frameViewWheelEventHandlerCountChanged):
2073         (WebCore::ScrollingCoordinator::frameViewHasSlowRepaintObjectsDidChange):
2074         (WebCore::ScrollingCoordinator::frameViewFixedObjectsDidChange):
2075         (WebCore::ScrollingCoordinator::scrollLayerForScrollableArea):
2076         (WebCore::ScrollingCoordinator::scrollLayerForFrameView):
2077         (WebCore::ScrollingCoordinator::headerLayerForFrameView):
2078         (WebCore::ScrollingCoordinator::footerLayerForFrameView):
2079         (WebCore::ScrollingCoordinator::counterScrollingLayerForFrameView):
2080         (WebCore::ScrollingCoordinator::insetClipLayerForFrameView):
2081         (WebCore::ScrollingCoordinator::contentShadowLayerForFrameView):
2082         (WebCore::ScrollingCoordinator::rootContentLayerForFrameView):
2083         (WebCore::ScrollingCoordinator::frameViewRootLayerDidChange):
2084         (WebCore::ScrollingCoordinator::hasVisibleSlowRepaintViewportConstrainedObjects):
2085         (WebCore::ScrollingCoordinator::synchronousScrollingReasons):
2086         (WebCore::ScrollingCoordinator::updateSynchronousScrollingReasons):
2087         (WebCore::ScrollingCoordinator::setForceSynchronousScrollLayerPositionUpdates):
2088         (WebCore::ScrollingCoordinator::shouldUpdateScrollLayerPositionSynchronously):
2089         (WebCore::ScrollingCoordinator::replaySessionStateDidChange):
2090         (WebCore::ScrollingCoordinator::synchronousScrollingReasonsAsText):
2091         * page/scrolling/ScrollingCoordinator.h: Align the bitmask enums to make mistakes easier to spot.
2092         (WebCore::ScrollingCoordinator::frameViewLayoutUpdated):
2093         (WebCore::ScrollingCoordinator::frameViewNonFastScrollableRegionChanged):
2094         (WebCore::ScrollingCoordinator::requestScrollPositionUpdate):
2095         (WebCore::ScrollingCoordinator::handleWheelEvent):
2096         (WebCore::ScrollingCoordinator::willDestroyScrollableArea):
2097         (WebCore::ScrollingCoordinator::scrollableAreaScrollLayerDidChange):
2098         (WebCore::ScrollingCoordinator::scrollableAreaScrollbarLayerDidChange):
2099         (WebCore::ScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView):
2100         * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
2101         (WebCore::ScrollingCoordinatorCoordinatedGraphics::scrollableAreaScrollLayerDidChange):
2102         (WebCore::ScrollingCoordinatorCoordinatedGraphics::willDestroyScrollableArea):
2103         (WebCore::ScrollingCoordinatorCoordinatedGraphics::requestScrollPositionUpdate):
2104         * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h:
2105         * page/scrolling/ios/ScrollingCoordinatorIOS.h:
2106         * page/scrolling/mac/ScrollingCoordinatorMac.h:
2107         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
2108         (WebCore::ScrollingCoordinatorMac::handleWheelEvent):
2109         * rendering/RenderLayer.cpp:
2110         (WebCore::RenderLayer::~RenderLayer):
2111         * rendering/RenderLayerBacking.cpp:
2112         (WebCore::RenderLayerBacking::updateOverflowControlsLayers):
2113         * rendering/RenderLayerCompositor.cpp:
2114         (WebCore::RenderLayerCompositor::updateBacking):
2115         (WebCore::RenderLayerCompositor::hasCoordinatedScrolling):
2116         (WebCore::RenderLayerCompositor::scrollingLayerDidChange):
2117         (WebCore::RenderLayerCompositor::updateLayerForHeader):
2118         (WebCore::RenderLayerCompositor::updateLayerForFooter):
2119         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
2120         (WebCore::RenderLayerCompositor::destroyRootLayer):
2121         (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
2122         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
2123         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
2124         (WebCore::RenderLayerCompositor::didAddScrollingLayer):
2125         * testing/Internals.cpp:
2126         (WebCore::Internals::nonFastScrollableRects):
2127
2128 2015-03-29  Benjamin Poulain  <benjamin@webkit.org>
2129
2130         Use :matches() instead of :-webkit-any() for the sections and headings default style
2131         https://bugs.webkit.org/show_bug.cgi?id=143197
2132
2133         Reviewed by Darin Adler.
2134
2135         We no longer need to use the :-webkit-any() hack in the default stylesheet.
2136
2137         The pseudo class :matches() also support correct specificity. This is not observable
2138         since those selector do not conflict with any other rule in the default stylesheet.
2139
2140         * css/CSSSelector.h:
2141         * css/SelectorChecker.cpp:
2142         (WebCore::SelectorChecker::determineLinkMatchType):
2143         * css/html.css:
2144         (:matches(article, aside, nav, section) h1):
2145         (:matches(article, aside, nav, section) :matches(article, aside, nav, section) h1):
2146         (:matches(article, aside, nav, section) :matches(article, aside, nav, section) :matches(article, aside, nav, section) h1):
2147         (:matches(article, aside, nav, section) :matches(article, aside, nav, section) :matches(article, aside, nav, section) :matches(article, aside, nav, section) h1):
2148         (: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):
2149         (:-webkit-any(article,aside,nav,section) h1): Deleted.
2150         (:-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) h1): Deleted.
2151         (:-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) h1): Deleted.
2152         (:-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.
2153         (:-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.
2154
2155 2015-03-29  Benjamin Poulain  <benjamin@webkit.org>
2156
2157         `currentColor` computes to the same colour on all elements, even if 'color' is inherited differently
2158         https://bugs.webkit.org/show_bug.cgi?id=133420
2159
2160         Reviewed by Darin Adler.
2161
2162         When resolving a style with the help of the property cache, we were
2163         completely ignoring currentColor.
2164
2165         Since you can set currentColor on properties that are not inherited,
2166         those properties would just be copied from the cached style, which
2167         may have a completely different inherited color.
2168
2169         This pacth fixes the issue by preventing any MatchResult from hitting
2170         the cache if it contains any non-inherited property that would require
2171         resolution by the cache:
2172         -Using the inherit value.
2173         -Using the currentColor value.
2174
2175         Tests: fast/css/currentColor-on-before-after-pseudo-elements.html
2176                fast/css/currentColor-style-update-reftest.html
2177                fast/css/currentColor-value-style-update.html
2178
2179         * css/ElementRuleCollector.cpp:
2180         (WebCore::ElementRuleCollector::addElementStyleProperties):
2181         (WebCore::ElementRuleCollector::matchAuthorRules):
2182         (WebCore::ElementRuleCollector::matchUserRules):
2183         (WebCore::ElementRuleCollector::matchUARules):
2184         * css/StyleResolver.cpp:
2185         (WebCore::StyleResolver::MatchResult::addMatchedProperties):
2186         (WebCore::StyleResolver::styleForKeyframe):
2187         (WebCore::StyleResolver::pseudoStyleForElement):
2188         (WebCore::StyleResolver::styleForPage):
2189         (WebCore::StyleResolver::findFromMatchedPropertiesCache):
2190         (WebCore::StyleResolver::addToMatchedPropertiesCache):
2191         (WebCore::extractDirectionAndWritingMode):
2192         (WebCore::StyleResolver::applyMatchedProperties):
2193         (WebCore::StyleResolver::CascadedProperties::addStyleProperties):
2194         (WebCore::StyleResolver::CascadedProperties::addMatches):
2195         * css/StyleResolver.h:
2196         (WebCore::StyleResolver::MatchResult::matchedProperties):
2197
2198 2015-03-29  Benjamin Poulain  <benjamin@webkit.org>
2199
2200         Enable :any-link by default
2201         https://bugs.webkit.org/show_bug.cgi?id=143201
2202
2203         Reviewed by Sam Weinig.
2204
2205         The pseudo class :any-link has been stable for a while. This patch enables
2206         it by default and remove the -webkit- prefix on the default style.
2207
2208         * css/CSSDefaultStyleSheets.cpp:
2209         * css/CSSSelector.cpp:
2210         (WebCore::CSSSelector::selectorText):
2211         * css/CSSSelector.h:
2212         * css/RuleSet.cpp:
2213         (WebCore::RuleSet::addRule):
2214         * css/SelectorChecker.cpp:
2215         (WebCore::SelectorChecker::checkOne):
2216         * css/SelectorChecker.h:
2217         (WebCore::SelectorChecker::isCommonPseudoClassSelector):
2218         * css/SelectorPseudoClassAndCompatibilityElementMap.in:
2219         * css/html.css:
2220         (a:any-link):
2221         (a:any-link:active):
2222         (:any-link img):
2223         (a:-webkit-any-link): Deleted.
2224         (a:-webkit-any-link:active): Deleted.
2225         (:-webkit-any-link img): Deleted.
2226         * cssjit/SelectorCompiler.cpp:
2227         (WebCore::SelectorCompiler::addPseudoClassType):
2228         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementLinkMatching):
2229
2230 2015-03-29  Joonghun Park  <jh718.park@samsung.com>
2231
2232         nullptr cleanup in RenderFooBox classes
2233         https://bugs.webkit.org/show_bug.cgi?id=143182
2234
2235         Reviewed by Ryosuke Niwa.
2236
2237         No new tests, no behavior changes
2238
2239         Replace 0 with nullptr in RenderFooBox classes.
2240
2241         * rendering/RenderBox.cpp:
2242         (WebCore::RenderBox::RenderBox):
2243         (WebCore::RenderBox::paintFillLayer):
2244         (WebCore::RenderBox::shrinkLogicalWidthToAvoidFloats):
2245         (WebCore::RenderBox::containingBlockAvailableLineWidthInRegion):
2246         (WebCore::RenderBox::renderBoxRegionInfo):
2247         (WebCore::RenderBox::computePositionedLogicalWidthUsing):
2248         (WebCore::RenderBox::computePositionedLogicalHeightUsing):
2249         (WebCore::RenderBox::computePositionedLogicalWidthReplaced):
2250         (WebCore::RenderBox::positionForPoint):
2251         (WebCore::RenderBox::layoutOverflowRectForPropagation):
2252         * rendering/RenderBox.h:
2253         (WebCore::RenderBox::setMarginBefore):
2254         (WebCore::RenderBox::setMarginAfter):
2255         (WebCore::RenderBox::setMarginStart):
2256         (WebCore::RenderBox::setMarginEnd):
2257         (WebCore::RenderBox::createAnonymousBoxWithSameTypeAs):
2258         (WebCore::RenderBox::setInlineBoxWrapper):
2259         * rendering/RenderBoxModelObject.cpp:
2260         (WebCore::RenderBoxModelObject::willBeDestroyed):
2261         (WebCore::RenderBoxModelObject::paintMaskForTextFillBox):
2262         (WebCore::RenderBoxModelObject::paintBorderSides):
2263         (WebCore::RenderBoxModelObject::firstLetterRemainingText):
2264         * rendering/RenderBoxModelObject.h:
2265         (WebCore::RenderBoxModelObject::moveChildTo):
2266         (WebCore::RenderBoxModelObject::moveAllChildrenTo):
2267         (WebCore::RenderBoxModelObject::moveChildrenTo):
2268         * rendering/RenderDeprecatedFlexibleBox.cpp:
2269         (WebCore::FlexBoxIterator::reset):
2270         (WebCore::FlexBoxIterator::next):
2271         * rendering/RenderDeprecatedFlexibleBox.h:
2272         * rendering/RenderFlexibleBox.cpp:
2273         (WebCore::RenderFlexibleBox::firstLineBaseline):
2274         (WebCore::RenderFlexibleBox::computeMainAxisExtentForChild):
2275         * rendering/RenderLineBoxList.cpp:
2276         (WebCore::RenderLineBoxList::deleteLineBoxTree):
2277         (WebCore::RenderLineBoxList::extractLineBox):
2278         (WebCore::RenderLineBoxList::deleteLineBoxes):
2279         (WebCore::RenderLineBoxList::checkConsistency):
2280         * rendering/RenderLineBoxList.h:
2281         (WebCore::RenderLineBoxList::RenderLineBoxList):
2282         * rendering/RenderListBox.cpp:
2283         (WebCore::RenderListBox::enclosingScrollableArea):
2284         (WebCore::RenderListBox::setHasVerticalScrollbar):
2285         * rendering/RenderListBox.h:
2286
2287 2015-03-29  Darin Adler  <darin@apple.com>
2288
2289         HTMLCollection caches incorrect length if item(0) is called before length on an empty collection
2290         https://bugs.webkit.org/show_bug.cgi?id=143203
2291         rdar://problem/18460462
2292
2293         Reviewed by Antti Koivisto.
2294
2295         Test: fast/dom/htmlcollection-length-after-item-2.html
2296
2297         * dom/CollectionIndexCache.h:
2298         (CollectionIndexCache::nodeAt): If we hit the end looking for index 0, cache a length
2299         of 0, not a length of 1.
2300
2301 2015-03-29  Darin Adler  <darin@apple.com>
2302
2303         Remove unneeded SVG code, including most isSupportedAttribute functions
2304         https://bugs.webkit.org/show_bug.cgi?id=143194
2305
2306         Reviewed by Antti Koivisto.
2307
2308         - Removed most implementations of isSupportedAttribute. Others can be removed in
2309           future patches. The ones left behind are now all private static member functions.
2310           It's dangerous for them to be public because they tend to indicate which attributes
2311           are supported at a particular level in the class hierarchy and they are not virtual
2312           functions; might want to rethink the function name if we keep any of these long term.
2313
2314         - Removed unneeded includes, especially of Attr.h and Attribute.h.
2315
2316         - Changed most parseAttribute and svgAttributeChanged functions so they no longer
2317           rely on checking attribute names against a set. Also removed lots of unneeded calls
2318           to SVGLangSpace::parseAttribute, which is called by SVGElement::parseAttribute and
2319           need not be called by derived classes.
2320
2321         - Removed return values from parseAttribute functions. Skipping other parseAttribute
2322           logic is not an important optimization and makes functions needlessly complex.
2323
2324         - Moved use of InstanceInvalidationGuard closer to where they are needed. Eventually
2325           we may be able to remove many of these.
2326
2327         - Used auto in a few places where the same type is repeated twice on the same line of
2328           code, and auto makes it a bit smaller.
2329
2330         - Got rid of protected sections in some final classes; doesn't make sense to combine
2331           these two. Also moved a few functions from protected to private in other classes.
2332
2333         - Made a number of functions into static member functions in the base classes such
2334           as SVGLangSpace; they were not making any use of the object, and so it was wasteful
2335           to compile them as non-static member functions.
2336
2337         * rendering/svg/RenderSVGImage.cpp: Removed unneeded includes.
2338         * svg/SVGAElement.cpp: Removed unneeded includes.
2339         (WebCore::SVGAElement::isSupportedAttribute): Deleted.
2340         (WebCore::SVGAElement::parseAttribute): Don't use isSupportedAttribute.
2341         (WebCore::SVGAElement::svgAttributeChanged): Don't use isSupportedAttribute.
2342         * svg/SVGAElement.h: Removed isSupportedAttribute.
2343         * svg/SVGAnimateMotionElement.cpp: Removed unneeded includes.
2344         (WebCore::SVGAnimateMotionElement::isSupportedAttribute): Deleted.
2345         (WebCore::SVGAnimateMotionElement::parseAttribute): Don't use isSupportedAttribute.
2346         * svg/SVGAnimateMotionElement.h: Removed isSupportedAttribute.
2347         * svg/SVGAnimateTransformElement.cpp:
2348         (WebCore::SVGAnimateTransformElement::isSupportedAttribute): Deleted.
2349         (WebCore::SVGAnimateTransformElement::parseAttribute): Don't use isSupportedAttribute.
2350         * svg/SVGAnimateTransformElement.h: Removed isSupportedAttribute.
2351         * svg/SVGAnimationElement.cpp:
2352         (WebCore::SVGAnimationElement::parseAttribute): Don't use isSupportedAttribute.
2353         * svg/SVGCircleElement.cpp:
2354         (WebCore::SVGCircleElement::isSupportedAttribute): Deleted.
2355         (WebCore::SVGCircleElement::parseAttribute): Don't use isSupportedAttribute.
2356         (WebCore::SVGCircleElement::svgAttributeChanged): Don't use isSupportedAttribute.
2357         * svg/SVGCircleElement.h: Removed isSupportedAttribute.
2358         * svg/SVGClipPathElement.cpp: Removed unneeded includes.
2359         (WebCore::SVGClipPathElement::parseAttribute): Don't use isSupportedAttribute.
2360         * svg/SVGComponentTransferFunctionElement.cpp:
2361         (WebCore::SVGComponentTransferFunctionElement::parseAttribute): Don't use isSupportedAttribute.
2362         * svg/SVGCursorElement.cpp: Removed unneeded includes.
2363         (WebCore::SVGCursorElement::parseAttribute): Don't use isSupportedAttribute.
2364         (WebCore::SVGCursorElement::svgAttributeChanged): Don't use isSupportedAttribute.
2365         * svg/SVGElement.cpp: Removed unneeded includes.
2366         * svg/SVGEllipseElement.cpp: Removed unneeded includes.
2367         (WebCore::SVGEllipseElement::isSupportedAttribute): Deleted.
2368         (WebCore::SVGEllipseElement::parseAttribute): Don't use isSupportedAttribute.
2369         (WebCore::SVGEllipseElement::svgAttributeChanged): Don't use isSupportedAttribute.
2370         * svg/SVGEllipseElement.h: Removed isSupportedAttribute.
2371         * svg/SVGExternalResourcesRequired.cpp: Removed unneeded includes.
2372         (WebCore::SVGExternalResourcesRequired::parseAttribute): Don't return a boolean.
2373         * svg/SVGExternalResourcesRequired.h: Don't return a boolean.
2374         * svg/SVGFEBlendElement.cpp: Removed unneeded includes.
2375         (WebCore::SVGFEBlendElement::isSupportedAttribute): Deleted.
2376         (WebCore::SVGFEBlendElement::parseAttribute): Don't use isSupportedAttribute.
2377         (WebCore::SVGFEBlendElement::svgAttributeChanged): Don't use isSupportedAttribute.
2378         * svg/SVGFEBlendElement.h: Removed isSupportedAttribute.
2379         * svg/SVGFEColorMatrixElement.cpp: Removed unneeded includes.
2380         (WebCore::SVGFEColorMatrixElement::isSupportedAttribute): Deleted.
2381         (WebCore::SVGFEColorMatrixElement::parseAttribute): Don't use isSupportedAttribute.
2382         (WebCore::SVGFEColorMatrixElement::svgAttributeChanged): Don't use isSupportedAttribute.
2383         * svg/SVGFEColorMatrixElement.h: Removed isSupportedAttribute.
2384         * svg/SVGFEComponentTransferElement.cpp: Removed unneeded includes.
2385         (WebCore::SVGFEComponentTransferElement::isSupportedAttribute): Deleted.
2386         (WebCore::SVGFEComponentTransferElement::parseAttribute): Don't use isSupportedAttribute.
2387         * svg/SVGFEComponentTransferElement.h: Removed unneeded includes.
2388         * svg/SVGFECompositeElement.cpp: Removed unneeded includes.
2389         (WebCore::SVGFECompositeElement::isSupportedAttribute): Deleted.
2390         (WebCore::SVGFECompositeElement::parseAttribute): Don't use isSupportedAttribute.
2391         (WebCore::SVGFECompositeElement::svgAttributeChanged): Don't use isSupportedAttribute.
2392         * svg/SVGFECompositeElement.h:
2393         * svg/SVGFEConvolveMatrixElement.cpp: Removed unneeded includes.
2394         (WebCore::SVGFEConvolveMatrixElement::isSupportedAttribute): Deleted.
2395         (WebCore::SVGFEConvolveMatrixElement::parseAttribute): Don't use isSupportedAttribute.
2396         (WebCore::SVGFEConvolveMatrixElement::svgAttributeChanged): Don't use isSupportedAttribute.
2397         * svg/SVGFEConvolveMatrixElement.h:
2398         * svg/SVGFEDiffuseLightingElement.cpp: Removed unneeded includes.
2399         (WebCore::SVGFEDiffuseLightingElement::isSupportedAttribute): Deleted.
2400         (WebCore::SVGFEDiffuseLightingElement::parseAttribute): Don't use isSupportedAttribute.
2401         (WebCore::SVGFEDiffuseLightingElement::svgAttributeChanged): Don't use isSupportedAttribute.
2402         * svg/SVGFEDiffuseLightingElement.h:
2403         * svg/SVGFEDisplacementMapElement.cpp: Removed unneeded includes.
2404         (WebCore::SVGFEDisplacementMapElement::isSupportedAttribute): Deleted.
2405         (WebCore::SVGFEDisplacementMapElement::parseAttribute): Don't use isSupportedAttribute.
2406         (WebCore::SVGFEDisplacementMapElement::svgAttributeChanged): Don't use isSupportedAttribute.
2407         * svg/SVGFEDisplacementMapElement.h:
2408         * svg/SVGFEDropShadowElement.cpp: Removed unneeded includes.
2409         (WebCore::SVGFEDropShadowElement::isSupportedAttribute): Deleted.
2410         (WebCore::SVGFEDropShadowElement::parseAttribute): Don't use isSupportedAttribute.
2411         (WebCore::SVGFEDropShadowElement::svgAttributeChanged): Don't use isSupportedAttribute.
2412         * svg/SVGFEDropShadowElement.h:
2413         * svg/SVGFEFloodElement.cpp: Removed unneeded includes.
2414         * svg/SVGFEGaussianBlurElement.cpp: Removed unneeded includes.
2415         (WebCore::SVGFEGaussianBlurElement::isSupportedAttribute): Deleted.
2416         (WebCore::SVGFEGaussianBlurElement::parseAttribute): Don't use isSupportedAttribute.
2417         (WebCore::SVGFEGaussianBlurElement::svgAttributeChanged): Don't use isSupportedAttribute.
2418         * svg/SVGFEGaussianBlurElement.h:
2419         * svg/SVGFEImageElement.cpp: Removed unneeded includes.
2420         (WebCore::SVGFEImageElement::isSupportedAttribute): Deleted.
2421         (WebCore::SVGFEImageElement::parseAttribute): Don't use isSupportedAttribute.
2422         (WebCore::SVGFEImageElement::svgAttributeChanged): Don't use isSupportedAttribute.
2423         * svg/SVGFEImageElement.h:
2424         * svg/SVGFELightElement.cpp: Removed unneeded includes.
2425         (WebCore::SVGFELightElement::isSupportedAttribute): Deleted.
2426         (WebCore::SVGFELightElement::parseAttribute): Don't use isSupportedAttribute.
2427         (WebCore::SVGFELightElement::svgAttributeChanged): Don't use isSupportedAttribute.
2428         * svg/SVGFELightElement.h:
2429         * svg/SVGFEMergeNodeElement.cpp: Removed unneeded includes.
2430         (WebCore::SVGFEMergeNodeElement::isSupportedAttribute): Deleted.
2431         (WebCore::SVGFEMergeNodeElement::parseAttribute): Don't use isSupportedAttribute.
2432         (WebCore::SVGFEMergeNodeElement::svgAttributeChanged): Don't use isSupportedAttribute.
2433         * svg/SVGFEMergeNodeElement.h:
2434         * svg/SVGFEMorphologyElement.cpp: Removed unneeded includes.
2435         (WebCore::SVGFEMorphologyElement::isSupportedAttribute): Deleted.
2436         (WebCore::SVGFEMorphologyElement::parseAttribute): Don't use isSupportedAttribute.
2437         (WebCore::SVGFEMorphologyElement::svgAttributeChanged): Don't use isSupportedAttribute.
2438         * svg/SVGFEMorphologyElement.h:
2439         * svg/SVGFEOffsetElement.cpp: Removed unneeded includes.
2440         (WebCore::SVGFEOffsetElement::isSupportedAttribute): Deleted.
2441         (WebCore::SVGFEOffsetElement::parseAttribute): Don't use isSupportedAttribute.
2442         (WebCore::SVGFEOffsetElement::svgAttributeChanged): Don't use isSupportedAttribute.
2443         * svg/SVGFEOffsetElement.h:
2444         * svg/SVGFESpecularLightingElement.cpp: Removed unneeded includes.
2445         (WebCore::SVGFESpecularLightingElement::isSupportedAttribute): Deleted.
2446         (WebCore::SVGFESpecularLightingElement::parseAttribute): Don't use isSupportedAttribute.
2447         (WebCore::SVGFESpecularLightingElement::svgAttributeChanged): Don't use isSupportedAttribute.
2448         * svg/SVGFESpecularLightingElement.h:
2449         * svg/SVGFETileElement.cpp: Removed unneeded includes.
2450         (WebCore::SVGFETileElement::isSupportedAttribute): Deleted.
2451         (WebCore::SVGFETileElement::parseAttribute): Don't use isSupportedAttribute.
2452         (WebCore::SVGFETileElement::svgAttributeChanged): Don't use isSupportedAttribute.
2453         * svg/SVGFETileElement.h:
2454         * svg/SVGFETurbulenceElement.cpp: Removed unneeded includes.
2455         (WebCore::SVGFETurbulenceElement::isSupportedAttribute): Deleted.
2456         (WebCore::SVGFETurbulenceElement::parseAttribute): Don't use isSupportedAttribute.
2457         (WebCore::SVGFETurbulenceElement::svgAttributeChanged): Don't use isSupportedAttribute.
2458         * svg/SVGFETurbulenceElement.h:
2459         * svg/SVGFilterElement.cpp: Removed unneeded includes.
2460         (WebCore::SVGFilterElement::parseAttribute): Don't use isSupportedAttribute.
2461         * svg/SVGFilterPrimitiveStandardAttributes.cpp: Removed unneeded includes.
2462         (WebCore::SVGFilterPrimitiveStandardAttributes::parseAttribute): Don't use isSupportedAttribute.
2463         * svg/SVGFilterPrimitiveStandardAttributes.h: Removed isSupportedAttribute and also moved a
2464         couple functions out of the class definition.
2465         * svg/SVGFitToViewBox.cpp: Removed unneeded includes.
2466         * svg/SVGFontFaceElement.cpp: Removed unneeded includes.
2467         * svg/SVGFontFaceUriElement.cpp: Removed unneeded includes.
2468         * svg/SVGForeignObjectElement.cpp: Removed unneeded includes.
2469         (WebCore::SVGForeignObjectElement::parseAttribute): Don't use isSupportedAttribute.
2470         * svg/SVGGElement.cpp: Removed unneeded includes.
2471         (WebCore::SVGGElement::parseAttribute): Don't use isSupportedAttribute.
2472         * svg/SVGGlyphElement.cpp: Removed unneeded includes.
2473         * svg/SVGGlyphRefElement.cpp: Removed unneeded includes.
2474         (WebCore::SVGGlyphRefElement::hasValidGlyphElement): Rewrote to use is<> instead of hasTagName.
2475         (WebCore::SVGGlyphRefElement::parseAttribute): Don't use return value from SVGURIReference::parseAttribute.
2476         * svg/SVGGradientElement.cpp: Removed unneeded includes.
2477         (WebCore::SVGGradientElement::parseAttribute): Don't use isSupportedAttribute.
2478         * svg/SVGGraphicsElement.cpp: Removed unneeded includes.
2479         (WebCore::SVGGraphicsElement::parseAttribute): Don't use isSupportedAttribute.
2480         * svg/SVGImageElement.cpp: Removed unneeded includes.
2481         (WebCore::SVGImageElement::parseAttribute): Don't use isSupportedAttribute.
2482         * svg/SVGLangSpace.cpp: Removed unneeded includes.
2483         (WebCore::SVGLangSpace::parseAttribute): Removed the return value.
2484         * svg/SVGLangSpace.h: Converted functions to static member functions and removed the
2485         return value from parseAttribute.
2486         * svg/SVGLineElement.cpp: Removed unneeded includes.
2487         (WebCore::SVGLineElement::parseAttribute): Don't use isSupportedAttribute.
2488         * svg/SVGLinearGradientElement.cpp: Removed unneeded includes.
2489         (WebCore::SVGLinearGradientElement::parseAttribute): Don't use isSupportedAttribute.
2490         * svg/SVGMPathElement.cpp: Removed unneeded includes.
2491         (WebCore::SVGMPathElement::isSupportedAttribute): Deleted.
2492         (WebCore::SVGMPathElement::parseAttribute): Don't use isSupportedAttribute.
2493         (WebCore::SVGMPathElement::svgAttributeChanged): Don't use isSupportedAttribute.
2494         * svg/SVGMPathElement.h: Removed isSupportedAttribute and made didNotifySubtreeInsertions
2495         private instead of protected.
2496         * svg/SVGMarkerElement.cpp: Removed unneeded includes.
2497         (WebCore::SVGMarkerElement::parseAttribute): Don't use isSupportedAttribute.
2498         * svg/SVGMaskElement.cpp: Removed unneeded includes.
2499         (WebCore::SVGMaskElement::parseAttribute): Don't use isSupportedAttribute.
2500         * svg/SVGPathElement.cpp: Removed unneeded includes.
2501         (WebCore::SVGPathElement::parseAttribute): Don't use isSupportedAttribute.
2502         * svg/SVGPatternElement.cpp: Removed unneeded includes.
2503         (WebCore::SVGPatternElement::parseAttribute): Don't use isSupportedAttribute.
2504         * svg/SVGPolyElement.cpp: Removed unneeded includes.
2505         (WebCore::SVGPolyElement::isSupportedAttribute): Deleted.
2506         (WebCore::SVGPolyElement::parseAttribute): Don't use isSupportedAttribute.
2507         (WebCore::SVGPolyElement::svgAttributeChanged): Don't use isSupportedAttribute.
2508         * svg/SVGPolyElement.h:
2509         * svg/SVGRadialGradientElement.cpp: Removed unneeded includes.
2510         (WebCore::SVGRadialGradientElement::parseAttribute): Don't use isSupportedAttribute.
2511         * svg/SVGRectElement.cpp: Removed unneeded includes.
2512         (WebCore::SVGRectElement::isSupportedAttribute): Deleted.
2513         (WebCore::SVGRectElement::parseAttribute): Don't use isSupportedAttribute.
2514         (WebCore::SVGRectElement::svgAttributeChanged): Don't use isSupportedAttribute.
2515         * svg/SVGRectElement.h:
2516         * svg/SVGSVGElement.cpp: Removed unneeded includes.
2517         (WebCore::SVGSVGElement::parseAttribute): Don't use isSupportedAttribute.
2518         * svg/SVGScriptElement.cpp: Removed unneeded includes.
2519         * svg/SVGStopElement.cpp: Removed unneeded includes.
2520         (WebCore::SVGStopElement::isSupportedAttribute): Deleted.
2521         (WebCore::SVGStopElement::parseAttribute): Don't use isSupportedAttribute.
2522         (WebCore::SVGStopElement::svgAttributeChanged): Don't use isSupportedAttribute.
2523         * svg/SVGStopElement.h: Removed isSupportedAttribute.
2524         * svg/SVGStyleElement.cpp: Removed unneeded includes.
2525         (WebCore::SVGStyleElement::isSupportedAttribute): Deleted.
2526         (WebCore::SVGStyleElement::parseAttribute): Don't use isSupportedAttribute.
2527         * svg/SVGStyleElement.h: Removed isSupportedAttribute.
2528         * svg/SVGSymbolElement.cpp: Removed unneeded includes.
2529         (WebCore::SVGSymbolElement::isSupportedAttribute): Deleted.
2530         (WebCore::SVGSymbolElement::parseAttribute): Don't use isSupportedAttribute.
2531         (WebCore::SVGSymbolElement::svgAttributeChanged): Don't use isSupportedAttribute.
2532         * svg/SVGSymbolElement.h: Removed isSupportedAttribute.
2533         * svg/SVGTRefElement.cpp: Removed unneeded includes.
2534         (WebCore::SVGTRefElement::isSupportedAttribute): Deleted.
2535         (WebCore::SVGTRefElement::parseAttribute): Don't use isSupportedAttribute.
2536         (WebCore::SVGTRefElement::svgAttributeChanged): Don't use isSupportedAttribute.
2537         * svg/SVGTRefElement.h: Removed isSupportedAttribute and made didNotifySubtreeInsertions
2538         private instead of protected.
2539         * svg/SVGTests.cpp: Removed unneeded includes.
2540         (WebCore::SVGTests::parseAttribute): Removed return value.
2541         * svg/SVGTests.h: Removed return value of parseAttribute.
2542         * svg/SVGTextContentElement.cpp: Removed unneeded includes.
2543         (WebCore::SVGTextContentElement::collectStyleForPresentationAttribute): Don't use
2544         isSupportedAttribute. Also removed global to optimize comparing attribute value against
2545         the string "preserve".
2546         (WebCore::SVGTextContentElement::parseAttribute): Don't use isSupportedAttribute.
2547         (WebCore::SVGTextContentElement::svgAttributeChanged): Don't use isSupportedAttribute.
2548         * svg/SVGTextContentElement.h: Made isSupportedAttribute private instead of protected.
2549         * svg/SVGTextElement.cpp: Removed unneeded includes.
2550         * svg/SVGTextPathElement.cpp: Removed unneeded includes.
2551         (WebCore::SVGTextPathElement::parseAttribute): Don't use isSupportedAttribute.
2552         * svg/SVGTextPositioningElement.cpp: Removed unneeded includes.
2553         (WebCore::SVGTextPositioningElement::isSupportedAttribute): Deleted.
2554         (WebCore::SVGTextPositioningElement::parseAttribute): Don't use isSupportedAttribute.
2555         (WebCore::SVGTextPositioningElement::svgAttributeChanged): Don't use isSupportedAttribute.
2556         * svg/SVGTextPositioningElement.h: Removed isSupportedAttribute and made some functions
2557         private insetad of protected.
2558         * svg/SVGURIReference.cpp: Removed unneeded includes.
2559         (WebCore::SVGURIReference::parseAttribute): Don't use isSupportedAttribute.
2560         * svg/SVGURIReference.h:
2561         (WebCore::SVGURIReference::isExternalURIReference):
2562         * svg/SVGUseElement.cpp: Removed unneeded includes.
2563         (WebCore::SVGUseElement::parseAttribute): Don't use isSupportedAttribute.
2564         * svg/SVGViewElement.h: Removed isSupportedAttribute.
2565         * svg/animation/SVGSMILElement.cpp: Removed unneeded includes.
2566
2567 2015-03-29  Darin Adler  <darin@apple.com>
2568
2569         Remove unneeded includes of "Attribute.h"
2570         https://bugs.webkit.org/show_bug.cgi?id=143195
2571
2572         Reviewed by Antti Koivisto.
2573
2574         * css/StyleResolver.cpp:
2575         * html/HTMLAnchorElement.cpp:
2576         * html/HTMLAreaElement.cpp:
2577         * html/HTMLBRElement.cpp:
2578         * html/HTMLBaseElement.cpp:
2579         * html/HTMLBodyElement.cpp:
2580         * html/HTMLButtonElement.cpp:
2581         * html/HTMLCanvasElement.cpp:
2582         * html/HTMLDivElement.cpp:
2583         * html/HTMLElement.cpp:
2584         * html/HTMLEmbedElement.cpp:
2585         * html/HTMLFontElement.cpp:
2586         * html/HTMLFormControlElement.cpp:
2587         * html/HTMLFormElement.cpp:
2588         * html/HTMLFrameElement.cpp:
2589         * html/HTMLFrameElementBase.cpp:
2590         * html/HTMLFrameSetElement.cpp:
2591         * html/HTMLHRElement.cpp:
2592         * html/HTMLIFrameElement.cpp:
2593         * html/HTMLImageElement.cpp:
2594         * html/HTMLOListElement.cpp:
2595         * html/HTMLOptionElement.cpp:
2596         * html/HTMLParagraphElement.cpp:
2597         * html/HTMLParamElement.cpp:
2598         * html/HTMLPlugInElement.cpp:
2599         * html/HTMLPreElement.cpp:
2600         * html/HTMLProgressElement.cpp:
2601         * html/HTMLScriptElement.cpp:
2602         * html/HTMLSelectElement.cpp:
2603         * html/HTMLStyleElement.cpp:
2604         * html/HTMLTableCaptionElement.cpp:
2605         * html/HTMLTableCellElement.cpp:
2606         * html/HTMLTableColElement.cpp:
2607         * html/HTMLTableElement.cpp:
2608         * html/HTMLTablePartElement.cpp:
2609         * html/HTMLTextAreaElement.cpp:
2610         * html/HTMLTextFormControlElement.cpp:
2611         * html/HTMLUListElement.cpp:
2612         * html/HTMLVideoElement.cpp:
2613         * html/parser/HTMLScriptRunner.cpp:
2614         * inspector/InspectorNodeFinder.cpp:
2615         Removed includes of "Attribute.h".
2616
2617 2015-03-28  Eric Carlson  <eric.carlson@apple.com>
2618
2619         [Mac] Update for output device API change
2620         https://bugs.webkit.org/show_bug.cgi?id=143187
2621
2622         Reviewed by Zalan Bujtas.
2623
2624         The API used for output device is being deprecated, update to the replacement.
2625
2626         * WebCore.xcodeproj/project.pbxproj: Add SPI headers.
2627
2628         * platform/graphics/MediaPlaybackTarget.h:
2629         (WebCore::MediaPlaybackTarget::MediaPlaybackTarget): Update for API change.
2630         (WebCore::MediaPlaybackTarget::setDevicePickerContext):
2631         (WebCore::MediaPlaybackTarget::devicePickerContext):
2632
2633         * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
2634         (WebCore::MediaPlaybackTarget::encode):
2635         (WebCore::MediaPlaybackTarget::decode):
2636
2637         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
2638         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
2639         (WebCore::MediaPlaybackTargetPickerMac::MediaPlaybackTargetPickerMac):
2640         (WebCore::MediaPlaybackTargetPickerMac::~MediaPlaybackTargetPickerMac):
2641         (WebCore::MediaPlaybackTargetPickerMac::outputeDeviceAvailabilityChangedTimerFired):
2642         (WebCore::MediaPlaybackTargetPickerMac::devicePicker):
2643         (WebCore::MediaPlaybackTargetPickerMac::currentDeviceDidChange):
2644         (WebCore::MediaPlaybackTargetPickerMac::stopMonitoringPlaybackTargets):
2645         (-[WebAVOutputDeviceMenuControllerHelper observeValueForKeyPath:ofObject:change:context:]):
2646         (-[WebAVOutputDevicePickerMenuControllerHelper observeValueForKeyPath:ofObject:change:context:]): Deleted.
2647
2648         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2649         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2650         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
2651         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
2652         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget):
2653         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
2654
2655         * platform/spi/cocoa/AVKitSPI.h: Copied from Source/WebCore/platform/spi/ios/AVKitSPI.h. Moved
2656             from ios directory, added Mac includes and prototypes.
2657         * platform/spi/ios/AVKitSPI.h: Removed.
2658
2659         * platform/spi/mac/AVFoundationSPI.h: Added.
2660
2661 2015-03-28  Simon Fraser  <simon.fraser@apple.com>
2662
2663         Optimize RenderLayer::intersectsDamageRect() slightly
2664         https://bugs.webkit.org/show_bug.cgi?id=143186
2665
2666         Reviewed by Zalan Bujtas.
2667
2668         We can early return from RenderLayer::intersectsDamageRect() if the
2669         damageRect is empty, since nothing will intersect with the empty rect.
2670         
2671         Slight performance gain when scrolling overflow-scroll with lots of nested,
2672         clipping layers.
2673
2674         * rendering/RenderLayer.cpp:
2675         (WebCore::RenderLayer::calculateClipRects):
2676
2677 2015-03-28  Anders Carlsson  <andersca@apple.com>
2678
2679         Remove an unused SPI method from WebKitLegacy
2680         https://bugs.webkit.org/show_bug.cgi?id=143185
2681
2682         Reviewed by Sam Weinig.
2683
2684         * loader/appcache/ApplicationCacheStorage.cpp:
2685         (WebCore::ApplicationCacheStorage::storeCopyOfCache): Deleted.
2686         * loader/appcache/ApplicationCacheStorage.h:
2687
2688 2015-03-28  Joonghun Park  <jh718.park@samsung.com>
2689
2690         nullptr cleanup in InlineFooBox classes
2691         https://bugs.webkit.org/show_bug.cgi?id=143178
2692
2693         Reviewed by Csaba Osztrogonác.
2694
2695         No new tests, no behavior changes
2696
2697         Replace 0 with nullptr in InlineFooBox classes.
2698
2699         * rendering/InlineBox.cpp:
2700         (WebCore::InlineBox::prevLeafChildIgnoringLineBreak):
2701         * rendering/InlineFlowBox.cpp:
2702         (WebCore::InlineFlowBox::removeChild):
2703         (WebCore::InlineFlowBox::deleteLine):
2704         (WebCore::InlineFlowBox::placeBoxesInInlineDirection):
2705         (WebCore::InlineFlowBox::addTextBoxVisualOverflow):
2706         * rendering/InlineFlowBox.h:
2707         (WebCore::InlineFlowBox::InlineFlowBox):
2708         * rendering/InlineTextBox.h:
2709         (WebCore::InlineTextBox::InlineTextBox):
2710         * rendering/RootInlineBox.cpp:
2711         (WebCore::RootInlineBox::getLogicalStartBoxWithNode):
2712         (WebCore::RootInlineBox::getLogicalEndBoxWithNode):
2713         * rendering/RootInlineBox.h:
2714         * rendering/svg/SVGInlineTextBox.cpp:
2715         (WebCore::SVGInlineTextBox::SVGInlineTextBox):
2716         (WebCore::SVGInlineTextBox::releasePaintingResource):
2717         (WebCore::SVGInlineTextBox::restoreGraphicsContextAfterTextPainting):
2718         * rendering/svg/SVGRootInlineBox.cpp:
2719         (WebCore::SVGRootInlineBox::closestLeafChildForPosition):
2720         (WebCore::findFirstAndLastAttributesInVector):
2721         * rendering/svg/SVGRootInlineBox.h:
2722
2723 2015-03-27  Simon Fraser  <simon.fraser@apple.com>
2724
2725         More modern loops in RenderLayer.cpp
2726         https://bugs.webkit.org/show_bug.cgi?id=143175
2727
2728         Reviewed by Ryosuke Niwa.
2729
2730         Use modern loops in more places in RenderLayer.app.
2731
2732         * rendering/RenderLayer.cpp:
2733         (WebCore::RenderLayer::update3DTransformedDescendantStatus):
2734         (WebCore::RenderLayer::paint):
2735         (WebCore::performOverlapTests):
2736         (WebCore::RenderLayer::paintFixedLayersInNamedFlows):
2737         (WebCore::RenderLayer::paintList):
2738         (WebCore::RenderLayer::collectFragments):
2739         (WebCore::RenderLayer::updatePaintingInfoForFragments):
2740         (WebCore::RenderLayer::paintTransformedLayerIntoFragments):
2741         (WebCore::RenderLayer::calculateClipRects):
2742
2743 2015-03-27  Simon Fraser  <simon.fraser@apple.com>
2744
2745         nullptr cleanup in RenderLayer
2746         https://bugs.webkit.org/show_bug.cgi?id=143174
2747
2748         Reviewed by Ryosuke Niwa.
2749
2750         Replace 0 with nullptr in RenderLayer.cpp.
2751
2752         * rendering/RenderLayer.cpp:
2753         (WebCore::RenderLayer::filterRenderer):
2754         (WebCore::RenderLayer::updateLayerPositionsAfterLayout):
2755         (WebCore::RenderLayer::updateLayerPositionsAfterOverflowScroll):
2756         (WebCore::RenderLayer::positionNewlyCreatedOverflowControls):
2757         (WebCore::RenderLayer::enclosingOverflowClipLayer):
2758         (WebCore::RenderLayer::enclosingCompositingLayer):
2759         (WebCore::RenderLayer::enclosingCompositingLayerForRepaint):
2760         (WebCore::RenderLayer::enclosingFilterLayer):
2761         (WebCore::RenderLayer::enclosingFilterRepaintLayer):
2762         (WebCore::RenderLayer::clippingRootForPainting):
2763         (WebCore::RenderLayer::transparentPaintingAncestor):
2764         (WebCore::transparencyClipBox):
2765         (WebCore::RenderLayer::removeChild):
2766         (WebCore::RenderLayer::removeOnlyThisLayer):
2767         (WebCore::RenderLayer::insertOnlyThisLayer):
2768         (WebCore::accumulateOffsetTowardsAncestor):
2769         (WebCore::RenderLayer::enclosingScrollableArea):
2770         (WebCore::RenderLayer::enclosingPaginationLayerInSubtree):
2771         (WebCore::RenderLayer::enclosingElement):
2772         (WebCore::RenderLayer::enclosingFlowThreadAncestor):
2773         (WebCore::RenderLayer::hitTestFixedLayersInNamedFlows):
2774         (WebCore::RenderLayer::hitTestLayer):
2775         (WebCore::RenderLayer::hitTestTransformedLayerInFragments):
2776         (WebCore::RenderLayer::hitTestLayerByApplyingTransform):
2777         (WebCore::RenderLayer::hitTestList):
2778         (WebCore::RenderLayer::updateClipRects):
2779         (WebCore::RenderLayer::clipRects):
2780         (WebCore::RenderLayer::calculateClipRects):
2781
2782 2015-03-27  Gwang Yoon Hwang  <yoon@igalia.com>
2783
2784         [TexMap] Seperate BitmapTexture related classes implementations from TextureMapper
2785         https://bugs.webkit.org/show_bug.cgi?id=142386
2786
2787         Reviewed by Žan Doberšek.
2788
2789         TextureMapper and TextureMapperGL are bloated and tightly coupled with
2790         BitmapTexture. We should move these classes to seperated file of their own.
2791         Also, this patch removes friend relationship from TextureMapperGL and  its
2792         subsidiary classes.
2793
2794         The main purpose of this refactoring is to expose BitmapTexturePool to
2795         renderers of platformlayers like Video and Canvas. By doing this, each
2796         renderer can acquire textures from the global texture pool to paint
2797         their contents directly.
2798
2799         No new tests needed.
2800
2801         * PlatformEfl.cmake:
2802         * PlatformGTK.cmake:
2803         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2804         Include BitmapTextureGL and BitmapTexturePool explicitly
2805
2806         * platform/graphics/texmap/BitmapTexture.cpp: Added.
2807         * platform/graphics/texmap/BitmapTexture.h: Added.
2808         (WebCore::BitmapTexture::updateContents):
2809         Exclude BitmapTexture class from TextureMapper
2810
2811         * platform/graphics/texmap/BitmapTextureGL.cpp: Added.
2812         * platform/graphics/texmap/BitmapTextureGL.h: Added.
2813         Exclude BitmapTextureGL class from TextureMapperGL
2814         (WebCore::BitmapTextureGL::clipStack): Added.
2815         Add the getter for clipStack for TextureMapperGL
2816         (WebCore::BitmapTextureGL::Bind): Deleted.
2817         (WebCore::BitmapTextureGL::BindAsSurface): Added.
2818         Bind used TextureMapperGL's internal data directly to compute projection matrix as a friend class,
2819         However, TextureMapperGL can compute projection matrix itself after binding job, so this
2820         friend ship is not needed. Also, this patch renames Bind to BindAsSurface to remove ambiguity.
2821
2822         * platform/graphics/texmap/BitmapTextureImageBuffer.cpp: Added.
2823         * platform/graphics/texmap/BitmapTextureImageBuffer.h: Added.
2824         Exclude BitmapTextureImageBuffer class from TextureMapperImageBuffer
2825
2826         * platform/graphics/texmap/BitmapTexturePool.cpp: Added.
2827         * platform/graphics/texmap/BitmapTexturePool.h: Added.
2828         Exclude BitmapTexturePool class from TextureMapperGL
2829         (WebCore::BitmapTexturePool::acquireTexture):
2830         Modified to use passed GraphicsContext3D instead of TextureMapperGL to remove redundant coupling
2831
2832         * platform/graphics/texmap/TextureMapper.cpp:
2833         * platform/graphics/texmap/TextureMapper.h:
2834         Remove BitmapTexturePool and BitmapTexture from its implementation.
2835
2836         * platform/graphics/texmap/TextureMapperGL.cpp:
2837         * platform/graphics/texmap/TextureMapperGL.h:
2838         Remove BitmapTextureGL from its implementation.
2839         (WebCore::TextureMapperGL::TextureMapperGL):
2840         (WebCore::TextureMapperGL::clipStack):
2841         (WebCore::TextureMapperGL::bindSurface):
2842         (WebCore::TextureMapperGL::currentSurface):
2843         Add a getter of the current surface for filtering operation in BitmapTextureGL.
2844         It would be clear to move filtering operation from BitmapTextureGL to TextureMapperGL later.
2845
2846         (WebCore::TextureMapperGL::ClipStack):
2847         Move inner class declaration to public.
2848
2849         * platform/graphics/texmap/TextureMapperImageBuffer.cpp:
2850         * platform/graphics/texmap/TextureMapperImageBuffer.h:
2851         Remove BitmapTextureImageBuffer from its implementation.
2852
2853 2015-03-27  Tim Horton  <timothy_horton@apple.com>
2854
2855         WebProcess started by editable WKWebView spends 15% of its initialization time loading DataDetectors
2856         https://bugs.webkit.org/show_bug.cgi?id=143142
2857         <rdar://problem/20324495>
2858
2859         Reviewed by Anders Carlsson.
2860
2861         Calling DataDetectorsLibrary() is expensive; we should avoid doing it
2862         until actually necessary. When loading a page that makes a caret selection,
2863         ServicesOverlayController was calling DataDetectorsLibrary() (ignoring the fact
2864         that a caret selection can't have any services associated with it) to avoid
2865         crashing on systems where DataDetectors is not available. Instead, we should
2866         first check if there's anything to do, and then check for the existence
2867         of DataDetectors.
2868
2869         * page/mac/ServicesOverlayController.mm:
2870         (WebCore::ServicesOverlayController::buildPhoneNumberHighlights):
2871         Build the list of phone number ranges, and bail (clearing the potential highlights)
2872         if it is empty, before calling DataDetectorsLibrary().
2873
2874         (WebCore::ServicesOverlayController::buildSelectionHighlight):
2875         Check the list of selection rects, and bail (clearing the potential highlights)
2876         if it is empty, before calling DataDetectorsLibrary().
2877
2878 2015-03-27  Jer Noble  <jer.noble@apple.com>
2879
2880         [Mac] Safari fails to fire page "load" event with video[preload=none]
2881         https://bugs.webkit.org/show_bug.cgi?id=143147
2882
2883         Reviewed by Simon Fraser.
2884
2885         Test: media/video-page-load-preload-none.html
2886
2887         When told to load() when preload == None, set the networkState to Idle.
2888         This causes HTMLMediaElement to set the shouldDelayLoadEvent flag to
2889         false, and allows the page's 'load' event to fire.
2890
2891         Drive-by fix: add setNetworkState() and setReadyState() methods to
2892         MediaPlayerPrivateAVFoundation, reducing a bunch of code duplication.
2893
2894         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
2895         (WebCore::MediaPlayerPrivateAVFoundation::load):
2896         (WebCore::MediaPlayerPrivateAVFoundation::setNetworkState):
2897         (WebCore::MediaPlayerPrivateAVFoundation::setReadyState):
2898         (WebCore::MediaPlayerPrivateAVFoundation::updateStates):
2899         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
2900
2901 2015-03-27  Alexey Proskuryakov  <ap@apple.com>
2902
2903         Calling crypto.webkitSubtle.generateKey causes page memory to never be released
2904         https://bugs.webkit.org/show_bug.cgi?id=143151
2905         rdar://problem/18940687
2906
2907         Reviewed by Tim Horton.
2908
2909         * crypto/mac/CryptoKeyRSAMac.cpp: (WebCore::CryptoKeyRSA::generatePair): Don't.
2910
2911 2015-03-27  Brent Fulgham  <bfulgham@apple.com>
2912
2913         Null dereference in InbandMetadataTextTrack handling
2914         https://bugs.webkit.org/show_bug.cgi?id=143144
2915         <rdar://problem/18983250>
2916
2917         Reviewed by Eric Carlson.
2918
2919         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp:
2920         (WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes): Check for null return value from
2921         'client()', just like we do in all other methods.
2922
2923 2015-03-27  Oliver Hunt  <oliver@apple.com>
2924
2925         Forward additional CFNetwork ATS information to child processes
2926         https://bugs.webkit.org/show_bug.cgi?id=143136
2927
2928         Reviewed by Anders Carlsson.
2929
2930         Declare SPI.
2931
2932         * platform/spi/cf/CFNetworkSPI.h:
2933
2934 2015-03-27  Chris Dumez  <cdumez@apple.com>
2935
2936         [WK2][NetworkCache] We only cache responses with status codes that are cacheable by default
2937         https://bugs.webkit.org/show_bug.cgi?id=143125
2938         <rdar://problem/20321172>
2939
2940         Reviewed by Antti Koivisto.
2941
2942         Export a couple of extra symbols.
2943
2944         * platform/network/ResourceResponseBase.h:
2945
2946 2015-03-27  Jer Noble  <jer.noble@apple.com>
2947
2948         HTMLMediaElement will fire 'seeked' before seek completes, leading to currentTime discontinuities.
2949         https://bugs.webkit.org/show_bug.cgi?id=143132
2950
2951         Reviewed by Eric Carlson.
2952
2953         When seeking, if the ready state rises to >= HAVE_CURRENT_DATA, we will fire the 'seeked'
2954         event and continue playback. However, if a media engine updates the ready state before its
2955         seek operation actually completes, the currentTime it returns may still be the time before
2956         the seek.
2957
2958         Wait until both the ready state rises to HAVE_CURRENT_DATA and m_player->seeking() returns
2959         false before firing the 'seeked' event.
2960
2961         * html/HTMLMediaElement.cpp:
2962         (WebCore::HTMLMediaElement::parseAttribute):
2963
2964 2015-03-26  Geoffrey Garen  <ggaren@apple.com>
2965
2966         Make some more objects use FastMalloc
2967         https://bugs.webkit.org/show_bug.cgi?id=143122
2968
2969         Reviewed by Csaba Osztrogonác.
2970
2971         * Modules/geolocation/GeolocationController.h:
2972         * Modules/geolocation/NavigatorGeolocation.h:
2973         * Modules/indexeddb/DOMWindowIndexedDatabase.h:
2974         * Modules/notifications/NotificationController.h:
2975         * Modules/webdatabase/DatabaseServer.h:
2976         * css/CSSFontFaceSource.h:
2977         * html/HTMLMediaSession.h:
2978         * inspector/InspectorIndexedDBAgent.h:
2979         * inspector/InspectorReplayAgent.h:
2980         * page/CaptionUserPreferencesMediaAF.h:
2981         * page/PageConsoleClient.h:
2982         * page/PageDebuggable.h:
2983         * page/animation/CSSPropertyAnimation.cpp:
2984         * page/mac/ServicesOverlayController.h:
2985         * platform/RemoteCommandListener.h:
2986         * platform/Timer.h:
2987         * platform/audio/MediaSessionManager.h:
2988         * platform/mac/SystemSleepListenerMac.h:
2989         * platform/mac/ThemeMac.h:
2990         * rendering/svg/RenderSVGResourceSolidColor.h:
2991         * replay/ReplayController.h:
2992
2993 2015-03-27  Said Abou-Hallawa  <sabouhallawa@apple.com>
2994
2995         FEMorphology::platformApplyGeneric() should bail out if the radius is less than or equal to zero.
2996         https://bugs.webkit.org/show_bug.cgi?id=142885.
2997
2998         Reviewed by Dean Jackson.
2999
3000         FEMorphology class implementation code clean up.
3001         
3002         Tests: svg/filters/feMorphology-radius-cases.svg
3003
3004         * platform/graphics/filters/FEMorphology.cpp:
3005         (WebCore::shouldSupersedeExtremum): Reuse code instead of repeating it and
3006         use < and > instead of =< and >=.
3007         
3008         (WebCore::pixelArrayIndex): Returns the array index of a pixel in an image
3009         buffer, given: position(x, y), image width and the color channel.
3010         
3011         (WebCore::columnExtremum): Returns the extremum of a column of pixels.
3012         
3013         (WebCore::kernelExtremum): Returns the extremum of a filter kernel.
3014         
3015         (WebCore::FEMorphology::platformApplyGeneric): Apply some code clean-up.
3016         The kernel size should be equal to radius of the filter. The extra pixel
3017         was causing the resulted image to be asymmetric in some cases.
3018         
3019         (WebCore::FEMorphology::platformApplyDegenerate):
3020         (WebCore::FEMorphology::platformApplySoftware): After applying scaling, we
3021         still need to check the resulted radius is negative (overflow case) or less
3022         than one (zero radius case) and treat these cases differently.
3023         
3024         (WebCore::FEMorphology::morphologyOperator): Deleted.
3025         (WebCore::FEMorphology::radiusX): Deleted.
3026         (WebCore::FEMorphology::radiusY): Deleted.
3027         * platform/graphics/filters/FEMorphology.h:
3028         (WebCore::FEMorphology::morphologyOperator):
3029         (WebCore::FEMorphology::radiusX):
3030         (WebCore::FEMorphology::radiusY):
3031         Move a single line functions from the source file to the header file.
3032
3033 2015-03-27  Antti Koivisto  <antti@apple.com>
3034
3035         Move CacheValidation to platform
3036         https://bugs.webkit.org/show_bug.cgi?id=143133
3037
3038         Reviewed by Chris Dumez.
3039
3040         It deals with platform types only and is currently violating layering.
3041
3042         * WebCore.xcodeproj/project.pbxproj:
3043         * loader/cache/CacheValidation.cpp: Removed.
3044         * loader/cache/CacheValidation.h: Removed.
3045         * platform/network/CacheValidation.cpp: Copied from Source/WebCore/loader/cache/CacheValidation.cpp.
3046         * platform/network/CacheValidation.h: Copied from Source/WebCore/loader/cache/CacheValidation.h.
3047
3048 2015-03-27  Commit Queue  <commit-queue@webkit.org>
3049
3050         Unreviewed, rolling out r177896.
3051         https://bugs.webkit.org/show_bug.cgi?id=142978
3052
3053         Loading libgstclutter.so in-process hangs web process
3054         (Requested by mcatanzaro on #webkit).
3055
3056         Reverted changeset:
3057
3058         "[GStreamer] Disable gst-plugin-scanner if seccomp filters are
3059         enabled"
3060         https://bugs.webkit.org/show_bug.cgi?id=140069
3061         http://trac.webkit.org/changeset/177896
3062
3063 2015-03-26  Antti Koivisto  <antti@apple.com>
3064
3065         Respect cache-control directives in request
3066         https://bugs.webkit.org/show_bug.cgi?id=143121
3067         rdar://problem/19714040
3068
3069         Reviewed by Chris Dumez.
3070
3071         Test: http/tests/cache/disk-cache/disk-cache-request-headers.html
3072
3073         * loader/cache/CacheValidation.cpp:
3074         (WebCore::isCacheHeaderSeparator):
3075         (WebCore::isControlCharacter):
3076         (WebCore::trimToNextSeparator):
3077         (WebCore::parseCacheHeader):
3078         (WebCore::parseCacheControlDirectives):
3079
3080             Factor Cache-control parsing here so it can be used for both requests and responses.
3081
3082         * loader/cache/CacheValidation.h:
3083         * platform/network/ResourceRequestBase.h:
3084         * platform/network/ResourceResponseBase.cpp:
3085         (WebCore::ResourceResponseBase::ResourceResponseBase):
3086         (WebCore::ResourceResponseBase::parseCacheControlDirectives):
3087         (WebCore::ResourceResponseBase::cacheControlContainsNoCache):
3088         (WebCore::ResourceResponseBase::cacheControlContainsNoStore):
3089         (WebCore::ResourceResponseBase::cacheControlContainsMustRevalidate):
3090         (WebCore::ResourceResponseBase::cacheControlMaxAge):
3091         (WebCore::isCacheHeaderSeparator): Deleted.
3092         (WebCore::isControlCharacter): Deleted.
3093         (WebCore::trimToNextSeparator): Deleted.
3094         (WebCore::parseCacheHeader): Deleted.
3095         * platform/network/ResourceResponseBase.h:
3096
3097 2015-03-27  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
3098
3099         [GStreamer] share GL context in pipeline, part 2
3100         https://bugs.webkit.org/show_bug.cgi?id=143049
3101
3102         Reviewed by Carlos Garcia Campos.
3103
3104         This patch, instead of cluttering the GstGL attributes creation in
3105         ::handleSyncMessage(), creates a new method ::ensureGstGLContext(),
3106         where those attributes are defined. This method is guarded by
3107         USE(GSTREAMER_GL)
3108
3109         ::handlSyncMessage() shall return nothing, according to GStreamer
3110         documentation, not a boolean.
3111
3112         The GstGL attributes are now GRefPtr<> to avoid memory leaks.
3113
3114         The GstGLAPI and GstGLPlatform are now set given by the pre-processor
3115         directives, and the code in ::ensureGstGLContext() is simpler.
3116
3117         No new tests because this is platform specific and it depends in the
3118         run-time availability and configurations of GstGL elements.
3119
3120         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3121         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
3122         Don't initialise the GstGL attributes since are GRefPtr<>
3123         (WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage): Changed the
3124         signature to use void instead of gboolean.
3125         (WebCore::MediaPlayerPrivateGStreamer::ensureGstGLContext): New method.
3126         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
3127
3128 2015-03-26  Jeremy Jones  <jeremyj@apple.com>
3129
3130         Optimized Fullscreen fails to cleanup because of no longer necessary release of m_playerController in exitFullscreen()
3131         https://bugs.webkit.org/show_bug.cgi?id=143120
3132
3133         Reviewed by Eric Carlson.
3134
3135         We used to release m_playerController in WebVideoFullscreenInterfaceAVKit::exitFullscreen() in order to make sure 
3136         media state was reset. This is no longer necessary as we now have a way the model can explicitly request resetting the
3137         media state via resetMediaState(). m_playerController is already released in 
3138         WebVideoFullscreenInterfaceAVKit::cleanupFullscreenInternal(). Releasing it prematurely can actually prevent the exit
3139         fullscreen process from completing successfully.
3140
3141         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3142         (WebVideoFullscreenInterfaceAVKit::exitFullscreen):
3143
3144 2015-03-26  Zalan Bujtas  <zalan@apple.com>
3145
3146         Inline continuation code should not take anonymous containing wrapper granted.
3147         https://bugs.webkit.org/show_bug.cgi?id=133312
3148
3149         Reviewed by Dave Hyatt.
3150
3151         It's wrong to assume that when RenderInline is part of an inline continuation, its containing block
3152         is an anonymous wrapper and its sibling might be a block level renderer.
3153         When the inline continuation is no longer needed, for example when the block level renderer that initiated the continuation
3154         is detached from the render tree, the inline renderes still continue to form continuation.(however they no longer require
3155         anonymous wrappers)
3156
3157         Test: fast/inline/crash-when-position-property-is-changed-and-no-longer-in-continuation.html
3158
3159         * rendering/RenderInline.cpp:
3160         (WebCore::updateStyleOfAnonymousBlockContinuations):
3161         (WebCore::RenderInline::styleDidChange):
3162
3163 2015-03-26  Tim Horton  <timothy_horton@apple.com>
3164
3165         REGRESSION (r181358 and r181507): Lots of sites think that we support touch events on OS X
3166         https://bugs.webkit.org/show_bug.cgi?id=142888
3167         <rdar://problem/20227304>
3168
3169         Reviewed by Beth Dakin.
3170
3171         * dom/Document.idl:
3172         * dom/Element.idl:
3173         * html/HTMLBodyElement.idl:
3174         * html/HTMLFrameSetElement.idl:
3175         * page/DOMWindow.idl:
3176         Re-conditionalize a lot of event listeners; sites test ("ontouchstart" in window), which
3177         is not covered by NotEnumerable, and so r181358 and r181507 broke a bunch of sites
3178         (apple.com, blaze.com, anything using nicescroll.js, etc.) by causing them to think
3179         that (Mac) Safari was touch-enabled.
3180
3181 2015-03-26  Geoffrey Garen  <ggaren@apple.com>
3182
3183         "lineNo" does not match WebKit coding style guidelines
3184         https://bugs.webkit.org/show_bug.cgi?id=143119
3185
3186         Reviewed by Michael Saboff.
3187
3188         We can afford to use whole words.
3189
3190         * bindings/js/JSLazyEventListener.cpp:
3191         (WebCore::JSLazyEventListener::initializeJSFunction):
3192         * bindings/js/JSMainThreadExecStateInstrumentation.h:
3193         (WebCore::JSMainThreadExecState::instrumentFunctionCall):
3194         * inspector/InspectorDOMAgent.cpp:
3195         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
3196         * testing/Internals.cpp:
3197         (WebCore::Internals::parserMetaData):
3198
3199 2015-03-26  Roger Fong  <roger_fong@apple.com>
3200
3201         Apply blur effect to media control background.
3202         https://bugs.webkit.org/show_bug.cgi?id=143116.
3203         <rdar://problem/20316964>.
3204
3205         Reviewed by Brent Fulgham.
3206
3207         There are still a few issues, like the borders of the controls being blurred with black,
3208         and the volume slider background not showing the blur effect. Will fix those separately.
3209
3210         Add CSS for new divs to create blur effect using back drop filters and blend modes.
3211         * Modules/mediacontrols/mediaControlsApple.css:
3212         (audio::-webkit-media-controls-panel):
3213         (audio::-webkit-media-controls-panel-tint):
3214         (audio::-webkit-media-controls-panel-background):
3215         (audio::-webkit-media-controls-panel .volume-box):
3216         (audio::-webkit-media-controls-volume-slider-container-background):
3217         (audio::-webkit-media-controls-volume-slider-container-tint):
3218         (audio::-webkit-media-controls-toggle-closed-captions-button): Adjust fill.
3219         (audio::-webkit-media-controls-fullscreen-button): Adjust fill.
3220         (audio::-webkit-media-controls-fullscreen-button.exit): Adjust fill.
3221         (video:-webkit-full-screen::-webkit-media-controls-panel):
3222         (audio:-webkit-full-screen::-webkit-media-controls-panel-tint):
3223         (audio:-webkit-full-screen::-webkit-media-controls-panel-background):
3224         (video:-webkit-full-screen::-webkit-media-controls-panel .volume-box):
3225         (video:-webkit-full-screen::-webkit-media-controls-play-button):
3226         (video:-webkit-full-screen::-webkit-media-controls-seek-back-button):
3227         (video:-webkit-full-screen::-webkit-media-controls-seek-forward-button):
3228         (video:-webkit-full-screen::-webkit-media-controls-timeline-container):
3229         (video:-webkit-full-screen::-webkit-media-controls-status-display):
3230         (audio::-webkit-media-controls-panel .volume-box:active): Deleted.
3231         * Modules/mediacontrols/mediaControlsApple.js:
3232         (Controller.prototype.createControls):
3233         (Controller.prototype.configureInlineControls): Add new divs for blurred background effect.
3234         (Controller.prototype.configureFullScreenControls): Ditto.
3235         (Controller.prototype.handlePanelMouseDown): The tint div is now in front.
3236         (Controller.prototype.drawTimelineBackground): Adjust colors to make border look better with new background.
3237         (Controller.prototype.drawVolumeBackground): Ditto.
3238
3239 2015-03-26  Geoffrey Garen  <ggaren@apple.com>
3240
3241         Assertion firing in JavaScriptCore/parser/parser.h for statesman.com site
3242         https://bugs.webkit.org/show_bug.cgi?id=142974
3243
3244         Reviewed by Joseph Pecoraro.
3245
3246         * bindings/js/JSLazyEventListener.cpp:
3247         (WebCore::JSLazyEventListener::initializeJSFunction): Use the new override
3248         line number API to guarantee that errors will map to the .html file locations
3249         that we like.
3250
3251         * bindings/js/ScriptController.cpp:
3252         (WebCore::ScriptController::eventHandlerPosition): Added a FIXME to cover
3253         some cases where our line and column numbers are still nonsense.
3254
3255 2015-03-26  Beth Dakin  <bdakin@apple.com>
3256
3257         Relevant repainted objects callback is inaccurate and inconsistent for PDF 
3258         documents
3259         https://bugs.webkit.org/show_bug.cgi?id=143118
3260         -and corresponding-
3261         rdar://problem/13371582
3262
3263         Reviewed by Tim Horton.
3264
3265         Investigating this bug resulted in finding two things that should change for the 
3266         relevant repainted objects heuristic. First, we should not count any objects 
3267         painted while updating control tints. And secondly, we should not use it at all 
3268         for plugin documents. In other documents, we count the plugin area as “painted” 
3269         when we get to paint whether or not the plugin has actually loaded. This is 
3270         intentional because it allows us to account for chunks of the page that will be 
3271         filled in by possibly slow-loading ads. However, if the plugin is the whole 
3272         document, then the heuristic just doesn’t make any sense and it leads to 
3273         inconsistent behavior at different window sizes. So we’ll only count plugins when 
3274         the document is not a plugin document. 
3275
3276         Don’t count objects during this paint!
3277         * page/FrameView.cpp:
3278         (WebCore::FrameView::updateControlTints):
3279         * page/Page.h:
3280         (WebCore::Page::setIsCountingRelevantRepaintedObjects):
3281
3282         Make sure the document is not a plugin document.
3283         * rendering/RenderEmbeddedObject.cpp:
3284         (WebCore::RenderEmbeddedObject::paint):
3285
3286 2015-03-26  Alex Christensen  <achristensen@webkit.org>
3287
3288         Progress towards CMake on Mac.
3289         https://bugs.webkit.org/show_bug.cgi?id=143112
3290
3291         Reviewed by Chris Dumez.
3292
3293         * CMakeLists.txt:
3294         * PlatformEfl.cmake:
3295         * PlatformGTK.cmake:
3296         * PlatformMac.cmake:
3297         * platform/graphics/mac/IconMac.mm:
3298
3299 2015-03-26  Jer Noble  <jer.noble@apple.com>
3300
3301         [iOS] Accessibility crashing because MediaPlayer is laying out UI off the main thread
3302         https://bugs.webkit.org/show_bug.cgi?id=142970
3303
3304         Reviewed by Eric Carlson.
3305
3306         isMainThread() will (ironically) return true if called from the web thread. Rather than dispatch
3307         synchronously to the main thread to allocate the _volumeView, dispatch asynchronously and handle
3308         the case where the MPVolumeView has not yet been created.
3309
3310         * platform/audio/ios/MediaSessionManagerIOS.mm:
3311         (-[WebMediaSessionHelper allocateVolumeView]): Dispatch to the main thread to allocate. Move notification
3312             registration to -setVolumeView:.
3313         (-[WebMediaSessionHelper setVolumeView:]): Added. Register/Unregister for route availablitiy notifications.
3314         (-[WebMediaSessionHelper hasWirelessTargetsAvailable]): Handle the possibility of a nil _volumeView.
3315
3316 2015-03-26  Benjamin Poulain  <bpoulain@apple.com>
3317
3318         Fix state maching debugging after r181964
3319         https://bugs.webkit.org/show_bug.cgi?id=143082
3320
3321         Reviewed by Alex Christensen.
3322
3323         * contentextensions/ContentExtensionCompiler.cpp:
3324         (WebCore::ContentExtensions::compileRuleList):
3325
3326 2015-03-25  David Hyatt  <hyatt@apple.com>
3327
3328         Improve the offsetWidth/Height layout optimization
3329         https://bugs.webkit.org/show_bug.cgi?id=143008
3330
3331         Reviewed by Zalan Bujtas.
3332
3333         * dom/Document.cpp:
3334         (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
3335         * dom/Document.h:
3336         Change Element* to Element&. Clean up the dimension bits to use shifting. Remove both the inline and