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