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