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