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