0b8a139c4d8b1ad67ace4869c0a019a9afed0732
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-04-23  Simon Fraser  <simon.fraser@apple.com>
2
3         Use a typedef for TileGrid tile validation policy flags
4         https://bugs.webkit.org/show_bug.cgi?id=144085
5
6         Reviewed by Tim Horton.
7
8         Replace 'unsigned' with a typedef for the bitmask of TileValidationPolicyFlags.
9
10         * platform/graphics/ca/TileController.cpp:
11         (WebCore::TileController::tileRevalidationTimerFired):
12         * platform/graphics/ca/TileGrid.cpp:
13         (WebCore::TileGrid::revalidateTiles):
14         * platform/graphics/ca/TileGrid.h:
15
16 2015-04-23  Andreas Kling  <akling@apple.com>
17
18         Slap Node's reference counting functions with ALWAYS_INLINE stick.
19
20         Speculative fix for weird ~3% regression on Speedometer seen after TreeShared
21         was merged into Node. Since the memory layout didn't change, failure to inline
22         seems like a possible source of regression.
23
24         * dom/Node.h:
25         (WebCore::Node::ref):
26         (WebCore::Node::deref):
27         (WebCore::Node::hasOneRef):
28         (WebCore::Node::refCount):
29
30 2015-04-22  Simon Fraser  <simon.fraser@apple.com>
31
32         [iOS] Move computeCoverageRect code from FrameView into TileController
33         https://bugs.webkit.org/show_bug.cgi?id=144087
34
35         Reviewed by Benjamin Poulain.
36         
37         There is code in four different places that adjusts tiling coverage rect:
38         1. LegacyTileCache. This will remain unchanged.
39         2. FrameView::computeTileCoverageRect(). This was added to do velocity-based
40         page tiled coverage expansion for iOS WK2.
41         3. TileController::computeTileCoverageRect(): this is used for the page tiles
42         on Mac.
43         4. GraphicsLayerCA::adjustTiledLayerVisibleRect(). This is used by non-page
44         tiled layers on both iOS and Mac.
45         
46         This patch reduced this list to 3, coalescing FrameView::computeTileCoverageRect()
47         and TileController::computeTileCoverageRect(). It removes the rect inflation that
48         affects the visibleRect passed into rootLayer->flushCompositingState() for iOS,
49         but the page tiles now do an identical coverage inflation. The visible rect
50         change does affect visible rect computations for non-page tiled backings, but
51         a future patch will restore that.
52
53         * page/FrameView.cpp:
54         (WebCore::FrameView::setScrollVelocity):
55         (WebCore::FrameView::computeCoverageRect): Deleted.
56         * page/FrameView.h:
57         * platform/graphics/TiledBacking.h:
58         (WebCore::VelocityData::VelocityData):
59         * platform/graphics/ca/TileController.cpp:
60         (WebCore::TileController::setVelocity):
61         (WebCore::TileController::computeTileCoverageRect):
62         * platform/graphics/ca/TileController.h:
63         * rendering/RenderLayerCompositor.cpp:
64         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
65
66 2015-04-22  Darin Adler  <darin@apple.com>
67
68         Remove OwnPtr and PassOwnPtr use from WebKit/cf, WebKit/mac, and WebKit2
69         https://bugs.webkit.org/show_bug.cgi?id=143943
70
71         Reviewed by Anders Carlsson.
72
73         * editing/Editor.cpp:
74         (WebCore::Editor::insertDictationPhrases): Changed this iOS-only
75         function to take a Vector<Vector<String>>&& and not involve PassOwnPtr.
76         (WebCore::Editor::setDictationPhrasesAsChildOfElement): Changed this iOS-only
77         function to take a Vector<Vector<String>> and not involve PassOwnPtr. Also made
78         it take a reference rather than a pointer to the element and simplify the code
79         a bit using modern for loops and auto.
80         * editing/Editor.h: Ditto.
81
82         * editing/ios/DictationCommandIOS.cpp:
83         (WebCore::DictationCommandIOS::DictationCommandIOS): Take
84         a Vector<Vector<String>>&& instead of a PassOwnPtr.
85         (WebCore::DictationCommandIOS::~DictationCommandIOS): Deleted. No need to
86         explicitly define this.
87         (WebCore::DictationCommandIOS::doApply): Updated to use modern for loop and
88         work with a Vector<Vector<String>> instead of an OwnPtr.
89         * editing/ios/DictationCommandIOS.h: Updated to not use PassOwnPtr and OwnPtr.
90         Also modernized a bit by using override.
91
92         * platform/network/ios/QuickLook.h: Return an NSURLRequest * instead of a
93         PassOwnPtr<ResourceRequest> from this iOS-specific function.
94         * platform/network/ios/QuickLook.mm:
95         (WebCore::registerQLPreviewConverterIfNeeded): Ditto.
96
97 2015-04-22  Jinwoo Song  <jinwoo7.song@samsung.com>
98
99         Convert OwnPtr to std::unique_ptr in GraphicsContextCairo.cpp
100         https://bugs.webkit.org/show_bug.cgi?id=144033
101
102         Reviewed by Darin Adler.
103
104         Use unique_ptr for creating a copy of cairo_path_t and use lambda function
105         for custom deleter, cairo_path_destroy().
106
107         * platform/graphics/cairo/GraphicsContextCairo.cpp:
108         (WebCore::drawPathShadow): Use std::unique_ptr instead of OwnPtr.
109         (WebCore::GraphicsContext::clip): Call cairo_path_destroy() immediately.
110         * platform/graphics/cairo/OwnPtrCairo.cpp:
111         (WTF::deleteOwnedPtr<cairo_path_t>): Deleted. Remove unnecessary deleter anymore.
112         * platform/graphics/cairo/OwnPtrCairo.h: Ditto.
113
114 2015-04-22  Darin Adler  <darin@apple.com>
115
116         Eliminate remaining uses of OwnPtr and PassOwnPtr in WebCore outside the editing and platform directories
117         https://bugs.webkit.org/show_bug.cgi?id=143949
118
119         Reviewed by Andreas Kling.
120
121         * dom/ContainerNode.h: Removed unneeded includes and forward declarations.
122         * dom/Document.h: Ditto.
123
124         * dom/DocumentParser.h: Fixed comment to not mention PassOwnPtr.
125
126         * html/shadow/MediaControlElements.cpp:
127         (WebCore::MediaControlTextTrackContainerElement::create): Return a Ref instead of a PassRefPtr.
128         (WebCore::MediaControlTextTrackContainerElement::updateTextTrackRepresentation): Pass a reference
129         rather than a pointer to TextTrackRepresentation::create.
130         (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage): Return a
131         RefPtr instead of a PassRefPtr.
132
133         * html/shadow/MediaControlElements.h: Use unique_ptr for m_textTrackRepresentation.
134         Also fix a couple uses of PassRefPtr.
135
136         * loader/DocumentLoader.cpp:
137         (WebCore::DocumentLoader::DocumentLoader): Use make_unique.
138         (WebCore::DocumentLoader::addAllArchiveResources): Ditto.
139         (WebCore::DocumentLoader::addArchiveResource): Ditto.
140         (WebCore::DocumentLoader::clearArchiveResources): Set to nullptr instead of calling clear.
141         (WebCore::DocumentLoader::startLoadingMainResource): Use make_unique.
142         * loader/DocumentLoader.h: Made m_archiveResourceCollection and
143         m_applicationCacheHost use unique_ptr.
144
145         * loader/WorkerThreadableLoader.cpp:
146         (WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveData): Use delete here instead
147         of using OwnPtr to do the deletion. Matches the other code nearby.
148
149         * loader/appcache/ApplicationCacheGroup.cpp:
150         (WebCore::ApplicationCacheGroup::disassociateDocumentLoader): Handle case where the host is
151         null; this happens during the DocumentLoader destruction process since unique_ptr sets itself
152         to null before it destroys the object it points to and OwnPtr does not.
153
154         * loader/cocoa/DiskCacheMonitorCocoa.mm:
155         (WebCore::DiskCacheMonitor::monitorFileBackingStoreCreation): Use delete instead of adoptPtr
156         to delete a raw pointer.
157         (WebCore::DiskCacheMonitor::DiskCacheMonitor): Use unique_ptr instead of OwnPtr.
158
159         * page/DragController.h: Removed some unneeded forward declarations and changed the
160         create function to return unique_ptr.
161
162         * platform/LayoutUnit.h: Removed wtf_ceil workaround hack here. Not sure why we ever did it
163         this way!
164
165         * platform/graphics/FontCascade.cpp:
166         (WTF::deleteOwnedPtr<WebCore::TextLayout>): Deleted.
167         (WebCore::FontCascade::createLayout): Changed to return a unique_ptr.
168         (WebCore::FontCascade::deleteLayout): Deleted.
169         * platform/graphics/FontCascade.h: Made the above changes.
170
171         * platform/graphics/ImageBuffer.h: Changed copyImage to return a RefPtr instead of a PassRefPtr.
172
173         * platform/graphics/TextTrackRepresentation.cpp:
174         (WebCore::TextTrackRepresentation::create): Use make_unique and return a unique_ptr.
175         * platform/graphics/TextTrackRepresentation.h: Removed unneeded includes and forward declarations
176         and made create return a unique_ptr.
177         * platform/graphics/cairo/ImageBufferCairo.cpp:
178         (WebCore::ImageBuffer::copyImage): Changed to return a RefPtr.
179         * platform/graphics/cg/ImageBufferCG.cpp:
180         (WebCore::ImageBuffer::copyImage): Changed to return a RefPtr.
181
182         * platform/graphics/ios/TextTrackRepresentationIOS.h: Use reference instead of pointer,
183         made more things private.
184         * platform/graphics/ios/TextTrackRepresentationIOS.mm:
185         (TextTrackRepresentation::create): Use make_unique.
186         (TextTrackRepresentationIOS::TextTrackRepresentationIOS): Take a reference.
187
188         * platform/graphics/mac/ComplexTextController.cpp:
189         (WebCore::FontCascade::createLayout): Return a unique_ptr with a custom destruction function.
190         The custom destruction function eliminates the need to put TextLayout in a visible header.
191         (WebCore::FontCascade::deleteLayout): Deleted. Use a lambda instead.
192         (WebCore::roundCGFloat): Deleted. Old fashioned way to deal with multiple floating point sizes.
193         Just use std::round instead.
194         (WebCore::ceilCGFloat): Deleted. Same as above. Just use std::ceil instead.
195         (WebCore::ComplexTextController::adjustGlyphsAndAdvances): Use std::round and std::ceil.
196
197         * rendering/RenderBlockLineLayout.cpp:
198         (WebCore::RenderTextInfo::RenderTextInfo): Deleted. Can compile constructor and destructor
199         now thanks to use of unique_ptr with a custom deleter.
200         (WebCore::RenderTextInfo::~RenderTextInfo): Deleted. Ditto.
201         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange): Updated for RenderTextInfo data member
202         name change.
203
204         * rendering/RenderView.h: Removed unneeded include.
205
206         * rendering/line/BreakingContext.h: Removed unneeded include.
207         (WebCore::BreakingContext::handleOutOfFlowPositioned): Updated for RenderTextInfo data member
208         name change.
209         (WebCore::BreakingContext::handleFloat): Ditto.
210         (WebCore::BreakingContext::handleReplaced): Ditto.
211         (WebCore::BreakingContext::handleText): Ditto.
212         (WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord): Ditto.
213
214         * rendering/line/LineBreaker.h: Made the RenderTextInfo struct more like a struct by taking
215         off all the m_ prefixes from the data member names. Initialized all the values in the struct
216         to defaults so we don't need an explicit constructor. We also don't need an explicit destructor
217         any more due to use of a unique_ptr with a deleter.
218
219 2015-04-22  Roger Fong  <roger_fong@apple.com>
220
221         Volume slider appears/doesn't appear at the wrong times.
222         https://bugs.webkit.org/show_bug.cgi?id=144072.
223         <rdar://problem/20576145>
224
225         Reviewed by Dean Jackson.
226
227         Set background divs to match volume box dimensions.
228         * Modules/mediacontrols/mediaControlsApple.css:
229         (audio::-webkit-media-controls-volume-slider-container-background):
230         (audio::-webkit-media-controls-volume-slider-container-tint):
231
232         Draw the volume slider immediately on mousing over the mute box.
233         * Modules/mediacontrols/mediaControlsApple.js:
234         (Controller.prototype.createControls):
235         (Controller.prototype.handleMuteBoxOver):
236
237 2015-04-22  Jer Noble  <jer.noble@apple.com>
238
239         [Mac][MediaSource] Crash when SourceBuffer::provideMediaData() is called re-entrantly.
240         https://bugs.webkit.org/show_bug.cgi?id=144023
241
242         Reviewed by Darin Adler.
243
244         Partially revert r183097 (as it was not sufficient to protect against re-entrancy). Instead,
245         protect against re-entrancy in provideMediaData() directly by removing the first sample
246         from the TrackBuffer's decodeQueue at a time. If provideMediaData() is called re-entrantly,
247         or if any other method which modifies the decodeQueue is called from inside
248         provideMediaData, no iterators will be invalidated.
249
250         * Modules/mediasource/SourceBuffer.cpp:
251         (WebCore::SourceBuffer::provideMediaData):
252         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
253         (WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples):
254
255 2015-04-22  Zalan Bujtas  <zalan@apple.com>
256
257         Create RenderRubyText for <rt> only when the parent renderer is a RenderRuby.
258         https://bugs.webkit.org/show_bug.cgi?id=144035
259         rdar://problem/20604467
260
261         Reviewed by Darin Adler.
262
263         This patch extends HTMLElement::createElementRenderer()
264         with the render tree insertion point so that we can create different type
265         of renderers based on the render tree context.
266
267         Test: fast/ruby/ruby-rt-with-region-crash.html
268
269         * CMakeLists.txt:
270         * Modules/plugins/PluginReplacement.h:
271         * Modules/plugins/QuickTimePluginReplacement.h:
272         * Modules/plugins/QuickTimePluginReplacement.mm:
273         (WebCore::QuickTimePluginReplacement::createElementRenderer):
274         * Modules/plugins/YouTubePluginReplacement.cpp:
275         (WebCore::YouTubePluginReplacement::createElementRenderer):
276         * Modules/plugins/YouTubePluginReplacement.h:
277         * WebCore.vcxproj/WebCore.vcxproj:
278         * WebCore.vcxproj/WebCore.vcxproj.filters:
279         * WebCore.xcodeproj/project.pbxproj:
280         * dom/Element.cpp:
281         (WebCore::Element::createElementRenderer):
282         * dom/Element.h:
283         * html/HTMLAppletElement.cpp:
284         (WebCore::HTMLAppletElement::createElementRenderer):
285         * html/HTMLAppletElement.h:
286         * html/HTMLAttachmentElement.cpp:
287         (WebCore::HTMLAttachmentElement::createElementRenderer):
288         * html/HTMLAttachmentElement.h:
289         * html/HTMLBRElement.cpp:
290         (WebCore::HTMLBRElement::createElementRenderer):
291         * html/HTMLBRElement.h:
292         * html/HTMLButtonElement.cpp:
293         (WebCore::HTMLButtonElement::createElementRenderer):
294         * html/HTMLButtonElement.h:
295         * html/HTMLCanvasElement.cpp:
296         (WebCore::HTMLCanvasElement::createElementRenderer):
297         * html/HTMLCanvasElement.h:
298         * html/HTMLDetailsElement.cpp:
299         (WebCore::HTMLDetailsElement::createElementRenderer):
300         * html/HTMLDetailsElement.h:
301         * html/HTMLElement.cpp:
302         (WebCore::HTMLElement::createElementRenderer):
303         * html/HTMLElement.h:
304         * html/HTMLFieldSetElement.cpp:
305         (WebCore::HTMLFieldSetElement::createElementRenderer):
306         * html/HTMLFieldSetElement.h:
307         * html/HTMLFrameElement.cpp:
308         (WebCore::HTMLFrameElement::createElementRenderer):
309         * html/HTMLFrameElement.h:
310         * html/HTMLFrameSetElement.cpp:
311         (WebCore::HTMLFrameSetElement::createElementRenderer):
312         * html/HTMLFrameSetElement.h:
313         * html/HTMLIFrameElement.cpp:
314         (WebCore::HTMLIFrameElement::createElementRenderer):
315         * html/HTMLIFrameElement.h:
316         * html/HTMLImageElement.cpp:
317         (WebCore::HTMLImageElement::createElementRenderer):
318         * html/HTMLImageElement.h:
319         * html/HTMLInputElement.cpp:
320         (WebCore::HTMLInputElement::createElementRenderer):
321         * html/HTMLInputElement.h:
322         * html/HTMLMediaElement.cpp:
323         (WebCore::HTMLMediaElement::parseAttribute):
324         * html/HTMLMediaElement.h:
325         * html/HTMLMeterElement.cpp:
326         (WebCore::HTMLMeterElement::createElementRenderer):
327         * html/HTMLMeterElement.h:
328         * html/HTMLPlugInElement.cpp:
329         (WebCore::HTMLPlugInElement::createElementRenderer):
330         * html/HTMLPlugInElement.h:
331         * html/HTMLPlugInImageElement.cpp:
332         (WebCore::HTMLPlugInImageElement::createElementRenderer):
333         * html/HTMLPlugInImageElement.h:
334         * html/HTMLProgressElement.cpp:
335         (WebCore::HTMLProgressElement::createElementRenderer):
336         * html/HTMLProgressElement.h:
337         * html/HTMLSelectElement.cpp:
338         (WebCore::HTMLSelectElement::createElementRenderer):
339         * html/HTMLSelectElement.h:
340         * html/HTMLSummaryElement.cpp:
341         (WebCore::HTMLSummaryElement::createElementRenderer):
342         * html/HTMLSummaryElement.h:
343         * html/HTMLTextAreaElement.cpp:
344         (WebCore::HTMLTextAreaElement::createElementRenderer):
345         * html/HTMLTextAreaElement.h:
346         * html/HTMLVideoElement.cpp:
347         (WebCore::HTMLVideoElement::createElementRenderer):
348         * html/HTMLVideoElement.h:
349         * html/HTMLWBRElement.cpp:
350         (WebCore::HTMLWBRElement::createElementRenderer):
351         * html/HTMLWBRElement.h:
352         * html/RubyElement.cpp:
353         (WebCore::RubyElement::createElementRenderer):
354         * html/RubyElement.h:
355         * html/RubyTextElement.cpp:
356         (WebCore::RubyTextElement::createElementRenderer):
357         * html/RubyTextElement.h:
358         * html/shadow/DetailsMarkerControl.cpp:
359         (WebCore::DetailsMarkerControl::createElementRenderer):
360         * html/shadow/DetailsMarkerControl.h:
361         * html/shadow/MediaControlElements.cpp:
362         (WebCore::MediaControlTimelineContainerElement::createElementRenderer):
363         (WebCore::MediaControlVolumeSliderContainerElement::createElementRenderer):
364         (WebCore::MediaControlTextTrackContainerElement::createElementRenderer):
365         * html/shadow/MediaControlElements.h:
366         * html/shadow/MeterShadowElement.cpp:
367         (WebCore::MeterInnerElement::createElementRenderer):
368         * html/shadow/MeterShadowElement.h:
369         * html/shadow/ProgressShadowElement.cpp:
370         (WebCore::ProgressInnerElement::createElementRenderer):
371         * html/shadow/ProgressShadowElement.h:
372         * html/shadow/SliderThumbElement.cpp:
373         (WebCore::SliderThumbElement::createElementRenderer):
374         (WebCore::SliderContainerElement::createElementRenderer):
375         * html/shadow/SliderThumbElement.h:
376         * html/shadow/TextControlInnerElements.cpp:
377         (WebCore::TextControlInnerContainer::createElementRenderer):
378         (WebCore::TextControlInnerTextElement::createElementRenderer):
379         * html/shadow/TextControlInnerElements.h:
380         * html/shadow/mac/ImageControlsButtonElementMac.cpp:
381         (WebCore::ImageControlsButtonElementMac::createElementRenderer):
382         * html/shadow/mac/ImageControlsButtonElementMac.h:
383         * html/shadow/mac/ImageControlsRootElementMac.cpp:
384         (WebCore::ImageControlsRootElementMac::createElementRenderer):
385         * html/shadow/mac/ImageControlsRootElementMac.h:
386         * html/track/VTTCue.cpp:
387         (WebCore::VTTCueBox::createElementRenderer):
388         * html/track/VTTCue.h:
389         * mathml/MathMLInlineContainerElement.cpp:
390         (WebCore::MathMLInlineContainerElement::createElementRenderer):
391         * mathml/MathMLInlineContainerElement.h:
392         * mathml/MathMLMathElement.cpp:
393         (WebCore::MathMLMathElement::createElementRenderer):
394         * mathml/MathMLMathElement.h:
395         * mathml/MathMLMencloseElement.cpp:
396         (WebCore::MathMLMencloseElement::createElementRenderer):
397         * mathml/MathMLMencloseElement.h:
398         * mathml/MathMLSelectElement.cpp:
399         (WebCore::MathMLSelectElement::createElementRenderer):
400         * mathml/MathMLSelectElement.h:
401         * mathml/MathMLTextElement.cpp:
402         (WebCore::MathMLTextElement::createElementRenderer):
403         * mathml/MathMLTextElement.h:
404         * rendering/RenderBlock.cpp:
405         (WebCore::RenderBlock::clone):
406         * rendering/RenderElement.cpp:
407         * rendering/RenderRuby.h:
408         (WebCore::isRuby):
409         * style/RenderTreePosition.cpp: Added.
410         (WebCore::RenderTreePosition::computeNextSibling):
411         (WebCore::RenderTreePosition::invalidateNextSibling):
412         (WebCore::RenderTreePosition::previousSiblingRenderer):
413         (WebCore::RenderTreePosition::nextSiblingRenderer):
414         (WebCore::RenderTreePosition::isRendererReparented):
415         * style/RenderTreePosition.h: Added.
416         (WebCore::RenderTreePosition::RenderTreePosition):
417         (WebCore::RenderTreePosition::parent):
418         (WebCore::RenderTreePosition::canInsert):
419         (WebCore::RenderTreePosition::insert):
420         * style/StyleResolveTree.cpp:
421         (WebCore::Style::createRendererIfNeeded):
422         (WebCore::Style::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded):
423         (WebCore::Style::textRendererIsNeeded):
424         (WebCore::Style::RenderTreePosition::parent): Deleted.
425         (WebCore::Style::isRendererReparented): Deleted.
426         (WebCore::Style::nextSiblingRenderer): Deleted.
427         (WebCore::Style::RenderTreePosition::RenderTreePosition): Deleted.
428         (WebCore::Style::RenderTreePosition::canInsert): Deleted.
429         (WebCore::Style::RenderTreePosition::insert): Deleted.
430         (WebCore::Style::RenderTreePosition::computeNextSibling): Deleted.
431         (WebCore::Style::RenderTreePosition::invalidateNextSibling): Deleted.
432         (WebCore::Style::previousSiblingRenderer): Deleted.
433         * svg/SVGAElement.cpp:
434         (WebCore::SVGAElement::createElementRenderer):
435         * svg/SVGAElement.h:
436         * svg/SVGAltGlyphElement.cpp:
437         (WebCore::SVGAltGlyphElement::createElementRenderer):
438         * svg/SVGAltGlyphElement.h:
439         * svg/SVGCircleElement.cpp:
440         (WebCore::SVGCircleElement::createElementRenderer):
441         * svg/SVGCircleElement.h:
442         * svg/SVGClipPathElement.cpp:
443         (WebCore::SVGClipPathElement::createElementRenderer):
444         * svg/SVGClipPathElement.h:
445         * svg/SVGDefsElement.cpp:
446         (WebCore::SVGDefsElement::createElementRenderer):
447         * svg/SVGDefsElement.h:
448         * svg/SVGEllipseElement.cpp:
449         (WebCore::SVGEllipseElement::createElementRenderer):
450         * svg/SVGEllipseElement.h:
451         * svg/SVGFilterElement.cpp:
452         (WebCore::SVGFilterElement::createElementRenderer):
453         * svg/SVGFilterElement.h:
454         * svg/SVGFilterPrimitiveStandardAttributes.cpp:
455         (WebCore::SVGFilterPrimitiveStandardAttributes::createElementRenderer):
456         * svg/SVGFilterPrimitiveStandardAttributes.h:
457         * svg/SVGForeignObjectElement.cpp:
458         (WebCore::SVGForeignObjectElement::createElementRenderer):
459         * svg/SVGForeignObjectElement.h:
460         * svg/SVGGElement.cpp:
461         (WebCore::SVGGElement::createElementRenderer):
462         * svg/SVGGElement.h:
463         * svg/SVGGraphicsElement.cpp:
464         (WebCore::SVGGraphicsElement::createElementRenderer):
465         * svg/SVGGraphicsElement.h:
466         * svg/SVGImageElement.cpp:
467         (WebCore::SVGImageElement::createElementRenderer):
468         * svg/SVGImageElement.h:
469         * svg/SVGLinearGradientElement.cpp:
470         (WebCore::SVGLinearGradientElement::createElementRenderer):
471         * svg/SVGLinearGradientElement.h:
472         * svg/SVGMarkerElement.cpp:
473         (WebCore::SVGMarkerElement::createElementRenderer):
474         * svg/SVGMarkerElement.h:
475         * svg/SVGMaskElement.cpp:
476         (WebCore::SVGMaskElement::createElementRenderer):
477         * svg/SVGMaskElement.h:
478         * svg/SVGPathElement.cpp:
479         (WebCore::SVGPathElement::createElementRenderer):
480         * svg/SVGPathElement.h:
481         * svg/SVGPatternElement.cpp:
482         (WebCore::SVGPatternElement::createElementRenderer):
483         * svg/SVGPatternElement.h:
484         * svg/SVGRadialGradientElement.cpp:
485         (WebCore::SVGRadialGradientElement::createElementRenderer):
486         * svg/SVGRadialGradientElement.h:
487         * svg/SVGRectElement.cpp:
488         (WebCore::SVGRectElement::createElementRenderer):
489         * svg/SVGRectElement.h:
490         * svg/SVGSVGElement.cpp:
491         (WebCore::SVGSVGElement::createElementRenderer):
492         * svg/SVGSVGElement.h:
493         * svg/SVGStopElement.cpp:
494         (WebCore::SVGStopElement::createElementRenderer):
495         * svg/SVGStopElement.h:
496         * svg/SVGSwitchElement.cpp:
497         (WebCore::SVGSwitchElement::createElementRenderer):
498         * svg/SVGSwitchElement.h:
499         * svg/SVGSymbolElement.cpp:
500         (WebCore::SVGSymbolElement::createElementRenderer):
501         * svg/SVGSymbolElement.h:
502         * svg/SVGTRefElement.cpp:
503         (WebCore::SVGTRefElement::createElementRenderer):
504         * svg/SVGTRefElement.h:
505         * svg/SVGTSpanElement.cpp:
506         (WebCore::SVGTSpanElement::createElementRenderer):
507         * svg/SVGTSpanElement.h:
508         * svg/SVGTextElement.cpp:
509         (WebCore::SVGTextElement::createElementRenderer):
510         * svg/SVGTextElement.h:
511         * svg/SVGTextPathElement.cpp:
512         (WebCore::SVGTextPathElement::createElementRenderer):
513         * svg/SVGTextPathElement.h:
514         * svg/SVGUseElement.cpp:
515         (WebCore::SVGUseElement::createElementRenderer):
516         * svg/SVGUseElement.h:
517
518 2015-04-22  Brent Fulgham  <bfulgham@apple.com>
519
520         VisibleSelection should only accept Range by reference
521         https://bugs.webkit.org/show_bug.cgi?id=144047
522
523         Reviewed by Tim Horton.
524
525         Update VisibleSelection to expect a Range reference argument, rather than a
526         Range*. Also update all uses of VisibleSelection to pass a reference instead
527         of a pointer.
528
529         No change in behavior, so new tests.
530
531         * editing/Editor.cpp:
532         (WebCore::Editor::selectionForCommand):
533         (WebCore::Editor::advanceToNextMisspelling):
534         (WebCore::Editor::markMisspellingsAfterTypingToWord):
535         (WebCore::Editor::markAndReplaceFor):
536         (WebCore::Editor::transpose):
537         (WebCore::Editor::findString):
538         (WebCore::Editor::rangeOfString):
539         * editing/FrameSelection.cpp:
540         (WebCore::FrameSelection::setSelectedRange):
541         * editing/SpellingCorrectionCommand.cpp:
542         (WebCore::SpellingCorrectionCommand::SpellingCorrectionCommand):
543         * editing/VisibleSelection.cpp:
544         (WebCore::VisibleSelection::VisibleSelection):
545         * editing/VisibleSelection.h:
546         * editing/mac/EditorMac.mm:
547         (WebCore::Editor::replaceNodeFromPasteboard):
548         * page/DragController.cpp:
549         (WebCore::selectElement):
550         * page/TextIndicator.cpp:
551         (WebCore::TextIndicator::createWithRange):
552         * page/mac/EventHandlerMac.mm:
553         (WebCore::EventHandler::selectClosestWordFromHitTestResultBasedOnLookup):
554         * rendering/SelectionSubtreeRoot.cpp:
555         (WebCore::SelectionSubtreeRoot::adjustForVisibleSelection):
556
557 2015-04-22  Roger Fong  <roger_fong@apple.com>
558
559         Audio controls should render with a black background.
560         https://bugs.webkit.org/show_bug.cgi?id=144074.
561         <rdar://problem/20596939>
562
563         Reviewed by Darin Adler.
564
565         * Modules/mediacontrols/mediaControlsApple.css:
566         (audio::-webkit-media-controls-panel-background-container):
567         (audio::-webkit-media-controls-panel .volume-box):
568
569 2015-04-22  Roger Fong  <roger_fong@apple.com>
570
571         Inline media control icons scale down when video is too small.
572         https://bugs.webkit.org/show_bug.cgi?id=144073.
573         <rdar://problem/20659451>
574
575         Reviewed by Darin Adler.
576
577         Just make sure the buttons use min-width.
578         * Modules/mediacontrols/mediaControlsApple.css:
579         (audio::-webkit-media-controls-rewind-button):
580         (audio::-webkit-media-controls-play-button):
581         (audio::-webkit-media-controls-panel .mute-box):
582         (video::-webkit-media-controls-volume-max-button):
583         (audio::-webkit-media-controls-wireless-playback-picker-button):
584         (audio::-webkit-media-controls-toggle-closed-captions-button):
585         (audio::-webkit-media-controls-fullscreen-button):
586
587 2015-04-22  Jer Noble  <jer.noble@apple.com>
588
589         Add new optimized fullscreen delegate methods
590         https://bugs.webkit.org/show_bug.cgi?id=144071
591
592         Reviewed by Eric Carlson.
593
594         AVPlayerViewController requires three new delegate methods to be implemented by WebKit which
595         notify the delegates exactly when the owning view will enter and leave fullscreen mode. One
596         of the delegate methods (-enterOptimizedFullScreenModeRedirectingVideoToLayer:) gives the
597         delegate an opportunity to move the video sublayer into a new CALayer. The matching delegate
598         (-leaveOptimizedFullScreenMode), allows us to return our sublayer back to its original parent.
599         The third delegate (-isOptimizedFullscreenPossible) is required so the AVPlayerViewController
600         knows whether to allow a standard -> optimized fullscreen transition.
601
602         Drive-by fix: initialize ivars at declaration time.
603
604         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
605         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
606         (-[WebAVPlayerController isOptimizedFullscreenPossible]):
607         (-[WebAVVideoLayer enterOptimizedFullScreenModeRedirectingVideoToLayer:]):
608         (-[WebAVVideoLayer leaveOptimizedFullScreenMode]):
609         (WebVideoFullscreenInterfaceAVKit::WebVideoFullscreenInterfaceAVKit):
610         (WebVideoFullscreenInterfaceAVKit::setupFullscreenInternal):
611         (+[WebAVPlayerController keyPathsForValuesAffectingPlayingOnExternalScreen]): Deleted.
612
613 2015-04-22  Myles C. Maxfield  <mmaxfield@apple.com>
614
615         [iOS] Caret does not line up with text when using the system font
616         https://bugs.webkit.org/show_bug.cgi?id=144076
617         <rdar://problem/20578301>
618
619         Reviewed by Enrica Casucci.
620
621         Determining caret locations often uses the complex text codepath, which means
622         the complex text codepath must know about custom tracking.
623
624         This regression is due to r182512.
625
626         Note that this patch is a short-term solution until I can solve the bigger issue of
627         having two CTFontRefs and using each in their proper place.
628
629         No new tests because there is no way to robustly test the system font.
630
631         * platform/graphics/Font.h:
632         (WebCore::Font::hasCustomTracking):
633         * platform/graphics/cocoa/FontCocoa.mm:
634         (WebCore::canUseFastGlyphAdvanceGetter):
635         (WebCore::Font::platformWidthForGlyph):
636         (WebCore::hasCustomTracking): Deleted.
637         * platform/graphics/mac/SimpleFontDataCoreText.cpp:
638         (WebCore::Font::getCFStringAttributes):
639
640 2015-04-22  Brent Fulgham  <bfulgham@apple.com>
641
642         Context menu doesn't account for selection semantics
643         https://bugs.webkit.org/show_bug.cgi?id=143958
644         <rdar://problem/19735706>
645
646         Reviewed by Tim Horton.
647
648         Before using the default word-only selection for context menus, check with the
649         lookup service to see if we can get a semantically appropriate selection.
650
651         * editing/EditingBehavior.h:
652         (WebCore::EditingBehavior::shouldSelectBasedOnDictionaryLookup): Added, so that we can
653         behavior correctly when using non-Mac editing behavior.
654         * editing/mac/DictionaryLookup.mm:
655         (WebCore::rangeForDictionaryLookupAtHitTestResult): Modified to honor standard WebKit
656         behavior when hit testing at end-of-line/end-of-paragraph, etc.
657         * page/EventHandler.cpp:
658         (WebCore::EventHandler::shouldAppendTrailingWhitespace): New helper function to share code.
659         (WebCore::EventHandler::selectClosestWordFromHitTestResultBasedOnLookup): Added.
660         (WebCore::EventHandler::selectClosestContextualWordFromMouseEvent): Added.
661         (WebCore::EventHandler::selectClosestContextualWordOrLinkFromMouseEvent): Renamed from selectClosestWordOrLinkFromMouseEvent.
662         Have this call the new 'selectClosestContextualWordFromMouseEvent' instead of the vanilla 'selectClosestWordFromMouseEvent'.
663         * page/EventHandler.h:
664         * page/mac/EventHandlerMac.mm:
665         (WebCore::EventHandler::selectClosestWordFromHitTestResultBasedOnLookup): Added.
666
667 2015-04-21  Brent Fulgham  <bfulgham@apple.com>
668
669         [Mac] Extend action menus to support PDF
670         https://bugs.webkit.org/show_bug.cgi?id=143895
671         <rdar://problem/19003333>
672
673         Reviewed by Tim Horton.
674
675         Tested by TestWebKitAPI ActionMenus.mm.
676
677         Add a new dictionary lookup method to support PDF Selections. This code replicates the
678         DOM Range-based logic used for HTML documents, but does so using the PDFKit API and
679         its support types.
680
681         * Configurations/Base.xcconfig: Add PDFKit include path for build.
682         * editing/mac/DictionaryLookup.h:
683         * editing/mac/DictionaryLookup.mm:
684         (WebCore::expandSelectionByCharacters): Helper function for PDF support.
685         (WebCore::dictionaryLookupForPDFSelection): Added.
686
687 2015-04-22  Zalan Bujtas  <zalan@apple.com>
688
689         Move render ruby initialization logic from RenderElement::createFor() to *::createElementRenderer()
690         https://bugs.webkit.org/show_bug.cgi?id=144058
691
692         Reviewed by Darin Adler.
693
694         No change in functionality.
695
696         * CMakeLists.txt:
697         * WebCore.vcxproj/WebCore.vcxproj:
698         * WebCore.vcxproj/WebCore.vcxproj.filters:
699         * WebCore.xcodeproj/project.pbxproj:
700         * html/HTMLTagNames.in:
701         * html/RubyElement.cpp: Added.
702         (WebCore::RubyElement::RubyElement):
703         (WebCore::RubyElement::create):
704         (WebCore::RubyElement::createElementRenderer):
705         * html/RubyElement.h: Added.
706         * html/RubyTextElement.cpp: Added.
707         (WebCore::RubyTextElement::RubyTextElement):
708         (WebCore::RubyTextElement::create):
709         (WebCore::RubyTextElement::createElementRenderer):
710         * html/RubyTextElement.h: Added.
711         * rendering/RenderElement.cpp:
712         (WebCore::RenderElement::createFor):
713
714 2015-04-22  Roger Fong  <roger_fong@apple.com>
715
716         Show correct wireless play placard on iOS.
717         <rdar://problem/20656596>
718
719         Copy wireless player placard code from r182631 to iOS.
720         * Modules/mediacontrols/mediaControlsiOS.css:
721         (audio::-webkit-media-controls-wireless-playback-status):
722         (audio::-webkit-media-controls-wireless-playback-text):
723         (audio::-webkit-media-controls-wireless-playback-text-top):
724         (audio::-webkit-media-controls-wireless-playback-text-bottom):
725         (audio::-webkit-media-controls-wireless-playback-status.small):
726         (audio::-webkit-media-controls-wireless-playback-text-top.small):
727         (audio::-webkit-media-controls-wireless-playback-text-bottom.small):
728         * Modules/mediacontrols/mediaControlsiOS.js:
729         (ControllerIOS.prototype.createControls):
730         (ControllerIOS.prototype.configureInlineControls):
731
732 2015-04-22  Roger Fong  <roger_fong@apple.com>
733
734         Rollout part of r182263 that broke inline media controls on iOS.
735         <rdar://problem/20654260>
736
737         * Modules/mediacontrols/mediaControlsApple.js:
738         (Controller.prototype.handlePanelTransitionEnd):
739         (Controller.prototype.setPlaying):
740         (Controller.prototype.showControls):
741         (Controller.prototype.hideControls):
742
743 2015-04-22  Eric Carlson  <eric.carlson@apple.com>
744
745         Unreviewed post-review clean up after r183096.
746
747         * Modules/mediasession/WebMediaSessionManagerClient.h:
748         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
749
750 2015-04-22  Nan Wang  <nanwang1101@yahoo.com>
751
752         AX: WebKit does not expose text fields inside tree views.
753         https://bugs.webkit.org/show_bug.cgi?id=142196
754
755         Reviewed by Chris Fleizach.
756
757         The problem is that any object in a tree which is not a static text 
758         or treeitem will be ignored. Fixed it by exposing the children of treeitem.
759
760         Test: accessibility/treeitem-child-exposed.html
761
762         * accessibility/AccessibilityRenderObject.cpp:
763         (WebCore::AccessibilityRenderObject::isAllowedChildOfTree):
764
765 2015-04-22  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
766
767         [Streams API] Implement ReadableStreamController
768         https://bugs.webkit.org/show_bug.cgi?id=143608
769
770         Reviewed by Benjamin Poulain.
771
772         Introducing ReadableStreamController, an abstraction to manage JS source stream queues.
773         This new interface is not exposed to JS scripts as specified, using NoInterfaceObject.
774
775         A controller is created at the time a ReadableJSStream is started and it is owned by it.
776         The controller may outlive the stream but as its reference will be reset, the calls to
777         its methods would result in exceptions.
778
779         The constructor is not implemented yet.
780
781         Change covered by existing tests and rebased expectations.
782
783         * CMakeLists.txt:
784         * DerivedSources.cpp:
785         * DerivedSources.make: Added ReadableStreamController.idl related files.
786         * Modules/streams/ReadableStreamController.h: Added.
787         * Modules/streams/ReadableStreamController.idl: Added.
788         * WebCore.vcxproj/WebCore.vcxproj:
789         * WebCore.vcxproj/WebCore.vcxproj.filters:
790         * WebCore.xcodeproj/project.pbxproj:
791         * bindings/js/JSBindingsAllInOne.cpp: Added ReadableStreamController.idl related files.
792         * bindings/js/JSReadableStreamControllerCustom.cpp: Added.
793         * bindings/js/ReadableStreamJSSource.cpp:
794         * bindings/js/ReadableStreamJSSource.h: Removed custom controller implementation.
795
796 2015-04-22  Manuel Rego Casasnovas  <rego@igalia.com>
797
798         Rename hasOverride{Height,Width}() to hasOverrideLogicalContent{Height,Width}()
799         https://bugs.webkit.org/show_bug.cgi?id=143984
800
801         Reviewed by Darin Adler.
802
803         This patch is renaming these LayoutBox methods, because of their names
804         don't match with the getters and setters, which is confusing. Specially
805         now that we also have hasOverrideContainingBlockLogical{Height,Width}().
806
807         No new tests (this is just a refactoring).
808
809         * rendering/RenderBlockFlow.cpp:
810         (WebCore::RenderBlockFlow::fitBorderToLinesIfNeeded):
811         * rendering/RenderBlockLineLayout.cpp:
812         (WebCore::RenderBlockFlow::updateRubyForJustifiedText):
813         * rendering/RenderBox.cpp:
814         (WebCore::RenderBox::hasOverrideLogicalContentHeight):
815         (WebCore::RenderBox::hasOverrideLogicalContentWidth):
816         (WebCore::RenderBox::overrideLogicalContentWidth):
817         (WebCore::RenderBox::overrideLogicalContentHeight):
818         (WebCore::RenderBox::perpendicularContainingBlockLogicalHeight):
819         (WebCore::RenderBox::computeLogicalWidthInRegion):
820         (WebCore::RenderBox::computeLogicalHeight):
821         (WebCore::RenderBox::computePercentageLogicalHeight):
822         (WebCore::RenderBox::availableLogicalHeightUsing):
823         * rendering/RenderBox.h:
824         * rendering/RenderDeprecatedFlexibleBox.cpp:
825         (WebCore::contentWidthForChild):
826         (WebCore::contentHeightForChild):
827         * rendering/RenderFlexibleBox.cpp:
828         (WebCore::RenderFlexibleBox::preferredMainAxisContentExtentForChild):
829         * rendering/RenderRubyBase.cpp:
830         (WebCore::RenderRubyBase::adjustInlineDirectionLineBounds):
831         * rendering/RenderTableSection.cpp:
832         (WebCore::RenderTableSection::calcRowLogicalHeight):
833
834 2015-04-21  Jer Noble  <jer.noble@apple.com>
835
836         [Mac][MediaSource] Crash when SourceBuffer::provideMediaData() is called re-entrantly.
837         https://bugs.webkit.org/show_bug.cgi?id=144023
838
839         Reviewed by Eric Carlson.
840
841         Fixes non-deterministic crash in media/media-source/media-source-stalled-holds-sleep-assertion.html.
842
843         Platform changes have introduced a re-entrancy to provideMediaData().  Calling
844         SourceBufferPrivate::enqueueSample() can result in a re-entrant call back into
845         SourceBuffer::provideMediaData(). To protect against this, wrap the client call
846         from SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples() to
847         SourceBuffer::sourceBufferPrivateDidBecomeReadyForMoreSamples() in a dispatch_async() to the
848         main thread. This gives the original provideMediaData() a chance to finish before the next
849         one begins.
850
851         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
852         (WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples):
853
854 2015-04-21  Eric Carlson  <eric.carlson@apple.com>
855
856         [Mac] Use one playback target for all web processes
857         https://bugs.webkit.org/show_bug.cgi?id=144009
858
859         Reviewed by Tim Horton.
860
861         * Modules/mediacontrols/mediaControlsApple.js:
862         (Controller.prototype.updateWirelessPlaybackStatus): Drive-by fix to show controls when
863             we show the placeholder image.
864
865         Instead of having each Page/Document pair manage access to the playback target for the videos
866         in a web process, put all of the logic into a new class - WebMediaSessionManager. A singleton
867         instance talks to the target picker and manages video element access for all web processes.
868         All playback target logic was removed from Document, Page, and MediaSessionManager.
869
870         * Modules/mediasession: Added.
871         * Modules/mediasession/WebMediaSessionManager.cpp: Added.
872         (WebCore::ClientState::ClientState):
873         (WebCore::flagsAreSet):
874         (WebCore::WebMediaSessionManager::WebMediaSessionManager):
875         (WebCore::WebMediaSessionManager::~WebMediaSessionManager):
876         (WebCore::WebMediaSessionManager::addPlaybackTargetPickerClient):
877         (WebCore::WebMediaSessionManager::removePlaybackTargetPickerClient):
878         (WebCore::WebMediaSessionManager::removeAllPlaybackTargetPickerClients):
879         (WebCore::WebMediaSessionManager::showPlaybackTargetPicker):
880         (WebCore::WebMediaSessionManager::clientStateDidChange):
881         (WebCore::WebMediaSessionManager::setPlaybackTarget):
882         (WebCore::WebMediaSessionManager::externalOutputDeviceAvailableDidChange):
883         (WebCore::WebMediaSessionManager::configurePlaybackTargetMonitoring):
884         (WebCore::WebMediaSessionManager::taskTimerFired):
885         (WebCore::WebMediaSessionManager::find):
886         (WebCore::WebMediaSessionManager::forEachClient):
887         * Modules/mediasession/WebMediaSessionManager.h: Added.
888         * Modules/mediasession/WebMediaSessionManagerClient.h: Added.
889         (WebCore::WebMediaSessionManagerClient::~WebMediaSessionManagerClient):
890         * Modules/webaudio/AudioContext.cpp:
891         (WebCore::AudioContext::mediaState): Replaces isPlayingAudio.
892         (WebCore::AudioContext::isPlayingAudio): Deleted.
893         * Modules/webaudio/AudioContext.h:
894         * WebCore.xcodeproj/project.pbxproj: Added new files.
895         * dom/Document.cpp:
896         (WebCore::Document::Document):
897         (WebCore::Document::addAudioProducer): Take a MediaProducer instead of an AudioProducer.
898         (WebCore::Document::removeAudioProducer):
899         (WebCore::Document::updateIsPlayingMedia):
900         (WebCore::nextPlaybackTargetClientContextId):
901         (WebCore::Document::addPlaybackTargetPickerClient):
902         (WebCore::Document::removePlaybackTargetPickerClient):
903         (WebCore::Document::showPlaybackTargetPicker):
904         (WebCore::Document::playbackTargetPickerClientStateDidChange):
905         (WebCore::Document::playbackTargetAvailabilityDidChange):
906         (WebCore::Document::setPlaybackTarget):
907         (WebCore::Document::setShouldPlayToPlaybackTarget):
908         (WebCore::Document::configurePlaybackTargetMonitoring): Deleted.
909         (WebCore::Document::requiresPlaybackTargetRouteMonitoring): Deleted.
910         (WebCore::Document::didChoosePlaybackTarget): Deleted.
911         * dom/Document.h:
912         (WebCore::Document::mediaState):
913         (WebCore::Document::isPlayingAudio): Deleted.
914         * html/HTMLMediaElement.cpp:
915         (WebCore::HTMLMediaElement::~HTMLMediaElement):
916         (WebCore::HTMLMediaElement::registerWithDocument):
917         (WebCore::HTMLMediaElement::setMuted): 
918         (WebCore::HTMLMediaElement::parseAttribute):
919         * html/HTMLMediaElement.h:
920         * html/HTMLMediaSession.cpp:
921         (WebCore::HTMLMediaSession::registerWithDocument):
922         (WebCore::HTMLMediaSession::unregisterWithDocument):
923         (WebCore::HTMLMediaSession::showPlaybackTargetPicker):
924         (WebCore::HTMLMediaSession::setHasPlaybackTargetAvailabilityListeners):
925         (WebCore::HTMLMediaSession::setPlaybackTarget):
926         (WebCore::HTMLMediaSession::externalOutputDeviceAvailableDidChange):
927         (WebCore::HTMLMediaSession::setShouldPlayToPlaybackTarget):
928         (WebCore::HTMLMediaSession::mediaStateDidChange):
929         (WebCore::HTMLMediaSession::didChoosePlaybackTarget): Deleted.
930         (WebCore::HTMLMediaSession::requiresPlaybackTargetRouteMonitoring): Deleted.
931         (WebCore::HTMLMediaSession::startPlayingToPlaybackTarget): Deleted.
932         (WebCore::HTMLMediaSession::stopPlayingToPlaybackTarget): Deleted.
933         * html/HTMLMediaSession.h:
934         * page/AudioProducer.h: Removed.
935         * page/ChromeClient.h:
936         * page/MediaProducer.h: Copied from Source/WebCore/page/AudioProducer.h.
937         (WebCore::MediaProducer::~MediaProducer):
938         (WebCore::AudioProducer::~AudioProducer): Deleted.
939         * page/Page.cpp:
940         (WebCore::Page::Page):
941         (WebCore::Page::updateIsPlayingMedia):
942         (WebCore::Page::addPlaybackTargetPickerClient):
943         (WebCore::Page::removePlaybackTargetPickerClient):
944         (WebCore::Page::showPlaybackTargetPicker):
945         (WebCore::Page::playbackTargetPickerClientStateDidChange):
946         (WebCore::Page::setPlaybackTarget):
947         (WebCore::Page::playbackTargetAvailabilityDidChange):
948         (WebCore::Page::setShouldPlayToPlaybackTarget):
949         (WebCore::Page::playbackTarget): Deleted.
950         (WebCore::Page::didChoosePlaybackTarget): Deleted.
951         (WebCore::Page::configurePlaybackTargetMonitoring): Deleted.
952         * page/Page.h:
953         (WebCore::Page::mediaState):
954         (WebCore::Page::isPlayingAudio): Deleted.
955         (WebCore::Page::hasWirelessPlaybackTarget): Deleted.
956         * platform/audio/MediaSession.h:
957         (WebCore::MediaSession::isPlayingToWirelessPlaybackTarget):
958         (WebCore::MediaSession::requiresPlaybackTargetRouteMonitoring):
959         (WebCore::MediaSessionClient::setShouldPlayToPlaybackTarget):
960         (WebCore::MediaSession::startPlayingToPlaybackTarget): Deleted.
961         (WebCore::MediaSession::stopPlayingToPlaybackTarget): Deleted.
962         (WebCore::MediaSessionClient::startPlayingToPlaybackTarget): Deleted.
963         (WebCore::MediaSessionClient::stopPlayingToPlaybackTarget): Deleted.
964         * platform/audio/MediaSessionManager.cpp:
965         (WebCore::MediaSessionManager::sessionWillBeginPlayback):
966         (WebCore::MediaSessionManager::sessionCanLoadMedia):
967         (WebCore::MediaSessionManager::sessionShouldBeginPlayingToWirelessPlaybackTarget): Deleted.
968         * platform/audio/MediaSessionManager.h:
969         * platform/graphics/MediaPlaybackTargetClient.h: Copied from Source/WebCore/platform/graphics/MediaPlaybackTargetPickerClient.h.
970         (WebCore::MediaPlaybackTargetClient::~MediaPlaybackTargetClient):
971         (WebCore::MediaPlaybackTargetPickerClient::~MediaPlaybackTargetPickerClient): Deleted.
972         * platform/graphics/MediaPlaybackTargetPicker.cpp:
973         (WebCore::MediaPlaybackTargetPicker::showPlaybackTargetPicker):
974         (WebCore::MediaPlaybackTargetPicker::startingMonitoringPlaybackTargets):
975         (WebCore::MediaPlaybackTargetPicker::stopMonitoringPlaybackTargets):
976         * platform/graphics/MediaPlaybackTargetPicker.h:
977         * platform/graphics/MediaPlaybackTargetPickerClient.h: Removed.
978         * platform/graphics/MediaPlayer.cpp:
979         (WebCore::MediaPlayer::setShouldPlayToPlaybackTarget):
980         (WebCore::MediaPlayer::startPlayingToPlaybackTarget): Deleted.
981         (WebCore::MediaPlayer::stopPlayingToPlaybackTarget): Deleted.
982         * platform/graphics/MediaPlayer.h:
983         * platform/graphics/MediaPlayerPrivate.h:
984         (WebCore::MediaPlayerPrivateInterface::setShouldPlayToPlaybackTarget):
985         (WebCore::MediaPlayerPrivateInterface::startPlayingToPlaybackTarget): Deleted.
986         (WebCore::MediaPlayerPrivateInterface::stopPlayingToPlaybackTarget): Deleted.
987         * platform/graphics/avfoundation/WebMediaSessionManagerMac.cpp: Added.
988         (WebCore::WebMediaSessionManagerMac::singleton):
989         (WebCore::WebMediaSessionManagerMac::WebMediaSessionManagerMac):
990         (WebCore::WebMediaSessionManagerMac::~WebMediaSessionManagerMac):
991         (WebCore::WebMediaSessionManagerMac::targetPicker):
992         * platform/graphics/avfoundation/WebMediaSessionManagerMac.h: Added.
993         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
994         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
995         (WebCore::MediaPlaybackTargetPickerMac::currentDeviceDidChange):
996         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
997         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
998         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
999         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget):
1000         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget):
1001         (WebCore::MediaPlayerPrivateAVFoundationObjC::startPlayingToPlaybackTarget): Deleted.
1002         (WebCore::MediaPlayerPrivateAVFoundationObjC::stopPlayingToPlaybackTarget): Deleted.
1003         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1004         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1005         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setShouldPlayToPlaybackTarget):
1006         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::togglePlayingToPlaybackTarget): Deleted.
1007         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::startPlayingToPlaybackTarget): Deleted.
1008         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::stopPlayingToPlaybackTarget): Deleted.
1009         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
1010         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
1011         (WebCore::MediaPlayerPrivateQTKit::setShouldPlayToPlaybackTarget):
1012         (WebCore::MediaPlayerPrivateQTKit::togglePlayingToPlaybackTarget): Deleted.
1013         (WebCore::MediaPlayerPrivateQTKit::startPlayingToPlaybackTarget): Deleted.
1014         (WebCore::MediaPlayerPrivateQTKit::stopPlayingToPlaybackTarget): Deleted.
1015         * testing/Internals.cpp:
1016         (WebCore::Internals::isPagePlayingAudio):
1017
1018 2015-04-21  Myles C. Maxfield  <mmaxfield@apple.com>
1019
1020         [iOS] When computing visible rects for tiling, stop searching at UIWindows
1021         https://bugs.webkit.org/show_bug.cgi?id=144022
1022         <rdar://problem/18327227>
1023
1024         Reviewed by Simon Fraser.
1025
1026         [WAKWindow _visibleRectRespectingMasksToBounds:] computes a visible rect which we use
1027         to determine which tiles to create. We do this by finding the frame of the _hostLayer,
1028         and then walking up the CALayer hierarchy converting each rect into its parent's
1029         coordinate system (all the while clipping to bounds if necessary). This walk up the
1030         layer hierarchy should stop at a layer associated with a UIWindow.
1031
1032         * platform/ios/wak/WAKWindow.mm:
1033         (-[WAKWindow _visibleRectRespectingMasksToBounds:]):
1034
1035 2015-04-21  Jinwoo Song  <jinwoo7.song@samsung.com>
1036
1037         [Cairo] Implement Path::addPath
1038         https://bugs.webkit.org/show_bug.cgi?id=130580
1039
1040         Reviewed by Dirk Schulze.
1041
1042         Add support for addPath method for ports using cairo.
1043         This patch is originally authored by Jae Hyun Park <jaepark@webkit.org>.
1044
1045         Test: fast/canvas/canvas-path-addPath.html
1046
1047         * platform/graphics/cairo/PathCairo.cpp:
1048         (WebCore::Path::addPath): Implement addPath for cairo.
1049
1050 2015-04-21  Tim Horton  <timothy_horton@apple.com>
1051
1052         Fix the iOS build.
1053
1054         * platform/spi/cg/CoreGraphicsSPI.h:
1055
1056 2015-04-21  Said Abou-Hallawa  <sabouhallawa@apple.com>
1057
1058         SVGAnimateElementBase::calculateAnimatedValue() asserts when reinserting an SVG animating element within the same animation limits
1059         https://bugs.webkit.org/show_bug.cgi?id=143994
1060
1061         Reviewed by Simon Fraser.
1062
1063         Make sure the SVG animation variables are reset cleanly such that if the
1064         animation restarts it can rebuild its limit values reliably and correctly.
1065
1066         Tests: svg/animations/crash-reinsert-animate-length-same-limits.svg
1067                svg/animations/crash-reinsert-animate-transform-same-limits.svg
1068
1069         * svg/SVGAnimateElementBase.h:
1070         * svg/SVGAnimateElementBase.cpp:
1071         (WebCore::SVGAnimateElementBase::resetAnimatedPropertyType):
1072         Call the base class resetAnimatedPropertyType() from the derived class.
1073
1074         * svg/SVGAnimationElement.h:
1075         * svg/SVGAnimationElement.cpp:
1076         (WebCore::SVGAnimationElement::resetAnimatedPropertyType):
1077         Make resetAnimatedPropertyType() virtual. The implementation of the base
1078         class of this function resets the values of the animation limits. When
1079         updateAnimation() is called, it will be forced to recalculate the animation
1080         limits by calling calculateFromAndToValues() even if the limits have not
1081         changed.
1082
1083 2015-04-21  Tim Horton  <timothy_horton@apple.com>
1084
1085         Long pause under _takeViewSnapshot when screen updates are disabled
1086         https://bugs.webkit.org/show_bug.cgi?id=144017
1087         <rdar://problem/20548397>
1088
1089         Reviewed by Simon Fraser.
1090
1091         * platform/spi/cg/CoreGraphicsSPI.h:
1092         Add some SPI.
1093
1094 2015-04-21  Commit Queue  <commit-queue@webkit.org>
1095
1096         Unreviewed, rolling out r183077.
1097         https://bugs.webkit.org/show_bug.cgi?id=144021
1098
1099         broke a bunch of tests, bfulgham is going to try again
1100         (Requested by thorton on #webkit).
1101
1102         Reverted changeset:
1103
1104         "Context menu doesn't account for selection semantics"
1105         https://bugs.webkit.org/show_bug.cgi?id=143958
1106         http://trac.webkit.org/changeset/183077
1107
1108 2015-04-21  Chris Dumez  <cdumez@apple.com>
1109
1110         [WK2][NetworkCache] Better account of resource revalidations in efficacy logging
1111         https://bugs.webkit.org/show_bug.cgi?id=144014
1112
1113         Reviewed by Antti Koivisto.
1114
1115         Add additional diagnostic logging key for network cache efficacy
1116         logging.
1117
1118         * page/DiagnosticLoggingKeys.cpp:
1119         (WebCore::DiagnosticLoggingKeys::needsRevalidationKey):
1120         * page/DiagnosticLoggingKeys.h:
1121
1122 2015-04-21  Brent Fulgham  <bfulgham@apple.com>
1123
1124         Context menu doesn't account for selection semantics
1125         https://bugs.webkit.org/show_bug.cgi?id=143958
1126         <rdar://problem/19735706>
1127
1128         Reviewed by Tim Horton.
1129
1130         Before using the default word-only selection, check with the
1131         lookup service to see if we can get a semantically appropriate
1132         selection.
1133
1134         * page/EventHandler.cpp:
1135         (WebCore::EventHandler::selectClosestWordFromHitTestResultBasedOnLookup):
1136         (WebCore::EventHandler::selectClosestWordFromHitTestResult):
1137         * page/EventHandler.h:
1138         * page/mac/EventHandlerMac.mm:
1139         (WebCore::EventHandler::selectClosestWordFromHitTestResultBasedOnLookup):
1140
1141 2015-04-21  Anders Carlsson  <andersca@apple.com>
1142
1143         Get rid of an unneeded function from LoaderNSURLExtras.mm
1144         https://bugs.webkit.org/show_bug.cgi?id=144003
1145
1146         Reviewed by Chris Dumez.
1147
1148         Just use Vector::contains instead of vectorContainsString.
1149
1150         * loader/mac/LoaderNSURLExtras.mm:
1151         (suggestedFilenameWithMIMEType):
1152         (vectorContainsString): Deleted.
1153
1154 2015-04-21  Chris Dumez  <cdumez@apple.com>
1155
1156         Make Vector(const Vector<T, otherCapacity, otherOverflowBehaviour>&) constructor explicit
1157         https://bugs.webkit.org/show_bug.cgi?id=143970
1158
1159         Reviewed by Darin Adler.
1160
1161         Make Vector(const Vector<T, otherCapacity, otherOverflowBehaviour>&)
1162         constructor explicit as it copies the vector and it is easy to call it
1163         by mistake.
1164
1165         * Modules/indexeddb/IDBDatabaseBackend.cpp:
1166         (WebCore::IDBDatabaseBackend::setIndexKeys):
1167         (WebCore::IDBDatabaseBackend::setIndexesReady):
1168         * Modules/indexeddb/IDBDatabaseBackend.h:
1169         * Modules/indexeddb/IDBServerConnection.h:
1170         * cssjit/SelectorCompiler.cpp:
1171         (WebCore::SelectorCompiler::minimumRegisterRequirements):
1172         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasClasses):
1173         * cssjit/StackAllocator.h:
1174         (WebCore::StackAllocator::push):
1175         (WebCore::StackAllocator::pop):
1176         * rendering/RenderGrid.cpp:
1177         (WebCore::RenderGrid::GridIterator::nextGridItem):
1178         (WebCore::RenderGrid::GridIterator::isEmptyAreaEnough):
1179         * rendering/style/SVGRenderStyle.cpp:
1180         (WebCore::SVGRenderStyle::paintTypesForPaintOrder):
1181         * rendering/style/SVGRenderStyle.h:
1182         * rendering/svg/RenderSVGShape.cpp:
1183         (WebCore::RenderSVGShape::fillStrokeMarkers):
1184         * rendering/svg/SVGInlineTextBox.cpp:
1185         (WebCore::SVGInlineTextBox::paint):
1186         * svg/SVGToOTFFontConversion.cpp:
1187         (WebCore::SVGToOTFFontConverter::appendLigatureGlyphs):
1188         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):
1189
1190 2015-04-21  Chris Dumez  <cdumez@apple.com>
1191
1192         Use ASSERT_WITH_SECURITY_IMPLICATION() for NoEventDispatchAssertion
1193         https://bugs.webkit.org/show_bug.cgi?id=143971
1194
1195         Reviewed by Darin Adler.
1196
1197         Use ASSERT_WITH_SECURITY_IMPLICATION() for NoEventDispatchAssertion as
1198         firing JS events can cause arbitrary JS execution which often leads to
1199         security bugs when event firing is forbidden. For e.g. firing events
1200         from ActiveDOMObject::suspend() means JS can construct or destroy
1201         ActiveDOMObjects while we are iterating over them.
1202
1203         * dom/ContainerNode.cpp:
1204         (WebCore::dispatchChildInsertionEvents):
1205         (WebCore::dispatchChildRemovalEvents):
1206         * dom/ContainerNodeAlgorithms.h:
1207         (WebCore::ChildNodeInsertionNotifier::notify):
1208         * dom/Document.cpp:
1209         (WebCore::Document::dispatchWindowEvent):
1210         (WebCore::Document::dispatchWindowLoadEvent):
1211         * dom/Element.cpp:
1212         (WebCore::Element::dispatchFocusInEvent):
1213         (WebCore::Element::dispatchFocusOutEvent):
1214         * dom/EventDispatcher.cpp:
1215         (WebCore::EventDispatcher::dispatchEvent):
1216         * dom/EventTarget.cpp:
1217         (WebCore::EventTarget::fireEventListeners):
1218         * dom/Node.cpp:
1219         (WebCore::Node::dispatchSubtreeModifiedEvent):
1220         (WebCore::Node::dispatchDOMActivateEvent):
1221         * dom/ScriptExecutionContext.cpp:
1222         (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForPageCache):
1223         (WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
1224         (WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
1225         (WebCore::ScriptExecutionContext::stopActiveDOMObjects):
1226         (WebCore::ScriptExecutionContext::willDestroyActiveDOMObject):
1227         * dom/WebKitNamedFlow.cpp:
1228         (WebCore::WebKitNamedFlow::dispatchRegionOversetChangeEvent):
1229
1230 2015-04-21  Darin Adler  <darin@apple.com>
1231
1232         Remove some stray uses of OwnPtr and PassOwnPtr in WTF (outside of the template definitions and traits)
1233         https://bugs.webkit.org/show_bug.cgi?id=143944
1234
1235         Reviewed by Andreas Kling.
1236
1237         * editing/ios/DictationCommandIOS.h: Added now-needed include of PassOwnPtr.h.
1238
1239 2015-04-20  Simon Fraser  <simon.fraser@apple.com>
1240
1241         REGRESSION (r177494): -webkit-mask-image: with data URI fails on non-local files
1242         https://bugs.webkit.org/show_bug.cgi?id=141857
1243
1244         Reviewed by Dirk Schulze.
1245         
1246         r177494 regressed loading of data URIs in masks with remote content, triggering
1247         a cross-domain error which occurs because the mask loading happened via a separate
1248         SVGDocument.
1249         
1250         Fix by checking for data URIs at parsing time, which is what we used to do.
1251
1252         Test: http/tests/css/data-uri-mask.html
1253
1254         * css/CSSParser.cpp:
1255         (WebCore::CSSParser::parseMaskImage):
1256         * svg/SVGURIReference.h:
1257         (WebCore::SVGURIReference::isExternalURIReference):
1258
1259 2015-04-20  Chris Dumez  <cdumez@apple.com>
1260
1261         Crash when showing Web Inspector on page with 'multipart/x-mixed-replace' main resource
1262         https://bugs.webkit.org/show_bug.cgi?id=143979
1263         <rdar://problem/20594948>
1264
1265         Reviewed by Timothy Hatcher.
1266
1267         InspectorDOMAgent::m_document was updated only once per load, from
1268         FrameLoader::dispatchDidCommitLoad(). However, dispatchDidCommitLoad()
1269         is not called for follow-up multipart replacing loads. You can see this
1270         from the following check in DocumentLoader::commitData():
1271             if (!isMultipartReplacingLoad())
1272                 frameLoader()->receivedFirstData();
1273
1274         As a result, in the case of a 'multipart/x-mixed-replace' main resource
1275         InspectorDOMAgent::m_document would quickly get outdated as we create
1276         a new Document for each replacing load. This would lead to Web Inspector
1277         code using a Document without frame and causing crashes.
1278
1279         This patch calls InspectorInstrumentation::frameDocumentUpdated() from
1280         Frame::setDocument() so that InspectorDOMAgent::m_document is always up
1281         to date.
1282
1283         No new tests, not easily testable as the main resource needs to be
1284         'multipart/x-mixed-replace'.
1285
1286         * dom/Document.cpp:
1287         (WebCore::Document::applyXSLTransform):
1288         Stop calling InspectorInstrumentation::frameDocumentUpdated() here as
1289         XSLTProcessor::createDocumentFromSource() will call Frame::setDocument()
1290         and frameDocumentUpdated() will be called there.
1291
1292         * page/Frame.cpp:
1293         (WebCore::Frame::setDocument):
1294         Call InspectorInstrumentation::frameDocumentUpdated() to make sure
1295         InspectorDOMAgent::m_document gets updated.
1296
1297 2015-04-20  Alex Christensen  <achristensen@webkit.org>
1298
1299         Overwrite existing files with moveFile.
1300         https://bugs.webkit.org/show_bug.cgi?id=143968
1301
1302         Reviewed by Brady Eidson and Anders Carlsson.
1303
1304         * platform/mac/FileSystemMac.mm:
1305         (-[WebFileManagerDelegate fileManager:shouldProceedAfterError:movingItemAtURL:toURL:]):
1306         (WebCore::moveFile):
1307         r182932 introduced moveFile instead of renameFile.  In order to preserve behavior, it should overwrite existing files.
1308
1309 2015-04-20  Joseph Pecoraro  <pecoraro@apple.com>
1310
1311         Unreviewed Windows build fix after r183031.
1312
1313         * platform/graphics/OpenGLShims.cpp:
1314         (WebCore::lookupOpenGLFunctionAddress):
1315         Windows needs an explicit cast converting LChar* to const char*.
1316         Also, add a FIXME comment for sketchy behavior.
1317
1318 2015-04-20  Joseph Pecoraro  <pecoraro@apple.com>
1319
1320         Cleanup some StringBuilder use
1321         https://bugs.webkit.org/show_bug.cgi?id=143550
1322
1323         Reviewed by Darin Adler.
1324
1325         * Modules/plugins/YouTubePluginReplacement.cpp:
1326         (WebCore::YouTubePluginReplacement::youTubeURL):
1327         * css/CSSAnimationTriggerScrollValue.cpp:
1328         (WebCore::CSSAnimationTriggerScrollValue::customCSSText):
1329         * css/CSSCanvasValue.cpp:
1330         (WebCore::CSSCanvasValue::customCSSText):
1331         * html/HTMLCanvasElement.cpp:
1332         (WebCore::HTMLCanvasElement::createImageBuffer):
1333         * page/CaptionUserPreferencesMediaAF.cpp:
1334         (WebCore::CaptionUserPreferencesMediaAF::captionsWindowCSS):
1335         (WebCore::CaptionUserPreferencesMediaAF::windowRoundedCornerRadiusCSS):
1336         (WebCore::CaptionUserPreferencesMediaAF::cssPropertyWithTextEdgeColor):
1337         (WebCore::CaptionUserPreferencesMediaAF::colorPropertyCSS):
1338         (WebCore::CaptionUserPreferencesMediaAF::captionsDefaultFontCSS):
1339         (WebCore::CaptionUserPreferencesMediaAF::captionsStyleSheetOverride):
1340         * page/EventSource.cpp:
1341         (WebCore::EventSource::didReceiveResponse):
1342         * page/PageSerializer.cpp:
1343         (WebCore::PageSerializer::serializeCSSStyleSheet):
1344         * platform/graphics/OpenGLShims.cpp:
1345         (WebCore::lookupOpenGLFunctionAddress):
1346         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
1347         (WebCore::InbandTextTrackPrivateAVF::processCueAttributes):
1348         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1349         (WebCore::generateHashedName):
1350         * platform/text/DateTimeFormat.cpp:
1351         (WebCore::DateTimeFormat::quoteAndAppendLiteral):
1352         * rendering/RenderLayerCompositor.cpp:
1353         (WebCore::RenderLayerCompositor::logLayerInfo):
1354         * rendering/RenderTreeAsText.cpp:
1355         (WebCore::writeRenderRegionList):
1356         * testing/MicroTaskTest.cpp:
1357         (WebCore::MicroTaskTest::run):
1358         * testing/MockContentFilterSettings.cpp:
1359         (WebCore::MockContentFilterSettings::unblockRequestURL):
1360
1361 2015-04-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
1362
1363         SVGFitToViewBox::viewBoxToViewTransform() has to count for zero physical width and height before calling SVGPreserveAspectRatio::getCTM()
1364         https://bugs.webkit.org/show_bug.cgi?id=143903
1365
1366         Reviewed by Daniel Bates.
1367
1368         Ensure that the SVG viewBoxToView transformation is always invertible.
1369         CG path drawing functions crash if the context is transformed to non-
1370         invertible matrix.
1371
1372         Tests: svg/css/crash-path-zero-height-viewbox.svg
1373                svg/css/crash-path-zero-width-viewbox.svg
1374
1375         * svg/SVGFitToViewBox.cpp:
1376         (WebCore::SVGFitToViewBox::viewBoxToViewTransform):
1377         Do not call SVGPreserveAspectRatio::getCTM() if the physical width or the
1378         physical height is zero.
1379
1380         * svg/SVGPreserveAspectRatio.cpp:
1381         (WebCore::SVGPreserveAspectRatio::getCTM):
1382         Ensure that we are not dividing by zero in this function.
1383
1384 2015-04-20  Chris Dumez  <cdumez@apple.com>
1385
1386         CSSParser::parseValue() copies the m_parsedProperties vector at addParsedProperties()
1387         https://bugs.webkit.org/show_bug.cgi?id=143925
1388
1389         Reviewed by Simon Fraser.
1390
1391         Update MutableStyleProperties::addParsedProperties() to use
1392         CSSParser::ParsedPropertyVector type (i.e. Vector<CSSProperty, 256>)
1393         instead of Vector<CSSProperty> so that the properties vector is no
1394         longer copied unnecessarily to convert one type to the other.
1395
1396         * css/CSSParser.h:
1397         * css/StyleProperties.cpp:
1398         (WebCore::MutableStyleProperties::addParsedProperties):
1399         * css/StyleProperties.h:
1400
1401 2015-04-20  Beth Dakin  <bdakin@apple.com>
1402
1403         Should remove mouseForceClick and mouseForceCancelled from DOM force events
1404         https://bugs.webkit.org/show_bug.cgi?id=143904
1405         -and corresponding-
1406         rdar://problem/20578842
1407
1408         Reviewed by Dan Bernstein.
1409
1410         After more thought and discussion, we decided to remove mouseForceClick and 
1411         mouseForceCancelled from DOM force events. mouseForceClick is confusing and 
1412         redundant. mouseForceCancelled is confusing as it is currently implemented, and 
1413         all of its functionality can be filled by exisiting events such as mouseup, 
1414         mouseout, etc.
1415
1416         * dom/Document.cpp:
1417         (WebCore::Document::addListenerTypeIfNeeded):
1418         * dom/Document.h:
1419         * dom/Document.idl:
1420         * dom/Element.cpp:
1421         (WebCore::Element::dispatchMouseForceWillBegin):
1422         (WebCore::Element::dispatchMouseForceClick): Deleted.
1423         (WebCore::Element::dispatchMouseForceCancelled): Deleted.
1424         * dom/Element.h:
1425         * dom/Element.idl:
1426         * dom/EventNames.h:
1427         * html/HTMLAttributeNames.in:
1428         * html/HTMLBodyElement.cpp:
1429         (WebCore::HTMLBodyElement::createWindowEventHandlerNameMap):
1430         * html/HTMLBodyElement.idl:
1431         * html/HTMLElement.cpp:
1432         (WebCore::HTMLElement::createEventHandlerNameMap):
1433         * page/DOMWindow.idl:
1434
1435 2015-04-20  Simon Fraser  <simon.fraser@apple.com>
1436
1437         Setting inline style to the same value it already has triggers a style recalc
1438         https://bugs.webkit.org/show_bug.cgi?id=143922
1439
1440         Reviewed by Antti Koivisto.
1441
1442         MutableStyleProperties::setProperty() was taking the result of CSSParser::parseValue()
1443         to mean "parsing changed the style", but it actually just means "parsing succeeded".
1444         Add a new out param, piped through various parser functions, to indicate whether
1445         parsing actually changed style, and instead return that from setProperty().
1446
1447         Add internals.startTrackingStyleRecalcs() and internals.styleRecalcCount() so
1448         we can write tests for style recalc.
1449
1450         Test: fast/css/set-inline-style-recalc.html
1451
1452         * WebCore.xcodeproj/project.pbxproj: Let Xcode have it's way.
1453         * css/CSSParser.cpp:
1454         (WebCore::parseColorValue):
1455         (WebCore::parseSimpleLengthValue):
1456         (WebCore::parseKeywordValue):
1457         (WebCore::parseTranslateTransformValue):
1458         (WebCore::CSSParser::parseFontFaceValue):
1459         (WebCore::CSSParser::parseValue):
1460         * css/CSSParser.h:
1461         * css/CSSProperty.h:
1462         (WebCore::StylePropertyMetadata::operator==):
1463         (WebCore::CSSProperty::operator==):
1464         * css/DOMWindowCSS.cpp:
1465         (WebCore::DOMWindowCSS::supports):
1466         * css/StyleProperties.cpp:
1467         (WebCore::MutableStyleProperties::setProperty):
1468         (WebCore::MutableStyleProperties::appendPrefixingVariantProperty):
1469         (WebCore::MutableStyleProperties::addParsedProperties):
1470         (WebCore::MutableStyleProperties::addParsedProperty):
1471         * css/StyleProperties.h:
1472         * css/WebKitCSSMatrix.cpp:
1473         (WebCore::WebKitCSSMatrix::setMatrixValue):
1474         * dom/Document.cpp:
1475         (WebCore::Document::recalcStyle):
1476         (WebCore::Document::startTrackingStyleRecalcs):
1477         (WebCore::Document::styleRecalcCount):
1478         * dom/Document.h:
1479         * html/canvas/CanvasRenderingContext2D.cpp:
1480         (WebCore::CanvasRenderingContext2D::setFont):
1481         * testing/Internals.cpp:
1482         (WebCore::Internals::startTrackingStyleRecalcs):
1483         (WebCore::Internals::styleRecalcCount):
1484         * testing/Internals.h:
1485         * testing/Internals.idl:
1486
1487 2015-04-20  Brady Eidson  <beidson@apple.com>
1488
1489         Crash in StyleResolver::invalidateMatchedPropertiesCache() when using content extensions.
1490         <rdar://problem/20554405> and https://bugs.webkit.org/show_bug.cgi?id=143892
1491
1492         Reviewed by Chris Dumez.
1493
1494         Test: http/tests/contentextensions/style-resolver-changed-reentrancy.html
1495
1496         * contentextensions/ContentExtensionsBackend.cpp:
1497         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
1498
1499         * dom/DocumentStyleSheetCollection.cpp:
1500         (WebCore::DocumentStyleSheetCollection::DocumentStyleSheetCollection):
1501         (WebCore::DocumentStyleSheetCollection::addContentExtensionUserSheet): Call styleResolverChanged on a delay.
1502         (WebCore::DocumentStyleSheetCollection::maybeAddContentExtensionSheet): Ditto.
1503         (WebCore::DocumentStyleSheetCollection::styleResolverChangedTimerFired):
1504         * dom/DocumentStyleSheetCollection.h:
1505
1506 2015-04-20  Per Arne Vollan  <peavo@outlook.com>
1507
1508         Favicons are not always loaded.
1509         https://bugs.webkit.org/show_bug.cgi?id=143880
1510
1511         Reviewed by Darin Adler.
1512
1513         If the favicon link element(s) in the document does not have a mime type,
1514         the favicon is loaded from the domain root (/favicon.ico). If no favicon
1515         exists at this location, the favicon loading will fail. This can be solved
1516         by not demanding that the link element has a mime type.
1517
1518         Test: fast/dom/icon-url-without-mimetype.html
1519
1520         * loader/icon/IconController.cpp:
1521         (WebCore::iconFromLinkElements): Return the chosen icon URL instead of a vector of URLs.
1522         (WebCore::IconController::url):
1523         (WebCore::iconsFromLinkElements): Deleted.
1524
1525 2015-04-20  Martin Robinson  <mrobinson@igalia.com>
1526
1527         [CMake] Include ICU unconditionally on the source lists
1528         https://bugs.webkit.org/show_bug.cgi?id=143900
1529
1530         Reviewed by Darin Adler.
1531
1532         No new tests. This is just a build file change.
1533
1534         * CMakeLists.txt: Integrate ICU source files, includes, and libraries into the main
1535         sections. They are shared by all platforms.
1536         * PlatformGTK.cmake: Eliminate build rules that are duplicated from the main CMakeLists.txt.
1537
1538 2015-04-20  Chris Fleizach  <cfleizach@apple.com>
1539
1540         AX: iOS: Text input field ignores value of read-only and aria-readonly attributes
1541         https://bugs.webkit.org/show_bug.cgi?id=143946
1542
1543         Reviewed by Mario Sanchez Prada.
1544
1545         Expose an existing method for determining whether the value can be set to the iOS accessibility platform.
1546
1547         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1548         (-[WebAccessibilityObjectWrapper accessibilityCanSetValue]):
1549
1550 2015-04-20  Andreas Kling  <akling@apple.com>
1551
1552         Merge TreeShared into Node.
1553         <https://webkit.org/b/143942>
1554
1555         Reviewed by Darin Adler.
1556
1557         Node was the only remaining user of TreeShared, so just fold the class into Node.
1558
1559         * WebCore.vcxproj/WebCore.vcxproj:
1560         * WebCore.vcxproj/WebCore.vcxproj.filters:
1561         * WebCore.xcodeproj/project.pbxproj:
1562         * dom/Node.cpp:
1563         (WebCore::Node::Node):
1564         (WebCore::Node::~Node):
1565         * dom/Node.h:
1566         (WebCore::Node::ref):
1567         (WebCore::Node::deref):
1568         (WebCore::Node::hasOneRef):
1569         (WebCore::Node::refCount):
1570         (WebCore::adopted):
1571         (WebCore::Node::hasTreeSharedParent): Deleted.
1572         * platform/TreeShared.h: Removed.
1573
1574 2015-04-19  Benjamin Poulain  <benjamin@webkit.org>
1575
1576         Improve the feature.json files
1577
1578         * features.json:
1579
1580 2015-04-18  Jon Lee  <jonlee@apple.com>
1581
1582         [Mac] Time elapsed should be right-aligned
1583         https://bugs.webkit.org/show_bug.cgi?id=143927
1584
1585         Reviewed by Eric Carlson.
1586
1587         Current time is left-aligned, which is visually jarring when going from < 1 hour to > 1 hour.
1588
1589         * Modules/mediacontrols/mediaControlsApple.css:
1590         (audio::-webkit-media-controls-current-time-display): Set justify-content to flex-end.
1591         (audio::-webkit-media-controls-time-remaining-display): Explicitly set justify-content to flex-start.
1592
1593 2015-04-18  Simon Fraser  <simon.fraser@apple.com>
1594
1595         REGRESSION (r181656): Animated tiled layers are missing content
1596         https://bugs.webkit.org/show_bug.cgi?id=143911
1597         rdar://problem/20596328
1598
1599         Reviewed by Darin Adler.
1600
1601         After r181656, all requestAnimationFrame was falling back to timers, and not
1602         using the platform's DisplayRefreshMonitor, because of a Nullopt vs nullptr
1603         fumble. As a result, GraphicsLayerUpdater (which updates tiled layers during
1604         animations) was failing to do any updates.
1605         
1606         Replace this confusing Optional<> code with simpler code that just forces the
1607         clients to make a DisplayRefreshMonitor if they can, first asking
1608         ChromeClient, and then falling back to createDefaultDisplayRefreshMonitor().
1609         
1610         Make lots of things into references, and use C++11 initialization in some places.
1611         
1612         Add Internals API to allow a test to get the number of layer flushes that have
1613         occurred.
1614         
1615         * dom/ScriptedAnimationController.cpp:
1616         (WebCore::ScriptedAnimationController::ScriptedAnimationController):
1617         (WebCore::ScriptedAnimationController::windowScreenDidChange):
1618         (WebCore::ScriptedAnimationController::scheduleAnimation):
1619         (WebCore::ScriptedAnimationController::createDisplayRefreshMonitor):
1620         * dom/ScriptedAnimationController.h:
1621         * page/ChromeClient.h:
1622         * platform/graphics/DisplayRefreshMonitor.cpp:
1623         (WebCore::DisplayRefreshMonitor::createDefaultDisplayRefreshMonitor):
1624         (WebCore::DisplayRefreshMonitor::create):
1625         (WebCore::DisplayRefreshMonitor::addClient):
1626         (WebCore::DisplayRefreshMonitor::removeClient):
1627         (WebCore::DisplayRefreshMonitor::displayDidRefresh):
1628         * platform/graphics/DisplayRefreshMonitor.h:
1629         * platform/graphics/DisplayRefreshMonitorClient.cpp:
1630         (WebCore::DisplayRefreshMonitorClient::~DisplayRefreshMonitorClient):
1631         * platform/graphics/DisplayRefreshMonitorClient.h:
1632         * platform/graphics/DisplayRefreshMonitorManager.cpp:
1633         (WebCore::DisplayRefreshMonitorManager::createMonitorForClient):
1634         (WebCore::DisplayRefreshMonitorManager::registerClient):
1635         (WebCore::DisplayRefreshMonitorManager::unregisterClient):
1636         (WebCore::DisplayRefreshMonitorManager::scheduleAnimation):
1637         (WebCore::DisplayRefreshMonitorManager::displayDidRefresh):
1638         (WebCore::DisplayRefreshMonitorManager::windowScreenDidChange):
1639         * platform/graphics/DisplayRefreshMonitorManager.h:
1640         * platform/graphics/GraphicsLayerUpdater.cpp:
1641         (WebCore::GraphicsLayerUpdater::GraphicsLayerUpdater):
1642         (WebCore::GraphicsLayerUpdater::scheduleUpdate):
1643         (WebCore::GraphicsLayerUpdater::screenDidChange):
1644         (WebCore::GraphicsLayerUpdater::displayRefreshFired):
1645         (WebCore::GraphicsLayerUpdater::createDisplayRefreshMonitor):
1646         * platform/graphics/GraphicsLayerUpdater.h:
1647         * rendering/RenderLayerCompositor.cpp:
1648         (WebCore::RenderLayerCompositor::RenderLayerCompositor):
1649         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
1650         (WebCore::RenderLayerCompositor::notifyFlushBeforeDisplayRefresh):
1651         (WebCore::RenderLayerCompositor::flushLayersSoon):
1652         (WebCore::RenderLayerCompositor::createDisplayRefreshMonitor):
1653         (WebCore::RenderLayerCompositor::startTrackingLayerFlushes):
1654         (WebCore::RenderLayerCompositor::layerFlushCount):
1655         * rendering/RenderLayerCompositor.h:
1656         * testing/Internals.cpp:
1657         (WebCore::Internals::startTrackingLayerFlushes):
1658         (WebCore::Internals::layerFlushCount):
1659         * testing/Internals.h:
1660         * testing/Internals.idl:
1661
1662 2015-04-17  Bem Jones-Bey  <bjonesbe@adobe.com>
1663
1664         Large values for line-height cause integer overflow in RenderStyle::computedLineHeight
1665         https://bugs.webkit.org/show_bug.cgi?id=143863
1666
1667         Reviewed by Rob Buis.
1668
1669         When we compute huge values for line-height through percentage or CSS
1670         calc, we'll overflow the integer and later on
1671         ShapeOutsideInfo::computeDeltasForContainingBlockLine will ASSERT
1672         because it expects non-negative line height.  So for the computed
1673         line-height, clamp to an integer range to avoid overflow. Note that
1674         the code path for percentages here is safe because LayoutUnit clamps
1675         to an int on conversion.
1676
1677         This is based on a Blink patch by Rob Buis.
1678
1679         Test: fast/shapes/shape-outside-floats/shape-outside-negative-line-height-crash.html
1680
1681         * rendering/style/RenderStyle.cpp:
1682         (WebCore::RenderStyle::computedLineHeight): Clamp line-height to an
1683             int to avoid overflow.
1684
1685 2015-04-17  Beth Dakin  <bdakin@apple.com>
1686
1687         Force mouse events should go through normal mouse event handling code paths
1688         https://bugs.webkit.org/show_bug.cgi?id=143749
1689         -and corresponding-
1690         rdar://problem/20472895
1691
1692         Reviewed by Dean Jackson.
1693
1694         This patch moves all of the code to dispatch mouseforcedown, mouseforceup, and 
1695         mouseforcechanged into normal mouse event dispatching code. This patch leaves 
1696         behind the cancel and click events because we plan to remove those, and it also 
1697         leaves mouseforcewillbegin because that is necessarily a very different event more 
1698         tied to the NSImmediateActionGestureRecognizer than these other events which are 
1699         tied to NSResponder’s pressureChangeWithEvent.
1700
1701         New helper functions.
1702         * dom/Document.cpp:
1703         (WebCore::Document::hasListenerTypeForEventType):
1704         * dom/Document.h:
1705         * dom/Element.cpp:
1706         (WebCore::isForceEvent):
1707
1708         Move the code to ensure the force events have listeners in order to fire to 
1709         dispatchMouseEvent, and delete the old implementations.
1710         (WebCore::Element::dispatchMouseEvent):
1711         (WebCore::Element::dispatchMouseForceChanged): Deleted.
1712         (WebCore::Element::dispatchMouseForceDown): Deleted.
1713         (WebCore::Element::dispatchMouseForceUp): Deleted.
1714         * dom/Element.h:
1715
1716         Perform a hit test and pipe the events through dispatchMouseEvent(). 
1717         * page/EventHandler.cpp:
1718         (WebCore::EventHandler::handleMouseForceEvent):
1719         * page/EventHandler.h:
1720
1721         New types for the new events.
1722         * platform/PlatformEvent.h:
1723
1724         Forward to EventHandler. 
1725         * replay/UserInputBridge.cpp:
1726         (WebCore::UserInputBridge::handleMouseForceEvent):
1727         * replay/UserInputBridge.h:
1728
1729 2015-04-17  Zalan Bujtas  <zalan@apple.com>
1730
1731         RenderTableCell::computeCollapsed*Border() should check if the cell is still attached to the render tree.
1732         https://bugs.webkit.org/show_bug.cgi?id=143887
1733         rdar://problem/20568989
1734
1735         Reviewed by Simon Fraser.
1736
1737         Detached table cell has no access to its parent table. This is a speculative fix to
1738         avoid dereferencing the invalid table pointer.
1739
1740         * rendering/RenderTableCell.cpp:
1741         (WebCore::RenderTableCell::computeCollapsedStartBorder):
1742         (WebCore::RenderTableCell::computeCollapsedEndBorder):
1743         (WebCore::RenderTableCell::computeCollapsedBeforeBorder):
1744         (WebCore::RenderTableCell::computeCollapsedAfterBorder):
1745
1746 2015-04-16  Roger Fong  <roger_fong@apple.com>
1747
1748         Update fullscreen button visibility on fullscreen change.
1749         https://bugs.webkit.org/show_bug.cgi?id=143861.
1750         <rdar://problem/20143218>
1751
1752         Reviewed by Eric Carlson.
1753
1754         * Modules/mediacontrols/mediaControlsApple.js:
1755         (Controller): There is no need for hasVisualMedia to be a class variable.
1756         (Controller.prototype.handleReadyStateChange):
1757         (Controller.prototype.handleFullscreenChange):
1758         (Controller.prototype.updateFullscreenButtons):
1759
1760 2015-04-17  Daniel Bates  <dabates@apple.com>
1761
1762         REGRESSION: SVG does not support link dragging
1763         https://bugs.webkit.org/show_bug.cgi?id=141597
1764
1765         Reviewed by Darin Adler.
1766
1767         Fixes an issue where a SVG hyperlink cannot be dragged. We should support
1768         dragging an SVG A element just as we support dragging an HTML A element.
1769
1770         Test: fast/events/drag-and-drop-link.html
1771
1772         * page/DragController.cpp: Removed explicit include of header Element.h as it will
1773         be ultimately included by HTMLAnchorElement.h, among other headers.
1774         (WebCore::isDraggableLink): Added. Extracted code from HitTestResult::isLiveLink().
1775         (WebCore::DragController::draggableElement): Call WebCore::isDraggableLink() to
1776         determine whether a element is a hyperlink that can be dragged.
1777         * page/DragController.h:
1778         * page/EventHandler.cpp:
1779         (WebCore::EventHandler::selectClosestWordOrLinkFromMouseEvent): Write code in terms of
1780          WebCore::isDraggableLink().
1781         * rendering/HitTestResult.cpp:
1782         (WebCore::HitTestResult::isLiveLink): Deleted.
1783         * rendering/HitTestResult.h:
1784
1785 2015-04-17  Commit Queue  <commit-queue@webkit.org>
1786
1787         Unreviewed, rolling out r182912 and r182920.
1788         https://bugs.webkit.org/show_bug.cgi?id=143881
1789
1790         Build breakage in some configurations (Requested by ap on
1791         #webkit).
1792
1793         Reverted changesets:
1794
1795         "Force mouse events should go through normal mouse event
1796         handling code paths"
1797         https://bugs.webkit.org/show_bug.cgi?id=143749
1798         http://trac.webkit.org/changeset/182912
1799
1800         http://trac.webkit.org/changeset/182920
1801
1802 2015-04-17  Said Abou-Hallawa  <sabouhallawa@apple.com>
1803
1804         Fix review comments for https://bugs.webkit.org/show_bug.cgi?id=143590
1805         following http://trac.webkit.org/changeset/182876.
1806
1807         Reviewed by Daniel Bates.
1808
1809         * ChangeLog:
1810         Fixed typo.
1811         
1812         * style/StyleFontSizeFunctions.cpp:
1813         (WebCore::Style::computedFontSizeFromSpecifiedSize):
1814         Fixed a typo in an enum definition and changed the name of an argument.
1815
1816 2015-04-17  Philippe Normand  <pnormand@igalia.com>
1817
1818         [GStreamer] Silent WebAudio buffers support
1819         https://bugs.webkit.org/show_bug.cgi?id=143869
1820
1821         Reviewed by Carlos Garcia Campos.
1822
1823         * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
1824         (webKitWebAudioSrcLoop): Set gap flag on silent buffers. The audio
1825         sink can then drop them and avoid un-necessary buffer processing.
1826
1827 2015-04-17  Carlos Garcia Campos  <cgarcia@igalia.com>
1828
1829         [SOUP] Redirect to non HTTP destination is broken
1830         https://bugs.webkit.org/show_bug.cgi?id=143866
1831
1832         Reviewed by Sergio Villar Senin.
1833
1834         This is because we are passing true unconditionally as
1835         isHTTPFamilyRequest parameter of
1836         createSoupRequestAndMessageForHandle in continueAfterWillSendRequest.
1837         We don't actually need to pass isHTTPFamilyRequest parameter to
1838         createSoupRequestAndMessageForHandle, since it can simply check
1839         that from the given request.
1840
1841         Covered by unit tets and also cache/disk-cache/disk-cache-redirect-to-data.html.
1842
1843         * platform/network/soup/ResourceHandleSoup.cpp:
1844         (WebCore::continueAfterWillSendRequest):
1845         (WebCore::createSoupRequestAndMessageForHandle):
1846         (WebCore::ResourceHandle::start):
1847
1848 2015-04-16  Alex Christensen  <achristensen@webkit.org>
1849
1850         Use less memory when compiling content extensions
1851         https://bugs.webkit.org/show_bug.cgi?id=143857
1852
1853         Reviewed by Benjamin Poulain.
1854
1855         When compiling a content extension, we convert the rule list into several intermediate forms:
1856
1857         1) A String.
1858         2) A JSValue from JSONParse in loadEncodedRules.
1859         3) A Vector of ContentExtensionRules.
1860         4) A CombinedURLFilters object representing the pieces of the regular expressions from the triggers.
1861         5) A Vector of NFAs.
1862         6) A DFA for each NFA.
1863         7) A Vector of DFABytecode.
1864         
1865         Each one of these contains all the information contained in the content extension,
1866         so we do not need to keep them all in memory at the same time like we are doing now.
1867         When we are done with one, we can free that memory to greatly reduce the maximum memory usage while compiling.
1868         The next step will be to reduce the copies of the original JSON String and to generate NFAs one at a time.
1869
1870         * contentextensions/CombinedURLFilters.cpp:
1871         (WebCore::ContentExtensions::CombinedURLFilters::clear):
1872         * contentextensions/CombinedURLFilters.h:
1873         * contentextensions/ContentExtensionCompiler.cpp:
1874         (WebCore::ContentExtensions::compileRuleList):
1875         Clear structures when finished using them.
1876
1877 2015-04-16  Brady Eidson  <beidson@apple.com>
1878
1879         Compiling a content extension fails when user's home directory is on a different volume from /var/tmp.
1880         https://bugs.webkit.org/show_bug.cgi?id=143834
1881
1882         Reviewed by Anders Carlsson.
1883
1884         - Add moveFile() for a WK2 call site to use.
1885         - Remove renameFile() as it is now dead code.
1886
1887         * platform/FileSystem.h:
1888
1889         * platform/gtk/FileSystemGtk.cpp:
1890         (WebCore::renameFile): Deleted.
1891
1892         * platform/mac/FileSystemMac.mm:
1893         (WebCore::moveFile):
1894
1895         * platform/posix/FileSystemPOSIX.cpp:
1896         (WebCore::renameFile): Deleted.
1897
1898         * platform/win/FileSystemWin.cpp:
1899         (WebCore::renameFile): Deleted.
1900
1901 2015-04-16  Roger Fong  <roger_fong@apple.com>
1902
1903         Media element time displays shouldn't wrap.
1904         https://bugs.webkit.org/show_bug.cgi?id=143854.
1905         <rdar://problem/20284766>
1906
1907         Reviewed by Brent Fulgham.
1908
1909         * Modules/mediacontrols/mediaControlsApple.css:
1910         (::-webkit-media-controls): Don't wrap any text.
1911         (audio::-webkit-media-controls-time-remaining-display): Also increase remaining time display width by 1.
1912         (audio::-webkit-media-controls-time-remaining-display.five-digit-time): Ditto.
1913         (audio::-webkit-media-controls-time-remaining-display.six-digit-time): Ditto.
1914
1915 2015-04-16  Chris Dumez  <cdumez@apple.com>
1916
1917         Add assertions to make sure ActiveDOMObject::suspend() / resume() / stop() overrides don't fire events
1918         https://bugs.webkit.org/show_bug.cgi?id=143850
1919
1920         Reviewed by Alexey Proskuryakov.
1921
1922         Add assertions to make sure ActiveDOMObject::suspend() / resume() / stop()
1923         overrides don't fire events as this is not allowed. This would cause
1924         arbitrary JS execution which would be very dangerous in these stages.
1925
1926         Firing JS events from these functions is a common source of crashes.
1927
1928         * Modules/websockets/WebSocket.cpp:
1929         (WebCore::WebSocket::suspend):
1930         (WebCore::WebSocket::resume):
1931         * dom/ScriptExecutionContext.cpp:
1932         (WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
1933         (WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
1934         (WebCore::ScriptExecutionContext::stopActiveDOMObjects):
1935         * xml/XMLHttpRequest.cpp:
1936         (WebCore::XMLHttpRequest::suspend):
1937         (WebCore::XMLHttpRequest::resume):
1938         (WebCore::XMLHttpRequest::stop):
1939
1940 2015-04-16  Brady Eidson  <beidson@apple.com>
1941
1942         Media element can manipulate DOM during Document destruction.
1943         rdar://problem/20553898 and https://bugs.webkit.org/show_bug.cgi?id=143780
1944
1945         Reviewed by Jer Noble.
1946
1947         * html/HTMLMediaElement.cpp:
1948         (WebCore::HTMLMediaElement::configureMediaControls): Bail if the element has no active document.
1949
1950 2015-04-13  Jer Noble  <jer.noble@apple.com>
1951
1952         [iOS] When simultaneously exiting-and-entering fullscreen, WebVideoFullscreenManager/Proxy becomes confused about what video element it represents.
1953         https://bugs.webkit.org/show_bug.cgi?id=143680
1954
1955         Reviewed by Simon Fraser.
1956
1957         Add getters for the video's fullscreen layer, and be more tolerant about the order in which setVideoElement() and 
1958         setWebVideoFullscreenInterface are called.
1959
1960         * html/HTMLMediaElement.h:
1961         (WebCore::HTMLMediaElement::videoFullscreenLayer): Added simple getter.
1962         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
1963         * platform/ios/WebVideoFullscreenModelVideoElement.h:
1964         (WebCore::WebVideoFullscreenModelVideoElement::videoElement): Added simple getter.
1965         (WebCore::WebVideoFullscreenModelVideoElement::setWebVideoFullscreenInterface): Deleted. Moved to .mm file.
1966         * platform/ios/WebVideoFullscreenModelVideoElement.mm:
1967         (WebVideoFullscreenModelVideoElement::WebVideoFullscreenModelVideoElement): Initialize ivars in the .h file.
1968         (WebVideoFullscreenModelVideoElement::setWebVideoFullscreenInterface): Call those methods skipped in setVideoElement()
1969             if m_videoFullscreenInterface had not yet been set.
1970         (WebVideoFullscreenModelVideoElement::setVideoElement): Null-check m_videoFullscreenInterface.
1971
1972 2015-04-16  Beth Dakin  <bdakin@apple.com>
1973
1974         Force mouse events should go through normal mouse event handling code paths
1975         https://bugs.webkit.org/show_bug.cgi?id=143749
1976         -and corresponding-
1977         rdar://problem/20472895
1978
1979         Reviewed by Dean Jackson.
1980
1981         This patch moves all of the code to dispatch mouseforcedown, mouseforceup, and 
1982         mouseforcechanged into normal mouse event dispatching code. This patch leaves 
1983         behind the cancel and click events because we plan to remove those, and it also 
1984         leaves mouseforcewillbegin because that is necessarily a very different event more 
1985         tied to the NSImmediateActionGestureRecognizer than these other events which are 
1986         tied to NSResponder’s pressureChangeWithEvent.
1987
1988         New helper functions.
1989         * dom/Document.cpp:
1990         (WebCore::Document::hasListenerTypeForEventType):
1991         * dom/Document.h:
1992         * dom/Element.cpp:
1993         (WebCore::isForceEvent):
1994
1995         Move the code to ensure the force events have listeners in order to fire to 
1996         dispatchMouseEvent, and delete the old implementations.
1997         (WebCore::Element::dispatchMouseEvent):
1998         (WebCore::Element::dispatchMouseForceChanged): Deleted.
1999         (WebCore::Element::dispatchMouseForceDown): Deleted.
2000         (WebCore::Element::dispatchMouseForceUp): Deleted.
2001         * dom/Element.h:
2002
2003         Perform a hit test and pipe the events through dispatchMouseEvent(). 
2004         * page/EventHandler.cpp:
2005         (WebCore::EventHandler::handleMouseForceEvent):
2006         * page/EventHandler.h:
2007
2008         New types for the new events.
2009         * platform/PlatformEvent.h:
2010
2011         Forward to EventHandler. 
2012         * replay/UserInputBridge.cpp:
2013         (WebCore::UserInputBridge::handleMouseForceEvent):
2014         * replay/UserInputBridge.h:
2015
2016 2015-04-16  Tim Horton  <timothy_horton@apple.com>
2017
2018         Sites with both width=device-width and height=device-height load zoomed out
2019         https://bugs.webkit.org/show_bug.cgi?id=143795
2020         <rdar://problem/20369671>
2021
2022         Reviewed by Ben Poulain.
2023
2024         * page/ViewportConfiguration.cpp:
2025         (WebCore::ViewportConfiguration::shouldIgnoreVerticalScalingConstraints):
2026         Some sites specify both width=device-width and height=device-height, and
2027         then lay out to device width but with a large amount of vertically scrollable content
2028         (so, height=device-height was a lie).
2029
2030         In all other cases where we use device-width and device-height, we prefer
2031         width=device-width over height=device-height, but in the code to ignore scaling constraints,
2032         the two paths were completely separate. On sites that specify both, this
2033         resulted in us attempting to zoom out to fit the entire height of the very tall page,
2034         which isn't at all what we wanted. So, ignore height=device-height if a width is specified.
2035
2036 2015-04-16  Chris Dumez  <cdumez@apple.com>
2037
2038         Regression(r182517): WebSocket::suspend() causes error event to be fired
2039         https://bugs.webkit.org/show_bug.cgi?id=143806
2040         <rdar://problem/20559812>
2041
2042         Reviewed by Alexey Proskuryakov.
2043
2044         WebSocket::suspend() causes an error event to be fired after r182517.
2045         This is not allowed as firing the event could trigger arbitrary JS
2046         execution, which is no longer allowed at this point.
2047
2048         This patch delays the error event firing until after
2049         WebSocket::resume() is called, similarly to what we already do for
2050         the close event.
2051
2052         Also add assertions in WebSocket::suspend() / WebSocket::resume()
2053         that will be hit if JS events are fired from within these functions.
2054         The pre-existing closed-when-entering-page-cache.html test is hitting
2055         one of these assertions without the fix above.
2056
2057         Tests:
2058           - http/tests/websocket/tests/hybi/closed-when-entering-page-cache.html
2059           - http/tests/websocket/tests/hybi/stop-on-resume-in-error-handler.html
2060
2061         * Modules/websockets/WebSocket.cpp:
2062         (WebCore::WebSocket::suspend):
2063         (WebCore::WebSocket::resume):
2064         (WebCore::WebSocket::resumeTimerFired):
2065         (WebCore::WebSocket::stop):
2066         (WebCore::WebSocket::didReceiveMessageError):
2067         (WebCore::WebSocket::didClose):
2068         (WebCore::WebSocket::dispatchOrQueueEvent):
2069         * Modules/websockets/WebSocket.h:
2070
2071 2015-04-15  Roger Fong  <roger_fong@apple.com>
2072
2073         Adjustments to button graphics for media controls.
2074         https://bugs.webkit.org/show_bug.cgi?id=143797.
2075         <rdar://problem/20083708>
2076
2077         Reviewed by Dean Jackson.
2078
2079         These changes are visual in nature and mainly affect the buttons.
2080         I've gotten rid of the text-shadow for all the buttons,
2081         used plus-lighter blending mode and changed the button opacity to reflect the specs,
2082         and made all the buttons turn opaque white when active.
2083
2084         * Modules/mediacontrols/mediaControlsApple.css:
2085         (audio::-webkit-media-controls-panel button):
2086         (audio::-webkit-media-controls-rewind-button):
2087         (audio::-webkit-media-controls-play-button):
2088         (audio::-webkit-media-controls-play-button.paused):
2089         (video::-webkit-media-controls-volume-max-button):
2090         (video::-webkit-media-controls-volume-slider):
2091         (video::-webkit-media-controls-volume-min-button):
2092         (audio::-webkit-media-controls-wireless-playback-picker-button):
2093         (audio::-webkit-media-controls-toggle-closed-captions-button):
2094         (audio::-webkit-media-controls-closed-captions-container li.selected:hover::before):
2095         (audio::-webkit-media-controls-fullscreen-button):
2096         (audio::-webkit-media-controls-fullscreen-button.exit):
2097         (audio::-webkit-media-controls-status-display):
2098         (audio::-webkit-media-controls-timeline):
2099         (audio::-webkit-media-controls-time-remaining-display):
2100         (video:-webkit-full-screen::-webkit-media-controls-volume-max-button):
2101         (video:-webkit-full-screen::-webkit-media-controls-volume-min-button):
2102         (video:-webkit-full-screen::-webkit-media-controls-play-button):
2103         (video:-webkit-full-screen::-webkit-media-controls-play-button.paused):
2104         (video:-webkit-full-screen::-webkit-media-controls-seek-back-button):
2105         (video:-webkit-full-screen::-webkit-media-controls-seek-forward-button):
2106         (video::-webkit-media-controls-volume-max-button:active):
2107         (video::-webkit-media-controls-volume-min-button:active):
2108         (audio::-webkit-media-controls-toggle-closed-captions-button:active):
2109         (audio::-webkit-media-controls-rewind-button:active):
2110         (audio::-webkit-media-controls-play-button:active):
2111         (video:-webkit-full-screen::-webkit-media-controls-volume-max-button:active):
2112         (video:-webkit-full-screen::-webkit-media-controls-volume-min-button:active):
2113         (video:-webkit-full-screen::-webkit-media-controls-play-button:active):
2114         (video:-webkit-full-screen::-webkit-media-controls-seek-back-button:active):
2115         (video:-webkit-full-screen::-webkit-media-controls-seek-forward-button:active):
2116         (audio::-webkit-media-controls-fullscreen-button:active):
2117
2118         Using the pseudo id itself here currently does not work, which is why we rely on the button.* selector for these.
2119         (video:-webkit-full-screen::-webkit-media-controls-panel button.paused:active):
2120         (audio::-webkit-media-controls-panel button.paused:active):
2121         (audio::-webkit-media-controls-panel button.exit:active):
2122  
2123         Draw volume slider knob as opaque white when active.
2124         Adjust colors of timeline and volume sliders now that we are using plus-lighter blending.
2125         * Modules/mediacontrols/mediaControlsApple.js:
2126         (Controller):
2127         (Controller.prototype.createControls):
2128         (Controller.prototype.handleVolumeSliderMouseDown):
2129         (Controller.prototype.handleVolumeSliderMouseUp):
2130         (Controller.prototype.drawTimelineBackground):
2131         (Controller.prototype.drawVolumeBackground):
2132
2133 2015-04-15  Simon Fraser  <simon.fraser@apple.com>
2134
2135         Pull emoji-position adjustment code into its own function
2136         https://bugs.webkit.org/show_bug.cgi?id=143592
2137
2138         Reviewed by Myles C. Maxfield.
2139
2140         First step to cleaning up FontCascade::drawGlyphs(). Pull iOS-only code related to
2141         emoji positioning into its own function.
2142
2143         * platform/graphics/cocoa/FontCascadeCocoa.mm:
2144         (WebCore::pointAdjustedForEmoji):
2145         (WebCore::FontCascade::drawGlyphs):
2146
2147 2015-04-16  Myles C. Maxfield  <mmaxfield@apple.com>
2148
2149         [iOS] Delete hardcoded font fallback tables
2150         https://bugs.webkit.org/show_bug.cgi?id=143583
2151
2152         Reviewed by Darin Adler
2153
2154         Instead of hardcoding which font to use for a particular character, use
2155         CTFontCreatePhysicalFontDescriptorForCharactersWithLanguage().
2156
2157         Updated test expected results:
2158             editing/selection/vertical-rl-rtl-extend-line-backward-br.html
2159             editing/selection/vertical-rl-rtl-extend-line-backward-p.html
2160             editing/selection/vertical-rl-rtl-extend-line-forward-br.html
2161             editing/selection/vertical-rl-rtl-extend-line-forward-p.html
2162             fast/text/international/danda-space.html
2163             fast/text/international/thai-baht-space.html
2164
2165         * platform/graphics/ios/FontCacheIOS.mm:
2166         (WebCore::FontCache::getSystemFontFallbackForCharacters):
2167         (WebCore::FontCache::systemFallbackForCharacters):
2168         * platform/spi/cocoa/CoreTextSPI.h:
2169
2170 2015-04-16  Per Arne Vollan  <peavo@outlook.com>
2171
2172         [WinCairo] Compile error when environment variable WEBKITLIBRARIESDIR is not defined.
2173         https://bugs.webkit.org/show_bug.cgi?id=143828
2174
2175         Reviewed by Brent Fulgham.
2176
2177         Python throws an exception when calling os.environ['WEBKITLIBRARIESDIR'] and
2178         WEBKITLIBRARIESDIR is not defined. WEBKITLIBRARIESDIR is obsolete, we can remove it.
2179
2180         * AVFoundationSupport.py:
2181         (lookFor):
2182
2183 2015-04-16  Alexey Proskuryakov  <ap@apple.com>
2184
2185         Minor AudioContext cleanup
2186         https://bugs.webkit.org/show_bug.cgi?id=143816
2187
2188         Reviewed by Jer Noble.
2189
2190         * Modules/webaudio/AudioContext.cpp:
2191         (WebCore::AudioContext::~AudioContext):
2192         (WebCore::AudioContext::lazyInitialize):
2193         (WebCore::AudioContext::stop):
2194         (WebCore::AudioContext::derefNode):
2195         (WebCore::AudioContext::scheduleNodeDeletion):
2196         (WebCore::AudioContext::deleteMarkedNodes):
2197         (WebCore::AudioContext::stopDispatch): Deleted.
2198         (WebCore::AudioContext::deleteMarkedNodesDispatch): Deleted.
2199         * Modules/webaudio/AudioContext.h:
2200
2201         * Modules/webaudio/AudioNode.cpp: (WebCore::AudioNode::~AudioNode):
2202
2203 2015-04-16  Chris Dumez  <cdumez@apple.com>
2204
2205         Unreviewed attempt to fix Windows build after r182881.
2206
2207         Add missing header include.
2208
2209         * page/PageConsoleClient.h:
2210
2211 2015-04-16  Chris Dumez  <cdumez@apple.com>
2212
2213         Tests introduced in r182877 are flaky
2214         https://bugs.webkit.org/show_bug.cgi?id=143784
2215
2216         Reviewed by Alexey Proskuryakov.
2217
2218         Tests introduced in r182877 are flaky as the line number sometimes
2219         appears in the console messages. This patch updates the console
2220         logging code so that no Document is provided when logging. Therefore,
2221         no line number will ever be displayed. In this case, I don't think
2222         having the line number is terribly useful anyway.
2223
2224         * css/StyleSheetContents.cpp:
2225         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
2226
2227 2015-04-15  Simon Fraser  <simon.fraser@apple.com>
2228
2229         We should dump GraphicsLayer's anchorPoint z component
2230         https://bugs.webkit.org/show_bug.cgi?id=143815
2231
2232         Reviewed by Tim Horton.
2233
2234         We didn't include the z component of a layer's anchor point when dumping.
2235         Dump if it's non-zero (to avoid having to change lots of test output).
2236         No test with non-zero z appears to dump layers.
2237
2238         * platform/graphics/GraphicsLayer.cpp:
2239         (WebCore::GraphicsLayer::dumpProperties):
2240         * rendering/style/RenderStyle.cpp:
2241         (WebCore::requireTransformOrigin): Remove a FIXME which, on further consideration,
2242         is wrong.
2243
2244 2015-04-15  Brent Fulgham  <bfulgham@apple.com>
2245
2246         [Mac] Disable "Save to Downloads" option for local files
2247         https://bugs.webkit.org/show_bug.cgi?id=143794
2248
2249         Reviewed by Tim Horton.
2250
2251         Disable the Image and Media download options if the download
2252         target is a local file. We can only download web resources;
2253         anything else is actually a no-op.
2254
2255         * page/ContextMenuController.cpp:
2256         (WebCore::ContextMenuController::checkOrEnableIfNeeded): Disable
2257         menu item if appropriate.
2258
2259 2015-04-15  Chris Dumez  <cdumez@apple.com>
2260
2261         Add a console message when a stylesheet is not parsed due to invalid MIME type
2262         https://bugs.webkit.org/show_bug.cgi?id=143784
2263
2264         Reviewed by Joseph Pecoraro.
2265
2266         After r180020, we no longer have a quirks mode exception for CSS MIME
2267         types. This means that we'll start rejecting stylesheets that were
2268         previously accepted due to this quirk. In this case we log a console
2269         message to help Web developers understand why their stylesheet is being
2270         rejected.
2271
2272         * css/StyleRuleImport.cpp:
2273         (WebCore::StyleRuleImport::setCSSStyleSheet):
2274
2275         * css/StyleSheetContents.cpp:
2276         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
2277         - Initialize hasValidMIMEType to true so that it ends up being false
2278           only when canUseSheet(hasValidMIMEType) is called and we've determined
2279           the MIME type is indeed invalid. Otherwise, hasValidMIMEType would
2280           also be false when m_data is null or empty in
2281           CachedCSSStyleSheet::sheetText() and we don't want to display the MIME
2282           type error in this case.
2283         - If hasValidMIMEType is false, display the console message and abort
2284           early. We don't need to execute the rest of the function in this case
2285           as sheetText is a null String and there is no point in trying to parse
2286           it.
2287         - Drop handling of !hasValidMIMEType && !hasSyntacticallyValidCSSHeader()
2288           as this can no longer be reached. This handling no longer makes sense
2289           after r180020 as sheetText() will now always return a null String if
2290           the MIME type is invalid (as we no longer support the CSS MIME type
2291           quirks mode).
2292
2293         * css/StyleSheetContents.h:
2294         * html/HTMLLinkElement.cpp:
2295         (WebCore::HTMLLinkElement::setCSSStyleSheet):
2296
2297 2015-04-15  Said Abou-Hallawa  <said@apple.com>
2298
2299         Minimum font size pref breaks SVG text very badly.
2300         https://bugs.webkit.org/show_bug.cgi?id=143590.
2301
2302         Reviewed by Simon Fraser.
2303
2304         When enabling the minimum font size perf, the computed font size is set
2305         to the minimum font size if the computed value is smaller than the minimum.
2306         The bug happens because the SVG text element applies its scaling on the
2307         computed value after applying the minimum font size rule. This means the
2308         final computed value for the font size will be the scaling of the minimum
2309         font size and not minimum font size itself. What we need is to postpone
2310         applying the minimum font size rules, till the SVG scaling is applied.
2311
2312         Tests: svg/text/font-small-enlarged-minimum-larger.svg
2313                svg/text/font-small-enlarged-minimum-smaller.svg
2314
2315         * rendering/svg/RenderSVGInlineText.cpp:
2316         (WebCore::RenderSVGInlineText::computeNewScaledFontForStyle): Call
2317         computedFontSizeFromSpecifiedSizeForSVGInlineText() even if scalingFactor
2318         is 1. We need to make sure the minimum font size rules are applied. This
2319         function was assuming the mininum font size rule was applied when resolving
2320         the style. This is not true anymore for the SVG text.
2321
2322         * style/StyleFontSizeFunctions.cpp:
2323         (WebCore::Style::computedFontSizeFromSpecifiedSize): Do not apply the
2324         minimum size rules for the SVG element until it applies its scaling to
2325         the font size.
2326
2327 2015-04-15  Mark Lam  <mark.lam@apple.com>
2328
2329         Remove obsolete VMInspector debugging tool.
2330         https://bugs.webkit.org/show_bug.cgi?id=143798
2331
2332         Reviewed by Michael Saboff.
2333
2334         No new tests needed.  Just removing obsolete code.
2335
2336         * ForwardingHeaders/interpreter/VMInspector.h: Removed.
2337
2338 2015-04-15  Timothy Horton  <timothy_horton@apple.com>
2339
2340         Custom CSS cursors do not use -webkit-image-set on retina displays
2341         https://bugs.webkit.org/show_bug.cgi?id=120783
2342         <rdar://problem/14921432>
2343
2344         Reviewed by Beth Dakin.
2345         Patch by Evan Wallace <evan.exe@gmail.com>.
2346
2347         Scale NSCursor images correctly so custom CSS cursors work with
2348         -webkit-image-set on retina displays.
2349
2350         * WebCore.exp.in:
2351         * page/EventHandler.cpp:
2352         (WebCore::EventHandler::selectCursor):
2353         * platform/mac/CursorMac.mm:
2354         (WebCore::createCustomCursor):
2355         (WebCore::Cursor::ensurePlatformCursor):
2356
2357 2015-04-15  Alexey Proskuryakov  <ap@apple.com>
2358
2359         No thread safety when passing ThreadableLoaderOptions from a worker thread
2360         https://bugs.webkit.org/show_bug.cgi?id=143790
2361
2362         Reviewed by Geoffrey Garen.
2363
2364         * loader/ThreadableLoader.h:
2365         * loader/ThreadableLoader.cpp: (WebCore::ThreadableLoaderOptions::isolatedCopy): Added.
2366
2367         * loader/WorkerThreadableLoader.cpp:
2368         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge): Don't just send
2369         a structure with strings to a different thread, that's bad.
2370
2371         * platform/CrossThreadCopier.h: I think that this is dead code, but for this bug,
2372         just removing a clearly wrong specialization.
2373
2374 2015-04-15  Alex Christensen  <achristensen@webkit.org>
2375
2376         Progress towards CMake on Mac.
2377         https://bugs.webkit.org/show_bug.cgi?id=143785
2378
2379         Reviewed by Csaba Osztrogonác.
2380
2381         * CMakeLists.txt:
2382         * PlatformMac.cmake:
2383
2384 2015-04-15  Daniel Bates  <dabates@apple.com>
2385
2386         Clean up: Have SVGTextLayoutEngine::beginTextPathLayout() take a reference to a
2387         RenderSVGTextPath instead of a pointer
2388         https://bugs.webkit.org/show_bug.cgi?id=143787
2389
2390         Reviewed by Andreas Kling.
2391
2392         SVGTextLayoutEngine::beginTextPathLayout() assumes that the passed RenderObject is a
2393         non-null pointer to a RenderSVGTextPath object. Instead we should have this function take a
2394         reference to a RenderSVGTextPath object to help callers catch bad usage and better document
2395         the expectation of a valid RenderSVGTextPath object.
2396
2397         * rendering/svg/SVGRootInlineBox.cpp:
2398         (WebCore::SVGRootInlineBox::layoutCharactersInTextBoxes): Downcast the renderer of the
2399         inline box to a RenderSVGTextPath object and pass it to SVGTextLayoutEngine::beginTextPathLayout().
2400         We ensured that this cast is safe earlier in this function.
2401         SVGTextLayoutEngine::beginTextPathLayout().
2402         * rendering/svg/SVGTextLayoutEngine.cpp:
2403         (WebCore::SVGTextLayoutEngine::beginTextPathLayout): Change type of first parameter from
2404         RenderObject* to RenderSVGTextPath. Remove ASSERT() that was checking for a non-null
2405         RenderObject pointer since we are passing the renderer by reference and a well-formed
2406         reference must refer to a valid object.
2407         * rendering/svg/SVGTextLayoutEngine.h: Substitute RenderSVGTextPath& for RenderObject*.
2408
2409 2015-04-13  Jer Noble  <jer.noble@apple.com>
2410
2411         [Fullscreen] ChromeClient::exitVideoFullscreen() should take a pointer to a HTMLVideoElement.
2412         https://bugs.webkit.org/show_bug.cgi?id=143674
2413
2414         Reviewed by Darin Adler.
2415
2416         * html/HTMLMediaElement.cpp:
2417         (WebCore::HTMLMediaElement::enterFullscreen): Pass a reference.
2418         (WebCore::HTMLMediaElement::exitFullscreen): exitVideoFullscreen() -> exitVideoFullscreenForVideoElement(...).
2419         * page/ChromeClient.h:
2420
2421 2015-04-14  Anders Carlsson  <andersca@apple.com>
2422
2423         Make creating send rights from shared memory more robust
2424         https://bugs.webkit.org/show_bug.cgi?id=143730
2425         rdar://problem/16595870
2426
2427         Reviewed by Darin Adler.
2428
2429         Add a bool conversion operator to MachSendRight and tidy up the default constructor.
2430
2431         * platform/cocoa/MachSendRight.h:
2432         (WebCore::MachSendRight::operator bool):
2433         (WebCore::MachSendRight::MachSendRight): Deleted.
2434
2435 2015-04-15  Eric Carlson  <eric.carlson@apple.com>
2436
2437         Generalize "isPlayingAudio" to include other media characteristics
2438         https://bugs.webkit.org/show_bug.cgi?id=143713
2439
2440         Reviewed by Jer Noble.
2441
2442         No new functionality.
2443
2444         * Modules/webaudio/AudioContext.cpp:
2445         (WebCore::AudioContext::stop): updateIsPlayingAudio -> updateIsPlayingMedia.
2446         (WebCore::AudioContext::isPlayingAudioDidChange): Ditto.
2447
2448         * dom/Document.cpp:
2449         (WebCore::Document::addAudioProducer): Ditto.
2450         (WebCore::Document::removeAudioProducer): Ditto.
2451         (WebCore::Document::updateIsPlayingMedia): Renamed.
2452         (WebCore::Document::updateIsPlayingAudio): Deleted.
2453         * dom/Document.h:
2454
2455         * html/HTMLMediaElement.cpp:
2456         (WebCore::HTMLMediaElement::setMuted): updateIsPlayingAudio -> updateIsPlayingMedia.
2457         (WebCore::HTMLMediaElement::setPlaying): Ditto.
2458
2459         * page/ChromeClient.h:
2460         * page/Page.cpp:
2461         (WebCore::Page::updateIsPlayingMedia): Renamed.
2462         (WebCore::Page::updateIsPlayingAudio): Deleted.
2463         * page/Page.h:
2464
2465 2015-04-15  Joonghun Park  <jh718.park@samsung.com>
2466
2467         Fix Debug build error 'comparison of unsigned expression >= 0 is always true [-Werror=type-limits]'
2468         https://bugs.webkit.org/show_bug.cgi?id=143751
2469
2470         Reviewed by Csaba Osztrogonác.
2471
2472         No new tests, no new behaviors.
2473
2474         * rendering/svg/SVGTextChunk.cpp:
2475         (WebCore::SVGTextChunk::SVGTextChunk):
2476
2477 2015-04-14  Zalan Bujtas  <zalan@apple.com>
2478
2479         Make inline continuation style change logic consistent.
2480         https://bugs.webkit.org/show_bug.cgi?id=143737
2481         rdar://problem/20486596
2482
2483         Reviewed by Simon Fraser.
2484
2485         Do not force RenderBlock type-casting on the first sibling of the continuation's container.
2486         The first sibling of the container of a continuation should be handled as the rest of the siblings.
2487
2488         Test: fast/inline/inline-with-column-span-and-remove-block-child-crash.html
2489
2490         * rendering/RenderInline.cpp:
2491         (WebCore::updateStyleOfAnonymousBlockContinuations):
2492         (WebCore::RenderInline::styleDidChange):
2493
2494 2015-04-14  Chris Dumez  <cdumez@apple.com>
2495
2496         Regression(r180020): Web Inspector crashes on pages that have a stylesheet with an invalid MIME type
2497         https://bugs.webkit.org/show_bug.cgi?id=143745
2498         <rdar://problem/20243916>
2499
2500         Reviewed by Joseph Pecoraro.
2501
2502         After r180020, we are stricter and no longer accept CSS resources that
2503         are not served with a CSS MIME type. Showing Web inspector on a page
2504         with such bad resource would crash because
2505         InspectorPageAgent::cachedResourceContent() would return true but
2506         the result String would be null. This null String would then later
2507         be passed to the Yarr interpreter and crash on a String::is8Bit()
2508         call.
2509
2510         cachedResourceContent() calls CachedCSSStyleSheet::sheetText(). Before
2511         r180020, it would return the text, even if the MIME type was incorrect.
2512         However, this is no longer the case and we now need to make sure that
2513         cachedResourceContent() returns false if sheetText() returns a null
2514         String.
2515
2516         Test: http/tests/inspector/css/bad-mime-type.html
2517
2518         * inspector/InspectorPageAgent.cpp:
2519         (WebCore::InspectorPageAgent::cachedResourceContent):
2520
2521 2015-04-14  Said Abou-Hallawa  <sabouhallawa@apple.com>
2522
2523         textPath layout performance improvement.
2524         https://bugs.webkit.org/show_bug.cgi?id=141570.
2525
2526         Reviewed by Darin Adler.
2527
2528         The bottleneck of the text-on-path performance is the position and angle
2529         calculations for every single character. If the number of characters is
2530         'n' and the number of path elements is 'm', the total number of processing
2531         the path elements is O(2 x n x m). What makes it really worse is, for every
2532         curve we keep splitting the curve till the split curve is almost a straight
2533         line. The changes we need to do are:
2534         1. Merge the position and the angle traversals in one pass since they are
2535            returning info for the same length on the path. There is a degenerate
2536            case for the starting point when calculating the angle. The original
2537            code was solving this problem by passing an epsilon instead of zero but
2538            because traversing the path for position and angle are now merged, we
2539            will pass zero for the starting point as is. All we need is to move one
2540            step ahead without moving the position. We need the extra step forward
2541            to calculate the slope of the path at the starting point.
2542         2. We need to add a new mode to traversing a path. The new mode will take
2543            a vector of lengths and returns a vector of arrow vectors. Every arrow
2544            vector represents a position and an angle on the path at a certain length.
2545            This requires changing the SVGTextLayoutEngine to calculate the lengths
2546            of the characters on the curve first and then passing all of them to the
2547            path traversal function. Instead of traversing the path for every length,
2548            we are going to get the required point and angle from the vector of arrow
2549            vectors.
2550
2551         This patch is addressing the first fix only. The second one will require
2552         refactoring the SVGTextLayoutEngine so I am going to address it in a
2553         different patch.
2554
2555         * platform/graphics/Path.cpp:
2556         (WebCore::pathLengthApplierFunction): It is cleaner to move the function
2557         of this method to PathTraversalState::processPathElement().
2558         
2559         (WebCore::Path::length): Use new enum Action value and access methods.
2560         
2561         (WebCore::Path::traversalStateAtLength): New function which returns the
2562         traversalState at a certain length on a path.
2563         
2564         (WebCore::Path::pointAtLength):
2565         (WebCore::Path::normalAngleAtLength): Use traversalStateAtLength() to get
2566         the traversalState and from it return either the position or the angle.
2567         
2568         * platform/graphics/Path.h: Define traversalStateAtLength().
2569         
2570         * platform/graphics/PathTraversalState.cpp:
2571         (WebCore::distanceLine): Code clean up.
2572         
2573         (WebCore::curveLength): Make the setting of m_previous and m_current happens
2574         only in this function.
2575         
2576         (WebCore::PathTraversalState::PathTraversalState): Add an optional parameter
2577         for the desired length and move the initialization of the other members to
2578         the class definition.
2579         
2580         (WebCore::PathTraversalState::closeSubpath):
2581         (WebCore::PathTraversalState::moveTo):
2582         (WebCore::PathTraversalState::lineTo): Add the distance to the m_totalLength
2583         instead of returning it since this is what all the callers were doing.
2584         
2585         (WebCore::PathTraversalState::quadraticBezierTo):
2586         (WebCore::PathTraversalState::cubicBezierTo): Add the distance to the
2587         m_totalLength. Move the setting of m_previous and m_current to curveLength().
2588         Remove unused members m_control1 and m_control2.
2589
2590         (WebCore::PathTraversalState::processSegment): Deleted.        
2591         (WebCore::PathTraversalState::finalizeAppendPathElement): Create a new
2592         name for the function. Handle the case of the angle at the starting point
2593         where m_desiredLength is set to zero. The new flag m_isZeroVector will be
2594         set to notify the caller that the  next iteration will be the last one and
2595         it is only needed for the calculating the angle of a zero vector. m_current
2596         should not change by this last iteration.
2597         
2598         (WebCore::PathTraversalState::appendPathElement): This code is moved from
2599         pathLengthApplierFunction().
2600         
2601         (WebCore::PathTraversalState::processPathElement): This function is used
2602         by the class Path. It is a wrapper for appendPathElement(). If m_isZeroVector
2603         is set we append the new element to a copy for the PathTraversalState just
2604         to get the angle for the zero vector.
2605
2606         * platform/graphics/PathTraversalState.h: Change the enum values to not
2607         not include the class or the enum class. Make the data members private and
2608         expose the needed ones through access methods. Make all the internal methods
2609         to be private.
2610         
2611         (WebCore::PathTraversalState::processPathElement):  Another wrapper for
2612         appendPathElement() which is used by SVGPathTraversalStateBuilder.
2613         
2614         (WebCore::PathTraversalState::action):
2615         (WebCore::PathTraversalState::setAction):
2616         (WebCore::PathTraversalState::desiredLength):
2617         (WebCore::PathTraversalState::setDesiredLength):
2618         (WebCore::PathTraversalState::success):
2619         (WebCore::PathTraversalState::totalLength):
2620         (WebCore::PathTraversalState::current):
2621         (WebCore::PathTraversalState::normalAngle): New access methods which are now
2622         needed after making the data members private.
2623         
2624         * rendering/svg/SVGRootInlineBox.cpp:
2625         (WebCore::SVGRootInlineBox::layoutCharactersInTextBoxes): Make the casting
2626         of the renderer on the caller side.
2627         
2628         * rendering/svg/SVGTextChunk.cpp:
2629         (WebCore::SVGTextChunk::SVGTextChunk): The constructor should append the
2630         elements of m_boxes instead of making this from outside the class.
2631         
2632         (WebCore::SVGTextChunk::totalCharacters):
2633         (WebCore::SVGTextChunk::totalLength):
2634         (WebCore::SVGTextChunk::calculateLength): Deleted.
2635         Replace calculateLength() by totalCharacters() and totalLength() to make
2636         the interface cleaner.
2637         
2638         (WebCore::SVGTextChunk::totalAnchorShift):
2639         (WebCore::SVGTextChunk::calculateTextAnchorShift): Deleted.
2640         Rename the function name.
2641         
2642         (WebCore::SVGTextChunk::layout):
2643         (WebCore::SVGTextChunk::processTextLengthSpacingCorrection):
2644         (WebCore::SVGTextChunk::buildBoxTransformations):
2645         (WebCore::SVGTextChunk::boxSpacingAndGlyphsTransform):
2646         (WebCore::SVGTextChunk::processTextAnchorCorrection):
2647         Move the chunk layout code from SVGTextChunkBuilder::layoutTextChunks()
2648         to the SVGTextChunk::layout(). Move all the helper functions as well.
2649         
2650         * rendering/svg/SVGTextChunk.h:
2651         (WebCore::SVGTextChunk::hasTextAnchor):
2652         (WebCore::SVGTextChunk::boxes): Deleted.
2653         Add the new methods and change most of the public methods to be private.
2654         
2655         * rendering/svg/SVGTextChunkBuilder.cpp:
2656         (WebCore::SVGTextChunkBuilder::totalCharacters):
2657         (WebCore::SVGTextChunkBuilder::totalLength):
2658         (WebCore::SVGTextChunkBuilder::totalAnchorShift): This code is moved from
2659         SVGTextLayoutEngine. It scans the boxes stored in the SVGTextChunkBuilder
2660         and sums up the total values.
2661         
2662         (WebCore::SVGTextChunkBuilder::transformationForTextBox):
2663         (WebCore::SVGTextChunkBuilder::buildTextChunks):
2664         (WebCore::SVGTextChunkBuilder::layoutTextChunks): Code clean up.
2665         
2666         (WebCore::SVGTextChunkBuilder::addTextChunk): Deleted.
2667         (WebCore::SVGTextChunkBuilder::processTextChunk): Deleted.
2668         (WebCore::SVGTextChunkBuilder::processTextLengthSpacingCorrection): Deleted.
2669         (WebCore::SVGTextChunkBuilder::processTextAnchorCorrection): Deleted.
2670         (WebCore::SVGTextChunkBuilder::buildSpacingAndGlyphsTransform): Deleted.
2671         This code now lives in SVGTextChunk.
2672         
2673         * rendering/svg/SVGTextChunkBuilder.h: Add new methods for code which was
2674         moved from SVGTextLayoutEngine and remove methods for code which was removed
2675         to SVGTextChunk.
2676         
2677         * rendering/svg/SVGTextLayoutEngine.cpp:
2678         (WebCore::SVGTextLayoutEngine::beginTextPathLayout): Use the sum up methods
2679         from SVGTextChunkBuilder instead of looping through the chunks. Also get a
2680         clean order for defining variables and doing the calculations.
2681         
2682         (WebCore::SVGTextLayoutEngine::finalizeTransformMatrices): Code clean up.
2683         
2684         (WebCore::SVGTextLayoutEngine::layoutTextOnLineOrPath): Do a single path
2685         traversal to get the position and the angle for a length on a path.
2686         
2687         * svg/SVGAnimateMotionElement.cpp:
2688         (WebCore::SVGAnimateMotionElement::buildTransformForProgress): Do a single
2689         path traversal to get the position and the angle at a length on a path.
2690         
2691         * svg/SVGPathTraversalStateBuilder.cpp:
2692         (WebCore::SVGPathTraversalStateBuilder::SVGPathTraversalStateBuilder):
2693         (WebCore::SVGPathTraversalStateBuilder::moveTo):
2694         (WebCore::SVGPathTraversalStateBuilder::lineTo):
2695         (WebCore::SVGPathTraversalStateBuilder::curveToCubic):
2696         (WebCore::SVGPathTraversalStateBuilder::closePath):
2697         (WebCore::SVGPathTraversalStateBuilder::setDesiredLength):
2698         (WebCore::SVGPathTraversalStateBuilder::continueConsuming):
2699         (WebCore::SVGPathTraversalStateBuilder::totalLength):
2700         (WebCore::SVGPathTraversalStateBuilder::currentPoint):
2701         (WebCore::SVGPathTraversalStateBuilder::incrementPathSegmentCount): Deleted.
2702         (WebCore::SVGPathTraversalStateBuilder::pathSegmentIndex): Deleted.
2703         * svg/SVGPathTraversalStateBuilder.h:
2704         (WebCore::SVGPathTraversalStateBuilder::pathSegmentIndex):
2705         Code clean up.
2706         
2707         * svg/SVGPathUtilities.cpp:
2708         (WebCore::getSVGPathSegAtLengthFromSVGPathByteStream):
2709         (WebCore::getTotalLengthOfSVGPathByteStream):
2710         (WebCore::getPointAtLengthOfSVGPathByteStream): Use new TraversalState::Action
2711         enum values.
2712
2713 2015-04-14  Simon Fraser  <simon.fraser@apple.com>
2714
2715         Re-enable custom dilation for antialiased fonts
2716         https://bugs.webkit.org/show_bug.cgi?id=143738
2717
2718         Reviewed by Tim Horton.
2719         
2720         Enabling custom dilation for antialised fonts broke layout tests, so re-land it,
2721         but disable in WebKitTestRunner and DumpRenderTree. The latter requires adding
2722         a private WebKit pref. This pref defaults to YES, enabling the feature by default
2723         in WK1 as we do for WK2.
2724
2725         * platform/graphics/cocoa/FontCascadeCocoa.mm:
2726         (WebCore::dilationSizeForTextColor):
2727         (WebCore::FontCascade::drawGlyphs):
2728
2729 2015-04-14  Andy Estes  <aestes@apple.com>
2730
2731         [Content Filtering] Use ASSERT_WITH_SECURITY_IMPLICATION for verifying types from NEFilterSource
2732         https://bugs.webkit.org/show_bug.cgi?id=143742
2733
2734         Reviewed by David Kilzer.
2735
2736         * platform/cocoa/NetworkExtensionContentFilter.mm:
2737         (replacementDataFromDecisionInfo): ASSERT_WITH_SECURITY_IMPLICATION that decisionInfo is really a NSDictionary.
2738         (WebCore::NetworkExtensionContentFilter::handleDecision): ASSERT_WITH_SECURITY_IMPLICATION that replacementData is really a NSData.
2739
2740 2015-04-14  Brent Fulgham  <bfulgham@apple.com>
2741
2742         Correct layering violation in DumpRenderTree Build
2743         https://bugs.webkit.org/show_bug.cgi?id=143732
2744
2745         Reviewed by Simon Fraser.
2746
2747         * testing/js/WebCoreTestSupport.cpp:
2748         (WebCoreTestSupport::monitorWheelEvents): Added. Provides a wrapper around
2749         the internal WebCore objects needed to implement this function.
2750         (WebCoreTestSupport::setTestCallbackAndStartNotificationTimer): Ditto.
2751         * testing/js/WebCoreTestSupport.h:
2752
2753 2015-04-14  Brady Eidson  <beidson@apple.com>
2754
2755         Make sure media element loads hit content filter extensions.
2756         <rdar://problem/20014012> and https://bugs.webkit.org/show_bug.cgi?id=143731
2757
2758         Reviewed by Jer Noble.
2759
2760         Tests: http/tests/contentextensions/media-filtered.html
2761                http/tests/contentextensions/text-track-blocked.html
2762
2763         * html/HTMLMediaElement.cpp:
2764         (WebCore::HTMLMediaElement::parseAttribute): Skip loads that are filtered.
2765
2766 2015-04-14  Brian Weinstein  <bweinstein@apple.com>
2767
2768         Add SPI to clear HSTS hosts added since a date.
2769         https://bugs.webkit.org/show_bug.cgi?id=143726
2770         and
2771         rdar://problem/16664597
2772
2773         Declare _CFNetworkResetHSTSHostsSinceDate in CFNetworkSPI.h.
2774
2775         Reviewed by Anders Carlsson.
2776
2777         * platform/spi/cf/CFNetworkSPI.h:
2778
2779 2015-04-14  Roger Fong  <roger_fong@apple.com>
2780
2781         Unreviewed. Time numbers on media controls move as they update on OSX.
2782         <rdar://problem/20141790>.
2783
2784         * Modules/mediacontrols/mediaControlsApple.css:
2785         (audio::-webkit-media-controls-current-time-display):
2786         (audio::-webkit-media-controls-time-remaining-display):
2787         Don't bother justifying content to end. We size the box to fit the time displays exactly anyways.
2788
2789 2015-04-14  Roger Fong  <roger_fong@apple.com>
2790
2791         Insert volume control in correct place after exiting wireless play.
2792         https://bugs.webkit.org/show_bug.cgi?id=143721.
2793         <rdar://problem/20526106>
2794
2795         Reviewed by Darin Adler.
2796
2797         * Modules/mediacontrols/mediaControlsApple.js:
2798         (Controller.prototype.updateWirelessPlaybackStatus):
2799
2800 2015-04-14  Brady Eidson  <beidson@apple.com>
2801
2802         Media elements not in a page shouldn't load.
2803         https://bugs.webkit.org/show_bug.cgi?id=143720
2804
2805         Reviewed by Jer Noble.
2806
2807         No new tests (Theoretical problem noticed in code review).
2808
2809         * html/HTMLMediaElement.cpp:
2810         (WebCore::HTMLMediaElement::loadResource): Make sure the frame is in a page.
2811
2812 2015-04-14  Simon Fraser  <simon.fraser@apple.com>
2813
2814         [iOS] Clean up registration of layers with the ScrollingCoordinator
2815         https://bugs.webkit.org/show_bug.cgi?id=143725
2816
2817         Reviewed by Tim Horton.
2818
2819         Simplify a couple of bits of code related to the registration of layers with
2820         the ScrollingCoordinator in RenderLayerCompositor.
2821
2822         First, RenderLayerBacking was using ScrollingNodeTypes to choose which scrolling
2823         roles a layer has, which let to ambiguous code where we hardcoded a ScrollingNodeType
2824         with knowledge of what RenderLayerBacking did with it. Clean up by using LayerScrollCoordinationRole,
2825         which is moved to RenderLayer.h so that RenderLayerCompositor.h and RenderLayerBacking.h
2826         both see it.
2827
2828         Secondly, avoid having both detachFromScrollingCoordinator() and detachFromScrollingCoordinatorForRole()
2829         by passing in the bitmask of roles.
2830
2831         * page/FrameView.cpp:
2832         (WebCore::FrameView::scrollLayerID):
2833         * rendering/RenderLayer.h:
2834         * rendering/RenderLayerBacking.cpp:
2835         (WebCore::RenderLayerBacking::~RenderLayerBacking):
2836         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
2837         (WebCore::RenderLayerBacking::detachFromScrollingCoordinatorForRole): Deleted.
2838         * rendering/RenderLayerBacking.h:
2839         * rendering/RenderLayerCompositor.cpp:
2840         (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
2841         (WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
2842         (WebCore::scrollCoordinationRoleForNodeType):
2843         (WebCore::RenderLayerCompositor::attachScrollingNode):
2844         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
2845         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
2846         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
2847         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayerForRole): Deleted.
2848         * rendering/RenderLayerCompositor.h:
2849
2850 2015-04-14  Benjamin Poulain  <benjamin@webkit.org>
2851
2852         Add a conservative DFA minimizer for the content extension matcher
2853         https://bugs.webkit.org/show_bug.cgi?id=143501
2854
2855         Reviewed by Alex Christensen.
2856
2857         This patch adds a simple minimizer for DFA graphs. It is not a perfect minimizer:
2858         some indistinguishable are not merged, but no two distinguishable are merged.
2859
2860         The general idea of the algorithm is to put all the state into a single set
2861         and partition iteratively until it is impossible to split any subset by using
2862         a transition to distinguish two states.
2863
2864         Let's ignore fallback transition for now, and I'll explain later how they fit in
2865         the big picture.
2866
2867
2868         The first thing we do is create a partition of the transition by grouping every
2869         transition by the same character in the same subset. This partition of transitions
2870         is the base by which we will partition the states.
2871
2872         Each subset in the transition partition is a "distinguisher" by which we can
2873         separate the state partition.
2874
2875         We also create a second partition, the state partition. This is where we keep
2876         all the subsets of states that have been split so far.
2877
2878         Let say we have the following graph.
2879
2880             1 --a--> 2
2881             1 --b--> 3
2882             2 --c--> 4 (final)
2883             3 --c--> 4 (final)
2884
2885         The partition of transition would start with:
2886         Set 0:
2887             1 --a--> 2
2888         Set 1:
2889             1 --b--> 3
2890         Set 2:
2891             2 --c--> 4
2892             3 --c--> 4
2893
2894         The state partition would have a single set with { 1, 2, 3, 4 }.
2895
2896
2897         Next, we split the state partition by distinguishable final states. In this case,
2898         we would split it into { 1, 2, 3 }, { 4 }.
2899
2900         We then refine the transition partition by splitting it by the states that have
2901         been distinguished. Here, the only transitions to 4 are both is the same set (set 2),
2902         so the transition partition remains the same.
2903
2904
2905         We can now execute the main loop of the algorithm:
2906         1) Split the states by the transitions.
2907         2) Split the transitions that are now reaching two different sets of the state partition.
2908         3) Add any newly discovered "distinguisher" (the ones we split) to the list of "distinguisher"
2909            to process.
2910
2911         In this case, we just iterate over the partition set in order, and add newly split transitions
2912         to the end of the list.
2913
2914         In the example, we would first visit set 0. We have that state 1 is distinguishable
2915         by "a", and the state partition would become { 1 }, { 2, 3 }, { 4 }.
2916
2917         We then visit transition set 1, it distinguishes state 1 which is already alone -> nothing to do.
2918
2919         Finally, we process the transition set 2, it distinguishes 2 and 3, they are already in the same
2920         set -> nothing to do.
2921
2922         There is no more transition to process, we have 3 unique subsets and we should merge 2 and 3.
2923
2924         ---
2925
2926         Okay, now how to we fit fallback transition in this model. In this patch, I take the conservative
2927         approach: we split everything assuming fallback transition do not exist, then we refine
2928         by the fallback transitions.
2929
2930         Let's take the following example:
2931             1 --a--> 3
2932             2 --a--> 3
2933             1 -[f]-> 4
2934             2 -[f]-> 5
2935
2936         and at this stage in the algorithm, we have the sets { 1, 2 }, { 3 }, { 4 }, { 5 }.
2937         The states 1 and 2 are together because they cannot be distinguished by 'a', but
2938         the fallback transition distinguishes them.
2939
2940         Since we have done every other split, we have one useful property: we know that every
2941         state in every set transition with the exact set of characters within that set.
2942         If that was not true, there would be one "distinguisher" 'x' that could spit the set
2943         into two subsets: the one with the transition 'x' and the ones without.
2944
2945         Since all the transitions are the same, there is no overlap between the defined transition
2946         and the fallback transition. Consequently, we can use the fallback transition as a whole
2947         transition and use it to distinguish the states.
2948
2949         The fallback transitions are handled like any other transition, we have a partition of such
2950         transitions and split by each of them. BUT, we can only use them after every unique transition
2951         has been covered.
2952
2953         This trick is also what makes the minimization imperfect: it should be possible to merge
2954         states with overlap in their fallback transitions but we would split them.
2955
2956         ---
2957
2958         Antti Valmari, Petri Lehtinen, Marie-Pierre Béal and Maxime Crochemore deserve credit for their indirect
2959         work on this patch. Thanks for your wonderful papers about DFA minimization.
2960
2961         * WebCore.xcodeproj/project.pbxproj:
2962         * contentextensions/ContentExtensionCompiler.cpp:
2963         (WebCore::ContentExtensions::compileRuleList):
2964         * contentextensions/DFA.cpp:
2965         (WebCore::ContentExtensions::DFA::minimize):
2966         (WebCore::ContentExtensions::DFA::debugPrintDot):
2967         * contentextensions/DFA.h:
2968         * contentextensions/DFABytecodeCompiler.cpp:
2969         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNode):
2970         * contentextensions/DFAMinimizer.cpp: Added.
2971         (WebCore::ContentExtensions::DFAMinimizer::simplifyTransitions):
2972         (WebCore::ContentExtensions::DFAMinimizer::Partition::initialize):
2973         (WebCore::ContentExtensions::DFAMinimizer::Partition::markElementInCurrentGeneration):
2974         (WebCore::ContentExtensions::DFAMinimizer::Partition::refineGeneration):
2975         (WebCore::ContentExtensions::DFAMinimizer::Partition::iterateSet):
2976         (WebCore::ContentExtensions::DFAMinimizer::Partition::setIndex):
2977         (WebCore::ContentExtensions::DFAMinimizer::Partition::firstElementInSet):
2978         (WebCore::ContentExtensions::DFAMinimizer::Partition::size):
2979         (WebCore::ContentExtensions::DFAMinimizer::Partition::SetDescriptor::indexAfterMarkedElements):
2980         (WebCore::ContentExtensions::DFAMinimizer::Partition::SetDescriptor::end):
2981         (WebCore::ContentExtensions::DFAMinimizer::FullGraphPartition::FullGraphPartition):
2982         (WebCore::ContentExtensions::DFAMinimizer::FullGraphPartition::markNode):
2983         (WebCore::ContentExtensions::DFAMinimizer::FullGraphPartition::refinePartitions):
2984         (WebCore::ContentExtensions::DFAMinimizer::FullGraphPartition::splitByUniqueTransitions):
2985         (WebCore::ContentExtensions::DFAMinimizer::FullGraphPartition::splitByFallbackTransitions):
2986         (WebCore::ContentExtensions::DFAMinimizer::FullGraphPartition::nodeReplacement):
2987         (WebCore::ContentExtensions::DFAMinimizer::ActionKey::ActionKey):
2988         (WebCore::ContentExtensions::DFAMinimizer::ActionKey::isEmptyValue):
2989         (WebCore::ContentExtensions::DFAMinimizer::ActionKey::isDeletedValue):
2990         (WebCore::ContentExtensions::DFAMinimizer::ActionKeyHash::hash):
2991         (WebCore::ContentExtensions::DFAMinimizer::ActionKeyHash::equal):
2992         (WebCore::ContentExtensions::DFAMinimizer::minimize):
2993         * contentextensions/DFAMinimizer.h: Copied from Source/WebCore/contentextensions/DFA.h.
2994         * contentextensions/DFANode.h:
2995         * contentextensions/NFAToDFA.cpp:
2996         (WebCore::ContentExtensions::NFAToDFA::convert):
2997         (WebCore::ContentExtensions::simplifyTransitions): Deleted.
2998
2999 2015-04-14  Chris Dumez  <cdumez@apple.com>
3000
3001         ASSERT(frame().view() == this) assertion hit in FrameView::windowClipRect() on Windows bots
3002         https://bugs.webkit.org/show_bug.cgi?id=143723
3003
3004         Reviewed by Brent Fulgham.
3005
3006         ASSERT(frame().view() == this) in FrameView::windowClipRect() can be hit
3007         if the post layout timer timer fires after the page has entered page
3008         cache. Upon entering page cache, we call FrameView::unscheduleRelayout()
3009         to stop the layout timer if it is active, however, we don't stop the
3010         post-layout timer. Therefore, there was nothing preventing the
3011         post-layout timer from firing after entering page cache.
3012
3013         In this patch, we unschedule the post-layout timer in
3014         FrameView::unscheduleRelayout() to protect ourselves against this.
3015
3016         I think we were only seeing the assertion hit on Windows because this
3017         timer probably gets scheduled more frequently on Windows. On Mac, I
3018         rarely see it getting scheduled.
3019
3020         No new tests, should fix crashing tests on the bots.
3021
3022         * page/FrameView.cpp:
3023         (WebCore::FrameView::unscheduleRelayout):
3024
3025 2015-04-14  Chris Dumez  <cdumez@apple.com>
3026
3027         FrameView::m_frame should be a Ref<Frame>
3028         https://bugs.webkit.org/show_bug.cgi?id=143716
3029
3030         Reviewed by Andreas Kling.
3031
3032         FrameView::m_frame should be a Ref<Frame> instead of a RefPtr<Frame> as
3033         it can never be null.
3034
3035         * page/FrameView.cpp:
3036         (WebCore::FrameView::FrameView):
3037         (WebCore::FrameView::flushCompositingStateForThisFrame):
3038         (WebCore::FrameView::hasCompositedContentIncludingDescendants):
3039         (WebCore::FrameView::flushCompositingStateIncludingSubframes):
3040         (WebCore::FrameView::updateCanBlitOnScrollRecursively):
3041         (WebCore::FrameView::setIsOverlapped):
3042         (WebCore::FrameView::shouldUpdateCompositingLayersAfterScrolling):
3043         (WebCore::FrameView::renderedCharactersExceed):
3044         (WebCore::FrameView::updateLayerFlushThrottling):
3045         (WebCore::FrameView::serviceScriptedAnimations):
3046         (WebCore::FrameView::updateBackgroundRecursively):
3047         (WebCore::FrameView::adjustScrollStepForFixedContent):
3048         (WebCore::FrameView::paintContentsForSnapshot):
3049         (WebCore::FrameView::notifyWidgetsInAllFrames):
3050         (WebCore::FrameView::setExposedRect):
3051         (WebCore::FrameView::setViewportSizeForCSSViewportUnits):
3052         * page/FrameView.h:
3053
3054 2015-04-13  Simon Fraser  <simon.fraser@apple.com>
3055
3056         [iOS WK2] Interactive elements of developer.apple.com are broken
3057         https://bugs.webkit.org/show_bug.cgi?id=143692
3058         rdar://problem/19320087
3059
3060         Reviewed by Sam Weinig.
3061         
3062         When a composited RenderLayer had nodes in the scrolling tree by virtue of
3063         both position and overflow:scroll, and one of those reasons disappeared,
3064         we'd fail to remove the corresponding node from the scrolling tree. This
3065         could leave an overflow:scroll element behaving as if it were position:fixed.
3066         
3067         Fix by having RenderLayerCompositor::updateScrollCoordinationForThisFrame()
3068         detach the layer on a per-role basis.
3069
3070         Test: platform/ios-simulator-wk2/scrolling/remove-scrolling-role.html
3071
3072         * rendering/RenderLayerBacking.cpp:
3073         (WebCore::RenderLayerBacking::detachFromScrollingCoordinatorForRole):
3074         * rendering/RenderLayerBacking.h:
3075         * rendering/RenderLayerCompositor.cpp:
3076         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayerForRole):
3077         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer): Just moved.
3078         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): Call detachScrollCoordinatedLayerForRole()
3079         if the layer doesn't have the relevant scrolling reasons.
3080         * rendering/RenderLayerCompositor.h:
3081
3082 2015-04-14  Commit Queue  <commit-queue@webkit.org>
3083
3084         Unreviewed, rolling out r182794.
3085         https://bugs.webkit.org/show_bug.cgi?id=143714
3086
3087         readable-stream-templated.html fails on Debug bots (Requested
3088         by youenn on #webkit).
3089
3090         Reverted changeset:
3091
3092         "[Streams API] ReadableStream constructor start function
3093         should be able to close the stream"
3094         https://bugs.webkit.org/show_bug.cgi?id=143363
3095         http://trac.webkit.org/changeset/182794
3096
3097 2015-04-14  Per Arne Vollan  <peavo@outlook.com>
3098
3099         [WinCairo] Unreviewed build fix after r182707.
3100
3101         * platform/network/curl/MultipartHandle.cpp:
3102         (WebCore::MultipartHandle::didReceiveResponse):
3103
3104 2015-04-14  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
3105
3106         [Streams API] ReadableStream constructor start function should be able to close the stream
3107         https://bugs.webkit.org/show_bug.cgi?id=143363
3108
3109         Reviewed by Benjamin Poulain.
3110
3111         Implements https://streams.spec.whatwg.org/#close-readable-stream.
3112         When the "close" JS function is called, the stream is getting closed.
3113         The stream state is changed to close and if it has a reader, the reader gets closed as well:
3114         The reader resolves the closed promise and release the stream.
3115
3116         Enabled the possibility to resolve a promise with any JS value.
3117         This is used to resolve closed promise with jsUndefined and will be used for read promises.
3118
3119         Covered by reference tests that are now passing.
3120
3121         * Modules/streams/ReadableStream.cpp:
3122         (WebCore::ReadableStream::changeStateToClosed): Called by the JS function 'close'.
3123         * Modules/streams/ReadableStream.h:
3124         * Modules/streams/ReadableStreamReader.cpp:
3125         (WebCore::ReadableStreamReader::ReadableStreamReader):
3126         (WebCore::ReadableStreamReader::initialize): Added to handle state change at constructor time (in particular closed/errored state).
3127         (WebCore::ReadableStreamReader::releaseStream):
3128         (WebCore::ReadableStreamReader::closed): Storing the closed promise callbacks.
3129         (WebCore::ReadableStreamReader::changeStateToClosed): Resolution of closed promise.
3130         * Modules/streams/ReadableStreamReader.h:
3131         * bindings/js/JSDOMPromise.h:
3132         (WebCore::DeferredWrapper::resolve<JSC::JSValue>):
3133         * bindings/js/JSReadableStreamReaderCustom.cpp:
3134         (WebCore::JSReadableStreamReader::closed):
3135         * bindings/js/ReadableStreamJSSource.cpp:
3136         (WebCore::readableStreamSlotName):
3137         (WebCore::getReadableJSStream): Helper function to retrieve the stream from the exec state.
3138         (WebCore::closeReadableStreamFunction):
3139         (WebCore::createReadableStreamCloseFunction):
3140         (WebCore::createReadableStreamController):
3141         (WebCore::ReadableStreamJSSource::start):
3142         (WebCore::ReadableJSStreamReader::ReadableJSStreamReader): Deleted.
3143
3144 2015-04-13  Joonghun Park  <jh718.park@samsung.com>
3145
3146         Use modern for-loops in Document
3147         https://bugs.webkit.org/show_bug.cgi?id=143600
3148
3149         Reviewed by Darin Adler.
3150
3151         No new tests, no behavior changes.
3152
3153         * dom/Document.cpp:
3154         (WebCore::Document::visibilityStateChanged):
3155         (WebCore::Document::processBaseElement):
3156         (WebCore::Document::moveNodeIteratorsToNewDocument):
3157         (WebCore::Document::updateRangesAfterChildrenChanged):
3158         (WebCore::Document::nodeChildrenWillBeRemoved):
3159         (WebCore::Document::nodeWillBeRemoved):
3160         (WebCore::Document::textInserted):
3161         (WebCore::Document::textRemoved):
3162         (WebCore::Document::textNodesMerged):
3163         (WebCore::Document::textNodeSplit):
3164         (WebCore::Document::documentWillSuspendForPageCache):
3165         (WebCore::Document::documentDidResumeFromPageCache):
3166         (WebCore::Document::mediaVolumeDidChange):
3167         (WebCore::Document::privateBrowsingStateDidChange):
3168         (WebCore::Document::captionPreferencesChanged):
3169         (WebCore::Document::validateAutoSizingNodes):
3170         (WebCore::Document::resetAutoSizingNodes):
3171         (WebCore::Document::webkitExitFullscreen):
3172         (WebCore::Document::absoluteRegionForEventTargets):
3173
3174 2015-04-13  Manuel Rego Casasnovas  <rego@igalia.com>
3175
3176         [CSS Grid Layout] Columns set in percentages collapse to auto width
3177         https://bugs.webkit.org/show_bug.cgi?id=141435
3178
3179         Reviewed by David Hyatt.
3180
3181         Based on a patch by Sergio Villar Senin  <svillar@igalia.com>.
3182
3183         This patch adds 2 new new methods in RenderBox to determine if the grid
3184         has a definite size or not.
3185
3186         RenderGrid::gridTrackSize() was not checking properly if the grid has or
3187         not an indefinite size.
3188         The condition was including auto which is not indefinite per se. For
3189         example, auto is definite if the containing block is definite.
3190         As the new method is more expensive, we just call it when it's really
3191         needed to avoid performance regressions.
3192
3193         Finally we were setting the override logical width/height to -1 (no
3194         possible resolution) for all the items regardless if they've a relative
3195         width/height or a fixed one.
3196         Added the condition, including not only items with percentage logical
3197         width/height but also relative, to avoid overriding the value for items
3198         with fixed width/height as it's not needed.
3199
3200         Tests: fast/css-grid-layout/grid-item-with-percent-height-in-auto-height-grid-resolution.html
3201                fast/css-grid-layout/percent-intrinsic-track-breadth.html
3202                fast/css-grid-layout/percent-track-breadths-regarding-container-size.html
3203
3204         * rendering/RenderBox.cpp:
3205         (WebCore::logicalWidthIsResolvable):
3206         (WebCore::RenderBox::hasDefiniteLogicalWidth):
3207         (WebCore::RenderBox::percentageLogicalHeightIsResolvableFromBlock):
3208         (WebCore::RenderBox::hasRelativeLogicalWidth):
3209         * rendering/RenderBox.h:
3210         * rendering/RenderGrid.cpp:
3211         (WebCore::RenderGrid::hasDefiniteLogicalSize):
3212         (WebCore::RenderGrid::gridTrackSize):
3213         (WebCore::RenderGrid::logicalContentHeightForChild):
3214         (WebCore::RenderGrid::minContentForChild):
3215         (WebCore::RenderGrid::maxContentForChild):
3216         * rendering/RenderGrid.h:
3217
3218 2015-04-13  Chris Dumez  <cdumez@apple.com>
3219
3220         Regression: Scrolling on popsci.com spends too much time in FrameView::viewportsContentsChanged()
3221         https://bugs.webkit.org/show_bug.cgi?id=143675
3222
3223         Reviewed by Simon Fraser.
3224
3225         Optimize resumeVisibleImageAnimationsIncludingSubframes() so that the FrameViews'
3226         windowClipRect gets computed less often:
3227         - Cache the FrameView's windowClipRect before resuming image animations in subframes
3228           as calling windowClipRect() on those subframes' view is going to call windowClipRect()
3229           on their ancestors. This avoids a lot of unnecessary windowClipRect recomputations
3230           in deep frame trees.
3231         - Stop traversing the Frame tree if the current frame does not have a content
3232           renderer, as this means the subframes won't have one either.
3233         - Stop traversing the Frame tree if the current frame's view has an empty
3234           windowClipRect() as this means the windowClipRect will be empty for those
3235           subframes as well.
3236
3237         On popsci.com, this cuts down the number of uncached windowClipRect() calls by
3238         approximately half. I see viewportsContentsChanged() at ~0.4% when scrolling
3239         on popsci.com after this change.
3240
3241         * page/FrameView.cpp:
3242         (WebCore::FrameView::resumeVisibleImageAnimationsIncludingSubframes):
3243         (WebCore::FrameView::windowClipRect):
3244         * page/FrameView.h:
3245         * rendering/RenderView.cpp:
3246         (WebCore::RenderView::resumePausedImageAnimationsIfNeeded):
3247         * rendering/RenderView.h:
3248
3249 2015-04-13  Roger Fong  <roger_fong@apple.com>
3250
3251         Unreviewed. Set the title text of the placard added in r182631.
3252         https://bugs.webkit.org/show_bug.cgi?id=143585.
3253         <rdar://problem/12067439>
3254
3255         * Modules/mediacontrols/mediaControlsApple.js:
3256         (Controller.prototype.updateWirelessPlaybackStatus):
3257
3258 2015-04-10  Brent Fulgham  <bfulgham@apple.com>
3259
3260         Expand test infrastructure to support scrolling tests
3261         https://bugs.webkit.org/show_bug.cgi?id=143286
3262         <rdar://problem/20375516>
3263
3264         Reviewed by Simon Fraser.
3265
3266         No new functionality.
3267
3268         This series of changes adds a new singleton class, 'WheelEventTestTrigger', which encapsulates a
3269         function object to be fired when scroll events are finished. The object also keeps track of reasons
3270         why the test should not yet fire (e.g., 'rubberbanding' is active) so that tests do not incorrectly
3271         check rendering state in the middle of an animation.
3272
3273         This code is not yet hooked up to the rendering system, and so does not have any effect on behavior.
3274
3275         * CMakeLists.txt: Add new WheelEventTestTrigger files.
3276         * WebCore.vcxproj/WebCore.vcxproj: Ditto.
3277         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
3278         * WebCore.xcodeproj/project.pbxproj: Ditto.
3279         * page/MainFrame.cpp:
3280         (WebCore::MainFrame::MainFrame): Add new member to constructor.
3281         (WebCore::MainFrame::testTrigger): Added.
3282         (WebCore::MainFrame::ensureTestTrigger): Added.
3283         (WebCore::MainFrame::clearTrigger): Added.
3284         * page/MainFrame.h:
3285         * page/WheelEventTestTrigger.cpp: Added.
3286         (WebCore::WheelEventTestTrigger::WheelEventTestTrigger):
3287         (WebCore::WheelEventTestTrigger::createWeakPtr):
3288         (WebCore::WheelEventTestTrigger::clearAllTestDeferrals):
3289         (WebCore::WheelEventTestTrigger::setTestNotificationCallback):
3290         (WebCore::WheelEventTestTrigger::deferTestsForReason):
3291         (WebCore::WheelEventTestTrigger::removeTestDeferralForReason):
3292         (WebCore::WheelEventTestTrigger::triggerTestTimerFired):
3293         * page/WheelEventTestTrigger.h: Added.
3294
3295 2015-04-13  Jer Noble  <jer.noble@apple.com>
3296
3297         [iOS] When entering optimized fullscreen, standard fullscreen view should exit.
3298         https://bugs.webkit.org/show_bug.cgi?id=143615
3299
3300         Reviewed by Simon Fraser.
3301
3302         When entering optimized fullscreen from standard fullscreen, the original fullscreen
3303         view should animate out.
3304
3305         The original method for entering optimized fullscreen is deprecated, so replace it with
3306         the new method (which doesn't take completion blocks) and use delegate methods to detect
3307         when the animation transition completes.
3308
3309         * platform/Logging.h:
3310         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
3311         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3312         (boolString): Added; use for logging boolean parameters.
3313         (-[WebAVPlayerController playerViewControllerWillStartOptimizedFullscreen:]): Pass to WebVideoFullscreenInterfaceAVKit.
3314         (-[WebAVPlayerController playerViewControllerDidStartOptimizedFullscreen:]): Ditto.
3315         (-[WebAVPlayerController playerViewControllerWillStopOptimizedFullscreen:]): Ditto.
3316         (-[WebAVPlayerController playerViewControllerDidStopOptimizedFullscreen:]): Ditto.
3317         (-[WebAVPlayerController playerViewControllerWillCancelOptimizedFullscreen:]): Ditto.
3318         (-[WebAVPlayerController playerViewControllerDidCancelOptimizedFullscreen:]): Ditto.
3319         (-[WebAVPlayerController playerViewController:restoreUserInterfaceForOptimizedFullscreenStopWithCompletionHandler:]): Ditto.
3320         (-[WebAVVideoLayer setPlayerViewController:]): Remove the KVO registration; now handled by above delegate methods.
3321         (WebVideoFullscreenInterfaceAVKit::setupFullscreenInternal): Add logging.
3322         (WebVideoFullscreenInterfaceAVKit::enterFullscreen): Ditto.
3323         (WebVideoFullscreenInterfaceAVKit::enterFullscreenOptimized): Use new -startOptimizedFullscreen method.
3324         (WebVideoFullscreenInterfaceAVKit::enterFullscreenStandard): Add logging.
3325         (WebVideoFullscreenInterfaceAVKit::exitFullscreenInternal): Ditto.
3326         (WebVideoFullscreenInterfaceAVKit::cleanupFullscreenInternal): Use hasMode() & isMode() rather than checking m_mode directly.
3327         (WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen): Ditto.
3328         (WebVideoFullscreenInterfaceAVKit::preparedToReturnToInline): Callback now stored on this object rather than the WebAVPlayerController.
3329         (WebVideoFullscreenInterfaceAVKit::mayAutomaticallyShowVideoOptimized): Moved.
3330         (WebVideoFullscreenInterfaceAVKit::fullscreenMayReturnToInline): Added; store the passed callback.
3331         (WebVideoFullscreenInterfaceAVKit::willStartOptimizedFullscreen): Exit out of standard fullscreen mode if necessary.
3332         (WebVideoFullscreenInterfaceAVKit::didStartOptimizedFullscreen): Moved from the start lambda in enterFullscreenOptimized().
3333         (WebVideoFullscreenInterfaceAVKit::willStopOptimizedFullscreen): Call the model's requestExitFullscreen() method.
3334         (WebVideoFullscreenInterfaceAVKit::didStopOptimizedFullscreen): Moved from the stop lambda in enterFullscreenOptimized().
3335         (WebVideoFullscreenInterfaceAVKit::willCancelOptimizedFullscreen): Call the model's requestExitFullscreen() method.
3336         (WebVideoFullscreenInterfaceAVKit::didCancelOptimizedFullscreen): Moved from the stop lambda in enterFullscreenOptimized().
3337         (WebVideoFullscreenInterfaceAVKit::prepareForOptimizedFullscreenStopWithCompletionHandler): Moved from -playerViewController:shouldExitFullScreenWithReason:.
3338         (WebVideoFullscreenInterfaceAVKit::setMode): Added; Call fullscreenModeChanged() if necessary.
3339         (WebVideoFullscreenInterfaceAVKit::clearMode): Ditto.
3340         (-[WebAVVideoLayer observeValueForKeyPath:ofObject:change:context:]): Deleted.
3341         (WebVideoFullscreenInterfaceAVKit::setIsOptimized): Deleted.
3342
3343 2015-04-13  Brent Fulgham  <bfulgham@apple.com>
3344
3345         [Win] Unreviewed fix after r182757.
3346
3347         * platform/win/FileSystemWin.cpp:
3348         (WebCore::renameFile): Checked in wrong version.
3349
3350 2015-04-13  Brent Fulgham  <bfulgham@apple.com>
3351
3352         [Win] Unreviewed fix after r182161.
3353
3354         The change caused Windows to lose Media UI, since the new 'getFileSize'
3355         signature was being improperly used for a 'UInt8'-based string.
3356
3357         Fix was to provide implementations for the two new methods, and to make
3358         sure RenderThemeWin was using the proper signature.
3359
3360         This should actually be a little more efficient, since we have the file
3361         handle when we call this new method. Previously, a Windows 'find file' was
3362         being done with the requested path, which was unnecessary work.
3363
3364         * platform/win/FileSystemWin.cpp:
3365         (WebCore::getFileSizeFromByHandleFileInformationStructure): Added helper function.
3366         (WebCore::getFileSize): Provide implementation.
3367         (WebCore::renameFile):
3368         * rendering/RenderThemeWin.cpp:
3369         (WebCore::RenderThemeWin::stringWithContentsOfFile): Use the file handle to
3370         get the file size, rather than using the path-based size lookup (which involves
3371         performing an unnecessary file search.
3372
3373 2015-04-13  Brady Eidson  <beidson@apple.com>
3374
3375         Share sheets from Share menus appear outside the browser window.
3376         <rdar://problem/20455592> and https://bugs.webkit.org/show_bug.cgi?id=143620
3377
3378         Reviewed by Darin Adler.
3379
3380         * page/ContextMenuController.h:
3381         (WebCore::ContextMenuController::client):
3382
3383 2015-04-13  Andreas Kling  <akling@apple.com>
3384
3385         Rebaseline bindings tests.
3386
3387         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
3388         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
3389         * bindings/scripts/test/JS/JSTestEventTarget.h:
3390         * bindings/scripts/test/JS/JSTestException.h:
3391         * bindings/scripts/test/JS/JSTestInterface.h:
3392         * bindings/scripts/test/JS/JSTestObj.h:
3393         * bindings/scripts/test/JS/JSTestTypedefs.h:
3394
3395 2015-04-13  Jer Noble  <jer.noble@apple.com>
3396
3397         [iOS] Treat a 'not found' media option index as the 'off' track.
3398         https://bugs.webkit.org/show_bug.cgi?id=143672
3399
3400         Reviewed by Eric Carlson.
3401
3402         The UIProcess will pass in UINT64_MAX for the index of the legible option to select. Treat this
3403         as if the captionOffMenuItem() had been selected to avoid a null dereference.
3404
3405         * platform/ios/WebVideoFullscreenModelVideoElement.mm:
3406         (WebVideoFullscreenModelVideoElement::selectLegibleMediaOption):
3407
3408 2015-04-13  Said Abou-Hallawa  <sabouhallawa@apple.com>
3409
3410         list-style-image with SVG image renders at incorrect size.
3411         https://bugs.webkit.org/show_bug.cgi?id=141367.
3412
3413         Reviewed by Darin Adler.
3414         
3415         This patch imports https://codereview.chromium.org/197203003.
3416
3417         When using an SVG as list marker image, don't unconditionally set the
3418         dimensions to a square with the dimensions of ascent / 2, but rather
3419         determine a suitable size using intrinsic dimensions (and ratio).
3420
3421         Test: svg/as-list-image/svg-list-image-intrinsic-size-1.html
3422
3423         * rendering/RenderListMarker.cpp:
3424         (WebCore::RenderListMarker::updateContent):
3425
3426 2015-04-13  Said Abou-Hallawa  <sabouhallawa@apple.com>
3427
3428         Canvas drawImage() has a security hole when the image isn't yet fully loaded.
3429         https://bugs.webkit.org/show_bug.cgi?id=58681.
3430
3431         Reviewed by Darin Adler.
3432
3433         There is a race condition which may happen if an image from a different
3434         origin is drawn on a canvas before it finishes loading. The check to taint
3435         the canvas comes before drawing it. This check returns false if the image
3436         is not completely loaded because we check the URL of the resource response.
3437         If after this check and before the drawing, the image finishes loading, the
3438         canvas will not be tainted but the image will be drawn.
3439         
3440         The fix is to move the check to taint the canvas after drawing the image.
3441         The only problem with this solution is basically the opposite of this bug:
3442         we will become stricter than before with images which are from a different
3443         origin and before they finish loading. The image has not finished loading,
3444         so we do not draw it. Before we check for tainting, the image finishes
3445         loading. So we decide to taint the canvas even the image is not drawn.
3446         
3447         But this should not be a security issue anymore. I personally do not know
3448         if it is even a correctness issue or not.
3449
3450         Test: http/tests/canvas/canvas-tainted-after-draw-image.html
3451
3452         * html/canvas/CanvasRenderingContext2D.cpp:
3453         (WebCore::CanvasRenderingContext2D::drawImage):
3454
3455 2015-04-13  Beth Dakin  <bdakin@apple.com>
3456
3457         Add force property to MouseEvents
3458         https://bugs.webkit.org/show_bug.cgi?id=143569
3459         -and corresponding-
3460         rdar://problem/20472954
3461
3462         Reviewed by Darin Adler.
3463
3464         This patch removes WebKitMouseForceEvent and uses a MouseEvent everywhere that it 
3465         was used. That’s possible because this patch also adds a force property to all 
3466         MouseEvents and to PlatformMouseEvent.
3467
3468         Remove WebKitMouseForceEvent.
3469         * CMakeLists.txt:
3470         * DerivedSources.cpp:
3471         * DerivedSources.make:
3472         * WebCore.vcxproj/WebCore.vcxproj:
3473         * WebCore.vcxproj/WebCore.vcxproj.filters:
3474         * WebCore.xcodeproj/project.pbxproj:
3475         * dom/DOMAllInOne.cpp:
3476
3477         Create MouseEvents with the appropriate force instead of WebKitMouseForceEvents. 
3478         This patch also gets rid of the PlatformMouseEvent parameter for these events. 
3479         They were re-using the cached mousedown event before, which they never should have 
3480         done. Instead, we create PlatformMouseEvents inside these functions and then use 
3481         that to make MouseEvents.
3482         * dom/Element.cpp:
3483         (WebCore::Element::dispatchMouseForceWillBegin):
3484         (WebCore::Element::dispatchMouseForceChanged):
3485         (WebCore::Element::dispatchMouseForceDown):
3486         (WebCore::Element::dispatchMouseForceUp):
3487         (WebCore::Element::dispatchMouseForceClick):
3488         (WebCore::Element::dispatchMouseForceCancelled):
3489         * dom/Element.h:
3490
3491         No More WebKitMouseForceEvent.
3492         * dom/EventNames.in:
3493
3494         Add force to MouseEvent.
3495         * dom/MouseEvent.cpp:
3496         (WebCore::MouseEvent::create):
3497         (WebCore::MouseEvent::MouseEvent):
3498         (WebCore::MouseEvent::cloneFor):
3499         (WebCore::SimulatedMouseEvent::SimulatedMouseEvent):
3500         * dom/MouseEvent.h:
3501         (WebCore::MouseEvent::force):
3502         (WebCore::MouseEvent::setForce):
3503         * dom/MouseEvent.idl:
3504
3505         No More WebKitMouseForceEvent.
3506         * dom/WebKitMouseForceEvent.cpp: Removed.
3507         * dom/WebKitMouseForceEvent.h: Removed.
3508         * dom/WebKitMouseForceEvent.idl: Removed.
3509
3510         PlatformMouseEvent now takes a force parameter.
3511         * dom/WheelEvent.cpp:
3512         (WebCore::WheelEvent::WheelEvent):
3513         * page/ContextMenuController.cpp:
3514         (WebCore::ContextMenuController::showContextMenuAt):
3515         * page/DragController.cpp:
3516         (WebCore::createMouseEvent):
3517         * page/EventHandler.cpp:
3518         (WebCore::EventHandler::dispatchDragEvent):
3519         (WebCore::EventHandler::sendContextMenuEventForKey):
3520         (WebCore::EventHandler::fakeMouseMoveEventTimerFired):
3521
3522         We don’t need lastMouseDownEvent() anymore. We were using it to avoid creating new 
3523         PlatformMouseEvents for the force events, but we fix that in this patch.
3524         (WebCore::EventHandler::lastMouseDownEvent): Deleted.
3525         * page/EventHandler.h:
3526
3527         At force to PlatformMouseEvent.
3528         * platform/PlatformMouseEvent.h:
3529         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
3530         (WebCore::PlatformMouseEvent::force):
3531         * replay/SerializationMethods.cpp:
3532         (JSC::EncodingTraits<PlatformMouseEvent>::encodeValue):
3533         (JSC::EncodingTraits<PlatformMouseEvent>::decodeValue):
3534
3535 2015-04-13  Andreas Kling  <akling@apple.com>
3536
3537         Don't segregate heap objects based on Structure immortality.
3538         <https://webkit.org/b/143638>
3539
3540         Reviewed by Darin Adler.
3541
3542         * bindings/js/JSDOMBinding.h:
3543         * bindings/scripts/CodeGeneratorJS.pm:
3544         (GenerateHeader):
3545         (GeneratePrototypeDeclaration):
3546         * bridge/objc/objc_runtime.h:
3547         * bridge/runtime_array.h:
3548         * bridge/runtime_method.h:
3549         * bridge/runtime_object.h:
3550
3551 2015-04-13  Simon Fraser  <simon.fraser@apple.com>
3552
3553         Fixed position element is truncated if moved onscreen by a transform
3554         https://bugs.webkit.org/show_bug.cgi?id=143655
3555         rdar://problem/15020044
3556
3557         Reviewed by Darin Adler.
3558         
3559         Our "don't do layout if transform changes" code was too aggressive.
3560         If an element changes between having a transform and not having one, we
3561         really need to do a layout since so much else depends on transforms. In
3562         this particular case, we clip position:fixed elements to the viewport if
3563         they are not transformed, and were failing to re-evaluate this when a
3564         transform was added. Doing a layout fixes this.
3565
3566         Test: compositing/geometry/fixed-transformed.html
3567
3568         * rendering/style/RenderStyle.cpp:
3569         (WebCore::RenderStyle::changeRequiresLayout):
3570         * rendering/style/StyleTransformData.h:
3571         (WebCore::StyleTransformData::hasTransform):
3572
3573 2015-04-12  Darin Adler  <darin@apple.com>
3574
3575         [Cocoa] Localizable strings are inconsistent and need to be regenerated
3576         https://bugs.webkit.org/show_bug.cgi?id=143661
3577         rdar://problem/19634388
3578
3579         Reviewed by Dan Bernstein.
3580
3581         * English.lproj/Localizable.strings: Updated by running the
3582         update-webkit-localizable-strings script.
3583
3584 2015-04-13  Darin Adler  <darin@apple.com>
3585
3586         Remove needless recreation of URL in NavigationScheduler::scheduleLocationChange
3587         https://bugs.webkit.org/show_bug.cgi?id=143662
3588
3589         Reviewed by Sam Weinig.
3590
3591         * loader/NavigationScheduler.cpp:
3592         (WebCore::NavigationScheduler::scheduleLocationChange): Removed unnecessary code
3593         to convert a URL to a String and then back into a URL.
3594
3595 2015-04-13  Csaba Osztrogonác  <ossy@webkit.org>
3596
3597         [cmake] Add ENABLE(ATTACHMENT_ELEMENT) to the build system
3598         https://bugs.webkit.org/show_bug.cgi?id=143664
3599
3600         Reviewed by Gyuyoung Kim.
3601
3602         * page/efl/DragControllerEfl.cpp:
3603         (WebCore::DragController::declareAndWriteAttachment): Added stub implementation to fix the build.
3604         * page/gtk/DragControllerGtk.cpp:
3605         (WebCore::DragController::declareAndWriteAttachment): Added stub implementation to fix the build.
3606
3607 2015-04-13  Sungmann Cho  <sungmann.cho@navercorp.com>
3608
3609         [Curl] Small improvements to CurlCacheEntry::parseResponseHeaders()
3610         https://bugs.webkit.org/show_bug.cgi?id=143597
3611
3612         Reviewed by Csaba Osztrogonác.
3613
3614         Most lines of code in CurlCacheEntry::parseResponseHeaders() don't need to be
3615         executed if the response has "no-cache" or "no-store" directive, but we are
3616         checking these conditions in the middle of the method. We can move this to the
3617         beginning of the method for efficiency.
3618
3619         No new tests, no behavior change.
3620
3621         * platform/network/curl/CurlCacheEntry.cpp:
3622         (WebCore::CurlCacheEntry::parseResponseHeaders):
3623
3624 2015-04-13  Sergio Villar Senin  <svillar@igalia.com>
3625
3626         Unreviewed, build fix after r182704.
3627
3628         * rendering/RenderGrid.cpp:
3629         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
3630
3631 2015-04-13  Joonghun Park  <jh718.park@samsung.com>
3632
3633         Use std::unique_ptr instead of PassOwnPtr|OwnPtr for ResourceResponse
3634         https://bugs.webkit.org/show_bug.cgi?id=143056
3635
3636         Reviewed by Gyuyoung Kim.
3637
3638         No new tests, no behavior changes.
3639
3640         * loader/WorkerThreadableLoader.cpp:
3641         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
3642         (WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveResponse):
3643         * platform/CrossThreadCopier.h:
3644         * platform/network/ResourceResponseBase.cpp:
3645         (WebCore::ResourceResponseBase::adopt):
3646         (WebCore::ResourceResponseBase::copyData):
3647         * platform/network/ResourceResponseBase.h:
3648         * platform/network/cf/ResourceResponse.h:
3649         (WebCore::ResourceResponse::doPlatformCopyData):
3650         (WebCore::ResourceResponse::doPlatformAdopt):
3651         * platform/network/curl/ResourceResponse.h:
3652         (WebCore::ResourceResponse::doPlatformCopyData):
3653         (WebCore::ResourceResponse::doPlatformAdopt):
3654         * platform/network/soup/ResourceResponse.h:
3655         (WebCore::ResourceResponse::doPlatformCopyData):
3656         (WebCore::ResourceResponse::doPlatformAdopt):
3657
3658 2015-04-10  Sergio Villar Senin  <svillar@igalia.com>
3659
3660         [CSS Grid Layout] Support marking/unmarking tracks as infinitely growable
3661         https://bugs.webkit.org/show_bug.cgi?id=141431
3662
3663         Reviewed by Darin Adler.
3664
3665         As explained here
3666         http://lists.w3.org/Archives/Public/www-style/2014Mar/0512.html we
3667         sometimes need to consider that some tracks are infinitely
3668         growable even when they are really not, in order to produce more
3669         "natural" results.
3670
3671         For example the following case:
3672           grid-template-columns: auto auto;
3673           item 1 in column 1 with min-content = max-content = 10px;
3674           item 2 in columns 1-2 with min-content = 30, max-content = 100px;
3675
3676         will produce (45px, 55px) without this patch. But considering the
3677         second column as infinitely growable the result is (10px, 90px), a
3678         more "natural" result because column 1 just needs to be 10px to
3679         accommodate item 1. From now on we can flag GridTracks so that
3680         they can infinitely grow even when the growth limit is finite.
3681
3682         Apart from that distributeSpaceToTracks() is now unconditionally
3683         called even though the extra space is 0. That's because it
3684         computes the plannedSize value.
3685
3686         Test: fast/css-grid-layout/mark-as-infinitely-growable.html
3687
3688         * rendering/RenderGrid.cpp:
3689         (WebCore::GridTrack::infiniteGrowthPotential):
3690         (WebCore::GridTrack::infinitelyGrowable):
3691         (WebCore::GridTrack::setInfinitelyGrowable):
3692         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
3693         (WebCore::RenderGrid::trackSizeForTrackSizeComputationPhase): Updated with new phase.
3694         (WebCore::RenderGrid::shouldProcessTrackForTrackSizeComputationPhase): Ditto.
3695         (WebCore::RenderGrid::trackShouldGrowBeyondGrowthLimitsForTrackSizeComputationPhase): Ditto.
3696         (WebCore::RenderGrid::updateTrackSizeForTrackSizeComputationPhase): Ditto.
3697         (WebCore::RenderGrid::currentItemSizeForTrackSizeComputationPhase): Ditto.
3698         (WebCore::RenderGrid::markAsInfinitelyGrowableForTrackSizeComputationPhase):
3699         New helper method which does the mark/unmark just for growth limits.
3700         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
3701         (WebCore::sortByGridTrackGrowthPotential): Use
3702         infiniteGrowthPotential() for sorting.
3703         (WebCore::RenderGrid::distributeSpaceToTracks):
3704         * rendering/RenderGrid.h:
3705
3706 2015-04-12  Benjamin Poulain  <benjamin@webkit.org>
3707
3708         Legacy scroll behavior on HTMLBodyElement should only apply to the first body element of a document
3709         https://bugs.webkit.org/show_bug.cgi?id=143651
3710
3711         Reviewed by Sam Weinig.
3712
3713         WebKit has some very weird behaviors for the scroll methods on body. This patch
3714         address the first bug: only the first body element should have the legacy behavior.
3715
3716         The relevant text in spec:
3717         -http://dev.w3.org/csswg/cssom-view/#dom-element-scrollleft
3718         -http://dev.w3.org/csswg/cssom-view/#dom-element-scrolltop
3719         -http://dev.w3.org/csswg/cssom-view/#dom-element-scrollwidth
3720         -http://dev.w3.org/csswg/cssom-view/#dom-element-scrollheight
3721
3722         Tests: fast/dom/Element/body-scrollHeight-basics-quirks.html
3723                fast/dom/Element/body-scrollLeft-basics-quirks.html
3724                fast/dom/Element/body-scrollTop-basics-quirks.html
3725                fast/dom/Element/body-scrollWidth-basics-quirks.html
3726                fast/dom/Element/detached-body-element-does-not-scroll-main-frame-with-scrollLeft.html
3727                fast/dom/Element/detached-body-element-does-not-scroll-main-frame-with-scrollTop.html
3728
3729         * html/HTMLBodyElement.cpp:
3730         (WebCore::HTMLBodyElement::isFirstBodyElementOfDocument):
3731         (WebCore::HTMLBodyElement::scrollLeft):
3732         (WebCore::HTMLBodyElement::setScrollLeft):
3733         (WebCore::HTMLBodyElement::scrollTop):
3734         (WebCore::HTMLBodyElement::setScrollTop):
3735         (WebCore::HTMLBodyElement::scrollHeight):
3736         (WebCore::HTMLBodyElement::scrollWidth):
3737         * html/HTMLBodyElement.h:
3738
3739 2015-04-12  Sungmann Cho  <sungmann.cho@navercorp.com>
3740
3741         Fix trival typos related to the word "coordinate".
3742         https://bugs.webkit.org/show_bug.cgi?id=143644
3743
3744         Reviewed by Alexey Proskuryakov.
3745
3746         No new tests, no behavior change.
3747
3748         * rendering/RenderBox.cpp:
3749         (WebCore::RenderBox::layoutOverflowRectForPropagation):
3750
3751 2015-04-12  Simon Fraser  <simon.fraser@apple.com>
3752
3753         Scrollbars in composited overflow and iframes fail to render on Mac
3754         https://bugs.webkit.org/show_bug.cgi?id=143647
3755         rdar://problem/20340544
3756
3757         Reviewed by Darin Adler.
3758
3759         When adding support for drawing scrollbars on the scrolling thread, we inadvertently
3760         disabled scrollbar drawing in other composited, main-thread scrolling configurations.
3761         
3762         Fix by having Scrollbar::supportsUpdateOnSecondaryThread() only return true if
3763         the scrollable area is using async scrolling.
3764         
3765         Sadly, we can't layout-test this.
3766
3767         * platform/Scrollbar.cpp:
3768         (WebCore::Scrollbar::supportsUpdateOnSecondaryThread):
3769
3770 2015-04-12  Simon Fraser  <simon.fraser@apple.com>
3771
3772         Selects don't scroll at some aspect ratios
3773         https://bugs.webkit.org/show_bug.cgi?id=143649
3774         rdar://problem/19365694
3775
3776         Reviewed by Darin Adler.
3777         
3778         Fix width/height flip in RenderListBox which caused us to fail to scroll when
3779         the list was wider than the scroll height.
3780         
3781         We're generally confused about RenderListBox scroll offsets (webkit.org/b/143648)
3782         but this fixes the immediate problem.
3783
3784         Test: fast/forms/listbox-visible-size.html
3785
3786         * rendering/RenderListBox.h:
3787
3788 2015-04-12  Simon Fraser  <simon.fraser@apple.com>
3789
3790         Too much repainting on scrolling with fixed backgrounds
3791         https://bugs.webkit.org/show_bug.cgi?id=143637
3792         rdar://problem/20245243
3793
3794         Reviewed by Darin Adler.
3795         
3796         FrameView::scrollContentsSlowPath() would repaint the entire viewport if there were
3797         any slow-repaint objects (those with background-attachment: fixed) and the contents
3798         were using compositing for scrolling.
3799         
3800         This is wrong; we only need to issue repaint for the slow-repaint renderers,
3801         and, if the frame is hosted in a compositing layer and not using compositing for scrolling,
3802         repaint that hosting layer.
3803
3804         Tests: compositing/repaint/iframes/composited-iframe-with-fixed-background-doc-repaint.html
3805                compositing/repaint/iframes/compositing-iframe-scroll-repaint.html
3806                compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint.html
3807                platform/mac-wk2/tiled-drawing/fixed-background-scroll-repaint.html
3808
3809         * page/FrameView.cpp:
3810         (WebCore::FrameView::scrollContentsSlowPath):
3811
3812 2015-04-11  Matt Baker  <mattbaker@apple.com>
3813
3814         Web Inspector: create content view and details sidebar for Frames timeline
3815         https://bugs.webkit.org/show_bug.cgi?id=143533
3816
3817         Reviewed by Timothy Hatcher.
3818
3819         Refactoring: RunLoop prefix changed to RenderingFrame.
3820
3821         * inspector/InspectorTimelineAgent.cpp:
3822         (WebCore::InspectorTimelineAgent::internalStart):
3823         (WebCore::toProtocol):
3824         * inspector/InspectorTimelineAgent.h:
3825
3826 2015-04-11  Chris Dumez  <cdumez@apple.com>
3827
3828         Stop referring to outdated RFC2616 in CacheValidation.cpp
3829         https://bugs.webkit.org/show_bug.cgi?id=143619
3830
3831         Reviewed by Darin Adler.
3832
3833         Stop referring to outdated RFC2616 in CacheValidation.cpp and refer to
3834         the newer RFC7230 & RFC7234. Also update some variables to match the
3835         naming in the RFC for clarity.
3836
3837         No behavior change.
3838
3839         * platform/network/CacheValidation.cpp:
3840         (WebCore::updateResponseHeadersAfterRevalidation):
3841         (WebCore::computeCurrentAge):
3842         (WebCore::computeFreshnessLifetimeForHTTPFamily):
3843         (WebCore::isCacheHeaderSeparator):
3844         (WebCore::parseCacheControlDirectives):
3845
3846 2015-04-11  Ryosuke Niwa  <rniwa@webkit.org>
3847
3848         WebKit places caret in front of pasted Numbers cells instead of behind
3849         https://bugs.webkit.org/show_bug.cgi?id=143627
3850
3851         Reviewed by Darin Adler.
3852
3853         The bug was caused by Position::downstream not respecting modern position types inside a table.
3854         Fixed it by using Position::atStartOfNode which respects before/after positions.
3855
3856         This bug doesn't reproduce when there is no whitespace after td element in the pasted content
3857         because positionAtEndOfInsertedContent() will be inside the last pasted cell inside
3858         ReplaceSelectionCommand::completeHTMLReplacement in those cases. This related but separate bug
3859         is tracked in https://webkit.org/b/143628.
3860
3861         Tests: editing/pasteboard/paste-table-with-unrendered-text-nodes.html
3862
3863         * dom/Position.cpp:
3864         (WebCore::Position::downstream):
3865
3866 2015-04-11  Yusuke Suzuki  <utatane.tea@gmail.com>
3867
3868         [ES6] Enable Symbol in web pages
3869         https://bugs.webkit.org/show_bug.cgi?id=143375
3870
3871         Reviewed by Ryosuke Niwa.
3872
3873         * inspector/InspectorFrontendClientLocal.cpp:
3874         (WebCore::InspectorFrontendClientLocal::InspectorFrontendClientLocal):
3875
3876 2015-04-10  Roger Fong  <roger_fong@apple.com>
3877
3878         Hide volume controls when playing wirelessly.
3879         https://bugs.webkit.org/show_bug.cgi?id=143621.
3880         <rdar://problem/20490673>
3881
3882         Reviewed by Darin Adler.
3883
3884         * Modules/mediacontrols/mediaControlsApple.js:
3885         (Controller.prototype.updateWirelessPlaybackStatus):
3886
3887 2015-04-10  Alexey Proskuryakov  <ap@apple.com>
3888
3889         Build fix.
3890
3891         * WebCore.xcodeproj/project.pbxproj: Make LaunchServicesSPI.h a private header
3892         instead of project, as it's used in WebKit.
3893
3894 2015-04-08  Sam Weinig  <sam@webkit.org>
3895
3896         Allow LaunchServices to handle URLs on link navigations
3897         <rdar://problem/19446826>
3898         https://bugs.webkit.org/show_bug.cgi?id=143544
3899
3900         Reviewed by Anders Carlsson.
3901
3902         * WebCore.xcodeproj/project.pbxproj:
3903         * platform/spi/ios/LaunchServicesSPI.h: Added.
3904         Add new SPI header.
3905
3906 2015-04-10  Bem Jones-Bey  <bjonesbe@adobe.com>
3907
3908         Unreviewed, added CSS Shapes to features.json file.
3909
3910         * features.json:
3911
3912 2015-04-10  Andy Estes  <aestes@apple.com>
3913
3914         [Content Filtering] Support modifying request URLs
3915         https://bugs.webkit.org/show_bug.cgi?id=143599
3916         rdar://problem/20442560
3917
3918         Reviewed by Darin Adler.
3919
3920         Tests: contentfiltering/modify-request-url.html
3921                http/tests/contentfiltering/modify-redirect-request-url.html
3922
3923         Allow NEFilterSource to modifiy request URLs. Also teach MockContentFilter to do the same for testing.
3924
3925         * platform/cocoa/NetworkExtensionContentFilter.mm:
3926         (WebCore::NetworkExtensionContentFilter::willSendRequest): If NEFilterSource provided a string representing a
3927         valid URL in decisionInfo[NEFilterSourceOptionsRedirectURL], then used that as the request URL.
3928         * platform/spi/cocoa/NEFilterSourceSPI.h: Temporarily defined NEFilterSourceOptionsRedirectURL.
3929         * testing/MockContentFilter.cpp:
3930         (WebCore::MockContentFilter::willSendRequest): If settings() has a valid modifiedRequestURL, use it as the
3931         request URL. Only do so once MockContentFilter has reached its decision point so that both initial requests and
3932         redirect requests can be tested.
3933         * testing/MockContentFilterSettings.h: Added modifiedRequestURL.
3934         (WebCore::MockContentFilterSettings::modifiedRequestURL): Ditto.
3935         (WebCore::MockContentFilterSettings::setModifiedRequestURL): Ditto.
3936         * testing/MockContentFilterSettings.idl: Ditto.
3937
3938 2015-04-10  Zalan Bujtas  <zalan@apple.com>
3939
3940         showRenderTree: Include the render object to the inlinebox output.
3941         https://bugs.webkit.org/show_bug.cgi?id=143610
3942
3943         This helps to match the inlinebox and its renderer.
3944
3945         Reviewed by Antti Koivisto.
3946
3947         * rendering/InlineBox.cpp:
3948         (WebCore::InlineBox::showLineBox):
3949
3950 2015-04-09  Roger Fong  <roger_fong@apple.com>
3951
3952         Update wireless player placard for OSX.
3953         https://bugs.webkit.org/show_bug.cgi?id=143585.
3954         <rdar://problem/12067439>
3955
3956         Reviewed by Eric Carlson.
3957
3958         * Modules/mediacontrols/mediaControlsApple.css:
3959         Adjust button positioning and svg.
3960         (audio::-webkit-media-controls-wireless-playback-picker-button):
3961         (audio::-webkit-media-controls-wireless-playback-picker-button.playing):
3962         Style the wireless playback status placard, small and big versions.
3963         (audio::-webkit-media-controls-wireless-playback-status):
3964         (audio::-webkit-media-controls-wireless-playback-text):
3965         (audio::-webkit-media-controls-wireless-playback-text-top):
3966         (audio::-webkit-media-controls-wireless-playback-text-bottom):
3967         (audio::-webkit-media-controls-wireless-playback-status.small):
3968         (audio::-webkit-media-controls-wireless-playback-text-top.small):
3969         (audio::-webkit-media-controls-wireless-playback-text-bottom.small):
3970         * Modules/mediacontrols/mediaControlsApple.js:
3971         Add new wireless player placard elements.
3972         (Controller.prototype.createControls):
3973         (Controller.prototype.configureInlineControls):
3974         Make sure to switch between small and big placards when switching between fullscreen and small videos.
3975         (Controller.prototype.configureFullScreenControls):
3976         (Controller.prototype.handleFullscreenChange):
3977         (Controller.prototype.updateWirelessPlaybackStatus):
3978
3979 2015-04-10  Eric Carlson  <eric.carlson@apple.com>
3980
3981         [Mac] Refactor MediaPlaybackTarget
3982         https://bugs.webkit.org/show_bug.cgi?id=143571
3983
3984         Reviewed by Jer Noble.
3985
3986         * WebCore.xcodeproj/project.pbxproj:
3987         * dom/Document.cpp:
3988         (WebCore::Document::addPlaybackTargetPickerClient): Don't call client if page playback target
3989             is NULL.
3990         (WebCore::Document::didChoosePlaybackTarget): MediaPlaybackTarget is passed as a Ref<>
3991         * dom/Document.h:
3992
3993         * html/HTMLMediaElement.cpp:
3994         (WebCore::HTMLMediaElement::setWirelessPlaybackTarget): MediaPlaybackTarget is passed as a Ref<>
3995         * html/HTMLMediaElement.h:
3996
3997         * html/HTMLMediaSession.cpp:
3998         (WebCore::HTMLMediaSession::HTMLMediaSession): Don't initialize m_playbackTarget.