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