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