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