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