[Streams API] Refactor ReadableJSStream and ReadableStreamJSSource
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-05-04  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
2
3         [Streams API] Refactor ReadableJSStream and ReadableStreamJSSource
4         https://bugs.webkit.org/show_bug.cgi?id=144387
5
6         Reviewed by Darin Adler.
7
8         Made ReadableStreamReader a private class of ReadableJSStream.
9         Simplified ReadableJSStream construction so that binding constructor does not need to know about ReadableStreamJSSource. 
10
11         No functional change, existing tests cover the changes.
12
13         * Modules/streams/ReadableStream.h:
14         (WebCore::ReadableStream::source): Added to implement jsSource(), needed by ReadableJSStream.
15         * bindings/js/JSReadableStreamCustom.cpp:
16         (WebCore::constructJSReadableStream): Simplified to not have to handle source creation.
17         * bindings/js/ReadableStreamJSSource.cpp:
18         (WebCore::ReadableStreamJSSource::globalObject): Helper function to be used in other future methods.
19         (WebCore::ReadableStreamJSSource::start):
20         (WebCore::ReadableJSStream::create):
21         (WebCore::ReadableJSStream::createReader):
22         (WebCore::ReadableJSStream::jsSource):
23         (WebCore::ReadableJSStream::Reader::create):
24         (WebCore::ReadableJSStream::Reader::Reader):
25         * bindings/js/ReadableStreamJSSource.h:
26
27 2015-05-04  Csaba Osztrogonác  <ossy@webkit.org>
28
29         Remove move-js-headers.sh
30         https://bugs.webkit.org/show_bug.cgi?id=144323
31
32         Reviewed by Daniel Bates.
33
34         move-js-headers.sh was only used by the Wx port, which has been removed from trunk long ago.
35
36         * move-js-headers.sh: Removed.
37
38 2015-05-04  Csaba Osztrogonác  <ossy@webkit.org>
39
40         [ARM] Don't compare unsigned chars to EOF (-1)
41         https://bugs.webkit.org/show_bug.cgi?id=144439
42
43         Reviewed by Geoffrey Garen.
44
45         * platform/linux/MemoryPressureHandlerLinux.cpp:
46         (WebKit::nextToken): Don't cast return value of fgetc() to char.
47
48 2015-05-04  Manuel Rego Casasnovas  <rego@igalia.com>
49
50         [CSS Grid Layout] Wrong computed style for named grid lines in implicit tracks
51         https://bugs.webkit.org/show_bug.cgi?id=144449
52
53         Reviewed by Sergio Villar Senin.
54
55         If there're implicit tracks then trackPositions is bigger than
56         trackSizes, so we need to use the proper index to append the trailing
57         <ident>s in valueForGridTrackList().
58
59         Test: fast/css-grid-layout/named-grid-lines-computed-style-implicit-tracks.html
60
61         * css/CSSComputedStyleDeclaration.cpp:
62         (WebCore::valueForGridTrackList):
63
64 2015-05-03  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
65
66         Purge PassRefPtr in WebCore/html
67         https://bugs.webkit.org/show_bug.cgi?id=144543
68
69         Reviewed by Andreas Kling.
70
71         Change PassRefPtr in create() factory functions with Ref. In some functions,
72         it returns RefPtr when it might have a chance to return nullptr.
73
74         No new tests, no behavior changes.
75
76         * Modules/encryptedmedia/MediaKeySession.cpp:
77         (WebCore::MediaKeySession::sendError):
78         * html/DOMFormData.h:
79         (WebCore::DOMFormData::create):
80         * html/HTMLMediaElement.cpp:
81         (WebCore::HTMLMediaElement::mediaPlayerCreateResourceLoader):
82         * html/HTMLMediaElement.h:
83         * html/MediaError.h:
84         (WebCore::MediaError::create):
85         * html/MediaKeyError.h:
86         (WebCore::MediaKeyError::create):
87         * html/canvas/CanvasGradient.h:
88         * html/canvas/CanvasProxy.cpp:
89         (WebCore::CanvasProxy::create):
90         * html/canvas/CanvasProxy.h:
91         * html/canvas/WebGLActiveInfo.h:
92         (WebCore::WebGLActiveInfo::create):
93         * html/canvas/WebGLContextAttributes.h:
94         * html/canvas/WebGLContextGroup.h:
95         * html/canvas/WebGLProgram.h:
96         * html/canvas/WebGLQuery.h:
97         * html/canvas/WebGLRenderbuffer.h:
98         * html/canvas/WebGLSampler.h:
99         * html/canvas/WebGLShader.h:
100         * html/canvas/WebGLShaderPrecisionFormat.h:
101         * html/canvas/WebGLSync.h:
102         * html/canvas/WebGLTexture.h:
103         * html/canvas/WebGLTransformFeedback.h:
104         * html/canvas/WebGLUniformLocation.h:
105         * html/canvas/WebGLVertexArrayObjectOES.h:
106         * html/shadow/ImageControlsRootElement.cpp:
107         (WebCore::ImageControlsRootElement::maybeCreate):
108         * html/shadow/ImageControlsRootElement.h:
109         * html/shadow/MediaControlElements.cpp:
110         (WebCore::MediaControlPanelElement::create):
111         (WebCore::MediaControlPanelEnclosureElement::create):
112         (WebCore::MediaControlOverlayEnclosureElement::create):
113         (WebCore::MediaControlTimelineContainerElement::create):
114         (WebCore::MediaControlVolumeSliderContainerElement::create):
115         (WebCore::MediaControlStatusDisplayElement::create):
116         (WebCore::MediaControlPanelMuteButtonElement::create):
117         (WebCore::MediaControlVolumeSliderMuteButtonElement::create):
118         (WebCore::MediaControlPlayButtonElement::create):
119         (WebCore::MediaControlOverlayPlayButtonElement::create):
120         (WebCore::MediaControlSeekForwardButtonElement::create):
121         (WebCore::MediaControlSeekBackButtonElement::create):
122         (WebCore::MediaControlRewindButtonElement::create):
123         (WebCore::MediaControlReturnToRealtimeButtonElement::create):
124         (WebCore::MediaControlToggleClosedCaptionsButtonElement::create):
125         (WebCore::MediaControlClosedCaptionsContainerElement::create):
126         (WebCore::MediaControlClosedCaptionsTrackListElement::create):
127         (WebCore::MediaControlTimelineElement::create):
128         (WebCore::MediaControlPanelVolumeSliderElement::create):
129         (WebCore::MediaControlFullscreenVolumeSliderElement::create):
130         (WebCore::MediaControlFullscreenButtonElement::create):
131         (WebCore::MediaControlFullscreenVolumeMinButtonElement::create):
132         (WebCore::MediaControlFullscreenVolumeMaxButtonElement::create):
133         (WebCore::MediaControlTimeRemainingDisplayElement::create):
134         (WebCore::MediaControlCurrentTimeDisplayElement::create):
135         * html/shadow/MediaControlElements.h:
136         * html/shadow/MediaControlsApple.h:
137         (WebCore::MediaControlsAppleEventListener::create):
138         * html/shadow/MeterShadowElement.h:
139         (WebCore::MeterInnerElement::create):
140         (WebCore::MeterBarElement::create):
141         (WebCore::MeterValueElement::create):
142         * html/shadow/ProgressShadowElement.h:
143         (WebCore::ProgressInnerElement::create):
144         (WebCore::ProgressBarElement::create):
145         (WebCore::ProgressValueElement::create):
146         * html/shadow/mac/ImageControlsRootElementMac.cpp:
147         (WebCore::ImageControlsRootElement::maybeCreate):
148         * html/track/TextTrackCueList.h:
149         (WebCore::TextTrackCueList::create):
150         * html/track/VTTCue.cpp:
151         (WebCore::VTTCue::create):
152         * html/track/VTTCue.h:
153         (WebCore::VTTCue::create):
154         * html/track/VTTRegion.h:
155         * html/track/VideoTrack.h:
156         * html/track/VideoTrackList.h:
157         * html/track/WebVTTElement.cpp:
158         (WebCore::WebVTTElement::create):
159         * html/track/WebVTTElement.h:
160         * html/track/WebVTTParser.h:
161         * platform/graphics/MediaPlayer.h:
162         (WebCore::MediaPlayerClient::mediaPlayerCreateResourceLoader):
163
164 2015-05-03  Simon Fraser  <simon.fraser@apple.com>
165
166         Make some static data const
167         https://bugs.webkit.org/show_bug.cgi?id=144552
168
169         Reviewed by Andreas Kling.
170
171         Turn baseTable and shiftTable into const data.
172
173         * platform/graphics/FormatConverter.cpp:
174
175 2015-05-02  Simon Fraser  <simon.fraser@apple.com>
176
177         Assertion failure (!needsLayout()) loading inkedmag.com
178         https://bugs.webkit.org/show_bug.cgi?id=144528
179         rdar://problem/20788681
180
181         Reviewed by Darin Adler.
182         
183         When animated GIFs get into catch-up mode, which is common on inkedmag.com,
184         BitmapImage::advanceAnimation() can synchronously call it's observer's
185         animationAdvanced(). This could cause RenderImage::repaintOrMarkForLayout()
186         to repaint or mark itself as needing layout in the middle of painting.
187         If painting multiple tiles, this could occur when painting the first tile,
188         and then painting the second tile would assert in RenderView::paint().
189         
190         It's always wrong to synchronously call the observer when advancing
191         the animation, since this happens when painting, and you can't repaint
192         when painting. The long comment and call to startAnimation(DoNotCatchUp)
193         was required to explain and work around this, but it's simpler to just
194         advance the animation on a zero-delay timer.
195         
196         Special handling is required for the case where internalAdvanceAnimation()
197         is catching up, and reaches the end of a non-repeating image; there, we
198         have to set a flag and do the notify on a zero-delay timer.
199         
200         Lots of comment cleanup.
201
202         Test: fast/images/set-needs-layout-in-painting.html
203
204         * platform/graphics/BitmapImage.cpp:
205         (WebCore::BitmapImage::BitmapImage):
206         (WebCore::BitmapImage::startTimer): Utility to create and start the timer.
207         (WebCore::BitmapImage::repetitionCount):
208         (WebCore::BitmapImage::startAnimation): Early return in the DoNotCatchUp clause.
209         If skipping, and internalAdvanceAnimation() returns false (meaning it must have
210         reached the end), then queue up a notify. Change the normal behavior to just
211         start the timer.
212         (WebCore::BitmapImage::stopAnimation):
213         (WebCore::BitmapImage::internalAdvanceAnimation): Notify if the flag is set.
214         * platform/graphics/BitmapImage.h:
215         * rendering/RenderReplaced.cpp:
216         (WebCore::RenderReplaced::paint): Add a SetLayoutNeededForbiddenScope to
217         detect setNeedsLayouts when painting replaced elements, including images.
218
219 2015-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
220
221         [GTK][EFL] Unify platform display handling
222         https://bugs.webkit.org/show_bug.cgi?id=144517
223
224         Reviewed by Martin Robinson.
225
226         There are several places were we are handling the X display
227         connection:
228
229         - GLContext::sharedX11Display() creates a new connection.
230         - X11Helper::nativeDisplay() creates a new connection.
231         - BackingStoreBackendCairoX11 uses the GTK+ shared connection.
232         - NetscapePlugin::x11HostDisplay() uses the GTK+/ecore shared connection
233         - The rest of the GTK+ code uses the shared GTK+ connection
234
235         And then we also have WaylandDisplay and the code to check if the
236         current display is wayland or X11.
237         We could unify all these to share the same connection to reduce
238         the amount of ifdefs and ensure a single connection. That will
239         also allow us to use "smart pointers" for the X resources that
240         need a Display* to be freed.
241
242         * PlatformEfl.cmake: Add new files to compilation.
243         * PlatformGTK.cmake: Move some files to WebCore_SOURCES sinc ethey
244         don't use GTK+ anymore, and add new files to compilation.
245         * platform/graphics/GLContext.cpp:
246         (WebCore::GLContext::cleanupActiveContextsAtExit): Remove the
247         custom X11 connection.
248         (WebCore::GLContext::createContextForWindow): Check if the shared
249         display is Wayland to create a EGL context in such case.
250         * platform/graphics/PlatformDisplay.cpp: Added.
251         (WebCore::PlatformDisplay::createPlatformDisplay): Creates the
252         shared display, using the GTK+/ecore shared connection.
253         (WebCore::PlatformDisplay::sharedDisplay): Return the shared display.
254         * platform/graphics/PlatformDisplay.h: Added.
255         * platform/graphics/egl/GLContextEGL.cpp:
256         (WebCore::sharedEGLDisplay): Use PlatformDisplay::sharedDisplay()
257         to get the native display.
258         (WebCore::GLContextEGL::createPixmapContext): Ditto.
259         * platform/graphics/glx/GLContextGLX.cpp:
260         (WebCore::GLContextGLX::createWindowContext): Ditto.
261         (WebCore::GLContextGLX::createPbufferContext): Ditto.
262         (WebCore::GLContextGLX::createPixmapContext): Ditto.
263         (WebCore::GLContextGLX::createContext): Ditto.
264         (WebCore::GLContextGLX::~GLContextGLX): Ditto.
265         (WebCore::GLContextGLX::defaultFrameBufferSize): Ditto.
266         (WebCore::GLContextGLX::makeContextCurrent): Ditto.
267         (WebCore::GLContextGLX::swapBuffers): Ditto.
268         (WebCore::GLContextGLX::cairoDevice): Ditto.
269         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
270         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext): Ditto.
271         * platform/graphics/surfaces/glx/X11Helper.cpp:
272         (WebCore::X11Helper::nativeDisplay): Ditto.
273         * platform/graphics/wayland/PlatformDisplayWayland.cpp: Renamed from Source/WebCore/platform/graphics/wayland/WaylandDisplay.cpp.
274         (WebCore::PlatformDisplayWayland::globalCallback):
275         (WebCore::PlatformDisplayWayland::globalRemoveCallback):
276         (WebCore::PlatformDisplayWayland::create): Renamed instance() as
277         create() since the single instance is now handled by PlatformDisplay.
278         (WebCore::PlatformDisplayWayland::PlatformDisplayWayland):
279         (WebCore::PlatformDisplayWayland::createSurface):
280         (WebCore::PlatformDisplayWayland::createSharingGLContext):
281         * platform/graphics/wayland/PlatformDisplayWayland.h: Renamed from Source/WebCore/platform/graphics/wayland/WaylandDisplay.h.
282         * platform/graphics/x11/PlatformDisplayX11.cpp: Added.
283         (WebCore::PlatformDisplayX11::PlatformDisplayX11):
284         (WebCore::PlatformDisplayX11::~PlatformDisplayX11):
285         * platform/graphics/x11/PlatformDisplayX11.h: Added.
286         * platform/gtk/GtkUtilities.cpp:
287         (WebCore::getDisplaySystemType): Deleted.
288         * platform/gtk/GtkUtilities.h:
289
290 2015-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
291
292         [GTK] API tests crashing on debug builds due to extra unref
293         https://bugs.webkit.org/show_bug.cgi?id=144508
294
295         Reviewed by Mario Sanchez Prada.
296
297         The problem is that we were assuming that when a new DOMWindow is
298         created, the DOM object cache was notified about the previous
299         DOMWindow being destroyed before objects for the new DOMWindow are
300         added to the cache. However, that's not always the case and we
301         only create a DOMWindowObserver for the first DOMWindow. We need
302         to keep a pointer to the DOMWindow being observed to clear() the
303         cache and create a new DOMWindowObserver when it changes in the
304         Frame.
305
306         Fixes crashes in several unit tests in debug builds.
307
308         * bindings/gobject/DOMObjectCache.cpp:
309
310 2015-05-03  Alexey Proskuryakov  <ap@apple.com>
311
312         Remove timer alignment logging that I added earler today.
313
314         * page/Settings.cpp: (WebCore::Settings::setDOMTimerAlignmentInterval):
315
316 2015-05-02  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
317
318         Purge PassRefPtr create() factory functions in html 
319         https://bugs.webkit.org/show_bug.cgi?id=144522
320
321         Reviewed by Darin Adler.
322
323         Return Ref instead of PassRefPtr in create() factory functions in html, because the factory
324         can't return null. This patch is a first step to purge in html. Following patch is going to
325         be uploaded.
326
327         No new tests, no behavior changes.
328
329         * html/FileInputType.cpp:
330         (WebCore::UploadButtonElement::create):
331         (WebCore::UploadButtonElement::createForMultiple):
332         * html/MediaController.cpp:
333         (MediaController::create):
334         * html/MediaController.h:
335         * html/canvas/WebGLBuffer.cpp:
336         (WebCore::WebGLBuffer::create):
337         * html/canvas/WebGLBuffer.h:
338         * html/canvas/WebGLContextAttributes.cpp:
339         (WebCore::WebGLContextAttributes::create):
340         * html/canvas/WebGLContextAttributes.h:
341         * html/canvas/WebGLContextGroup.cpp:
342         (WebCore::WebGLContextGroup::create):
343         * html/canvas/WebGLContextGroup.h:
344         * html/canvas/WebGLFramebuffer.cpp:
345         (WebCore::WebGLFramebuffer::create):
346         * html/canvas/WebGLFramebuffer.h:
347         * html/canvas/WebGLProgram.cpp:
348         (WebCore::WebGLProgram::create):
349         * html/canvas/WebGLProgram.h:
350         * html/canvas/WebGLQuery.cpp:
351         (WebCore::WebGLQuery::create):
352         * html/canvas/WebGLQuery.h:
353         * html/canvas/WebGLRenderbuffer.cpp:
354         (WebCore::WebGLRenderbuffer::create):
355         * html/canvas/WebGLRenderbuffer.h:
356         * html/canvas/WebGLSampler.cpp:
357         (WebCore::WebGLSampler::create):
358         * html/canvas/WebGLSampler.h:
359         * html/canvas/WebGLShader.cpp:
360         (WebCore::WebGLShader::create):
361         * html/canvas/WebGLShader.h:
362         * html/canvas/WebGLShaderPrecisionFormat.cpp:
363         (WebCore::WebGLShaderPrecisionFormat::create):
364         * html/canvas/WebGLShaderPrecisionFormat.h:
365         * html/canvas/WebGLSync.cpp:
366         (WebCore::WebGLSync::create):
367         * html/canvas/WebGLSync.h:
368         * html/canvas/WebGLTexture.cpp:
369         (WebCore::WebGLTexture::create):
370         * html/canvas/WebGLTexture.h:
371         * html/canvas/WebGLTransformFeedback.cpp:
372         (WebCore::WebGLTransformFeedback::create):
373         * html/canvas/WebGLTransformFeedback.h:
374         * html/canvas/WebGLUniformLocation.cpp:
375         (WebCore::WebGLUniformLocation::create):
376         * html/canvas/WebGLUniformLocation.h:
377         * html/canvas/WebGLVertexArrayObject.cpp:
378         (WebCore::WebGLVertexArrayObject::create):
379         * html/canvas/WebGLVertexArrayObject.h:
380         * html/canvas/WebGLVertexArrayObjectOES.cpp:
381         (WebCore::WebGLVertexArrayObjectOES::create):
382         * html/canvas/WebGLVertexArrayObjectOES.h:
383
384 2015-05-02  Andreas Kling  <akling@apple.com>
385
386         Style recalc always causes detach from shared StyleRareNonInheritedData.
387         <https://webkit.org/b/144530>
388
389         Reviewed by Darin Adler.
390
391         StyleResolver::adjustStyleForMaskImages() was always calling RenderStyle::ensureMaskLayers()
392         when we were in style recalc. This caused the RenderStyle to COW off from the previously
393         shared StyleRareNonInheritedData even if nothing actually changes.
394
395         This patch adds an early return to adjustStyleForMaskImages() when the previous style had
396         no mask images. Further refinements could be made, but this covers the most common case where
397         we don't have any mask images at all.
398
399         * css/StyleResolver.cpp:
400         (WebCore::StyleResolver::adjustStyleForMaskImages):
401
402 2015-05-02  Alexey Proskuryakov  <ap@apple.com>
403
404         fast/frames/flattening/iframe-flattening-resize-event-count.html times out on Yosemite WK2
405         https://bugs.webkit.org/show_bug.cgi?id=144155
406
407         Unreviewed, will roll out soon.
408
409         Added some temporary logging to better see if alignment is indeed the culprit.
410
411         * page/Settings.cpp: (WebCore::Settings::setDOMTimerAlignmentInterval):
412
413 2015-05-02  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
414
415         Use Ref instead of PassRefPtr in WebCore/svg 
416         https://bugs.webkit.org/show_bug.cgi?id=144479
417
418         Reviewed by Darin Adler.
419
420         Remove remained PassRefPtr in svg.
421
422         No new tests, no behavior changes.
423
424         * svg/SVGFontFaceSrcElement.cpp:
425         (WebCore::SVGFontFaceSrcElement::srcValue):
426         * svg/SVGFontFaceSrcElement.h:
427         * svg/properties/SVGPropertyInfo.h:
428
429 2015-05-02  Simon Fraser  <simon.fraser@apple.com>
430
431         Small cleanup in BitmapImage
432         https://bugs.webkit.org/show_bug.cgi?id=144515
433
434         Reviewed by Darin Adler.
435
436         Use an enum for the internalAdvanceAnimation() argument, with a default.
437         
438         Wrap the clearing of the timer in a clearTimer() function, called from
439         stopAnimation(). This fixes the jarring reading of BitmapImage::internalAdvanceAnimation(),
440         which used to start by calling stopAnimation().
441
442         * platform/graphics/BitmapImage.cpp:
443         (WebCore::BitmapImage::clearTimer):
444         (WebCore::BitmapImage::startAnimation):
445         (WebCore::BitmapImage::stopAnimation):
446         (WebCore::BitmapImage::advanceAnimation):
447         (WebCore::BitmapImage::internalAdvanceAnimation):
448         * platform/graphics/BitmapImage.h:
449         * platform/graphics/Image.h:
450
451 2015-05-01  Simon Fraser  <simon.fraser@apple.com>
452
453         Avoid compositing updates after style recalcs which have no compositing implications
454         https://bugs.webkit.org/show_bug.cgi?id=144502
455
456         Reviewed by Darin Adler.
457         
458         After r183461, we have reliable information about whether a style change with zero
459         diff can be reliably ignored. Use that information to track whether a given
460         recalcStyle() does anything which should force a compositing update.
461         
462         This eliminates up to 40% of the post-recalcStyle compositing updates on some pages.
463         
464         Add Internals API to test.
465
466         Test: compositing/updates/no-style-change-updates.html
467
468         * dom/Document.cpp:
469         (WebCore::Document::recalcStyle): Tell the FrameView we're going to recalc style.
470         * page/FrameView.cpp:
471         (WebCore::FrameView::willRecalcStyle): Pass it on to the compositor.
472         (WebCore::FrameView::updateCompositingLayersAfterStyleChange): Move the code
473         that was here into RenderLayerCompositor::didRecalcStyleWithNoPendingLayout().
474         * page/FrameView.h:
475         * rendering/RenderLayerCompositor.cpp:
476         (WebCore::RenderLayerCompositor::willRecalcStyle): Reset the m_layerNeedsCompositingUpdate flag.
477         (WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout): Bail on the update if
478         no layers changed.
479         (WebCore::RenderLayerCompositor::updateCompositingLayers): Logging. Increment m_compositingUpdateCount,
480         which is used for testing.
481         (WebCore::RenderLayerCompositor::layerStyleChanged): Set the m_layerNeedsCompositingUpdate flag.
482         (WebCore::RenderLayerCompositor::startTrackingCompositingUpdates): Reset the counter.
483         (WebCore::RenderLayerCompositor::compositingUpdateCount):
484         * rendering/RenderLayerCompositor.h:
485         * testing/Internals.cpp:
486         (WebCore::Internals::startTrackingCompositingUpdates):
487         (WebCore::Internals::compositingUpdateCount):
488         * testing/Internals.h:
489         * testing/Internals.idl:
490
491 2015-05-01  Andreas Kling  <akling@apple.com>
492
493         Reproducible crash removing name attribute from <img> node
494         <https://webkit.org/b/144371>
495         <rdar://problem/17198583>
496
497         Reviewed by Darin Adler.
498
499         The problem here was with HTMLImageElement::getNameAttribute(), which relies
500         on Element::hasName() to avoid slow attribute lookups when the attribute
501         is already known not to be present. Unfortunately hasName() uses an ElementData
502         flag that wasn't getting updated until after the call to parseAttribute().
503
504         This patch fixes the issue by moving the code that updates the hasName() flag
505         before the parseAttribute() virtual dispatch.
506
507         Test: fast/dom/HTMLImageElement/remove-name-id-attribute-from-image.html
508
509         * dom/Element.cpp:
510         (WebCore::Element::attributeChanged):
511
512 2015-05-01  Eric Carlson  <eric.carlson@apple.com>
513
514         Postpone caption style sheet creation
515         https://bugs.webkit.org/show_bug.cgi?id=144499
516
517         Reviewed by Simon Fraser.
518         
519         Generating and inserting the caption user style sheet is expensive so don't do it until
520         we see a text track, and only do it for the first video element in a PageGroup.
521
522         Test: media/track/track-user-stylesheet.html
523
524         * html/HTMLMediaElement.cpp:
525         (WebCore::HTMLMediaElement::registerWithDocument): Only register for caption preferences
526         changes if we have done so before.
527         (WebCore::HTMLMediaElement::unregisterWithDocument): Only unregister for caption preferences
528         changes if we registered for them.
529         (WebCore::HTMLMediaElement::addTextTrack): Register for caption preference changes.
530         * html/HTMLMediaElement.h:
531
532         * page/CaptionUserPreferencesMediaAF.cpp:
533         (WebCore::CaptionUserPreferencesMediaAF::setInterestedInCaptionPreferenceChanges): Only
534         generate the style sheet when called for the first time.
535
536 2015-05-01  Dean Jackson  <dino@apple.com>
537
538         [iOS] Scrubber display is broken if the buffered range is empty
539         https://bugs.webkit.org/show_bug.cgi?id=144511
540
541         Reviewed by Eric Carlson.
542
543         Make sure that if video.buffered returns an empty list, we
544         still draw the scrubber background correctly.
545
546         * Modules/mediacontrols/mediaControlsiOS.js:
547         (ControllerIOS.prototype.drawTimelineBackground): Ensure that buffered
548         is always at least as big as the current time.
549
550 2015-05-01  Roger Fong  <roger_fong@apple.com>
551
552         Media control volume slider should be vertical to avoid flickering issues.
553         https://bugs.webkit.org/show_bug.cgi?id=144496.
554         <rdar://problem/20451328>
555
556         Reviewed by Darin Adler.
557
558         * Modules/mediacontrols/mediaControlsApple.css:
559         Resize and reposition the volume box so that it does not have to rotated via a transform.
560         (audio::-webkit-media-controls-panel):
561         (audio::-webkit-media-controls-panel .volume-box): Also set overflow: hidden so we can't interact
562              with the volume slider while the volume box is hidden.
563         (audio::-webkit-media-controls-panel .volume-box:active):
564         Rotate and position the volume slider via transforms. Make sure it's not transformed in the fullscreen controls.
565         (video::-webkit-media-controls-volume-slider):
566         (video:-webkit-full-screen::-webkit-media-controls-volume-slider):
567
568 2015-05-01  Brent Fulgham  <bfulgham@apple.com>
569
570         Expand test infrastructure to support scrolling tests (Part 4): Scroll Snap Support
571         https://bugs.webkit.org/show_bug.cgi?id=144482
572
573         Reviewed by Simon Fraser.
574
575         New tests will be landed in a second patch.
576
577         The new WheelEventTestTriggers do not work properly with scroll snap points, because some test deferral notifications
578         need to be triggered for state changes on the scrolling thread. This required the following changes:
579         1. A flag indicating that we want to know about WheelEvent state changes needed to be propagated to the scrolling thread,
580            so that tests could be deferred until Scrolling thread rubberband or scroll-snap animations had completed.
581         2. The ScrollingNodeID needed to be used for registering and clearing deferrals.
582         3. The scrolling thread needed a way to dispatch messages to the main thread indicating that we should (or should not)
583            defer tests due to scrolling actions.
584
585         Note that a future patch will extend this support to include the RemoteScrollingTree.
586
587         * page/WheelEventTestTrigger.cpp:
588         (WebCore::WheelEventTestTrigger::deferTestsForReason): Added some logging features.
589         (WebCore::WheelEventTestTrigger::removeTestDeferralForReason): Ditto.
590         (WebCore::dumpState): Helper function for logging test deferral state.
591         (WebCore::WheelEventTestTrigger::triggerTestTimerFired): Added some logging features.
592         * page/scrolling/AsyncScrollingCoordinator.cpp:
593         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated): Make sure that the scrolling thread is
594         told that it needs to send scrolling state back to the main thread. Only do this if we are in testing mode.
595         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll): The scrollingNodeID should be
596         used as the identifier for this operation, not the page address.
597         (WebCore::AsyncScrollingCoordinator::deferTestsForReason): Added. receives messages from the scrolling thread
598         and notifies the testing infrastructure.
599         (WebCore::AsyncScrollingCoordinator::removeTestDeferralForReason): Ditto.
600         * page/scrolling/AsyncScrollingCoordinator.h:
601         * page/scrolling/ScrollingStateScrollingNode.cpp:
602         (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode): When cloning the ScrollingStateScrollingNode,
603         include the testing mode state.
604         (WebCore::ScrollingStateScrollingNode::setExpectsWheelEventTestTrigger): Added.
605         * page/scrolling/ScrollingStateScrollingNode.h:
606         (WebCore::ScrollingStateScrollingNode::expectsWheelEventTestTrigger): Added.
607         * page/scrolling/ScrollingTree.h:
608         (WebCore::ScrollingTree::deferTestsForReason): Added stub.
609         (WebCore::ScrollingTree::removeTestDeferralForReason): Ditto.
610         * page/scrolling/ThreadedScrollingTree.cpp:
611         (WebCore::ThreadedScrollingTree::deferTestsForReason): Added. Dispatches messages from the scrolling thread to the
612         main thread.
613         (WebCore::ThreadedScrollingTree::removeTestDeferralForReason): Ditto.
614         * page/scrolling/ThreadedScrollingTree.h:
615         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
616         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
617         (WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac): Initialize testing state flag.
618         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren): If the 'ExpectsWheelEventTestTrigger' flag is
619         set, update local state.
620         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent): If we are testing, and the wheel event should be handled
621         asynchronously, tell the testing infrastructure we need to wait for the thread state to sync.
622         (WebCore::ScrollingTreeFrameScrollingNodeMac::deferTestsForReason): Added. Notifies test system we need to defer tests
623         until we notify them. Also used by the ScrollController during animations.
624         (WebCore::ScrollingTreeFrameScrollingNodeMac::removeTestDeferralForReason): Ditto.
625         * platform/Logging.h:
626         * platform/ScrollAnimator.cpp:
627         (WebCore::ScrollAnimator::deferTestsForReason): Added. Used by ScrollController during animation. This updates the
628         testing infrastructure directly, since it is running in the same process and main thread.
629         (WebCore::ScrollAnimator::removeTestDeferralForReason): Ditto.
630         * platform/ScrollAnimator.h:
631         * platform/cocoa/ScrollController.h:
632         (WebCore::ScrollControllerClient::deferTestsForReason): Change client API.
633         (WebCore::ScrollControllerClient::removeTestDeferralForReason): Ditto.
634         (WebCore::ScrollControllerClient::testTrigger): Deleted.
635         * platform/cocoa/ScrollController.mm:
636         (WebCore::ScrollController::startSnapRubberbandTimer): Use new client API.
637         (WebCore::ScrollController::stopSnapRubberbandTimer): Ditto.
638         (WebCore::ScrollController::startScrollSnapTimer): Ditto.
639         (WebCore::ScrollController::stopScrollSnapTimer): Ditto.
640
641 2015-05-01  Joseph Pecoraro  <pecoraro@apple.com>
642
643         Inline some small methods instead of them being EXPORT'd and out of line
644         https://bugs.webkit.org/show_bug.cgi?id=144498
645
646         Reviewed by Darin Adler.
647
648         * page/Page.cpp:
649         (WebCore::Page::testTrigger): Deleted.
650         (WebCore::Page::clearTrigger): Deleted.
651         (WebCore::Page::expectsWheelEventTriggers): Deleted.
652         * page/Page.h:
653         (WebCore::Page::testTrigger):
654         (WebCore::Page::clearTrigger):
655         (WebCore::Page::expectsWheelEventTriggers):
656
657 2015-05-01  Dan Bernstein  <mitz@apple.com>
658
659         WebCore part of <rdar://problem/8636045> Back/forward navigation to an error page in Safari breaks the back-forward list
660         https://bugs.webkit.org/show_bug.cgi?id=144501
661
662         Reviewed by Darin Adler.
663
664         Test: TestWebKitAPI/Tests/WebKit2Cocoa/LoadAlternateHTMLString.mm
665
666         Normally, loading substitute data (such as an error page) creates a new back-forward list
667         item. FrameLoader has a mechanism that detects when a substitute data load occurs during
668         handling of a provisional load error and prevents the creation of a new back-forwards list
669         item in that case if the unreachable URL is the same as the failing provisional URL. This
670         mechanism was broken in WebKit2, where handling the provisional load error is asynchronous.
671
672         The fix is to capture some state (namely, the failing provisional URL) when dispatching the
673         load error and allow it to be restored when loading the substitute data.
674
675         * loader/FrameLoader.cpp:
676         (WebCore::FrameLoader::FrameLoader): Removed initialization of
677         m_delegateIsHandlingProvisionalLoadError.
678         (WebCore::FrameLoader::shouldReloadToHandleUnreachableURL): Instead of checking
679         m_delegateIsHandlingProvisionalLoadError and if true using the provisional document loader’s
680         URL, check m_provisionalLoadErrorBeingHandledURL.
681         (WebCore::FrameLoader::checkLoadCompleteForThisFrame): Instead of checking and setting
682         m_delegateIsHandlingProvisionalLoadError, use m_provisionalLoadErrorBeingHandledURL.
683         * loader/FrameLoader.h:
684         (WebCore::FrameLoader::provisionalLoadErrorBeingHandledURL): Added this getter. The client
685         can call this from its override of dispatchDidFailProvisionalLoad and store the result.
686         (WebCore::FrameLoader::setProvisionalLoadErrorBeingHandledURL): Added this setter. The
687         client can call this prior to loading substitute data if it’s done as part of handling a
688         previously-dispatched didFailProvisionalLoad.
689
690 2015-05-01  Martin Robinson  <mrobinson@igalia.com>
691
692         USE(...) macro should expect unprefixed variables
693         https://bugs.webkit.org/show_bug.cgi?id=144454
694
695         Reviewed by Daniel Bates.
696
697         * DerivedSources.make: Replace all occurrences WTF_USE with USE.
698         * PlatformEfl.cmake: Ditto.
699         * PlatformGTK.cmake: Ditto.
700         * bindings/objc/PublicDOMInterfaces.h: Ditto.
701         * config.h: Ditto.
702         * crypto/mac/SerializedCryptoKeyWrapMac.mm: Ditto.
703         * page/AlternativeTextClient.h: Ditto.
704         * platform/efl/FileSystemEfl.cpp: Ditto.
705         (WebCore::fileSystemRepresentation): Ditto.
706         * platform/graphics/cg/ImageBufferDataCG.h: Ditto.
707         * platform/graphics/cg/PDFDocumentImage.h: Ditto.
708         * platform/ios/wak/WAKAppKitStubs.h: Ditto.
709         * rendering/RenderLayerCompositor.cpp: Ditto.
710
711 2015-05-01  Myles C. Maxfield  <mmaxfield@apple.com>
712
713         [OS X] Text dilation parameters are not restored after being set
714         https://bugs.webkit.org/show_bug.cgi?id=144507
715         <rdar://problem/19446938>
716
717         Reviewed by Simon Fraser and Ned Holbrook.
718
719         Create a RAII class who is in charge of saving, applying, and restoring dilation parameters. Use this class
720         around our text drawing routines.
721
722         Note that this migrates our use of CTFontSetRenderingParameters() to CTFontSetRenderingStyle().
723
724         Test: fast/text/dilation-save-restore.html
725
726         * platform/graphics/cocoa/FontCascadeCocoa.mm:
727         (WebCore::RenderingStyleSaver::RenderingStyleSaver):
728         (WebCore::RenderingStyleSaver::~RenderingStyleSaver):
729         (WebCore::showGlyphsWithAdvances):
730         * platform/spi/cg/CoreGraphicsSPI.h:
731         * platform/spi/cocoa/CoreTextSPI.h:
732
733 2015-05-01  Commit Queue  <commit-queue@webkit.org>
734
735         Unreviewed, rolling out r183687.
736         https://bugs.webkit.org/show_bug.cgi?id=144505
737
738         Appears to have caused assertions (Requested by ap on
739         #webkit).
740
741         Reverted changeset:
742
743         "Media control volume slider is opaque."
744         https://bugs.webkit.org/show_bug.cgi?id=144470
745         http://trac.webkit.org/changeset/183687
746
747 2015-05-01  Jeremy Jones  <jeremyj@apple.com>
748
749         Stop using deprecated AVKit SPI for enter and exit fullscreen.
750         https://bugs.webkit.org/show_bug.cgi?id=144493
751
752         Reviewed by Jer Noble.
753
754         Replace 
755             -enterFullScreenWithCompletionHandler:
756             -exitFullScreenWithCompletionHandler:
757         with
758             -enterFullScreenAnimated:completionHandler:
759             -exitFullScreenAnimated:completionHandler:
760         
761         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
762         (WebVideoFullscreenInterfaceAVKit::enterFullscreenStandard):
763         (WebVideoFullscreenInterfaceAVKit::exitFullscreenInternal):
764         * platform/spi/cocoa/AVKitSPI.h:
765
766 2015-05-01  Roger Fong  <roger_fong@apple.com>
767
768         Media control volume slider is opaque.
769         https://bugs.webkit.org/show_bug.cgi?id=144470.
770         <rdar://problem/20770350>
771
772         Rubberstamped by Simon Fraser.
773
774         * Modules/mediacontrols/mediaControlsApple.css:
775         (audio::-webkit-media-controls-panel): 
776         Don't create a stacking context just for the controls.
777         Doing so causes the mix-blend-mode on the volume box to fail.
778
779 2015-05-01  Joanmarie Diggs  <jdiggs@igalia.com>
780
781         [GTK] REGRESSION(183368): It made editing tests assert
782         https://bugs.webkit.org/show_bug.cgi?id=144447
783
784         Reviewed by Chris Fleizach.
785
786         Don't notify platforms of editing actions of type EditActionUnspecified.
787         If we don't know what the action is, platform accessibility APIs certainly
788         won't.
789
790         Add AXTextEditTypeAttributesChange and AXTextAttributesChanged as catch-alls
791         for formatting changes. ATK lacks finely-grained signals through which to
792         specify which text attributes have changed. If other platforms have such
793         signals, new types can always be added.
794
795         Don't post an accessible replacement notification for AXTextEditTypeCut.
796         The notification is handled by DeleteSelectionCommand. It is possible for
797         white space to be inserted in preparation for a cut which was triggering
798         a not-reached assert, but insertion of whitespace in preparation for a
799         cut does not seem notification-worthy.
800
801         Treat AXTextEditTypeDictation the same as other insertion types (insert,
802         paste, typing) with respect to replacement notifications.
803
804         No new tests. The hundreds of editing tests that had been crashing seem sufficient.
805
806         * accessibility/AXObjectCache.cpp:
807         (WebCore::AXObjectCache::showIntent):
808         (WebCore::AXObjectCache::textChangeForEditType):
809         * accessibility/AXObjectCache.h:
810         * accessibility/AXTextStateChangeIntent.h:
811         * accessibility/atk/AXObjectCacheAtk.cpp:
812         (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
813         * editing/AppendNodeCommand.cpp:
814         (WebCore::AppendNodeCommand::doApply):
815         (WebCore::AppendNodeCommand::doUnapply):
816         * editing/DeleteFromTextNodeCommand.cpp:
817         (WebCore::DeleteFromTextNodeCommand::doApply):
818         (WebCore::DeleteFromTextNodeCommand::doUnapply):
819         * editing/EditCommand.cpp:
820         (WebCore::EditCommand::applyEditType):
821         (WebCore::EditCommand::unapplyEditType):
822         * editing/InsertIntoTextNodeCommand.cpp:
823         (WebCore::InsertIntoTextNodeCommand::doApply):
824         (WebCore::InsertIntoTextNodeCommand::doUnapply):
825         * editing/InsertNodeBeforeCommand.cpp:
826         (WebCore::InsertNodeBeforeCommand::doApply):
827         (WebCore::InsertNodeBeforeCommand::doUnapply):
828         * editing/ReplaceInsertIntoTextNodeCommand.cpp:
829         (WebCore::ReplaceInsertIntoTextNodeCommand::notifyAccessibilityForTextChange):
830
831 2015-05-01  Brady Eidson  <beidson@apple.com>
832
833         Add API to disable meta refreshes.
834         <rdar://problem/20333198> and https://bugs.webkit.org/show_bug.cgi?id=144269
835
836         Reviewed by Alexey Proskuryakov.
837
838         Test: loader/meta-refresh-disabled.html
839
840         * dom/Document.cpp:
841         (WebCore::Document::processHttpEquiv): Bail early if Settings have meta refreshes disabled.
842         * page/Settings.in:
843
844 2015-05-01  Martin Robinson  <mrobinson@igalia.com>
845
846         [Freetype] Properly support synthetic oblique in vertical text
847         https://bugs.webkit.org/show_bug.cgi?id=144492
848
849         Reviewed by Sergio Villar Senin.
850
851         No new tests. Covered by existing tests.
852
853         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
854         (WebCore::FontPlatformData::initializeWithFontFace): Skew vertical when using synthetic
855         oblique for vertical text.
856
857 2015-05-01  Joanmarie Diggs  <jdiggs@igalia.com>
858
859         AX: [ATK] REGRESSION: accessibility/canvas-fallback-content.html now crashes
860         https://bugs.webkit.org/show_bug.cgi?id=144481
861
862         Reviewed by Chris Fleizach.
863
864         Canvas fallback content is allowed to be focusable if the canvas is displayed
865         and visible. Update the style when creating an accessible object for a node in
866         a canvas subtree and before Element::isFocusable() gets called.
867
868         No new tests. The existing, crashing test no longer crashes.
869
870         * accessibility/AXObjectCache.cpp:
871         (WebCore::AXObjectCache::getOrCreate):
872
873 2015-05-01  Alex Christensen  <achristensen@webkit.org>
874
875         [Content Extensions] Add CombinedURLFilters debugging code.
876         https://bugs.webkit.org/show_bug.cgi?id=144491
877
878         Reviewed by Daniel Bates.
879
880         No change in behavior.
881
882         * contentextensions/CombinedURLFilters.cpp:
883         (WebCore::ContentExtensions::recursiveMemoryUsed):
884         (WebCore::ContentExtensions::CombinedURLFilters::memoryUsed):
885         (WebCore::ContentExtensions::prefixTreeVertexToString):
886         (WebCore::ContentExtensions::recursivePrint):
887         (WebCore::ContentExtensions::CombinedURLFilters::print):
888         (WebCore::ContentExtensions::CombinedURLFilters::addPattern):
889         (WebCore::ContentExtensions::generateNFAForSubtree):
890         (WebCore::ContentExtensions::CombinedURLFilters::processNFAs):
891         * contentextensions/CombinedURLFilters.h:
892         * contentextensions/NFA.cpp:
893         (WebCore::ContentExtensions::NFA::memoryUsed):
894         * contentextensions/NFA.h:
895         * contentextensions/Term.h:
896         (WebCore::ContentExtensions::quantifierToString):
897         (WebCore::ContentExtensions::Term::toString):
898
899 2015-05-01  Eric Carlson  <eric.carlson@apple.com>
900
901         Fix text track language selection logic
902         https://bugs.webkit.org/show_bug.cgi?id=144467
903
904         Reviewed by Brent Fulgham.
905
906         No new tests, media/track/track-language-preference.html was updated.
907
908         * html/HTMLMediaElement.cpp:
909         (WebCore::HTMLMediaElement::configureTextTrackGroup): Correct a minor style typo.
910         (WebCore::HTMLMediaElement::configureTextTrackDisplay): Update logging.
911
912         * page/CaptionUserPreferences.cpp:
913         (WebCore::CaptionUserPreferences::textTrackSelectionScore): Minor cleanup.
914         (WebCore::CaptionUserPreferences::textTrackLanguageSelectionScore): Give exact matches a
915         higher score.
916
917         * page/CaptionUserPreferencesMediaAF.cpp:
918         (WebCore::CaptionUserPreferencesMediaAF::textTrackSelectionScore): Update for 
919         indexOfBestMatchingLanguageInList change.
920
921         * platform/Language.cpp:
922         (WebCore::indexOfBestMatchingLanguageInList): Add parameter for exact match. Convert the
923         passed language to lower case as we do with the preferred languages.
924         * platform/Language.h:
925
926 2015-05-01  Martin Robinson  <mrobinson@igalia.com>
927
928         [Freetype] Add support for the font-synthesis property
929         https://bugs.webkit.org/show_bug.cgi?id=144472
930
931         Reviewed by Sergio Villar Senin.
932
933         No new tests. This causes fast/css3-text/font-synthesis.html to pass
934         for WebKitGTK+.
935
936         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
937         (WebCore::FontPlatformData::FontPlatformData): Only use synthetic bold when the font description allows it.
938         (WebCore::FontPlatformData::initializeWithFontFace): Ditto for synthetic oblique.
939
940 2015-05-01  Martin Robinson  <mrobinson@igalia.com>
941
942         [GTK] New CORS tests from r183280 fail on WebKitGTK+
943         https://bugs.webkit.org/show_bug.cgi?id=144469
944
945         Reviewed by Sergio Villar Senin.
946
947         No new tests. This causes failing tests to pass.
948
949         * platform/network/soup/ResourceHandleSoup.cpp:
950         (WebCore::doRedirect): Clear the origin header on cross-origin redirects.
951
952 2015-04-30  Alex Christensen  <achristensen@webkit.org>
953
954         Compile fix when using content extensions debugging code.
955
956         * contentextensions/ContentExtensionCompiler.cpp:
957         (WebCore::ContentExtensions::compileRuleList):
958         * contentextensions/ContentExtensionsDebugging.h:
959         * contentextensions/DFA.cpp:
960         (WebCore::ContentExtensions::printTransitions):
961         (WebCore::ContentExtensions::DFA::debugPrintDot):
962         * contentextensions/DFANode.h:
963         * contentextensions/NFA.cpp:
964         (WebCore::ContentExtensions::NFA::memoryUsed):
965         (WebCore::ContentExtensions::NFA::debugPrintDot):
966
967 2015-04-30  Dan Bernstein  <mitz@apple.com>
968
969         Fixed the build for <rdar://problem/20758514>
970
971         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
972         (WebCore::AudioSourceProviderAVFObjC::destroyMix): Don’t pass nil to
973         -[AVMutableAudioMix setInputParameters:].
974
975 2015-04-30  Daniel Bates  <dabates@apple.com>
976
977         Clean up: Remove unnecessary runtime computation of string length
978         https://bugs.webkit.org/show_bug.cgi?id=144483
979
980         Reviewed by Joseph Pecoraro.
981
982         Following <http://trac.webkit.org/changeset/183649>, WebCore::fullyQualifiedInfoTableName()
983         computes strlen() of the first string literal as part of concatenating two string literals.
984         It is sufficient to use sizeof() - 1 instead of strlen() to compute the length of the first
985         string literal because the size of the string literal is known at compile time.
986
987         * Modules/webdatabase/DatabaseBackendBase.cpp:
988         (WebCore::fullyQualifiedInfoTableName):
989
990 2015-04-30  Dean Jackson  <dino@apple.com>
991
992         Expose -apple-system as a font family
993         https://bugs.webkit.org/show_bug.cgi?id=144484
994         <rdar://problem/20767330>
995
996         Reviewed by Tim Horton.
997
998         Accept "-apple-system" for the font-family property, and
999         rename "-apple-system-font-monospaced-numbers" to
1000         "-apple-system-monospaced-numbers".
1001
1002         Also change the media controls to use the new name.
1003
1004         Covered by existing tests and this new one:
1005             fast/text/system-font-legacy-name.html
1006
1007         * Modules/mediacontrols/mediaControlsApple.css:
1008         (audio::-webkit-media-controls-time-remaining-display):
1009         * Modules/mediacontrols/mediaControlsiOS.css:
1010         (::-webkit-media-controls):
1011         (audio::-webkit-media-controls-time-remaining-display):
1012         (audio::-webkit-media-controls-status-display):
1013         * platform/graphics/ios/FontCacheIOS.mm: Add support for the new name.
1014         (WebCore::createCTFontWithFamilyNameAndWeight):
1015         * platform/graphics/mac/FontCacheMac.mm: Ditto.
1016         (WebCore::fontWithFamily):
1017
1018 2015-04-30  Javier Fernandez  <jfernandez@igalia.com>
1019
1020         [CSS Grid Layout] overflow-position keyword for align and justify properties.
1021         https://bugs.webkit.org/show_bug.cgi?id=144235
1022
1023         Reviewed by Sergio Villar Senin.
1024
1025         When the alignment subject is larger than the alignment container,
1026         it will overflow. Some alignment modes, if honored in this
1027         situation, may cause data loss; an overflow alignment mode can be
1028         explicitly specified to avoid this.
1029
1030         This patch implements overflow-keyword handling for Grid Layout on
1031         align-self and justify-self properties.
1032
1033         Test: fast/css-grid-layout/grid-align-justify-overflow.html
1034
1035         * rendering/RenderGrid.cpp:
1036         (WebCore::computeOverflowAlignmentOffset):
1037         (WebCore::RenderGrid::rowPositionForChild):
1038         (WebCore::RenderGrid::columnPositionForChild):
1039         (WebCore::RenderGrid::rowAxisPositionForChild): Deleted.
1040         * rendering/style/RenderStyle.cpp:
1041         (WebCore::resolveAlignmentData):
1042         (WebCore::resolveJustificationData):
1043         (WebCore::RenderStyle::resolveAlignment):
1044         (WebCore::RenderStyle::resolveAlignmentOverflow):
1045         (WebCore::RenderStyle::resolveJustification):
1046         (WebCore::RenderStyle::resolveJustificationOverflow):
1047         * rendering/style/RenderStyle.h:
1048
1049 2015-04-30  Jon Honeycutt  <jhoneycutt@apple.com>
1050
1051         Rebaseline bindings tests results after r183648.
1052
1053         Unreviewed.
1054
1055         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1056         (WebCore::jsTestActiveDOMObjectPrototypeFunctionPostMessage):
1057         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
1058         (WebCore::jsTestCustomNamedGetterPrototypeFunctionAnotherFunction):
1059         * bindings/scripts/test/JS/JSTestInterface.cpp:
1060         (WebCore::JSTestInterfaceConstructor::constructJSTestInterface):
1061         (WebCore::setJSTestInterfaceConstructorImplementsStaticAttr):
1062         (WebCore::setJSTestInterfaceImplementsStr2):
1063         (WebCore::setJSTestInterfaceConstructorSupplementalStaticAttr):
1064         (WebCore::setJSTestInterfaceSupplementalStr2):
1065         (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
1066         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
1067         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1068         (WebCore::JSTestNamedConstructorNamedConstructor::constructJSTestNamedConstructor):
1069         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
1070         (WebCore::setJSTestNondeterministicNondeterministicWriteableAttr):
1071         (WebCore::setJSTestNondeterministicNondeterministicExceptionAttr):
1072         (WebCore::setJSTestNondeterministicNondeterministicGetterExceptionAttr):
1073         (WebCore::setJSTestNondeterministicNondeterministicSetterExceptionAttr):
1074         * bindings/scripts/test/JS/JSTestObj.cpp:
1075         (WebCore::setJSTestObjConstructorStaticStringAttr):
1076         (WebCore::setJSTestObjStringAttr):
1077         (WebCore::setJSTestObjReflectedStringAttr):
1078         (WebCore::setJSTestObjReflectedURLAttr):
1079         (WebCore::setJSTestObjReflectedCustomURLAttr):
1080         (WebCore::setJSTestObjStringAttrWithGetterException):
1081         (WebCore::setJSTestObjStringAttrWithSetterException):
1082         (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs):
1083         (WebCore::jsTestObjPrototypeFunctionByteMethodWithArgs):
1084         (WebCore::jsTestObjPrototypeFunctionOctetMethodWithArgs):
1085         (WebCore::jsTestObjPrototypeFunctionLongMethodWithArgs):
1086         (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
1087         (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
1088         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalString):
1089         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefined):
1090         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsNullString):
1091         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod1):
1092         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod3):
1093         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod11):
1094         (WebCore::jsTestObjConstructorFunctionOverloadedMethod12):
1095         (WebCore::jsTestObjPrototypeFunctionStrictFunction):
1096         (WebCore::jsTestObjPrototypeFunctionVariadicStringMethod):
1097         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1098         (WebCore::JSTestOverloadedConstructorsConstructor::constructJSTestOverloadedConstructors4):
1099         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1100         (WebCore::JSTestTypedefsConstructor::constructJSTestTypedefs):
1101         (WebCore::setJSTestTypedefsStringAttrWithGetterException):
1102         (WebCore::setJSTestTypedefsStringAttrWithSetterException):
1103         (WebCore::jsTestTypedefsPrototypeFunctionSetShadow):
1104
1105 2015-04-30  Simon Fraser  <simon.fraser@apple.com>
1106
1107         Fixed elements end up in the middle of the view with pageScale < 1
1108         https://bugs.webkit.org/show_bug.cgi?id=144428
1109         rdar://problem/20404982
1110
1111         Reviewed by Tim Horton.
1112
1113         When pageScale is < 1, we used fixed layout mode, and FrameView::fixedElementsLayoutRelativeToFrame()
1114         returns true. However, the scrolling thread was calling the static scrollOffsetForFixedPosition()
1115         hardcoding 'false' for this parameter.
1116         
1117         Fix by sending the value of fixedElementsLayoutRelativeToFrame over to the scrolling thread,
1118         so we can use it when doing scrolling-thread fixed position stuff.
1119
1120         Not testable.
1121
1122         * page/scrolling/AsyncScrollingCoordinator.cpp:
1123         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
1124         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
1125         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
1126         (WebCore::ScrollingStateFrameScrollingNode::setFixedElementsLayoutRelativeToFrame):
1127         * page/scrolling/ScrollingStateFrameScrollingNode.h:
1128         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
1129         (WebCore::ScrollingTreeFrameScrollingNode::ScrollingTreeFrameScrollingNode):
1130         (WebCore::ScrollingTreeFrameScrollingNode::updateBeforeChildren):
1131         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
1132         (WebCore::ScrollingTreeFrameScrollingNode::fixedElementsLayoutRelativeToFrame):
1133         (WebCore::ScrollingTreeFrameScrollingNode::shouldUpdateScrollLayerPositionSynchronously): Deleted.
1134         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1135         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
1136
1137 2015-04-30  Beth Dakin  <bdakin@apple.com>
1138
1139         Remove invalid assertion from MouseEvent::create()
1140         https://bugs.webkit.org/show_bug.cgi?id=144477
1141
1142         Reviewed by Tim Horton.
1143
1144         mouseforcechanged events and mouseforcewillbegin trigger this assertion. The 
1145         assertion does not seem valuable, so rather than changing it, just remove it.
1146         * dom/MouseEvent.cpp:
1147         (WebCore::MouseEvent::create):
1148
1149 2015-04-30  Dean Jackson  <dino@apple.com>
1150
1151         -apple-system-font-monospaced-numbers doesn't work on iOS
1152         https://bugs.webkit.org/show_bug.cgi?id=144478
1153         <rdar://problem/20544940>
1154
1155         Reviewed by Brent Fulgham.
1156
1157         Make sure to start from the system font descriptor when
1158         asking for a monospaced numeric alternate.
1159
1160         Test: platform/ios-simulator/fast/text/system-monospaced-numbers.html
1161
1162         * platform/graphics/ios/FontCacheIOS.mm:
1163         (WebCore::createCTFontWithFamilyNameAndWeight):
1164
1165 2015-04-30  Oliver Hunt  <oliver@apple.com>
1166
1167         DOM bindings should not be using a reference type to point to a temporary object
1168         https://bugs.webkit.org/show_bug.cgi?id=144474
1169
1170         Reviewed by Beth Dakin.
1171
1172         The DOM bindings will currently try and use a local reference to point
1173         to a temporary object. This currently works as a by product of the compiler's
1174         stack layout. This patch removes the dependency on undefined behaviour
1175         by ensuring that we use a value rather than reference type.
1176
1177         * bindings/scripts/CodeGeneratorJS.pm:
1178         (GenerateParametersCheck):
1179         (GetNativeTypeForCallbacks):
1180
1181 2015-04-30  Brady Eidson  <beidson@apple.com>
1182
1183         Build fix after r183646 for less enlightened platforms.
1184
1185         Unreviewed.
1186
1187         * Modules/webdatabase/DatabaseBackendBase.cpp:
1188         (WebCore::fullyQualifiedInfoTableName): Windows doesn’t have stpcpy :(
1189
1190 2015-04-30  Brady Eidson  <beidson@apple.com>
1191
1192         Javascript using WebSQL can create their own WebKit info table.
1193         <rdar://problem/20688792> and https://bugs.webkit.org/show_bug.cgi?id=144466
1194
1195         Reviewed by Alex Christensen.
1196
1197         Test: storage/websql/alter-to-info-table.html
1198
1199         * Modules/webdatabase/DatabaseBackendBase.cpp:
1200         (WebCore::DatabaseBackendBase::databaseInfoTableName): Return the info table name.
1201         (WebCore::fullyQualifiedInfoTableName): Append "main." to the info table name.
1202         (WebCore::DatabaseBackendBase::DatabaseBackendBase): Use the fully qualified name.
1203         (WebCore::DatabaseBackendBase::performOpenAndVerify): Ditto.
1204         (WebCore::DatabaseBackendBase::getVersionFromDatabase): Ditto.
1205         (WebCore::DatabaseBackendBase::setVersionInDatabase): Ditto.
1206
1207 2015-04-30  Beth Dakin  <bdakin@apple.com>
1208
1209         Should choose UIScrollView indicatorStyle based on the document background color
1210         https://bugs.webkit.org/show_bug.cgi?id=144473
1211         -and corresponding-
1212         rdar://problem/19897699
1213
1214         Reviewed by Simon Fraser.
1215
1216         Export this function.
1217         * platform/graphics/Color.h:
1218
1219 2015-04-30  Brent Fulgham  <bfulgham@apple.com>
1220
1221         [Win] Allow WebKit to build without ANGLE support
1222         https://bugs.webkit.org/show_bug.cgi?id=144459
1223         <rdar://problem/20707307>
1224
1225         Reviewed by Dean Jackson.
1226
1227         * platform/graphics/GLContext.cpp: Use the ENABLE(GRAPHICS_CONTEXT_3D)
1228         macro to avoid compiling this code if not using WEBGL/3D contexts.
1229
1230 2015-04-29  David Hyatt  <hyatt@apple.com>
1231
1232         Avoid containingBlock() calls when no writing mode flipping is needed.
1233         https://bugs.webkit.org/show_bug.cgi?id=144407
1234
1235         Reviewed by Simon Fraser.
1236
1237         Add a bool to RenderView that indicates whether or not any flipped blocks have been
1238         added to the view. Once tainted, the view just stays dirty forever. If no flipped
1239         blocks are ever seen, we can then optimize away calls to containingBlock().
1240
1241         The motivation for this patch is to improve layer position updating, which makes many
1242         calls to topLeftLocationOffset(), one of the functions that can be optimized by this
1243         change.
1244
1245         * rendering/RenderBox.cpp:
1246         (WebCore::RenderBox::layoutOverflowRectForPropagation):
1247         * rendering/RenderBoxModelObject.cpp:
1248         (WebCore::RenderBoxModelObject::updateFromStyle):
1249         * rendering/RenderLayer.cpp:
1250         (WebCore::RenderLayer::calculateClipRects):
1251         * rendering/RenderLineBoxList.cpp:
1252         (WebCore::RenderLineBoxList::rangeIntersectsRect):
1253         * rendering/RenderView.cpp:
1254         (WebCore::RenderView::RenderView):
1255         * rendering/RenderView.h:
1256
1257 2015-04-29  Jer Noble  <jer.noble@apple.com>
1258
1259         Make GenericTaskQueue even more generic (and usable inside platform/)
1260         https://bugs.webkit.org/show_bug.cgi?id=144414
1261
1262         Reviewed by Eric Carlson.
1263
1264         Templatize GenericTaskQueue so that it can be used from within platform/.
1265
1266         * CMakeLists.txt:
1267         * WebCore.vcxproj/WebCore.vcxproj:
1268         * WebCore.vcxproj/WebCore.vcxproj.filters:
1269         * WebCore.xcodeproj/project.pbxproj:
1270         * dom/GenericTaskQueue.cpp: Removed.
1271         * html/HTMLMediaElement.h:
1272         * platform/GenericTaskQueue.h: Renamed from Source/WebCore/dom/GenericTaskQueue.h.
1273         (WebCore::TaskDispatcher::TaskDispatcher): Added default templatized class which just calls the parameter's postTask().
1274         (WebCore::TaskDispatcher::postTask): Call context's postTask().
1275         (WebCore::TaskDispatcher<Timer>::TaskDispatcher): Add a timer version which does not require a context.
1276         (WebCore::TaskDispatcher<Timer>::postTask): Set the timer.
1277         (WebCore::TaskDispatcher<Timer>::timerFired): Call the task.
1278         (WebCore::GenericTaskQueue::GenericTaskQueue): Moved from .cpp.
1279         (WebCore::GenericTaskQueue::enqueueTask): Ditto.
1280         (WebCore::GenericTaskQueue::close): Ditto.
1281         (WebCore::GenericTaskQueue::cancelAllTasks): Ditto.
1282         (WebCore::GenericTaskQueue::hasPendingTasks): Ditto.
1283
1284 2015-04-29  Joseph Pecoraro  <pecoraro@apple.com>
1285
1286         Unreviewed build fix. WebCore has a weak symbol.
1287
1288         WebCore has a weak external symbol in it. A common cause of weak external
1289         symbols is when an inline function is listed in the linker export file.
1290         ERROR: symbol __ZNK7WebCore4Page25expectsWheelEventTriggersEv
1291
1292         * page/Page.cpp:
1293         (WebCore::Page::expectsWheelEventTriggers):
1294         * page/Page.h:
1295         (WebCore::Page::expectsWheelEventTriggers): Deleted.
1296
1297 2015-04-29  Simon Fraser  <simon.fraser@apple.com>
1298
1299         Crash at WebCore::Document::absoluteRegionForEventTargets 
1300         https://bugs.webkit.org/show_bug.cgi?id=144426
1301         rdar://problem/20502166
1302
1303         Reviewed by Tim Horton.
1304
1305         When a frame had wheel event handlers, we would register the document itself
1306         as a handler in its parent document. This is problematic, because there's not
1307         code path that removes it when the frame is destroyed.
1308         
1309         It turns out we don't need to do this at all; the non-fast scrollable region
1310         already takes handlers in subframes into account.
1311
1312         Tests: fast/events/wheelevent-in-frame.html
1313                fast/events/wheelevent-in-reattached-frame.html
1314
1315         * dom/Document.cpp:
1316         (WebCore::Document::didAddWheelEventHandler):
1317         (WebCore::Document::didRemoveWheelEventHandler):
1318
1319 2015-04-29  Eric Carlson  <eric.carlson@apple.com>
1320
1321         Not all videos should automatically play to playback target
1322         https://bugs.webkit.org/show_bug.cgi?id=144430
1323         <rdar://problem/20718523>
1324
1325         Reviewed by Darin Adler.
1326
1327         * Modules/mediasession/WebMediaSessionManager.cpp:
1328         (WebCore::WebMediaSessionManager::clientStateDidChange): Consider ExternalDeviceAutoPlayCandidate.
1329         Minor cleanup.
1330
1331         * html/HTMLMediaElement.cpp:
1332         (WebCore::HTMLMediaElement::mediaState): Set ExternalDeviceAutoPlayCandidate when a <video>
1333         has a file with an audio track that does not loop.
1334
1335         * page/MediaProducer.h: Add ExternalDeviceAutoPlayCandidate.
1336
1337 2015-04-29  Joseph Pecoraro  <pecoraro@apple.com>
1338
1339         LiveNodeList may unexpectedly return an element for empty string
1340         https://bugs.webkit.org/show_bug.cgi?id=144429
1341
1342         Reviewed by Darin Adler.
1343
1344         * dom/LiveNodeList.cpp:
1345         (WebCore::LiveNodeList::namedItem):
1346         Never return a result for an empty string.
1347
1348 2015-04-29  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1349
1350         Remove PassRefPtr in SVGFEFooElement classes
1351         https://bugs.webkit.org/show_bug.cgi?id=144425
1352
1353         Reviewed by Darin Adler.
1354
1355         As a step to use Ref instead of PassRefPtr, this patch purges PassRefPtr
1356         in SVGFEFooElement.
1357
1358         No new tests, no behavior changes.
1359
1360         * css/RGBColor.cpp:
1361         (WebCore::RGBColor::create):
1362         * css/RGBColor.h:
1363         * platform/graphics/filters/PointLightSource.h:
1364         (WebCore::PointLightSource::create):
1365         * platform/graphics/filters/SpotLightSource.h:
1366         (WebCore::SpotLightSource::create):
1367         * svg/SVGColor.cpp:
1368         (WebCore::SVGColor::rgbColor):
1369         * svg/SVGColor.h:
1370         * svg/SVGFEDistantLightElement.cpp:
1371         (WebCore::SVGFEDistantLightElement::lightSource):
1372         * svg/SVGFEDistantLightElement.h:
1373         * svg/SVGFELightElement.cpp:
1374         (WebCore::SVGFELightElement::findLightSource):
1375         * svg/SVGFELightElement.h:
1376         * svg/SVGFEPointLightElement.cpp:
1377         (WebCore::SVGFEPointLightElement::lightSource):
1378         * svg/SVGFEPointLightElement.h:
1379         * svg/SVGFESpotLightElement.cpp:
1380         (WebCore::SVGFESpotLightElement::lightSource):
1381         * svg/SVGFESpotLightElement.h:
1382
1383 2015-04-29  Dean Jackson  <dino@apple.com>
1384
1385         Create a named CSS property for system colors
1386         https://bugs.webkit.org/show_bug.cgi?id=144423
1387         <rdar://problem/20491011>
1388
1389         Reviewed by Tim Horton.
1390
1391         Test: fast/css/apple-system-colors.html
1392
1393         Expose the following values to CSS color properties:
1394             -apple-system-blue
1395             -apple-system-brown
1396             -apple-system-gray
1397             -apple-system-green
1398             -apple-system-orange
1399             -apple-system-pink
1400             -apple-system-purple
1401             -apple-system-red
1402             -apple-system-yellow
1403
1404         On platforms other than OS X Yosemite and iOS, the
1405         actual color values are undefined and become transparent
1406         black. (In fact, not all are defined on iOS either.)
1407
1408         * WebCore.xcodeproj/project.pbxproj: Two new SPI header files.
1409
1410         * css/CSSParser.cpp:
1411         (WebCore::CSSParser::validSystemColorValue): New helper function that
1412         checks if a CSSValueID is between the two system color values. This
1413         was being tested everywhere, which meant adding a new system color was
1414         at risk of being ignored. It's a static method so it can be used
1415         from the SVG CSS parser too.
1416         (WebCore::validPrimitiveValueColor): Use the new helper.
1417         (WebCore::CSSParser::parseValue): Ditto.
1418         (WebCore::CSSParser::parseBackgroundColor): Ditto.
1419         (WebCore::CSSParser::parseShadow): Ditto.
1420         (WebCore::parseDeprecatedGradientColorStop): Ditto.
1421         (WebCore::parseGradientColorOrKeyword): Ditto.
1422         * css/CSSParser.h: New static helper function.
1423
1424         * css/CSSValueKeywords.in: Add the new CSS value keywords.
1425
1426         * css/SVGCSSParser.cpp:
1427         (WebCore::validSystemControlColorValue): SVG has a restricted
1428         set of system colors, so use the helper from CSSParser but with
1429         an extra condition.
1430         (WebCore::CSSParser::parseSVGValue): Use the helper.
1431
1432         * platform/spi/ios/UIColorSPI.h: Added.
1433         * platform/spi/cocoa/NSColorSPI.h: Added.
1434
1435         * rendering/RenderThemeIOS.h: New systemColor override. Also add a cache for system colors.
1436         * rendering/RenderThemeIOS.mm:
1437         (WebCore::RenderThemeIOS::systemColor): Ask UIColor to provide the color values for the new CSS values.
1438         * rendering/RenderThemeMac.mm:
1439         (WebCore::RenderThemeMac::systemColor): Ditto.
1440
1441 2015-04-29  Commit Queue  <commit-queue@webkit.org>
1442
1443         Unreviewed, rolling out r183600.
1444         https://bugs.webkit.org/show_bug.cgi?id=144432
1445
1446         New tests time out everywhere (Requested by ap on #webkit).
1447
1448         Reverted changeset:
1449
1450         "Crash at WebCore::Document::absoluteRegionForEventTargets"
1451         https://bugs.webkit.org/show_bug.cgi?id=144426
1452         http://trac.webkit.org/changeset/183600
1453
1454 2015-04-29  Joseph Pecoraro  <pecoraro@apple.com>
1455
1456         Unreviewed iOS build fix. Unused parameter no longer exists.
1457
1458         * page/scrolling/ScrollingCoordinator.cpp:
1459         (WebCore::ScrollingCoordinator::absoluteNonFastScrollableRegionForFrame):
1460
1461 2015-04-29  Simon Fraser  <simon.fraser@apple.com>
1462
1463         Crash at WebCore::Document::absoluteRegionForEventTargets 
1464         https://bugs.webkit.org/show_bug.cgi?id=144426
1465         rdar://problem/20502166
1466
1467         Reviewed by Tim Horton.
1468
1469         When a frame had wheel event handlers, we would register the document itself
1470         as a handler in its parent document. This is problematic, because there's not
1471         code path that removes it when the frame is destroyed.
1472         
1473         It turns out we don't need to do this at all; the non-fast scrollable region
1474         already takes handlers in subframes into account.
1475
1476         Tests: fast/events/wheelevent-in-frame.html
1477                fast/events/wheelevent-in-reattached-frame.html
1478
1479         * dom/Document.cpp:
1480         (WebCore::Document::didAddWheelEventHandler):
1481         (WebCore::Document::didRemoveWheelEventHandler):
1482
1483 2015-04-29  David Kilzer  <ddkilzer@apple.com>
1484
1485         Attempt #2: Switch QuickLook soft-linking to use QuickLookSoftLink.{h,mm}
1486         <http://webkit.org/b/144362>
1487
1488         Reviewed by Andy Estes.
1489
1490         This patch switches soft-linking of QuickLook.framework to
1491         QuickLookSoftLink.{h,mm} so that we stop exporting unintended
1492         symbols.
1493
1494         No new tests since no change in behavior.
1495
1496         * WebCore.xcodeproj/project.pbxproj:
1497         - Add QuickLookSoftLinking.{h,mm} to the project.
1498
1499         * platform/ios/QuickLookSoftLink.h: Added.
1500         * platform/ios/QuickLookSoftLink.mm: Added.
1501         * platform/mac/SoftLinking.h:
1502         (SOFT_LINK_CLASS_FOR_HEADER): Add macro.
1503         (SOFT_LINK_CLASS_FOR_SOURCE): Add macro.
1504         (SOFT_LINK_POINTER_FOR_HEADER): Add macro.
1505         (SOFT_LINK_POINTER_FOR_SOURCE): Add macro.
1506
1507         * platform/network/ios/QuickLook.h:
1508         - Remove unused declarations.
1509
1510         * platform/network/ios/QuickLook.mm:
1511         (WebCore::QLPreviewConverterClass): Deleted.
1512         (WebCore::QLTypeCopyBestMimeTypeForFileNameAndMimeType): Deleted.
1513         (WebCore::QLTypeCopyBestMimeTypeForURLAndMimeType): Deleted.
1514         (WebCore::QLTypeCopyUTIForURLAndMimeType): Deleted.
1515         - Remove SOFT_LINK macros and unused methods after switching to
1516           new QuickLookSoftLink.{h,mm}.
1517         (WebCore::QLPreviewGetSupportedMIMETypesSet):
1518         - Switch to use NeverDestroyed<>.
1519         (WebCore::registerQLPreviewConverterIfNeeded):
1520         (createQLPreviewProtocol):
1521         (WebCore::QLPreviewProtocol):
1522         (WebCore::QuickLookHandle::QuickLookHandle):
1523         (WebCore::QuickLookHandle::create):
1524         (WebCore::QuickLookHandle::shouldCreateForMIMEType):
1525         - Simplify code when using QuickLookSoftLink.h.
1526
1527         * platform/network/ios/WebCoreURLResponseIOS.mm:
1528         - Include QuickLookSoftLink.h header.
1529
1530 2015-04-29  Simon Fraser  <simon.fraser@apple.com>
1531
1532         Compute the non-fast-scrollable region in main-document coordinates
1533         https://bugs.webkit.org/show_bug.cgi?id=144420
1534
1535         Reviewed by Tim Horton.
1536
1537         Compute the non-fast-scrollable region in document coordinates, to make it easier
1538         to reason about. Previously, it was document coordinates offset by top content inset.
1539
1540         * page/DebugPageOverlays.cpp:
1541         (WebCore::MouseWheelRegionOverlay::updateRegion): Traverse all frames to compute the wheel
1542         event handler region, mapping each to root view coords, and then mapping back into document
1543         coords at the end.
1544         (WebCore::NonFastScrollableRegionOverlay::updateRegion): No offset needed here; the
1545         overlay and region are both document coordinates.
1546         * page/FrameView.h: Make some mapping function overrides public, and expose widgetsInRenderTree().
1547         * page/Page.cpp:
1548         (WebCore::Page::nonFastScrollableRects): Remove frame argument.
1549         * page/Page.h:
1550         * page/PageOverlay.cpp:
1551         (WebCore::PageOverlay::bounds):
1552         (WebCore::PageOverlay::viewToOverlayOffset): Convenience function to map between
1553         view and overlay coordinates.
1554         * page/PageOverlay.h:
1555         * page/scrolling/AsyncScrollingCoordinator.cpp: New computeNonFastScrollableRegion() signature.
1556         (WebCore::AsyncScrollingCoordinator::updateNonFastScrollableRegion):
1557         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
1558         (WebCore::AsyncScrollingCoordinator::scrollingStateTreeAsText):
1559         * page/scrolling/ScrollingCoordinator.cpp:
1560         (WebCore::ScrollingCoordinator::absoluteNonFastScrollableRegionForFrame): This function
1561         recurses on frames, computing an absolute (document-relative) region per frame. This
1562         removes the confusing offsetting through top content inset.
1563         Change how we get to plugins that want wheel events; we can't get from PluginViewBase
1564         to renderers, so use FrameView's list of Widgets, and their RenderWidgets. This fixes
1565         regions for transformed plugin-ins.
1566         For subframes, we get a region in the subframe's document coords. Map to that sub-frame,
1567         then to our frame, then to our document.
1568         (WebCore::ScrollingCoordinator::absoluteNonFastScrollableRegion): Wrapper that hides
1569         the recursive function.
1570         (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion): Deleted.
1571         * page/scrolling/ScrollingCoordinator.h:
1572         * page/scrolling/ScrollingTree.cpp:
1573         (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously): Map the event point
1574         from view coordinates to document coordinates for testing against the non-fast region.
1575         We previously assert that the root note is a FrameScrolling node.
1576         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
1577         (WebCore::ScrollingTreeFrameScrollingNode::viewToContentsOffset): Similar to ScrollView::viewToContents()
1578         for the scrolling tree.
1579         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
1580         * testing/Internals.cpp:
1581         (WebCore::Internals::nonFastScrollableRects): No need for frame arg.
1582
1583 2015-04-29  Brent Fulgham  <bfulgham@apple.com>
1584
1585         Expand test infrastructure to support scrolling tests
1586         https://bugs.webkit.org/show_bug.cgi?id=143684
1587         <rdar://problem/20375516>
1588
1589         Reviewed by Simon Fraser.
1590
1591         Tested by various fast/scrolling and platform/mac-wk2/tiled-drawing/scrolling tests.
1592
1593         This series of changes adds a new singleton class, 'WheelEventTestTrigger', which encapsulates a
1594         function object to be fired when scroll events are finished. The object also keeps track of reasons
1595         why the test should not yet fire (e.g., 'rubberbanding' is active) so that tests do not incorrectly
1596         check rendering state in the middle of an animation.
1597
1598         Switch from the original WeakPtr design to ThreadSafeRefPtr, because WeakPtr cannot be shared
1599         across multiple threads.
1600
1601         * page/FrameView.cpp:
1602         (WebCore::FrameView::layout): Make sure ScrollAnimator knows about any active test trigger.
1603         (WebCore::FrameView::setScrollPosition): Ditto.
1604         (WebCore::FrameView::didAddScrollbar): Ditto.
1605         * page/MainFrame.cpp:
1606         (WebCore::MainFrame::testTrigger): Moved to Page.
1607         (WebCore::MainFrame::ensureTestTrigger): Ditto.
1608         * page/MainFrame.h:
1609         * page/Page.cpp:
1610         (WebCore::Page::testTrigger): Moved from MainFrame, and converted to use RefPtr.
1611         (WebCore::Page::ensureTestTrigger): Ditto.
1612         * page/Page.h:
1613         * page/WheelEventTestTrigger.cpp:
1614         (WebCore::WheelEventTestTrigger::WheelEventTestTrigger): Remove WeakPtr code.
1615         (WebCore::WheelEventTestTrigger::createWeakPtr): Deleted.
1616         * page/WheelEventTestTrigger.h:
1617         * page/mac/EventHandlerMac.mm:
1618         (WebCore::EventHandler::platformPrepareForWheelEvents): Make sure the scroll animator knows about
1619         any active test trigger object.
1620         * page/scrolling/AsyncScrollingCoordinator.cpp:
1621         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll): Notify WheelEventTestTrigger
1622         that the scrolling thread is synced with the main thread.
1623         * platform/ScrollAnimator.h: Hold a RefPtr to the WheelEventTestTrigger. 
1624         (WebCore::ScrollAnimator::ScrollAnimator::setWheelEventTestTrigger):
1625         * platform/cocoa/ScrollController.h:
1626         * platform/cocoa/ScrollController.mm:
1627         (WebCore::ScrollController::startSnapRubberbandTimer): Notify test trigger to hold tests until rubber band
1628         snapping is complete.
1629         (WebCore::ScrollController::stopSnapRubberbandTimer): Notify test trigger that rubber band snapping is done.
1630         (WebCore::ScrollController::startScrollSnapTimer): Notify test trigger to hold tests until scroll snapping
1631         is complete.
1632         (WebCore::ScrollController::stopScrollSnapTimer): Notify test trigger that scroll snapping is done.
1633         * platform/mac/ScrollAnimatorMac.mm:
1634         (WebCore::ScrollAnimatorMac::didBeginScrollGesture): Notify test trigger that a content scroll is in progress.
1635         (WebCore::ScrollAnimatorMac::didEndScrollGesture): Notify test trigger that a content scroll is finished.
1636         (WebCore::ScrollAnimatorMac::sendContentAreaScrolledSoon): Notify test trigger to hold tests until the content
1637         scrolling is complete.
1638         (WebCore::ScrollAnimatorMac::sendContentAreaScrolledTimerFired): Notify test trigger that content scrolling is done.
1639         * rendering/RenderBox.cpp:
1640         (WebCore::connectScrollAnimatorToTestTrigger): Helper function.
1641         (WebCore::RenderBox::setScrollLeft): Call 'connectScrollAnimatorToTestTrigger' to connect the ScrollAnimator
1642         to the WheelEventTestTrigger so that future scroll operations can notify the test infrastructure.
1643         (WebCore::RenderBox::setScrollTop): Ditto.
1644         * rendering/RenderLayer.cpp:
1645         (WebCore::RenderLayer::createScrollbar): Make sure the ScrollAnimator knows about any active test triggers.
1646         * rendering/RenderListBox.cpp:
1647         (WebCore::connectScrollAnimatorToTestTrigger): Helper function.
1648         (WebCore::RenderListBox::setScrollLeft): Call 'connectScrollAnimatorToTestTrigger' to connect the ScrollAnimator
1649         to the WheelEventTestTrigger so that future scroll operations can notify the test infrastructure.
1650         (WebCore::RenderListBox::setScrollTop): Ditto.
1651         (WebCore::RenderListBox::createScrollbar): Ditto.
1652         * testing/js/WebCoreTestSupport.cpp:
1653         (WebCoreTestSupport::monitorWheelEvents): Look for WheelEventTestTrigger in Page, rather than MainFrame.
1654         (WebCoreTestSupport::setTestCallbackAndStartNotificationTimer): Ditto.
1655
1656 2015-04-29  Javier Fernandez  <jfernandez@igalia.com>
1657
1658         [CSS Box Alignment] Unifying alignment data in a single class
1659         https://bugs.webkit.org/show_bug.cgi?id=144384
1660
1661         Reviewed by David Hyatt.
1662
1663         The new CSS Box Alignment specification introduces more complex
1664         values and syntax for defining alignment properties. Most of the
1665         alignment values were just keyword identifiers, but the new syntax
1666         allows different combinations of identifiers to determine the
1667         alignment behavior (eg. overflow-alignment keyword).
1668
1669         This patch wll help to implement later overflow handling and
1670         specially Content Dstribution alignment, the most complex case by
1671         far. It will be more consistent against style changes and repaint,
1672         snce we will have just one field to monitoring for value
1673         modfications.
1674
1675         No new tests, because no new functionality was added; it's just a
1676         code refactoring which is just expected to pass current tests.
1677
1678         * css/CSSComputedStyleDeclaration.cpp:
1679         (WebCore::resolveSelfAlignmentAuto):
1680         (WebCore::ComputedStyleExtractor::propertyValue):
1681         * css/CSSPropertyNames.in:
1682         * css/StyleBuilderConverter.h:
1683         (WebCore::StyleBuilderConverter::convertSelfOrDefaultAlignmentData):
1684         (WebCore::StyleBuilderConverter::convertSVGColor): Deleted.
1685         * css/StyleBuilderCustom.h:
1686         (WebCore::StyleBuilderCustom::applyInitialWebkitMaskImage): Deleted.
1687         (WebCore::StyleBuilderCustom::applyInheritWebkitMaskImage): Deleted.
1688         (WebCore::ApplyPropertyBorderImageModifier::applyInheritValue): Deleted.
1689         (WebCore::ApplyPropertyBorderImageModifier::applyInitialValue): Deleted.
1690         (WebCore::ApplyPropertyBorderImageModifier::applyValue): Deleted.
1691         (WebCore::ApplyPropertyBorderImageModifier::getValue): Deleted.
1692         (WebCore::ApplyPropertyBorderImageModifier::setValue): Deleted.
1693         (WebCore::StyleBuilderCustom::applyInheritLineHeight): Deleted.
1694         * css/StyleResolver.cpp:
1695         (WebCore::StyleResolver::adjustRenderStyle):
1696         * mathml/MathMLTextElement.cpp:
1697         (WebCore::MathMLTextElement::createElementRenderer):
1698         * rendering/RenderFlexibleBox.cpp:
1699         (WebCore::RenderFlexibleBox::styleDidChange):
1700         * rendering/RenderFullScreen.cpp:
1701         (WebCore::createFullScreenStyle):
1702         * rendering/RenderMenuList.cpp:
1703         (WebCore::RenderMenuList::adjustInnerStyle):
1704         * rendering/mathml/RenderMathMLRoot.cpp:
1705         (WebCore::RenderMathMLRoot::updateStyle):
1706         * rendering/mathml/RenderMathMLScripts.cpp:
1707         (WebCore::RenderMathMLScripts::fixAnonymousStyleForSubSupPair):
1708         (WebCore::RenderMathMLScripts::fixAnonymousStyles):
1709         * rendering/style/RenderStyle.cpp:
1710         (WebCore::RenderStyle::resolveAlignment):
1711         (WebCore::RenderStyle::resolveJustification):
1712         * rendering/style/RenderStyle.h:
1713         * rendering/style/StyleRareNonInheritedData.cpp:
1714         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
1715         (WebCore::StyleRareNonInheritedData::operator==):
1716         (WebCore::StyleRareNonInheritedData::contentDataEquivalent): Deleted.
1717         * rendering/style/StyleRareNonInheritedData.h:
1718         * rendering/style/StyleSelfAlignmentData.h: Added.
1719         (WebCore::StyleSelfAlignmentData::StyleSelfAlignmentData):
1720         (WebCore::StyleSelfAlignmentData::setPosition):
1721         (WebCore::StyleSelfAlignmentData::setPositionType):
1722         (WebCore::StyleSelfAlignmentData::setOverflow):
1723         (WebCore::StyleSelfAlignmentData::position):
1724         (WebCore::StyleSelfAlignmentData::positionType):
1725         (WebCore::StyleSelfAlignmentData::overflow):
1726         (WebCore::StyleSelfAlignmentData::operator==):
1727         (WebCore::StyleSelfAlignmentData::operator!=):
1728
1729 2015-04-29  Joseph Pecoraro  <pecoraro@apple.com>
1730
1731         NodeList has issues with Symbol and empty string
1732         https://bugs.webkit.org/show_bug.cgi?id=144310
1733
1734         Reviewed by Darin Adler.
1735
1736         Tests: fast/dom/StyleSheet/stylesheet-symbol-names.html
1737                fast/dom/dataset-name-getter-symbols.html
1738                fast/dom/named-items-with-empty-name.html
1739                fast/dom/named-items-with-symbol-name.html
1740                storage/domstorage/localstorage/named-items.html
1741
1742         Test different bindings objects with custom named setter
1743         and getter handlers. Ensure that they handle Symbol properties
1744         gracefully. Often times avoiding the string path.
1745
1746         * dom/StaticNodeList.cpp:
1747         (WebCore::StaticNodeList::namedItem):
1748         (WebCore::StaticElementList::namedItem):
1749         Better handle the empty string. It should not match an item.
1750
1751         * bindings/js/JSDOMBinding.h:
1752         (WebCore::propertyNameToString):
1753         In cases where we would use this, we should have handled
1754         Symbol properties.
1755
1756         (WebCore::propertyNameToAtomicString):
1757         For Symbols, use the unique string. This should result
1758         in no matches for a Symbol property.
1759
1760         * bindings/js/JSDOMStringMapCustom.cpp:
1761         (WebCore::JSDOMStringMap::getOwnPropertySlotDelegate):
1762         (WebCore::JSDOMStringMap::deleteProperty):
1763         (WebCore::JSDOMStringMap::putDelegate):
1764         * bindings/js/JSStorageCustom.cpp:
1765         (WebCore::JSStorage::canGetItemsForName):
1766         (WebCore::JSStorage::nameGetter):
1767         (WebCore::JSStorage::deleteProperty):
1768         (WebCore::JSStorage::putDelegate):
1769         * bindings/js/JSStyleSheetListCustom.cpp:
1770         (WebCore::JSStyleSheetList::canGetItemsForName):
1771         Treat Symbol properties as private properties. They just
1772         go directly through to the Object, and avoid the string
1773         getter/setter property path.
1774
1775 2015-04-29  Eric Carlson  <eric.carlson@apple.com>
1776
1777         [Mac] Register with device picker whenever a page has <video>
1778         https://bugs.webkit.org/show_bug.cgi?id=144408
1779
1780         Reviewed by Jer Noble.
1781
1782         * Modules/mediasession/WebMediaSessionManager.cpp:
1783         (WebCore::WebMediaSessionManager::setPlaybackTarget): Drive-by fix: don't tell a client to play
1784         to the target when it has not routes.
1785
1786         * html/HTMLMediaElement.cpp:
1787         (WebCore::HTMLMediaElement::mediaState): Set RequiresPlaybackTargetMonitoring whenever the 
1788         element is <video> with a video track that does not block wireless playback.
1789
1790 2015-04-29  Martin Robinson  <mrobinson@igalia.com>
1791
1792         [GTK] Add support for automatic hyphenation
1793         https://bugs.webkit.org/show_bug.cgi?id=44478
1794
1795         Reviewed by Carlos Garcia Campos.
1796
1797         No new tests. This patch unskips and updates results for existing hyphenation tests.
1798
1799         * PlatformGTK.cmake: Add the libhypen implementation to the source list.
1800         * platform/gtk/GtkUtilities.cpp:
1801         (WebCore::topLevelPath): Add this helper function taken from the test harness.
1802         (WebCore::getWebKitBuildDirectory): Ditto.
1803         * platform/gtk/GtkUtilities.h: Add function declarations for the helper functions.
1804         * platform/text/Hyphenation.cpp: Surround this implementation with !USE(LIBHYPHEN),
1805           so that it can still be shared.
1806         * platform/text/gtk/HyphenationLibHyphen.cpp: Added.
1807         (WebCore::extractLocaleFromDictionaryFilePath): Take in a dictionary filename and
1808         determine the locale that it covers.
1809         (WebCore::scanDirectoryForDicionaries): Look for all installed dictionaries as well
1810         as ones in the JHBuild root for testing.
1811         (WebCore::scanTestDictionariesDirectoryIfNecessary): Try to scan the dictionaries installed
1812         in the JHBuild root.
1813         (WebCore::availableLocales): Getter for global hash of installed dictionaries.
1814         (WebCore::canHyphenate): Added libhyphen implementation.
1815         (WebCore::HyphenationDictionary): Helper class that properly manages the memory of
1816         an open libhyphen dictionary. This is useful so that they can be stored in an MRU
1817         cache. This is a similar approach to the CoreFoundation implementation.
1818         (WebCore::AtomicStringKeyedMRUCache<RefPtr<HyphenationDictionary>>::createValueForNullKey): MRU cache
1819         helper.
1820         (WebCore::AtomicStringKeyedMRUCache<RefPtr<HyphenationDictionary>>::createValueForKey): Ditto.
1821         (WebCore::hyphenDictionaryCache): A cache for opened hyphenation dictionaries.
1822         (WebCore::countLeadingSpaces): Count leading spaces, since WebCore often passes words with them.
1823         (WebCore::lastHyphenLocation): Added libhyphen implementation.
1824
1825 2015-04-29  Myles C. Maxfield  <mmaxfield@apple.com>
1826
1827         Unreviewed build fix.
1828
1829         * platform/graphics/mac/FontCacheMac.mm:
1830         (WebCore::fontWithFamily):
1831
1832 2015-04-29  Eric Carlson  <eric.carlson@apple.com>
1833
1834         Some media tests assert after r183096
1835         https://bugs.webkit.org/show_bug.cgi?id=144098
1836
1837         Reviewed by Brent Fulgham.
1838
1839         Never assert when a MediaPlaybackTargetClient client calls one of the methods on Document
1840         after it has been unregistered. A media element unregisters itself when it is removed from the 
1841         document, but scripts can still run and modify state that results in a call to
1842         playbackTargetPickerClientStateDidChange. Remove the asserts instead of adding checks to
1843         the various call sites.
1844
1845         * dom/Document.cpp:
1846         (WebCore::Document::showPlaybackTargetPicker): Don't assert if the client has already
1847         been unregistered.
1848         (WebCore::Document::playbackTargetPickerClientStateDidChange): Ditto.
1849
1850 2015-04-29  Zalan Bujtas  <zalan@apple.com>
1851
1852         Simple line layout: Web process spins endlessly below layoutSimpleLines.
1853         https://bugs.webkit.org/show_bug.cgi?id=144403
1854         rdar://problem/20742783
1855
1856         Reviewed by Antti Koivisto.
1857
1858         When a text fragment overlaps multiple renderes and it does not fit the current line,
1859         we revert the text fragment iterator position so that the overlapping content
1860         gets processed again for the next line.
1861         However, TextFragmentIterator::revertToFragment() was reverting too much and
1862         we started processing old content all over again -> infinite loop.
1863
1864         This patch ensures that text fragment iterator is reverted to the right position.
1865
1866         Test: fast/text/simple-line-layout-wrapping-multiple-renderers-hang.html
1867
1868         * rendering/SimpleLineLayout.cpp:
1869         (WebCore::SimpleLineLayout::createLineRuns):
1870         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
1871         (WebCore::SimpleLineLayout::TextFragmentIterator::revertToEndOfFragment):
1872         (WebCore::SimpleLineLayout::TextFragmentIterator::revertToFragment): Deleted.
1873         * rendering/SimpleLineLayoutTextFragmentIterator.h:
1874
1875 2015-04-29  Filip Pizlo  <fpizlo@apple.com>
1876
1877         JSTypeInfo should have an inline type flag to indicate of getCallData() has been overridden
1878         https://bugs.webkit.org/show_bug.cgi?id=144397
1879
1880         Reviewed by Andreas Kling.
1881
1882         If you override getCallData() and you want to be called a "function", then you need to use the
1883         new TypeOfShouldCallGetCallData flag.
1884
1885         * bindings/scripts/CodeGeneratorJS.pm:
1886         (GenerateHeader):
1887         * bridge/objc/objc_runtime.h:
1888         * bridge/runtime_method.h:
1889         * bridge/runtime_object.h:
1890
1891 2015-04-29  Commit Queue  <commit-queue@webkit.org>
1892
1893         Unreviewed, rolling out r183553 and r183561.
1894         https://bugs.webkit.org/show_bug.cgi?id=144406
1895
1896         broke the iOS build (Requested by thorton__ on #webkit).
1897
1898         Reverted changesets:
1899
1900         "Switch QuickLook soft-linking to use
1901         QuickLookSoftLink.{h,mm}"
1902         https://bugs.webkit.org/show_bug.cgi?id=144362
1903         http://trac.webkit.org/changeset/183553
1904
1905         "Unreviewed iOS build fix after r183553: fix declaration of
1906         QLPreviewScheme"
1907         http://trac.webkit.org/changeset/183561
1908
1909 2015-04-29  Antti Koivisto  <antti@apple.com>
1910
1911         ResourceLoadPriority should be enum class
1912         https://bugs.webkit.org/show_bug.cgi?id=144326
1913
1914         Reviewed by Darin Adler.
1915
1916         * html/HTMLLinkElement.cpp:
1917         (WebCore::HTMLLinkElement::process):
1918         * loader/LinkLoader.cpp:
1919         (WebCore::LinkLoader::loadLink):
1920         * loader/ResourceLoadScheduler.cpp:
1921         (WebCore::ResourceLoadScheduler::scheduleLoad):
1922         (WebCore::ResourceLoadScheduler::servePendingRequests):
1923         (WebCore::ResourceLoadScheduler::HostInformation::~HostInformation):
1924         (WebCore::ResourceLoadScheduler::HostInformation::priorityToIndex):
1925         (WebCore::ResourceLoadScheduler::HostInformation::schedule):
1926         (WebCore::ResourceLoadScheduler::HostInformation::remove):
1927         (WebCore::ResourceLoadScheduler::HostInformation::hasRequests):
1928         (WebCore::ResourceLoadScheduler::HostInformation::limitRequests):
1929         * loader/ResourceLoadScheduler.h:
1930         (WebCore::ResourceLoadScheduler::HostInformation::requestsPending):
1931
1932             Modernize ResourceLoadScheduler code a bit while switching to enum class.
1933
1934         * loader/cache/CachedResource.cpp:
1935         (WebCore::defaultPriorityForResourceType):
1936         * loader/cache/CachedResourceLoader.cpp:
1937         (WebCore::CachedResourceLoader::requestResource):
1938         * loader/icon/IconLoader.cpp:
1939         (WebCore::IconLoader::startLoading):
1940         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
1941         (WebCore::WebCoreAVFResourceLoader::startLoading):
1942         * platform/network/ResourceLoadPriority.h:
1943         (WebCore::operator++):
1944         (WebCore::operator--):
1945         * platform/network/ResourceRequestBase.cpp:
1946         (WebCore::ResourceRequestBase::adopt):
1947         (WebCore::ResourceRequestBase::copyData):
1948         (WebCore::ResourceRequestBase::cachePolicy):
1949         (WebCore::ResourceRequestBase::priority):
1950         (WebCore::ResourceRequestBase::setPriority):
1951         * platform/network/ResourceRequestBase.h:
1952
1953             Remove bitfields. ResourceRequests are not present in large enough numbers to require this kind of optimization.
1954             Use modern initialization syntax.
1955
1956         (WebCore::ResourceRequestBase::ResourceRequestBase):
1957         (WebCore::CrossThreadResourceRequestDataBase::CrossThreadResourceRequestDataBase): Deleted.
1958         * platform/network/cf/ResourceRequestCFNet.cpp:
1959         (WebCore::initializeMaximumHTTPConnectionCountPerHost):
1960         (WebCore::initializeHTTPConnectionSettingsOnStartup):
1961         * platform/network/cf/ResourceRequestCFNet.h:
1962         (WebCore::toResourceLoadPriority):
1963         (WebCore::toPlatformRequestPriority):
1964         * platform/network/soup/ResourceRequest.h:
1965         (WebCore::toSoupMessagePriority):
1966         * testing/Internals.cpp:
1967         (WebCore::stringToResourceLoadPriority):
1968
1969 2015-04-29  Myles C. Maxfield  <mmaxfield@apple.com>
1970
1971         [OS X] Use CTFontCreateForCSS instead of doing font search ourselves
1972         https://bugs.webkit.org/show_bug.cgi?id=132159
1973
1974         Reviewed by Darin Adler.
1975
1976         On platforms that support it, delegate font selection logic to the platform. Currently, this is
1977         only supported on Mac, using CTFontCreateForCSS().
1978
1979         This also changes the mechanism that enforces our font whitelist in our tests. We used to
1980         swizzle the implementations of NSFontManager methods. This patch migrates to using a whitelist of
1981         font family names instead.
1982
1983         Note that this patch is a work in progress, because it makes the following tests fail:
1984         fast/css/font-weight-1.html
1985         fast/forms/validation-message-appearance.html
1986         fast/forms/select/optgroup-rendering.html
1987
1988         No new tests, because there is no behavior change.
1989
1990         * platform/graphics/FontCache.h: Add a function to set the whitlist.
1991         * platform/graphics/mac/FontCacheMac.mm:
1992         (WebCore::fontWhitelist):
1993         (WebCore::FontCache::setFontWhitelist):
1994         (WebCore::toAppKitFontWeight):
1995         (WebCore::toCoreTextFontWeight):
1996         (WebCore::fontWithFamily): If ENABLE(PLATFORM_FONT_LOOKUP), use CTFontCreateForCSS().
1997         (WebCore::FontCache::createFontPlatformData):
1998         * platform/spi/cocoa/CoreTextSPI.h: Add signature for CTFontCreateForCSS().
1999
2000 2015-04-29  Jer Noble  <jer.noble@apple.com>
2001
2002         Unreviewed iOS build fix after r183553: fix declaration of QLPreviewScheme
2003
2004         * platform/ios/QuickLookSoftLink.mm:
2005
2006 2015-04-29  Eric Carlson  <eric.carlson@apple.com>
2007
2008         [Mac] Use new device picker menu API
2009         https://bugs.webkit.org/show_bug.cgi?id=144392
2010
2011         Reviewed by Jer Noble.
2012
2013         * Modules/mediasession/WebMediaSessionManager.cpp:
2014         (WebCore::WebMediaSessionManager::showPlaybackTargetPicker): Pass the route state to the picker.
2015         * platform/graphics/MediaPlaybackTargetPicker.h:
2016
2017         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
2018         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
2019         (WebCore::MediaPlaybackTargetPickerMac::MediaPlaybackTargetPickerMac):  m_deviceChangeTimer -> m_pendingActionTimer.
2020         (WebCore::MediaPlaybackTargetPickerMac::~MediaPlaybackTargetPickerMac): Ditto.
2021         (WebCore::MediaPlaybackTargetPickerMac::pendingActionTimerFired): Renamed from 
2022         outputeDeviceAvailabilityChangedTimerFired.
2023         (WebCore::MediaPlaybackTargetPickerMac::availableDevicesDidChange): Use addPendingAction.
2024         (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker): Call new picker API if it is
2025         available. New API returns true if a target is chosen, so call currentDeviceDidChange in that case.
2026         (WebCore::MediaPlaybackTargetPickerMac::addPendingAction): New.
2027         (WebCore::MediaPlaybackTargetPickerMac::currentDeviceDidChange): Make asynchronous because it 
2028         can now be called from showPlaybackTargetPicker.
2029         (WebCore::MediaPlaybackTargetPickerMac::outputeDeviceAvailabilityChangedTimerFired): Renamed
2030         pendingActionTimerFired.
2031
2032         * platform/spi/cocoa/AVKitSPI.h: Add new SPI.
2033
2034 2015-04-29  Antti Koivisto  <antti@apple.com>
2035
2036         Main resource loaded via 304 response becomes empty if reloaded by user
2037         https://bugs.webkit.org/show_bug.cgi?id=144386
2038
2039         Reviewed by Darin Adler.
2040
2041         Memory cache layer may make a main resource request conditional (add If-modified-since/If-none-match header).
2042         DocumentLoader stores the final ResourceRequest associated with document. If user triggered reload for
2043         conditionally loaded document DocumentLoader would include the same conditionals to the new request as well.
2044         Since these were not added by the memory cache it would pass any 304 response back to the DocumentLoader.
2045         However DocumentLoader has no code to handle 304 so we would end up with an empty document.
2046
2047         Test: http/tests/cache/main-resource-304-reload.html
2048
2049         * loader/DocumentLoader.cpp:
2050         (WebCore::DocumentLoader::startLoadingMainResource):
2051
2052             Ensure DocumentLoader doesn't issue conditional requests.
2053
2054 2015-04-28  Jer Noble  <jer.noble@apple.com>
2055
2056         Replace HTMLMediaElement's seek timer with a task queue.
2057         https://bugs.webkit.org/show_bug.cgi?id=144353
2058
2059         Reviewed by Eric Carlson.
2060
2061         No change in functionality, so no new tests added.
2062
2063         Replace a zero-length timer with an explicit task queue, backed by Document's postTask(). To
2064         make enqueued tasks cancellable, add a new GenericTaskQueue class modelled on
2065         GenericEventQueue which can cancel enqueued but not-yet-executed tasks.
2066
2067         * CMakeLists.txt:
2068         * WebCore.vcxproj/WebCore.vcxproj:
2069         * WebCore.vcxproj/WebCore.vcxproj.filters:
2070         * WebCore.xcodeproj/project.pbxproj:
2071         * dom/GenericTaskQueue.cpp: Added.
2072         (WebCore::GenericTaskQueue::GenericTaskQueue): Initialize ivars.
2073         (WebCore::GenericTaskQueue::enqueueTask): Wrap the task and pass it to the ScriptExecutionContext.
2074         (WebCore::GenericTaskQueue::close): Assert that the task queue will not accept any additional tasks.
2075         (WebCore::GenericTaskQueue::cancelAllTasks): Revoke outstanding weak pointers, thereby cancelling tasks.
2076         * dom/GenericTaskQueue.h: Added.
2077         (WebCore::GenericTaskQueue::hasPendingTasks):
2078         * html/HTMLMediaElement.cpp:
2079         (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize the task queue.
2080         (WebCore::HTMLMediaElement::~HTMLMediaElement): Close the task queue.
2081         (WebCore::HTMLMediaElement::seekWithTolerance): Post a task, rather than start a timer.
2082         (WebCore::HTMLMediaElement::seekTask): Renamed from seekTimerFired().
2083         (WebCore::HTMLMediaElement::seekTimerFired): Deleted.
2084         * html/HTMLMediaElement.h:
2085
2086 2015-04-28  David Kilzer  <ddkilzer@apple.com>
2087
2088         Switch QuickLook soft-linking to use QuickLookSoftLink.{h,mm}
2089         <http://webkit.org/b/144362>
2090
2091         Reviewed by Andy Estes.
2092
2093         This patch switches soft-linking of QuickLook.framework to
2094         QuickLookSoftLink.{h,mm} so that we stop exporting unintended
2095         symbols.
2096
2097         No new tests since no change in behavior.
2098
2099         * WebCore.xcodeproj/project.pbxproj:
2100         - Add QuickLookSoftLinking.{h,mm} to the project.
2101
2102         * platform/ios/QuickLookSoftLink.h: Added.
2103         * platform/ios/QuickLookSoftLink.mm: Added.
2104         * platform/mac/SoftLinking.h:
2105         (SOFT_LINK_CLASS_FOR_HEADER): Add macro.
2106         (SOFT_LINK_CLASS_FOR_SOURCE): Add macro.
2107
2108         * platform/network/ios/QuickLook.h:
2109         - Remove unused declarations.
2110
2111         * platform/network/ios/QuickLook.mm:
2112         (WebCore::QLPreviewConverterClass): Deleted.
2113         (WebCore::QLTypeCopyBestMimeTypeForFileNameAndMimeType): Deleted.
2114         (WebCore::QLTypeCopyBestMimeTypeForURLAndMimeType): Deleted.
2115         (WebCore::QLTypeCopyUTIForURLAndMimeType): Deleted.
2116         - Remove SOFT_LINK macros and unused methods after switching to
2117           new QuickLookSoftLink.{h,mm}.
2118         (WebCore::QLPreviewGetSupportedMIMETypesSet):
2119         - Switch to use NeverDestroyed<>.
2120         (WebCore::registerQLPreviewConverterIfNeeded):
2121         (createQLPreviewProtocol):
2122         (WebCore::QLPreviewProtocol):
2123         (WebCore::QuickLookHandle::QuickLookHandle):
2124         (WebCore::QuickLookHandle::create):
2125         (WebCore::QuickLookHandle::shouldCreateForMIMEType):
2126         - Simplify code when using QuickLookSoftLink.h.
2127
2128         * platform/network/ios/WebCoreURLResponseIOS.mm:
2129         - Include QuickLookSoftLink.h header.
2130
2131 2015-04-29  Darin Adler  <darin@apple.com>
2132
2133         [ES6] Implement Unicode code point escapes
2134         https://bugs.webkit.org/show_bug.cgi?id=144377
2135
2136         Reviewed by Antti Koivisto.
2137
2138         Test: js/unicode-escape-sequences.html
2139
2140         * css/CSSParser.cpp:
2141         (WebCore::CSSParser::parseEscape): Use ICU's UCHAR_MAX_VALUE instead of writing
2142         out 0x10FFFF; clearer this way. Also use our replacementCharacter instead of
2143         writing out 0xFFFD.
2144
2145         * html/parser/HTMLEntityParser.cpp:
2146         (WebCore::isAlphaNumeric): Deleted.
2147         (WebCore::HTMLEntityParser::legalEntityFor): Use ICU's UCHAR_MAX_VALUE and
2148         U_IS_SURROGATE instead of writing the code out. Didn't use U_IS_UNICODE_CHAR
2149         because that also includes U_IS_UNICODE_NONCHAR and thus would change behavior,
2150         but maye it's something we want to do in the future.
2151         (WebCore::HTMLEntityParser::consumeNamedEntity): Use isASCIIAlphanumeric instead
2152         of a the function in this file that does the same thing less efficiently.
2153
2154         * html/parser/InputStreamPreprocessor.h:
2155         (WebCore::InputStreamPreprocessor::processNextInputCharacter): Use
2156         replacementCharacter from CharacterNames.h instead of writing out 0xFFFd.
2157
2158         * xml/parser/CharacterReferenceParserInlines.h:
2159         (WebCore::consumeCharacterReference): Use ICU's UCHAR_MAX_VALUE instead of
2160         defining our own local highestValidCharacter constant.
2161
2162 2015-04-29  Martin Robinson  <mrobinson@igalia.com>
2163
2164         [CMake] [GTK] Organize and clean up unused CMake variables
2165         https://bugs.webkit.org/show_bug.cgi?id=144364
2166
2167         Reviewed by Gyuyoung Kim.
2168
2169         * PlatformGTK.cmake: Add variables specific to this project.
2170
2171 2015-04-29  Carlos Garcia Campos  <cgarcia@igalia.com>
2172
2173         REGRESSION(r182573): [GTK] The default context menu contains an empty item since r182573
2174         https://bugs.webkit.org/show_bug.cgi?id=144388
2175
2176         Reviewed by Brady Eidson.
2177
2178         There used to be a method in ContextMenuItem to check if share
2179         menu item was supported or not, but since r182573, there's a
2180         method to get the share menu item. If the returned menu item is
2181         null, it's not added to the menu, but we are not returning a null
2182         ContextMenu item even though we don't support share menu item.
2183
2184         * platform/gtk/ContextMenuItemGtk.cpp:
2185         (WebCore::ContextMenuItem::shareMenuItem): Return a null ContextMenuItem.
2186
2187 2015-04-29  Zan Dobersek  <zdobersek@igalia.com>
2188
2189         Switch to std::function<>, std::bind() in MediaPlayerPrivateAVFoundationObjC
2190         https://bugs.webkit.org/show_bug.cgi?id=144232
2191
2192         Reviewed by Darin Adler.
2193
2194         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2195         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]): 
2196         Replace uses of WTF::Function<> and WTF::bind() with the STL alternatives.
2197
2198 2015-04-29  Hyungwook Lee  <hyungwook.lee@navercorp.com>
2199
2200         Fix crash in WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::setBlock().
2201         https://bugs.webkit.org/show_bug.cgi?id=140261
2202
2203         Reviewed by Darin Adler.
2204
2205         We need to check whether RenderObject is valid in RenderView::fooSubtreeSelection functions
2206         because invalid object has caused a crash. This patch adds isValidObjectForNewSelection(), and use it.
2207
2208         * rendering/RenderView.cpp:
2209         (WebCore::isValidObjectForNewSelection):
2210         (WebCore::RenderView::clearSubtreeSelection):
2211         (WebCore::RenderView::applySubtreeSelection):
2212
2213 2015-04-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2214
2215         Synchronous XMLHttpRequest should get access to AppCache resources stored as flat files
2216         https://bugs.webkit.org/show_bug.cgi?id=143711
2217
2218         Reviewed by Darin Adler.
2219
2220         This patch checks whether a substitute resource data is stored in memory or in file for synchronous loads.
2221         If data is stored in file, it reads the data through SharedBuffer::createWithContentsOfFile.
2222         This patch refactors some routines to replace Vector<char> by SharedBuffer to transmit response data.
2223
2224         Test: http/tests/appcache/simple-video-sync.html
2225
2226         * html/HTMLMediaElement.cpp:
2227         (WebCore::HTMLMediaElement::parseAttribute):
2228         * loader/DocumentThreadableLoader.cpp:
2229         (WebCore::DocumentThreadableLoader::loadRequest):
2230         * loader/FrameLoader.cpp:
2231         (WebCore::FrameLoader::loadResourceSynchronously):
2232         * loader/FrameLoader.h:
2233         * loader/appcache/ApplicationCacheHost.cpp:
2234         (WebCore::ApplicationCacheHost::maybeLoadResource):
2235         (WebCore::ApplicationCacheHost::createFileURL):
2236         (WebCore::ApplicationCacheHost::maybeLoadSynchronously):
2237         (WebCore::ApplicationCacheHost::maybeLoadFallbackSynchronously):
2238         * loader/appcache/ApplicationCacheHost.h:
2239         * xml/XSLTProcessorLibxslt.cpp:
2240         (WebCore::docLoaderFunc):
2241         * xml/parser/XMLDocumentParserLibxml2.cpp:
2242         (WebCore::openFunc):
2243
2244 2015-04-29  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2245
2246         Purge PassRefPtr from createSVGPathSegFoo factory functions
2247         https://bugs.webkit.org/show_bug.cgi?id=144374
2248
2249         Reviewed by Darin Adler.
2250
2251         Use Ref instead of PassRefPtr in createSVGPathSegFoo functions because
2252         those factory functions can't return null. Additionally let's remove unnecessary
2253         #include<PassRefPtr.h> there.
2254
2255         No new tests, no behavior changes.
2256
2257         * svg/SVGColor.cpp:
2258         (WebCore::SVGColor::cloneForCSSOM):
2259         * svg/SVGColor.h:
2260         * svg/SVGGlyphMap.h:
2261         (WebCore::GlyphMapNode::create):
2262         * svg/SVGPaint.cpp:
2263         (WebCore::SVGPaint::cloneForCSSOM):
2264         * svg/SVGPaint.h:
2265         * svg/SVGPathElement.cpp:
2266         (WebCore::SVGPathElement::createSVGPathSegClosePath):
2267         (WebCore::SVGPathElement::createSVGPathSegMovetoAbs):
2268         (WebCore::SVGPathElement::createSVGPathSegMovetoRel):
2269         (WebCore::SVGPathElement::createSVGPathSegLinetoAbs):
2270         (WebCore::SVGPathElement::createSVGPathSegLinetoRel):
2271         (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicAbs):
2272         (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicRel):
2273         (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticAbs):
2274         (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticRel):
2275         (WebCore::SVGPathElement::createSVGPathSegArcAbs):
2276         (WebCore::SVGPathElement::createSVGPathSegArcRel):
2277         (WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalAbs):
2278         (WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalRel):
2279         (WebCore::SVGPathElement::createSVGPathSegLinetoVerticalAbs):
2280         (WebCore::SVGPathElement::createSVGPathSegLinetoVerticalRel):
2281         (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothAbs):
2282         (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothRel):
2283         (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothAbs):
2284         (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothRel):
2285         * svg/SVGPathElement.h:
2286         * svg/SVGPathSegArcAbs.h:
2287         (WebCore::SVGPathSegArcAbs::create):
2288         * svg/SVGPathSegArcRel.h:
2289         (WebCore::SVGPathSegArcRel::create):
2290         * svg/SVGPathSegClosePath.h:
2291         (WebCore::SVGPathSegClosePath::create):
2292         * svg/SVGPathSegCurvetoCubicAbs.h:
2293         (WebCore::SVGPathSegCurvetoCubicAbs::create):
2294         * svg/SVGPathSegCurvetoCubicRel.h:
2295         (WebCore::SVGPathSegCurvetoCubicRel::create):
2296         * svg/SVGPathSegCurvetoCubicSmoothAbs.h:
2297         (WebCore::SVGPathSegCurvetoCubicSmoothAbs::create):
2298         * svg/SVGPathSegCurvetoCubicSmoothRel.h:
2299         (WebCore::SVGPathSegCurvetoCubicSmoothRel::create):
2300         * svg/SVGPathSegCurvetoQuadraticAbs.h:
2301         (WebCore::SVGPathSegCurvetoQuadraticAbs::create):
2302         * svg/SVGPathSegCurvetoQuadraticRel.h:
2303         (WebCore::SVGPathSegCurvetoQuadraticRel::create):
2304         * svg/SVGPathSegCurvetoQuadraticSmoothAbs.h:
2305         (WebCore::SVGPathSegCurvetoQuadraticSmoothAbs::create):
2306         * svg/SVGPathSegCurvetoQuadraticSmoothRel.h:
2307         (WebCore::SVGPathSegCurvetoQuadraticSmoothRel::create):
2308         * svg/SVGPathSegLinetoAbs.h:
2309         (WebCore::SVGPathSegLinetoAbs::create):
2310         * svg/SVGPathSegLinetoHorizontalAbs.h:
2311         (WebCore::SVGPathSegLinetoHorizontalAbs::create):
2312         * svg/SVGPathSegLinetoHorizontalRel.h:
2313         (WebCore::SVGPathSegLinetoHorizontalRel::create):
2314         * svg/SVGPathSegLinetoRel.h:
2315         (WebCore::SVGPathSegLinetoRel::create):
2316         * svg/SVGPathSegLinetoVerticalAbs.h:
2317         (WebCore::SVGPathSegLinetoVerticalAbs::create):
2318         * svg/SVGPathSegLinetoVerticalRel.h:
2319         (WebCore::SVGPathSegLinetoVerticalRel::create):
2320         * svg/SVGPathSegMovetoAbs.h:
2321         (WebCore::SVGPathSegMovetoAbs::create):
2322         * svg/SVGPathSegMovetoRel.h:
2323         (WebCore::SVGPathSegMovetoRel::create):
2324         * svg/SVGViewSpec.h:
2325         (WebCore::SVGViewSpec::create):
2326         * svg/animation/SMILTimeContainer.h:
2327         (WebCore::SMILTimeContainer::create):
2328         * svg/animation/SVGSMILElement.cpp:
2329         (WebCore::ConditionEventListener::create):
2330         * svg/graphics/SVGImage.h:
2331         * svg/graphics/SVGImageForContainer.h:
2332         * svg/graphics/filters/SVGFilter.cpp:
2333         (WebCore::SVGFilter::create):
2334         * svg/graphics/filters/SVGFilter.h:
2335
2336 2015-04-28  Simon Fraser  <simon.fraser@apple.com>
2337
2338         Make a non-static version of FrameView::yPositionForRootContentLayer()
2339         https://bugs.webkit.org/show_bug.cgi?id=144375
2340
2341         Reviewed by Andy Estes.
2342
2343         There were two calls to the static FrameView::yPositionForRootContentLayer()
2344         which passed in all the arguments for the same FrameView. Make a member
2345         function for convenience.
2346
2347         * page/FrameView.cpp:
2348         (WebCore::FrameView::yPositionForRootContentLayer):
2349         * page/FrameView.h:
2350         * rendering/RenderLayerCompositor.cpp:
2351         (WebCore::RenderLayerCompositor::updateRootLayerPosition):
2352
2353 2015-04-28  Ryuan Choi  <ryuan.choi@navercorp.com>
2354
2355         [CoordinatedGraphics] Merge TILED_BACKING_STORE guard with COORDINATED_GRAPHICS
2356         https://bugs.webkit.org/show_bug.cgi?id=143001
2357
2358         Reviewed by Gyuyoung Kim.
2359
2360         TiledBackingStore has only been used by Coordinated Graphics since Qt and WebKit1/Efl were dropped.
2361         So, this patch replaces USE(TILED_BACKING_STORE) with USE(COORDINATED_GRAPHICS) to merge the features.
2362
2363         In addition, this moves TiledBackingStore and related files from platform to platform/texmap/coordinated
2364         where other coordinated graphics files are located.
2365
2366         * CMakeLists.txt: Move TiledBackingStore.cpp because this is not common file.
2367         * PlatformEfl.cmake:
2368         * PlatformGTK.cmake:
2369         * WebCore.vcxproj/WebCore.vcxproj: Follow new location of TiledBackingStore* files.
2370         * WebCore.vcxproj/WebCore.vcxproj.filters:
2371         * loader/EmptyClients.h:
2372         * page/Chrome.cpp:
2373         * page/Chrome.h:
2374         * page/ChromeClient.h:
2375         * page/Frame.cpp:
2376         (WebCore::Frame::createView):
2377         * page/FrameView.cpp:
2378         (WebCore::FrameView::requestScrollPositionUpdate):
2379         * page/FrameView.h:
2380         * page/Page.cpp:
2381         (WebCore::Page::setPageScaleFactor):
2382         * platform/HostWindow.h:
2383         * platform/ScrollView.cpp:
2384         (WebCore::ScrollView::unscaledVisibleContentSizeIncludingObscuredArea):
2385         (WebCore::ScrollView::unscaledUnobscuredVisibleContentSize):
2386         (WebCore::ScrollView::visibleContentRectInternal):
2387         (WebCore::ScrollView::scrollTo):
2388         * platform/ScrollView.h:
2389         * platform/graphics/cairo/TileCairo.h: Removed because it is dead code since r169328
2390         * platform/graphics/texmap/coordinated/Tile.h: Renamed from Source/WebCore/platform/graphics/Tile.h.
2391         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp: Renamed from Source/WebCore/platform/graphics/TiledBackingStore.cpp.
2392         * platform/graphics/texmap/coordinated/TiledBackingStore.h: Renamed from Source/WebCore/platform/graphics/TiledBackingStore.h.
2393         * platform/graphics/texmap/coordinated/TiledBackingStoreBackend.h: Renamed from Source/WebCore/platform/graphics/TiledBackingStoreBackend.h.
2394         * platform/graphics/texmap/coordinated/TiledBackingStoreClient.h: Renamed from Source/WebCore/platform/graphics/TiledBackingStoreClient.h.
2395
2396 2015-04-28  Brent Fulgham  <bfulgham@apple.com>
2397
2398         REGRESSION(180076): [Mac, iOS] Correct possible null dereference in printing code
2399         https://bugs.webkit.org/show_bug.cgi?id=144366
2400         <rdar://problem/20533513>
2401
2402         Reviewed by Dean Jackson.
2403
2404         * rendering/RenderBlockFlow.cpp:
2405         (WebCore::needsAppleMailPaginationQuirk): Check if the document settings is a nullptr
2406         before attempting to dereference it. 
2407
2408 2015-04-28  Andreas Kling  <akling@apple.com>
2409
2410         Simplify DOM wrapper destruction, don't deref() in finalizers.
2411         <https://webkit.org/b/144183>
2412
2413         Reviewed by Darin Adler.
2414
2415         DOM JS bindings had two mechanisms to call deref() on the WebCore object,
2416         once through a weak finalizer, and once through the JSCell's regular destructor.
2417
2418         That was once believed to be an optimization, but these days the finalizer will
2419         run just moments before the destructor anyway, all in the same call stack.
2420         And more importantly, the finalizer is not guaranteed to run, for instance in the
2421         case where a Weak is assigned to after going dead, but before the WeakBlock
2422         has been swept by the incremental sweeper.
2423
2424         Simplify this by just removing the deref() from the generated finalizers.
2425         This makes it easier to reason about DOM wrapper destruction, and eliminates
2426         the awkward time window  where a DOM wrapper could have a null impl().
2427
2428         We could spend more time on figuring out a way to have finalizers manage the
2429         destruction of these wrappers, but that would require fundamental changes to
2430         our implementation of JSC::Weak pointers. It would allow us to make JSDOMWrapper
2431         destructor-less, and shrink each wrapper object by 1 pointer (the ClassInfo*.)
2432         However the risk:reward ratio does not seem justified at this point in time.
2433
2434         * bindings/scripts/CodeGeneratorJS.pm:
2435         (GenerateHeader):
2436         (GenerateImplementation):
2437         * bindings/js/JSCSSValueCustom.cpp:
2438         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2439         (WebCore::JSTestActiveDOMObject::~JSTestActiveDOMObject):
2440         (WebCore::JSTestActiveDOMObjectOwner::finalize):
2441         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
2442         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
2443         (WebCore::JSTestCustomNamedGetter::~JSTestCustomNamedGetter):
2444         (WebCore::JSTestCustomNamedGetterOwner::finalize):
2445         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
2446         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2447         (WebCore::JSTestEventConstructor::~JSTestEventConstructor):
2448         (WebCore::JSTestEventConstructorOwner::finalize):
2449         * bindings/scripts/test/JS/JSTestEventConstructor.h:
2450         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2451         (WebCore::JSTestEventTarget::~JSTestEventTarget):
2452         (WebCore::JSTestEventTargetOwner::finalize):
2453         * bindings/scripts/test/JS/JSTestEventTarget.h:
2454         * bindings/scripts/test/JS/JSTestException.cpp:
2455         (WebCore::JSTestException::~JSTestException):
2456         (WebCore::JSTestExceptionOwner::finalize):
2457         * bindings/scripts/test/JS/JSTestException.h:
2458         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2459         (WebCore::JSTestGenerateIsReachable::~JSTestGenerateIsReachable):
2460         (WebCore::JSTestGenerateIsReachableOwner::finalize):
2461         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
2462         * bindings/scripts/test/JS/JSTestInterface.cpp:
2463         (WebCore::JSTestInterface::~JSTestInterface):
2464         (WebCore::JSTestInterfaceOwner::finalize):
2465         * bindings/scripts/test/JS/JSTestInterface.h:
2466         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2467         (WebCore::JSTestMediaQueryListListener::~JSTestMediaQueryListListener):
2468         (WebCore::JSTestMediaQueryListListenerOwner::finalize):
2469         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
2470         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2471         (WebCore::JSTestNamedConstructor::~JSTestNamedConstructor):
2472         (WebCore::JSTestNamedConstructorOwner::finalize):
2473         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
2474         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
2475         (WebCore::JSTestNondeterministic::~JSTestNondeterministic):
2476         (WebCore::JSTestNondeterministicOwner::finalize):
2477         * bindings/scripts/test/JS/JSTestNondeterministic.h:
2478         * bindings/scripts/test/JS/JSTestObj.cpp:
2479         (WebCore::JSTestObj::~JSTestObj):
2480         (WebCore::JSTestObjOwner::finalize):
2481         * bindings/scripts/test/JS/JSTestObj.h:
2482         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2483         (WebCore::JSTestOverloadedConstructors::~JSTestOverloadedConstructors):
2484         (WebCore::JSTestOverloadedConstructorsOwner::finalize):
2485         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
2486         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2487         (WebCore::JSTestSerializedScriptValueInterface::~JSTestSerializedScriptValueInterface):
2488         (WebCore::JSTestSerializedScriptValueInterfaceOwner::finalize):
2489         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
2490         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2491         (WebCore::JSTestTypedefs::~JSTestTypedefs):
2492         (WebCore::JSTestTypedefsOwner::finalize):
2493         * bindings/scripts/test/JS/JSTestTypedefs.h:
2494         * bindings/scripts/test/JS/JSattribute.cpp:
2495         (WebCore::JSattribute::~JSattribute):
2496         (WebCore::JSattributeOwner::finalize):
2497         * bindings/scripts/test/JS/JSattribute.h:
2498         * bindings/scripts/test/JS/JSreadonly.cpp:
2499         (WebCore::JSreadonly::~JSreadonly):
2500         (WebCore::JSreadonlyOwner::finalize):
2501         * bindings/scripts/test/JS/JSreadonly.h:
2502
2503 2015-04-28  Alex Christensen  <achristensen@webkit.org>
2504
2505         Build WinCairo without cygwin.
2506         https://bugs.webkit.org/show_bug.cgi?id=144365
2507
2508         Reviewed by Myles Maxfield.
2509
2510         * WebCore.vcxproj/WebCoreGeneratedWinCairo.make:
2511         Pass the CC executable to build-generated-files.pl like r182164.
2512         * WebCore.vcxproj/build-generated-files.pl:
2513         Default to 8 CPUs unless otherwise specified.
2514
2515 2015-04-28  Sam Weinig  <sam@webkit.org>
2516
2517         [Content Extensions] Process NFAs individually to avoid having all NFAs live at the same time
2518         https://bugs.webkit.org/show_bug.cgi?id=144363
2519
2520         Reviewed by Alex Christensen.
2521
2522         This brings dirty memory use when compiling our test content extension down from ~300MB to ~100MB.
2523
2524         * contentextensions/CombinedURLFilters.cpp:
2525         (WebCore::ContentExtensions::CombinedURLFilters::processNFAs):
2526         (WebCore::ContentExtensions::CombinedURLFilters::createNFAs): Deleted.
2527         * contentextensions/CombinedURLFilters.h:
2528         Replace function that creates a Vector of all the NFAs with one that allows incremental processing
2529         as they are created.
2530
2531         * contentextensions/ContentExtensionCompiler.cpp:
2532         (WebCore::ContentExtensions::addUniversalActionsToDFA):
2533         Extract code to add universal actions into a helper, since we need to call it in two places now.
2534
2535         (WebCore::ContentExtensions::compileRuleList):
2536         Adopt CombinedURLFilters::processNFAs. Now that we don't have a Vector of NFAs, we need to keep track
2537         of whether or not any NFAs were processed and if we are currently processing the first NFA so we can
2538         ensure that we have some bytecode generated event for empty rule sets, and that universal actions are
2539         placed on the first DFA.
2540
2541 2015-04-28  Timothy Horton  <timothy_horton@apple.com>
2542
2543         [TextIndicator] Yellow highlight takes too long to fade out on scroll
2544         https://bugs.webkit.org/show_bug.cgi?id=144358
2545         <rdar://problem/19451011>
2546
2547         Reviewed by Beth Dakin.
2548
2549         * page/TextIndicator.h:
2550         Add Lifetime and DismissalAnimation enums.
2551
2552         (WebCore::TextIndicator::contentImageWithHighlight):
2553         (WebCore::TextIndicator::contentImage):
2554         Fix style.
2555
2556         * page/mac/TextIndicatorWindow.h:
2557         * page/mac/TextIndicatorWindow.mm:
2558         (WebCore::TextIndicatorWindow::TextIndicatorWindow):
2559         (WebCore::TextIndicatorWindow::~TextIndicatorWindow):
2560         (WebCore::TextIndicatorWindow::clearTextIndicator):
2561         (WebCore::TextIndicatorWindow::setTextIndicator):
2562         (WebCore::TextIndicatorWindow::closeWindow):
2563         (WebCore::TextIndicatorWindow::startFadeOut):
2564         Rename m_startFadeOutTimer to m_temporaryTextIndicatorTimer (and related).
2565         This is just about temporary-lifetime TextIndicators, like the ones
2566         you get when the find-in-page UI is hidden but you hit Cmd-G.
2567
2568         Add clearTextIndicator, which takes a DismissalAnimation, providing
2569         clients an opportunity to avoid the normal fade-out animation, if it
2570         was going to happen.
2571
2572 2015-04-28  Michael Catanzaro  <mcatanzaro@igalia.com>
2573
2574         Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT
2575         https://bugs.webkit.org/show_bug.cgi?id=144304
2576
2577         Reviewed by Geoffrey Garen.
2578
2579         Define ENABLE_JIT, enabled by default, instead of ENABLE_LLINT_C_LOOP, disabled by default.
2580
2581         * Configurations/FeatureDefines.xcconfig:
2582
2583 2015-04-28  Commit Queue  <commit-queue@webkit.org>
2584
2585         Unreviewed, rolling out r183514.
2586         https://bugs.webkit.org/show_bug.cgi?id=144359
2587
2588         It broke cloop test bots (Requested by mcatanzaro on #webkit).
2589
2590         Reverted changeset:
2591
2592         "Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT"
2593         https://bugs.webkit.org/show_bug.cgi?id=144304
2594         http://trac.webkit.org/changeset/183514
2595
2596 2015-04-28  Michael Catanzaro  <mcatanzaro@igalia.com>
2597
2598         Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT
2599         https://bugs.webkit.org/show_bug.cgi?id=144304
2600
2601         Reviewed by Geoffrey Garen.
2602
2603         Define ENABLE_JIT, enabled by default, instead of ENABLE_LLINT_C_LOOP, disabled by default.
2604
2605         * Configurations/FeatureDefines.xcconfig:
2606
2607 2015-04-28  Zalan Bujtas  <zalan@apple.com>
2608
2609         Checkboxes on bugs.webkit.org are painted with stripes at some zoom levels.
2610         https://bugs.webkit.org/show_bug.cgi?id=144351
2611
2612         Reviewed by Simon Fraser.
2613
2614         This patch ensures that CG context is properly restored after painting dashed/dotted lines.
2615
2616         Test: fast/forms/checkbox-painting-with-hr.html
2617
2618         * platform/graphics/cg/GraphicsContextCG.cpp:
2619         (WebCore::GraphicsContext::drawLine):
2620
2621 2015-04-28  Simon Fraser  <simon.fraser@apple.com>
2622
2623         Provide contentsToView() and viewToContents() functions on ScrollView, and use them
2624         https://bugs.webkit.org/show_bug.cgi?id=144357
2625
2626         Reviewed by Tim Horton.
2627
2628         Too much code was consulting topContentInset() and headerHeight() directly. Replace
2629         with calls to new contentsToView() and viewToContents() functions, which wrap the
2630         exisiting documentScrollOffsetRelativeToViewOrigin().
2631         
2632         Use the new functions in FrameView and ScrollView coordinate mapping functions.
2633         
2634         No behavior change.
2635
2636         * page/FrameView.cpp:
2637         (WebCore::FrameView::convertFromRendererToContainingView):
2638         (WebCore::FrameView::convertFromContainingViewToRenderer):
2639         * platform/ScrollView.cpp:
2640         (WebCore::ScrollView::viewToContents):
2641         (WebCore::ScrollView::contentsToView):
2642         (WebCore::ScrollView::rootViewToContents):
2643         (WebCore::ScrollView::contentsToRootView):
2644         (WebCore::ScrollView::rootViewToTotalContents):
2645         (WebCore::ScrollView::windowToContents):
2646         (WebCore::ScrollView::contentsToWindow):
2647         * platform/ScrollView.h:
2648
2649 2015-04-28  Eric Carlson  <eric.carlson@apple.com>
2650
2651         [Mac] Simplify code to support media engines which do not support target playback
2652         https://bugs.webkit.org/show_bug.cgi?id=144332
2653
2654         Reviewed by Jer Noble.
2655
2656         * Modules/mediasession/WebMediaSessionManager.cpp:
2657         (WebCore::WebMediaSessionManager::externalOutputDeviceAvailableDidChange): Always make client
2658         callback, let them decide if it is significant or not.
2659
2660         * html/HTMLMediaElement.cpp:
2661         (WebCore::HTMLMediaElement::HTMLMediaElement): m_loadTimer -> m_pendingActionTimer.
2662         (WebCore::HTMLMediaElement::scheduleDelayedAction): Handle CheckPlaybackTargetCompatablity.
2663         (WebCore::HTMLMediaElement::scheduleNextSourceChild): m_loadTimer -> m_pendingActionTimer.
2664         (WebCore::HTMLMediaElement::loadTimerFired): Renamed pendingActionTimerFired.
2665         (WebCore::HTMLMediaElement::prepareForLoad): m_loadTimer -> m_pendingActionTimer.
2666         (WebCore::HTMLMediaElement::setDefaultPlaybackRate): Add logging.
2667         (WebCore::HTMLMediaElement::clearMediaPlayer): m_loadTimer -> m_pendingActionTimer.
2668         (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsSupported): Removed.
2669         (WebCore::HTMLMediaElement::dispatchEvent): If a 'webkitcurrentplaybacktargetiswirelesschanged'
2670         event is dispatched when the current target is wireless but the media engine does not support
2671         wireless playback, tell the media engine not to play to the target.
2672         * html/HTMLMediaElement.h:
2673         * html/HTMLMediaElement.idl:
2674
2675         * html/HTMLMediaSession.cpp:
2676         (WebCore::HTMLMediaSession::showPlaybackTargetPicker): Drive-by fix to disallow audio-only files.
2677         (WebCore::HTMLMediaSession::currentPlaybackTargetIsSupported): Deleted.
2678         * html/HTMLMediaSession.h:
2679
2680         * platform/graphics/MediaPlayer.cpp:
2681         (WebCore::MediaPlayer::isCurrentPlaybackTargetSupported): Deleted.
2682         * platform/graphics/MediaPlayer.h:
2683         * platform/graphics/MediaPlayerPrivate.h:
2684
2685         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2686         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget): Use a RetainPtr
2687         to explicitly manage the lifetime of the temporary object.
2688         (WebCore::MediaPlayerPrivateAVFoundationObjC::isPlayingToWirelessPlaybackTarget): Ditto.
2689         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2690
2691         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2692         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setShouldPlayToPlaybackTarget):
2693         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isCurrentPlaybackTargetWireless):
2694         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isCurrentPlaybackTargetSupported): Deleted.
2695
2696         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
2697         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2698         (WebCore::MediaPlayerPrivateQTKit::setShouldPlayToPlaybackTarget):
2699         (WebCore::MediaPlayerPrivateQTKit::isCurrentPlaybackTargetWireless):
2700         (WebCore::MediaPlayerPrivateQTKit::isCurrentPlaybackTargetSupported): Deleted.
2701
2702 2015-04-28  Alex Christensen  <achristensen@webkit.org>
2703
2704         [Content Extensions] Use less memory for CombinedURLFilters.
2705         https://bugs.webkit.org/show_bug.cgi?id=144290
2706
2707         Reviewed by Andreas Kling.
2708
2709         * contentextensions/CombinedURLFilters.cpp:
2710         (WebCore::ContentExtensions::recursiveMemoryUsed):
2711         (WebCore::ContentExtensions::CombinedURLFilters::addPattern):
2712         (WebCore::ContentExtensions::generateNFAForSubtree):
2713         (WebCore::ContentExtensions::CombinedURLFilters::createNFAs):
2714         * contentextensions/NFA.cpp:
2715         (WebCore::ContentExtensions::NFA::memoryUsed):
2716         (WebCore::ContentExtensions::NFA::setActions):
2717         * contentextensions/NFA.h:
2718         * contentextensions/NFANode.h:
2719         * contentextensions/Term.h:
2720         (WebCore::ContentExtensions::Term::Term::generateGraph):
2721         (WebCore::ContentExtensions::Term::generateSubgraphForAtom):
2722         Use Vectors instead of HashTables in PrefixTreeVertex because the sets stay small and need to be more memory efficient.
2723
2724 2015-04-28  Brady Eidson  <beidson@apple.com>
2725
2726         Consolidate most "frame load" arguments into FrameLoadRequest.
2727         https://bugs.webkit.org/show_bug.cgi?id=144276
2728
2729         Reviewed by Alexey Proskuryakov.
2730
2731         No new tests (No change in behavior).
2732         
2733         This patch starts the long overdue process of wrangling the insane load methods in FrameLoader.
2734         
2735         Humble beginnings of this long process:
2736         - Put most of the various "frame load" arguments that are passed around within FrameLoader on FrameLoadRequest.
2737         - Get rid of the "easy" constructors of FrameLoadRequest, forcing users to actually think about what they're doing.
2738         - Change a private FrameLoader load method (urlSelected) to take a FrameLoadRequest instead of argument gobbledygook.
2739         - Change a public FrameLoader load methods (changeLocation) to take a FrameLoadRequest instead of gobbledygook.
2740         
2741         These cover the straightforward changes where it was easy to figure out what the values of the FrameLoadRequest
2742         arguments were from these various call sites.
2743         
2744         Further refactoring can be done in much smaller patches, handling fewer cases at a time. Little by little we will be
2745         able to reduce the number of "load" methods on FrameLoader and make sure that they mainly only take a FrameLoadRequest
2746         as an argument.
2747
2748         * inspector/InspectorFrontendClientLocal.cpp:
2749         (WebCore::InspectorFrontendClientLocal::openInNewTab):
2750         
2751         * inspector/InspectorPageAgent.cpp:
2752         (WebCore::InspectorPageAgent::navigate):
2753         
2754         * loader/FrameLoadRequest.cpp:
2755         (WebCore::FrameLoadRequest::FrameLoadRequest):
2756         * loader/FrameLoadRequest.h:
2757         (WebCore::FrameLoadRequest::FrameLoadRequest):
2758         (WebCore::FrameLoadRequest::lockHistory):
2759         (WebCore::FrameLoadRequest::lockBackForwardList):
2760         (WebCore::FrameLoadRequest::shouldSendReferrer):
2761         (WebCore::FrameLoadRequest::allowNavigationToInvalidURL):
2762         (WebCore::FrameLoadRequest::newFrameOpenerPolicy):
2763         (WebCore::FrameLoadRequest::shouldReplaceDocumentIfJavaScriptURL):
2764         
2765         * loader/FrameLoader.cpp:
2766         (WebCore::FrameLoader::changeLocation):
2767         (WebCore::FrameLoader::urlSelected):
2768         (WebCore::FrameLoader::loadFrameRequest):
2769         * loader/FrameLoader.h:
2770         
2771         * loader/NavigationScheduler.cpp:
2772         (WebCore::NavigationScheduler::scheduleLocationChange):
2773         
2774         * page/ContextMenuController.cpp:
2775         (WebCore::openNewWindow):
2776         (WebCore::ContextMenuController::contextMenuItemSelected):
2777         
2778         * page/DOMWindow.cpp:
2779         (WebCore::DOMWindow::createWindow):
2780
2781 2015-04-27  Myles C. Maxfield  <mmaxfield@apple.com>
2782
2783         [Mac] [iOS] Implement font-synthesis CSS property
2784         https://bugs.webkit.org/show_bug.cgi?id=144305
2785
2786         Reviewed by Andreas Kling.
2787
2788         This patch is fairly straightforward, though there are some particular pieces to the patch listed below.
2789
2790         The implementation of this font-synthesis CSS property lives inside FontCacheIOS and FontCacheMac. We already
2791         determine if we should synthesize bold and italics, this CSS property simply guards that decision.
2792
2793         Because FontCache interacts with FontDescriptions and not RenderStyles, this patch moves the source of truth
2794         regarding font-synthesis into FontDescription (from RenderStyle).
2795
2796         Test: fast/css3-text/font-synthesis.html
2797
2798         * css/CSSPropertyNames.in: Mark font-synthesis as a FontProperty, which means that the relevant state is kept
2799         inside FontDescription. This also means that the property must be marked as a "high priority" property, which
2800         is enforced by it existing at the top of CSSPropertyNames.in. The move to FontDescription must be done so that
2801         FontCacheIOS and FontCacheMac have access to the saved state.
2802         * css/CSSComputedStyleDeclaration.cpp:
2803         (WebCore::fontSynthesisFromStyle): Update to look for state in FontDescription instead of RenderStyle.
2804         * css/CSSSegmentedFontFace.cpp:
2805         (WebCore::CSSSegmentedFontFace::fontRanges): Guard the synthetic bold and synthic italic decision on the new
2806         FontSynthesis state inside FontDescription.
2807         * css/StyleBuilderConverter.h:
2808         (WebCore::StyleBuilderConverter::convertFontSynthesis): Moved from
2809         StyleBuilderCustom::applyValueFontSynthesis(). This is because of the updated options inside of
2810         CSSPropertyNames.in
2811         * css/StyleBuilderCustom.h:
2812         (WebCore::StyleBuilderCustom::applyValueFontSynthesis): Deleted.
2813         * platform/graphics/FontDescription.h:
2814         (WebCore::FontDescription::FontDescription): Moved from RenderStyle.
2815         (WebCore::FontDescription::fontSynthesis): Ditto.
2816         (WebCore::FontDescription::setFontSynthesis): Ditto.
2817         (WebCore::FontDescription::initialFontSynthesis): Ditto.
2818         (WebCore::FontDescription::operator==): Update to include new state.
2819         * platform/graphics/FontCache.h:
2820         (WebCore::FontDescriptionFontDataCacheKey::makeFlagKey): Make FontDescription hashes sensitive to the new
2821         state inside FontDescription.
2822         * platform/graphics/ios/FontCacheIOS.mm:
2823         (WebCore::FontCache::createFontPlatformData): Guard the synthetic bold and synthetic italic decision on the
2824         new FontSynthesis state inside FontDescription.
2825         * platform/graphics/mac/FontCacheMac.mm:
2826         (WebCore::FontCache::createFontPlatformData): Ditto.
2827         * platform/text/TextFlags.h: Move FontSynthesis type from RenderStyleConstants.
2828         * rendering/style/RenderStyle.h:
2829         (WebCore::RenderStyle::fontSynthesis): Moved to FontDescription.
2830         (WebCore::RenderStyle::setFontSynthesis): Ditto.
2831         (WebCore::RenderStyle::initialFontSynthesis): Ditto.
2832         * rendering/style/RenderStyleConstants.h: Moved FontSynthesis type to TextFlags.
2833         * rendering/style/StyleRareInheritedData.h: Remove state regarding font synthesis (moved to FontDescription)
2834
2835 2015-04-28  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2836
2837         SharedBuffer::copy is not computing the buffer size correctly when having m_dataArray
2838         https://bugs.webkit.org/show_bug.cgi?id=144321
2839
2840         Reviewed by Darin Adler.
2841
2842         Patch correctness covered by existing tests.
2843
2844         * platform/SharedBuffer.cpp:
2845         (WebCore::SharedBuffer::copy): Direct appending to m_dataArray and not using append method as this method updates the SharedBuffer size.
2846
2847 2015-04-28  Per Arne Vollan  <peavo@outlook.com>
2848
2849         [Curl] Memory leak.
2850         https://bugs.webkit.org/show_bug.cgi?id=144327
2851
2852         Reviewed by Brent Fulgham.
2853
2854         When a data url is loaded, the ResourceHandle is not released.
2855
2856         * platform/network/curl/ResourceHandleManager.cpp:
2857         (WebCore::ResourceHandleManager::startJob):
2858
2859 2015-04-28  Andy Estes  <aestes@apple.com>
2860
2861         Fix the Mavericks Debug build after r183467.
2862
2863         * platform/network/ResourceRequestBase.h:
2864         (WebCore::ResourceRequestBase::requester): Removed WEBCORE_EXPORT.
2865         (WebCore::ResourceRequestBase::setRequester): Ditto.
2866
2867 2015-04-28  Csaba Osztrogonác  <ossy@webkit.org>
2868
2869         Remove make-file-arrays.py
2870         https://bugs.webkit.org/show_bug.cgi?id=144324
2871
2872         Reviewed by Gyuyoung Kim.
2873
2874         * make-file-arrays.py: Removed.
2875
2876 2015-04-28  Antti Koivisto  <antti@apple.com>
2877
2878         Build fix.
2879
2880         * platform/network/ios/ResourceRequestIOS.mm:
2881         (WebCore::ResourceRequest::ResourceRequest):
2882
2883 2015-04-28  Antti Koivisto  <antti@apple.com>
2884
2885         Network Cache: Disk cache getting filled by YouTube video data
2886         https://bugs.webkit.org/show_bug.cgi?id=144259
2887
2888         Reviewed by Darin Adler.
2889
2890         MSE media is loaded via XHR and tends to eventually fill the cache.
2891
2892         YouTube serves the media chunks cacheable, however they are rarely (if ever) reused.
2893         We can reduce disk writes and keep more useful resources around by not caching them
2894
2895         Test: http/tests/cache/disk-cache/disk-cache-media.html
2896
2897         * loader/DocumentLoader.cpp:
2898         (WebCore::DocumentLoader::startLoadingMainResource):
2899
2900             Set the requester.
2901
2902         * loader/cache/CachedRawResource.cpp:
2903         (WebCore::CachedRawResource::CachedRawResource):
2904         * page/DiagnosticLoggingKeys.cpp:
2905         (WebCore::DiagnosticLoggingKeys::streamingMedia):
2906         * page/DiagnosticLoggingKeys.h:
2907         * platform/network/ResourceRequestBase.cpp:
2908         (WebCore::ResourceRequestBase::adopt):
2909         (WebCore::ResourceRequestBase::copyData):
2910         (WebCore::equalIgnoringHeaderFields):
2911         * platform/network/ResourceRequestBase.h:
2912         (WebCore::ResourceRequestBase::requester):
2913         (WebCore::ResourceRequestBase::setRequester):
2914
2915             Add requester type to the request object. Currently this is main resource, xhr or unspecified.
2916
2917         (WebCore::ResourceRequestBase::encodeWithoutPlatformData):
2918         (WebCore::ResourceRequestBase::decodeWithoutPlatformData):
2919         * platform/network/cf/ResourceRequest.h:
2920         (WebCore::ResourceRequest::deprecatedSetMainResourceRequest): Deleted.
2921         (WebCore::ResourceRequest::deprecatedIsMainResourceRequest): Deleted.
2922
2923             Replace this iOS only field with shared mechanism.
2924
2925         * platform/network/ios/QuickLook.mm:
2926         (WebCore::QuickLookHandle::create):
2927         * xml/XMLHttpRequest.cpp:
2928         (WebCore::XMLHttpRequest::createRequest):
2929
2930             Set the requester.
2931
2932 2015-04-28  Namhoon Kim  <nakim@ea.com>
2933
2934         Fix windows build error in WebCore related to bulk build.
2935         https://bugs.webkit.org/show_bug.cgi?id=144313
2936
2937         Reviewed by Csaba Osztrogonác.
2938
2939         No new tests because there is no behavior change.
2940
2941         * css/CSSAllInOne.cpp:
2942         * dom/DOMAllInOne.cpp:
2943
2944 2015-04-27  Simon Fraser  <simon.fraser@apple.com>
2945
2946         Eliminate styleDidChange with StyleDifferenceEqual when updates are actually necessary
2947         https://bugs.webkit.org/show_bug.cgi?id=144198
2948
2949         Followup: fix assertions seen in fullscreen and pseudo-element tests. These code
2950         paths set the style to the existing pointer, but with a SyntheticStyleChange.
2951         We have to avoid an early return in this case.
2952
2953         * rendering/RenderElement.cpp:
2954         (WebCore::RenderElement::setStyle):
2955
2956 2015-04-25  Simon Fraser  <simon.fraser@apple.com>
2957
2958         Eliminate styleDidChange with StyleDifferenceEqual when updates are actually necessary
2959         https://bugs.webkit.org/show_bug.cgi?id=144198
2960
2961         Reviewed by Darin Adler, Antti Koivisto.
2962         
2963         SyntheticStyleChange style recalcs are triggered for cases where behavior depends
2964         on state which is outside of RenderStyle; this includes triggering compositing for
2965         animations, for video and canvas, and for iframes with composited content.
2966         
2967         In these cases, we'd run through RenderElement::setStyle() and its fan-out, but
2968         with diff == StyleDifferenceEqual, and so be unable to determine if there
2969         is actual work to be done.
2970         
2971         This patch enforces the contract that the diff is never StyleDifferenceEqual if
2972         compositing or other work has to happen from setStyle(). This is achieved by
2973         passing in a 'hasSideEffects' flag, which causes the diff to become at least
2974         StyleDifferenceRecompositeLayer.
2975         
2976         RenderLayerCompositor::layerStyleChanged() can now safely early return
2977         if the diff is equal. Future patches will reduce redundant work even more.
2978
2979         Test: compositing/animation/no-style-recalc-during-accelerated-animation.html
2980
2981         * page/animation/AnimationBase.h:
2982         (WebCore::AnimationBase::animate): Returns a bool now if the state changed.
2983         (WebCore::AnimationBase::state):
2984         * page/animation/AnimationController.cpp:
2985         (WebCore::AnimationController::updateAnimations): bool out param which indicates
2986         whether any animations changed state.
2987         * page/animation/AnimationController.h:
2988         * page/animation/CompositeAnimation.cpp:
2989         (WebCore::CompositeAnimation::animate): If any transitions or animations changed
2990         state, set the animationStateChanged out param to true.
2991         * page/animation/CompositeAnimation.h:
2992         * page/animation/ImplicitAnimation.cpp:
2993         (WebCore::ImplicitAnimation::animate): Return true if the state changed.
2994         * page/animation/ImplicitAnimation.h:
2995         * page/animation/KeyframeAnimation.cpp:
2996         (WebCore::KeyframeAnimation::animate): Return true if the state changed.
2997         * page/animation/KeyframeAnimation.h:
2998         * rendering/RenderElement.cpp:
2999         (WebCore::RenderElement::adjustStyleDifference): We may enter here now with diff
3000         != StyleDifferenceEqual, but still need to do the check to see if layers changed.
3001         (WebCore::RenderElement::initializeStyle): When setting style for the first time,
3002         don't use StyleDifferenceEqual.
3003         (WebCore::RenderElement::setStyle): Additional flag to indicate whether this style
3004         change involves side effects. If the diff is equal but the flag is set, change
3005         the diff to StyleDifferenceRecompositeLayer (the "lowest" non-zero diff).
3006         * rendering/RenderElement.h:
3007         (WebCore::RenderElement::setAnimatableStyle): Pass true to setStyle() if hasSideEffects
3008         is true, or if animation state changed.
3009         * rendering/RenderLayer.cpp:
3010         (WebCore::RenderLayer::styleChanged): Pass the diff down.
3011         * rendering/RenderLayerCompositor.cpp:
3012         (WebCore::RenderLayerCompositor::layerStyleChanged): Return if the diff is equal.
3013         * rendering/RenderLayerCompositor.h:
3014         * rendering/style/RenderStyleConstants.h: StyleDifferenceNewStyle is used when
3015         setting style for the first time.
3016         * style/StyleResolveTree.cpp:
3017         (WebCore::Style::createRendererIfNeeded): Provide animationsChanged bool (which is unused).
3018         (WebCore::Style::resolveLocal): If the style change is synthetic, set the flag that
3019         says there are side-effects.
3020
3021 2015-04-27  Michael Catanzaro  <mcatanzaro@igalia.com>
3022
3023         [GTK] Add one single option to control all OpenGL-related options
3024         https://bugs.webkit.org/show_bug.cgi?id=144105
3025
3026         Reviewed by Martin Robinson.
3027
3028         Test WTF_USE_TEXTURE_MAPPER since USE_TEXTURE_MAPPER has been removed.
3029
3030         * PlatformGTK.cmake:
3031
3032 2015-04-27  Myles C. Maxfield  <mmaxfield@apple.com>
3033
3034         Consolidate one-line flag-related header files into TextFlags.h
3035         https://bugs.webkit.org/show_bug.cgi?id=144295
3036
3037         Reviewed by Tim Horton.
3038
3039         There were a collection of single-line header files throughout platform/ which contain
3040         single-line type declaractions of flags related to text layout & rendering. This patch
3041         consolidates all these single-line headers into TextFlags.h
3042
3043         No new tests because there is no behavior change.
3044
3045         * WebCore.vcxproj/WebCore.vcxproj:
3046         * WebCore.vcxproj/WebCore.vcxproj.filters:
3047         * WebCore.xcodeproj/project.pbxproj:
3048         * css/CSSFontFace.h:
3049         * css/CSSPrimitiveValueMappings.h:
3050         * loader/cache/CachedFont.h:
3051         * loader/cache/CachedTextTrack.h:
3052         * page/Settings.h:
3053         * platform/DragImage.h:
3054         * platform/graphics/FontDescription.h:
3055         * platform/graphics/FontOrientation.h: Removed.
3056         * platform/graphics/FontPlatformData.h:
3057         * platform/graphics/FontRenderingMode.h: Removed.
3058         * platform/graphics/FontSmoothingMode.h: Removed.
3059         * platform/graphics/FontTraitsMask.h: Removed.
3060         * platform/graphics/FontWidthVariant.h: Removed.
3061         * platform/graphics/TextRenderingMode.h: Removed.
3062         * platform/graphics/cairo/FontCustomPlatformData.h:
3063         * platform/graphics/freetype/FontPlatformData.h:
3064         * platform/graphics/mac/FontCustomPlatformData.h:
3065         * platform/graphics/win/FontCustomPlatformData.h:
3066         * platform/text/NonCJKGlyphOrientation.h: Removed.
3067         * platform/text/TextFlags.h:
3068         * rendering/TextPainter.h:
3069         * style/StyleFontSizeFunctions.h:
3070
3071 2015-04-27  Daniel Bates  <dabates@apple.com>
3072
3073         Form control may be associated with the wrong HTML Form element after form id change
3074         https://bugs.webkit.org/show_bug.cgi?id=133456
3075         <rdar://problem/17095055>
3076
3077         Reviewed by Andy Estes.
3078
3079         Fixes an issue where a form control may be associated with the wrong HTML Form element
3080         after the id of the HTML Form element associated with the form control is changed when
3081         there is more than one HTML Form element with the same id in the document. Specifically,
3082         a form control that has an HTML form attribute value X will always be associated with
3083         some HTML Form element f where f.id = X regardless of whether f.id is subsequently
3084         changed.
3085
3086         Tests: fast/forms/change-form-id-to-be-unique-then-submit-form.html
3087                fast/forms/change-form-id-to-be-unique.html
3088
3089         * dom/Element.cpp:
3090         (WebCore::Element::attributeChanged): Notify observers when the id of an element changed.
3091         (WebCore::Element::updateId): Added parameter NotifyObservers (defaults to NotifyObservers::Yes),
3092         as to whether we should notify observers of the id change.
3093         (WebCore::Element::updateIdForTreeScope): Ditto.
3094         (WebCore::Element::willModifyAttribute): Do not notify observers of the id change immediately. As
3095         indicated by the name of this method, we plan to modify the DOM attribute id of the element, but
3096         we have not actually modified it when this method is called. Instead we will notify observers
3097         in Element::attributeChanged(), which is called after the DOM attribute id is modified.
3098         (WebCore::Element::cloneAttributesFromElement): Ditto.
3099         * dom/Element.h: Defined enum class NotifyObservers.
3100         * dom/TreeScope.cpp:
3101         (WebCore::TreeScope::addElementById): Added boolean parameter notifyObservers (defaults to true)
3102         as to whether we should dispatch a notification to all observers.
3103         (WebCore::TreeScope::removeElementById): Ditto.
3104         * dom/TreeScope.h:
3105
3106 2015-04-27  Alex Christensen  <achristensen@webkit.org>
3107
3108         Reduce allocations and memory usage when compiling content extensions.
3109         https://bugs.webkit.org/show_bug.cgi?id=144277
3110
3111         Reviewed by Benjamin Poulain.
3112
3113         Covered by existing tests.
3114
3115         * contentextensions/Term.h:
3116         (WebCore::ContentExtensions::Term::CharacterSet::set):
3117         (WebCore::ContentExtensions::Term::CharacterSet::get):
3118         (WebCore::ContentExtensions::Term::CharacterSet::invert):
3119         (WebCore::ContentExtensions::Term::CharacterSet::inverted):
3120         (WebCore::ContentExtensions::Term::CharacterSet::bitCount):
3121         (WebCore::ContentExtensions::Term::CharacterSet::operator==):
3122         (WebCore::ContentExtensions::Term::CharacterSet::hash):
3123         (WebCore::ContentExtensions::Term::Term):
3124         (WebCore::ContentExtensions::Term::addCharacter):
3125         (WebCore::ContentExtensions::Term::isEndOfLineAssertion):
3126         (WebCore::ContentExtensions::Term::isUniversalTransition):
3127         (WebCore::ContentExtensions::Term::generateSubgraphForAtom):
3128         Use two uint64_t's instead of a BitVector with a capacity of 128 bits.
3129
3130 2015-04-27  Michael Catanzaro  <mcatanzaro@igalia.com>
3131
3132         Rename WTF_USE_3D_GRAPHICS to ENABLE_GRAPHICS_CONTEXT_3D
3133         https://bugs.webkit.org/show_bug.cgi?id=144193
3134
3135         Reviewed by Darin Adler.
3136
3137         * CMakeLists.txt:
3138         * platform/graphics/ANGLEWebKitBridge.cpp:
3139         * platform/graphics/FormatConverter.cpp:
3140         * platform/graphics/FormatConverter.h:
3141         * platform/graphics/GLContext.h:
3142         * platform/graphics/GraphicsContext3D.cpp:
3143         * platform/graphics/GraphicsContext3DPrivate.cpp:
3144         * platform/graphics/OpenGLShims.cpp:
3145         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
3146         * platform/graphics/cg/GraphicsContext3DCG.cpp:
3147         * platform/graphics/egl/GLContextEGL.cpp:
3148         * platform/graphics/egl/GLContextEGL.h:
3149         * platform/graphics/glx/GLContextGLX.cpp:
3150         * platform/graphics/glx/GLContextGLX.h:
3151         * platform/graphics/mac/GraphicsContext3DMac.mm:
3152         * platform/graphics/opengl/Extensions3DOpenGL.cpp:
3153         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
3154         * platform/graphics/opengl/Extensions3DOpenGLES.cpp:
3155         * platform/graphics/opengl/GLPlatformContext.cpp:
3156         * platform/graphics/opengl/GLPlatformSurface.cpp:
3157         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
3158         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
3159         * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
3160         * platform/graphics/opengl/TemporaryOpenGLSetting.cpp:
3161         * platform/graphics/win/GraphicsContext3DWin.cpp:
3162
3163 2015-04-27  Jer Noble  <jer.noble@apple.com>
3164
3165         [iOS] Video not centered in element on retina devices
3166         https://bugs.webkit.org/show_bug.cgi?id=144274
3167
3168         Reviewed by Simon Fraser.
3169
3170         In r173702, a transform was added to the video layer (and a matching, inverse transform
3171         in the UIProcess), but this transform affects the position property of the video layer
3172         used to position the video content within the element bounds when their aspect ratios
3173         do not match.
3174
3175         To work around this problem, pre-apply the transform during -setPosition:.
3176
3177         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3178         (-[WebVideoContainerLayer setPosition:]):
3179
3180 2015-04-27  Jer Noble  <jer.noble@apple.com>
3181
3182         Add a setting & restriction which prevents non-interactivte playback of audible media elements.
3183         https://bugs.webkit.org/show_bug.cgi?id=143486
3184
3185         Reviewed by Eric Carlson.
3186
3187         Tests: media/audio-playback-restriction-autoplay.html
3188                media/audio-playback-restriction-play.html
3189
3190         To allow clients who want to allow non-user-interactive video-only playback, but still
3191         restrict playback of audible media elements, add a new setting and matching restriction
3192         which disallows playback of media elements containing audible characteristics.
3193
3194         * html/HTMLMediaElement.cpp:
3195         (WebCore::HTMLMediaElement::HTMLMediaElement): Set the RequireUserGestureForAudioRateChange
3196             restriction if the audioPlaybackRequiresUserGesture() setting is set.
3197         (WebCore::HTMLMediaElement::parseAttribute): Drive-by fix. Move the opening brace
3198             out of the #if, as this confuses the heck out of diff and makes all subsequent
3199             changes appear to be within HTMLMediaElement::parseAttribute.
3200         (WebCore::HTMLMediaElement::autoplay): Remove the restriction check from within autoplay().
3201             It is checked again immediately after every autoplay() call site.
3202         (WebCore::HTMLMediaElement::pauseInternal): Remove the iOS-only #if.
3203         (WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack): Check whether playback
3204             is permitted, and if not, pause.
3205         (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged): Ditto.
3206         (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture): Ditto.
3207         * html/HTMLMediaSession.cpp:
3208         (WebCore::restrictionName): Since BehaviorRestrictions is a bitfield, check each bit
3209             individually.
3210         (WebCore::HTMLMediaSession::removeBehaviorRestriction): Handle RequireUserGestureForAudioRateChange.
3211         (WebCore::HTMLMediaSession::playbackPermitted): Check whether the element has audio and 
3212             audio playback is restricted, and return false if so.
3213         * html/HTMLMediaSession.h:
3214         * page/Settings.cpp:
3215         * page/Settings.in:
3216         * testing/Internals.cpp:
3217         (WebCore::Internals::setMediaSessionRestrictions): Added. 
3218         (WebCore::Internals::setMediaElementRestrictions): Added.
3219         * testing/Internals.h:
3220         * testing/Internals.idl:
3221
3222 2015-04-27  Jer Noble  <jer.noble@apple.com>
3223
3224         [WebAudio] AudioContext does not remove user-gesture restriction during resume()
3225         https://bugs.webkit.org/show_bug.cgi?id=144211
3226
3227         Reviewed by Eric Carlson.
3228
3229         Tests: webaudio/audiocontext-restriction-audiobuffersourcenode-start.html
3230                webaudio/audiocontext-restriction.html
3231
3232         Before the introduction of resume(), suspend(), and stop(), AudioContexts which required
3233         a user-gesture would start normally, but would effectively mute their outputs. Now that
3234         the AudioContext's state property is exposed to JavaScript, the AudioContext should stay
3235         in the "suspended" state until the user-gesture restriction is lifted.
3236
3237         Add a new method, willBeginPlayback() which checks and potentially clears the context's
3238         behavior restrictions before checking with the MediaSession. Call this new willBeginPlayback()
3239         method when the state would transition to "running".
3240
3241         Because they may be called before any nodes are created, make sure to call lazyInitialize()
3242         from within the JS-exposed resumePlayback(), suspendPlayback(), and stopPlayback() methods.
3243
3244         Instead of clearing the behavior restrictions directly, scheduled AudioNodes should instead
3245         call a new method nodeWillBeginPlayback(). Because existing sites will call AudioNode.start()
3246         inside a user-gesture handler to clear the user-gesture restriction, call startRendering()
3247         from nodeWillBeginPlayback(). But because we don't want AudioNode.start() to resume playback
3248         unconditionally, only do so when the user-gesture restriction is set.
3249
3250         Now that an AudioContext will not transition to "running" state without a user-gesture (if
3251         that restriction is set), there's no reason to check for that restriction from inside
3252         AudioDestinationNode.
3253
3254         Add some internal methods to set and clear AudioContext BehaviorRestrictions for testing purposes.
3255
3256         * Modules/webaudio/AudioBufferSourceNode.cpp:
3257         (WebCore::AudioBufferSourceNode::startPlaying):
3258         * Modules/webaudio/AudioContext.cpp:
3259         (WebCore::AudioContext::nodeWillBeginPlayback):
3260         (WebCore::AudioContext::willBeginPlayback):
3261         (WebCore::AudioContext::willPausePlayback):
3262         (WebCore::AudioContext::startRendering):
3263         (WebCore::AudioContext::suspendContext):
3264         (WebCore::AudioContext::resumeContext):
3265         (WebCore::AudioContext::closeContext):
3266         (WebCore::AudioContext::suspendPlayback):
3267         (WebCore::AudioContext::mayResumePlayback):
3268         * Modules/webaudio/AudioContext.h:
3269         (WebCore::AudioContext::behaviorRestrictions):
3270         (WebCore::AudioContext::userGestureRequiredForAudioStart):
3271         (WebCore::AudioContext::pageConsentRequiredForAudioStart):
3272         * Modules/webaudio/AudioDestinationNode.cpp:
3273         (WebCore::AudioDestinationNode::render):
3274         * Modules/webaudio/AudioScheduledSourceNode.cpp:
3275         (WebCore::AudioScheduledSourceNode::start):
3276         * testing/Internals.cpp:
3277         (WebCore::Internals::setAudioContextRestrictions):
3278         * testing/Internals.h:
3279         * testing/Internals.idl:
3280
3281 2015-04-27  Alexey Proskuryakov  <ap@apple.com>
3282
3283         Build fix.
3284
3285         * accessibility/mac/AXObjectCacheMac.mm: (WebCore::AXObjectCache::postTextReplacementPlatformNotification):
3286         Use -setObject:forKey:, not array subscript.
3287
3288 2015-04-27  Eric Carlson  <eric.carlson@apple.com>
3289
3290         WirelessTargetPicker should not be visible unless a file is playable
3291         https://bugs.webkit.org/show_bug.cgi?id=144271
3292         <rdar://problem/20712003>
3293
3294         Reviewed by Jer Noble.
3295
3296         * Modules/mediacontrols/mediaControlsApple.js:
3297         (Controller.prototype.isPlayable): New.
3298         (Controller.prototype.setStatusHidden): Call updateWirelessTargetAvailable.
3299         (Controller.prototype.updateWirelessTargetAvailable): Don't show the button until the
3300             status message has been hidden.
3301
3302 2015-04-22  Martin Robinson  <mrobinson@igalia.com>
3303
3304         [CMake] Autogenerate cmakeconfig.h.cmake
3305         https://bugs.webkit.org/show_bug.cgi?id=143997
3306
3307         Reviewed by Csaba Osztrogonác.
3308
3309         * PlatformGTK.cmake: Use the WTF_USE style variables, because those are the same
3310         as the ones exposed to the build.
3311
3312 2015-04-27  Zalan Bujtas  <zalan@apple.com>
3313
3314         Simple line layout: Wrong text offsetting when range does not start from the first renderer.
3315         https://bugs.webkit.org/show_bug.cgi?id=144167
3316         rdar://problem/20639857
3317
3318         Reviewed by Simon Fraser.
3319
3320         This patch ensures that TextIterator returns the right text when the input range starts
3321         from a sibling node.
3322
3323         TextIterator::m_previousTextLengthInFlow keeps track of the current node offset from the parent.
3324         It is required to map simple line layout runs to RenderText positions.
3325         This patch sets the offset value when the iteration start with a sibling node.
3326
3327         Test: fast/text/range-text-with-simple-line-layout.html
3328
3329         * editing/TextIterator.cpp:
3330         (WebCore::TextIterator::TextIterator):
3331         (WebCore::TextIterator::handleTextNode):
3332
3333 2015-04-27  Commit Queue  <commit-queue@webkit.org>
3334
3335         Unreviewed, rolling out r183393.
3336         https://bugs.webkit.org/show_bug.cgi?id=144272
3337
3338         Caused memory corruption detected by GuardMalloc (Requested by
3339         ap on #webkit).
3340
3341         Reverted changeset:
3342
3343         "Synchronous XMLHttpRequest should get access to AppCache
3344         resources stored as flat files"
3345         https://bugs.webkit.org/show_bug.cgi?id=143711
3346         http://trac.webkit.org/changeset/183393
3347
3348 2015-04-27  Per Arne Vollan  <peavo@outlook.com>
3349
3350         [Curl] Favicons loaded from disc cache are ignored.
3351         https://bugs.webkit.org/show_bug.cgi?id=143953
3352
3353         Reviewed by Alex Christensen.
3354
3355         When a favicon is loaded from the Curl disc cache, the icon data is thrown away.
3356         This happens because we give a 304 response, which makes the icon loader ignore
3357         the response. We can solve this by responding with 200 OK.
3358
3359         * platform/network/ResourceHandleInternal.h:
3360         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
3361         * platform/network/curl/CurlCacheManager.cpp:
3362         (WebCore::CurlCacheManager::didReceiveResponse):
3363         * platform/network/curl/ResourceHandleManager.cpp:
3364         (WebCore::headerCallback):
3365         (WebCore::ResourceHandleManager::initializeHandle):
3366
3367 2015-04-27  Brady Eidson  <beidson@apple.com>
3368
3369         Make 'enum NavigationType' be an enum class
3370         https://bugs.webkit.org/show_bug.cgi?id=144270
3371
3372         Reviewed by Alex Christensen.
3373
3374         No new tests (No change in behavior).
3375
3376         I’ll be adding a new NavigationType for bug 144269 so it makes sense to make this
3377         an enum class first.
3378
3379         * loader/FrameLoader.cpp:
3380         (WebCore::FrameLoader::load):
3381         (WebCore::FrameLoader::reload):
3382         (WebCore::FrameLoader::loadDifferentDocumentItem):
3383         * loader/FrameLoaderTypes.h:
3384
3385         * loader/NavigationAction.cpp:
3386         (WebCore::navigationType):
3387         (WebCore::NavigationAction::NavigationAction):
3388
3389         * loader/PolicyChecker.cpp:
3390         (WebCore::PolicyChecker::checkNavigationPolicy):
3391
3392         * page/PerformanceNavigation.cpp:
3393         (WebCore::PerformanceNavigation::type):
3394
3395 2015-04-27  Yoav Weiss  <yoav@yoav.ws>
3396
3397         Fix viewport units in Media Queries
3398         https://bugs.webkit.org/show_bug.cgi?id=144260
3399
3400         Reviewed by Darin Adler.
3401
3402         This patch makes sure that viewport units are considered "length units"
3403         in the context of Media Queries, by having MediaQueryExp use the unit logic
3404         that is in CSSPrimitiveValue.
3405         It does that by turning the relevant methods in CSSPrimitiveValue into static.
3406
3407         It also makes sure that the logic for "resolution units" is not maintained separately