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