<attachment> icons are low-resolution when transformed or under page scale
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-03-04  Timothy Horton  <timothy_horton@apple.com>
2
3         <attachment> icons are low-resolution when transformed or under page scale
4         https://bugs.webkit.org/show_bug.cgi?id=142262
5         <rdar://problem/20035480>
6
7         Reviewed by Dean Jackson.
8
9         We should use Icon::createIconForFiles, just like <input type="file"> does,
10         instead of directly talking to IconServices. This results both in less code
11         and in NSImage's multiresolution magic making the icons sharp even under
12         the influence of transforms and page scale.
13
14         * WebCore.xcodeproj/project.pbxproj:
15         * platform/spi/mac/IconServicesSPI.h: Removed.
16         * platform/spi/mac/LaunchServicesSPI.h: Removed.
17         Get rid of IconServicesSPI.h and LaunchServicesSPI.h.
18
19         * platform/graphics/Icon.h:
20         Include RetainPtr just once.
21         paint() should take a GraphicsContext reference (null is not an option)
22         and a FloatRect (after all, it just turns around and converts to NSRect).
23
24         * platform/graphics/ios/IconIOS.mm:
25         (WebCore::Icon::paint):
26         * platform/graphics/mac/IconMac.mm:
27         (WebCore::Icon::createIconForFiles):
28         (WebCore::Icon::paint):
29         * platform/graphics/efl/IconEfl.cpp:
30         (WebCore::Icon::paint):
31         * platform/graphics/gtk/IconGtk.cpp:
32         (WebCore::Icon::paint):
33         * platform/graphics/win/IconWin.cpp:
34         (WebCore::Icon::paint):
35         Adapt to the paint() signature changes, fix some style, etc.
36
37         * rendering/RenderFileUploadControl.cpp:
38         (WebCore::RenderFileUploadControl::paintObject):
39         * rendering/RenderThemeIOS.mm:
40         (WebCore::RenderThemeIOS::paintFileUploadIconDecorations):
41         Adapt to the paint() signature changes.
42
43         * rendering/RenderThemeMac.mm:
44         (WebCore::paintAttachmentIcon):
45         Use Icon::createIconForFiles instead of IconServices.
46
47 2015-03-04  Tim Horton  <timothy_horton@apple.com>
48
49         <attachment> should not appear selected when the cursor is adjacent to it
50         https://bugs.webkit.org/show_bug.cgi?id=142311
51         <rdar://problem/20045862>
52
53         Reviewed by Dean Jackson.
54
55         * rendering/RenderAttachment.cpp:
56         (WebCore::RenderAttachment::isSelected): Deleted.
57         * rendering/RenderAttachment.h:
58         * rendering/RenderThemeMac.mm:
59         (WebCore::titleTextColorForAttachment):
60         (WebCore::RenderThemeMac::paintAttachment):
61         (WebCore::labelTextColorForAttachment): Deleted.
62         We were using the wrong (and far too complicated) mechanism to determine
63         if the attachment is selected (to decide which highlight color to use).
64         Instead, just check selectionState().
65
66 2015-03-04  Timothy Horton  <timothy_horton@apple.com>
67
68         <attachment> should show the file size as detail text below the icon
69         https://bugs.webkit.org/show_bug.cgi?id=142261
70         <rdar://problem/20009570>
71
72         Reviewed by Dean Jackson.
73
74         Test: fast/attachment/attachment-subtitle.html
75
76         * html/HTMLAttachmentElement.cpp:
77         (WebCore::HTMLAttachmentElement::setFile):
78         (WebCore::HTMLAttachmentElement::parseAttribute):
79         * html/HTMLAttachmentElement.h:
80         Let RenderAttachment know when the subtitle attribute changes.
81
82         * html/HTMLAttributeNames.in:
83         Add a subtitle attribute.
84
85         * rendering/RenderAttachment.cpp:
86         (WebCore::RenderAttachment::invalidate):
87         (WebCore::RenderAttachment::representedFileChanged): Deleted.
88         * rendering/RenderAttachment.h:
89         Rename representedFileChanged to invalidate; it will cause layout and
90         repaint of the attachment. Mostly for use from HTMLAttachmentElement,
91         when properties that affect the display and/or intrinsic size change.
92
93         * rendering/RenderThemeMac.mm:
94         (WebCore::attachmentTitleInactiveBackgroundColor):
95         (WebCore::attachmentTitleInactiveTextColor):
96         (WebCore::attachmentSubtitleTextColor):
97         (WebCore::titleTextColorForAttachment):
98         (WebCore::AttachmentLayout::addTitleLine):
99         (WebCore::AttachmentLayout::layOutTitle):
100         (WebCore::AttachmentLayout::layOutSubtitle):
101         (WebCore::AttachmentLayout::AttachmentLayout):
102         (WebCore::addAttachmentTitleBackgroundRightCorner):
103         (WebCore::addAttachmentTitleBackgroundLeftCorner):
104         (WebCore::paintAttachmentTitleBackground):
105         (WebCore::paintAttachmentTitle):
106         (WebCore::paintAttachmentSubtitle):
107         (WebCore::RenderThemeMac::paintAttachment):
108         (WebCore::attachmentLabelInactiveBackgroundColor): Deleted.
109         (WebCore::attachmentLabelInactiveTextColor): Deleted.
110         (WebCore::labelTextColorForAttachment): Deleted.
111         (WebCore::AttachmentLayout::addLine): Deleted.
112         (WebCore::AttachmentLayout::layOutLabel): Deleted.
113         (WebCore::addAttachmentLabelBackgroundRightCorner): Deleted.
114         (WebCore::addAttachmentLabelBackgroundLeftCorner): Deleted.
115         (WebCore::paintAttachmentLabelBackground): Deleted.
116         (WebCore::paintAttachmentLabel): Deleted.
117         Rename everything "label" to "title" (except LabelLine, which is not
118         specifically about the title). We're going to use "title" for the
119         main text below the icon, and "subtitle" for the secondary text below that.
120
121         Avoid keeping the CTFonts on the AttachmentLayout; there's no need for it.
122
123         Add layOutSubtitle and paintAttachmentSubtitle, which orient and paint
124         the subtitle (below the title, in blue, smaller than the label).
125
126 2015-03-04  David Kilzer  <ddkilzer@apple.com>
127
128         [Windows] Build fix: Make sure to include <CoreMedia/CoreMedia.h> before redefining CMSampleBuffer
129
130         More fallout from:
131
132         Switch remaining CoreMedia soft-linking in WebCore over to CoreMediaSoftLink.{cpp,h}
133         <http://webkit.org/b/141870>
134
135         * platform/cf/CoreMediaSoftLink.cpp:
136         * platform/cf/CoreMediaSoftLink.h:
137         - Remove include of <CoreMedia/CoreMedia.h> here.  These already
138           include CoreMediaSPI.h.
139         * platform/spi/cf/CoreMediaSPI.h:
140         - Add include of <CoreMedia/CoreMedia.h> here.
141         - Remove redundant include of <CoreMedia/CMTime.h> for Windows.
142
143 2015-03-04  David Kilzer  <ddkilzer@apple.com>
144
145         [iOS] Fix build with newer clang due to duplicate macro definition
146
147         Fallout from:
148
149         Switch remaining CoreMedia soft-linking in WebCore over to CoreMediaSoftLink.{cpp,h}
150         <http://webkit.org/b/141870>
151
152         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
153         Remove duplicate kCMTimeIndefinite macro.
154
155 2015-03-04  Roger Fong  <roger_fong@apple.com>
156
157         Update inline media control icons for OSX.
158         https://bugs.webkit.org/show_bug.cgi?id=142305.
159         <rdar://problem/19997484>
160
161         Reviewed by Dean Jackson.
162
163         Changes include: new volume button, new full screen button, new play/pause button.
164         Repositioning of 30 second and play buttons.
165         * Modules/mediacontrols/mediaControlsApple.css:
166         (audio::-webkit-media-controls-panel button):
167         (audio::-webkit-media-controls-rewind-button):
168         (audio::-webkit-media-controls-play-button):
169         (audio::-webkit-media-controls-play-button.paused):
170         (audio::-webkit-media-controls-panel .mute-box):
171         (video::-webkit-media-controls-volume-max-button):
172         (video::-webkit-media-controls-volume-min-button):
173         (audio::-webkit-media-controls-toggle-closed-captions-button):
174         (audio::-webkit-media-controls-fullscreen-button):
175         (audio::-webkit-media-controls-current-time-display):
176         * Modules/mediacontrols/mediaControlsApple.js:
177         (Controller.prototype.configureInlineControls): Swap positions of rewind and play buttons.
178         (Controller.prototype.handleMuteButtonClicked): Remember to update volume slider when necessary.
179         (Controller.prototype.updateVolume): Ditto
180
181 2015-03-04  Andy Estes  <aestes@apple.com>
182
183         [Content Filtering] Rename ContentFilterMac.mm to ContentFilter.cpp
184         https://bugs.webkit.org/show_bug.cgi?id=142313
185
186         Reviewed by Anders Carlsson.
187
188         ContentFilterMac.mm no longer contains any Objective-C code, so rename it to ContentFilter.cpp. It is also no longer Mac-specific, so move it up to platform/.
189
190         * WebCore.xcodeproj/project.pbxproj:
191         * platform/ContentFilter.cpp: Renamed from Source/WebCore/platform/mac/ContentFilterMac.mm.
192         * platform/cocoa/NetworkExtensionContentFilter.h: Replaced NSInteger with long.
193
194 2015-03-04  Dean Jackson  <dino@apple.com>
195
196         REGRESSION (r179597): Can't see power saver banner for plugins
197         https://bugs.webkit.org/show_bug.cgi?id=142312
198         <rdar://problem/20040517>
199
200         Reviewed by Brent Fulgham.
201
202         We were being a bit too restrictive when deciding a child
203         should not create a renderer. All shadow root children
204         of the snapshotted plugin need one.
205
206         * html/HTMLPlugInImageElement.cpp:
207         (WebCore::HTMLPlugInImageElement::childShouldCreateRenderer):
208         Test if we're part of the shadow tree.
209
210 2015-03-03  Andy Estes  <aestes@apple.com>
211
212         [Content Filtering] Make it easier to add new content filters
213         https://bugs.webkit.org/show_bug.cgi?id=142255
214
215         Reviewed by Sam Weinig.
216
217         ContentFilter was becoming a bit of a mess, with both the WebFilterEvaluator and NEFilterSource implementations
218         awkwardly living side-by-side. This patch cleans things up by moving these implementations into two separate
219         classes and turning ContentFilter itself into an abstract interface that each implements. A new class called
220         ContentFilterCollection, which also inherits from ContentFilter, manages the collection of individual content
221         filters and is vended to the rest of the system by ContentFilter::createIfNeeded().
222
223         This refactoring will make it easier to add a third type of content filter in a follow-on patch, namely a mock
224         content filter for testing purposes.
225
226         * WebCore.xcodeproj/project.pbxproj:
227         * loader/DocumentLoader.cpp:
228         (WebCore::DocumentLoader::responseReceived): Called ContentFilter::createIfNeeded() instead of instantiating a ContentFilter directly.
229         * platform/ContentFilter.h:
230         (WebCore::ContentFilter::~ContentFilter):
231         * platform/cocoa/NetworkExtensionContentFilter.h: Copied from Source/WebCore/platform/ContentFilter.h.
232         * platform/cocoa/NetworkExtensionContentFilter.mm: Added.
233         (WebCore::NetworkExtensionContentFilter::canHandleResponse): Moved NEFilterSource code from ContentFilterMac.mm to here.
234         (WebCore::NetworkExtensionContentFilter::create): Ditto.
235         (WebCore::NetworkExtensionContentFilter::NetworkExtensionContentFilter): Ditto.
236         (WebCore::NetworkExtensionContentFilter::~NetworkExtensionContentFilter): Ditto.
237         (WebCore::NetworkExtensionContentFilter::addData): Ditto.
238         (WebCore::NetworkExtensionContentFilter::finishedAddingData): Ditto.
239         (WebCore::NetworkExtensionContentFilter::needsMoreData): Ditto.
240         (WebCore::NetworkExtensionContentFilter::didBlockData): Ditto.
241         (WebCore::NetworkExtensionContentFilter::getReplacementData): Ditto.
242         (WebCore::NetworkExtensionContentFilter::unblockHandler): Ditto.
243         * platform/cocoa/ParentalControlsContentFilter.h: Copied from Source/WebCore/platform/ContentFilter.h.
244         * platform/cocoa/ParentalControlsContentFilter.mm: Added.
245         (WebCore::ParentalControlsContentFilter::canHandleResponse): Moved WebFilterEvaluator code from ContentFilterMac.mm to here.
246         (WebCore::ParentalControlsContentFilter::create): Ditto.
247         (WebCore::ParentalControlsContentFilter::ParentalControlsContentFilter): Ditto.
248         (WebCore::ParentalControlsContentFilter::addData): Ditto.
249         (WebCore::ParentalControlsContentFilter::finishedAddingData): Ditto.
250         (WebCore::ParentalControlsContentFilter::needsMoreData): Ditto.
251         (WebCore::ParentalControlsContentFilter::didBlockData): Ditto.
252         (WebCore::ParentalControlsContentFilter::getReplacementData): Ditto.
253         (WebCore::ParentalControlsContentFilter::unblockHandler): Ditto.
254         * platform/mac/ContentFilterMac.mm:
255         (WebCore::contentFilterType): Added a helper function template that creates a new ContentFilterType.
256         (WebCore::contentFilterTypes): Registered a ContentFilterType for each type of content filter.
257         (WebCore::ContentFilter::createIfNeeded): Created a ContentFilterCollection containing each content filter that can handle the given response.
258         (WebCore::ContentFilterCollection::ContentFilterCollection): Constructs a ContentFilterCollection given a Vector of content filters.
259         (WebCore::ContentFilterCollection::addData): Forwarded the call to each content filter in m_contentFilters.
260         (WebCore::ContentFilterCollection::finishedAddingData): Ditto.
261         (WebCore::ContentFilterCollection::needsMoreData): Ditto.
262         (WebCore::ContentFilterCollection::didBlockData): Ditto.
263         (WebCore::ContentFilterCollection::getReplacementData): Returned replacement data for the first filter that blocked the load.
264         If no filter blocked the load, returned the first filter's replacement data.
265         (WebCore::ContentFilterCollection::unblockHandler): Returned the unblock handler for the first filter that blocked the load.
266         (WebCore::ContentFilter::ContentFilter): Deleted.
267         (WebCore::ContentFilter::~ContentFilter): Deleted.
268         (WebCore::ContentFilter::canHandleResponse): Deleted.
269         (WebCore::ContentFilter::addData): Deleted.
270         (WebCore::ContentFilter::finishedAddingData): Deleted.
271         (WebCore::ContentFilter::needsMoreData): Deleted.
272         (WebCore::ContentFilter::didBlockData): Deleted.
273         (WebCore::ContentFilter::getReplacementData): Deleted.
274         (WebCore::ContentFilter::unblockHandler): Deleted.
275
276 2015-03-04  David Kilzer  <ddkilzer@apple.com>
277
278         Switch remaining CoreMedia soft-linking in WebCore over to CoreMediaSoftLink.{cpp,h}
279         <http://webkit.org/b/141870>
280
281         Reviewed by Alex Christensen.
282
283         * Configurations/WebCore.unexp:
284         - Remove all weak symbols for CoreMedia.framework as they should
285           no longer appear.
286
287         * Modules/plugins/QuickTimePluginReplacement.mm:
288         * platform/graphics/avfoundation/MediaTimeAVFoundation.cpp:
289         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
290         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
291         - Clean up headers.
292
293         * platform/cf/CoreMediaSoftLink.cpp:
294         * platform/cf/CoreMediaSoftLink.h:
295         - Add soft-link functions and constants from remaining source
296           files.
297
298         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
299         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
300         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
301         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isAvailable):
302         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
303         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
304         * platform/mac/PlatformClockCM.mm:
305         * platform/mediastream/mac/AVMediaCaptureSource.mm:
306         * platform/mediastream/mac/AVVideoCaptureSource.mm:
307         - Switch to using CoreMediaSoftLink.h.
308
309         * platform/mac/SoftLinking.h:
310         * platform/win/SoftLinking.h:
311         - Remove 'const' from SOFT_LINK_CONSTANT_{HEADER,SOURCE}()
312           macros since it won't work with const structs.
313
314         * platform/spi/cf/CoreMediaSPI.h:
315         - Add SPI declarations for Windows originally from
316           InbandTextTrackPrivateAVF.cpp.
317
318 2015-03-04  Commit Queue  <commit-queue@webkit.org>
319
320         Unreviewed, rolling out r181001 and r181003.
321         https://bugs.webkit.org/show_bug.cgi?id=142307
322
323         Broke many tests (Requested by ap on #webkit).
324
325         Reverted changesets:
326
327         "Make JavaScript binding get and set legacy event listener
328         attributes directly"
329         https://bugs.webkit.org/show_bug.cgi?id=142282
330         http://trac.webkit.org/changeset/181001
331
332         "Update bindings tests after r181001."
333         http://trac.webkit.org/changeset/181003
334
335 2015-03-04  Roger Fong  <roger_fong@apple.com>
336
337         Update elapsed/remaining time displays on media inline controls on OSX.
338         https://bugs.webkit.org/show_bug.cgi?id=142264.
339         <rdar://problem/19997487>
340
341         Reviewed by Dean Jackson.
342
343         Div surrounding times are set widths. A larger width is used for times that are
344         an hour or longer. Time elapsed is right justified. Time remaining is left justified.
345         Times are displayed in 11pt Helvetica Neue.
346         * Modules/mediacontrols/mediaControlsApple.css:
347         (audio::-webkit-media-controls-time-remaining-display):
348         (audio::-webkit-media-controls-current-time-display):
349         (audio::-webkit-media-controls-time-remaining-display.hour-long-time):
350         (audio::-webkit-media-controls-current-time-display.hour-long-time):
351         (audio::-webkit-media-controls-time-remaining-display.ten-hour-long-time):
352         (audio::-webkit-media-controls-current-time-display.ten-hour-long-time):
353         * Modules/mediacontrols/mediaControlsApple.js:
354         (Controller.prototype.updateDuration):
355
356 2015-03-04  Myles C. Maxfield  <mmaxfield@apple.com>
357
358         Implement -apple-trailing-word: -apple-partially-balanced
359         https://bugs.webkit.org/show_bug.cgi?id=142253
360
361         Reviewed by David Hyatt.
362
363         This patch implements a history mechanism for line breaking. In particular, this patch partitions
364         the updates to the current line breaking location into two kinds: conceptually new breaking locations,
365         and fixups to existing locations. Then, this patch remembers all the fixed up breaking locations, up
366         to a maximum number of remembered locations.
367
368         The patch then uses this memory to change the line-breaking selection based on the rules of
369         -apple-trailing-word.
370
371         Test: fast/text/trailing-word.html
372
373         * rendering/line/BreakingContextInlineHeaders.h:
374         Use InlineIteratorHistory as a proxy for the current breaking location. Note that all these functions
375         are inlined, so the overhead should be next to nothing when -apple-trailing-word is not in use.
376         (WebCore::BreakingContext::BreakingContext): Use InlineIteratorHistory instead of InlineIterator
377         (WebCore::BreakingContext::lineBreak): Ditto.
378         (WebCore::BreakingContext::clearLineBreakIfFitsOnLine): Ditto
379         (WebCore::BreakingContext::commitLineBreakAtCurrentWidth): Ditto
380         (WebCore::BreakingContext::InlineIteratorHistory::InlineIteratorHistory): Keeps track of historical
381         breaking locations
382         (WebCore::BreakingContext::InlineIteratorHistory::push): Remember a new breaking location
383         (WebCore::BreakingContext::InlineIteratorHistory::update): Update an existing breaking location
384         (WebCore::BreakingContext::InlineIteratorHistory::renderer): Forwarded to the current breaking location
385         (WebCore::BreakingContext::InlineIteratorHistory::offset): Ditto
386         (WebCore::BreakingContext::InlineIteratorHistory::atTextParagraphSeparator):  Ditto
387         (WebCore::BreakingContext::InlineIteratorHistory::previousInSameNode): Ditto
388         (WebCore::BreakingContext::InlineIteratorHistory::get): Get one of the remembered breaking locations
389         (WebCore::BreakingContext::InlineIteratorHistory::current): Get the current breaking location
390         (WebCore::BreakingContext::InlineIteratorHistory::historyLength):
391         (WebCore::BreakingContext::InlineIteratorHistory::moveTo): Forwarded to the current breaking location.
392         (WebCore::BreakingContext::InlineIteratorHistory::increment): Ditto
393         (WebCore::BreakingContext::InlineIteratorHistory::clear): Ditto
394         (WebCore::BreakingContext::handleBR): Use InlineIteratorHistory instead of InlineIterator
395         (WebCore::BreakingContext::handleFloat): Ditto
396         (WebCore::BreakingContext::handleText): Use InlineIteratorHistory instead of InlineIterator
397         (WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded): Style
398         (WebCore::checkMidpoints): Use InlineIteratorHistory instead of InlineIterator
399         (WebCore::BreakingContext::handleEndOfLine): If -apple-trailing-word is in effect, use
400         optimalLineBreakLocationForTrailingWord().
401         (WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord): Use the remembered breaking
402         locations and choose the optimal one.
403         (WebCore::BreakingContext::lineBreakRef): Deleted.
404
405 2015-03-04  Timothy Horton  <timothy_horton@apple.com>
406
407         <attachment> title text disappears when dragging
408         https://bugs.webkit.org/show_bug.cgi?id=142263
409         <rdar://problem/20035515>
410
411         Reviewed by Sam Weinig.
412
413         * rendering/RenderThemeMac.mm:
414         (WebCore::RenderThemeMac::paintAttachment):
415         We use NSColors with CoreText, which requires that Cocoa knows the current
416         CGContext out-of-band (through the NSGraphicsContext currentContext mechanism).
417         Otherwise, sometimes (especially when dragging), it will try to apply the
418         text foreground color to a null context, complain to the system log, and fail
419         to render the text.
420
421 2015-03-04  Jer Noble  <jer.noble@apple.com>
422
423         [Mac] YouTube playback at 1.5x speed has audible distortion
424         https://bugs.webkit.org/show_bug.cgi?id=142280
425
426         Reviewed by Eric Carlson.
427
428         Use the high-quality AVAudioTimePitchAlgorithmSpectral algorithm for the 
429         AVSampleBufferAudioRenderer rather than its default value of 
430         AVAudioTimePitchAlgorithmTimeDomain.
431
432         Drive-by fix:
433
434         Might as well add support for MediaPlayer::setPreservesPitch() while we're
435         changing the audio pitch algorithm. If preservesPitch() is false use the
436         AVAudioTimePitchAlgorithmVarispeed algorithm in both AVFObjC-based media players
437         (MediaPlayerPrivateAVFoundationObjC & MediaPlayerPrivateMediaSourceAVFObjC).
438
439         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
440         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
441         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
442         (WebCore::MediaPlayerPrivateAVFoundationObjC::setPreservesPitch):
443         (WebCore::MediaPlayerPrivateAVFoundationObjC::setRateDouble): Deleted.
444         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
445         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
446         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setPreservesPitch):
447         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer):
448
449 2015-03-04  Jer Noble  <jer.noble@apple.com>
450
451         [MSE][EME][Mac] Calling close on a MediaKeysSession will cause many decoding errors to be emitted
452         https://bugs.webkit.org/show_bug.cgi?id=142285
453
454         Reviewed by Eric Carlson.
455
456         When a MediaKeySession (backed by CDMSessionMediaSourceAVFObjC) is closed and the
457         underlying AVStreamSession is invalidated, the decryption context for in-flight
458         CMSampleBuffers is also invalidated, and the AVSampleBufferDisplayLayer will issue
459         one error for each enqueued and un-displayed sample in its image-queue. -flush-ing
460         the AVSampleBufferDisplayLayer is not enough, as the flush only takes effect
461         asynchronously the next time the layer needs new samples.
462
463         Add a workaround until framework-level support lands to fully flush enqueued and
464         encrypted frames.
465
466         When the CDMSessionMediaSOurceAVFObjC object recieves an error from the layer,
467         check to see if the session has been stopped. If so, and if the error in question is
468         one that indicates that the samples decryption context has been invalidated, suppress
469         the error and instruct the sender to suppress the error as well. This workaround will
470         be removed once real support for synchronous flushing lands in <rdar://problem/20027434.>
471
472         Still, we'll make our best effort to flush undisplayed frames when our CDM session is
473         invalidated. Move away from std::map and instead use HashMap to store the set of 
474         AVSampleBufferAudioRenderers. This allows us to use C++11 style loops against just
475         the HashMap's set of values.
476
477         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
478         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
479         (WebCore::CDMSessionMediaSourceAVFObjC::releaseKeys): Flush and set m_stopped.
480         (WebCore::CDMSessionMediaSourceAVFObjC::layerDidReceiveError): Check m_stopped and the
481             error code and bail before issuing the error.
482         (WebCore::CDMSessionMediaSourceAVFObjC::rendererDidReceiveError): Ditto.
483         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
484         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
485         (-[WebAVSampleBufferErrorListener layerFailedToDecode:]): Drive-by fix. Check whether
486             the layer is in the set of listened-to layers only back in the main thread; the
487             listnener may have been unregistered by the time the main thread was called.
488         (WebCore::SourceBufferPrivateAVFObjC::destroyRenderers): std::map -> HashMap.
489         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled): Ditto.
490         (WebCore::SourceBufferPrivateAVFObjC::flushAndEnqueueNonDisplayingSamples): Ditto.
491         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): Ditto.
492         (WebCore::SourceBufferPrivateAVFObjC::isReadyForMoreSamples): Ditto.
493         (WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples): Ditto.
494         (WebCore::SourceBufferPrivateAVFObjC::notifyClientWhenReadyForMoreSamples): Ditto.
495         (WebCore::SourceBufferPrivateAVFObjC::flush): Added; call -flush on all the display
496             layers and audio renderers.
497         (WebCore::SourceBufferPrivateAVFObjC::layerDidReceiveError): Check if any clients
498             asked to ignore the error, and if so, bail.
499         (WebCore::SourceBufferPrivateAVFObjC::rendererDidReceiveError): Ditto.
500
501 2015-03-04  Alex Christensen  <achristensen@webkit.org>
502
503         Update bindings tests after r181001.
504
505         * bindings/scripts/test/JS/*.cpp:
506         Class names changed to auto.
507
508 2015-03-04  Brent Fulgham  <bfulgham@apple.com>
509
510         [Win] Missing dependency checking in DerivedSources.make for FeatureDefines.props
511         https://bugs.webkit.org/show_bug.cgi?id=142284
512
513         Reviewed by David Kilzer.
514
515         Make DerivedSources.make understand its build dependency on FeatureDefines.props
516         when building on Windows:
517         1. Modify DerivedSources.make to declare a default dependency (on Windows)
518            to $(WEBKIT_LIBRARIES)/tools/vsprops/FeatureDefines.props.
519         2. Update the Windows script 'build-generated-files.pl' to specify the correct
520            FeatureDefines{Cairo}.props value to use, depending on build environment.
521
522         * DerivedSources.make:
523         * WebCore.vcxproj/build-generated-files.pl:
524
525 2015-03-04  Darin Adler  <darin@apple.com>
526
527         Make JavaScript binding get and set legacy event listener attributes directly
528         https://bugs.webkit.org/show_bug.cgi?id=142282
529
530         Reviewed by Sam Weinig.
531
532         Test: fast/dom/legacy-event-handler-attributes.html
533
534         This patch changes the JavaScript getters and setters for these attributes
535         to work directly without requiring any functions in the C++ DOM implementation.
536         A subsequent patch will remove the now-unused C++ DOM implementation.
537
538         * bindings/js/JSEventListener.cpp:
539         (WebCore::legacyEventListenerAttribute): Added.
540         (WebCore::createEventListenerForLegacyAttribute): Added.
541         (WebCore::setLegacyEventListenerAttribute): Added.
542         (WebCore::legacyWindowEventListenerAttribute): Added.
543         (WebCore::setLegacyWindowEventListenerAttribute): Added.
544
545         * bindings/js/JSEventListener.h:
546         (WebCore::createJSEventListenerForAttribute): Deleted.
547
548         * bindings/scripts/CodeGeneratorJS.pm:
549         (GenerateAttributeEventListenerCall): Deleted.
550         (LegacyEventListenerAttributeEventName): Added.
551         (LegacyEventListenerAttributePrefix): Added.
552         (GenerateImplementation): Use "auto" in lots of places to simplify the code
553         generation. Replaced the old inlined code to deal with legacy event listener
554         attributes with code that simply calls the new functions from JSEventLister.h.
555         (GenerateCallWith): Use "auto".
556         (GenerateConstructorDefinition): Ditto.
557
558 2015-03-03  Sam Weinig  <sam@webkit.org>
559
560         [Content Extensions] Split parsing and compiling of content extensions into their own files
561         https://bugs.webkit.org/show_bug.cgi?id=142259
562
563         Reviewed by Anders Carlsson.
564
565         Added new unit test:
566             ContentFilterTest.Basic
567
568         * WebCore.xcodeproj/project.pbxproj:
569         Add new files (CompiledContentExtension.h/cpp, ContentExtensionCompiler.h/cpp, and ContentExtensionParser.h/cpp)
570
571         * contentextensions/CompiledContentExtension.cpp: Added.
572         * contentextensions/CompiledContentExtension.h: Added.
573         Add new class for holding onto the compiled content extension itself. Make it ThreadSafeRefCounted so it is easy
574         to move between threads which will be important in a subsequent patch where we enable compilation on a background
575         thread.
576
577         * contentextensions/ContentExtensionCompiler.cpp: Added.
578         (WebCore::ContentExtensions::serializeActions):
579         (WebCore::ContentExtensions::compileRuleList):
580         * contentextensions/ContentExtensionCompiler.h: Added.
581         Moving compilation to its own file. Was previously in ContentExtensionsBackend. This is necessary because
582         we will want to be able to compile without the need of a backend.
583
584         * contentextensions/ContentExtensionParser.cpp: Copied from contentextensions/ContentExtensionsManager.cpp.
585         * contentextensions/ContentExtensionParser.h: Copied from contentextensions/ContentExtensionsManager.h.
586         Renamed ContentExtensionsManager to ContentExtensionParser, since that is all it is doing.
587
588         * contentextensions/ContentExtensionsBackend.cpp:
589         (WebCore::ContentExtensions::ContentExtensionsBackend::addContentExtension):
590         (WebCore::ContentExtensions::ContentExtensionsBackend::removeContentExtension):
591         (WebCore::ContentExtensions::ContentExtensionsBackend::removeAllContentExtensions):
592         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForURL):
593         (WebCore::ContentExtensions::ContentExtensionsBackend::serializeActions): Deleted.
594         (WebCore::ContentExtensions::ContentExtensionsBackend::setRuleList): Deleted.
595         (WebCore::ContentExtensions::ContentExtensionsBackend::removeRuleList): Deleted.
596         (WebCore::ContentExtensions::ContentExtensionsBackend::removeAllRuleLists): Deleted.
597         * contentextensions/ContentExtensionsBackend.h:
598         Change the backend to use the new CompiledContentExtension and change the terminology to
599         reference content extensions, rather than rule lists.
600
601         * page/UserContentController.cpp:
602         (WebCore::UserContentController::addUserContentFilter):
603         (WebCore::UserContentController::removeUserContentFilter):
604         (WebCore::UserContentController::removeAllUserContentFilters):
605         Update for new names and change addUserContentFilter to explicitly compile the JSON
606         rule list before handing it to the backend. In subsequent changes, addUserContentFilter
607         should be changed to take the compiled content extension, and it should become the responsibility
608         of the called (WebKit) to create them.
609
610 2015-03-04  Philippe Normand  <pnormand@igalia.com>
611
612         [GStreamer] the GST_SCHEDULING_FLAG_BANDWIDTH_LIMITED should be wrapped by a ifdef
613         https://bugs.webkit.org/show_bug.cgi?id=142274
614
615         Reviewed by Carlos Garcia Campos.
616
617         Don't handle scheduling queries if building against versions of
618         GStreamer older than 1.2.0.
619
620         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
621         (webKitWebSrcQueryWithParent):
622
623 2015-03-03  Yoav Weiss  <yoav@yoav.ws>
624
625         Add a microtask abstraction
626         https://bugs.webkit.org/show_bug.cgi?id=137496
627
628         Reviewed by Sam Weinig.
629
630         This patch adds a microtask abstraction: https://html.spec.whatwg.org/multipage/webappapis.html#microtask
631         That abstraction is required in order to enable async loading of images,
632         which is in turn required to enable support for the picture element, as well as
633         to make sure that the order of properties set on HTMLImageElement has no implications.
634
635         A similar patch was rolled back in r180914. This patch is an improved version.
636
637         * WebCore.vcxproj/WebCore.vcxproj: Add MicroTask.{h,cpp} to the project.
638         * WebCore.vcxproj/WebCoreTestSupport.vcxproj: Add MicroTaskTest.{h,cpp} to the project.
639         * WebCore.vcxproj/WebCore.vcxproj.filters: Add MicroTask.{h,cpp} to the project.
640         * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters: Add MicroTaskTest.{h,cpp} to the project.
641         * WebCore.xcodeproj/project.pbxproj: Add MicroTask{,Test}.{h,cpp} to the project.
642         * dom/Document.h: Add WEBCORE_EXPORT to addConsoleMessage, so it can be used in MicroTaskTest that's in WebCoreTestSupport..
643         * dom/MicroTask.h: Add a MicroTask interface class. Add a MicroTaskQueue singleton.
644         (WebCore::MicroTask::~MicroTask):
645         (WebCore::MicroTask::run): Run the microtask.
646         * dom/MicroTask.cpp: Implement the MicroTaskQueue singleton.
647         (WebCore::MicroTaskQueue::singleton): Get a singleton instance of MicroTaskQueue.
648         (WebCore::MicroTaskQueue::queueMicroTask): Add a microtask to the queue.
649         (WebCore::MicroTaskQueue::runMicroTasks): Run all the microtasks in the queue and clear it.
650         * dom/ScriptRunner.cpp: Trigger running of all microtasks in queue.
651         (WebCore::ScriptRunner::timerFired):
652         * html/parser/HTMLScriptRunner.cpp: Trigger running of all microtasks in queue.
653         (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent):
654         (WebCore::HTMLScriptRunner::executeScriptsWaitingForParsing):
655         (WebCore::HTMLScriptRunner::runScript):
656         * testing/Internals.cpp: Add a method to queue a test microtask.
657         (WebCore::Internals::queueMicroTask):
658         * testing/Internals.h: Add a method to queue a test microtask.
659         (WebCore::Internals::queueMicroTask):
660         * testing/Internals.idl: Expose test microtask queueing to test JS.
661         * testing/MicroTaskTest.cpp: Add a test class that implements a microtask and prints to the console when it runs.
662         (WebCore::MicroTaskTest::run): Run the microtask
663         (WebCore::MicroTaskTest::create): Create a test microtask.
664         * testing/MicroTaskTest.h: Add a test class that implements a microtask.
665         (WebCore::MicroTaskTest::run):
666         (WebCore::MicroTaskTest::create):
667
668 2015-03-03  Brent Fulgham  <bfulgham@apple.com>
669
670         Scroll snap points are not supported on the main frame
671         https://bugs.webkit.org/show_bug.cgi?id=141973
672         <rdar://problem/19938393>
673
674         Reviewed by Simon Fraser.
675
676         No new tests. Tests will be added when the animation behavior is finalized. Manual tests are attached to the bug.
677
678         Update the ScrollingTreeFrameScrollingNodeMac class to implement the delegate interface needed by the
679         ScrollController. This involves the following:
680         1. Implement scrollOffsetOnAxis: Used by the AxisScrollAnimator to determine the current position of the ScrollableArea.
681         2. Implement immediateScrollOnAxis: Used by the AxisScrollAnimator to scroll the ScrollableArea
682
683         We also need to hold a copy of the snap points vector to send to the scrolling thread.
684
685         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
686         (WebCore::convertToLayoutUnits): Added helper function to match Scroll Snap Points API.
687         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren): Recognize and react to changes to
688         Scroll Snap Points on top-level frames.
689         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollOffsetOnAxis): Implement delegate method needed by the ScrollController.
690         (WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollOnAxis): Ditto.
691         * platform/cocoa/ScrollController.h:
692         * platform/cocoa/ScrollController.mm:
693         (WebCore::ScrollController::updateScrollAnimatorsAndTimers): Pass snap offsets to AxisScrollSnapAnimator constructor as references.
694         (WebCore::ScrollController::updateScrollSnapPoints): Added. Used by ScrollingTreeFrameScrollingNodeMac to update scroll snap point
695         settings in the scrolling thread.
696         * platform/mac/AxisScrollSnapAnimator.h:
697         * platform/mac/AxisScrollSnapAnimator.mm:
698         (WebCore::toWheelEventStatus): Don't ignore the "MayBegin" or "Cancelled" event phases.
699         (WebCore::AxisScrollSnapAnimator::AxisScrollSnapAnimator): Revise signature to take a reference to the layout units.
700         (WebCore::AxisScrollSnapAnimator::scrollSnapAnimationUpdate): Handle the case where this method gets called from a thread
701         when the scrollable area has already reached its final destination.
702         (WebCore::AxisScrollSnapAnimator::beginScrollSnapAnimation): Handle the possibility that the snap offset point vector might be
703         empty. Update method to account for m_snapOffsets being a value, instead of a pointer.
704
705 2015-03-03  Andy Estes  <aestes@apple.com>
706
707         [Content Filtering] Separate unblock handling into its own class
708         https://bugs.webkit.org/show_bug.cgi?id=142251
709
710         Reviewed by Andreas Kling.
711
712         Unblock handling is currently supported only for one type of content filter (WebFilterEvaluator) on one
713         platform (iOS). Having its implementation in ContentFilter is making it difficult to support other filters and
714         platforms, so let's separate unblock handling into its own class called ContentFilterUnblockHandler.
715
716         * WebCore.xcodeproj/project.pbxproj:
717         * loader/DocumentLoader.cpp:
718         (WebCore::DocumentLoader::finishedLoading): Passed a ContentFilterUnblockHandler to FrameLoaderClient::contentFilterDidBlockLoad.
719         (WebCore::DocumentLoader::dataReceived): Ditto.
720         * loader/FrameLoaderClient.h:
721         * platform/ContentFilter.h:
722         * platform/ContentFilterUnblockHandler.h: Copied from Source/WebCore/platform/ios/ContentFilterIOS.mm.
723         (WebCore::ContentFilterUnblockHandler::clear):
724         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm: Renamed from Source/WebCore/platform/ios/ContentFilterIOS.mm.
725         (WebCore::ContentFilterUnblockHandler::ContentFilterUnblockHandler):
726         (WebCore::ContentFilterUnblockHandler::encode):
727         (WebCore::ContentFilterUnblockHandler::decode):
728         (WebCore::scheme):
729         (WebCore::ContentFilterUnblockHandler::handleUnblockRequestAndDispatchIfSuccessful):
730         * platform/mac/ContentFilterMac.mm:
731         (WebCore::ContentFilter::unblockHandler):
732         (WebCore::ContentFilter::ContentFilter): Deleted.
733         (WebCore::ContentFilter::encode): Deleted.
734         (WebCore::ContentFilter::decode): Deleted.
735
736 2015-03-03  Alexey Proskuryakov  <ap@apple.com>
737
738         [Mac] Track localized name follows locale instead of primary language
739         https://bugs.webkit.org/show_bug.cgi?id=142242
740         rdar://problem/20000365
741
742         Reviewed by Eric Carlson.
743
744         * page/CaptionUserPreferencesMediaAF.cpp: (WebCore::trackDisplayName): Use the
745         language for localization, as CFBundle does.
746
747 2015-03-03  Alex Christensen  <achristensen@webkit.org>
748
749         [Win] Unreviewed build fix.
750
751         * WebCore.vcxproj/WebCoreIncludeCommon.props:
752         Include contentextensions subdirectory.
753
754 2015-03-03  Alex Christensen  <achristensen@webkit.org>
755
756         Prepare to use CSS selectors in content extensions.
757         https://bugs.webkit.org/show_bug.cgi?id=142227
758
759         Reviewed by Benjamin Poulain.
760
761         Test: http/tests/usercontentfilter/css-display-none.html
762
763         * CMakeLists.txt:
764         * WebCore.xcodeproj/project.pbxproj:
765         * contentextensions/ContentExtensionActions.h: Added.
766         * contentextensions/ContentExtensionRule.cpp:
767         (WebCore::ContentExtensions::Action::deserialize):
768         * contentextensions/ContentExtensionRule.h:
769         (WebCore::ContentExtensions::Action::Action):
770         (WebCore::ContentExtensions::Action::type):
771         (WebCore::ContentExtensions::Action::cssSelector):
772         * contentextensions/ContentExtensionsBackend.cpp:
773         (WebCore::ContentExtensions::ContentExtensionsBackend::serializeActions):
774         Put action descriptions into a compact format in a Vector 
775         to be able to be put into one block of shared read-only memory.
776         (WebCore::ContentExtensions::ContentExtensionsBackend::setRuleList):
777         Put an index of the beginning of the description into the NFA instead of the index of the rule
778         because we will be sharing the descriptions of the actions and not the rules.
779         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForURL):
780         (WebCore::ContentExtensions::ContentExtensionsBackend::actionForURL): Deleted.
781         Return a vector of actions to be able to do multiple actions for one URL.
782         * contentextensions/ContentExtensionsBackend.h:
783         * contentextensions/ContentExtensionsManager.cpp:
784         (WebCore::ContentExtensions::ExtensionsManager::loadTrigger):
785         (WebCore::ContentExtensions::ExtensionsManager::loadAction):
786         Added the css-display-none action type, which requires a selector.
787         (WebCore::ContentExtensions::ExtensionsManager::loadRule):
788         * loader/cache/CachedResourceLoader.cpp:
789         (WebCore::CachedResourceLoader::requestResource):
790         * page/UserContentController.cpp:
791         (WebCore::UserContentController::actionsForURL):
792         (WebCore::UserContentController::actionForURL): Deleted.
793         * page/UserContentController.h:
794
795 2015-03-03  Brent Fulgham  <bfulgham@apple.com>
796
797         Move scroll animating functions from ScrollAnimator to ScrollController
798         https://bugs.webkit.org/show_bug.cgi?id=142102
799         <rdar://problem/20007161>
800
801         Reviewed by Simon Fraser.
802
803         Tested by platform/mac-wk2/tiled-drawing/scrolling/fast-scroll-mainframe-zoom.html.
804
805         Do some refactoring of the various scrolling classes:
806         1. Consolidate animation times to RunLoop::Timer instead of a combination of WebCore::Timer
807            and CFRunLoopTimers. Do this for Scroll Snap Point and Rubberband animations.
808         2. Move ScrollController from platform/mac to platform/cocoa to enable sharing with iOS.
809         3. Move code from ScrollAnimator{Mac} -> ScrollController.
810         4. Rename scrollOffsetInAxis -> scrollOffsetOnAxis
811         5. Rename immediateScrollInAxis -> immediateScrollOnAxis
812
813         * WebCore.xcodeproj/project.pbxproj: Move ScrollController to 'platform/cocoa'
814         * page/mac/EventHandlerMac.mm: Make sure the scroll controller is notified of end-of-scroll
815         events, just as is done for the "event not handled" case in EventHandler.cpp. 
816         (WebCore::EventHandler::platformCompleteWheelEvent):
817         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: Remove timer and some delegate
818         methods, now that ScrollController is controlling this state.
819         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
820         (WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac): We no longer
821         need to clean up the CFRunLoopTimer.
822         (WebCore::ScrollingTreeFrameScrollingNodeMac::stopSnapRubberbandTimer): Make sure scroll
823         state is updated after rubber band snap.
824         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollOffsetOnAxis): Add temporary stub needed
825         until Bug1973 is completed.).
826         (WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollOnAxis): Ditto.
827         (WebCore::ScrollingTreeFrameScrollingNodeMac::startSnapRubberbandTimer): Deleted.
828         * platform/ScrollAnimator.cpp:
829         (WebCore::ScrollAnimator::ScrollAnimator):
830         (WebCore::ScrollAnimator::processWheelEventForScrollSnap): Just call the ScrollController method.
831         (WebCore::ScrollAnimator::handleWheelEvent): Ditto.
832         (WebCore::ScrollAnimator::updateScrollAnimatorsAndTimers): Ditto.
833         (WebCore::ScrollAnimator::scrollOffsetOnAxis): Renamed from scrollOffsetInAxis.
834         (WebCore::ScrollAnimator::immediateScrollOnAxis): Renamed from immediateScrollInAxis.
835         (WebCore::ScrollAnimator::scrollOffsetInAxis): Deleted.
836         (WebCore::ScrollAnimator::immediateScrollInAxis): Deleted.
837         (WebCore::ScrollAnimator::startScrollSnapTimer): Deleted.
838         (WebCore::ScrollAnimator::stopScrollSnapTimer): Deleted.
839         (WebCore::ScrollAnimator::horizontalScrollSnapTimerFired): Deleted.
840         (WebCore::ScrollAnimator::verticalScrollSnapTimerFired): Deleted.
841         * platform/ScrollAnimator.h:
842         * platform/cocoa/ScrollController.h: Copied from platform/mac/ScrollController.h.
843         (WebCore::ScrollControllerClient::startSnapRubberbandTimer):
844         (WebCore::ScrollControllerClient::stopSnapRubberbandTimer):
845         (WebCore::ScrollControllerClient::startScrollSnapTimer):
846         (WebCore::ScrollControllerClient::stopScrollSnapTimer):
847         * platform/cocoa/ScrollController.mm: Copied from platform/mac/ScrollController.mm.
848         (WebCore::ScrollController::ScrollController): Update to initialize new timers.
849         (WebCore::ScrollController::handleWheelEvent): Update to handle Scroll Snap Point events.
850         (WebCore::ScrollController::startSnapRubberbandTimer): Added.
851         (WebCore::ScrollController::stopSnapRubberbandTimer): Manage animation timers locally, do not
852         require client to maintain timers.
853         (WebCore::ScrollController::snapRubberBand): Ditto.
854         (WebCore::ScrollController::processWheelEventForScrollSnap): Added. (Moved from ScrollAnimatorMac)
855         (WebCore::ScrollController::updateScrollAnimatorsAndTimers): Ditto. Also updated to use RunLoop::Timer.
856         (WebCore::ScrollController::startScrollSnapTimer): Ditto. Also updated to use RunLoop::Timer.
857         (WebCore::ScrollController::stopScrollSnapTimer): Ditto. Also updated to use RunLoop::Timer.
858         (WebCore::ScrollController::horizontalScrollSnapTimerFired): Ditto.
859         (WebCore::ScrollController::verticalScrollSnapTimerFired): Ditto.
860         (WebCore::ScrollController::scrollOffsetOnAxis): Moved from ScrollAnimatorMac.
861         (WebCore::ScrollController::immediateScrollOnAxis): Ditto.
862         * platform/mac/AxisScrollSnapAnimator.h: Rename methods from 'InAxis' to 'OnAxis'
863         * platform/mac/AxisScrollSnapAnimator.mm:
864         (WebCore::AxisScrollSnapAnimator::handleWheelEvent): Update for 'InAxis' to 'OnAxis' renaming.
865         (WebCore::AxisScrollSnapAnimator::scrollSnapAnimationUpdate): Ditto.
866         (WebCore::AxisScrollSnapAnimator::beginScrollSnapAnimation): Ditto.
867         (WebCore::AxisScrollSnapAnimator::computeSnapDelta): Ditto.
868         (WebCore::AxisScrollSnapAnimator::computeGlideDelta): Ditto.
869         * platform/mac/ScrollAnimatorMac.h:
870         * platform/mac/ScrollAnimatorMac.mm:
871         (WebCore::ScrollAnimatorMac::ScrollAnimatorMac): Remove unused Rubberband timers (now that this is
872         controlled in the ScrollController)
873         (WebCore::ScrollAnimatorMac::startSnapRubberbandTimer): Deleted.
874         (WebCore::ScrollAnimatorMac::stopSnapRubberbandTimer): Deleted.
875         (WebCore::ScrollAnimatorMac::snapRubberBandTimerFired): Deleted.
876         * platform/mac/ScrollController.h: Removed.
877         * platform/mac/ScrollController.mm: Removed.
878
879 2015-03-03  Commit Queue  <commit-queue@webkit.org>
880
881         Unreviewed, rolling out r180683.
882         https://bugs.webkit.org/show_bug.cgi?id=142249
883
884         Broke fast/css/acid2-pixel.html (Requested by ap on #webkit).
885
886         Reverted changeset:
887
888         "Setting any of the <object> element plugin controlling
889         attributes does not have any affect."
890         https://bugs.webkit.org/show_bug.cgi?id=141936
891         http://trac.webkit.org/changeset/180683
892
893 2015-03-03  Dean Jackson  <dino@apple.com>
894
895         Controls panel should have system blurry background
896         https://bugs.webkit.org/show_bug.cgi?id=142154
897         <rdar://problem/20000964>
898
899         Reviewed by Simon Fraser.
900
901         In order to replicate the system style of media controls
902         on OS X and iOS, we need to expose a special -webkit-appearance.
903         This patch adds the new property value, and implements
904         the iOS part of the appearance, which is a blurry shaded
905         background.
906
907         Test: compositing/media-controls-bar-appearance.html
908
909         * css/CSSPrimitiveValueMappings.h:
910         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Map the new
911         keywords from ControlParts.
912
913         * css/CSSValueKeywords.in: Add media-controls-light-bar-background
914         and media-controls-dark-bar-background. Darin suggested they
915         be sorted, so I did this at the same time.
916         * platform/ThemeTypes.h: New ControlParts for the values, and
917         sort the values since they need to be in sync with
918         CSSValueKeywords.in.
919
920         * platform/graphics/GraphicsLayer.h: Expose two new custom appearance
921         values.
922         * platform/graphics/ca/GraphicsLayerCA.cpp:
923         (WebCore::GraphicsLayerCA::GraphicsLayerCA):
924         (WebCore::layerTypeForCustomBackdropAppearance): Helper function.
925         (WebCore::isCustomBackdropLayerType): Ditto.
926         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): Merge setting
927         a system backdrop layer in with the code that swaps to/from tiled layers.
928         (WebCore::GraphicsLayerCA::changeLayerTypeTo): New method that does what
929         swapFromOrToTiledLayer implemented, but also allows us to change to a
930         system backdrop layer.
931         (WebCore::GraphicsLayerCA::swapFromOrToTiledLayer): Deleted.
932         * platform/graphics/ca/GraphicsLayerCA.h:
933
934         * platform/graphics/ca/PlatformCALayer.h: New layer types.
935         * platform/graphics/ca/mac/PlatformCALayerMac.mm: For now expose these
936         as regular backdrop layers.
937         (PlatformCALayerMac::PlatformCALayerMac):
938         (PlatformCALayerMac::updateCustomAppearance):
939
940         * rendering/RenderLayerBacking.cpp:
941         (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer): Make sure to update
942         custom appearance,
943         (WebCore::RenderLayerBacking::updateCustomAppearance): New method.
944         * rendering/RenderLayerBacking.h:
945
946 2015-03-03  Chris Dumez  <cdumez@apple.com>
947
948         Access ApplicationCacheStorage global instance via singleton() static member function
949         https://bugs.webkit.org/show_bug.cgi?id=142239
950
951         Reviewed by Anders Carlsson.
952
953         Access ApplicationCacheStorage global instance via singleton() static
954         member function as per WebKit coding style.
955
956 2015-03-03  Anders Carlsson  <andersca@apple.com>
957
958         Try to fix the build.
959
960         * platform/spi/cf/CFNetworkSPI.h:
961
962 2015-03-03  Timothy Horton  <timothy_horton@apple.com>
963
964         <attachment> label can get very wide, doesn't wrap/truncate
965         https://bugs.webkit.org/show_bug.cgi?id=142214
966         <rdar://problem/19982499>
967
968         Reviewed by Simon Fraser.
969
970         Test: fast/attachment/attachment-label-highlight.html
971
972         * rendering/RenderThemeMac.h:
973         * rendering/RenderThemeMac.mm:
974         (WebCore::labelTextColorForAttachment):
975         (WebCore::AttachmentLayout::addLine):
976         (WebCore::AttachmentLayout::layOutText):
977         (WebCore::AttachmentLayout::AttachmentLayout):
978         Make it possible to lay out multiple lines of label text.
979         We lay out the whole string normally, but then only draw N (where N=1 for now,
980         but is adjustable) of the lines. The remainder of the string is then
981         merged into a single line, which is middle-truncated with an ellipsis
982         and drawn in place of the N+1 line.
983
984         (WebCore::addAttachmentLabelBackgroundRightCorner):
985         (WebCore::addAttachmentLabelBackgroundLeftCorner):
986         (WebCore::paintAttachmentLabelBackground):
987         Wrap the label background around the multiple lines of text with curved edges.
988         We run first down the right side of the label, determining whether to use
989         concave or convex arcs based on the relative widths of adjacent lines.
990         Then, we run back up the left side of the label doing the same thing.
991
992         If the background rects of two lines are very similar (within the rounded rect radius),
993         they will be expanded to the larger of the two, because otherwise the arcs
994         look quite wrong.
995
996         (WebCore::paintAttachmentLabel):
997         Draw the label with CoreText directly instead of bothering with WebCore
998         text layout primitives. There's no need, and it makes wrapping much more complicated.
999
1000         (WebCore::RenderThemeMac::paintAttachment):
1001         (WebCore::RenderThemeMac::paintAttachmentLabelBackground): Deleted.
1002         (WebCore::RenderThemeMac::paintAttachmentLabel): Deleted.
1003
1004 2015-03-03  Simon Fraser  <simon.fraser@apple.com>
1005
1006         Avoid applying the clip-path when painting, if a layer also has a shape layer mask
1007         https://bugs.webkit.org/show_bug.cgi?id=142212
1008
1009         Reviewed by Zalan Bujtas.
1010
1011         After r180882 we translate clip-path into a composited shape mask when the layer
1012         is composited. However, we were also still applying the clip-path when painting
1013         the layer contents.
1014         
1015         Now, we set the GraphicsLayer bits GraphicsLayerPaintClipPath and GraphicsLayerPaintMask
1016         only for the m_maskLayer's painting. This translate into setting PaintLayerPaintingCompositingMaskPhase
1017         and PaintLayerPaintingCompositingClipPathPhase only when painting that same mask layer,
1018         rather than always. To ensure that masks and clip-path get applied for software paints,
1019         add shouldPaintMask() and shouldApplyClipPath() that return true for non-composited layers,
1020         and when doing a flattening paint.
1021
1022         * rendering/RenderLayer.cpp:
1023         (WebCore::RenderLayer::paintLayerContents): Use shouldApplyClipPath().
1024         Pull three chunks of code under a single "if (shouldPaintContent && !selectionOnly)" condition.
1025         The condition for paintChildClippingMaskForFragments() is changed slightly; we need to call this
1026         only when painting the clip-path/mask layer contents, but also only when there is no mask to fill
1027         the clipped area for us.
1028         (WebCore::RenderLayer::calculateClipRects):
1029         (WebCore::RenderLayer::paintsWithClipPath): Deleted.
1030         * rendering/RenderLayer.h:
1031         * rendering/RenderLayerBacking.cpp:
1032         (WebCore::RenderLayerBacking::updateMaskingLayer): Be sure to set the GraphicsLayerPaintClipPath bit
1033         when having a mask forces us onto the painting path.
1034
1035 2015-03-03  Anders Carlsson  <andersca@apple.com>
1036
1037         Use the correct display name for website data for local files
1038         https://bugs.webkit.org/show_bug.cgi?id=142228
1039
1040         Reviewed by Dan Bernstein.
1041
1042         * English.lproj/Localizable.strings:
1043         Add local file display name.
1044
1045         * platform/spi/cf/CFNetworkSPI.h:
1046         Add kCFHTTPCookieLocalFileDomain declaration.
1047
1048 2015-03-03  Myles C. Maxfield  <mmaxfield@apple.com>
1049
1050         BreakingContext cleanup
1051         https://bugs.webkit.org/show_bug.cgi?id=142146
1052
1053         Reviewed by Dean Jackson.
1054
1055         1. Use commitLineBreakAtCurrentWidth() instead of directly
1056         updating m_width and m_lineBreak, because the name makes the
1057         intent clearer.
1058         2. Remove duplicate function LineBreaker::nextSegmentBreak().
1059         3. lineStyle() takes care of inspecting RenderText's parent's
1060         style.
1061         4. Add FIXME to BreakingContext::initializeForCurrentObject()
1062         because it seems like we are ignoring first-line style for
1063         some properties.
1064
1065         No new tests because there is no behavior change.
1066
1067         * rendering/line/BreakingContextInlineHeaders.h:
1068         (WebCore::BreakingContext::BreakingContext):
1069         (WebCore::BreakingContext::initializeForCurrentObject):
1070         (WebCore::BreakingContext::handleReplaced):
1071         (WebCore::BreakingContext::handleText):
1072         (WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):
1073         (WebCore::BreakingContext::handleEndOfLine):
1074         * rendering/line/LineBreaker.cpp:
1075         (WebCore::LineBreaker::nextLineBreak): Deleted.
1076         (WebCore::LineBreaker::nextSegmentBreak): Deleted.
1077         * rendering/line/LineBreaker.h:
1078         * rendering/line/LineInlineHeaders.h:
1079         (WebCore::lineStyle):
1080
1081 2015-03-03  Chris Dumez  <cdumez@apple.com>
1082
1083         Make AudioContext suspendable when it is not rendering
1084         https://bugs.webkit.org/show_bug.cgi?id=142210
1085         <rdar://problem/19923085>
1086
1087         Reviewed by Eric Carlson.
1088
1089         Make AudioContext suspendable when it is not rendering to increase the
1090         likelihood of entering the PageCache for pages using WebAudio.
1091
1092         This patch adds a state member to AudioContext with 3 possible states:
1093         Suspended / Running / Closed, as defined in the specification:
1094         http://webaudio.github.io/web-audio-api/#widl-AudioContext-state
1095
1096         This state is used to decide if we can suspend the page or not. We
1097         can safely suspend if the AudioContext's state is suspended (did not
1098         start rendering) or closed (Stopped rendering).
1099
1100         Note that this patch does not expose the AudioContext's state to the
1101         Web yet, even though it is exposed in the latest specification.
1102
1103         Tests: fast/history/page-cache-closed-audiocontext.html
1104                fast/history/page-cache-running-audiocontext.html
1105                fast/history/page-cache-suspended-audiocontext.html
1106
1107         * Modules/webaudio/AudioContext.cpp:
1108         (WebCore::AudioContext::AudioContext):
1109         (WebCore::AudioContext::uninitialize):
1110         (WebCore::AudioContext::canSuspend):
1111         (WebCore::AudioContext::startRendering):
1112         (WebCore::AudioContext::fireCompletionEvent):
1113         * Modules/webaudio/AudioContext.h:
1114
1115 2015-03-02  Carlos Garcia Campos  <cgarcia@igalia.com>
1116
1117         [SOUP] Use SoupMessage::starting instead of SoupSession::request-started
1118         https://bugs.webkit.org/show_bug.cgi?id=142164
1119
1120         Reviewed by Sergio Villar Senin.
1121
1122         SoupSession::request-started is deprecated in libsoup 2.50. Both
1123         signals are equivalent, but SoupMessage::starting is also emitted
1124         for resources loaded from the disk cache. This fixes web timing
1125         calculations for cached resources, since we were not initializing
1126         m_requestStart.
1127
1128         * platform/network/soup/ResourceHandleSoup.cpp:
1129         (WebCore::startingCallback):
1130         (WebCore::createSoupMessageForHandleAndRequest):
1131         * platform/network/soup/SoupNetworkSession.cpp:
1132         (WebCore::SoupNetworkSession::SoupNetworkSession):
1133
1134 2015-03-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1135
1136         [SOUP] Synchronous XMLHttpRequests can time out when we reach the max connections limit
1137         https://bugs.webkit.org/show_bug.cgi?id=141508
1138
1139         Reviewed by Sergio Villar Senin.
1140
1141         Use SOUP_MESSAGE_IGNORE_CONNECTION_LIMITS flag when loading a
1142         synchronous message instead of increasing the maximum number of
1143         connections allowed if the soup version is recent enough.
1144         The current solution of increasing/decreasing the limits doesn't
1145         always work, because connections are not marked as IDLE in libsoup
1146         until the message is unqueued, but we don't wait for the message
1147         to be unqueued to finish our loads in WebKit, we finish them as
1148         soon as we have finished reading the stream. This causes that
1149         synchronous loads keep blocked in the nested main loop until the
1150         timeout of 10 seconds is fired and the load fails.
1151         Also marked WebCoreSynchronousLoader class as final, the virtual
1152         methods as override and removed the unsused method isSynchronousClient.
1153
1154         * platform/network/soup/ResourceHandleSoup.cpp:
1155         (WebCore::createSoupMessageForHandleAndRequest):
1156         (WebCore::WebCoreSynchronousLoader::WebCoreSynchronousLoader):
1157         (WebCore::WebCoreSynchronousLoader::isSynchronousClient): Deleted.
1158         (WebCore::WebCoreSynchronousLoader::didReceiveResponse):
1159         (WebCore::WebCoreSynchronousLoader::didReceiveData):
1160         (WebCore::WebCoreSynchronousLoader::didReceiveBuffer):
1161         (WebCore::WebCoreSynchronousLoader::didFinishLoading):
1162         (WebCore::WebCoreSynchronousLoader::didFail):
1163         (WebCore::WebCoreSynchronousLoader::didReceiveAuthenticationChallenge):
1164         (WebCore::WebCoreSynchronousLoader::shouldUseCredentialStorage):
1165
1166 2015-03-02  David Kilzer  <ddkilzer@apple.com>
1167
1168         [iOS] Disable -Wdeprecated-declaration warnings in WebVideoFullscreenInterfaceAVKit.mm
1169
1170         Fixing the deprecations is tracked by: <rdar://problem/20018692>
1171
1172         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1173         (WebVideoFullscreenInterfaceAVKit::enterFullscreenOptimized):
1174         Ignore -Wdeprecated-declaration warnings via clang pragmas.
1175
1176 2015-03-02  Commit Queue  <commit-queue@webkit.org>
1177
1178         Unreviewed, rolling out r180902.
1179         https://bugs.webkit.org/show_bug.cgi?id=142205
1180
1181         It broke scrolling in some cases. See bug 142202 for details.
1182         (Requested by bdash on #webkit).
1183
1184         Reverted changeset:
1185
1186         "Move scroll animating functions from ScrollAnimator to
1187         ScrollController"
1188         https://bugs.webkit.org/show_bug.cgi?id=142102
1189         http://trac.webkit.org/changeset/180902
1190
1191 2015-03-02  Commit Queue  <commit-queue@webkit.org>
1192
1193         Unreviewed, rolling out r180911.
1194         https://bugs.webkit.org/show_bug.cgi?id=142204
1195
1196         The tests it added are crashing (Requested by bdash on
1197         #webkit).
1198
1199         Reverted changeset:
1200
1201         "Add a microtask abstraction"
1202         https://bugs.webkit.org/show_bug.cgi?id=137496
1203         http://trac.webkit.org/changeset/180911
1204
1205 2015-03-02  Yoav Weiss  <yoav@yoav.ws>
1206
1207         Add a microtask abstraction
1208         https://bugs.webkit.org/show_bug.cgi?id=137496
1209
1210         Reviewed by Sam Weinig.
1211
1212         This patch adds a microtask abstraction: https://html.spec.whatwg.org/multipage/webappapis.html#microtask
1213         That abstraction is required in order to enable async loading of images,
1214         which is in turn required to enable support for the picture element, as well as
1215         to make sure that the order of properties set on HTMLImageElement has no implications.
1216
1217         * WebCore.vcxproj/WebCore.vcxproj: Add MicroTask.{h,cpp} to the project.
1218         * WebCore.vcxproj/WebCoreTestSupport.vcxproj: Add MicroTaskTest.{h,cpp} to the project.
1219         * WebCore.vcxproj/WebCore.vcxproj.filters: Add MicroTask.{h,cpp} to the project.
1220         * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters: Add MicroTaskTest.{h,cpp} to the project.
1221         * WebCore.xcodeproj/project.pbxproj: Add MicroTask{,Test}.{h,cpp} to the project.
1222         * dom/Document.h: Add WEBCORE_EXPORT to addConsoleMessage, so it can be used in MicroTaskTest that's in WebCoreTestSupport..
1223         * dom/MicroTask.h: Add a MicroTask interface class. Add a MicroTaskQueue singleton.
1224         (WebCore::MicroTask::~MicroTask):
1225         (WebCore::MicroTask::run): Run the microtask.
1226         * dom/MicroTask.cpp: Implement the MicroTaskQueue singleton.
1227         (WebCore::MicroTaskQueue::singleton): Get a singleton instance of MicroTaskQueue.
1228         (WebCore::MicroTaskQueue::queueMicroTask): Add a microtask to the queue.
1229         (WebCore::MicroTaskQueue::runMicroTasks): Run all the microtasks in the queue and clear it.
1230         * dom/ScriptRunner.cpp: Trigger running of all microtasks in queue.
1231         (WebCore::ScriptRunner::timerFired):
1232         * html/parser/HTMLScriptRunner.cpp: Trigger running of all microtasks in queue.
1233         (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent):
1234         (WebCore::HTMLScriptRunner::executeScriptsWaitingForParsing):
1235         (WebCore::HTMLScriptRunner::runScript):
1236         * testing/Internals.cpp: Add a method to queue a test microtask.
1237         (WebCore::Internals::queueMicroTask):
1238         * testing/Internals.h: Add a method to queue a test microtask.
1239         (WebCore::Internals::queueMicroTask):
1240         * testing/Internals.idl: Expose test microtask queueing to test JS.
1241         * testing/MicroTaskTest.cpp: Add a test class that implements a microtask and prints to the console when it runs.
1242         (WebCore::MicroTaskTest::run): Run the microtask
1243         (WebCore::MicroTaskTest::create): Create a test microtask.
1244         * testing/MicroTaskTest.h: Add a test class that implements a microtask.
1245         (WebCore::MicroTaskTest::run):
1246         (WebCore::MicroTaskTest::create):
1247
1248 2015-03-02  Jeremy Jones  <jeremyj@apple.com>
1249
1250         RenderVideo should not paint the video frame when video is fullscreen.
1251         https://bugs.webkit.org/show_bug.cgi?id=142097
1252
1253         Reviewed by Eric Carlson.
1254
1255         For performance and correctness, RenderVideo should not paint the current video frame
1256         inline when video is fullscreen. This happens when snapshots are taken and can have a
1257         negative performance impact.
1258
1259         * rendering/RenderVideo.cpp:
1260         (WebCore::RenderVideo::paintReplaced):
1261
1262 2015-03-02  Dean Jackson  <dino@apple.com>
1263
1264         [iOS Media] Airplay button should be blue when active
1265         https://bugs.webkit.org/show_bug.cgi?id=142193
1266
1267         Reviewed by Brent Fulgham.
1268
1269         Add a blue form of the Airplay button that is used
1270         when we are actively displaying on another screen.
1271
1272         * Modules/mediacontrols/mediaControlsiOS.css:
1273         (video::-webkit-media-controls-wireless-playback-picker-button):
1274         (video::-webkit-media-controls-wireless-playback-picker-button:active):
1275         (video::-webkit-media-controls-wireless-playback-picker-button.playing):
1276         * Modules/mediacontrols/mediaControlsiOS.js:
1277         (ControllerIOS.prototype.updateWirelessPlaybackStatus):
1278
1279 2015-03-02  Brent Fulgham  <bfulgham@apple.com>
1280
1281         Move scroll animating functions from ScrollAnimator to ScrollController
1282         https://bugs.webkit.org/show_bug.cgi?id=142102
1283         <rdar://problem/20007161>
1284
1285         Reviewed by Simon Fraser.
1286
1287         No change in functionality.
1288         
1289         Do some refactoring of the various scrolling classes:
1290         1. Consolidate animation times to RunLoop::Timer instead of a combination of WebCore::Timer
1291            and CFRunLoopTimers. Do this for Scroll Snap Point and Rubberband animations.
1292         2. Move ScrollController from platform/mac to platform/cocoa to enable sharing with iOS.
1293         3. Move code from ScrollAnimator{Mac} -> ScrollController.
1294         4. Rename scrollOffsetInAxis -> scrollOffsetOnAxis
1295         5. Rename immediateScrollInAxis -> immediateScrollOnAxis
1296
1297         * WebCore.xcodeproj/project.pbxproj: Move ScrollController to 'platform/cocoa'
1298         * page/mac/EventHandlerMac.mm: Make sure the scroll controller is notified of end-of-scroll
1299         events, just as is done for the "event not handled" case in EventHandler.cpp. 
1300         (WebCore::EventHandler::platformCompleteWheelEvent):
1301         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: Remove timer and some delegate
1302         methods, now that ScrollController is controlling this state.
1303         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1304         (WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac): We no longer
1305         need to clean up the CFRunLoopTimer.
1306         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollOffsetOnAxis): Add temporary stub needed
1307         until Bug 141973 is completed.).
1308         (WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollOnAxis): Ditto.
1309         (WebCore::ScrollingTreeFrameScrollingNodeMac::startSnapRubberbandTimer): Deleted.
1310         (WebCore::ScrollingTreeFrameScrollingNodeMac::stopSnapRubberbandTimer): Deleted.
1311         * platform/ScrollAnimator.cpp:
1312         (WebCore::ScrollAnimator::ScrollAnimator):
1313         (WebCore::ScrollAnimator::processWheelEventForScrollSnap): Just call the ScrollController method.
1314         (WebCore::ScrollAnimator::handleWheelEvent): Ditto.
1315         (WebCore::ScrollAnimator::updateScrollAnimatorsAndTimers): Ditto.
1316         (WebCore::ScrollAnimator::scrollOffsetOnAxis): Renamed from scrollOffsetInAxis.
1317         (WebCore::ScrollAnimator::scrollOffsetInAxis): Deleted.
1318         (WebCore::ScrollAnimator::immediateScrollOnAxis): Renamed from immediateScrollInAxis.
1319         (WebCore::ScrollAnimator::immediateScrollInAxis): Deleted.
1320         (WebCore::ScrollAnimator::startScrollSnapTimer): Deleted.
1321         (WebCore::ScrollAnimator::stopScrollSnapTimer): Deleted.
1322         (WebCore::ScrollAnimator::horizontalScrollSnapTimerFired): Deleted.
1323         (WebCore::ScrollAnimator::verticalScrollSnapTimerFired): Deleted.
1324         * platform/ScrollAnimator.h:
1325         * platform/cocoa/ScrollController.h: Copied from platform/mac/ScrollController.h.
1326         * platform/cocoa/ScrollController.mm: Copied from platform/mac/ScrollController.mm.
1327         (WebCore::ScrollController::ScrollController): Update to initialize new timers.
1328         (WebCore::ScrollController::handleWheelEvent): Update to handle Scroll Snap Point events.
1329         (WebCore::ScrollController::startSnapRubberbandTimer): Added.
1330         (WebCore::ScrollController::stopSnapRubberbandTimer): Manage animation timers locally, do not
1331         require client to maintain timers.
1332         (WebCore::ScrollController::snapRubberBand): Ditto.
1333         (WebCore::ScrollController::processWheelEventForScrollSnap): Added. (Moved from ScrollAnimatorMac)
1334         (WebCore::ScrollController::updateScrollAnimatorsAndTimers): Ditto. Also updated to use RunLoop::Timer.
1335         (WebCore::ScrollController::startScrollSnapTimer): Ditto. Also updated to use RunLoop::Timer.
1336         (WebCore::ScrollController::stopScrollSnapTimer):  Ditto. Also updated to use RunLoop::Timer.
1337         (WebCore::ScrollController::horizontalScrollSnapTimerFired): Ditto.
1338         (WebCore::ScrollController::verticalScrollSnapTimerFired): Ditto.
1339         (WebCore::ScrollController::scrollOffsetOnAxis): Moved from ScrollAnimatorMac.
1340         (WebCore::ScrollController::immediateScrollOnAxis): Ditto.
1341         * platform/mac/AxisScrollSnapAnimator.h: Rename methods from 'InAxis' to 'OnAxis'
1342         * platform/mac/AxisScrollSnapAnimator.mm: Ditto.
1343         * platform/mac/ScrollAnimatorMac.h:
1344         * platform/mac/ScrollAnimatorMac.mm:
1345         (WebCore::ScrollAnimatorMac::ScrollAnimatorMac): Remove unused Rubberband timers (now that this is
1346         controlled in the ScrollController)
1347         (WebCore::ScrollAnimatorMac::startSnapRubberbandTimer): Deleted.
1348         (WebCore::ScrollAnimatorMac::stopSnapRubberbandTimer): Deleted.
1349         (WebCore::ScrollAnimatorMac::snapRubberBandTimerFired): Deleted.
1350         * platform/mac/ScrollController.h: Removed.
1351         * platform/mac/ScrollController.mm: Removed.
1352
1353 2015-03-02  Mark Lam  <mark.lam@apple.com>
1354
1355         The InspectorTimelineAgent should gracefully handle attempts to start more than once.
1356         <https://webkit.org/b/142189>
1357
1358         Reviewed by Joseph Pecoraro.
1359
1360         No new tests.  Unskipped an existing test that already asserts this.
1361
1362         InspectorTimelineAgent::internalStop() already checks for redundant calls to it in
1363         case the InspectorTimelineAgent is already disabled. Similarly,
1364         InspectorTimelineAgent::internalStart() should check if the InspectorTimelineAgent
1365         is already enabled before proceeding to do work to enable it. Though wasteful,
1366         it is legal for clients of the InspectorTimelineAgent to invoke start on it more
1367         than once. Hence, this check is needed.
1368
1369         This check fixes the debug assertion failure when running the
1370         inspector/timeline/debugger-paused-while-recording.html test. The test can now
1371         be unskipped.
1372
1373         * inspector/InspectorTimelineAgent.cpp:
1374         (WebCore::InspectorTimelineAgent::internalStart):
1375
1376 2015-03-02  Roger Fong  <roger_fong@apple.com>
1377
1378         Update backgrounds of sliders for inline media controls on OS X.
1379         https://bugs.webkit.org/show_bug.cgi?id=142188.
1380         <rdar://problem/20012413>
1381
1382         Reviewed by Dean Jackson.
1383
1384         Don’t use CSS to draw volume and timeline slider backgrounds.
1385         * Modules/mediacontrols/mediaControlsApple.css:
1386         (video::-webkit-media-controls-volume-slider):
1387         (audio::-webkit-media-controls-volume-slider::-webkit-slider-thumb):
1388         (audio::-webkit-media-controls-timeline):
1389         (audio::-webkit-media-controls-timeline::-webkit-slider-thumb):
1390         (audio::-webkit-media-controls-panel .thumbnail-track):
1391         (audio::-webkit-media-controls-volume-slider::-webkit-slider-thumb:active::-webkit-slider-thumb): Deleted.
1392         (audio::-webkit-media-controls-timeline:active::-webkit-slider-thumb,): Deleted.
1393
1394         Draw volume and timeline slider backgrounds using 2d canvases.
1395         * Modules/mediacontrols/mediaControlsApple.js:
1396         (Controller.prototype.createControls):
1397         (Controller.prototype.handleVolumeSliderInput):
1398         (Controller.prototype.addRoundedRect):
1399         (Controller.prototype.drawTimelineBackground):
1400         (Controller.prototype.drawVolumeBackground):
1401         (Controller.prototype.showControls):
1402         * Modules/mediacontrols/mediaControlsiOS.js:
1403         (ControllerIOS.prototype.addRoundedRect): Deleted.
1404
1405 2015-03-01  Roger Fong  <roger_fong@apple.com>
1406
1407         Update inline media element controls appearance Part 1.
1408         https://bugs.webkit.org/show_bug.cgi?id=142138.
1409         <rdar://problem/19997384>
1410
1411         Reviewed by Dean Jackson.
1412
1413         Update positioning, sizes, and background colors media control elements.
1414         Volume and timeline sliders will be drawn in a separate patch via 2d canvases.
1415
1416         * Modules/mediacontrols/mediaControlsApple.css:
1417         (audio::-webkit-media-controls-panel):
1418         (video::-webkit-media-controls-panel):
1419         (audio::-webkit-media-controls-rewind-button):
1420         (audio::-webkit-media-controls-play-button):
1421         (audio::-webkit-media-controls-panel .mute-box):
1422         (video::-webkit-media-controls-volume-max-button):
1423         (audio::-webkit-media-controls-panel .volume-box):
1424         (audio::-webkit-media-controls-panel .volume-box:active):
1425         (video::-webkit-media-controls-volume-slider):
1426         (audio::-webkit-media-controls-toggle-closed-captions-button):
1427         (audio::-webkit-media-controls-fullscreen-button):
1428         (audio::-webkit-media-controls-current-time-display):
1429         (audio::-webkit-media-controls-time-remaining-display):
1430         (audio::-webkit-media-controls-timeline-container .hour-long-time): Deleted.
1431
1432 2015-03-02  David Kilzer  <ddkilzer@apple.com>
1433
1434         REGRESSION (r180882): Build failure: Methods not marked override in GraphicsLayerCA.h
1435         <http://webkit.org/b/138684>
1436
1437         Fixes the following build failures:
1438
1439             In file included from WebKit2/WebProcess/WebPage/DrawingArea.cpp:39:
1440             In file included from WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:30:
1441             In file included from WebKit2/WebProcess/WebPage/mac/GraphicsLayerCARemote.h:29:
1442             WebCore.framework/PrivateHeaders/GraphicsLayerCA.h:123:33: error: 'setShapeLayerPath' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
1443                 WEBCORE_EXPORT virtual void setShapeLayerPath(const Path&);
1444                                             ^
1445             In file included from WebKit2/WebProcess/WebPage/DrawingArea.cpp:30:
1446             In file included from WebKit2/WebProcess/WebPage/WebPage.h:46:
1447             In file included from WebKit2/WebProcess/Plugins/Plugin.h:31:
1448             WebCore.framework/PrivateHeaders/GraphicsLayer.h:390:18: note: overridden virtual function is here
1449                 virtual void setShapeLayerPath(const Path&);
1450                              ^
1451             In file included from WebKit2/WebProcess/WebPage/DrawingArea.cpp:39:
1452             In file included from WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:30:
1453             In file included from WebKit2/WebProcess/WebPage/mac/GraphicsLayerCARemote.h:29:
1454             WebCore.framework/PrivateHeaders/GraphicsLayerCA.h:124:33: error: 'setShapeLayerWindRule' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
1455                 WEBCORE_EXPORT virtual void setShapeLayerWindRule(WindRule);
1456                                             ^
1457             In file included from WebKit2/WebProcess/WebPage/DrawingArea.cpp:30:
1458             In file included from WebKit2/WebProcess/WebPage/WebPage.h:46:
1459             In file included from WebKit2/WebProcess/Plugins/Plugin.h:31:
1460             WebCore.framework/PrivateHeaders/GraphicsLayer.h:393:18: note: overridden virtual function is here
1461                 virtual void setShapeLayerWindRule(WindRule);
1462                              ^
1463             2 errors generated.
1464
1465         * platform/graphics/ca/GraphicsLayerCA.h:
1466         (WebCore::GraphicsLayer::setShapeLayerPath): Mark as override.
1467         (WebCore::GraphicsLayer::setShapeLayerWindRule): Ditto.
1468
1469 2015-03-01  Simon Fraser  <simon.fraser@apple.com>
1470
1471         Make clip-path work on <video>, <canvas> etc.
1472         https://bugs.webkit.org/show_bug.cgi?id=138684
1473
1474         Reviewed by Darin Adler.
1475         
1476         clip-path only worked in compositing layers on the painted contents of the layer,
1477         and failed to clip children. Fix this by translating the clip path into a Path
1478         which is set on a CA shape layer (for Mac and iOS), or painted into the
1479         RenderLayerBacking's mask layer. There are two code paths:
1480
1481         1. clip-path which is a <basic-shape> or <geometry-box>, and no mask.
1482             Here we can use the optimal code path of converting the clip into a path
1483             that is put onto a CAShapeLayer, which is then used as a mask. There is no
1484             additional backing store.
1485         2. clip-path with an SVG reference, or clip-path combined with -webkit-mask:
1486             Here we have to allocate backing store for the mask layer, and paint the
1487             clip path (possibly with the mask).
1488         
1489         We add GraphicsLayer::Type::Shape, and add a getter for the layer type.
1490
1491         Tests: compositing/masks/compositing-clip-path-and-mask.html
1492                compositing/masks/compositing-clip-path-mask-change.html
1493                compositing/masks/compositing-clip-path.html
1494                compositing/masks/reference-clip-path-on-composited.html
1495
1496         * platform/graphics/GraphicsLayer.cpp:
1497         (WebCore::GraphicsLayer::GraphicsLayer): Store the type in the layer so the getter can return it.
1498         (WebCore::GraphicsLayer::shapeLayerPath): Get and set the shape layer path.
1499         (WebCore::GraphicsLayer::setShapeLayerPath): Ditto.
1500         (WebCore::GraphicsLayer::shapeLayerWindRule): Get and set the shape layer wind rule.
1501         (WebCore::GraphicsLayer::setShapeLayerWindRule): Ditto.
1502         * platform/graphics/GraphicsLayer.h:
1503         (WebCore::GraphicsLayer::type): Expose the type.
1504         (WebCore::GraphicsLayer::supportsLayerType): Allow the cross-platform code to use
1505         shape layers when it knows they are available.
1506         (WebCore::GraphicsLayer::needsClippingMaskLayer): Deleted. This was never used.
1507         * platform/graphics/GraphicsLayerClient.h: Align the bits (helps avoid typos). Add a
1508         GraphicsLayerPaintClipPath phase.
1509         * platform/graphics/Path.h: Some exports since WK2 needs to encode Paths now.
1510         * platform/graphics/ca/GraphicsLayerCA.cpp:
1511         (WebCore::GraphicsLayerCA::initialize): Make shape layers.
1512         (WebCore::GraphicsLayerCA::setShapeLayerPath): Setter for the shape path. Sadly we
1513         can't early return on unchanged paths yet.
1514         (WebCore::GraphicsLayerCA::setShapeLayerWindRule):
1515         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): Updates for shape path
1516         and wind rule.
1517         (WebCore::GraphicsLayerCA::updateShape):
1518         (WebCore::GraphicsLayerCA::updateWindRule):
1519         * platform/graphics/ca/GraphicsLayerCA.h: Some new dirty bits for shape path and wind rule.
1520         * platform/graphics/ca/PlatformCALayer.h:
1521         * platform/graphics/ca/mac/PlatformCALayerMac.h:
1522         * platform/graphics/ca/mac/PlatformCALayerMac.mm: Got rid of lots of m_layer.get().
1523         (PlatformCALayerMac::~PlatformCALayerMac):
1524         (PlatformCALayerMac::setNeedsDisplay):
1525         (PlatformCALayerMac::setNeedsDisplayInRect):
1526         (PlatformCALayerMac::removeFromSuperlayer):
1527         (PlatformCALayerMac::setSublayers):
1528         (PlatformCALayerMac::removeAllSublayers):
1529         (PlatformCALayerMac::appendSublayer):
1530         (PlatformCALayerMac::insertSublayer):
1531         (PlatformCALayerMac::replaceSublayer):
1532         (PlatformCALayerMac::adoptSublayers):
1533         (PlatformCALayerMac::addAnimationForKey):
1534         (PlatformCALayerMac::removeAnimationForKey):
1535         (PlatformCALayerMac::animationForKey):
1536         (PlatformCALayerMac::setMask):
1537         (PlatformCALayerMac::isOpaque):
1538         (PlatformCALayerMac::setOpaque):
1539         (PlatformCALayerMac::bounds):
1540         (PlatformCALayerMac::setBounds):
1541         (PlatformCALayerMac::position):
1542         (PlatformCALayerMac::setPosition):
1543         (PlatformCALayerMac::anchorPoint):
1544         (PlatformCALayerMac::setAnchorPoint):
1545         (PlatformCALayerMac::transform):
1546         (PlatformCALayerMac::setTransform):
1547         (PlatformCALayerMac::sublayerTransform):
1548         (PlatformCALayerMac::setSublayerTransform):
1549         (PlatformCALayerMac::setHidden):
1550         (PlatformCALayerMac::setGeometryFlipped):
1551         (PlatformCALayerMac::isDoubleSided):
1552         (PlatformCALayerMac::setDoubleSided):
1553         (PlatformCALayerMac::masksToBounds):
1554         (PlatformCALayerMac::setMasksToBounds):
1555         (PlatformCALayerMac::acceleratesDrawing):
1556         (PlatformCALayerMac::setAcceleratesDrawing):
1557         (PlatformCALayerMac::contents):
1558         (PlatformCALayerMac::setContents):
1559         (PlatformCALayerMac::setContentsRect):
1560         (PlatformCALayerMac::setMinificationFilter):
1561         (PlatformCALayerMac::setMagnificationFilter):
1562         (PlatformCALayerMac::backgroundColor):
1563         (PlatformCALayerMac::setBackgroundColor):
1564         (PlatformCALayerMac::setBorderWidth):
1565         (PlatformCALayerMac::setBorderColor):
1566         (PlatformCALayerMac::opacity):
1567         (PlatformCALayerMac::setOpacity):
1568         (PlatformCALayerMac::copyFiltersFrom):
1569         (PlatformCALayerMac::setName):
1570         (PlatformCALayerMac::setSpeed):
1571         (PlatformCALayerMac::setTimeOffset):
1572         (PlatformCALayerMac::contentsScale):
1573         (PlatformCALayerMac::setContentsScale):
1574         (PlatformCALayerMac::cornerRadius):
1575         (PlatformCALayerMac::setCornerRadius):
1576         (PlatformCALayerMac::setEdgeAntialiasingMask):
1577         (PlatformCALayerMac::shapeWindRule): New function.
1578         (PlatformCALayerMac::setShapeWindRule): Ditto.
1579         (PlatformCALayerMac::shapePath): Ditto.
1580         (PlatformCALayerMac::setShapePath): Ditto.
1581         (PlatformCALayer::isWebLayer):
1582         * platform/graphics/cg/PathCG.cpp:
1583         (WebCore::Path::Path): nullptr.
1584         * rendering/RenderLayer.cpp:
1585         (WebCore::RenderLayer::paintsWithClipPath): Return true if the clip path is painted.
1586         (WebCore::RenderLayer::computeClipPath): Factor code that computes the clip path into this
1587         function, so we can call it from RenderLayerBacking too.
1588         (WebCore::RenderLayer::setupClipPath):
1589         (WebCore::RenderLayer::paintLayerContents): We only want to apply the clip path
1590         for painting when we're either painting a non-composited layer, or we're painting the
1591         mask layer of a composited layer. We in the latter case, we just want to fill the clip
1592         path with black, so re-use the paintChildClippingMaskForFragments() which does this.
1593         * rendering/RenderLayer.h: Align the bits, add PaintLayerPaintingCompositingClipPathPhase.
1594         * rendering/RenderLayerBacking.cpp:
1595         (WebCore::RenderLayerBacking::~RenderLayerBacking):
1596         (WebCore::RenderLayerBacking::updateConfiguration):
1597         (WebCore::RenderLayerBacking::updateGeometry): Move mask updating into its own function.
1598         (WebCore::RenderLayerBacking::updateMaskingLayerGeometry): If we're using the shape layer
1599         code path, compute the Path and set it and the wind rule on the mask layer.
1600         (WebCore::RenderLayerBacking::updateMaskingLayer): This is now more complex, as it has
1601         to deal with combinations of clip-path and mask, some of which allow for the shape layer
1602         mask, and we handle dynamic changes between these and painted masks.
1603         (WebCore::RenderLayerBacking::paintingPhaseForPrimaryLayer): Include the GraphicsLayerPaintClipPath phase.
1604         (WebCore::RenderLayerBacking::paintIntoLayer): Map GraphicsLayerPaintClipPath to PaintLayerPaintingCompositingClipPathPhase.
1605         (WebCore::RenderLayerBacking::updateMaskLayer): Deleted.
1606         * rendering/RenderLayerBacking.h:
1607
1608 2015-03-01  Hunseop Jeong  <hs85.jeong@samsung.com>
1609
1610         [Cairo] Implement Path::addEllipse 
1611         https://bugs.webkit.org/show_bug.cgi?id=142144
1612
1613         Reviewed by Gyuyoung Kim.
1614
1615         Add support for addEllipse method for platforms using cairo.
1616
1617         * platform/graphics/cairo/PathCairo.cpp:
1618         (WebCore::Path::addEllipse):
1619
1620 2015-03-01  Joonghun Park  <jh718.park@samsung.com>
1621
1622         Use std::unique_ptr instead of PassOwnPtr|OwnPtr for ScrollAnimator
1623         https://bugs.webkit.org/show_bug.cgi?id=142143
1624
1625         Reviewed by Darin Adler.
1626
1627         No new tests, no behavior changes.
1628
1629         * platform/ScrollAnimator.cpp:
1630         (WebCore::ScrollAnimator::create):
1631         * platform/ScrollAnimator.h:
1632         * platform/ScrollAnimatorNone.cpp:
1633         (WebCore::ScrollAnimator::create):
1634         * platform/ScrollableArea.h:
1635         * platform/ios/ScrollAnimatorIOS.mm:
1636         (WebCore::ScrollAnimator::create):
1637         * platform/mac/ScrollAnimatorMac.mm:
1638         (WebCore::ScrollAnimator::create):
1639
1640 2015-02-26  Andy Estes  <aestes@apple.com>
1641
1642         [Content Filtering] Move another declaration to WebFilterEvaluatorSPI.h
1643         https://bugs.webkit.org/show_bug.cgi?id=142066
1644
1645         Reviewed by Andreas Kling.
1646
1647         * platform/ios/ContentFilterIOS.mm:
1648         * platform/spi/cocoa/WebFilterEvaluatorSPI.h:
1649
1650 2015-03-01  Chris Dumez  <cdumez@apple.com>
1651
1652         Make NotificationCenter / Notification suspendable
1653         https://bugs.webkit.org/show_bug.cgi?id=142117
1654         <rdar://problem/19923085>
1655
1656         Reviewed by Andreas Kling.
1657
1658         Make NotificationCenter / Notification suspendable so that pages using
1659         them can enter the PageCache.
1660
1661         NotificationCenter can safely be suspended if there are no pending
1662         permission requests. This required adding an
1663         "hasPendingPermissionRequests()" callback to the NotificationClient.
1664
1665         Notification can safely be suspended if it is either idle (not showing
1666         yet) or closed.
1667
1668         Tests: fast/history/page-cache-notification-non-suspendable.html
1669                fast/history/page-cache-notification-suspendable.html
1670
1671         * Modules/notifications/Notification.cpp:
1672         (WebCore::Notification::canSuspend):
1673         * Modules/notifications/NotificationCenter.cpp:
1674         (WebCore::NotificationCenter::canSuspend):
1675         * Modules/notifications/NotificationClient.h:
1676
1677 2015-03-01  Ryosuke Niwa  <rniwa@webkit.org>
1678
1679         isContentEditable shouldn't trigger synchronous style recalc in most cases
1680         https://bugs.webkit.org/show_bug.cgi?id=129034
1681
1682         Reviewed by Antti Koivisto.
1683
1684         Avoid style recalc inside isContentEditable when the document doesn't contain -webkit-user-modify or
1685         -webkit-user-select: all. Instead, compute the value from contenteditable attributes in ancestors.
1686         However, still compute the editability from the style tree when it's up-to-date in order to avoid
1687         repeatedly walking up the DOM tree in a hot code path inside editing.
1688
1689         Test: fast/dom/HTMLElement/dynamic-editability-change.html
1690
1691         * css/CSSGrammar.y.in: No need to pass in "true" as we never call this function with false.
1692         * css/CSSParser.cpp:
1693         (WebCore::isValidKeywordPropertyAndValue): Calls parserSetUsesStyleBasedEditability as needed.
1694         (WebCore::parseKeywordValue): Passes around StyleSheetContents*.
1695         (WebCore::CSSParser::parseValue): Ditto.
1696         (WebCore::CSSParser::parseFont): Ditto.
1697
1698         * css/StyleSheetContents.cpp:
1699         (WebCore::StyleSheetContents::StyleSheetContents): Initializes and copies m_usesStyleBasedEditability.
1700
1701         * css/StyleSheetContents.h:
1702         (WebCore::StyleSheetContents::parserSetUsesRemUnits): Removed the argument since it was always true.
1703         (WebCore::StyleSheetContents::parserSetUsesStyleBasedEditability): Added.
1704         (WebCore::StyleSheetContents::usesStyleBasedEditability): Added.
1705
1706         * dom/Document.cpp:
1707         (WebCore::Document::recalcStyle): Added a FIXME as well as a comment explaining why we don't call
1708         setUsesStyleBasedEditability. Since Node::computeEditability triggers style recalc only when the flag
1709         is set to true, it's too late to update the flag here.
1710         (WebCore::Document::updateStyleIfNeeded): Uses a newly extracted needsStyleRecalc.
1711         (WebCore::Document::updateBaseURL): Preserves m_usesStyleBasedEditability as well as m_usesRemUnit.
1712         (WebCore::Document::usesStyleBasedEditability): Added. Returns true when inline style declarations or
1713         any active stylesheet uses -webkit-user-modify or -webkit-user-select: all. Flushing pending stylesheet
1714         changes here is fine because the alternative is to trigger a full blown style recalc.
1715
1716         * dom/Document.h:
1717         (WebCore::Document::needsStyleRecalc): Added. Extracted from updateStyleIfNeeded.
1718
1719         * dom/DocumentStyleSheetCollection.cpp:
1720         (WebCore::DocumentStyleSheetCollection::DocumentStyleSheetCollection):
1721         (WebCore::styleSheetsUseRemUnits): Deleted.
1722         (WebCore::DocumentStyleSheetCollection::updateActiveStyleSheets): Updates m_usesStyleBasedEditability
1723         as well as m_usesRemUnit.
1724
1725         * dom/DocumentStyleSheetCollection.h:
1726         (WebCore::DocumentStyleSheetCollection::usesStyleBasedEditability): Added.
1727         (WebCore::DocumentStyleSheetCollection::setUsesStyleBasedEditability): Added.
1728
1729         * dom/Node.cpp:
1730         (WebCore::computeEditabilityFromComputedStyle): Extracted from computeEditability.
1731         (WebCore::Node::computeEditability): When the style recalc is requested and the render tree is dirty,
1732         check if the document uses any CSS property that can affect the editability of elements. If it doesn't,
1733         compute the editability from contenteditable attributes in the anchors via matchesReadWritePseudoClass.
1734         Continue to use the style-based computation when the render tree isn't dirty to avoid the tree walk.
1735
1736         * html/HTMLElement.cpp:
1737         (WebCore::HTMLElement::editabilityFromContentEditableAttr): Extracted from matchesReadWritePseudoClass
1738         to be called in Node::computeEditability. Also made it return Editability instead of boolean.
1739         (WebCore::HTMLElement::matchesReadWritePseudoClass):
1740         * html/HTMLElement.h:
1741
1742 2015-03-01  Brent Fulgham  <bfulgham@apple.com>
1743
1744         [Win] Unreviewed build fix.
1745
1746         * WebCorePrefix.h: Provide some default definitions to help build on Windows
1747         machines with different application support libraries.
1748
1749 2015-02-28  Simon Fraser  <simon.fraser@apple.com>
1750
1751         Viewport units should not dirty style just before we do layout
1752         https://bugs.webkit.org/show_bug.cgi?id=141682
1753
1754         Reviewed by Zalan Bujtas.
1755         
1756         In documents using viewport units, we dirtied style every time layout changed
1757         the size of the document. This is nonsensical, because viewport units depend on the
1758         viewport size, not the document size.
1759         
1760         Move the style dirtying from layout() into availableContentSizeChanged(). Hook
1761         this up for WebKit1 by calling from -[WebFrameView _frameSizeChanged], and,
1762         since that causes availableContentSizeChanged() to be called for WK1 for the first
1763         time, protect the call to updateScrollbars() with a !platformWidget check.
1764
1765         Covered by existing viewport unit tests.
1766
1767         * page/FrameView.cpp:
1768         (WebCore::FrameView::layout):
1769         (WebCore::FrameView::availableContentSizeChanged):
1770         (WebCore::FrameView::viewportSizeForCSSViewportUnits): Add a FIXME comment. Whether
1771         scrollbars are ignored depends on the value of the overflow property on the root element.
1772         * page/FrameView.h:
1773         * platform/ScrollView.cpp:
1774         (WebCore::ScrollView::availableContentSizeChanged):
1775
1776 2015-02-28  Andreas Kling  <akling@apple.com>
1777
1778         [Cocoa] Purge SQLite page cache when under memory pressure.
1779         <https://webkit.org/b/142139>
1780         <rdar://problem/19997739>
1781
1782         Reviewed by Pratik Solanki.
1783
1784         Call out to sqlite3 cache purging SPI on Cocoa platforms when
1785         we need to free up some extra memory.
1786
1787         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
1788         (WebCore::MemoryPressureHandler::platformReleaseMemory):
1789
1790 2015-02-28  Simon Fraser  <simon.fraser@apple.com>
1791
1792         FrameView::layoutTimerFired() should update style if needed before doing layout
1793         https://bugs.webkit.org/show_bug.cgi?id=141688
1794
1795         Reviewed by Andreas Kling.
1796
1797         If the style recalc timer has been scheduled to fire after the layout timer,
1798         when the layout timer fires, we might as well just do the style recalc
1799         too. The call to updateStyleIfNeeded() will cancel the pending style
1800         recalc timer.
1801         
1802         This doesn't have much impact on the number of layouts (measured via PLT)
1803         but seems like a reasonable thing to do.
1804
1805         * page/FrameView.cpp:
1806         (WebCore::FrameView::layoutTimerFired):
1807
1808 2015-02-28  Simon Fraser  <simon.fraser@apple.com>
1809
1810         Fullscreen video layers are off by one sometimes
1811         https://bugs.webkit.org/show_bug.cgi?id=142122
1812         rdar://problem/19878821
1813
1814         Reviewed by Eric Carlson.
1815
1816         Convert MediaPlayer::naturalSize() to return a FloatSize, since the natural size
1817         isn't always integral (because of preserving pixel aspect ratio etc). Fix all the media
1818         backends to use FloatSizes for natural size. Convert the video image drawing code
1819         paths to FloatSize, since naturalSize is used on the destination rect computation,
1820         and painting should be floating point anyway.
1821         
1822         Give the layer created by SourceBufferPrivateAVFObjC a name in debug builds.
1823
1824         * html/HTMLVideoElement.cpp:
1825         (WebCore::HTMLVideoElement::videoWidth):
1826         (WebCore::HTMLVideoElement::videoHeight):
1827         (WebCore::HTMLVideoElement::paintCurrentFrameInContext):
1828         * html/HTMLVideoElement.h:
1829         * html/canvas/CanvasRenderingContext2D.cpp:
1830         (WebCore::size):
1831         (WebCore::CanvasRenderingContext2D::drawImage):
1832         * html/canvas/WebGLRenderingContextBase.cpp:
1833         (WebCore::WebGLRenderingContextBase::videoFrameToImage):
1834         * platform/graphics/MediaPlayer.cpp:
1835         (WebCore::NullMediaPlayerPrivate::naturalSize):
1836         (WebCore::MediaPlayer::naturalSize):
1837         (WebCore::MediaPlayer::paint):
1838         (WebCore::MediaPlayer::paintCurrentFrameInContext):
1839         (WebCore::NullMediaPlayerPrivate::paint): Deleted.
1840         * platform/graphics/MediaPlayer.h:
1841         * platform/graphics/MediaPlayerPrivate.h:
1842         (WebCore::MediaPlayerPrivateInterface::paintCurrentFrameInContext):
1843         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1844         (WebCore::MediaPlayerPrivateAVFoundation::naturalSize):
1845         (WebCore::MediaPlayerPrivateAVFoundation::setNaturalSize):
1846         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
1847         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1848         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1849         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintCurrentFrameInContext):
1850         (WebCore::MediaPlayerPrivateAVFoundationObjC::paint):
1851         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithImageGenerator):
1852         (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageForTimeInRect):
1853         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
1854         (WebCore::MediaPlayerPrivateAVFoundationObjC::sizeChanged):
1855         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
1856         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1857         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1858         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::naturalSize):
1859         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paint):
1860         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paintCurrentFrameInContext):
1861         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
1862         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
1863         (WebCore::MediaSourcePrivateAVFObjC::naturalSize):
1864         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
1865         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1866         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
1867         (WebCore::SourceBufferPrivateAVFObjC::naturalSize):
1868         * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h:
1869         * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.mm:
1870         (WebCore::VideoTrackPrivateMediaSourceAVFObjC::naturalSize):
1871         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
1872         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
1873         (WebCore::MediaPlayerPrivateQTKit::naturalSize):
1874         (WebCore::MediaPlayerPrivateQTKit::paintCurrentFrameInContext):
1875         (WebCore::MediaPlayerPrivateQTKit::paint):
1876         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
1877         (WebCore::MockMediaPlayerMediaSource::naturalSize):
1878         (WebCore::MockMediaPlayerMediaSource::paint):
1879         * platform/mock/mediasource/MockMediaPlayerMediaSource.h:
1880         * rendering/RenderVideo.cpp:
1881         (WebCore::RenderVideo::calculateIntrinsicSize):
1882         (WebCore::RenderVideo::paintReplaced):
1883
1884 2015-02-27  Hunseop Jeong  <hs85.jeong@samsung.com>
1885
1886         [EFL][GTK] Fix build break after r180790,180798
1887         https://bugs.webkit.org/show_bug.cgi?id=142127
1888
1889         Reviewed by Gyuyoung Kim.
1890
1891         * platform/graphics/cairo/PathCairo.cpp:
1892         (WebCore::Path::addEllipse):
1893
1894 2015-02-27  Zalan Bujtas  <zalan@apple.com>
1895
1896         Subpixel-layout: width: max-content; property might cause unnecessary scrollbar.
1897         https://bugs.webkit.org/show_bug.cgi?id=142065
1898
1899         Reviewed by Simon Fraser.
1900
1901         We should not pixelsnap (ceil in this case) logical coordinates during layout.
1902         Should this cause content to be partially cut off, we need to
1903         find the broken piece in the computation logic.
1904
1905         Covered by the unskipped test.
1906
1907         * rendering/RootInlineBox.cpp:
1908         (WebCore::RootInlineBox::paddedLayoutOverflowRect):
1909
1910 2015-02-27  Ryosuke Niwa  <rniwa@webkit.org>
1911
1912         Node::hasEditableStyle and isEditablePosition have too many options
1913         https://bugs.webkit.org/show_bug.cgi?id=142078
1914
1915         Reviewed by Andreas Kling.
1916
1917         Moved the code that dealt with accessibility to htmlediting.cpp from Node. This patch introduces
1918         new editing helper functions hasEditableStyle and isEditableNode for this purpose.
1919
1920         Also removed UserSelectAllTreatment from isContentEditable's arguments in the favor of using
1921         newly extracted computeEditability in call sites that specify this option since isContentEditable
1922         is a public DOM API.
1923
1924         No new tests since there should be no observable behavior changes.
1925
1926         * accessibility/AXObjectCache.h: Removed the declaration of an undefined function.
1927
1928         * dom/Element.cpp:
1929         (WebCore::Element::shouldUseInputMethod): Uses newly added computeEditability.
1930
1931         * dom/Node.cpp:
1932         (WebCore::Node::isContentEditable): Ditto. No longer takes UserSelectAllTreatment as an argument.
1933         (WebCore::Node::isContentRichlyEditable): Ditto.
1934         (WebCore::Node::computeEditability): Renamed from hasEditableStyle to avoid the confusion with
1935         a helper function of the same name. Added ShouldUpdateStyle as an argument to optionally update
1936         style tree. Also returns tri-state Editability enum instead of returning a boolean based on
1937         the value of EditableLevel argument.
1938         (WebCore::Node::isEditableToAccessibility): Moved to htmlediting.cpp.
1939         (WebCore::Node::willRespondToMouseClickEvents): Uses newly added computeEditability.
1940         (WebCore::Node::rootEditableElement): Moved to htmlediting.cpp.
1941
1942         * dom/Node.h: No longer includes EditingBoundary.h.
1943         (WebCore::Node::isContentEditable):
1944         (WebCore::Node::hasEditableStyle): No longer takes EditableType as an argument.
1945         (WebCore::Node::hasRichlyEditableStyle): Ditto.
1946
1947         * editing/ApplyStyleCommand.cpp:
1948         (WebCore::ApplyStyleCommand::removeInlineStyleFromElement): Uses newly added isEditableNode.
1949         (WebCore::ApplyStyleCommand::surroundNodeRangeWithElement): Ditto.
1950         * editing/DeleteFromTextNodeCommand.cpp:
1951         (WebCore::DeleteFromTextNodeCommand::doApply): Ditto.
1952         * editing/FrameSelection.cpp:
1953         (WebCore::CaretBase::invalidateCaretRect): Ditto.
1954         * editing/InsertNodeBeforeCommand.cpp:
1955         (WebCore::InsertNodeBeforeCommand::doApply): Ditto.
1956         (WebCore::InsertNodeBeforeCommand::doUnapply): Ditto.
1957         * editing/RemoveNodeCommand.cpp:
1958         (WebCore::RemoveNodeCommand::doApply): Ditto.
1959
1960         * editing/VisibleSelection.cpp:
1961         (WebCore::VisibleSelection::hasEditableStyle): Since this is the only caller of isEditablePosition
1962         which sets DoNotUpdateStyle, directly call hasEditableStyle on the container node instead. This was
1963         not possible prior to r180726 because isEditablePosition had to move out of tables.
1964
1965         * editing/VisibleUnits.cpp:
1966         (WebCore::previousLeafWithSameEditability): Uses newly added hasEditableStyle.
1967         (WebCore::nextLeafWithSameEditability): Ditto.
1968         (WebCore::rootEditableOrDocumentElement): Extracted from previousLinePosition. Use helper functions
1969         in htmlediting.cpp instead of member functions of Node since they no longer support EditableType.
1970         (WebCore::previousLinePosition):
1971         (WebCore::nextLinePosition):
1972
1973         * editing/htmlediting.cpp:
1974         (WebCore::highestEditableRoot): Uses newly added hasEditableStyle.
1975         (WebCore::isEditableToAccessibility): Moved from Node.
1976         (WebCore::computeEditability): Extracted from isEditablePosition.
1977         (WebCore::hasEditableStyle): Added.
1978         (WebCore::isEditableNode): Added.
1979         (WebCore::isEditablePosition): Now calls computeEditability.
1980         (WebCore::isRichlyEditablePosition): No longer takes EditableType since that variant was never used.
1981         (WebCore::editableRootForPosition): Moved the code from Node::rootEditableElement.
1982
1983         * editing/htmlediting.h:
1984
1985 2015-02-27  Chris Dumez  <cdumez@apple.com>
1986
1987         Make ActiveDOMObject::canSuspend() pure virtual
1988         https://bugs.webkit.org/show_bug.cgi?id=142096
1989         <rdar://problem/19923085>
1990
1991         Reviewed by Andreas Kling.
1992
1993         Make ActiveDOMObject::canSuspend() pure virtual so that people at least
1994         try to provide an implementation for it. The default implementation was
1995         returning false unconditionally and thus was preventing pages from
1996         entering the PageCache.
1997
1998 2015-02-27  Commit Queue  <commit-queue@webkit.org>
1999
2000         Unreviewed, rolling out r180203 and r180210.
2001         https://bugs.webkit.org/show_bug.cgi?id=142116
2002
2003         broke process suspension and tile map (Requested by thorton on
2004         #webkit).
2005
2006         Reverted changesets:
2007
2008         "Adopt CAMachPort-as-layer-contents"
2009         https://bugs.webkit.org/show_bug.cgi?id=141687
2010         http://trac.webkit.org/changeset/180203
2011
2012         "Fix the !USE(IOSURFACE) build"
2013         http://trac.webkit.org/changeset/180210
2014
2015 2015-02-27  Sam Weinig  <sam@webkit.org>
2016
2017         Add WebKit2 SPI to create a DOM File object
2018         https://bugs.webkit.org/show_bug.cgi?id=142109
2019
2020         Reviewed by Tim Horton.
2021
2022         * WebCore.xcodeproj/project.pbxproj:
2023         Make <WebCore/File.h> (and associated files) available to WebKit2.
2024
2025 2015-02-27  Myles C. Maxfield  <mmaxfield@apple.com>
2026
2027         [Subpixel] Subpixelize RenderListMarker
2028         https://bugs.webkit.org/show_bug.cgi?id=142093
2029
2030         Reviewed by Zalan Bujtas.
2031
2032         Use floats instead of ints.
2033
2034         Test: fast/lists/rtl-marker.html
2035
2036         * rendering/RenderListMarker.cpp:
2037         (WebCore::RenderListMarker::paint):
2038         (WebCore::RenderListMarker::updateContent):
2039         (WebCore::RenderListMarker::getRelativeMarkerRect):
2040         * rendering/RenderListMarker.h:
2041
2042 2015-02-27  Timothy Horton  <timothy_horton@apple.com>
2043
2044         <attachment> should be selected immediately upon click, and be drag/copyable upon click
2045         https://bugs.webkit.org/show_bug.cgi?id=142114
2046         <rdar://problem/19982520>
2047
2048         Reviewed by Enrica Casucci.
2049
2050         * css/html.css:
2051         (attachment):
2052         Make attachment use 'user-select: all' to act as a single click-to-select unit.
2053
2054         * html/HTMLAttachmentElement.cpp:
2055         (WebCore::HTMLAttachmentElement::setFocus): Deleted.
2056         * html/HTMLAttachmentElement.h:
2057         * rendering/RenderAttachment.cpp:
2058         (WebCore::RenderAttachment::isFocused): Deleted.
2059         (WebCore::RenderAttachment::focusChanged): Deleted.
2060         * rendering/RenderAttachment.h:
2061         * rendering/RenderThemeMac.mm:
2062         (WebCore::RenderThemeMac::paintAttachment):
2063         Remove focus-related code; instead of focusing the element upon click,
2064         we get a selection including just the <attachment>, and everything
2065         behaves much more consistently (copy works, drag works, etc.).
2066
2067 2015-02-27  Myles C. Maxfield  <mmaxfield@apple.com>
2068
2069         [iOS] Some MathML tests crash in RenderMathMLOperator::advanceForGlyph() or boundsForGlyph()
2070         https://bugs.webkit.org/show_bug.cgi?id=141371
2071
2072         Reviewed by David Kilzer.
2073
2074         Null checks.
2075
2076         Covered by existing mathml tests.
2077
2078         * rendering/mathml/RenderMathMLOperator.cpp:
2079         (WebCore::RenderMathMLOperator::boundsForGlyph):
2080         (WebCore::RenderMathMLOperator::advanceForGlyph):
2081         (WebCore::RenderMathMLOperator::getDisplayStyleLargeOperator):
2082
2083 2015-02-27  Chris Dumez  <cdumez@apple.com>
2084
2085         Make SourceBuffer ActiveDOMObject suspendable
2086         https://bugs.webkit.org/show_bug.cgi?id=142108
2087         <rdar://problem/19923085>
2088
2089         Reviewed by Jer Noble.
2090
2091         Make SourceBuffer ActiveDOMObject suspendable if it is removed from its
2092         MediaSource and does not have any pending events. This makes it more
2093         likely for pages using SourceBuffer objects to go into the PageCache.
2094
2095         Test: fast/history/page-cache-removed-source-buffer.html
2096
2097         * Modules/mediasource/SourceBuffer.cpp:
2098         (WebCore::SourceBuffer::canSuspend):
2099         * Modules/mediasource/SourceBuffer.h:
2100
2101 2015-02-26  Sam Weinig  <sam@webkit.org>
2102
2103         Add support for canvas ellipse method
2104         https://bugs.webkit.org/show_bug.cgi?id=82791
2105         <rdar://problem/11159172>
2106
2107         Reviewed by Dirk Schulze.
2108
2109         Tests: fast/canvas/canvas-ellipse-360-winding.html
2110                fast/canvas/canvas-ellipse-circumference-fill.html
2111                fast/canvas/canvas-ellipse-circumference.html
2112                fast/canvas/canvas-ellipse-connecting-line.html
2113                fast/canvas/canvas-ellipse-negative-radius.html
2114                fast/canvas/canvas-ellipse-zero-lineto.html
2115                fast/canvas/canvas-ellipse.html
2116
2117         * html/canvas/CanvasPathMethods.h:
2118         * html/canvas/CanvasPathMethods.cpp:
2119         (WebCore::CanvasPathMethods::lineTo):
2120         Convenience for passing a FloatPoint instead of two floats.
2121
2122         (WebCore::normalizeAngles):
2123         Normalizes the angles as described in the HTML spec. Ensuring the startAngle
2124         is greater than 0 and less than 2pi, and the the endAngle is at most 2pi
2125         from the start angle.
2126
2127         (WebCore::CanvasPathMethods::arc):
2128         - Renames some of the parameters to be clearer.
2129         - Normalizes the angles for consistency with ellipse.
2130         - Moves hasInvertibleTransform() higher in the function for consistency.
2131
2132         (WebCore::CanvasPathMethods::ellipse): Added.
2133
2134         * html/canvas/CanvasRenderingContext2D.idl:
2135         * html/canvas/DOMPath.idl:
2136         Add ellipse(...).
2137
2138         * platform/graphics/Path.h:
2139         * platform/graphics/cg/PathCG.cpp:
2140         (WebCore::Path::addArc):
2141         Rename parameters for clarity and use a nullptr.
2142
2143         (WebCore::Path::addEllipse):
2144         Added. Constructs an ellipse via a transformed arc.
2145
2146 2015-02-27  Enrica Casucci  <enrica@apple.com>
2147
2148         Adding support for serializing HTMLAttachment elements.
2149         https://bugs.webkit.org/show_bug.cgi?id=142026
2150
2151         Reviewed by Tim Horton.
2152
2153         Test: editing/pasteboard/copy-paste-attachment.html
2154
2155         Adding support to serialize the attachment element
2156         and properly handle it when converting a DOM range
2157         to NSAttributedString.
2158
2159         * editing/cocoa/HTMLConverter.mm:
2160         (HTMLConverter::_processElement):
2161         * editing/markup.cpp:
2162         (WebCore::StyledMarkupAccumulator::appendCustomAttributes): Create new attribute
2163         for attachment element when serializating.
2164         (WebCore::StyledMarkupAccumulator::appendElement):
2165         (WebCore::createFragmentFromMarkup): Remove the attribute from the attachment element
2166         when creating the fragment.
2167         * html/HTMLAttachmentElement.cpp:
2168         (WebCore::HTMLAttachmentElement::file): Added const to file() to
2169         use it in appendCustonAttributes where the element is a const reference.
2170         * html/HTMLAttachmentElement.h:
2171         * html/HTMLAttributeNames.in:
2172
2173 2015-02-27  Timothy Horton  <timothy_horton@apple.com>
2174
2175         <attachment> should have an inactive style (gray in background)
2176         https://bugs.webkit.org/show_bug.cgi?id=142103
2177         <rdar://problem/19982486>
2178
2179         Reviewed by Dan Bernstein.
2180
2181         * rendering/RenderThemeMac.mm:
2182         (WebCore::attachmentLabelInactiveBackgroundColor):
2183         (WebCore::attachmentLabelInactiveTextColor):
2184         (WebCore::RenderThemeMac::paintAttachmentLabelBackground):
2185         (WebCore::RenderThemeMac::paintAttachmentLabel):
2186         Use a gray background and gray text when the selection containing the
2187         attachment isn't focused and active.
2188
2189 2015-02-27  Brady Eidson  <beidson@apple.com>
2190
2191         Add a "block-cookies" rule to the user content filter.
2192         https://bugs.webkit.org/show_bug.cgi?id=142105
2193
2194         Reviewed by Alex Christensen.
2195
2196         Tests: http/tests/usercontentfilter/block-cookies-basic.html
2197                http/tests/usercontentfilter/block-cookies-send.html
2198
2199         * contentextensions/ContentExtensionRule.h:
2200
2201         * contentextensions/ContentExtensionsBackend.cpp:
2202         (WebCore::ContentExtensions::ContentExtensionsBackend::actionForURL):
2203         (WebCore::ContentExtensions::ContentExtensionsBackend::shouldBlockURL): Deleted.
2204         * contentextensions/ContentExtensionsBackend.h:
2205
2206         * contentextensions/ContentExtensionsManager.cpp:
2207         (WebCore::ContentExtensions::ExtensionsManager::loadAction):
2208
2209         * loader/cache/CachedResourceLoader.cpp:
2210         (WebCore::CachedResourceLoader::requestResource):
2211
2212         * page/UserContentController.cpp:
2213         (WebCore::UserContentController::actionForURL):
2214         (WebCore::UserContentController::contentFilterBlocksURL): Deleted.
2215         * page/UserContentController.h:
2216
2217 2015-02-27  Alex Christensen  <achristensen@webkit.org>
2218
2219         [WinCairo] Unreviewed build fix.
2220
2221         * platform/graphics/BitmapImage.h:
2222         * platform/win/BitmapInfo.h:
2223         Added WEBCORE_EXPORT.
2224
2225 2015-02-27  Timothy Horton  <timothy_horton@apple.com>
2226
2227         <attachment>'s label baseline should match that of the surrounding text
2228         https://bugs.webkit.org/show_bug.cgi?id=142099
2229         rdar://problem/19982495
2230
2231         Reviewed by Dan Bernstein.
2232
2233         * rendering/RenderAttachment.cpp:
2234         (WebCore::RenderAttachment::baselinePosition):
2235         * rendering/RenderAttachment.h:
2236         Override baselinePosition and retrieve it from RenderTheme.
2237
2238         * rendering/RenderTheme.h:
2239         (WebCore::RenderTheme::attachmentBaseline):
2240         * rendering/RenderThemeMac.h:
2241         * rendering/RenderThemeMac.mm:
2242         (WebCore::AttachmentLayout::AttachmentLayout):
2243         (WebCore::RenderThemeMac::attachmentBaseline):
2244         Plumb the label baseline from AttachmentLayout to RenderAttachment.
2245
2246 2015-02-27  Commit Queue  <commit-queue@webkit.org>
2247
2248         Unreviewed, rolling out r180752.
2249         https://bugs.webkit.org/show_bug.cgi?id=142098
2250
2251         Causes 10 SVG test failures on Windows. (Requested by
2252         bfulgham_ on #webkit).
2253
2254         Reverted changeset:
2255
2256         "Cache glyph widths to GlyphPages"
2257         https://bugs.webkit.org/show_bug.cgi?id=142028
2258         http://trac.webkit.org/changeset/180752
2259
2260 2015-02-27  David Kilzer  <ddkilzer@apple.com>
2261
2262         [iOS] Fix build by defining EAGL_IOSURFACE macro before including <OpenGLES/EAGLPrivate.h>
2263
2264         * platform/spi/ios/OpenGLESSPI.h:  Define EAGL_IOSURFACE macro
2265         until header refactoring is completed.
2266
2267 2015-02-27  Chris Dumez  <cdumez@apple.com>
2268
2269         MediaSource should be suspendable when closed
2270         https://bugs.webkit.org/show_bug.cgi?id=142089
2271         <rdar://problem/19923085>
2272
2273         Reviewed by Jer Noble.
2274
2275         Make MediaSource ActiveDOMObject suspendable when it is in closed state
2276         and it has no pending events. This increases the likelihood of pages
2277         using MediaSource to enter the PageCache.
2278
2279         Tests: fast/history/page-cache-media-source-closed-2.html
2280                fast/history/page-cache-media-source-closed.html
2281                fast/history/page-cache-media-source-opened.html
2282
2283 2015-02-27  Andreas Kling  <akling@apple.com>
2284
2285         Use NeverDestroyed for JS wrapper owners.
2286         <https://webkit.org/b/142090>
2287
2288         Reviewed by Chris Dumez.
2289
2290         Using NeverDestroyed puts these objects in BSS which is preferable
2291         since that prevents them from pinning down entire malloc pages forever.
2292
2293         * bindings/scripts/CodeGeneratorJS.pm:
2294         (GenerateHeader): Use NeverDestroyed instead of DEPRECATED_DEFINE_STATIC_LOCAL.
2295
2296         * bindings/scripts/test/JS/*: Rebaseline bindings tests for this change.
2297
2298 2015-02-27  Chris Dumez  <cdumez@apple.com>
2299
2300         Make IDBDatabase / IDBRequest suspendable
2301         https://bugs.webkit.org/show_bug.cgi?id=142076
2302         <rdar://problem/19923085>
2303
2304         Reviewed by Andreas Kling.
2305
2306         Make IDBDatabase / IDBRequest suspendable under certain conditions to
2307         make it more likely for pages using indexeddb to enter the PageCache.
2308
2309         IDBDatabase is safely suspendable if the database is closed. IDBRequest
2310         is safely suspendable if the request no longer has any pending activity
2311         (i.e. state is DONE and success / failure handler was called). We may
2312         be able to do better later but this is the bare minimum for now.
2313
2314         Tests: fast/history/page-cache-indexed-closed-db.html
2315                fast/history/page-cache-indexed-opened-db.html
2316
2317         * Modules/indexeddb/IDBDatabase.cpp:
2318         (WebCore::IDBDatabase::IDBDatabase):
2319         (WebCore::IDBDatabase::closeConnection):
2320         (WebCore::IDBDatabase::enqueueEvent):
2321         (WebCore::IDBDatabase::canSuspend):
2322         * Modules/indexeddb/IDBDatabase.h:
2323         * Modules/indexeddb/IDBRequest.cpp:
2324         (WebCore::IDBRequest::canSuspend):
2325         * Modules/indexeddb/IDBRequest.h:
2326
2327 2015-02-27  Chris Dumez  <cdumez@apple.com>
2328
2329         Drop unnecessary DatabaseManager::hasOpenDatabases() in PageCache::canCachePageContainingThisFrame()
2330         https://bugs.webkit.org/show_bug.cgi?id=142052
2331
2332         Reviewed by Andreas Kling.
2333
2334         Drop WebDatabase special-handling from PageCache::canCachePageContainingThisFrame().
2335         DatabaseContext is already an ActiveDOMObject and DatabaseContext::canSuspend() was
2336         returning false so pages using WebDatabase would never enter the PageCache anyway.
2337
2338         This patch also overrides ActiveDOMObject::canSuspend() in DatabaseContext to only
2339         return false when there are open databases. This check is now equivalent to the one
2340         that was in PageCache.
2341
2342         An issue that remains is that DatabaseContext::m_hasOpenDatabases is never reset
2343         to false so once a page opened a database, it will never be page-cacheable. This
2344         will be taken care of separately though.
2345
2346         Test: fast/history/page-cache-webdatabase-opened-db.html
2347
2348         * Modules/webdatabase/DatabaseContext.cpp:
2349         (WebCore::DatabaseContext::canSuspend):
2350         * Modules/webdatabase/DatabaseContext.h:
2351         * history/PageCache.cpp:
2352         (WebCore::logCanCacheFrameDecision):
2353         (WebCore::PageCache::canCachePageContainingThisFrame):
2354         * page/DiagnosticLoggingKeys.cpp:
2355         (WebCore::DiagnosticLoggingKeys::hasOpenDatabasesKey): Deleted.
2356         * page/DiagnosticLoggingKeys.h:
2357
2358 2015-02-27  Alex Christensen  <achristensen@webkit.org>
2359
2360         Compile DFA to bytecode.
2361         https://bugs.webkit.org/show_bug.cgi?id=142031
2362
2363         Reviewed by Benjamin Poulain.
2364
2365         * WebCore.xcodeproj/project.pbxproj:
2366         * contentextensions/ContentExtensionsBackend.cpp:
2367         (WebCore::ContentExtensions::ContentExtensionsBackend::setRuleList):
2368         (WebCore::ContentExtensions::ContentExtensionsBackend::shouldBlockURL):
2369         * contentextensions/ContentExtensionsBackend.h:
2370         * contentextensions/DFA.cpp:
2371         (WebCore::ContentExtensions::DFA::nextState): Deleted.
2372         (WebCore::ContentExtensions::DFA::actions): Deleted.
2373         * contentextensions/DFA.h:
2374         (WebCore::ContentExtensions::DFA::size):
2375         (WebCore::ContentExtensions::DFA::nodeAt):
2376         * contentextensions/DFABytecode.h: Added.
2377         (WebCore::ContentExtensions::instructionSizeWithArguments):
2378         * contentextensions/DFABytecodeCompiler.cpp: Added.
2379         (WebCore::ContentExtensions::append):
2380         (WebCore::ContentExtensions::set32Bits):
2381         (WebCore::ContentExtensions::DFABytecodeCompiler::emitAppendAction):
2382         (WebCore::ContentExtensions::DFABytecodeCompiler::emitJump):
2383         (WebCore::ContentExtensions::DFABytecodeCompiler::emitCheckValue):
2384         (WebCore::ContentExtensions::DFABytecodeCompiler::emitTerminate):
2385         (WebCore::ContentExtensions::DFABytecodeCompiler::reserveBufferCapacity):
2386         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNode):
2387         (WebCore::ContentExtensions::DFABytecodeCompiler::compile):
2388         * contentextensions/DFABytecodeCompiler.h: Added.
2389         (WebCore::ContentExtensions::DFABytecodeCompiler::DFABytecodeCompiler):
2390         * contentextensions/DFABytecodeInterpreter.cpp: Added.
2391         (WebCore::ContentExtensions::getBits):
2392         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
2393         * contentextensions/DFABytecodeInterpreter.h: Added.
2394         (WebCore::ContentExtensions::DFABytecodeInterpreter::DFABytecodeInterpreter):
2395
2396 2015-02-27  Zalan Bujtas  <zalan@apple.com>
2397
2398         Use after free in WebCore::RenderNamedFlowFragment::restoreRegionObjectsOriginalStyle
2399         https://bugs.webkit.org/show_bug.cgi?id=138366
2400
2401         Reviewed by Dave Hyatt.
2402
2403         This patch ensures that we clean up RenderNamedFlowFragment::m_renderObjectRegionStyle when embedded flow content is getting destroyed.
2404
2405         In m_renderObjectRegionStyle hash map, we store style information about the named flow's descendant children.
2406         When a child is being detached from the tree, it removes itself from this hashmap.
2407         We do it by traversing up on the ancestor chain and call removeFlowChildInfo() on the parent flow.
2408         However in case of embedded flows (for example multicolumn content inside a region), we need to check whether the parent flow
2409         is inside a flow too and continue the cleanup accordingly.
2410
2411         Test: fast/regions/region-with-multicolumn-embedded-crash.html
2412
2413         * rendering/RenderObject.cpp:
2414         (WebCore::RenderObject::removeFromRenderFlowThreadIncludingDescendants):
2415
2416 2015-02-27  Brady Eidson  <beidson@apple.com>
2417
2418         Add API to remove a single content filter.
2419         <rdar://problem/19977764> and https://bugs.webkit.org/show_bug.cgi?id=142088
2420
2421         Reviewed by Sam Weinig.
2422
2423         * page/UserContentController.cpp:
2424         (WebCore::UserContentController::removeUserContentFilter):
2425         * page/UserContentController.h:
2426
2427 2015-02-26  Brent Fulgham  <bfulgham@apple.com>
2428
2429         [Win] Remove remaining SafariTheme cruft
2430         https://bugs.webkit.org/show_bug.cgi?id=142075
2431
2432         Reviewed by Anders Carlsson.
2433
2434         Remove reference to SafariTheme-switching preference.
2435
2436         Tested by existing layout tests.
2437
2438         * WebCore.vcxproj/WebCore.vcxproj:
2439         * WebCore.vcxproj/WebCore.vcxproj.filters:
2440         * config.h:
2441         * page/Settings.cpp:
2442         (WebCore::Settings::fontRenderingMode):
2443         (WebCore::Settings::setShouldPaintNativeControls): Deleted.
2444         * page/Settings.h:
2445         (WebCore::Settings::shouldPaintNativeControls): Deleted.
2446         * platform/win/ScrollbarThemeWin.cpp:
2447         (WebCore::ScrollbarTheme::nativeTheme):
2448         * rendering/RenderThemeWin.cpp:
2449         (WebCore::RenderTheme::themeForPage):
2450
2451 2015-02-27  Myles C. Maxfield  <mmaxfield@apple.com>
2452
2453         Add comment about CSS value name mangling
2454
2455         Unreviewed
2456
2457         * css/CSSParser.cpp:
2458         (WebCore::cssValueKeywordID):
2459
2460 2015-02-27  Antti Koivisto  <antti@apple.com>
2461
2462         Cache glyph widths to GlyphPages
2463         https://bugs.webkit.org/show_bug.cgi?id=142028
2464
2465         Reviewed by Andreas Kling.
2466
2467         Currently we have a separate cache in Font for glyph widths. In practice we always need
2468         the widths so we can just cache them in GlyphPages. This simplifies the code and removes
2469         a per-character hash lookup from WidthIterator.
2470
2471         * platform/graphics/Font.cpp:
2472         (WebCore::Font::Font):
2473         (WebCore::Font::initCharWidths):
2474         (WebCore::Font::platformGlyphInit):
2475         (WebCore::createAndFillGlyphPage):
2476         (WebCore::Font::computeWidthForGlyph):
2477
2478             Rename to make it clear this doesn't cache.
2479
2480         (WebCore::GlyphPage::setGlyphDataForIndex):
2481
2482             Initialize the width.
2483             This could go to GlyphPage.cpp if we had one.
2484
2485         * platform/graphics/Font.h:
2486         (WebCore::Font::glyphZeroWidth):
2487         (WebCore::Font::isZeroWidthSpaceGlyph):
2488         (WebCore::Font::zeroGlyph): Deleted.
2489         (WebCore::Font::setZeroGlyph): Deleted.
2490         (WebCore::Font::widthForGlyph): Deleted.
2491         * platform/graphics/FontCascade.cpp:
2492         (WebCore::offsetToMiddleOfGlyph):
2493         * platform/graphics/FontCascadeFonts.cpp:
2494         (WebCore::FontCascadeFonts::glyphDataForCharacter):
2495         * platform/graphics/GlyphPage.h:
2496         (WebCore::GlyphData::GlyphData):
2497
2498             Return width too as part of GlyphData.
2499
2500         (WebCore::GlyphPage::glyphDataForIndex):
2501         (WebCore::GlyphPage::setGlyphDataForCharacter):
2502         (WebCore::GlyphPage::setGlyphDataForIndex):
2503         (WebCore::GlyphPage::GlyphPage):
2504         * platform/graphics/WidthIterator.cpp:
2505         (WebCore::WidthIterator::advanceInternal):
2506
2507             No need to lookup width separately now.
2508
2509         * platform/graphics/mac/ComplexTextController.cpp:
2510         (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
2511         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
2512         (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
2513         * rendering/mathml/RenderMathMLOperator.cpp:
2514         (WebCore::RenderMathMLOperator::advanceForGlyph):
2515         * rendering/svg/SVGTextRunRenderingContext.cpp:
2516         (WebCore::missingGlyphForFont):
2517         * svg/SVGFontData.cpp:
2518         (WebCore::SVGFontData::initializeFont):
2519
2520 2015-02-26  Alexey Proskuryakov  <ap@apple.com>
2521
2522         iOS build fix after r180717.
2523
2524         * Modules/webdatabase/DatabaseThread.cpp: (WebCore::DatabaseUnpauseTask::doPerformTask):
2525
2526 2015-02-26  Ryosuke Niwa  <rniwa@webkit.org>
2527
2528         isEditablePosition and related functions shouldn't move position out of table
2529         https://bugs.webkit.org/show_bug.cgi?id=129200
2530
2531         Reviewed by Darin Adler.
2532
2533         This patch removes the legacy editing position for elements display: table in its computed style.
2534         Previously, we used (table, 0) and (table, !0) to denote positions immediately before and after
2535         such an element for historical reasons. This forced us to update the style tree before computing
2536         the editability of a position because we have to check the editability of the position outside
2537         the element with display: table if the position was using such a legacy editing position.
2538         e.g. if a table was not editable (contenteditable=false), the position before the table (table, 0)
2539         should still be considered editable if the parent node of the table was editable.
2540
2541         This patch replaces such a legacy editing position by using modern position types:
2542         PositionIsBeforeAnchor and PositionIsAfterAnchor.
2543
2544         No new tests since there should be no change in the user perceived editing operations.
2545
2546         * dom/Position.cpp:
2547         (WebCore::Position::previous): Setup the node and the offset correctly when the original position's
2548         type is PositionIsBeforeAnchor. Also return a position before or after node when the node we found
2549         is "atomic" (e.g. input, img, br, etc...) or it's a table. This avoids creating a legacy editing
2550         position inside a table.
2551         (WebCore::Position::next): Ditto.
2552         (WebCore::Position::atStartOfTree): Use atFirstEditingPositionForNode, which takes care of all types
2553         of positions.
2554         (WebCore::Position::atEndOfTree): Ditto.
2555         (WebCore::Position::downstream): Return a position before a node instead of a legacy editing position
2556         for an atomic element or a table element as done in the equivalent code in Position::upstream.
2557         (WebCore::Position::isCandidate): Don't treat a position inside a table to be a candidate. e.g.
2558         (table, 1) when there are more than two children of the table.
2559
2560         * dom/PositionIterator.cpp:
2561         (WebCore::PositionIterator::operator Position): PositionIterator internally uses legacy editing
2562         positions. So convert it to a modern position by returning a position before or after a table here.
2563         * editing/ApplyBlockElementCommand.cpp:
2564         (WebCore::ApplyBlockElementCommand::formatSelection): Check that the unsplittable element we found
2565         is actually empty before executing the simple code path for an empty unsplittable element. Without
2566         this check, block formatting a table element will fail.
2567
2568         * editing/htmlediting.cpp:
2569         (WebCore::isEditablePosition): Use containerNode instead of deprecatedNode because the editability
2570         of a position before or after an element is determined by its parent, not the element itself.
2571         (WebCore::isAtUnsplittableElement): Ditto.
2572         (WebCore::isRichlyEditablePosition): Ditto. Removed the code that moved the starting node out of
2573         an element with display: table. This is the code removal for which this patch was made.
2574         (WebCore::editableRootForPosition): Ditto.
2575
2576 2015-02-26  Timothy Horton  <timothy_horton@apple.com>
2577
2578         Implement <attachment> element appearance on Mac
2579         https://bugs.webkit.org/show_bug.cgi?id=142023
2580
2581         Reviewed by Dean Jackson.
2582
2583         * css/CSSParser.cpp:
2584         (WebCore::isValidKeywordPropertyAndValue):
2585         * css/CSSPrimitiveValueMappings.h:
2586         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2587         * css/CSSValueKeywords.in:
2588         * css/html.css:
2589         (attachment):
2590         * platform/ThemeTypes.h:
2591         Add a new -webkit-appearance value, attachment.
2592
2593         * WebCore.xcodeproj/project.pbxproj:
2594         * html/HTMLAttachmentElement.cpp:
2595         (WebCore::HTMLAttachmentElement::setFile):
2596         Let the renderer know when the file changes (so it can relayout and repaint).
2597
2598         (WebCore::HTMLAttachmentElement::filePath):
2599         (WebCore::HTMLAttachmentElement::fileName):
2600         * html/HTMLAttachmentElement.h:
2601         Handy acccessors for the full path and the name of the file.
2602
2603         * platform/spi/mac/IconServicesSPI.h: Added.
2604         * platform/spi/mac/LaunchServicesSPI.h: Added.
2605         Add some IconServices and LaunchServices SPI headers.
2606
2607         * rendering/RenderAttachment.cpp:
2608         (WebCore::RenderAttachment::RenderAttachment):
2609         Don't have a default intrinsic size; we'll adjust in layout().
2610
2611         (WebCore::RenderAttachment::isSelected):
2612         (WebCore::RenderAttachment::isFocused):
2613         (WebCore::RenderAttachment::isSelectedOrFocused):
2614         Factor out from paintReplaced().
2615
2616         (WebCore::RenderAttachment::layout):
2617         Use RenderTheme to compute the intrinsic size of this attachment.
2618
2619         (WebCore::RenderAttachment::paintReplaced):
2620         Use RenderTheme to paint the attachment.
2621
2622         (WebCore::RenderAttachment::representedFileChanged):
2623         When the represented file changes, we need to recompute the intrinsic size and repaint.
2624
2625         * rendering/RenderTheme.cpp:
2626         (WebCore::RenderTheme::adjustStyle):
2627         (WebCore::RenderTheme::paint):
2628         (WebCore::RenderTheme::adjustAttachmentStyle):
2629         (WebCore::RenderTheme::paintAttachment):
2630         Plumb through the attachment appearance.
2631
2632         * rendering/RenderAttachment.h:
2633         * rendering/RenderTheme.h:
2634         (WebCore::RenderTheme::paintAttachment):
2635         (WebCore::RenderTheme::attachmentIntrinsicSize):
2636         * rendering/RenderThemeMac.h:
2637         * rendering/RenderThemeMac.mm:
2638         (WebCore::attachmentIconBackgroundColor):
2639         (WebCore::attachmentIconBorderColor):
2640         (WebCore::AttachmentLayout):
2641         AttachmentLayout lays out the innards of the RenderThemeMac attachment
2642         presentation: an icon with an optional bordered background, with a label
2643         underneath it with an optional background.
2644
2645         (WebCore::RenderThemeMac::attachmentIntrinsicSize):
2646         (WebCore::paintAttachmentIconBackground):
2647         (WebCore::paintAttachmentIcon):
2648         (WebCore::RenderThemeMac::paintAttachmentLabelBackground):
2649         (WebCore::RenderThemeMac::paintAttachmentLabel):
2650         (WebCore::RenderThemeMac::paintAttachment):
2651         Paint the attachment element. Paint the optional backgrounds (and swap
2652         out the text color) if the element is selected/focused.
2653
2654 2015-02-26  Doug Russell  <d_russell@apple.com>
2655
2656         AX: Expose caret browsing preference to accessibility API
2657         https://bugs.webkit.org/show_bug.cgi?id=141862
2658
2659         Reviewed by Chris Fleizach.
2660
2661         Exposing the caret browsing setting on WebCore::Frame via the accessibility API would allow assistive tech apps to enable it contextually (for example, when the assistive tech app is running).
2662         Enabling caret browsing when assistive tech apps are running greatly improves the reliability of keyboard navigation on the web. Most especially in cases where selection would be disrupted by focus events.
2663
2664         Tests: platform/mac/accessibility/caret-browsing-arrow-nav.html
2665                platform/mac/accessibility/caret-browsing-attribute.html
2666                platform/mac/accessibility/caret-browsing-tab-selection.html
2667
2668         * accessibility/AccessibilityObject.h:
2669         * accessibility/mac/AccessibilityObjectMac.mm:
2670         (WebCore::AccessibilityObject::caretBrowsingEnabled):
2671         (WebCore::AccessibilityObject::setCaretBrowsingEnabled):
2672         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2673         (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
2674         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2675         (-[WebAccessibilityObjectWrapper accessibilityIsAttributeSettable:]):
2676         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
2677         (-[WebAccessibilityObjectWrapper _accessibilitySetTestValue:forAttribute:]):
2678
2679 2015-02-26  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2680
2681         Remove unnecessary create() factory functions
2682         https://bugs.webkit.org/show_bug.cgi?id=142039
2683
2684         Reviewed by Chris Dumez.
2685
2686         Clean up remaining JSCryptoKeySerializationJWK::create, HTMLMediaSession::create,
2687         and DatabaseUnpauseTask::create.
2688
2689         * Modules/webdatabase/DatabaseThread.cpp:
2690         (WebCore::DatabaseUnpauseTask::DatabaseUnpauseTask):
2691         (WebCore::DatabaseThread::setPaused):
2692         (WebCore::DatabaseUnpauseTask::create): Deleted.
2693         * bindings/js/JSCryptoKeySerializationJWK.h:
2694         * bindings/js/JSSubtleCryptoCustom.cpp:
2695         (WebCore::importKey):
2696         * html/HTMLMediaElement.cpp:
2697         (WebCore::HTMLMediaElement::HTMLMediaElement):
2698         * html/HTMLMediaSession.cpp:
2699         (WebCore::HTMLMediaSession::create): Deleted.
2700         * html/HTMLMediaSession.h:
2701
2702 2015-02-26  Joseph Pecoraro  <pecoraro@apple.com>
2703
2704         Web Inspector: Save Console Evaluations into Command Line variables $1-$99 ($n)
2705         https://bugs.webkit.org/show_bug.cgi?id=142061
2706
2707         Reviewed by Timothy Hatcher.
2708
2709         * inspector/CommandLineAPIModuleSource.js:
2710         Replace $1-$4 "inspected objects" with $1-$99 "saved results".
2711
2712         * bindings/js/JSCommandLineAPIHostCustom.cpp:
2713         (WebCore::JSCommandLineAPIHost::inspectedObject):
2714         * inspector/CommandLineAPIHost.cpp:
2715         (WebCore::CommandLineAPIHost::CommandLineAPIHost):
2716         (WebCore::CommandLineAPIHost::InspectableObject::get):
2717         (WebCore::CommandLineAPIHost::addInspectedObject):
2718         (WebCore::CommandLineAPIHost::inspectedObject):
2719         (WebCore::CommandLineAPIHost::clearInspectedObjects): Deleted.
2720         * inspector/CommandLineAPIHost.h:
2721         * inspector/CommandLineAPIHost.idl:
2722         Since we now just save the single $0 inspected object, eliminate
2723         keeping track of a list of 5 values.
2724
2725 2015-02-26  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2726
2727         Remove unnecessary create() factory functions in CDMFoo, NamedNodeMap
2728         https://bugs.webkit.org/show_bug.cgi?id=141902
2729
2730         Reviewed by Darin Adler.
2731
2732         Create instance using std::make_unique<> in CDMFactory directly. To do that,
2733         CDMFactory uses lambdas. Additionally this patch removes NamedNodeMap::create() as well.
2734
2735         No new tests, no behavior changes.
2736
2737         * Modules/encryptedmedia/CDM.cpp:
2738         (WebCore::installedCDMFactories):
2739         * Modules/encryptedmedia/CDM.h:
2740         * Modules/encryptedmedia/CDMPrivateClearKey.h:
2741         (WebCore::CDMPrivateClearKey::CDMPrivateClearKey):
2742         (WebCore::CDMPrivateClearKey::create): Deleted.
2743         * Modules/encryptedmedia/CDMPrivateMediaPlayer.h:
2744         (WebCore::CDMPrivateMediaPlayer::create): Deleted.
2745         * dom/Element.cpp:
2746         (WebCore::Element::attributes):
2747         * dom/NamedNodeMap.h:
2748         (WebCore::NamedNodeMap::NamedNodeMap):
2749         (WebCore::NamedNodeMap::create): Deleted.
2750         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h:
2751         (WebCore::CDMPrivateMediaSourceAVFObjC::create): Deleted.
2752
2753 2015-02-26  Andy Estes  <aestes@apple.com>
2754
2755         [Content Filtering] Move WebFilterEvaluator and NEFilterSource declarations to SPI headers
2756         https://bugs.webkit.org/show_bug.cgi?id=142062
2757
2758         Reviewed by Daniel Bates.
2759
2760         * WebCore.xcodeproj/project.pbxproj:
2761         * platform/mac/ContentFilterMac.mm:
2762         * platform/spi/cocoa/NEFilterSourceSPI.h: Added.
2763         * platform/spi/cocoa/WebFilterEvaluatorSPI.h: Added.
2764
2765 2015-02-26  Anders Carlsson  <andersca@apple.com>
2766
2767         Add API to remove all website data for the given data records
2768         https://bugs.webkit.org/show_bug.cgi?id=142060
2769
2770         Reviewed by Beth Dakin.
2771
2772         * loader/cache/MemoryCache.cpp:
2773         (WebCore::MemoryCache::removeResourcesWithOrigins):
2774         New function that removes all resources that match the set of origins in a given session.
2775
2776 2015-02-26  Chris Dumez  <cdumez@apple.com>
2777
2778         Rename DatabaseManager::manager() to DatabaseManager::singleton()
2779         https://bugs.webkit.org/show_bug.cgi?id=142054
2780
2781         Reviewed by Ryosuke Niwa.
2782
2783         Rename DatabaseManager::manager() to DatabaseManager::singleton() as
2784         per coding style and use WTF::NeverDestroyed.
2785
2786         * Modules/webdatabase/DOMWindowWebDatabase.cpp:
2787         (WebCore::DOMWindowWebDatabase::openDatabase):
2788         * Modules/webdatabase/DatabaseBackendBase.cpp:
2789         (WebCore::DatabaseBackendBase::DatabaseBackendBase):
2790         * Modules/webdatabase/DatabaseContext.cpp:
2791         (WebCore::DatabaseContext::DatabaseContext):
2792         (WebCore::DatabaseContext::~DatabaseContext):
2793         (WebCore::DatabaseContext::stopDatabases):
2794         (WebCore::DatabaseContext::databaseExceededQuota):
2795         * Modules/webdatabase/DatabaseManager.cpp:
2796         (WebCore::DatabaseManager::singleton):
2797         (WebCore::DatabaseManager::manager): Deleted.
2798         * Modules/webdatabase/DatabaseManager.h:
2799         (WebCore::DatabaseManager::~DatabaseManager): Deleted.
2800         * Modules/webdatabase/SQLTransactionClient.cpp:
2801         (WebCore::SQLTransactionClient::didExceedQuota):
2802         * history/PageCache.cpp:
2803         (WebCore::logCanCacheFrameDecision):
2804         (WebCore::PageCache::canCachePageContainingThisFrame):
2805         * loader/FrameLoader.cpp:
2806         (WebCore::FrameLoader::stopLoading):
2807
2808 2015-02-26  Csaba Osztrogonác  <ossy@webkit.org>
2809
2810         Fix the !ENABLE(GEOLOCATION) build after r180533
2811         https://bugs.webkit.org/show_bug.cgi?id=142053
2812
2813         Reviewed by Chris Dumez.
2814
2815         * Modules/geolocation/GeoNotifier.cpp:
2816         * Modules/geolocation/GeoNotifier.h:
2817
2818 2015-02-26  Dean Jackson  <dino@apple.com>
2819
2820         [iOS Media] incorrect front padding on time values
2821         https://bugs.webkit.org/show_bug.cgi?id=142027
2822         <rdar://problem/19960790>
2823
2824         Reviewed by Brent Fulgham.
2825
2826         My last commit was updating the OS X file,
2827         not the iOS file.
2828
2829         We don't want to prefix times with a "0".
2830
2831         * Modules/mediacontrols/mediaControlsApple.js:
2832         (Controller.prototype.formatTime):
2833         * Modules/mediacontrols/mediaControlsiOS.js:
2834         (ControllerIOS.prototype.formatTime):
2835
2836 2015-02-26  Mark Lam  <mark.lam@apple.com>
2837
2838         Rolling out r180602, r180608, r180613, r180617, r180671.
2839         <https://webkit.org/b/141990>
2840
2841         Not reviewed.
2842
2843         The r180602 solution does result in more work for GC when worker
2844         threads are in use.  Filip is uncomfortable with that.
2845         The EFL and GTK ports also seem to be unhappy with this change.
2846         Rolling out while we investigate.
2847
2848         * bindings/js/JSDOMWindowBase.cpp:
2849         (WebCore::JSDOMWindowBase::commonVM):
2850
2851 2015-02-26  Myles C. Maxfield  <mmaxfield@apple.com>
2852
2853         [Mac] [iOS] Parsing support for -apple-trailing-word
2854         https://bugs.webkit.org/show_bug.cgi?id=141939
2855
2856         Reviewed by Andreas Kling.
2857
2858         This patch implements initial parsing support for the -apple-trailing-word CSS property.
2859         This property has two possible (mutually exclusive) values: auto and
2860         -apple-partially-balanced. This property is inherited.
2861
2862         The work for this property is behind the ENABLE(CSS_TRAILING_WORD) preprocessor define.
2863
2864         This is an internal property that will allow us to control line breaking behavior for
2865         short paragraphs.
2866
2867         Note that, because of the implementation of cssValueKeywordID() in CSSParser.cpp,
2868         the new value must be implemented as -webkit-partially-balanced. Using the -apple-
2869         prefix will work, but if you getComputedStyle(), it will return the -webkit- prefixed
2870         version.
2871
2872         Test: platform/mac/fast/text/trailing-word-parse.html
2873
2874         * Configurations/FeatureDefines.xcconfig:
2875         * css/CSSComputedStyleDeclaration.cpp:
2876         (WebCore::ComputedStyleExtractor::propertyValue): Turn internal representation into a
2877         CSS value.
2878         * css/CSSParser.cpp:
2879         (WebCore::isValidKeywordPropertyAndValue): Updated for new keyword property / value
2880         pair.
2881         (WebCore::isKeywordPropertyID): New property is a keyword property.
2882         (WebCore::CSSParser::parseValue): Use the keyword property codepath.
2883         * css/CSSPrimitiveValueMappings.h:
2884         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Convert to and from the internal
2885         representation and CSS values.
2886         (WebCore::CSSPrimitiveValue::operator TrailingWord):
2887         * css/CSSPropertyNames.in: New property.
2888         * css/CSSValueKeywords.in: New value.
2889         * rendering/SimpleLineLayout.cpp:
2890         (WebCore::SimpleLineLayout::canUseFor): Can't use SimpleLineLayout for this.
2891         * rendering/style/RenderStyle.h: Getter, setter and initial value.
2892         * rendering/style/RenderStyleConstants.h: Internal data type.
2893         * rendering/style/StyleRareInheritedData.h: One bit to control this style property.
2894         * rendering/style/StyleRareInheritedData.cpp: Update constructors and operators.
2895
2896 2015-02-26  Roger Fong  <roger_fong@apple.com>
2897
2898         Unreviewed. Fix a accidental deletion from r178674.
2899
2900         * html/canvas/WebGLRenderingContextBase.cpp:
2901         (WebCore::WebGLRenderingContextBase::create):
2902         Return the fake WebGL context.
2903
2904 2015-02-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
2905
2906         Cleanup RenderSVGResourceClipper class.
2907         https://bugs.webkit.org/show_bug.cgi?id=142032.
2908
2909         Reviewed by Darin Adler.
2910         
2911         This is a follow up for r180643: <http://trac.webkit.org/changeset/180643>.
2912         It includes cleanup for RenderSVGResourceClipper class.
2913
2914         * rendering/svg/RenderSVGResourceClipper.cpp:
2915         (WebCore::RenderSVGResourceClipper::applyClippingToContext):
2916         (WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage):
2917         * rendering/svg/RenderSVGResourceClipper.h: Change ClipperData to be a
2918         typedef instead of a class and rename it to ClipperMaskImage. The purpose
2919         of having it a class even though it includes only one member was because
2920         we wanted it to be WTF_MAKE_FAST_ALLOCATED. We do not need to allocate it
2921         as a separate object on the heap anymore.
2922         
2923         (WebCore::RenderSVGResourceClipper::addRendererToClipper): Instead of doing
2924         double hash table lookups by calling HashMap::contains() and then HashMap::get(),
2925         we can use HashMap::add() instead.
2926
2927 2015-02-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
2928
2929         Setting any of the <object> element plugin controlling attributes does not have any affect.
2930         https://bugs.webkit.org/show_bug.cgi?id=141936.
2931
2932         Reviewed by Zalan Bujtas.
2933
2934         When setting any of the <object> element plugin controlling attributes
2935         dynamically we need to mark the the element to be dirty by calling
2936         setNeedsStyleRecalc(), so it has to recreate its renderer when needed.
2937         
2938         Test: svg/as-object/svg-in-object-dynamic-attribute-change.html
2939
2940         * dom/Element.h: Delete unimplemented function.
2941         
2942         * html/HTMLObjectElement.cpp:
2943         (WebCore::HTMLObjectElement::parseAttribute): Dirty the element by calling
2944         setNeedsStyleRecalc() when one of the plugin controlling attributes gets
2945         changed. We have to clear the m_useFallbackContent because the attribute's
2946         new value might fix the object rendering.
2947         
2948         * html/HTMLObjectElement.h: Add a function to clear m_useFallbackContent.
2949         
2950         * html/HTMLPlugInImageElement.cpp:
2951         (WebCore::HTMLPlugInImageElement::willRecalcStyle): We might need to 
2952         reconstruct the object renderer in the image case. This can happen if the
2953         image was rendering fallback content and the attribute's new value fixes
2954         the object rendering.
2955
2956 2015-02-26  Brent Fulgham  <bfulgham@apple.com>
2957
2958         [Win] Make build logs more legible by reducing noise
2959         https://bugs.webkit.org/show_bug.cgi?id=142034
2960
2961         Reviewed by Alexey Proskuryakov.
2962
2963         Modify batch files, makefiles, and DOS commands to remove
2964         uninteresting/unhelpful output.
2965
2966         * WebCore.vcxproj/WebCoreGenerated.make:
2967         * WebCore.vcxproj/WebCorePreBuild.cmd:
2968         * WebCore.vcxproj/copyForwardingHeaders.cmd:
2969         * WebCore.vcxproj/copyWebCoreResourceFiles.cmd:
2970
2971 2015-02-26  Michael Catanzaro  <mcatanzaro@igalia.com>
2972
2973         [FreeType] REGRESSION(r180563): Introduced crashes
2974         https://bugs.webkit.org/show_bug.cgi?id=142044
2975
2976         Reviewed by Martin Robinson.
2977
2978         No new tests, should be caught by any woff font test.
2979
2980         Use optionsPattern, not m_pattern, when m_pattern may be null.
2981
2982         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
2983         (WebCore::FontPlatformData::initializeWithFontFace):
2984
2985 2015-02-26  Sergio Villar Senin  <svillar@igalia.com>
2986
2987         ASSERTION FAILED: !length.isUndefined() in WebCore::GridLength::GridLength
2988         https://bugs.webkit.org/show_bug.cgi?id=141645
2989
2990         Reviewed by Chris Dumez.
2991
2992         This bug has been here since r110484 but was uncovered by
2993         r180140. The problem r110484 was trying to fix was that
2994         CSSPrimitiveValue::convertToLength<Length> ended up calling
2995         CSSPrimitiveValue::computeLengthDouble() which was apparently
2996         dereferencing conversionData.style() and
2997         conversionData.rootStyle() pointers without checking them. That's
2998         why that fix added this condition to convertToLength():
2999
3000         isFontRelativeLength() && (!conversionData.style() || !conversionData.rootStyle())
3001
3002         which is not correct, because for the 4 possible font relative
3003         length types, 3 of them just use the style() pointer and the other
3004         one just uses rootStyle() which BTW could be NULL. This erroneous
3005         condition makes that function to return Length(Undefined) more
3006         often than it should.
3007
3008         From now on it only returns Length(Undefined) if the style()
3009         pointer is NULL and the font relative length type is one in the
3010         set (CSS_EMS, CSS_EXS, CSS_CHS);
3011
3012         Test: fast/css-grid-layout/grid-with-relative-font-length-crash.html
3013
3014         * css/CSSPrimitiveValue.h:
3015         * css/CSSPrimitiveValueMappings.h:
3016         (WebCore::CSSPrimitiveValue::convertingToLengthRequiresNonNullStyle):
3017         (WebCore::CSSPrimitiveValue::convertToLength):
3018
3019
3020 2015-02-26  Andreas Kling  <akling@apple.com>
3021
3022         [Cocoa] Prod libcache to drop caches in memory pressure relief handler.
3023         <https://webkit.org/b/142024>
3024         <rdar://problem/19966096>
3025
3026         Reviewed by Antti Koivisto.
3027
3028         libcache already listens to the OS memory pressure notifications, but we still
3029         need to manually request a cleanup when doing an iOS process suspension, or when
3030         simulating memory pressure.
3031
3032         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
3033         (WebCore::MemoryPressureHandler::platformReleaseMemory): Call out to libcache's
3034         cache_simulate_memory_warning_event() to make sure that nonessential objects
3035         being kept alive by NSCaches get dropped when we need the memory.
3036
3037 2015-02-25  Zalan Bujtas  <zalan@apple.com>
3038
3039         Black line across screen on Adobe Illustrator detail page (non-retina only)
3040         https://bugs.webkit.org/show_bug.cgi?id=141866
3041
3042         Reviewed by Simon Fraser.
3043
3044         Phase is relative to the destination origin. We need to take location information into account
3045         while snapping so that the result is inline with the snapped destination rect.
3046         (location affects the snapped size.)
3047
3048         Test: fast/backgrounds/gradient-background-on-subpixel-position.html
3049
3050         * rendering/RenderBoxModelObject.cpp:
3051         (WebCore::pixelSnapBackgroundImageGeometryForPainting):
3052         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
3053
3054 2015-02-25  Brent Fulgham  <bfulgham@apple.com>
3055
3056         [Win] Use WEBCORE_EXPORT instead of Definition file
3057         https://bugs.webkit.org/show_bug.cgi?id=141734
3058
3059         Reviewed by Alex Christensen.
3060
3061         No change in functionality.
3062
3063         * WebCore.vcxproj/WebCore.vcxproj: Correct bad Precompiled header
3064         settings on certain files.
3065         * WebCore.vcxproj/WebCore.vcxproj.filters: Automatically updated
3066         by Visual Studio.
3067         * WebCore.vcxproj/WebCoreTestSupport.vcxproj: Ditto.
3068         * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters: Ditto.
3069         * WebCore.vcxproj/WebCoreTestSupportCommon.props: Added.
3070         * WebCore.vcxproj/WebCoreTestSupportDebug.props: Added.
3071         * WebCore.vcxproj/WebCoreTestSupportDebugWinCairo.props: Added.
3072         * WebCore.vcxproj/WebCoreTestSupportProduction.props: Added.
3073         * WebCore.vcxproj/WebCoreTestSupportRelease.props: Added.
3074         * WebCore.vcxproj/WebCoreTestSupportReleaseWinCairo.props: Added.
3075         * WebCorePrefix.h: Provide proper export definitions for Windows.
3076         * bindings/js/JSCustomXPathNSResolver.cpp: Add missing #include
3077         needed by the new export style.
3078         * bindings/js/JSDOMWindowBase.h: Export class since DRT needs
3079         access to parts of it.
3080         * bindings/js/ScriptCachedFrameData.cpp: Add missing #include
3081         needed by the new export style.
3082         * bindings/scripts/CodeGeneratorJS.pm: Use different export macro
3083         when generating WebCoreTestSupport files, so that we don't confuse
3084         the linker when WebCore.lib and WebCoreTestSupport.lib try to
3085         both export WEBCORE_EXPORT symbols.
3086         (ExportLabelForClass):
3087         (GenerateHeader):
3088         * bridge/jsc/BridgeJSC.cpp: Add missing #include needed by the new
3089         export style.
3090         * css/CSSParser.cpp: Ditto.
3091         * dom/Document.cpp: Ditto.
3092         * html/HTMLImageLoader.cpp: Ditto.
3093         * inspector/CommandLineAPIModule.cpp: Ditto.
3094         * inspector/PageDebuggerAgent.cpp: Ditto.
3095         * inspector/PageRuntimeAgent.cpp: Ditto.
3096         * inspector/WorkerRuntimeAgent.cpp: Ditto.
3097         * page/DOMWindow.cpp: Ditto.
3098         * page/DOMWindow.h: Export the destructor, as it is needed by
3099         DumpRenderTree (on Windows).
3100         * page/Page.cpp: Add missing #include needed by the new export style.
3101         * platform/Logging.h: Remove conflicting export declaration.
3102         * platform/PlatformExportMacros.h: Update for Windows use.
3103         * testing/Internals.cpp: Add missing #include needed by the new export style.
3104         * testing/Internals.h: Use WEBCORE_TESTSUPPORT_EXPORT for things that
3105         are supposed to be exported by WebCoreTestSupport, not WebCore.
3106         * testing/js/WebCoreTestSupport.cpp: Add missing #include needed by
3107         new export style.
3108         * testing/js/WebCoreTestSupportPrefix.cpp: Added.
3109         * testing/js/WebCoreTestSupportPrefix.h: Added.
3110         * xml/XMLHttpRequest.h: Export the destructor.
3111         * xml/XSLStyleSheetLibxslt.cpp: Add missing #include needed by the new
3112         export style.
3113         * xml/XSLTProcessorLibxslt.cpp: Ditto.
3114
3115 2015-02-25  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3116
3117         Remove unnecessary DatabaseFooTask::create
3118         https://bugs.webkit.org/show_bug.cgi?id=142002
3119
3120         Reviewed by Darin Adler.
3121
3122         DatabaseFooTask::create can be replaced with std::make_unique<>.
3123
3124         No new tests, no behavior changes.
3125
3126         * Modules/webdatabase/Database.cpp:
3127         (WebCore::Database::scheduleTransaction):
3128         (WebCore::Database::scheduleTransactionStep):
3129         (WebCore::Database::markAsDeletedAndClose):
3130         (WebCore::Database::closeImmediately):
3131         (WebCore::Database::tableNames):
3132         * Modules/webdatabase/DatabaseTask.h:
3133         (WebCore::DatabaseBackend::DatabaseCloseTask::create): Deleted.
3134         (WebCore::DatabaseBackend::DatabaseTransactionTask::create): Deleted.
3135         (WebCore::DatabaseBackend::DatabaseTableNamesTask::create): Deleted.
3136
3137 2015-02-25  Dean Jackson  <dino@apple.com>
3138
3139         [iOS Media] incorrect front padding on time values
3140         https://bugs.webkit.org/show_bug.cgi?id=142027
3141         <rdar://problem/19960790>
3142
3143         Reviewed by Brent Fulgham.
3144
3145         We don't want to prefix times with a "0".
3146
3147         * Modules/mediacontrols/mediaControlsApple.js:
3148         (Controller.prototype.formatTime):
3149
3150 2015-02-25  Chris Dumez  <cdumez@apple.com>
3151
3152         Make PublicURLManager suspendable
3153         https://bugs.webkit.org/show_bug.cgi?id=141977
3154         <rdar://problem/19923085>
3155
3156         Reviewed by Andreas Kling.
3157
3158         Make PublicURLManager suspendable by overriding ActiveDOMObject::canSuspend()
3159         and returning true. Nothing prevents suspending the PublicURLManager as its
3160         implementation never causes JS to be executed. No implementation for
3161         suspend() / resume() needs to be provided for the same reason.
3162
3163         The fact that PublicURLManager wasn't suspendable was preventing pages using
3164         URL.createObjectURL() from entering the PageCache. Baidu.com search results
3165         pages are using the API for example.
3166
3167         Test: fast/history/page-cache-createObjectURL.html
3168
3169         * html/PublicURLManager.cpp:
3170         (WebCore::PublicURLManager::canSuspend):
3171         * html/PublicURLManager.h:
3172
3173 2015-02-25  Zalan Bujtas  <zalan@apple.com>
3174
3175         Cleanup BackgroundImageGeometry class.
3176         https://bugs.webkit.org/show_bug.cgi?id=141997
3177
3178         Reviewed by Simon Fraser.
3179
3180         This patch attempts to improve RenderBoxModelObject::calculateBackgroundImageGeometry() readability by
3181         removing redundant code and making image geometry operations explicit. BackgroundImageGeometry
3182         becomes a read only class (with the exception of the clip() method).
3183
3184         No change in functionality.
3185
3186         * rendering/RenderBoxModelObject.cpp:
3187         (WebCore::BackgroundImageGeometry::BackgroundImageGeometry):
3188         (WebCore::BackgroundImageGeometry::pixelSnapBackgroundImageGeometryForPainting):
3189         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
3190         (WebCore::BackgroundImageGeometry::setNoRepeatX): Deleted.
3191         (WebCore::BackgroundImageGeometry::setNoRepeatY): Deleted.
3192         (WebCore::BackgroundImageGeometry::useFixedAttachment): Deleted.
3193         (WebCore::BackgroundImageGeometry::clip): Deleted.
3194         (WebCore::RenderBoxModelObject::pixelSnapBackgroundImageGeometryForPainting): Deleted.
3195         * rendering/RenderBoxModelObject.h:
3196         (WebCore::BackgroundImageGeometry::clip):
3197         (WebCore::BackgroundImageGeometry::BackgroundImageGeometry): Deleted.
3198         (WebCore::BackgroundImageGeometry::setDestRect): Deleted.
3199         (WebCore::BackgroundImageGeometry::setPhase): Deleted.
3200         (WebCore::BackgroundImageGeometry::setPhaseX): Deleted.
3201         (WebCore::BackgroundImageGeometry::setPhaseY): Deleted.
3202         (WebCore::BackgroundImageGeometry::setTileSize): Deleted.
3203         (WebCore::BackgroundImageGeometry::setSpaceSize): Deleted.
3204         (WebCore::BackgroundImageGeometry::setHasNonLocalGeometry): Deleted.
3205
3206 2015-02-25  Said Abou-Hallawa  <sabouhallawa@apple.com>
3207
3208         Horizontal and vertical lines are clipped completely if clip-path is included in the tag but the referenced element is defined later.
3209         https://bugs.webkit.org/show_bug.cgi?id=141776.
3210
3211         Reviewed by Dean Jackson.
3212
3213         Tests: svg/clip-path/clip-path-line-use-before-defined-expected.svg
3214                svg/clip-path/clip-path-line-use-before-defined.svg
3215
3216         * rendering/svg/RenderSVGResourceClipper.cpp:
3217         (WebCore::RenderSVGResourceClipper::applyClippingToContext): Ensure the renderer
3218         is added to m_clipper if it does not exist. The same renderer might have been 
3219         added to m_clipper in resourceBoundingBox().
3220         
3221         (WebCore::RenderSVGResourceClipper::addRendererToClipper): Add the renderer to
3222         m_clipper if it does not exist. Return the associated ClipperData.
3223         
3224         (WebCore::RenderSVGResourceClipper::resourceBoundingBox): If the clipper is
3225         referenced before it is defined, add the renderer to m_clipper. While doing the
3226         layout() for the clipper, we can check if m_clipper has values or not. If it does
3227         have, we are going to mark the clipper for client invalidation which is done by
3228         the SVG root.
3229         
3230         * rendering/svg/RenderSVGResourceClipper.h:
3231         * rendering/svg/RenderSVGResourceContainer.h:
3232         (WebCore::RenderSVGResourceContainer::selfNeedsClientInvalidation): Define a 
3233         new function selfNeedsClientInvalidation() which controls marking the clipper 
3234         for client invalidation. In RenderSVGResourceClipper, override it so it checks
3235         m_clipper to force clients validation even if it the first time we do layout
3236         for this clipper.
3237
3238         * rendering/svg/RenderSVGResourceContainer.cpp:
3239         (WebCore::RenderSVGResourceContainer::layout): Call the virtual function
3240         selfNeedsClientInvalidation() to check whether we need to mark the clipper for
3241         client invalidation.
3242         
3243         * svg/SVGElement.cpp: Delete unneeded header file.
3244
3245 2015-02-25  peavo@outlook.com  <peavo@outlook.com>
3246
3247         [WinCairo] WinLauncher is not starting on Vista.
3248         https://bugs.webkit.org/show_bug.cgi?id=141905
3249
3250         Reviewed by Alex Christensen.
3251
3252         We have to soft link with Media Foundation functions to be able
3253         to start on Vista and WinXP.
3254
3255         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
3256         (WebCore::MediaPlayerPrivateMediaFoundation::createSession):
3257         (WebCore::MediaPlayerPrivateMediaFoundation::endSession):
3258         (WebCore::MediaPlayerPrivateMediaFoundation::startCreateMediaSource):
3259         (WebCore::MediaPlayerPrivateMediaFoundation::endGetEvent):
3260         (WebCore::MediaPlayerPrivateMediaFoundation::createTopologyFromSource):
3261         (WebCore::MediaPlayerPrivateMediaFoundation::createOutputNode):
3262         (WebCore::MediaPlayerPrivateMediaFoundation::createSourceStreamNode):
3263         (WebCore::MediaPlayerPrivateMediaFoundation::onTopologySet):
3264
3265 2015-02-25  Beth Dakin  <bdakin@apple.com>
3266
3267         REGRESSION (r180018 ): Holding a rubber-band in place can get stuck
3268         https://bugs.webkit.org/show_bug.cgi?id=142020
3269         -and corresponding-
3270         rdar://problem/19945216
3271
3272         Reviewed by Tom Horton.
3273
3274         It was a mistaken assumption that it was necessary to return false in the zero-
3275         delta case. That is clearly conceptually wrong since false represents the DOM 
3276         doing something special with the event, which is clearly not the case if we never 
3277         even send the event to the DOM. Returning true will allow the rest of the 
3278         scrolling machinery the ability to handle the event.
3279         * dom/Element.cpp:
3280         (WebCore::Element::dispatchWheelEvent):
3281
3282 2015-02-25  Ryosuke Niwa  <rniwa@webkit.org>
3283
3284         HTMLElement::collectStyleForPresentationAttribute duplicates a lot of code for contentEditableAttr
3285         https://bugs.webkit.org/show_bug.cgi?id=142003
3286
3287         Reviewed by Sam Weinig.
3288
3289         Utilized contentEditableType to reduce the code duplication.
3290
3291         * html/HTMLElement.cpp:
3292         (WebCore::contentEditableType): Moved and added a version that takes AtomicString.
3293         (WebCore::HTMLElement::collectStyleForPresentationAttribute):
3294
3295 2015-02-25  Sergio Villar Senin  <svillar@igalia.com>
3296
3297         [CSS Grid Layout] Tracks growing beyond limits when they should not
3298         https://bugs.webkit.org/show_bug.cgi?id=140883
3299
3300         Reviewed by Darin Adler.
3301
3302         Our track sizing algorithm implementation incorrectly grew some
3303         tracks beyond limits when handling min-content and max-content
3304         base sizes. In those cases we should only grow "any affected track
3305         that happens to also have an intrinsic max track sizing function"
3306         or all of them if there are none.
3307
3308         The problem was that we're using a vector of indexes pointing to
3309         the vector with the list of affected tracks. Those indexes become
3310         easily incorrect because the first thing we do in
3311         distributeSpaceToTracks() is to sort the vector with the affected
3312         tracks by growth potential.
3313
3314         Instead of that we now pass a vector with pointers to the list of
3315         tracks allowed to grow over the limits. The size changes are now
3316         directly stored in the GridTracks (it's called plannedSize)
3317         instead of in a separate vector, so we don't need to worry about
3318         tracks being rearranged (and we also get rid of the ugly vector of
3319         indexes pointing to another vector).
3320
3321         * rendering/RenderGrid.cpp:
3322         (WebCore::GridTrack::plannedSize): New member with getter/setter.
3323         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
3324         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
3325         Pass a setXXX() function instead of a growXXX() one to ForItems().
3326         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
3327         Renamed additionalBreadthSpace to extraSpace which is the term
3328         used by specs.
3329         (WebCore::RenderGrid::distributeSpaceToTracks): Use GridTrack's
3330         plannedSize instead of the old distribution vector.
3331         (WebCore::GridTrack::growBaseSize): Deleted.
3332         (WebCore::GridTrack::growGrowthLimit): Deleted.
3333         * rendering/RenderGrid.h:
3334
3335 2015-02-25  Joanmarie Diggs  <jdiggs@igalia.com>
3336
3337         AX: Implement support for ARIA 1.1 'searchbox' role
3338         https://bugs.webkit.org/show_bug.cgi?id=142004
3339
3340         Reviewed by Chris Fleizach.
3341
3342         Add a new accessible SearchFieldRole to handle both the ARIA role
3343         and the "search" input type.
3344
3345         No new tests. Instead, added a new test case to roles-exposed.html
3346         for the mapping, and updated roles-computedRoleString.html because
3347         there is now a one-to-one mapping between the "search" input type
3348         and an ARIA role.
3349
3350         * accessibility/AccessibilityNodeObject.cpp:
3351         (WebCore::AccessibilityNodeObject::determineAccessibilityRole):
3352         (WebCore::AccessibilityNodeObject::isSearchField):
3353         * accessibility/AccessibilityObject.cpp:
3354         (WebCore::AccessibilityObject::isARIATextControl):
3355         (WebCore::AccessibilityObject::isARIAInput):
3356         (WebCore::initializeRoleMap):
3357         * accessibility/AccessibilityObject.h:
3358         * accessibility/AccessibilityRenderObject.cpp:
3359         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
3360         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
3361         (atkRole):
3362         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3363         (-[WebAccessibilityObjectWrapper accessibilityCanFuzzyHitTest]):
3364         (-[WebAccessibilityObjectWrapper accessibilityTraits]):
3365         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
3366         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3367         (createAccessibilityRoleMap):
3368
3369 2015-02-24  Simon Fraser  <simon.fraser@apple.com>
3370
3371         Clarify some resizing terminology in ScrollView/FrameView
3372         https://bugs.webkit.org/show_bug.cgi?id=141996
3373
3374         Reviewed by Zalan Bujtas.
3375
3376         ScrollableArea/ScrollView/FrameView had some confusing terminology around
3377         contentsResized/visibleContentsResized/fixedLayoutSizeChanged.
3378         
3379         Clarify this by distinguishing between:
3380         1. Available size changes because of
3381             i) non-overlay scrollbar presence
3382            ii) ScrollableArea frame change
3383         2. Removing fixedLayoutSizeChanged() and just treating it like an
3384            available size change.
3385            
3386         contentsResized() is relegated to simply being a hook that allows Mac to
3387         flash overlay scrollbars.
3388         
3389         The confusingly named visibleContentsResized() is now updateContentsSize(),
3390         and is the way that a ScrollableArea tells its subclasss that it should recompute
3391         the size of the contents (i.e. do a layout).
3392
3393         * page/FrameView.cpp:
3394         (WebCore::FrameView::setContentsSize): No longer mysteriously skip the
3395         FrameView implementation of contentsResized(), which used to do a setNeedsLayout()
3396         which we didn't want to do from setContentsSize(), which itself happens as a result of layout.
3397         (WebCore::FrameView::adjustViewSize): Whitespace.
3398         (WebCore::FrameView::layout): Ditto.
3399         (WebCore::FrameView::availableContentSizeChanged): Called on frame size change, or scrollbar
3400         change.
3401         (WebCore::FrameView::updateContentsSize): This actually does the layout.
3402         (WebCore::FrameView::scrollbarStyleChanged): Always call the base class;  ScrollView::scrollbarStyleChanged
3403         will bail if not a forced update.
3404         (WebCore::FrameView::setCustomFixedPositionLayoutRect): Forces a layout via updateContentsSize() now.
3405         (WebCore::FrameView::contentsResized): Deleted.
3406         (WebCore::FrameView::fixedLayoutSizeChanged): Deleted.
3407         (WebCore::FrameView::visibleContentsResized): Deleted.
3408         * page/FrameView.h:
3409         * platform/ScrollView.cpp:
3410         (WebCore::ScrollView::setFixedLayoutSize): Calls availableContentSizeChanged() now.
3411         (WebCore::ScrollView::setUseFixedLayout): Ditto.
3412         (WebCore::ScrollView::availableContentSizeChanged): Update scrollbars if that's not
3413         the reason we are being called.
3414         (WebCore::ScrollView::updateScrollbars): contentsResized() was the thing that caused setNeedsLayout();
3415         replace it with availableContentSizeChanged(). visibleContentsResized() did the layout, and
3416         replace with updateContentsSize().
3417         (WebCore::ScrollView::setFrameRect): Call availableContentSizeChanged() now. This takes care of
3418         updating scrollbars, so no need to explicitly do that.
3419         (WebCore::ScrollView::scrollbarStyleChanged): Call the base class.
3420         (WebCore::ScrollView::fixedLayoutSizeChanged): Deleted.
3421         * platform/ScrollView.h:
3422         * platform/ScrollableArea.cpp:
3423         (WebCore::ScrollableArea::availableContentSizeChanged): Call scrollAnimator->contentsResized()
3424         to flash the scrollbars.
3425         (WebCore::ScrollableArea::scrolledToRight):
3426         (WebCore::ScrollableArea::scrollbarStyleChanged): Call availableContentSizeChanged() since
3427         scrollbar style affects available space.
3428         * platform/ScrollableArea.h:
3429         (WebCore::ScrollableArea::updateContentsSize):
3430         (WebCore::ScrollableArea::scrollbarStyleChanged): Deleted.
3431
3432 2015-02-24  Ryosuke Niwa  <rniwa@webkit.org>
3433
3434         Unreviewed Mavericks build attempt fix after r180609.
3435
3436         * platform/graphics/mac/GraphicsContext3DMac.mm:
3437         (WebCore::GraphicsContext3D::GraphicsContext3D):
3438         (WebCore::GraphicsContext3D::checkGPUStatusIfNecessary):
3439
3440 2015-02-19  Roger Fong  <roger_fong@apple.com>
3441
3442         WebGL: Destroy the GLContext if a GPU restart has been detected.
3443         https://bugs.webkit.org/show_bug.cgi?id=141567.
3444         <rdar://problem/18507496>
3445
3446         Reviewed by Dean Jackson.
3447
3448         * html/canvas/WebGLRenderingContextBase.cpp:
3449         (WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
3450         * platform/graphics/GraphicsContext3D.h:
3451         (WebCore::GraphicsContext3D::setWebGLContext): 
3452         Keep track of which WebGLRenderingContext is associated with the current GraphicsContext3D.
3453         * platform/graphics/mac/GraphicsContext3DMac.mm:
3454         (WebCore::GraphicsContext3D::checkGPUStatusIfNecessary): Helper method to check GPU status.
3455         (WebCore::GraphicsContext3D::GraphicsContext3D): 
3456         Don’t immediately abort the GPU process when the restart status is kCGLCPGPURestartStatusBlacklisted.
3457         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
3458         (WebCore::GraphicsContext3D::forceContextLost): 
3459         Force the WebGLRenderingContext to be lost.
3460         (WebCore::GraphicsContext3D::drawArrays): Check GPU status after calling drawArrays.
3461         (WebCore::GraphicsContext3D::drawElements): Check GPU status after calling drawElements.
3462         * WebCore.xcodeproj/project.pbxproj: Add SPI header for iOS.
3463         * platform/spi/ios/OpenGLESSPI.h: Added.
3464
3465 2015-02-24  Stephanie Lewis  <slewis@apple.com>
3466
3467         Unreviewed ios build fix after http://trac.webkit.org/changeset/180602.
3468
3469         * bindings/js/JSDOMWindowBase.cpp:
3470         (WebCore::JSDOMWindowBase::commonVM):
3471
3472 2015-02-24  Simon Fraser  <simon.fraser@apple.com>
3473
3474         Use an enum for scrollbar style
3475         https://bugs.webkit.org/show_bug.cgi?id=141985
3476
3477         Reviewed by Beth Dakin.
3478
3479         Switch to an enum class for the scrollbar style (normal or overlay).
3480
3481         * page/ChromeClient.h:
3482         * page/FrameView.cpp:
3483         (WebCore::FrameView::scrollbarStyleChanged):
3484         * page/FrameView.h:
3485         * platform/ScrollTypes.h:
3486         * platform/ScrollView.cpp:
3487         (WebCore::ScrollView::scrollbarStyleChanged):
3488         * platform/ScrollView.h:
3489         * platform/ScrollableArea.h:
3490         (WebCore::ScrollableArea::scrollbarStyleChanged):
3491         * platform/mac/ScrollAnimatorMac.mm:
3492         (WebCore::ScrollAnimatorMac::updateScrollerStyle):
3493
3494 2015-02-24  Commit Queue  <commit-queue@webkit.org>
3495
3496         Unreviewed, rolling out r180599.
3497         https://bugs.webkit.org/show_bug.cgi?id=141998
3498
3499         Lots of new test failures (Requested by smfr on #webkit).
3500
3501         Reverted changeset:
3502
3503         "Parsing support for -webkit-trailing-word"
3504         https://bugs.webkit.org/show_bug.cgi?id=141939
3505         http://trac.webkit.org/changeset/180599
3506
3507 2015-02-24  Sam Weinig  <sam@webkit.org>
3508
3509         [Attachment] Give <attachment> elements an underlying File
3510         https://bugs.webkit.org/show_bug.cgi?id=141993
3511
3512         Reviewed by Tim Horton.
3513
3514         - Add a JS subclass for attachments so that <attachment>s are
3515           instances of HTMLAttachmentElement rather than HTMLElement.
3516         - Give HTMLAttachmentElements an underlying File that they
3517           are the representation of. Expose it via a new 'file' property.
3518         - Expose a new Internals function called window.internals.createFile(url)
3519           that allows creating File objects for testing.
3520
3521         * CMakeLists.txt:
3522         * DerivedSources.cpp:
3523         * DerivedSources.make:
3524         * WebCore.vcxproj/WebCore.vcxproj:
3525         * WebCore.vcxproj/WebCore.vcxproj.filters:
3526         * WebCore.xcodeproj/project.pbxproj:
3527         * fileapi/File.h:
3528         * html/HTMLAttachmentElement.cpp:
3529         (WebCore::HTMLAttachmentElement::~HTMLAttachmentElement):
3530         (WebCore::HTMLAttachmentElement::file):
3531         (WebCore::HTMLAttachmentElement::setFile):
3532         * html/HTMLAttachmentElement.h:
3533         * html/HTMLAttachmentElement.idl: Added.
3534         * html/HTMLTagNames.in:
3535         * testing/Internals.cpp:
3536         (WebCore::Internals::createFile):
3537         * testing/Internals.h:
3538         * testing/Internals.idl:
3539
3540 2015-02-24  Joanmarie Diggs  <jdiggs@igalia.com>
3541
3542         AX: Implement support for ARIA 1.1 'switch' role
3543         https://bugs.webkit.org/show_bug.cgi?id=141986
3544
3545         Reviewed by Chris Fleizach.
3546
3547         Map the role to ATK_ROLE_TOGGLE_BUTTON for Gtk and Efl; on the Mac, to
3548         AXCheckBox with a subrole of AXSwitch. Ensure it looks and acts like a
3549         widget to accessibility APIs (supports and emits notifications when
3550         toggled, doesn't have children, exposes a name and description when
3551         provided).
3552
3553         Tests: accessibility/aria-switch-checked.html
3554                accessibility/aria-switch-sends-notification.html
3555                accessibility/aria-switch-text.html
3556
3557         * accessibility/AccessibilityNodeObject.cpp:
3558         (WebCore::AccessibilityNodeObject::canHaveChildren):
3559         (WebCore::AccessibilityNodeObject::isChecked):
3560         (WebCore::AccessibilityNodeObject::visibleText):
3561         (WebCore::AccessibilityNodeObject::title):
3562         * accessibility/AccessibilityObject.cpp:
3563         (WebCore::AccessibilityObject::isARIAInput):
3564         (WebCore::AccessibilityObject::actionVerb):
3565         (WebCore::initializeRoleMap):
3566         (WebCore::AccessibilityObject::supportsChecked):
3567         (WebCore::AccessibilityObject::checkboxOrRadioValue):
3568         * accessibility/AccessibilityObject.h:
3569         (WebCore::AccessibilityObject::isSwitch):
3570         * accessibility/atk/AXObjectCacheAtk.cpp:
3571         (WebCore::AXObjectCache::postPlatformNotification):
3572         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
3573         (atkRole):
3574         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3575         (-[WebAccessibilityObjectWrapper accessibilityCanFuzzyHitTest]):
3576         (-[WebAccessibilityObjectWrapper accessibilityTraits]):
3577         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
3578         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3579         (createAccessibilityRoleMap):
3580         (-[WebAccessibilityObjectWrapper subrole]):
3581         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
3582
3583 2015-02-24  Myles C. Maxfield  <mmaxfield@apple.com>
3584
3585         [Mac] [iOS] Parsing support for -apple-trailing-word
3586         https://bugs.webkit.org/show_bug.cgi?id=141939
3587
3588         Reviewed by Andreas Kling.
3589
3590         This patch implements initial parsing support for the -apple-trailing-word CSS property.
3591         This property has two possible (mutually exclusive) values: auto and
3592         -apple-partially-balanced. This property is inherited.
3593
3594         The work for this property is behind the ENABLE(CSS_TRAILING_WORD) preprocessor define.
3595
3596         This is an internal property that will allow us to control line breaking behavior for
3597         short paragraphs.
3598
3599         Note that, because of the implementation of cssValueKeywordID() in CSSParser.cpp,
3600         the new value must be implemented as -webkit-partially-balanced. Using the -apple-
3601         prefix will work, but if you getComputedStyle(), it will return the -webkit- prefixed
3602         version.
3603
3604         Test: platform/mac/fast/text/trailing-word-parse.html
3605
3606         * Configurations/FeatureDefines.xcconfig:
3607         * css/CSSComputedStyleDeclaration.cpp:
3608         (WebCore::ComputedStyleExtractor::propertyValue): Turn internal representation into a
3609         CSS value.
3610         * css/CSSParser.cpp:
3611         (WebCore::isValidKeywordPropertyAndValue): Updated for new keyword property / value
3612         pair.
3613         (WebCore::isKeywordPropertyID): New property is a keyword property.
3614         (WebCore::CSSParser::parseValue): Use the keyword property codepath.
3615         * css/CSSPrimitiveValueMappings.h:
3616         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Convert to and from the internal
3617         representation and CSS values.
3618         (WebCore::CSSPrimitiveValue::operator TrailingWord):
3619         * css/CSSPropertyNames.in: New property.
3620         * css/CSSValueKeywords.in: New value.
3621         * rendering/SimpleLineLayout.cpp:
3622         (WebCore::SimpleLineLayout::canUseFor): Can't use SimpleLineLayout for this.
3623         * rendering/style/RenderStyle.h: Getter, setter and initial value.
3624         * rendering/style/RenderStyleConstants.h: Internal data type.
3625         * rendering/style/StyleRareInheritedData.h: One bit to control this style property.
3626
3627 2015-02-24  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3628
3629         Remove DecodingTask::create and DatabaseOpenTask::create
3630         https://bugs.webkit.org/show_bug.cgi?id=141966
3631
3632         Reviewed by Anders Carlsson.
3633
3634         These create() factory functions are redundant. We can use std::make_unique<> directly.
3635
3636         No new tests, no behavior changes.
3637
3638         * Modules/webaudio/AsyncAudioDecoder.cpp:
3639         (WebCore::AsyncAudioDecoder::decodeAsync):
3640         (WebCore::AsyncAudioDecoder::DecodingTask::create): Deleted.
3641         * Modules/webaudio/AsyncAudioDecoder.h:
3642         * Modules/webdatabase/Database.cpp:
3643         (WebCore::Database::openAndVerifyVersion):
3644         * Modules/webdatabase/DatabaseTask.h:
3645         (WebCore::DatabaseBackend::DatabaseOpenTask::create): Deleted.
3646
3647 2015-02-24  Commit Queue  <commit-queue@webkit.org>
3648
3649         Unreviewed, rolling out r180578.
3650         https://bugs.webkit.org/show_bug.cgi?id=141992
3651
3652         Broke scrolling in Inspector Console. (Requested by JoePeck on
3653         #webkit).
3654
3655         Reverted changeset:
3656
3657         "[Mac] WebKit abandons overlay scrollbar CALayers."
3658         https://bugs.webkit.org/show_bug.cgi?id=141943
3659         http://trac.webkit.org/changeset/180578
3660
3661 2015-02-24  Dean Jackson  <dino@apple.com>
3662
3663         [ios Media] the inline controls are visible after pressing Done on iPhone
3664         https://bugs.webkit.org/show_bug.cgi?id=141987
3665         <rdar://problem/19944110>
3666
3667         Reviewed by Beth Dakin.
3668
3669         When exiting out of a playing video, we should show the
3670         start playback button if we don't allow inline media
3671         (such as on iPhone).
3672
3673         * Modules/mediacontrols/mediaControlsiOS.js:
3674         (ControllerIOS.prototype.shouldHaveStartPlaybackButton): Test for
3675         allowsInline as well.
3676
3677 2015-02-24  Zalan Bujtas  <zalan@apple.com>
3678
3679         Pass FillLayer reference instead of pointer to RenderBoxModelObject::calculateBackgroundImageGeometry.
3680         https://bugs.webkit.org/show_bug.cgi?id=141982
3681
3682         Reviewed by Simon Fraser.
3683
3684         There should always be a valid FillLayer.
3685
3686         No change in functionality.
3687
3688         * rendering/RenderBox.cpp:
3689         (WebCore::RenderBox::getBackgroundPaintedExtent):
3690         (WebCore::RenderBox::maskClipRect):
3691         (WebCore::RenderBox::repaintLayerRectsForImage):
3692         * rendering/RenderBoxModelObject.cpp:
3693         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
3694         (WebCore::RenderBoxModelObject::calculateFillTileSize):
3695         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
3696         (WebCore::RenderBoxModelObject::getGeometryForBackgroundImage):
3697         * rendering/RenderBoxModelObject.h:
3698
3699 2015-02-24  Dean Jackson  <dino@apple.com>
3700
3701         [iOS Media] Be specific about which document to use for the timeline background canvas
3702         https://bugs.webkit.org/show_bug.cgi?id=141981
3703
3704         Reviewed by Eric Carlson.
3705
3706         In some cases, especially with nested iframes, the document
3707         reference for the shadow DOM might not be the one used
3708         to create a -webkit-canvas context for rendering via CSS.
3709         Explicitly get the context from the video's owner
3710         document.
3711
3712         There is still a bug here:
3713         https://bugs.webkit.org/show_bug.cgi?id=141983
3714
3715         * Modules/mediacontrols/mediaControlsiOS.js:
3716         (ControllerIOS.prototype.drawTimelineBackground):
3717
3718 2015-02-24  Zalan Bujtas  <zalan@apple.com>
3719
3720         Remove unused BackgroundImageGeometry::m_destOrigin
3721         https://bugs.webkit.org/show_bug.cgi?id=141980
3722
3723         Reviewed by Simon Fraser.
3724
3725         Remove BackgroundImageGeometry::m_destOrigin and its dependencies.
3726         They are not used at all.
3727
3728         No change in functionality.
3729
3730         * rendering/RenderBoxModelObject.cpp:
3731         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
3732         (WebCore::RenderBoxModelObject::pixelSnapBackgroundImageGeometryForPainting):
3733         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
3734         (WebCore::BackgroundImageGeometry::relativePhase): Deleted.
3735         * rendering/RenderBoxModelObject.h:
3736         (WebCore::BackgroundImageGeometry::destOrigin): Deleted.
3737         (WebCore::BackgroundImageGeometry::setDestOrigin): Deleted.
3738         * rendering/svg/RenderSVGResourceMasker.cpp:
3739         (WebCore::RenderSVGResourceMasker::drawMaskForRenderer):
3740
3741 2015-02-24  Zalan Bujtas  <zalan@apple.com>
3742
3743         RenderBoxModelObject::calculateBackgroundImageGeometry should return BackgroundImageGeometry.
3744         https://bugs.webkit.org/show_bug.cgi?id=141979
3745
3746         Reviewed by Simon Fraser.
3747
3748         No change in functionality.
3749
3750         * rendering/RenderBox.cpp:
3751         (WebCore::RenderBox::getBackgroundPaintedExtent):
3752         (WebCore::RenderBox::maskClipRect):
3753         (WebCore::RenderBox::repaintLayerRectsForImage):
3754         * rendering/RenderBoxModelObject.cpp:
3755         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
3756         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
3757         (WebCore::RenderBoxModelObject::getGeometryForBackgroundImage):
3758         * rendering/RenderBoxModelObject.h:
3759
3760 2015-02-24  Zalan Bujtas  <zalan@apple.com>
3761
3762         Switch BackgroundImageGeometry's m_phase from LayoutPoint to LayoutSize.
3763         https://bugs.webkit.org/show_bug.cgi?id=141972
3764
3765         Reviewed by Simon Fraser.
3766
3767         Image geometry's phase represents distance.
3768
3769         No change in functionality.
3770
3771         * WebCore.order:
3772         * platform/graphics/GraphicsLayer.h:
3773         (WebCore::GraphicsLayer::setContentsTilePhase):
3774         (WebCore::GraphicsLayer::contentsTilePhase):
3775         * platform/graphics/texmap/TextureMapperLayer.cpp:
3776         (WebCore::TextureMapperLayer::computePatternTransformIfNeeded):
3777         (WebCore::TextureMapperLayer::setContentsTilePhase):
3778         * platform/graphics/texmap/TextureMapperLayer.h:
3779         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3780         (WebCore::CoordinatedGraphicsLayer::setContentsTilePhase):
3781         * rendering/RenderBoxModelObject.cpp:
3782         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
3783         (WebCore::BackgroundImageGeometry::setNoRepeatX):
3784         (WebCore::BackgroundImageGeometry::setNoRepeatY):
3785         (WebCore::BackgroundImageGeometry::useFixedAttachment):
3786         (WebCore::BackgroundImageGeometry::relativePhase):
3787         (WebCore::RenderBoxModelObject::pixelSnapBackgroundImageGeometryForPainting):
3788         (WebCore::RenderBoxModelObject::getGeometryForBackgroundImage):
3789         * rendering/RenderBoxModelObject.h:
3790         (WebCore::BackgroundImageGeometry::phase):
3791         (WebCore::BackgroundImageGeometry::setPhase):
3792         (WebCore::BackgroundImageGeometry::setPhaseX):
3793         (WebCore::BackgroundImageGeometry::setPhaseY):
3794         * rendering/RenderLayerBacking.cpp:
3795         (WebCore::RenderLayerBacking::resetContentsRect):
3796         (WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundImage):
3797         * rendering/svg/RenderSVGResourceMasker.cpp:
3798         (WebCore::RenderSVGResourceMasker::drawMaskForRenderer):
3799
3800 2015-02-24  Andreas Kling  <akling@apple.com>
3801
3802         [Mac] WebKit abandons overlay scrollbar CALayers.
3803         <https://webkit.org/b/141943>
3804         <rdar://problem/19932199>
3805
3806         Reviewed by Beth Dakin.
3807
3808         * platform/mac/ScrollAnimatorMac.mm:
3809         (-[WebScrollbarPartAnimation initWithScrollbar:featureToAnimate:animateFrom:animateTo:duration:]):
3810         Use NSAnimationNonblockingThreaded to ensure that NSAnimations get cleaned up after they finish.
3811         The animation was indirectly retaining the overlay scrollbar's CALayer, causing significant
3812         amounts of abandoned memory to accumulate over time.
3813
3814 2015-02-24  Anders Carlsson  <andersca@apple.com>
3815
3816         Implement more of the data fetching API
3817         https://bugs.webkit.org/show_bug.cgi?id=141975
3818
3819         Reviewed by Andreas Kling.
3820
3821         Add API for getting origins in a given session that has cached data.
3822
3823         * loader/cache/MemoryCache.cpp:
3824         (WebCore::MemoryCache::originsWithCache):
3825
3826 2015-02-24  Simon Fraser  <simon.fraser@apple.com>
3827
3828         Use nullptr in more places in FrameView, RenderView, RenderObject
3829         https://bugs.webkit.org/show_bug.cgi?id=141974
3830
3831         Reviewed by Zalan Bujtas.
3832
3833         0 -> nullptr in FrameView.h/cpp, RenderView.h/cpp, RenderObject.h/cpp.
3834         
3835         Rename FrameView::m_deferSetNeedsLayouts to FrameView::m_deferSetNeedsLayoutCount
3836         to make it more clear that it's a count.
3837
3838         * page/FrameView.cpp:
3839         (WebCore::FrameView::FrameView):
3840         (WebCore::FrameView::reset):
3841         (WebCore::FrameView::setContentsSize):
3842         (WebCore::FrameView::calculateScrollbarModesForLayout):
3843         (WebCore::FrameView::layerForScrolling):
3844         (WebCore::FrameView::layerForHorizontalScrollbar):
3845         (WebCore::FrameView::layerForVerticalScrollbar):
3846         (WebCore::FrameView::layerForScrollCorner):
3847         (WebCore::FrameView::tiledBacking):
3848         (WebCore::FrameView::scrollLayerID):
3849         (WebCore::FrameView::layerForOverhangAreas):
3850         (WebCore::FrameView::setWantsLayerForTopOverHangArea):
3851         (WebCore::FrameView::setWantsLayerForBottomOverHangArea):
3852         (WebCore::FrameView::hasCompositedContentIncludingDescendants):
3853         (WebCore::FrameView::layoutRoot):
3854         (WebCore::FrameView::forceLayoutParentViewIfNeeded):
3855         (WebCore::FrameView::layout):
3856         (WebCore::FrameView::hostWindow):
3857         (WebCore::FrameView::scheduleRelayout):
3858         (WebCore::FrameView::scheduleRelayoutOfSubtree):
3859         (WebCore::FrameView::needsLayout):
3860         (WebCore::FrameView::setNeedsLayout):
3861         (WebCore::FrameView::enclosingScrollableArea):
3862         (WebCore::FrameView::parentFrameView):
3863         (WebCore::FrameView::paintControlTints):
3864         (WebCore::FrameView::adjustPageHeightDeprecated):
3865         (WebCore::FrameView::axObjectCache):
3866         * page/FrameView.h:
3867         * rendering/RenderObject.cpp:
3868         (WebCore::RenderObject::RenderObject):
3869         (WebCore::RenderObject::nextInPreOrderAfterChildren):
3870         (WebCore::RenderObject::previousInPreOrder):
3871         (WebCore::RenderObject::firstLeafChild):
3872         (WebCore::RenderObject::lastLeafChild):
3873         (WebCore::RenderObject::traverseNext):
3874         (WebCore::RenderObject::firstLineBlock):
3875         (WebCore::RenderObject::containerForRepaint):
3876         (WebCore::RenderObject::showRenderSubTreeAndMark):
3877         (WebCore::RenderObject::localToAbsolute):
3878         (WebCore::RenderObject::container):
3879         * rendering/RenderObject.h:
3880         (WebCore::RenderObject::virtualContinuation):
3881         (WebCore::RenderObject::node):
3882         (WebCore::RenderObject::nonPseudoNode):
3883         (WebCore::RenderObject::localToAbsoluteQuad):
3884         (WebCore::RenderObject::absoluteQuads):
3885         (WebCore::RenderObject::absoluteClippedOverflowRect):
3886         (WebCore::RenderObject::outlineBoundsForRepaint):
3887         (WebCore::RenderObject::computeAbsoluteRepaintRect):
3888         (WebCore::RenderObject::selectionRect):
3889         (WebCore::RenderObject::imageChanged):
3890         (WebCore::RenderObject::addFocusRingRects):
3891         (WebCore::RenderObject::absoluteOutlineBounds):
3892         * rendering/RenderView.cpp:
3893         (WebCore::SelectionIterator::next):
3894         (WebCore::RenderView::RenderView):
3895         (WebCore::RenderView::mapLocalToContainer):
3896         (WebCore::RenderView::pushMappingToContainer):
3897         (WebCore::RenderView::computeRectForRepaint):
3898         (WebCore::rendererAfterPosition):
3899         (WebCore::RenderView::splitSelectionBetweenSubtrees):
3900         (WebCore::RenderView::rootBackgroundIsEntirelyFixed):
3901         * rendering/RenderView.h:
3902
3903 2015-02-24  Yusuke Suzuki  <utatane.tea@gmail.com>
3904
3905         REGRESSION(r179429): Can't type comments in Facebook
3906         https://bugs.webkit.org/show_bug.cgi?id=141859
3907
3908         Reviewed by Brent Fulgham.
3909
3910         Enable SymbolEnabled runtime flag in inspector context.
3911
3912         * ForwardingHeaders/runtime/RuntimeFlags.h: Added.
3913         * WebCore.order:
3914         * WebCore.vcxproj/WebCore.vcxproj:
3915         * WebCore.vcxproj/WebCore.vcxproj.filters:
3916         * bindings/js/JSDOMWindowBase.cpp:
3917         (WebCore::JSDOMWindowBase::javaScriptRuntimeFlags):
3918         (WebCore::JSDOMWindowBase::javaScriptExperimentsEnabled): Deleted.
3919         * bindings/js/JSDOMWindowBase.h:
3920         * bindings/js/JSWorkerGlobalScopeBase.cpp:
3921         (WebCore::JSWorkerGlobalScopeBase::javaScriptRuntimeFlags):
3922         (WebCore::JSWorkerGlobalScopeBase::javaScriptExperimentsEnabled): Deleted.
3923         * bindings/js/JSWorkerGlobalScopeBase.h:
3924         * inspector/InspectorFrontendClientLocal.cpp:
3925         (WebCore::InspectorFrontendClientLocal::InspectorFrontendClientLocal):
3926         * page/Settings.h:
3927         * page/Settings.in: