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