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