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