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