1525aef2ac94f2208ec34da7ba8333481aac4854
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-05-06  Jon Lee  <jonlee@apple.com>
2
3         Expose more font weights for -apple-system
4         https://bugs.webkit.org/show_bug.cgi?id=144707
5
6         Reviewed by Dean Jackson.
7
8         Update to platform/mac/fast/text/systemFont.html
9
10         * platform/graphics/mac/FontCacheMac.mm:
11         (WebCore::toNSFontWeight): New static method to map font weights to NSFontWeight constants available on
12         Yosemite and later.
13         (WebCore::fontWithFamily): Request the system font with a mapped weight on Yosemite and later.
14         * platform/spi/mac/NSFontSPI.h: Add [NSFont systemFontWithSize:weight:], and the proper NSFontWeight
15         constants.
16
17 2015-05-06  Dean Jackson  <dino@apple.com>
18
19         Handle backdrop views that have to tile
20         https://bugs.webkit.org/show_bug.cgi?id=142317
21         <rdar://problem/20049088>
22
23         Reviewed by Simon Fraser.
24
25         Make sure backdrop layers don't tile. If they are big
26         enough, we'll leave it to the platform compositor to handle.
27
28         This also fixes a bug where if a layer changed from a backdrop
29         type to a tiled type, it would still retain its custom appearance
30         and we'd try to add children to the wrong layer.
31
32         Test: compositing/media-controls-bar-appearance-big.html
33
34         * platform/graphics/ca/GraphicsLayerCA.cpp:
35         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): Check if
36         a layer needs a backdrop before checking if it needs to tile.
37
38 2015-05-06  Carlos Garcia Campos  <cgarcia@igalia.com> and Per Arne Vollan  <peavo@outlook.com>
39
40         [WinCairo] Compile error due to undefined symbols after r183868
41         https://bugs.webkit.org/show_bug.cgi?id=144692
42
43         Reviewed by Alex Christensen.
44
45         Speculative build fix. Add dummy PlatformDisplayWin.
46
47         * PlatformWinCairo.cmake: Add PlatformDisplay.cpp to compilation.
48         * platform/graphics/PlatformDisplay.cpp:
49         (WebCore::PlatformDisplay::createPlatformDisplay):
50         * platform/graphics/PlatformDisplay.h:
51         * platform/graphics/win/PlatformDisplayWin.h:
52         Add stubs to compile.
53         * WebCore.vcxproj/WebCore.vcxproj
54         * WebCore.vcxproj/WebCore.vcxproj.filters
55         Add new files to Windows build.
56
57 2015-05-06  David Hyatt  <hyatt@apple.com>
58
59         Avoid copies in scrollOffsetForFixedPosition() and inline it.
60         https://bugs.webkit.org/show_bug.cgi?id=144709
61
62         Reviewed by Simon Fraser.
63
64         * page/FrameView.cpp:
65         (WebCore::FrameView::frameScaleFactor):
66         Added so that scrollOffsetForFixedPosition() can be inlined without having to
67         reference Frame's implementation.
68
69         (WebCore::FrameView::scrollOffsetForFixedPosition): Deleted.
70         Moved this to the header.
71
72         * page/FrameView.h:
73         Inline scrollOffsetForFixedPosition() and get rid of all the copying
74         it was doing.
75
76 2015-05-06  David Hyatt  <hyatt@apple.com>
77
78         RenderLayer::currentTransform computes a pixel snapped rect it doesn't use.
79         https://bugs.webkit.org/show_bug.cgi?id=144708
80
81         Reviewed by Simon Fraser.
82
83         * rendering/RenderLayer.cpp:
84         (WebCore::RenderLayer::currentTransform):
85
86         Only compute a pixel snapped rect if we actually end up needing it. The common case
87         is that this rect is not needed, so pushing it inside the two if statements
88         speeds up the common case.
89
90 2015-05-06  Timothy Horton  <timothy_horton@apple.com>
91
92         Fix the build.
93
94         * platform/spi/cocoa/QuartzCoreSPI.h:
95
96 2015-05-06  David Hyatt  <hyatt@apple.com>
97
98         Optimize topLeftLocationOffset() addition in updateLayerPosition
99         https://bugs.webkit.org/show_bug.cgi?id=144704
100
101         Reviewed by Dean Jackson.
102
103         * page/FrameView.cpp:
104         (WebCore::FrameView::FrameView):
105         * page/FrameView.h:
106         Move the hasFlippedBlocks bit to FrameView instead of RenderView. Works better for inlining
107         the check in any renderer header, and it also makes more sense conceptually, since the RenderView
108         itself could be a flipped block.
109
110         * rendering/RenderBox.cpp:
111         (WebCore::RenderBox::layoutOverflowRectForPropagation):
112         Change over to the FrameView bit.
113
114         * rendering/RenderBox.h:
115         (WebCore::RenderBox::applyTopLeftLocationOffset):
116         Add a new inlined function that can apply the top left location offset to a point without
117         multiple LayoutSize creations and copies. It invokes a helper for flipping that is not
118         inlined only in the case where actual flipped blocks exist in the render tree.
119
120         * rendering/RenderBoxModelObject.cpp:
121         (WebCore::RenderBoxModelObject::updateFromStyle):
122         Set the bit on the FrameView now instead of the RenderView.
123
124         * rendering/RenderLayer.cpp:
125         (WebCore::RenderLayer::updateLayerPosition):
126         Call the new applyTopLeftLocationOffset function so that the point can have offsets added
127         in without any extra copies.
128
129         (WebCore::RenderLayer::calculateClipRects):
130         * rendering/RenderLineBoxList.cpp:
131         (WebCore::RenderLineBoxList::rangeIntersectsRect):
132         Switch over to the bit on the FrameView.
133
134         * rendering/RenderView.cpp:
135         (WebCore::RenderView::RenderView):
136         * rendering/RenderView.h:
137         Get rid of the bit on the RenderView.
138
139 2015-05-05  Myles C. Maxfield  <mmaxfield@apple.com>
140
141         Introducing the Platform Abstraction Layer (PAL)
142         https://bugs.webkit.org/show_bug.cgi?id=143358
143
144         Reviewed by Simon Fraser.
145
146         * WebCore.xcodeproj/project.pbxproj: Let the project know about the .a
147         * Configurations/FeatureDefines.xcconfig: Updated
148
149 2015-05-06  Eric Carlson  <eric.carlson@apple.com>
150
151         [iOS] remove some unnecessary iOS-only media code
152         https://bugs.webkit.org/show_bug.cgi?id=144697
153         <rdar://problem/20229914>
154
155         Reviewed by Jer Noble.
156
157         * html/HTMLAttributeNames.in: Remove data-youtube-id.
158
159         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
160         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem): Remove dataYouTubeID.
161
162 2015-05-06  David Hyatt  <hyatt@apple.com>
163
164         Optimize relativePositionOffset() to avoid doing unnecessary work
165         https://bugs.webkit.org/show_bug.cgi?id=144698
166
167         Reviewed by Simon Fraser.
168
169         * rendering/RenderBoxModelObject.cpp:
170         (WebCore::RenderBoxModelObject::relativePositionOffset):
171
172         Patch relativePositionOffset to avoid doing unnecessary work in the common case where
173         all values of top/left/right/bottom are either auto or fixed. We no longer fetch
174         containingBlock() into a local always, but instead just invoke the function only
175         when necessary.
176
177         Also avoid computing the percentage-relative maximum for the top/right/bottom/left lengths
178         when they are fixed values, since that maximum won't be examined at all.
179
180 2015-05-06  Martin Robinson  <mrobinson@igalia.com>
181
182         [FreeType] Vertical CJK glyphs should not be rendered with synthetic oblique
183         https://bugs.webkit.org/show_bug.cgi?id=144612
184
185         Reviewed by Darin Adler.
186
187         No new tests. This causes fast/text/international/synthesized-italic-vertical.html to pass.
188
189         * platform/graphics/Font.cpp:
190         (WebCore::Font::nonSyntheticItalicFont): Compile this method for Cairo as well.
191         * platform/graphics/FontCascadeFonts.cpp:
192         (WebCore::FontCascadeFonts::glyphDataForSystemFallback): When searching for the system fallback,
193         ensure that we do not use synthetic oblique when rendering vertical CJK glyphs.
194         (WebCore::FontCascadeFonts::glyphDataForNormalVariant): Extend the CJK fix to Cairo ports.
195         * platform/graphics/FontPlatformData.h:
196         (WebCore::FontPlatformData::setSyntheticOblique): Added this helper method, because
197         Freetype/Cairo ports needs to be able to recreate the scaled font matrix when the
198         synthetic oblique settings changes.
199         * platform/graphics/freetype/FontPlatformData.h: Rename initializeWithFontFace to buildScaledFont.
200         Remove the now unused m_horizontalOrientationMatrix member.
201         (WebCore::FontPlatformData::setSyntheticOblique): Added the helper here as well.
202         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
203         (WebCore::FontPlatformData::FontPlatformData): Calculate whether or not to use synthetic oblique here,
204         before buildScaledFont is called. Call buildScaledFont instead of initializeWithFontFace.
205         (WebCore::FontPlatformData::operator=):
206         (WebCore::FontPlatformData::buildScaledFont): Renamed from initializeWithFontFace, does
207         the same thing, except calculate whether or not to use synthetic oblique. Instead just
208         reads the value.
209         (WebCore::FontPlatformData::setOrientation): Instead of adjusting the font matrix, recreate
210         the entire font.
211         (WebCore::FontPlatformData::setSyntheticOblique): Added.
212         (WebCore::rotateCairoMatrixForVerticalOrientation): Deleted.
213         (WebCore::FontPlatformData::initializeWithFontFace): Deleted.
214
215 2015-05-06  Alex Christensen  <achristensen@webkit.org>
216
217         [Content Extensions] Test splitting NFAs by max NFA size.
218         https://bugs.webkit.org/show_bug.cgi?id=144659
219
220         Reviewed by Darin Adler.
221
222         * WebCore.xcodeproj/project.pbxproj:
223         * contentextensions/CombinedURLFilters.cpp:
224         (WebCore::ContentExtensions::generateNFAForSubtree):
225         (WebCore::ContentExtensions::CombinedURLFilters::processNFAs):
226         * contentextensions/CombinedURLFilters.h:
227         * contentextensions/ContentExtensionCompiler.cpp:
228         (WebCore::ContentExtensions::compileRuleList):
229         * contentextensions/DFABytecodeCompiler.h:
230         * contentextensions/DFABytecodeInterpreter.h:
231         Make maxNFASize a parameter so we can test it with small values.
232
233 2015-05-06  Antti Koivisto  <antti@apple.com>
234
235         REGRESSION (r183467): Unable to start downloads in private browsing mode
236         https://bugs.webkit.org/show_bug.cgi?id=144533
237
238         Reviewed by Darin Adler.
239
240         If willSendRequest delegate mutated the request we would lose the requester field value from the original.
241
242         No test runner support for mutating requests.
243
244         * platform/network/cf/ResourceRequestCFNet.cpp:
245         (WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties):
246
247             This needs to keep the requester too.
248
249         * platform/network/cocoa/ResourceRequestCocoa.mm:
250         (WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties): Deleted.
251
252             Share implementations.
253
254 2015-05-06  Ryosuke Niwa  <rniwa@webkit.org>
255
256         Toggling underline on font panel removes strike through
257         https://bugs.webkit.org/show_bug.cgi?id=144670
258         <rdar://problem/3790443>
259
260         Reviewed by Darin Adler.
261
262         * editing/EditingStyle.cpp:
263         (WebCore::EditingStyle::EditingStyle): Added a variant that takes CSSStyleDeclaration.
264         * editing/EditingStyle.h:
265         (WebCore::EditingStyle::create): Ditto.
266         * editing/Editor.cpp:
267         (WebCore::Editor::applyStyleToSelection): Takes Ref<EditingStyle>&& instead of RefPtr<EditingStyle>&&.
268         * editing/Editor.h:
269         * editing/EditorCommand.cpp:
270         (WebCore::applyCommandToFrame): Ditto.
271         (WebCore::executeStrikethrough):
272         (WebCore::executeUnderline):
273
274 2015-05-06  Jessie Berlin  <jberlin@webkit.org>
275
276         More build fixing.
277
278         * page/mac/TextIndicatorWindow.mm:
279
280 2015-05-06  Jessie Berlin  <jberlin@webkit.org>
281
282         32-bit build fix after r183859 and r183860.
283
284         * page/mac/TextIndicatorWindow.mm:
285         Autosynthesis isn't available for our 32-bit builds.
286
287 2015-05-06  Carlos Garcia Campos  <cgarcia@igalia.com>
288
289         [EGL] Move EGLDisplay handling to PlatformDisplay and remove PlatformDisplay definition from GLDefs.h
290         https://bugs.webkit.org/show_bug.cgi?id=144685
291
292         Reviewed by Martin Robinson.
293
294         The EGL display is also initialized in multiple places, and could
295         be unified in PlatformDisplay. Remove the PlatformDisplay
296         definition from platform/graphics/opengl/GLDefs.h to avoid conflicts.
297
298         * platform/graphics/PlatformDisplay.cpp:
299         (WebCore::PlatformDisplay::PlatformDisplay): Initialize m_eglDisplay.
300         (WebCore::PlatformDisplay::~PlatformDisplay): Call terminateEGLDisplay().
301         (WebCore::PlatformDisplay::eglDisplay): Lazy intialize the EGL
302         display and return it.
303         (WebCore::PlatformDisplay::initializeEGLDisplay):
304         (WebCore::PlatformDisplay::terminateEGLDisplay):
305         * platform/graphics/PlatformDisplay.h:
306         * platform/graphics/egl/GLContextEGL.cpp:
307         (WebCore::sharedEGLDisplay): Use PlatformDisplay::eglDisplay().
308         * platform/graphics/opengl/GLDefs.h: Remove unneeded definitions.
309         * platform/graphics/opengl/GLPlatformSurface.cpp:
310         (WebCore::GLPlatformSurface::GLPlatformSurface): Remove
311         m_sharedDisplay member, PlatformDisplay::sharedDisplay() can be used instead.
312         (WebCore::GLPlatformSurface::sharedDisplay): Deleted.
313         * platform/graphics/opengl/GLPlatformSurface.h:
314         * platform/graphics/surfaces/egl/EGLConfigSelector.h: Use
315         EGLDisplay instead of PlatformDisplay.
316         * platform/graphics/surfaces/egl/EGLContext.cpp:
317         (WebCore::EGLOffScreenContext::initialize): Use PlatformDisplay::eglDisplay().
318         * platform/graphics/surfaces/egl/EGLHelper.cpp: Remove the
319         EGLDisplayConnection clas and use PlatformDisplay instead.
320         (WebCore::EGLHelper::eglDisplay):
321         (WebCore::EGLHelper::currentDisplay):
322         (WebCore::EGLDisplayConnection::EGLDisplayConnection): Deleted.
323         (WebCore::EGLDisplayConnection::~EGLDisplayConnection): Deleted.
324         (WebCore::EGLDisplayConnection::display): Deleted.
325         (WebCore::EGLDisplayConnection::terminate): Deleted.
326         * platform/graphics/surfaces/egl/EGLHelper.h:
327         * platform/graphics/surfaces/egl/EGLSurface.cpp:
328         (WebCore::EGLTransportSurface::EGLTransportSurface): Use EGLHelper::eglDisplay().
329         (WebCore::EGLTransportSurface::destroy): Ditto.
330         (WebCore::EGLOffScreenSurface::EGLOffScreenSurface): Ditto.
331         (WebCore::EGLOffScreenSurface::destroy): Ditto.
332         * platform/graphics/surfaces/egl/EGLXSurface.cpp:
333         (WebCore::EGLWindowTransportSurface::EGLWindowTransportSurface):
334         Use PlatformDisplay::eglDisplay().
335         (WebCore::EGLWindowTransportSurface::swapBuffers): Ditto.
336         (WebCore::EGLPixmapSurface::EGLPixmapSurface): Ditto.
337         * platform/graphics/surfaces/glx/GLXContext.cpp:
338         (WebCore::GLXOffScreenContext::initialize): Use X11Helper::nativeDisplay().
339         * platform/graphics/surfaces/glx/GLXSurface.cpp:
340         (WebCore::GLXTransportSurface::GLXTransportSurface): Do not use m_sharedDisplay.
341         (WebCore::GLXOffScreenSurface::initialize): Ditto.
342         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
343         (WebCore::PlatformDisplayWayland::PlatformDisplayWayland): Call
344         PlatformDisplay::initializeEGLDisplay() to insialize the EGL display.
345         * platform/graphics/wayland/PlatformDisplayWayland.h:
346         * platform/graphics/x11/PlatformDisplayX11.cpp:
347         (WebCore::PlatformDisplayX11::initializeEGLDisplay): Override
348         PlatformDisplay::initializeEGLDisplay() to initialize the
349         m_eglDisplay member.
350         * platform/graphics/x11/PlatformDisplayX11.h:
351
352 2015-05-06  Joseph Pecoraro  <pecoraro@apple.com>
353
354         Web Inspector: DOMStorage exception and issue with sessionStorage
355         https://bugs.webkit.org/show_bug.cgi?id=144646
356
357         Reviewed by Timothy Hatcher.
358
359         * inspector/InspectorDOMStorageAgent.cpp:
360         (WebCore::InspectorDOMStorageAgent::findStorageArea):
361         Return session storage if the identifier says not local storage.
362
363 2015-05-06  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
364
365         Move ReadableStreamJSSource.h/.cpp to ReadableJSStream.h/.cpp
366         https://bugs.webkit.org/show_bug.cgi?id=144567
367
368         Reviewed by Darin Adler.
369
370         In addition to renaming ReadableStreamJSSource.h/.cpp, ReadableStreamJSSource is now made a private class of
371         ReadableJSStream, called ReadableJSStream::Source.
372         Made some minor refactoring (passing some ExecState by ref and not by pointer).
373         No functional change, existing tests cover the changes.
374
375         * bindings/js/JSReadableStreamCustom.cpp:
376         * bindings/js/ReadableJSStream.cpp:
377         (WebCore::ReadableJSStream::Source::create):
378         (WebCore::ReadableJSStream::Source::Source):
379         (WebCore::ReadableJSStream::Source::~Source):
380         (WebCore::ReadableJSStream::Source::globalObject):
381         (WebCore::ReadableJSStream::Source::start):
382         (WebCore::ReadableJSStream::create):
383         (WebCore::ReadableJSStream::ReadableJSStream):
384         * bindings/js/ReadableJSStream.h:
385
386 2015-05-05  Tim Horton  <timothy_horton@apple.com>
387
388         REGRESSION (r183517): Yellow find-in-page highlight gets stuck forever
389         https://bugs.webkit.org/show_bug.cgi?id=144651
390         <rdar://problem/20755722>
391
392         * page/mac/TextIndicatorWindow.mm:
393         Fix an incorrectly-applied review comment.
394
395 2015-05-05  Timothy Horton  <timothy_horton@apple.com>
396
397         REGRESSION (r183517): Yellow find-in-page highlight gets stuck forever
398         https://bugs.webkit.org/show_bug.cgi?id=144651
399         <rdar://problem/20755722>
400
401         Reviewed by Dan Bernstein.
402
403         * page/mac/TextIndicatorWindow.h:
404         * page/mac/TextIndicatorWindow.mm:
405         (WebCore::TextIndicatorWindow::clearTextIndicator):
406         (WebCore::TextIndicatorWindow::setTextIndicator):
407         (WebCore::TextIndicatorWindow::closeWindow):
408         (WebCore::TextIndicatorWindow::startFadeOut):
409         We can't keep m_fadingOut on TextIndicatorWindow, since it is reused.
410         Keep it on the WebTextIndicatorView instead.
411
412 2015-05-05  Žan Doberšek  <zdobersek@igalia.com>
413
414         Add missing vtable override specifiers under Source/WebCore/html
415         https://bugs.webkit.org/show_bug.cgi?id=144578
416
417         Reviewed by Daniel Bates.
418
419         Update virtual method overrides under Source/WebCore/html
420         which are missing the override specifier.
421
422         * html/canvas/WebGL2RenderingContext.h:
423         * html/canvas/WebGLRenderingContext.h:
424         * html/track/InbandTextTrack.h:
425         * html/track/TrackListBase.h:
426
427 2015-05-05  Žan Doberšek  <zdobersek@igalia.com>
428
429         Add missing vtable override specifiers under Source/WebCore/rendering
430         https://bugs.webkit.org/show_bug.cgi?id=144570
431
432         Reviewed by Darin Adler.
433
434         Update virtual method overrides under Source/WebCore/rendering
435         which are missing the override specifiers.
436
437         * rendering/InlineTextBox.h:
438         (WebCore::InlineTextBox::calculateBoundaries): Deleted.
439         * rendering/RenderFlowThread.h:
440         * rendering/RenderMedia.h:
441         (WebCore::RenderMedia::shadowControlsNeedCustomLayoutMetrics): Deleted.
442         * rendering/RenderMultiColumnSet.h:
443         * rendering/RenderRegion.h:
444         * rendering/RenderRegionSet.h:
445         * rendering/RenderThemeGtk.h:
446         * rendering/mathml/RenderMathMLOperator.h:
447         * rendering/svg/RenderSVGBlock.h:
448
449 2015-05-05  Žan Doberšek  <zdobersek@igalia.com>
450
451         Add missing vtable override specifiers under Source/WebCore/Modules
452         https://bugs.webkit.org/show_bug.cgi?id=144569
453
454         Reviewed by Darin Adler.
455
456         Update virtual method overrides under Source/WebCore/Modules
457         which are missing the override specifier.
458
459         * Modules/mediasource/SourceBuffer.h:
460         * Modules/mediastream/MediaStreamTrack.h:
461         * Modules/mediastream/RTCVoidRequestImpl.h:
462         * Modules/webaudio/AudioContext.h:
463         (WebCore::AudioContext::mediaType): Deleted.
464         (WebCore::AudioContext::presentationType): Deleted.
465         (WebCore::AudioContext::canReceiveRemoteControlCommands): Deleted.
466         (WebCore::AudioContext::didReceiveRemoteControlCommand): Deleted.
467         (WebCore::AudioContext::overrideBackgroundPlaybackRestriction): Deleted.
468         * Modules/webaudio/MediaStreamAudioDestinationNode.h:
469         * Modules/webaudio/MediaStreamAudioSourceNode.h:
470         * Modules/webaudio/WaveShaperDSPKernel.h:
471         * Modules/websockets/WebSocketChannel.h:
472         (WebCore::WebSocketChannel::refThreadableWebSocketChannel): Deleted.
473         (WebCore::WebSocketChannel::derefThreadableWebSocketChannel): Deleted.
474         * Modules/websockets/WorkerThreadableWebSocketChannel.h:
475         (WebCore::WorkerThreadableWebSocketChannel::refThreadableWebSocketChannel): Deleted.
476         (WebCore::WorkerThreadableWebSocketChannel::derefThreadableWebSocketChannel): Deleted.
477
478 2015-05-05  Žan Doberšek  <zdobersek@igalia.com>
479
480         EventHandler::m_eventHandlerWillResetCapturingMouseEventsElement is incorrectly initialized
481         https://bugs.webkit.org/show_bug.cgi?id=144583
482
483         Reviewed by Daniel Bates.
484
485         * page/EventHandler.cpp:
486         (WebCore::EventHandler::EventHandler): The
487         m_eventHandlerWillResetCapturingMouseEventsElement is a boolean,
488         so initialize it to false, instead of to nullptr.
489
490 2015-05-05  Manuel Rego Casasnovas  <rego@igalia.com>
491
492         [CSS Grid Layout] grid-template-areas should accept none value
493         https://bugs.webkit.org/show_bug.cgi?id=144624
494
495         Reviewed by Darin Adler.
496
497         Default value for grid-template-areas property is "none":
498         http://dev.w3.org/csswg/css-grid/#propdef-grid-template-areas
499
500         Currently if you set the property to "none" from JavaScript, the value
501         doesn't get reseted and it keeps the old value.
502
503         Update fast/css-grid-layout/grid-template-areas-get-set.html adding a
504         new test case.
505
506         * css/CSSParser.cpp:
507         (WebCore::CSSParser::parseGridTemplateAreas): Add support to parse
508         "none" successfully.
509
510 2015-05-05  Zalan Bujtas  <zalan@apple.com>
511
512         Remove unused RenderLayerBacking::hasContentsLayer().
513         https://bugs.webkit.org/show_bug.cgi?id=144658
514
515         Reviewed by Simon Fraser.
516
517         No change in functionality.
518
519         * rendering/RenderLayerBacking.h:
520
521 2015-05-05  Alex Christensen  <achristensen@webkit.org>
522
523         [Content Extensions] Limit NFA size.
524         https://bugs.webkit.org/show_bug.cgi?id=144649
525
526         Reviewed by Benjamin Poulain.
527
528         * contentextensions/CombinedURLFilters.cpp:
529         (WebCore::ContentExtensions::generateNFAForSubtree):
530         (WebCore::ContentExtensions::CombinedURLFilters::processNFAs):
531         Add a maximum NFA size to ensure that we do not use too much memory when compiling.
532         * contentextensions/ContentExtensionCompiler.cpp:
533         (WebCore::ContentExtensions::compileRuleList):
534         Remove debugging code that doesn't compile any more.
535
536 2015-05-05  Roger Fong  <roger_fong@apple.com>
537
538         Unreviewed. Some assertion failures in compositing code after r183820.
539         https://bugs.webkit.org/show_bug.cgi?id=144630.
540
541         * rendering/RenderLayerCompositor.cpp:
542         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
543
544 2015-05-05  Timothy Horton  <timothy_horton@apple.com>
545
546         Add a layout mode for computing fixed layout size from a minimum size
547         https://bugs.webkit.org/show_bug.cgi?id=144610
548         <rdar://problem/19790341>
549
550         Reviewed by Simon Fraser.
551
552         * platform/spi/cocoa/QuartzCoreSPI.h:
553         Add some SPI.
554
555 2015-05-05  Brent Fulgham  <bfulgham@apple.com>
556
557         iOS] Scroll snap points trigger reentrant layout
558         https://bugs.webkit.org/show_bug.cgi?id=144644
559         <rdar://problem/20366547>
560
561         Reviewed by Simon Fraser.
562
563         Covered by scroll-snap-mandatory.html test.
564
565         We had an iOS code path in 'appendChildSnapOffsets' that used offsetLeft and offsetTop. This code
566         was sometimes called during layout, which triggered a reentrant layout call, resulting in a debug
567         assertion.
568
569         * page/scrolling/AxisScrollSnapOffsets.cpp:
570         (WebCore::appendChildSnapOffsets): Remove iOS codepath.
571
572 2015-05-05  Roger Fong  <roger_fong@apple.com>
573
574         Blurry media control icons on non retina displays.
575         https://bugs.webkit.org/show_bug.cgi?id=144638.
576         <rdar://problem/20526166>
577
578         Reviewed by Dean Jackson.
579
580         * Modules/mediacontrols/mediaControlsApple.css:
581         Adjust fullscreen buttons so that they look good on both 1x and 2x displays.
582         (audio::-webkit-media-controls-fullscreen-button):
583         (audio::-webkit-media-controls-fullscreen-button.exit):
584         (audio::-webkit-media-controls-fullscreen-button:active):
585         (audio::-webkit-media-controls-panel button.exit:active):
586         Handle wireless playback picker button background in mediaControlsApple.js
587         (audio::-webkit-media-controls-wireless-playback-picker-button):
588         (audio::-webkit-media-controls-wireless-playback-picker-button.playing): Deleted.
589
590         * Modules/mediacontrols/mediaControlsApple.js:
591         Update wireless playback picker button based on display type.
592         (Controller.prototype.UIString):
593         (Controller.prototype.handleReadyStateChange):
594         (Controller.prototype.updateWirelessTargetPickerButton):
595         (Controller.prototype.updateWirelessPlaybackStatus):
596
597 2015-05-05  Joseph Pecoraro  <pecoraro@apple.com>
598
599         Web Inspector: Crash under WebCore::domWindowFromExecState reloading page with inspector open
600         https://bugs.webkit.org/show_bug.cgi?id=144636
601
602         Reviewed by Mark Lam.
603
604         This ensures we create an InjectedScript for the execution context
605         (frame) preventing the global object / exec state from getting garbage
606         collected before we remove it from our map.
607
608         * inspector/PageRuntimeAgent.cpp:
609         (WebCore::PageRuntimeAgent::notifyContextCreated):
610
611 2015-05-05  Dean Jackson  <dino@apple.com>
612
613         [iOS] AirPlay placeholder in inline videos uses Helvetica or Times, should be system font
614         https://bugs.webkit.org/show_bug.cgi?id=144643
615
616         Reviewed by Brent Fulgham.
617
618         The Airplay placard should use "-apple-system" as a font-family.
619
620         * Modules/mediacontrols/mediaControlsiOS.css:
621         (audio::-webkit-media-controls-wireless-playback-status):
622
623 2015-05-05  Zalan Bujtas  <zalan@apple.com>
624
625         Navigating to www.apple.com hits assertion in WebCore::TextIteratorCopyableText::set()
626         https://bugs.webkit.org/show_bug.cgi?id=144629
627         rdar://problem/20689877
628
629         Reviewed by Andreas Kling.
630
631         This patch ensures that we don't emit empty text for the text iterator.
632         In TextIterator::handleTextNode before emitting a string, certain characters (\n \t) need to
633         be replaced with space. When such character is found, we emit the string we've processed so far and
634         handle the replacement during the next callback.
635         When the first character in the string needs replacing, there's nothing to emit. However if we don't
636         handle at least one character, TextIterator::advance believes that processing is done and never calls  
637         TextIterator::handleTextNode back with the rest of the string. 
638
639         Test: fast/text/simple-line-layout-innerText-with-newline.html
640
641         * editing/TextIterator.cpp:
642         (WebCore::isNewLineOrTabCharacter):
643         (WebCore::TextIterator::handleTextNode):
644
645 2015-05-05  Alex Christensen  <achristensen@webkit.org>
646
647         [Content Extensions] Use less memory to store the json input.
648         https://bugs.webkit.org/show_bug.cgi?id=144604
649
650         Reviewed by Benjamin Poulain.
651
652         * contentextensions/ContentExtensionCompiler.cpp:
653         (WebCore::ContentExtensions::compileRuleList):
654         * contentextensions/ContentExtensionCompiler.h:
655         (WebCore::ContentExtensions::loadEncodedRules):
656         Don't copy strings as much or keep them alive after done using them.
657
658 2015-05-05  Eric Carlson  <eric.carlson@apple.com>
659
660         Prevent recursive calls to show target picker menu.
661         https://bugs.webkit.org/show_bug.cgi?id=144637
662         <rdar://problem/20824726>
663
664         Reviewed by Jer Noble.
665
666         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h: Add m_showingMenu.
667         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
668         (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker): Do nothing if the menu
669         is already showing.
670
671 2015-05-05  Dean Jackson  <dino@apple.com>
672
673         Use system blue for Airplay Glyph
674         https://bugs.webkit.org/show_bug.cgi?id=144614
675
676         There was a typo in the last commit.
677
678         * Modules/mediacontrols/mediaControlsiOS.css:
679         (audio::-webkit-media-controls-optimized-fullscreen-button): Transition duration should be 250ms.
680
681 2015-05-04  Dean Jackson  <dino@apple.com>
682
683         [iOS] Use system blue for Airplay Glyph
684         https://bugs.webkit.org/show_bug.cgi?id=144614
685
686         Reviewed by Eric Carlson.
687
688         Revert to using masks for the glyphs in the media controls,
689         which allows us to:
690         - use the system blue color when Airplay is active <rdar://problem/20245297>
691         - fade out from the active state <rdar://problem/20245487>
692         - allow the play button to give touch feedback <rdar://problem/17849930>
693
694         While those are three separate bugs, they all get addressed by
695         this single change.
696
697         * Modules/mediacontrols/mediaControlsiOS.css:
698         (audio::-webkit-media-controls-optimized-fullscreen-button):
699         (audio::-webkit-media-controls-optimized-fullscreen-button:active):
700         (video::-webkit-media-controls-play-button):
701         (video::-webkit-media-controls-play-button.paused):
702         (video::-webkit-media-controls-fullscreen-button):
703         (video::-webkit-media-controls-wireless-playback-picker-button):
704         (video::-webkit-media-controls-wireless-playback-picker-button.playing):
705         (video::-webkit-media-controls-optimized-fullscreen-button):
706         (video::-webkit-media-controls-play-button:active): Deleted.
707         (video::-webkit-media-controls-play-button.paused:active): Deleted.
708         (video::-webkit-media-controls-fullscreen-button:active): Deleted.
709         (video::-webkit-media-controls-wireless-playback-picker-button:active): Deleted.
710
711 2015-05-05  Eric Carlson  <eric.carlson@apple.com>
712
713         Only autoplay videos should not automatically play to playback target
714         https://bugs.webkit.org/show_bug.cgi?id=144633
715
716         Reviewed by Jer Noble.
717
718         * html/HTMLMediaElement.cpp:
719         (WebCore::HTMLMediaElement::HTMLMediaElement): Set RequireUserGestureToAutoplayToExternalDevice.
720         (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture): Remove
721         RequireUserGestureToAutoplayToExternalDevice.
722         (WebCore::HTMLMediaElement::mediaState): Set ExternalDeviceAutoPlayCandidate if playback
723         was started from a user gesture, even if the video loops and/or doesn't have audio.
724
725         * html/HTMLMediaSession.h: Define RequireUserGestureToAutoplayToExternalDevice.
726         (WebCore::HTMLMediaSession::hasBehaviorRestriction): New.
727
728 2015-05-05  Brent Fulgham  <bfulgham@apple.com>
729
730         Unreviewed logging fix.
731
732         * page/WheelEventTestTrigger.cpp:
733         (WebCore::WheelEventTestTrigger::triggerTestTimerFired): Fix typo in logging channel.
734
735 2015-05-04  Roger Fong  <roger_fong@apple.com>
736
737         Media control volume slider is opaque.
738         https://bugs.webkit.org/show_bug.cgi?id=144470.
739         <rdar://problem/20770350>
740
741         Rubberstamped by Simon Fraser.
742
743         * Modules/mediacontrols/mediaControlsApple.css:
744         (audio::-webkit-media-controls-panel): 
745         Don't create a stacking context just for the controls.
746         Doing so causes the mix-blend-mode on the volume box to fail.
747
748 2015-05-05  Alex Christensen  <achristensen@webkit.org>
749
750         [Content Extensions] Combine NFAs properly and free memory as we compile.
751         https://bugs.webkit.org/show_bug.cgi?id=144485
752
753         Reviewed by Benjamin Poulain.
754
755         This patch correctly combines all regular expressions with a common prefix up to
756         the last quantified term into the same NFA.  It also deletes the prefix tree as it 
757         creates NFAs, thus reducing the maximum memory used when compiling.
758
759         * contentextensions/CombinedURLFilters.cpp:
760         (WebCore::ContentExtensions::CombinedURLFilters::isEmpty):
761         (WebCore::ContentExtensions::CombinedURLFilters::addPattern):
762         (WebCore::ContentExtensions::generateNFAForSubtree):
763         (WebCore::ContentExtensions::CombinedURLFilters::processNFAs):
764         (WebCore::ContentExtensions::CombinedURLFilters::clear): Deleted.
765         * contentextensions/CombinedURLFilters.h:
766         * contentextensions/ContentExtensionCompiler.cpp:
767         (WebCore::ContentExtensions::compileRuleList):
768         * contentextensions/ContentExtensionsDebugging.h:
769
770 2015-05-04  Alex Christensen  <achristensen@webkit.org>
771
772         [Content Extensions] Use less memory when writing byte code to file
773         https://bugs.webkit.org/show_bug.cgi?id=144602
774
775         Reviewed by Darin Adler.
776
777         * contentextensions/ContentExtensionCompiler.cpp:
778         (WebCore::ContentExtensions::compileRuleList):
779         * contentextensions/ContentExtensionCompiler.h:
780         Compile one DFA at a time so we don't need to keep all the bytecode in memory at the same time.
781         * contentextensions/DFABytecodeInterpreter.cpp:
782         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
783         Jumps are now relative to the current DFA because we don't know about other DFAs that
784         have been compiling when linking the DFA bytecode.  This will also make the DFA bytecode
785         easier to minimize because more of the values are small in the DFAs after the first DFA.
786         * platform/FileSystem.h:
787
788 2015-05-05  Csaba Osztrogonác  <ossy@webkit.org>
789
790         Unreviewed, speculative WinCairo buildfix after r183807.
791
792         * WebCore.vcxproj/WebCore.vcxproj:
793         * WebCore.vcxproj/WebCore.vcxproj.filters:
794
795 2015-05-05  Csaba Osztrogonác  <ossy@webkit.org>
796
797         Remove TextureMapperImageBuffer
798         https://bugs.webkit.org/show_bug.cgi?id=143561
799
800         Reviewed by Žan Doberšek.
801
802         * CMakeLists.txt:
803         * PlatformEfl.cmake:
804         * PlatformGTK.cmake:
805         * PlatformWinCairo.cmake:
806         * platform/graphics/GraphicsContext3DPrivate.cpp:
807         (WebCore::GraphicsContext3DPrivate::paintToTextureMapper):
808         * platform/graphics/cairo/ImageBufferCairo.cpp:
809         (WebCore::ImageBufferData::paintToTextureMapper):
810         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
811         (WebCore::MediaPlayerPrivateGStreamerBase::paintToTextureMapper):
812         * platform/graphics/texmap/BitmapTextureImageBuffer.cpp: Removed.
813         * platform/graphics/texmap/BitmapTextureImageBuffer.h: Removed.
814         * platform/graphics/texmap/BitmapTexturePool.cpp:
815         (WebCore::BitmapTexturePool::createTexture):
816         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
817         (WebCore::GraphicsLayerTextureMapper::setFilters):
818         * platform/graphics/texmap/TextureMapper.cpp:
819         (WebCore::TextureMapper::create):
820         (WebCore::TextureMapper::TextureMapper):
821         * platform/graphics/texmap/TextureMapper.h:
822         (WebCore::TextureMapper::accelerationMode): Deleted.
823         * platform/graphics/texmap/TextureMapperGL.cpp:
824         (WebCore::TextureMapperGL::TextureMapperGL):
825         * platform/graphics/texmap/TextureMapperImageBuffer.cpp: Removed.
826         * platform/graphics/texmap/TextureMapperImageBuffer.h: Removed.
827         * platform/graphics/texmap/coordinated/CompositingCoordinator.cpp:
828         (WebCore::CompositingCoordinator::CompositingCoordinator):
829         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
830         (WebCore::GraphicsLayer::supportsContentsTiling):
831         (WebCore::CoordinatedGraphicsLayer::setShouldSupportContentsTiling): Deleted.
832         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
833
834 2015-05-05  Javier Fernandez  <jfernandez@igalia.com>
835
836         [CSS Box Alignment] Upgrade align-content parsing to CSS3 Box Alignment spec
837         https://bugs.webkit.org/show_bug.cgi?id=144443
838
839         Reviewed by Darin Adler.
840
841         Upgrade the align-content property to the last CSS3 Box
842         Alignment specification. As it uses a different enumeration for
843         Positional and Distribution alignment, it implies some changes in
844         the FlexibleBox implementation.
845
846         Test: css3/parse-align-content.html
847
848         * css/CSSComputedStyleDeclaration.cpp:
849         (WebCore::resolveContentAlignmentAuto):
850         (WebCore::ComputedStyleExtractor::propertyValue):
851         * css/CSSParser.cpp:
852         (WebCore::isValidKeywordPropertyAndValue):
853         (WebCore::isKeywordPropertyID):
854         (WebCore::CSSParser::parseValue):
855         * css/CSSPropertyNames.in:
856         * rendering/RenderFlexibleBox.cpp:
857         (WebCore::RenderFlexibleBox::layoutAndPlaceChildren):
858         (WebCore::RenderFlexibleBox::layoutColumnReverse):
859         (WebCore::initialAlignContentOffset):
860         (WebCore::alignContentSpaceBetweenChildren):
861         (WebCore::RenderFlexibleBox::alignFlexLines):
862         * rendering/style/RenderStyle.cpp:
863         (WebCore::RenderStyle::resolveContentAlignment):
864         (WebCore::RenderStyle::resolveContentJustification):
865         * rendering/style/RenderStyle.h:
866         * rendering/style/StyleRareNonInheritedData.cpp:
867         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
868         (WebCore::StyleRareNonInheritedData::operator==):
869         * rendering/style/StyleRareNonInheritedData.h:
870
871 2015-05-05  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
872
873         streams/readable-stream.html is very flaky
874         https://bugs.webkit.org/show_bug.cgi?id=144455
875
876         Reviewed by Darin Adler.
877
878         Changed the link between readadable stream and controller.
879         Controller ref()/deref() now increments/decrements its stream ref counter.
880         This ensures that even if JS scripts do not keep track of the readable stream,
881         the readable stream will not be disposed as long as the JS script has access to its controller.
882
883         Test: streams/readable-stream-gc.html
884
885         * Modules/streams/ReadableStreamController.h:
886         (WebCore::ReadableStreamController::ReadableStreamController):
887         (WebCore::ReadableStreamController::ref):
888         (WebCore::ReadableStreamController::deref):
889         (WebCore::ReadableStreamController::create): Deleted.
890         (WebCore::ReadableStreamController::stream): Deleted.
891         * bindings/js/JSReadableStreamControllerCustom.cpp:
892         (WebCore::JSReadableStreamController::close):
893         (WebCore::JSReadableStreamController::enqueue):
894         (WebCore::JSReadableStreamController::error):
895         * bindings/js/ReadableStreamJSSource.cpp:
896         (WebCore::ReadableStreamJSSource::~ReadableStreamJSSource):
897         (WebCore::ReadableStreamJSSource::start):
898         (WebCore::ReadableJSStream::jsController):
899         * bindings/js/ReadableStreamJSSource.h:
900
901 2015-05-05  Myles C. Maxfield  <mmaxfield@apple.com>
902
903         Small cleanup in RenderText::computePreferredLogicalWidths()
904         https://bugs.webkit.org/show_bug.cgi?id=144615
905
906         Reviewed by Simon Fraser.
907
908         A little bit of cleanup before I tackle dependent widths in this function.
909
910         No new tests because there is no behavior change.
911
912         * rendering/RenderText.cpp:
913         (WebCore::RenderText::computePreferredLogicalWidths):
914
915 2015-05-05  Joanmarie Diggs  <jdiggs@igalia.com>
916
917         [ATK] AX: figure out platform difference for ATK to make accessibility/table-cell-display-block.html work
918         https://bugs.webkit.org/show_bug.cgi?id=143083
919
920         Reviewed by Chris Fleizach.
921
922         The main platform difference was that ATK was mapping the td element to
923         the accessible table cell, and the render block resulting from the style
924         wound up being the cell parent. In contrast, AX API was mapping the cell
925         element to an AXGroup which was a child of the AXCell. Rather than try to
926         bend yet another case to the will of our individual platforms' table needs,
927         it made more sense to clean up the code that is competing and move toward
928         more platform-unified handling. This is the first step in that direction,
929         with ATK moving closer toward the WebCore/AX API mapping.
930
931         No new tests. Instead, modified and fixed the test which was being skipped
932         for GTK, and also updated the expectations of some Mac tests whose FIXMEs
933         should now be fixed.
934
935         * accessibility/AccessibilityNodeObject.cpp:
936         (WebCore::AccessibilityNodeObject::supportsRequiredAttribute):
937         * accessibility/AccessibilityRenderObject.cpp:
938         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
939         * accessibility/AccessibilityTable.cpp:
940         (WebCore::AccessibilityTable::computeIsTableExposableThroughAccessibility):
941         * accessibility/AccessibilityTableCell.cpp:
942         (WebCore::AccessibilityTableCell::determineAccessibilityRole):
943         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
944         (createAccessibilityRoleMap):
945
946 2015-05-04  Jer Noble  <jer.noble@apple.com>
947
948         [iOS] Videos on apple.com flash when touching to show or hide the controls
949         https://bugs.webkit.org/show_bug.cgi?id=144598
950
951         Reviewed by Eric Carlson.
952
953         The apple.com site will add a "selection" rectangle atop a playing video when it recieves a touchstart
954         event. The default media controls use touchstart to signal the controls to become visible. Stop the touch
955         from propagating down to the page in this case.
956
957         * Modules/mediacontrols/mediaControlsiOS.js:
958         (ControllerIOS.prototype.handleWrapperTouchStart):
959
960 2015-05-04  Andreas Kling  <akling@apple.com>
961
962         Record the reference time when Performance is constructed.
963         <https://webkit.org/b/144616>
964
965         Reviewed by Geoffrey Garen.
966
967         This is a merge of Blink's r156613 by simonjam@chromium.org.
968
969         Cache a copy of the DocumentLoader's reference timestamp when constructing
970         the Performance object. That way we don't have to jump through a bunch of scary
971         hoops to access it when now() is called later on.
972
973         * page/Performance.cpp:
974         (WebCore::Performance::Performance):
975         (WebCore::Performance::now): Deleted.
976         * page/Performance.h:
977
978 2015-05-04  Simon Fraser  <simon.fraser@apple.com>
979
980         Fix assertions in WK1 tests after r183777.
981         
982         Two issues with the original change:
983         
984         If not in compositing mode, we shouldn't schedule layer flushes, since
985         Document::documentWillSuspendForPageCache() only only calls cancelCompositingLayerUpdate()
986         if in compositing mode.
987         
988         Second, RenderLayerCompositor::rootBackgroundTransparencyChanged() never stored the
989         new color, resulting in too many triggered compositing updates.
990
991         * rendering/RenderLayerCompositor.cpp:
992         (WebCore::RenderLayerCompositor::rootBackgroundTransparencyChanged):
993
994 2015-05-04  Zalan Bujtas  <zalan@apple.com>
995
996         RenderWidget::setWidgetGeometry() can end up destroying *this*.
997         https://bugs.webkit.org/show_bug.cgi?id=144601
998
999         Reviewed by Andreas Kling.
1000
1001         This is a speculative fix to ensure we don't crash on an invalid *this* renderer
1002         while flattening the current iframe.
1003         Calling RenderWidget::setWidgetGeometry() can result in destroying the current renderer.
1004         While it is not a issue in case of normal layout flow as widget positions are updated at post layout,
1005         frame flattening initiates this action in the middle of layout.
1006         This patch re-introduces refcount model for RenderWidgets so that the renderer is protected during layout
1007         when frame flattening is in use.
1008
1009         * rendering/RenderFrameBase.cpp:
1010         (WebCore::RenderFrameBase::layoutWithFlattening): Let's be paranoid about child view.
1011         * rendering/RenderObject.cpp:
1012         (WebCore::RenderObject::destroy):
1013         * rendering/FrameView.cpp:
1014         (WebCore::FrameView::layout):
1015         * rendering/RenderView.h:
1016         * rendering/RenderWidget.cpp:
1017         (WebCore::RenderWidget::~RenderWidget):
1018         * rendering/RenderWidget.h:
1019         (WebCore::RenderWidget::ref):
1020         (WebCore::RenderWidget::deref):
1021
1022 2015-05-04  Doug Russell  <d_russell@apple.com>
1023
1024         AX: setting focus via accessibility object needs to set isSynchronizing in resulting selection intent
1025         https://bugs.webkit.org/show_bug.cgi?id=144489
1026
1027         Reviewed by Chris Fleizach.
1028
1029         Resolves infinite looping when navigating rapidly between controls with the search API and then focusing
1030         on the returned control.
1031         Remove isSynchronizing flag from AXTextStateChangeIntent and put it on AXObjectCache.
1032         Move AXTextStateChangeIntent logic in AccessibilityRenderObject into a helper method.
1033         Call new AXTextStateChangeIntent helper from AccessibilityRenderObject::setFocus().
1034         Add support for setSelectedVisibleTextRange() in accessibility tests.
1035
1036         Test: platform/mac/accessibility/selection-sync.html
1037
1038         * accessibility/AXObjectCache.cpp:
1039         (WebCore::AXObjectCache::showIntent):
1040         (WebCore::AXObjectCache::setTextSelectionIntent):
1041         (WebCore::AXObjectCache::setIsSynchronizingSelection):
1042         (WebCore::AXObjectCache::postTextStateChangeNotification):
1043         * accessibility/AXObjectCache.h:
1044         * accessibility/AXTextStateChangeIntent.h:
1045         (WebCore::AXTextStateChangeIntent::AXTextStateChangeIntent):
1046         * accessibility/AccessibilityRenderObject.cpp:
1047         (WebCore::setTextSelectionIntent):
1048         (WebCore::AccessibilityRenderObject::setSelectedTextRange):
1049         (WebCore::AccessibilityRenderObject::setFocused):
1050         (WebCore::AccessibilityRenderObject::setSelectedVisiblePositionRange):
1051         (WebCore::AccessibilityRenderObject::boundsForVisiblePositionRange): Deleted.
1052         * accessibility/mac/AXObjectCacheMac.mm:
1053         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
1054
1055 2015-05-04  Eric Carlson  <eric.carlson@apple.com>
1056
1057         [Mac] Audio-only files should not have a device picker
1058         https://bugs.webkit.org/show_bug.cgi?id=144606
1059         <rdar://problem/20806387>
1060
1061         Reviewed by Dean Jackson.
1062
1063         * Modules/mediacontrols/mediaControlsApple.js:
1064         (Controller.prototype.hasVideo): New.
1065         (Controller.prototype.updateFullscreenButtons): Use hasVideo.
1066         (Controller.prototype.updateHasVideo): Ditto.
1067         (Controller.prototype.updateWirelessTargetAvailable): Don't show the target picker button
1068         unless a file has video.
1069
1070 2015-05-04  Chris Dumez  <cdumez@apple.com>
1071
1072         Crash at com.apple.WebKit.WebContent at com.apple.WebCore: WebCore::createWindow + 185
1073         https://bugs.webkit.org/show_bug.cgi?id=144597
1074         <rdar://problem/20361579>
1075
1076         Reviewed by Andreas Kling.
1077
1078         Test: fast/dom/Window/window-open-activeWindow-null-frame.html
1079
1080         In our implementation of window.open(), we make sure that the window
1081         which window.open() is called has a frame. However, we did not have the
1082         same check for the activeDOMWindow (i.e. the lexicalGlobalObject) causing
1083         us to crash in WebCore::createWindow() when dereferencing it.
1084
1085         This patch updates WebCore::createWindow() takes a reference to the
1086         openerFrame instead of a pointer to make it clear the implementation
1087         expects it to be non-null. A null check is then added for the frame
1088         at the call site: DOMWindow::createWindow().
1089
1090         * inspector/InspectorFrontendClientLocal.cpp:
1091         (WebCore::InspectorFrontendClientLocal::openInNewTab):
1092         * loader/FrameLoader.cpp:
1093         (WebCore::isDocumentSandboxed):
1094         (WebCore::FrameLoader::submitForm):
1095         (WebCore::createWindow):
1096         Take a reference to openerFrame instead of a pointer as the
1097         implementation expects it to be non-null.
1098
1099         * loader/FrameLoader.h:
1100         * page/DOMWindow.cpp:
1101         (WebCore::DOMWindow::createWindow):
1102         Add null check for activeFrame before passing it to
1103         WebCore::createWindow().
1104
1105 2015-05-04  Dean Jackson  <dino@apple.com>
1106
1107         Create a named CSS property for system colors
1108         https://bugs.webkit.org/show_bug.cgi?id=144423
1109
1110         Follow-up comments from Darin Adler.
1111
1112         * rendering/RenderThemeIOS.h: Cache a Color rather than an RGBA32.
1113         * rendering/RenderThemeIOS.mm:
1114         (WebCore::RenderThemeIOS::systemColor): Use "add" to avoid multiple hits on the HashMap, and
1115         cache invalid responses so that we don't have to keep looking for non-existent colors.
1116         * rendering/RenderThemeMac.h: Same as iOS.
1117         * rendering/RenderThemeMac.mm:
1118         (WebCore::RenderThemeMac::systemColor):
1119
1120 2015-05-04  Simon Fraser  <simon.fraser@apple.com>
1121
1122         display:none iframes cause repeated compositing flushing
1123         https://bugs.webkit.org/show_bug.cgi?id=144529
1124
1125         Reviewed by Darin Adler.
1126         
1127         FrameView::updateLayoutAndStyleIfNeededRecursive() only forces layout on rendered
1128         frames, by virtue of using its Widget children which are FrameViews.
1129         
1130         However, FrameView::flushCompositingStateIncludingSubframes() iterated over
1131         all frames, and return false if any subframe needed layout. Thus, if it saw
1132         non-rendered frames (which are never laid out), it would return false,
1133         which causes the CFRunLoopObserver that drives flushing to run again.
1134         
1135         Fix by having FrameView::flushCompositingStateIncludingSubframes() only check
1136         rendered frames, using FrameTree::traverseNextRendered() (which needs to be public).
1137         
1138         Also change FrameView::needsStyleRecalcOrLayout() and FrameView::updateLayoutAndStyleIfNeededRecursive()
1139         to fetch the list of FrameViews using FrameTree's nextRenderedSibling(), rather than using
1140         the Widget tree, since we'd like to eventually remove Widgets, and using the Frame
1141         tree matches flushCompositingStateIncludingSubframes() and other code.
1142
1143         Test: compositing/iframes/display-none-subframe.html
1144
1145         * page/FrameTree.h:
1146         * page/FrameView.cpp:
1147         (WebCore::FrameView::flushCompositingStateIncludingSubframes):
1148         (WebCore::FrameView::needsStyleRecalcOrLayout):
1149         (WebCore::FrameView::renderedChildFrameViews): Helper that returns a vector
1150         of Ref<FrameView>s for rendered frames only.
1151         (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive):
1152         * page/FrameView.h:
1153
1154 2015-05-04  Chris Dumez  <cdumez@apple.com>
1155
1156         Unreviewed. Fix build with SECURITY_ASSERTIONS enabled.
1157         <rdar://problem/20653104>
1158
1159         * dom/ScriptExecutionContext.cpp:
1160         (WebCore::ScriptExecutionContext::ScriptExecutionContext):
1161         (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForPageCache):
1162         (WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
1163         (WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
1164         * dom/ScriptExecutionContext.h:
1165
1166 2015-05-04  Simon Fraser  <simon.fraser@apple.com>
1167
1168         Fix updating of tiled backing opaquenss when the page background color changes
1169         https://bugs.webkit.org/show_bug.cgi?id=144600
1170         rdar://problem/20723035
1171
1172         Reviewed by Tim Horton.
1173
1174         RenderLayerCompositor makes the page tiles opaque or not based on the result of
1175         viewHasTransparentBackground(), which consults the view transparency, and
1176         FrameView::documentBackgroundColor(). documentBackgroundColor() in turn is based
1177         on the root and/or body background colors.
1178
1179         We thus need to re-evaluate whether page tiles are opaque when any of these inputs
1180         change, but were failing to do so for the FrameView's baseBackgroundColor, and
1181         the page root background color.
1182         
1183         Fix by having FrameView::setBaseBackgroundColor(), and RenderBox::styleDidChange()
1184         (for the root) trigger a compositing update when necessary.
1185
1186         Added setViewBaseBackgroundColor() on Internals for testing.
1187
1188         Test: platform/mac-wk2/tiled-drawing/background-transparency-toggle.html
1189
1190         * page/FrameView.cpp:
1191         (WebCore::FrameView::setTransparent): Use the isViewForDocumentInFrame() helper.
1192         (WebCore::FrameView::setBaseBackgroundColor): Bail if we're not the view for the 
1193         frame's document, and trigger a compositing update check if the alpha changed.
1194         (WebCore::FrameView::isViewForDocumentInFrame): Helper that checks to see if
1195         this FrameView is associated with the Document being displayed in the FrameView's
1196         Frame. This returns false when we're setting up a new FrameView (its Frame still
1197         points to the old document, so renderView() returns the RenderView for the Frame's
1198         existing Document).
1199         * page/FrameView.h:
1200         * rendering/RenderBox.cpp:
1201         (WebCore::RenderBox::styleDidChange): Have the compositor check to see if it needs
1202         to do an update.
1203         * rendering/RenderLayerCompositor.cpp:
1204         (WebCore::RenderLayerCompositor::rootBackgroundTransparencyChanged): If the result
1205         of documentBackgroundColor() changed in alpha since the last time, trigger a compositing
1206         update.
1207         * rendering/RenderLayerCompositor.h:
1208         * testing/Internals.cpp:
1209         (WebCore::Internals::setViewBaseBackgroundColor):
1210         * testing/Internals.h:
1211         * testing/Internals.idl:
1212
1213 2015-05-04  Jer Noble  <jer.noble@apple.com>
1214
1215         [iOS] Crash in -[WebCALayerHostWrapper resolveBounds]
1216         https://bugs.webkit.org/show_bug.cgi?id=144595
1217
1218         Reviewed by Eric Carlson.
1219
1220         It is possible for a WebCALayorHostWrapper to outlive the WebVideoFullscreenModel to which it refers,
1221         since the model pointer is bare, rather than a RefPtr. The reference to the model must be invalidated
1222         before the model is destroyed.
1223
1224         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1225         (WebVideoFullscreenInterfaceAVKit::cleanupFullscreenInternal):
1226
1227 2015-05-04  Ryosuke Niwa  <rniwa@webkit.org>
1228
1229         Toggling underline or strike through affects each other
1230         https://bugs.webkit.org/show_bug.cgi?id=27818
1231
1232         Reviewed by Darin Adler.
1233
1234         This patch introduces a new mechanism to apply and remove text decorations. This is necessary because text
1235         decorations are always additive and we can't differentiate whether we're adding or removing a text decoration.
1236         Conceptually, we need four values for text decorations: adding underline, removing underline, adding
1237         line-through, and removing line-through but we have only three: underline, line-through, none.
1238
1239         After this patch, there are three mechanism by which text decorations states are kept tracked. While applying
1240         or removing text decorations, we use newly added m_underlineChange and m_strikeThroughChange in EditingStyle.
1241         For the typing style, we use -webkit-text-decorations-in-effect to store the state since we need to preserve
1242         every type of text decorations such as overline in addition to underline and line-through. Once applied, all
1243         text decorations should be expressed in terms of the standard text-decoration property.
1244
1245         Test: editing/execCommand/toggle-mixed-text-decorations.html
1246
1247         * editing/ApplyStyleCommand.cpp:
1248         (WebCore::ApplyStyleCommand::applyBlockStyle):
1249         (WebCore::ApplyStyleCommand::removeCSSStyle): conflictsWithInlineStyleOfElement now creates a new inline style
1250         instead of a list of properties to remove.
1251         (WebCore::ApplyStyleCommand::addBlockStyle):
1252         (WebCore::ApplyStyleCommand::applyInlineStyleChange): Merge inline styles instead of adding as string.
1253         Otherwise it would generate style content attribute with multiple text-decoration properties.
1254
1255         * editing/EditingStyle.cpp:
1256         (WebCore::HTMLElementEquivalent::matches):
1257         (WebCore::HTMLElementEquivalent::propertyExistsInStyle): Takes an EditingStyle instead of StyleProperties.
1258         (WebCore::HTMLElementEquivalent::valueIsPresentInStyle):
1259         (WebCore::HTMLTextDecorationEquivalent::HTMLTextDecorationEquivalent): 
1260         (WebCore::HTMLTextDecorationEquivalent::propertyExistsInStyle): Respect newly added m_strikeThroughChange and
1261         m_underlineChange in EditingStyle.
1262         (WebCore::HTMLTextDecorationEquivalent::valueIsPresentInStyle): Ditto.
1263         (WebCore::HTMLTextDecorationEquivalent::changeInStyle): Added. Retrieves the change enum for the associated
1264         type of text-decoration (underline or strike through).
1265         (WebCore::HTMLAttributeEquivalent::matches):
1266         (WebCore::HTMLAttributeEquivalent::valueIsPresentInStyle):
1267         (WebCore::EditingStyle::EditingStyle): Initialize m_underlineChange and m_strikeThroughChange. Also use the
1268         delegating constructor elsewhere. Also added the missing call to extractFontSizeDelta() in the variant that
1269         takes CSSPropertyID and String, and added a variant that takes CSSPropertyID and CSSValueID.
1270         (WebCore::EditingStyle::isEmpty): Return false when m_underlineChange and m_strikeThroughChange are not "none".
1271         (WebCore::applyTextDecorationChangeToValueList): Added.
1272         (WebCore::EditingStyle::overrideTypingStyleAt): Added. Used by Editor::computeAndSetTypingStyle to set a new
1273         typing style. Resolve m_underlineChange and m_strikeThroughChange into -webkit-text-decorations-in-effect.
1274         (WebCore::EditingStyle::clear): Clear m_underlineChange and m_strikeThroughChange.
1275         (WebCore::EditingStyle::copy): Copy m_underlineChange and m_strikeThroughChange.
1276         (WebCore::textDecorationValueList): Added.
1277         (WebCore::EditingStyle::conflictsWithInlineStyleOfElement): Now takes a pointer to MutableStyleProperties
1278         instead of a vector. This was necessary we can't simply remove text-decoration property in ApplyStyleCommand's
1279         removeCSSStyle as that would result in unrelated text decorations also getting removed. Also added the code
1280         for m_underlineChange and m_strikeThroughChange. Only removing text decoration changes can cause a conflict
1281         since text decorations are always additive.
1282         (WebCore::EditingStyle::conflictsWithImplicitStyleOfElement): Check isEmpty() instead of the nullity of
1283         m_mutableStyle to respect m_underlineChange and m_strikeThroughChange.
1284         (WebCore::EditingStyle::conflictsWithImplicitStyleOfAttributes):
1285         (WebCore::EditingStyle::extractConflictingImplicitStyleOfAttributes):
1286         (WebCore::EditingStyle::styleIsPresentInComputedStyleOfNode): Respect the values of m_underlineChange and
1287         m_strikeThroughChange. Here, the style is considered present if it has text decorations that are being added.
1288         (WebCore::EditingStyle::elementIsStyledSpanOrHTMLEquivalent):
1289         (WebCore::elementMatchesAndPropertyIsNotInInlineStyleDecl): Takes EditingStyle instead of StyleProperties to
1290         respect m_underlineChange and m_strikeThroughChange.
1291         (WebCore::EditingStyle::mergeInlineAndImplicitStyleOfElement):
1292         (WebCore::mergeTextDecorationValues):
1293         (WebCore::EditingStyle::mergeStyle): Make a copy of CSSValueList before modifying it since CSSValueList's are
1294         shared with other immutable StyleProperties.
1295         (WebCore::StyleChange::StyleChange): Set m_applyUnderline, m_applyLineThrough, and m_cssStyle if either
1296         m_underlineChange or m_strikeThroughChange are TextDecorationChange::Add in EditingStyle if the current position
1297         doesn't already have the matching style.
1298         (WebCore::StyleChange::operator==): Moved from the header file. Also added the logic to compare m_cssStyle now
1299         that it's a StyleProperties instead of String.
1300
1301         * editing/EditingStyle.h: Added TextDecorationChange.
1302         (WebCore::EditingStyle::create): Added a variant that takes CSSPropertyID and CSSValueID.
1303         (WebCore::EditingStyle::conflictsWithInlineStyleOfElement):
1304         (WebCore::EditingStyle::setUnderlineChange): Added.
1305         (WebCore::EditingStyle::underlineChange): Added.
1306         (WebCore::EditingStyle::setStrikeThroughChange): Added.
1307         (WebCore::EditingStyle::strikeThroughChange): Added.
1308         (WebCore::StyleChange::cssStyle): Now returns StyleProperties* instead of String so that ApplyStyleCommand's
1309         applyInlineStyleChange could merge inline styles instead of just appending it to the end.
1310         (WebCore::StyleChange::operator==): Moved into the cpp file.
1311
1312         * editing/Editor.cpp:
1313         (WebCore::Editor::applyStyle): Added. This variant takes EditingStyle instead of StyleProperties.
1314         (WebCore::Editor::applyStyleToSelection): Ditto.
1315         (WebCore::Editor::computeAndSetTypingStyle): Added a variant for EditingStyle. Also use overrideTypingStyleAt
1316         to set -webkit-text-decorations-in-effect based on m_underlineChange and m_strikeThroughChange 
1317
1318         * editing/Editor.h:
1319         * editing/EditorCommand.cpp:
1320         (WebCore::applyCommandToFrame):
1321         (WebCore::isStylePresent): Extracted from executeToggleStyle.
1322         (WebCore::executeApplyStyle):
1323         (WebCore::executeToggleStyle):
1324         (WebCore::executeToggleStyleInList): Deleted.
1325         (WebCore::textDecorationChangeForToggling): Added. Used in executeStrikethrough and executeUnderline.
1326         (WebCore::executeStrikethrough):
1327         (WebCore::executeUnderline):
1328
1329 2015-05-04  Eric Carlson  <eric.carlson@apple.com>
1330
1331         [Mac] Fix build breakage caused by API deprecation
1332         https://bugs.webkit.org/show_bug.cgi?id=144593
1333
1334         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
1335         (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker): Suppress warnings.
1336
1337 2015-05-04  Chris Dumez  <cdumez@apple.com>
1338
1339         REGRESSION (r178156): CSS Parser incorrectly rejects valid calc() in padding-right property
1340         https://bugs.webkit.org/show_bug.cgi?id=144584
1341         <rdar://problem/20796829>
1342
1343         Reviewed by Darin Adler.
1344
1345         The CSS parser was rejecting calculated values at parsing time if it
1346         considered the value was negative and the CSS property did not allow
1347         negative values. However, doing so at this point will not always work
1348         because we don't necessarily know the font-size yet (for e.g. for
1349         calc(0.5em - 2px). Also, rejecting negative calculated values is not
1350         the right behavior as the the specification. The specification says
1351         we should clamp:
1352         http://dev.w3.org/csswg/css-values-3/#calc-range
1353
1354         This patch updates validateCalculationUnit() to stop marking the value
1355         as invalid if it is negative. Instead, let the CSSCalcValue's permitted
1356         range clamp the value as needed.
1357
1358         This bug was causing the bottom graphic on aldentrio.com to not be
1359         rendered properly.
1360
1361         Test: fast/css/negative-calc-values.html
1362               fast/css/padding-calc-value.html
1363
1364         * css/CSSParser.cpp:
1365         (WebCore::CSSParser::validateCalculationUnit):
1366
1367 2015-05-04  Eric Carlson  <eric.carlson@apple.com>
1368
1369         [Mac] Show wireless playback placard even when an element has custom controls
1370         https://bugs.webkit.org/show_bug.cgi?id=144548
1371
1372         Reviewed by Brent Fulgham.
1373
1374         * Modules/mediacontrols/mediaControlsApple.js:
1375         (Controller.prototype.shouldHaveAnyUI): Return true when playing to wireless target.
1376         (Controller.prototype.reconnectControls): Add controls when playing to wireless target.
1377         (Controller.prototype.setPlaying): Return early when there is no 'controls' attribute.
1378         (Controller.prototype.showControls): Ditto.
1379         (Controller.prototype.updateWirelessPlaybackStatus): Call updateBase when playing to wireless
1380         target to ensure that controls have been set up.
1381         (Controller.prototype.handleWirelessPlaybackChange): Call reconnectControls when playing
1382         to wireless target when there is no 'controls' attribute.
1383         (Controller.prototype.showInlinePlaybackPlaceholderOnly): New.
1384
1385         * html/HTMLMediaElement.cpp:
1386         (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged): Call configureMediaControls.
1387         (WebCore::HTMLMediaElement::configureMediaControls): Require controls when playing
1388         to wireless target.
1389         (WebCore::HTMLMediaElement::configureTextTrackDisplay): Remove some unhelpful, noisy, logging.
1390
1391 2015-05-04  Dan Bernstein  <mitz@apple.com>
1392
1393         Fixed the build.
1394
1395         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
1396         (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker): Moved off of a deprecated
1397         method to a non-deprecated equivalent.
1398
1399 2015-05-04  Javier Fernandez  <jfernandez@igalia.com>
1400
1401         [CSS Box Alignment] Upgrade justify-content parsing to CSS3 Box Alignment spec.
1402         https://bugs.webkit.org/show_bug.cgi?id=144442
1403
1404         Reviewed by David Hyatt.
1405
1406         Upgrade the justify-content property to the last CSS3 Box
1407         Alignment specification. It defines a different enumeration for
1408         Positional and Distribution alignment, which requires changes in
1409         the FlexibleBox implementation.
1410
1411         A new parsing function has been implemented to replace the basic
1412         keyword IDs validation. Because of the complexity of the new
1413         values, a new CSSPrimitiveValue derived class has been defined
1414         which simplifies considerably the parsing logic.
1415
1416         We will follow the same approach than for Self Alignment, defining
1417         a single class to hold all the related alignment data. This makes
1418         possible to use a StyleBuilderConverter function instead of custom
1419         builder functions for these properties.
1420
1421         Test: css3/parse-justify-content.html
1422
1423         * CMakeLists.txt:
1424         * WebCore.xcodeproj/project.pbxproj:
1425         * css/CSSComputedStyleDeclaration.cpp:
1426         (WebCore::resolveContentAlignmentAuto):
1427         (WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
1428         (WebCore::ComputedStyleExtractor::propertyValue):
1429         (WebCore::valueForItemPositionWithOverflowAlignment): Deleted.
1430         * css/CSSContentDistributionValue.cpp: Added.
1431         (WebCore::CSSContentDistributionValue::CSSContentDistributionValue):
1432         (WebCore::CSSContentDistributionValue::~CSSContentDistributionValue):
1433         (WebCore::CSSContentDistributionValue::customCSSText):
1434         (WebCore::CSSContentDistributionValue::equals):
1435         * css/CSSContentDistributionValue.h: Added.
1436         (WebCore::CSSContentDistributionValue::create):
1437         (WebCore::CSSContentDistributionValue::distribution):
1438         (WebCore::CSSContentDistributionValue::position):
1439         (WebCore::CSSContentDistributionValue::overflow):
1440         * css/CSSParser.cpp:
1441         (WebCore::isValidKeywordPropertyAndValue):
1442         (WebCore::isKeywordPropertyID):
1443         (WebCore::CSSParser::parseValue):
1444         (WebCore::isContentDistributionKeyword):
1445         (WebCore::isContentPositionKeyword):
1446         (WebCore::isAlignmentOverflowKeyword):
1447         (WebCore::CSSParser::parseContentDistributionOverflowPosition):
1448         (WebCore::CSSParser::parseItemPositionOverflowPosition):
1449         (WebCore::CSSParser::parseLegacyPosition): Deleted.
1450         * css/CSSParser.h:
1451         * css/CSSPrimitiveValueMappings.h:
1452         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1453         (WebCore::CSSPrimitiveValue::operator ContentPosition):
1454         (WebCore::CSSPrimitiveValue::operator ContentDistributionType):
1455         (WebCore::CSSPrimitiveValue::operator EFlexDirection): Deleted.
1456         * css/CSSPropertyNames.in:
1457         * css/CSSValue.cpp:
1458         (WebCore::CSSValue::equals):
1459         (WebCore::CSSValue::cssText):
1460         (WebCore::CSSValue::destroy):
1461         * css/CSSValue.h:
1462         (WebCore::CSSValue::isContentDistributionValue):
1463         (WebCore::CSSValue::isWebKitCSSFilterValue): Deleted.
1464         * css/CSSValueKeywords.in:
1465         * css/StyleBuilderConverter.h:
1466         (WebCore::StyleBuilderConverter::convertContentAlignmentData):
1467         (WebCore::StyleBuilderConverter::convertSelfOrDefaultAlignmentData): Deleted.
1468         * rendering/RenderFlexibleBox.cpp:
1469         (WebCore::initialJustifyContentOffset):
1470         (WebCore::justifyContentSpaceBetweenChildren):
1471         (WebCore::RenderFlexibleBox::layoutAndPlaceChildren):
1472         (WebCore::RenderFlexibleBox::layoutColumnReverse):
1473         * rendering/RenderFullScreen.cpp:
1474         (WebCore::createFullScreenStyle):
1475         * rendering/mathml/RenderMathMLScripts.cpp:
1476         (WebCore::RenderMathMLScripts::fixAnonymousStyleForSubSupPair):
1477         (WebCore::RenderMathMLScripts::fixAnonymousStyles):
1478         * rendering/style/RenderStyle.h:
1479         * rendering/style/RenderStyleConstants.h:
1480         * rendering/style/StyleContentAlignmentData.h: Added.
1481         (WebCore::StyleContentAlignmentData::StyleContentAlignmentData):
1482         (WebCore::StyleContentAlignmentData::setPosition):
1483         (WebCore::StyleContentAlignmentData::setDistribution):
1484         (WebCore::StyleContentAlignmentData::setOverflow):
1485         (WebCore::StyleContentAlignmentData::position):
1486         (WebCore::StyleContentAlignmentData::distribution):
1487         (WebCore::StyleContentAlignmentData::overflow):
1488         (WebCore::StyleContentAlignmentData::operator==):
1489         (WebCore::StyleContentAlignmentData::operator!=):
1490         * rendering/style/StyleRareNonInheritedData.cpp:
1491         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
1492         (WebCore::StyleRareNonInheritedData::operator==):
1493         * rendering/style/StyleRareNonInheritedData.h:
1494
1495 2015-05-04  Per Arne Vollan  <peavo@outlook.com>
1496
1497         [WinCairo] Compile error in sharedEGLDisplay() method.
1498         https://bugs.webkit.org/show_bug.cgi?id=144563
1499
1500         Reviewed by Alex Christensen.
1501
1502         The PlatformDisplay type is undefined.
1503
1504         * platform/graphics/egl/GLContextEGL.cpp:
1505         (WebCore::sharedEGLDisplay):
1506
1507 2015-05-04  Zan Dobersek  <zdobersek@igalia.com>
1508
1509         [WTF] Remove Functional.h inclusions
1510         https://bugs.webkit.org/show_bug.cgi?id=144400
1511
1512         Reviewed by Darin Adler.
1513
1514         Remove unnecessary inclusions of the <wtf/Functional.h> header in WebCore.
1515
1516         * Modules/mediastream/MediaStreamTrack.cpp:
1517         * Modules/mediastream/MediaStreamTrackSourcesRequest.cpp:
1518         * Modules/mediastream/UserMediaRequest.cpp:
1519         * page/scrolling/ScrollingTree.h:
1520         * page/scrolling/ios/ScrollingCoordinatorIOS.mm:
1521         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
1522         * platform/MemoryPressureHandler.cpp:
1523         * platform/UserActivity.h: Include the <objc/objc.h> header that was previously
1524         indirectly included through Functional.h.
1525         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
1526         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1527         * platform/mac/SoftLinking.h: Unconditionally include the <objc/runtime.h> header
1528         that was previously included for the Mac port through Functional.h.
1529
1530 2015-05-04  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
1531
1532         [Streams API] Refactor ReadableJSStream and ReadableStreamJSSource
1533         https://bugs.webkit.org/show_bug.cgi?id=144387
1534
1535         Reviewed by Darin Adler.
1536
1537         Made ReadableStreamReader a private class of ReadableJSStream.
1538         Simplified ReadableJSStream construction so that binding constructor does not need to know about ReadableStreamJSSource. 
1539
1540         No functional change, existing tests cover the changes.
1541
1542         * Modules/streams/ReadableStream.h:
1543         (WebCore::ReadableStream::source): Added to implement jsSource(), needed by ReadableJSStream.
1544         * bindings/js/JSReadableStreamCustom.cpp:
1545         (WebCore::constructJSReadableStream): Simplified to not have to handle source creation.
1546         * bindings/js/ReadableStreamJSSource.cpp:
1547         (WebCore::ReadableStreamJSSource::globalObject): Helper function to be used in other future methods.
1548         (WebCore::ReadableStreamJSSource::start):
1549         (WebCore::ReadableJSStream::create):
1550         (WebCore::ReadableJSStream::createReader):
1551         (WebCore::ReadableJSStream::jsSource):
1552         (WebCore::ReadableJSStream::Reader::create):
1553         (WebCore::ReadableJSStream::Reader::Reader):
1554         * bindings/js/ReadableStreamJSSource.h:
1555
1556 2015-05-04  Csaba Osztrogonác  <ossy@webkit.org>
1557
1558         Remove move-js-headers.sh
1559         https://bugs.webkit.org/show_bug.cgi?id=144323
1560
1561         Reviewed by Daniel Bates.
1562
1563         move-js-headers.sh was only used by the Wx port, which has been removed from trunk long ago.
1564
1565         * move-js-headers.sh: Removed.
1566
1567 2015-05-04  Csaba Osztrogonác  <ossy@webkit.org>
1568
1569         [ARM] Don't compare unsigned chars to EOF (-1)
1570         https://bugs.webkit.org/show_bug.cgi?id=144439
1571
1572         Reviewed by Geoffrey Garen.
1573
1574         * platform/linux/MemoryPressureHandlerLinux.cpp:
1575         (WebKit::nextToken): Don't cast return value of fgetc() to char.
1576
1577 2015-05-04  Manuel Rego Casasnovas  <rego@igalia.com>
1578
1579         [CSS Grid Layout] Wrong computed style for named grid lines in implicit tracks
1580         https://bugs.webkit.org/show_bug.cgi?id=144449
1581
1582         Reviewed by Sergio Villar Senin.
1583
1584         If there're implicit tracks then trackPositions is bigger than
1585         trackSizes, so we need to use the proper index to append the trailing
1586         <ident>s in valueForGridTrackList().
1587
1588         Test: fast/css-grid-layout/named-grid-lines-computed-style-implicit-tracks.html
1589
1590         * css/CSSComputedStyleDeclaration.cpp:
1591         (WebCore::valueForGridTrackList):
1592
1593 2015-05-03  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1594
1595         Purge PassRefPtr in WebCore/html
1596         https://bugs.webkit.org/show_bug.cgi?id=144543
1597
1598         Reviewed by Andreas Kling.
1599
1600         Change PassRefPtr in create() factory functions with Ref. In some functions,
1601         it returns RefPtr when it might have a chance to return nullptr.
1602
1603         No new tests, no behavior changes.
1604
1605         * Modules/encryptedmedia/MediaKeySession.cpp:
1606         (WebCore::MediaKeySession::sendError):
1607         * html/DOMFormData.h:
1608         (WebCore::DOMFormData::create):
1609         * html/HTMLMediaElement.cpp:
1610         (WebCore::HTMLMediaElement::mediaPlayerCreateResourceLoader):
1611         * html/HTMLMediaElement.h:
1612         * html/MediaError.h:
1613         (WebCore::MediaError::create):
1614         * html/MediaKeyError.h:
1615         (WebCore::MediaKeyError::create):
1616         * html/canvas/CanvasGradient.h:
1617         * html/canvas/CanvasProxy.cpp:
1618         (WebCore::CanvasProxy::create):
1619         * html/canvas/CanvasProxy.h:
1620         * html/canvas/WebGLActiveInfo.h:
1621         (WebCore::WebGLActiveInfo::create):
1622         * html/canvas/WebGLContextAttributes.h:
1623         * html/canvas/WebGLContextGroup.h:
1624         * html/canvas/WebGLProgram.h:
1625         * html/canvas/WebGLQuery.h:
1626         * html/canvas/WebGLRenderbuffer.h:
1627         * html/canvas/WebGLSampler.h:
1628         * html/canvas/WebGLShader.h:
1629         * html/canvas/WebGLShaderPrecisionFormat.h:
1630         * html/canvas/WebGLSync.h:
1631         * html/canvas/WebGLTexture.h:
1632         * html/canvas/WebGLTransformFeedback.h:
1633         * html/canvas/WebGLUniformLocation.h:
1634         * html/canvas/WebGLVertexArrayObjectOES.h:
1635         * html/shadow/ImageControlsRootElement.cpp:
1636         (WebCore::ImageControlsRootElement::maybeCreate):
1637         * html/shadow/ImageControlsRootElement.h:
1638         * html/shadow/MediaControlElements.cpp:
1639         (WebCore::MediaControlPanelElement::create):
1640         (WebCore::MediaControlPanelEnclosureElement::create):
1641         (WebCore::MediaControlOverlayEnclosureElement::create):
1642         (WebCore::MediaControlTimelineContainerElement::create):
1643         (WebCore::MediaControlVolumeSliderContainerElement::create):
1644         (WebCore::MediaControlStatusDisplayElement::create):
1645         (WebCore::MediaControlPanelMuteButtonElement::create):
1646         (WebCore::MediaControlVolumeSliderMuteButtonElement::create):
1647         (WebCore::MediaControlPlayButtonElement::create):
1648         (WebCore::MediaControlOverlayPlayButtonElement::create):
1649         (WebCore::MediaControlSeekForwardButtonElement::create):
1650         (WebCore::MediaControlSeekBackButtonElement::create):
1651         (WebCore::MediaControlRewindButtonElement::create):
1652         (WebCore::MediaControlReturnToRealtimeButtonElement::create):
1653         (WebCore::MediaControlToggleClosedCaptionsButtonElement::create):
1654         (WebCore::MediaControlClosedCaptionsContainerElement::create):
1655         (WebCore::MediaControlClosedCaptionsTrackListElement::create):
1656         (WebCore::MediaControlTimelineElement::create):
1657         (WebCore::MediaControlPanelVolumeSliderElement::create):
1658         (WebCore::MediaControlFullscreenVolumeSliderElement::create):
1659         (WebCore::MediaControlFullscreenButtonElement::create):
1660         (WebCore::MediaControlFullscreenVolumeMinButtonElement::create):
1661         (WebCore::MediaControlFullscreenVolumeMaxButtonElement::create):
1662         (WebCore::MediaControlTimeRemainingDisplayElement::create):
1663         (WebCore::MediaControlCurrentTimeDisplayElement::create):
1664         * html/shadow/MediaControlElements.h:
1665         * html/shadow/MediaControlsApple.h:
1666         (WebCore::MediaControlsAppleEventListener::create):
1667         * html/shadow/MeterShadowElement.h:
1668         (WebCore::MeterInnerElement::create):
1669         (WebCore::MeterBarElement::create):
1670         (WebCore::MeterValueElement::create):
1671         * html/shadow/ProgressShadowElement.h:
1672         (WebCore::ProgressInnerElement::create):
1673         (WebCore::ProgressBarElement::create):
1674         (WebCore::ProgressValueElement::create):
1675         * html/shadow/mac/ImageControlsRootElementMac.cpp:
1676         (WebCore::ImageControlsRootElement::maybeCreate):
1677         * html/track/TextTrackCueList.h:
1678         (WebCore::TextTrackCueList::create):
1679         * html/track/VTTCue.cpp:
1680         (WebCore::VTTCue::create):
1681         * html/track/VTTCue.h:
1682         (WebCore::VTTCue::create):
1683         * html/track/VTTRegion.h:
1684         * html/track/VideoTrack.h:
1685         * html/track/VideoTrackList.h:
1686         * html/track/WebVTTElement.cpp:
1687         (WebCore::WebVTTElement::create):
1688         * html/track/WebVTTElement.h:
1689         * html/track/WebVTTParser.h:
1690         * platform/graphics/MediaPlayer.h:
1691         (WebCore::MediaPlayerClient::mediaPlayerCreateResourceLoader):
1692
1693 2015-05-03  Simon Fraser  <simon.fraser@apple.com>
1694
1695         Make some static data const
1696         https://bugs.webkit.org/show_bug.cgi?id=144552
1697
1698         Reviewed by Andreas Kling.
1699
1700         Turn baseTable and shiftTable into const data.
1701
1702         * platform/graphics/FormatConverter.cpp:
1703
1704 2015-05-02  Simon Fraser  <simon.fraser@apple.com>
1705
1706         Assertion failure (!needsLayout()) loading inkedmag.com
1707         https://bugs.webkit.org/show_bug.cgi?id=144528
1708         rdar://problem/20788681
1709
1710         Reviewed by Darin Adler.
1711         
1712         When animated GIFs get into catch-up mode, which is common on inkedmag.com,
1713         BitmapImage::advanceAnimation() can synchronously call it's observer's
1714         animationAdvanced(). This could cause RenderImage::repaintOrMarkForLayout()
1715         to repaint or mark itself as needing layout in the middle of painting.
1716         If painting multiple tiles, this could occur when painting the first tile,
1717         and then painting the second tile would assert in RenderView::paint().
1718         
1719         It's always wrong to synchronously call the observer when advancing
1720         the animation, since this happens when painting, and you can't repaint
1721         when painting. The long comment and call to startAnimation(DoNotCatchUp)
1722         was required to explain and work around this, but it's simpler to just
1723         advance the animation on a zero-delay timer.
1724         
1725         Special handling is required for the case where internalAdvanceAnimation()
1726         is catching up, and reaches the end of a non-repeating image; there, we
1727         have to set a flag and do the notify on a zero-delay timer.
1728         
1729         Lots of comment cleanup.
1730
1731         Test: fast/images/set-needs-layout-in-painting.html
1732
1733         * platform/graphics/BitmapImage.cpp:
1734         (WebCore::BitmapImage::BitmapImage):
1735         (WebCore::BitmapImage::startTimer): Utility to create and start the timer.
1736         (WebCore::BitmapImage::repetitionCount):
1737         (WebCore::BitmapImage::startAnimation): Early return in the DoNotCatchUp clause.
1738         If skipping, and internalAdvanceAnimation() returns false (meaning it must have
1739         reached the end), then queue up a notify. Change the normal behavior to just
1740         start the timer.
1741         (WebCore::BitmapImage::stopAnimation):
1742         (WebCore::BitmapImage::internalAdvanceAnimation): Notify if the flag is set.
1743         * platform/graphics/BitmapImage.h:
1744         * rendering/RenderReplaced.cpp:
1745         (WebCore::RenderReplaced::paint): Add a SetLayoutNeededForbiddenScope to
1746         detect setNeedsLayouts when painting replaced elements, including images.
1747
1748 2015-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1749
1750         [GTK][EFL] Unify platform display handling
1751         https://bugs.webkit.org/show_bug.cgi?id=144517
1752
1753         Reviewed by Martin Robinson.
1754
1755         There are several places were we are handling the X display
1756         connection:
1757
1758         - GLContext::sharedX11Display() creates a new connection.
1759         - X11Helper::nativeDisplay() creates a new connection.
1760         - BackingStoreBackendCairoX11 uses the GTK+ shared connection.
1761         - NetscapePlugin::x11HostDisplay() uses the GTK+/ecore shared connection
1762         - The rest of the GTK+ code uses the shared GTK+ connection
1763
1764         And then we also have WaylandDisplay and the code to check if the
1765         current display is wayland or X11.
1766         We could unify all these to share the same connection to reduce
1767         the amount of ifdefs and ensure a single connection. That will
1768         also allow us to use "smart pointers" for the X resources that
1769         need a Display* to be freed.
1770
1771         * PlatformEfl.cmake: Add new files to compilation.
1772         * PlatformGTK.cmake: Move some files to WebCore_SOURCES sinc ethey
1773         don't use GTK+ anymore, and add new files to compilation.
1774         * platform/graphics/GLContext.cpp:
1775         (WebCore::GLContext::cleanupActiveContextsAtExit): Remove the
1776         custom X11 connection.
1777         (WebCore::GLContext::createContextForWindow): Check if the shared
1778         display is Wayland to create a EGL context in such case.
1779         * platform/graphics/PlatformDisplay.cpp: Added.
1780         (WebCore::PlatformDisplay::createPlatformDisplay): Creates the
1781         shared display, using the GTK+/ecore shared connection.
1782         (WebCore::PlatformDisplay::sharedDisplay): Return the shared display.
1783         * platform/graphics/PlatformDisplay.h: Added.
1784         * platform/graphics/egl/GLContextEGL.cpp:
1785         (WebCore::sharedEGLDisplay): Use PlatformDisplay::sharedDisplay()
1786         to get the native display.
1787         (WebCore::GLContextEGL::createPixmapContext): Ditto.
1788         * platform/graphics/glx/GLContextGLX.cpp:
1789         (WebCore::GLContextGLX::createWindowContext): Ditto.
1790         (WebCore::GLContextGLX::createPbufferContext): Ditto.
1791         (WebCore::GLContextGLX::createPixmapContext): Ditto.
1792         (WebCore::GLContextGLX::createContext): Ditto.
1793         (WebCore::GLContextGLX::~GLContextGLX): Ditto.
1794         (WebCore::GLContextGLX::defaultFrameBufferSize): Ditto.
1795         (WebCore::GLContextGLX::makeContextCurrent): Ditto.
1796         (WebCore::GLContextGLX::swapBuffers): Ditto.
1797         (WebCore::GLContextGLX::cairoDevice): Ditto.
1798         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1799         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext): Ditto.
1800         * platform/graphics/surfaces/glx/X11Helper.cpp:
1801         (WebCore::X11Helper::nativeDisplay): Ditto.
1802         * platform/graphics/wayland/PlatformDisplayWayland.cpp: Renamed from Source/WebCore/platform/graphics/wayland/WaylandDisplay.cpp.
1803         (WebCore::PlatformDisplayWayland::globalCallback):
1804         (WebCore::PlatformDisplayWayland::globalRemoveCallback):
1805         (WebCore::PlatformDisplayWayland::create): Renamed instance() as
1806         create() since the single instance is now handled by PlatformDisplay.
1807         (WebCore::PlatformDisplayWayland::PlatformDisplayWayland):
1808         (WebCore::PlatformDisplayWayland::createSurface):
1809         (WebCore::PlatformDisplayWayland::createSharingGLContext):
1810         * platform/graphics/wayland/PlatformDisplayWayland.h: Renamed from Source/WebCore/platform/graphics/wayland/WaylandDisplay.h.
1811         * platform/graphics/x11/PlatformDisplayX11.cpp: Added.
1812         (WebCore::PlatformDisplayX11::PlatformDisplayX11):
1813         (WebCore::PlatformDisplayX11::~PlatformDisplayX11):
1814         * platform/graphics/x11/PlatformDisplayX11.h: Added.
1815         * platform/gtk/GtkUtilities.cpp:
1816         (WebCore::getDisplaySystemType): Deleted.
1817         * platform/gtk/GtkUtilities.h:
1818
1819 2015-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1820
1821         [GTK] API tests crashing on debug builds due to extra unref
1822         https://bugs.webkit.org/show_bug.cgi?id=144508
1823
1824         Reviewed by Mario Sanchez Prada.
1825
1826         The problem is that we were assuming that when a new DOMWindow is
1827         created, the DOM object cache was notified about the previous
1828         DOMWindow being destroyed before objects for the new DOMWindow are
1829         added to the cache. However, that's not always the case and we
1830         only create a DOMWindowObserver for the first DOMWindow. We need
1831         to keep a pointer to the DOMWindow being observed to clear() the
1832         cache and create a new DOMWindowObserver when it changes in the
1833         Frame.
1834
1835         Fixes crashes in several unit tests in debug builds.
1836
1837         * bindings/gobject/DOMObjectCache.cpp:
1838
1839 2015-05-03  Alexey Proskuryakov  <ap@apple.com>
1840
1841         Remove timer alignment logging that I added earler today.
1842
1843         * page/Settings.cpp: (WebCore::Settings::setDOMTimerAlignmentInterval):
1844
1845 2015-05-02  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1846
1847         Purge PassRefPtr create() factory functions in html 
1848         https://bugs.webkit.org/show_bug.cgi?id=144522
1849
1850         Reviewed by Darin Adler.
1851
1852         Return Ref instead of PassRefPtr in create() factory functions in html, because the factory
1853         can't return null. This patch is a first step to purge in html. Following patch is going to
1854         be uploaded.
1855
1856         No new tests, no behavior changes.
1857
1858         * html/FileInputType.cpp:
1859         (WebCore::UploadButtonElement::create):
1860         (WebCore::UploadButtonElement::createForMultiple):
1861         * html/MediaController.cpp:
1862         (MediaController::create):
1863         * html/MediaController.h:
1864         * html/canvas/WebGLBuffer.cpp:
1865         (WebCore::WebGLBuffer::create):
1866         * html/canvas/WebGLBuffer.h:
1867         * html/canvas/WebGLContextAttributes.cpp:
1868         (WebCore::WebGLContextAttributes::create):
1869         * html/canvas/WebGLContextAttributes.h:
1870         * html/canvas/WebGLContextGroup.cpp:
1871         (WebCore::WebGLContextGroup::create):
1872         * html/canvas/WebGLContextGroup.h:
1873         * html/canvas/WebGLFramebuffer.cpp:
1874         (WebCore::WebGLFramebuffer::create):
1875         * html/canvas/WebGLFramebuffer.h:
1876         * html/canvas/WebGLProgram.cpp:
1877         (WebCore::WebGLProgram::create):
1878         * html/canvas/WebGLProgram.h:
1879         * html/canvas/WebGLQuery.cpp:
1880         (WebCore::WebGLQuery::create):
1881         * html/canvas/WebGLQuery.h:
1882         * html/canvas/WebGLRenderbuffer.cpp:
1883         (WebCore::WebGLRenderbuffer::create):
1884         * html/canvas/WebGLRenderbuffer.h:
1885         * html/canvas/WebGLSampler.cpp:
1886         (WebCore::WebGLSampler::create):
1887         * html/canvas/WebGLSampler.h:
1888         * html/canvas/WebGLShader.cpp:
1889         (WebCore::WebGLShader::create):
1890         * html/canvas/WebGLShader.h:
1891         * html/canvas/WebGLShaderPrecisionFormat.cpp:
1892         (WebCore::WebGLShaderPrecisionFormat::create):
1893         * html/canvas/WebGLShaderPrecisionFormat.h:
1894         * html/canvas/WebGLSync.cpp:
1895         (WebCore::WebGLSync::create):
1896         * html/canvas/WebGLSync.h:
1897         * html/canvas/WebGLTexture.cpp:
1898         (WebCore::WebGLTexture::create):
1899         * html/canvas/WebGLTexture.h:
1900         * html/canvas/WebGLTransformFeedback.cpp:
1901         (WebCore::WebGLTransformFeedback::create):
1902         * html/canvas/WebGLTransformFeedback.h:
1903         * html/canvas/WebGLUniformLocation.cpp:
1904         (WebCore::WebGLUniformLocation::create):
1905         * html/canvas/WebGLUniformLocation.h:
1906         * html/canvas/WebGLVertexArrayObject.cpp:
1907         (WebCore::WebGLVertexArrayObject::create):
1908         * html/canvas/WebGLVertexArrayObject.h:
1909         * html/canvas/WebGLVertexArrayObjectOES.cpp:
1910         (WebCore::WebGLVertexArrayObjectOES::create):
1911         * html/canvas/WebGLVertexArrayObjectOES.h:
1912
1913 2015-05-02  Andreas Kling  <akling@apple.com>
1914
1915         Style recalc always causes detach from shared StyleRareNonInheritedData.
1916         <https://webkit.org/b/144530>
1917
1918         Reviewed by Darin Adler.
1919
1920         StyleResolver::adjustStyleForMaskImages() was always calling RenderStyle::ensureMaskLayers()
1921         when we were in style recalc. This caused the RenderStyle to COW off from the previously
1922         shared StyleRareNonInheritedData even if nothing actually changes.
1923
1924         This patch adds an early return to adjustStyleForMaskImages() when the previous style had
1925         no mask images. Further refinements could be made, but this covers the most common case where
1926         we don't have any mask images at all.
1927
1928         * css/StyleResolver.cpp:
1929         (WebCore::StyleResolver::adjustStyleForMaskImages):
1930
1931 2015-05-02  Alexey Proskuryakov  <ap@apple.com>
1932
1933         fast/frames/flattening/iframe-flattening-resize-event-count.html times out on Yosemite WK2
1934         https://bugs.webkit.org/show_bug.cgi?id=144155
1935
1936         Unreviewed, will roll out soon.
1937
1938         Added some temporary logging to better see if alignment is indeed the culprit.
1939
1940         * page/Settings.cpp: (WebCore::Settings::setDOMTimerAlignmentInterval):
1941
1942 2015-05-02  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1943
1944         Use Ref instead of PassRefPtr in WebCore/svg 
1945         https://bugs.webkit.org/show_bug.cgi?id=144479
1946
1947         Reviewed by Darin Adler.
1948
1949         Remove remained PassRefPtr in svg.
1950
1951         No new tests, no behavior changes.
1952
1953         * svg/SVGFontFaceSrcElement.cpp:
1954         (WebCore::SVGFontFaceSrcElement::srcValue):
1955         * svg/SVGFontFaceSrcElement.h:
1956         * svg/properties/SVGPropertyInfo.h:
1957
1958 2015-05-02  Simon Fraser  <simon.fraser@apple.com>
1959
1960         Small cleanup in BitmapImage
1961         https://bugs.webkit.org/show_bug.cgi?id=144515
1962
1963         Reviewed by Darin Adler.
1964
1965         Use an enum for the internalAdvanceAnimation() argument, with a default.
1966         
1967         Wrap the clearing of the timer in a clearTimer() function, called from
1968         stopAnimation(). This fixes the jarring reading of BitmapImage::internalAdvanceAnimation(),
1969         which used to start by calling stopAnimation().
1970
1971         * platform/graphics/BitmapImage.cpp:
1972         (WebCore::BitmapImage::clearTimer):
1973         (WebCore::BitmapImage::startAnimation):
1974         (WebCore::BitmapImage::stopAnimation):
1975         (WebCore::BitmapImage::advanceAnimation):
1976         (WebCore::BitmapImage::internalAdvanceAnimation):
1977         * platform/graphics/BitmapImage.h:
1978         * platform/graphics/Image.h:
1979
1980 2015-05-01  Simon Fraser  <simon.fraser@apple.com>
1981
1982         Avoid compositing updates after style recalcs which have no compositing implications
1983         https://bugs.webkit.org/show_bug.cgi?id=144502
1984
1985         Reviewed by Darin Adler.
1986         
1987         After r183461, we have reliable information about whether a style change with zero
1988         diff can be reliably ignored. Use that information to track whether a given
1989         recalcStyle() does anything which should force a compositing update.
1990         
1991         This eliminates up to 40% of the post-recalcStyle compositing updates on some pages.
1992         
1993         Add Internals API to test.
1994
1995         Test: compositing/updates/no-style-change-updates.html
1996
1997         * dom/Document.cpp:
1998         (WebCore::Document::recalcStyle): Tell the FrameView we're going to recalc style.
1999         * page/FrameView.cpp:
2000         (WebCore::FrameView::willRecalcStyle): Pass it on to the compositor.
2001         (WebCore::FrameView::updateCompositingLayersAfterStyleChange): Move the code
2002         that was here into RenderLayerCompositor::didRecalcStyleWithNoPendingLayout().
2003         * page/FrameView.h:
2004         * rendering/RenderLayerCompositor.cpp:
2005         (WebCore::RenderLayerCompositor::willRecalcStyle): Reset the m_layerNeedsCompositingUpdate flag.
2006         (WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout): Bail on the update if
2007         no layers changed.
2008         (WebCore::RenderLayerCompositor::updateCompositingLayers): Logging. Increment m_compositingUpdateCount,
2009         which is used for testing.
2010         (WebCore::RenderLayerCompositor::layerStyleChanged): Set the m_layerNeedsCompositingUpdate flag.
2011         (WebCore::RenderLayerCompositor::startTrackingCompositingUpdates): Reset the counter.
2012         (WebCore::RenderLayerCompositor::compositingUpdateCount):
2013         * rendering/RenderLayerCompositor.h:
2014         * testing/Internals.cpp:
2015         (WebCore::Internals::startTrackingCompositingUpdates):
2016         (WebCore::Internals::compositingUpdateCount):
2017         * testing/Internals.h:
2018         * testing/Internals.idl:
2019
2020 2015-05-01  Andreas Kling  <akling@apple.com>
2021
2022         Reproducible crash removing name attribute from <img> node
2023         <https://webkit.org/b/144371>
2024         <rdar://problem/17198583>
2025
2026         Reviewed by Darin Adler.
2027
2028         The problem here was with HTMLImageElement::getNameAttribute(), which relies
2029         on Element::hasName() to avoid slow attribute lookups when the attribute
2030         is already known not to be present. Unfortunately hasName() uses an ElementData
2031         flag that wasn't getting updated until after the call to parseAttribute().
2032
2033         This patch fixes the issue by moving the code that updates the hasName() flag
2034         before the parseAttribute() virtual dispatch.
2035
2036         Test: fast/dom/HTMLImageElement/remove-name-id-attribute-from-image.html
2037
2038         * dom/Element.cpp:
2039         (WebCore::Element::attributeChanged):
2040
2041 2015-05-01  Eric Carlson  <eric.carlson@apple.com>
2042
2043         Postpone caption style sheet creation
2044         https://bugs.webkit.org/show_bug.cgi?id=144499
2045
2046         Reviewed by Simon Fraser.
2047         
2048         Generating and inserting the caption user style sheet is expensive so don't do it until
2049         we see a text track, and only do it for the first video element in a PageGroup.
2050
2051         Test: media/track/track-user-stylesheet.html
2052
2053         * html/HTMLMediaElement.cpp:
2054         (WebCore::HTMLMediaElement::registerWithDocument): Only register for caption preferences
2055         changes if we have done so before.
2056         (WebCore::HTMLMediaElement::unregisterWithDocument): Only unregister for caption preferences
2057         changes if we registered for them.
2058         (WebCore::HTMLMediaElement::addTextTrack): Register for caption preference changes.
2059         * html/HTMLMediaElement.h:
2060
2061         * page/CaptionUserPreferencesMediaAF.cpp:
2062         (WebCore::CaptionUserPreferencesMediaAF::setInterestedInCaptionPreferenceChanges): Only
2063         generate the style sheet when called for the first time.
2064
2065 2015-05-01  Dean Jackson  <dino@apple.com>
2066
2067         [iOS] Scrubber display is broken if the buffered range is empty
2068         https://bugs.webkit.org/show_bug.cgi?id=144511
2069
2070         Reviewed by Eric Carlson.
2071
2072         Make sure that if video.buffered returns an empty list, we
2073         still draw the scrubber background correctly.
2074
2075         * Modules/mediacontrols/mediaControlsiOS.js:
2076         (ControllerIOS.prototype.drawTimelineBackground): Ensure that buffered
2077         is always at least as big as the current time.
2078
2079 2015-05-01  Roger Fong  <roger_fong@apple.com>
2080
2081         Media control volume slider should be vertical to avoid flickering issues.
2082         https://bugs.webkit.org/show_bug.cgi?id=144496.
2083         <rdar://problem/20451328>
2084
2085         Reviewed by Darin Adler.
2086
2087         * Modules/mediacontrols/mediaControlsApple.css:
2088         Resize and reposition the volume box so that it does not have to rotated via a transform.
2089         (audio::-webkit-media-controls-panel):
2090         (audio::-webkit-media-controls-panel .volume-box): Also set overflow: hidden so we can't interact
2091              with the volume slider while the volume box is hidden.
2092         (audio::-webkit-media-controls-panel .volume-box:active):
2093         Rotate and position the volume slider via transforms. Make sure it's not transformed in the fullscreen controls.
2094         (video::-webkit-media-controls-volume-slider):
2095         (video:-webkit-full-screen::-webkit-media-controls-volume-slider):
2096
2097 2015-05-01  Brent Fulgham  <bfulgham@apple.com>
2098
2099         Expand test infrastructure to support scrolling tests (Part 4): Scroll Snap Support
2100         https://bugs.webkit.org/show_bug.cgi?id=144482
2101
2102         Reviewed by Simon Fraser.
2103
2104         New tests will be landed in a second patch.
2105
2106         The new WheelEventTestTriggers do not work properly with scroll snap points, because some test deferral notifications
2107         need to be triggered for state changes on the scrolling thread. This required the following changes:
2108         1. A flag indicating that we want to know about WheelEvent state changes needed to be propagated to the scrolling thread,
2109            so that tests could be deferred until Scrolling thread rubberband or scroll-snap animations had completed.
2110         2. The ScrollingNodeID needed to be used for registering and clearing deferrals.
2111         3. The scrolling thread needed a way to dispatch messages to the main thread indicating that we should (or should not)
2112            defer tests due to scrolling actions.
2113
2114         Note that a future patch will extend this support to include the RemoteScrollingTree.
2115
2116         * page/WheelEventTestTrigger.cpp:
2117         (WebCore::WheelEventTestTrigger::deferTestsForReason): Added some logging features.
2118         (WebCore::WheelEventTestTrigger::removeTestDeferralForReason): Ditto.
2119         (WebCore::dumpState): Helper function for logging test deferral state.
2120         (WebCore::WheelEventTestTrigger::triggerTestTimerFired): Added some logging features.
2121         * page/scrolling/AsyncScrollingCoordinator.cpp:
2122         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated): Make sure that the scrolling thread is
2123         told that it needs to send scrolling state back to the main thread. Only do this if we are in testing mode.
2124         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll): The scrollingNodeID should be
2125         used as the identifier for this operation, not the page address.
2126         (WebCore::AsyncScrollingCoordinator::deferTestsForReason): Added. receives messages from the scrolling thread
2127         and notifies the testing infrastructure.
2128         (WebCore::AsyncScrollingCoordinator::removeTestDeferralForReason): Ditto.
2129         * page/scrolling/AsyncScrollingCoordinator.h:
2130         * page/scrolling/ScrollingStateScrollingNode.cpp:
2131         (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode): When cloning the ScrollingStateScrollingNode,
2132         include the testing mode state.
2133         (WebCore::ScrollingStateScrollingNode::setExpectsWheelEventTestTrigger): Added.
2134         * page/scrolling/ScrollingStateScrollingNode.h:
2135         (WebCore::ScrollingStateScrollingNode::expectsWheelEventTestTrigger): Added.
2136         * page/scrolling/ScrollingTree.h:
2137         (WebCore::ScrollingTree::deferTestsForReason): Added stub.
2138         (WebCore::ScrollingTree::removeTestDeferralForReason): Ditto.
2139         * page/scrolling/ThreadedScrollingTree.cpp:
2140         (WebCore::ThreadedScrollingTree::deferTestsForReason): Added. Dispatches messages from the scrolling thread to the
2141         main thread.
2142         (WebCore::ThreadedScrollingTree::removeTestDeferralForReason): Ditto.
2143         * page/scrolling/ThreadedScrollingTree.h:
2144         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
2145         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2146         (WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac): Initialize testing state flag.
2147         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren): If the 'ExpectsWheelEventTestTrigger' flag is
2148         set, update local state.
2149         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent): If we are testing, and the wheel event should be handled
2150         asynchronously, tell the testing infrastructure we need to wait for the thread state to sync.
2151         (WebCore::ScrollingTreeFrameScrollingNodeMac::deferTestsForReason): Added. Notifies test system we need to defer tests
2152         until we notify them. Also used by the ScrollController during animations.
2153         (WebCore::ScrollingTreeFrameScrollingNodeMac::removeTestDeferralForReason): Ditto.
2154         * platform/Logging.h:
2155         * platform/ScrollAnimator.cpp:
2156         (WebCore::ScrollAnimator::deferTestsForReason): Added. Used by ScrollController during animation. This updates the
2157         testing infrastructure directly, since it is running in the same process and main thread.
2158         (WebCore::ScrollAnimator::removeTestDeferralForReason): Ditto.
2159         * platform/ScrollAnimator.h:
2160         * platform/cocoa/ScrollController.h:
2161         (WebCore::ScrollControllerClient::deferTestsForReason): Change client API.
2162         (WebCore::ScrollControllerClient::removeTestDeferralForReason): Ditto.
2163         (WebCore::ScrollControllerClient::testTrigger): Deleted.
2164         * platform/cocoa/ScrollController.mm:
2165         (WebCore::ScrollController::startSnapRubberbandTimer): Use new client API.
2166         (WebCore::ScrollController::stopSnapRubberbandTimer): Ditto.
2167         (WebCore::ScrollController::startScrollSnapTimer): Ditto.
2168         (WebCore::ScrollController::stopScrollSnapTimer): Ditto.
2169
2170 2015-05-01  Joseph Pecoraro  <pecoraro@apple.com>
2171
2172         Inline some small methods instead of them being EXPORT'd and out of line
2173         https://bugs.webkit.org/show_bug.cgi?id=144498
2174
2175         Reviewed by Darin Adler.
2176
2177         * page/Page.cpp:
2178         (WebCore::Page::testTrigger): Deleted.
2179         (WebCore::Page::clearTrigger): Deleted.
2180         (WebCore::Page::expectsWheelEventTriggers): Deleted.
2181         * page/Page.h:
2182         (WebCore::Page::testTrigger):
2183         (WebCore::Page::clearTrigger):
2184         (WebCore::Page::expectsWheelEventTriggers):
2185
2186 2015-05-01  Dan Bernstein  <mitz@apple.com>
2187
2188         WebCore part of <rdar://problem/8636045> Back/forward navigation to an error page in Safari breaks the back-forward list
2189         https://bugs.webkit.org/show_bug.cgi?id=144501
2190
2191         Reviewed by Darin Adler.
2192
2193         Test: TestWebKitAPI/Tests/WebKit2Cocoa/LoadAlternateHTMLString.mm
2194
2195         Normally, loading substitute data (such as an error page) creates a new back-forward list
2196         item. FrameLoader has a mechanism that detects when a substitute data load occurs during
2197         handling of a provisional load error and prevents the creation of a new back-forwards list
2198         item in that case if the unreachable URL is the same as the failing provisional URL. This
2199         mechanism was broken in WebKit2, where handling the provisional load error is asynchronous.
2200
2201         The fix is to capture some state (namely, the failing provisional URL) when dispatching the
2202         load error and allow it to be restored when loading the substitute data.
2203
2204         * loader/FrameLoader.cpp:
2205         (WebCore::FrameLoader::FrameLoader): Removed initialization of
2206         m_delegateIsHandlingProvisionalLoadError.
2207         (WebCore::FrameLoader::shouldReloadToHandleUnreachableURL): Instead of checking
2208         m_delegateIsHandlingProvisionalLoadError and if true using the provisional document loader’s
2209         URL, check m_provisionalLoadErrorBeingHandledURL.
2210         (WebCore::FrameLoader::checkLoadCompleteForThisFrame): Instead of checking and setting
2211         m_delegateIsHandlingProvisionalLoadError, use m_provisionalLoadErrorBeingHandledURL.
2212         * loader/FrameLoader.h:
2213         (WebCore::FrameLoader::provisionalLoadErrorBeingHandledURL): Added this getter. The client
2214         can call this from its override of dispatchDidFailProvisionalLoad and store the result.
2215         (WebCore::FrameLoader::setProvisionalLoadErrorBeingHandledURL): Added this setter. The
2216         client can call this prior to loading substitute data if it’s done as part of handling a
2217         previously-dispatched didFailProvisionalLoad.
2218
2219 2015-05-01  Martin Robinson  <mrobinson@igalia.com>
2220
2221         USE(...) macro should expect unprefixed variables
2222         https://bugs.webkit.org/show_bug.cgi?id=144454
2223
2224         Reviewed by Daniel Bates.
2225
2226         * DerivedSources.make: Replace all occurrences WTF_USE with USE.
2227         * PlatformEfl.cmake: Ditto.
2228         * PlatformGTK.cmake: Ditto.
2229         * bindings/objc/PublicDOMInterfaces.h: Ditto.
2230         * config.h: Ditto.
2231         * crypto/mac/SerializedCryptoKeyWrapMac.mm: Ditto.
2232         * page/AlternativeTextClient.h: Ditto.
2233         * platform/efl/FileSystemEfl.cpp: Ditto.
2234         (WebCore::fileSystemRepresentation): Ditto.
2235         * platform/graphics/cg/ImageBufferDataCG.h: Ditto.
2236         * platform/graphics/cg/PDFDocumentImage.h: Ditto.
2237         * platform/ios/wak/WAKAppKitStubs.h: Ditto.
2238         * rendering/RenderLayerCompositor.cpp: Ditto.
2239
2240 2015-05-01  Myles C. Maxfield  <mmaxfield@apple.com>
2241
2242         [OS X] Text dilation parameters are not restored after being set
2243         https://bugs.webkit.org/show_bug.cgi?id=144507
2244         <rdar://problem/19446938>
2245
2246         Reviewed by Simon Fraser and Ned Holbrook.
2247
2248         Create a RAII class who is in charge of saving, applying, and restoring dilation parameters. Use this class
2249         around our text drawing routines.
2250
2251         Note that this migrates our use of CTFontSetRenderingParameters() to CTFontSetRenderingStyle().
2252
2253         Test: fast/text/dilation-save-restore.html
2254
2255         * platform/graphics/cocoa/FontCascadeCocoa.mm:
2256         (WebCore::RenderingStyleSaver::RenderingStyleSaver):
2257         (WebCore::RenderingStyleSaver::~RenderingStyleSaver):
2258         (WebCore::showGlyphsWithAdvances):
2259         * platform/spi/cg/CoreGraphicsSPI.h:
2260         * platform/spi/cocoa/CoreTextSPI.h:
2261
2262 2015-05-01  Commit Queue  <commit-queue@webkit.org>
2263
2264         Unreviewed, rolling out r183687.
2265         https://bugs.webkit.org/show_bug.cgi?id=144505
2266
2267         Appears to have caused assertions (Requested by ap on
2268         #webkit).
2269
2270         Reverted changeset:
2271
2272         "Media control volume slider is opaque."
2273         https://bugs.webkit.org/show_bug.cgi?id=144470
2274         http://trac.webkit.org/changeset/183687
2275
2276 2015-05-01  Jeremy Jones  <jeremyj@apple.com>
2277
2278         Stop using deprecated AVKit SPI for enter and exit fullscreen.
2279         https://bugs.webkit.org/show_bug.cgi?id=144493
2280
2281         Reviewed by Jer Noble.
2282
2283         Replace 
2284             -enterFullScreenWithCompletionHandler:
2285             -exitFullScreenWithCompletionHandler:
2286         with
2287             -enterFullScreenAnimated:completionHandler:
2288             -exitFullScreenAnimated:completionHandler:
2289         
2290         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2291         (WebVideoFullscreenInterfaceAVKit::enterFullscreenStandard):
2292         (WebVideoFullscreenInterfaceAVKit::exitFullscreenInternal):
2293         * platform/spi/cocoa/AVKitSPI.h:
2294
2295 2015-05-01  Roger Fong  <roger_fong@apple.com>
2296
2297         Media control volume slider is opaque.
2298         https://bugs.webkit.org/show_bug.cgi?id=144470.
2299         <rdar://problem/20770350>
2300
2301         Rubberstamped by Simon Fraser.
2302
2303         * Modules/mediacontrols/mediaControlsApple.css:
2304         (audio::-webkit-media-controls-panel): 
2305         Don't create a stacking context just for the controls.
2306         Doing so causes the mix-blend-mode on the volume box to fail.
2307
2308 2015-05-01  Joanmarie Diggs  <jdiggs@igalia.com>
2309
2310         [GTK] REGRESSION(183368): It made editing tests assert
2311         https://bugs.webkit.org/show_bug.cgi?id=144447
2312
2313         Reviewed by Chris Fleizach.
2314
2315         Don't notify platforms of editing actions of type EditActionUnspecified.
2316         If we don't know what the action is, platform accessibility APIs certainly
2317         won't.
2318
2319         Add AXTextEditTypeAttributesChange and AXTextAttributesChanged as catch-alls
2320         for formatting changes. ATK lacks finely-grained signals through which to
2321         specify which text attributes have changed. If other platforms have such
2322         signals, new types can always be added.
2323
2324         Don't post an accessible replacement notification for AXTextEditTypeCut.
2325         The notification is handled by DeleteSelectionCommand. It is possible for
2326         white space to be inserted in preparation for a cut which was triggering
2327         a not-reached assert, but insertion of whitespace in preparation for a
2328         cut does not seem notification-worthy.
2329
2330         Treat AXTextEditTypeDictation the same as other insertion types (insert,
2331         paste, typing) with respect to replacement notifications.
2332
2333         No new tests. The hundreds of editing tests that had been crashing seem sufficient.
2334
2335         * accessibility/AXObjectCache.cpp:
2336         (WebCore::AXObjectCache::showIntent):
2337         (WebCore::AXObjectCache::textChangeForEditType):
2338         * accessibility/AXObjectCache.h:
2339         * accessibility/AXTextStateChangeIntent.h:
2340         * accessibility/atk/AXObjectCacheAtk.cpp:
2341         (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
2342         * editing/AppendNodeCommand.cpp:
2343         (WebCore::AppendNodeCommand::doApply):
2344         (WebCore::AppendNodeCommand::doUnapply):
2345         * editing/DeleteFromTextNodeCommand.cpp:
2346         (WebCore::DeleteFromTextNodeCommand::doApply):
2347         (WebCore::DeleteFromTextNodeCommand::doUnapply):
2348         * editing/EditCommand.cpp:
2349         (WebCore::EditCommand::applyEditType):
2350         (WebCore::EditCommand::unapplyEditType):
2351         * editing/InsertIntoTextNodeCommand.cpp:
2352         (WebCore::InsertIntoTextNodeCommand::doApply):
2353         (WebCore::InsertIntoTextNodeCommand::doUnapply):
2354         * editing/InsertNodeBeforeCommand.cpp:
2355         (WebCore::InsertNodeBeforeCommand::doApply):
2356         (WebCore::InsertNodeBeforeCommand::doUnapply):
2357         * editing/ReplaceInsertIntoTextNodeCommand.cpp:
2358         (WebCore::ReplaceInsertIntoTextNodeCommand::notifyAccessibilityForTextChange):
2359
2360 2015-05-01  Brady Eidson  <beidson@apple.com>
2361
2362         Add API to disable meta refreshes.
2363         <rdar://problem/20333198> and https://bugs.webkit.org/show_bug.cgi?id=144269
2364
2365         Reviewed by Alexey Proskuryakov.
2366
2367         Test: loader/meta-refresh-disabled.html
2368
2369         * dom/Document.cpp:
2370         (WebCore::Document::processHttpEquiv): Bail early if Settings have meta refreshes disabled.
2371         * page/Settings.in:
2372
2373 2015-05-01  Martin Robinson  <mrobinson@igalia.com>
2374
2375         [Freetype] Properly support synthetic oblique in vertical text
2376         https://bugs.webkit.org/show_bug.cgi?id=144492
2377
2378         Reviewed by Sergio Villar Senin.
2379
2380         No new tests. Covered by existing tests.
2381
2382         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
2383         (WebCore::FontPlatformData::initializeWithFontFace): Skew vertical when using synthetic
2384         oblique for vertical text.
2385
2386 2015-05-01  Joanmarie Diggs  <jdiggs@igalia.com>
2387
2388         AX: [ATK] REGRESSION: accessibility/canvas-fallback-content.html now crashes
2389         https://bugs.webkit.org/show_bug.cgi?id=144481
2390
2391         Reviewed by Chris Fleizach.
2392
2393         Canvas fallback content is allowed to be focusable if the canvas is displayed
2394         and visible. Update the style when creating an accessible object for a node in
2395         a canvas subtree and before Element::isFocusable() gets called.
2396
2397         No new tests. The existing, crashing test no longer crashes.
2398
2399         * accessibility/AXObjectCache.cpp:
2400         (WebCore::AXObjectCache::getOrCreate):
2401
2402 2015-05-01  Alex Christensen  <achristensen@webkit.org>
2403
2404         [Content Extensions] Add CombinedURLFilters debugging code.
2405         https://bugs.webkit.org/show_bug.cgi?id=144491
2406
2407         Reviewed by Daniel Bates.
2408
2409         No change in behavior.
2410
2411         * contentextensions/CombinedURLFilters.cpp:
2412         (WebCore::ContentExtensions::recursiveMemoryUsed):
2413         (WebCore::ContentExtensions::CombinedURLFilters::memoryUsed):
2414         (WebCore::ContentExtensions::prefixTreeVertexToString):
2415         (WebCore::ContentExtensions::recursivePrint):
2416         (WebCore::ContentExtensions::CombinedURLFilters::print):
2417         (WebCore::ContentExtensions::CombinedURLFilters::addPattern):
2418         (WebCore::ContentExtensions::generateNFAForSubtree):
2419         (WebCore::ContentExtensions::CombinedURLFilters::processNFAs):
2420         * contentextensions/CombinedURLFilters.h:
2421         * contentextensions/NFA.cpp:
2422         (WebCore::ContentExtensions::NFA::memoryUsed):
2423         * contentextensions/NFA.h:
2424         * contentextensions/Term.h:
2425         (WebCore::ContentExtensions::quantifierToString):
2426         (WebCore::ContentExtensions::Term::toString):
2427
2428 2015-05-01  Eric Carlson  <eric.carlson@apple.com>
2429
2430         Fix text track language selection logic
2431         https://bugs.webkit.org/show_bug.cgi?id=144467
2432
2433         Reviewed by Brent Fulgham.
2434
2435         No new tests, media/track/track-language-preference.html was updated.
2436
2437         * html/HTMLMediaElement.cpp:
2438         (WebCore::HTMLMediaElement::configureTextTrackGroup): Correct a minor style typo.
2439         (WebCore::HTMLMediaElement::configureTextTrackDisplay): Update logging.
2440
2441         * page/CaptionUserPreferences.cpp:
2442         (WebCore::CaptionUserPreferences::textTrackSelectionScore): Minor cleanup.
2443         (WebCore::CaptionUserPreferences::textTrackLanguageSelectionScore): Give exact matches a
2444         higher score.
2445
2446         * page/CaptionUserPreferencesMediaAF.cpp:
2447         (WebCore::CaptionUserPreferencesMediaAF::textTrackSelectionScore): Update for 
2448         indexOfBestMatchingLanguageInList change.
2449
2450         * platform/Language.cpp:
2451         (WebCore::indexOfBestMatchingLanguageInList): Add parameter for exact match. Convert the
2452         passed language to lower case as we do with the preferred languages.
2453         * platform/Language.h:
2454
2455 2015-05-01  Martin Robinson  <mrobinson@igalia.com>
2456
2457         [Freetype] Add support for the font-synthesis property
2458         https://bugs.webkit.org/show_bug.cgi?id=144472
2459
2460         Reviewed by Sergio Villar Senin.
2461
2462         No new tests. This causes fast/css3-text/font-synthesis.html to pass
2463         for WebKitGTK+.
2464
2465         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
2466         (WebCore::FontPlatformData::FontPlatformData): Only use synthetic bold when the font description allows it.
2467         (WebCore::FontPlatformData::initializeWithFontFace): Ditto for synthetic oblique.
2468
2469 2015-05-01  Martin Robinson  <mrobinson@igalia.com>
2470
2471         [GTK] New CORS tests from r183280 fail on WebKitGTK+
2472         https://bugs.webkit.org/show_bug.cgi?id=144469
2473
2474         Reviewed by Sergio Villar Senin.
2475
2476         No new tests. This causes failing tests to pass.
2477
2478         * platform/network/soup/ResourceHandleSoup.cpp:
2479         (WebCore::doRedirect): Clear the origin header on cross-origin redirects.
2480
2481 2015-04-30  Alex Christensen  <achristensen@webkit.org>
2482
2483         Compile fix when using content extensions debugging code.
2484
2485         * contentextensions/ContentExtensionCompiler.cpp:
2486         (WebCore::ContentExtensions::compileRuleList):
2487         * contentextensions/ContentExtensionsDebugging.h:
2488         * contentextensions/DFA.cpp:
2489         (WebCore::ContentExtensions::printTransitions):
2490         (WebCore::ContentExtensions::DFA::debugPrintDot):
2491         * contentextensions/DFANode.h:
2492         * contentextensions/NFA.cpp:
2493         (WebCore::ContentExtensions::NFA::memoryUsed):
2494         (WebCore::ContentExtensions::NFA::debugPrintDot):
2495
2496 2015-04-30  Dan Bernstein  <mitz@apple.com>
2497
2498         Fixed the build for <rdar://problem/20758514>
2499
2500         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
2501         (WebCore::AudioSourceProviderAVFObjC::destroyMix): Don’t pass nil to
2502         -[AVMutableAudioMix setInputParameters:].
2503
2504 2015-04-30  Daniel Bates  <dabates@apple.com>
2505
2506         Clean up: Remove unnecessary runtime computation of string length
2507         https://bugs.webkit.org/show_bug.cgi?id=144483
2508
2509         Reviewed by Joseph Pecoraro.
2510
2511         Following <http://trac.webkit.org/changeset/183649>, WebCore::fullyQualifiedInfoTableName()
2512         computes strlen() of the first string literal as part of concatenating two string literals.
2513         It is sufficient to use sizeof() - 1 instead of strlen() to compute the length of the first
2514         string literal because the size of the string literal is known at compile time.
2515
2516         * Modules/webdatabase/DatabaseBackendBase.cpp:
2517         (WebCore::fullyQualifiedInfoTableName):
2518
2519 2015-04-30  Dean Jackson  <dino@apple.com>
2520
2521         Expose -apple-system as a font family
2522         https://bugs.webkit.org/show_bug.cgi?id=144484
2523         <rdar://problem/20767330>
2524
2525         Reviewed by Tim Horton.
2526
2527         Accept "-apple-system" for the font-family property, and
2528         rename "-apple-system-font-monospaced-numbers" to
2529         "-apple-system-monospaced-numbers".
2530
2531         Also change the media controls to use the new name.
2532
2533         Covered by existing tests and this new one:
2534             fast/text/system-font-legacy-name.html
2535
2536         * Modules/mediacontrols/mediaControlsApple.css:
2537         (audio::-webkit-media-controls-time-remaining-display):
2538         * Modules/mediacontrols/mediaControlsiOS.css:
2539         (::-webkit-media-controls):
2540         (audio::-webkit-media-controls-time-remaining-display):
2541         (audio::-webkit-media-controls-status-display):
2542         * platform/graphics/ios/FontCacheIOS.mm: Add support for the new name.
2543         (WebCore::createCTFontWithFamilyNameAndWeight):
2544         * platform/graphics/mac/FontCacheMac.mm: Ditto.
2545         (WebCore::fontWithFamily):
2546
2547 2015-04-30  Javier Fernandez  <jfernandez@igalia.com>
2548
2549         [CSS Grid Layout] overflow-position keyword for align and justify properties.
2550         https://bugs.webkit.org/show_bug.cgi?id=144235
2551
2552         Reviewed by Sergio Villar Senin.
2553
2554         When the alignment subject is larger than the alignment container,
2555         it will overflow. Some alignment modes, if honored in this
2556         situation, may cause data loss; an overflow alignment mode can be
2557         explicitly specified to avoid this.
2558
2559         This patch implements overflow-keyword handling for Grid Layout on
2560         align-self and justify-self properties.
2561
2562         Test: fast/css-grid-layout/grid-align-justify-overflow.html
2563
2564         * rendering/RenderGrid.cpp:
2565         (WebCore::computeOverflowAlignmentOffset):
2566         (WebCore::RenderGrid::rowPositionForChild):
2567         (WebCore::RenderGrid::columnPositionForChild):
2568         (WebCore::RenderGrid::rowAxisPositionForChild): Deleted.
2569         * rendering/style/RenderStyle.cpp:
2570         (WebCore::resolveAlignmentData):
2571         (WebCore::resolveJustificationData):
2572         (WebCore::RenderStyle::resolveAlignment):
2573         (WebCore::RenderStyle::resolveAlignmentOverflow):
2574         (WebCore::RenderStyle::resolveJustification):
2575         (WebCore::RenderStyle::resolveJustificationOverflow):
2576         * rendering/style/RenderStyle.h:
2577
2578 2015-04-30  Jon Honeycutt  <jhoneycutt@apple.com>
2579
2580         Rebaseline bindings tests results after r183648.
2581
2582         Unreviewed.
2583
2584         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2585         (WebCore::jsTestActiveDOMObjectPrototypeFunctionPostMessage):
2586         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
2587         (WebCore::jsTestCustomNamedGetterPrototypeFunctionAnotherFunction):
2588         * bindings/scripts/test/JS/JSTestInterface.cpp:
2589         (WebCore::JSTestInterfaceConstructor::constructJSTestInterface):
2590         (WebCore::setJSTestInterfaceConstructorImplementsStaticAttr):
2591         (WebCore::setJSTestInterfaceImplementsStr2):
2592         (WebCore::setJSTestInterfaceConstructorSupplementalStaticAttr):
2593         (WebCore::setJSTestInterfaceSupplementalStr2):
2594         (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
2595         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
2596         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2597         (WebCore::JSTestNamedConstructorNamedConstructor::constructJSTestNamedConstructor):
2598         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
2599         (WebCore::setJSTestNondeterministicNondeterministicWriteableAttr):
2600         (WebCore::setJSTestNondeterministicNondeterministicExceptionAttr):
2601         (WebCore::setJSTestNondeterministicNondeterministicGetterExceptionAttr):
2602         (WebCore::setJSTestNondeterministicNondeterministicSetterExceptionAttr):
2603         * bindings/scripts/test/JS/JSTestObj.cpp:
2604         (WebCore::setJSTestObjConstructorStaticStringAttr):
2605         (WebCore::setJSTestObjStringAttr):
2606         (WebCore::setJSTestObjReflectedStringAttr):
2607         (WebCore::setJSTestObjReflectedURLAttr):
2608         (WebCore::setJSTestObjReflectedCustomURLAttr):
2609         (WebCore::setJSTestObjStringAttrWithGetterException):
2610         (WebCore::setJSTestObjStringAttrWithSetterException):
2611         (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs):
2612         (WebCore::jsTestObjPrototypeFunctionByteMethodWithArgs):
2613         (WebCore::jsTestObjPrototypeFunctionOctetMethodWithArgs):
2614         (WebCore::jsTestObjPrototypeFunctionLongMethodWithArgs):
2615         (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
2616         (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
2617         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalString):
2618         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefined):
2619         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsNullString):
2620         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod1):
2621         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod3):
2622         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod11):
2623         (WebCore::jsTestObjConstructorFunctionOverloadedMethod12):
2624         (WebCore::jsTestObjPrototypeFunctionStrictFunction):
2625         (WebCore::jsTestObjPrototypeFunctionVariadicStringMethod):
2626         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2627         (WebCore::JSTestOverloadedConstructorsConstructor::constructJSTestOverloadedConstructors4):
2628         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2629         (WebCore::JSTestTypedefsConstructor::constructJSTestTypedefs):
2630         (WebCore::setJSTestTypedefsStringAttrWithGetterException):
2631         (WebCore::setJSTestTypedefsStringAttrWithSetterException):
2632         (WebCore::jsTestTypedefsPrototypeFunctionSetShadow):
2633
2634 2015-04-30  Simon Fraser  <simon.fraser@apple.com>
2635
2636         Fixed elements end up in the middle of the view with pageScale < 1
2637         https://bugs.webkit.org/show_bug.cgi?id=144428
2638         rdar://problem/20404982
2639
2640         Reviewed by Tim Horton.
2641
2642         When pageScale is < 1, we used fixed layout mode, and FrameView::fixedElementsLayoutRelativeToFrame()
2643         returns true. However, the scrolling thread was calling the static scrollOffsetForFixedPosition()
2644         hardcoding 'false' for this parameter.
2645         
2646         Fix by sending the value of fixedElementsLayoutRelativeToFrame over to the scrolling thread,
2647         so we can use it when doing scrolling-thread fixed position stuff.
2648
2649         Not testable.
2650
2651         * page/scrolling/AsyncScrollingCoordinator.cpp:
2652         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
2653         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
2654         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
2655         (WebCore::ScrollingStateFrameScrollingNode::setFixedElementsLayoutRelativeToFrame):
2656         * page/scrolling/ScrollingStateFrameScrollingNode.h:
2657         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
2658         (WebCore::ScrollingTreeFrameScrollingNode::ScrollingTreeFrameScrollingNode):
2659         (WebCore::ScrollingTreeFrameScrollingNode::updateBeforeChildren):
2660         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
2661         (WebCore::ScrollingTreeFrameScrollingNode::fixedElementsLayoutRelativeToFrame):
2662         (WebCore::ScrollingTreeFrameScrollingNode::shouldUpdateScrollLayerPositionSynchronously): Deleted.
2663         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2664         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
2665
2666 2015-04-30  Beth Dakin  <bdakin@apple.com>
2667
2668         Remove invalid assertion from MouseEvent::create()
2669         https://bugs.webkit.org/show_bug.cgi?id=144477
2670
2671         Reviewed by Tim Horton.
2672
2673         mouseforcechanged events and mouseforcewillbegin trigger this assertion. The 
2674         assertion does not seem valuable, so rather than changing it, just remove it.
2675         * dom/MouseEvent.cpp:
2676         (WebCore::MouseEvent::create):
2677
2678 2015-04-30  Dean Jackson  <dino@apple.com>
2679
2680         -apple-system-font-monospaced-numbers doesn't work on iOS
2681         https://bugs.webkit.org/show_bug.cgi?id=144478
2682         <rdar://problem/20544940>
2683
2684         Reviewed by Brent Fulgham.
2685
2686         Make sure to start from the system font descriptor when
2687         asking for a monospaced numeric alternate.
2688
2689         Test: platform/ios-simulator/fast/text/system-monospaced-numbers.html
2690
2691         * platform/graphics/ios/FontCacheIOS.mm:
2692         (WebCore::createCTFontWithFamilyNameAndWeight):
2693
2694 2015-04-30  Oliver Hunt  <oliver@apple.com>
2695
2696         DOM bindings should not be using a reference type to point to a temporary object
2697         https://bugs.webkit.org/show_bug.cgi?id=144474
2698
2699         Reviewed by Beth Dakin.
2700
2701         The DOM bindings will currently try and use a local reference to point
2702         to a temporary object. This currently works as a by product of the compiler's
2703         stack layout. This patch removes the dependency on undefined behaviour
2704         by ensuring that we use a value rather than reference type.
2705
2706         * bindings/scripts/CodeGeneratorJS.pm:
2707         (GenerateParametersCheck):
2708         (GetNativeTypeForCallbacks):
2709
2710 2015-04-30  Brady Eidson  <beidson@apple.com>
2711
2712         Build fix after r183646 for less enlightened platforms.
2713
2714         Unreviewed.
2715
2716         * Modules/webdatabase/DatabaseBackendBase.cpp:
2717         (WebCore::fullyQualifiedInfoTableName): Windows doesn’t have stpcpy :(
2718
2719 2015-04-30  Brady Eidson  <beidson@apple.com>
2720
2721         Javascript using WebSQL can create their own WebKit info table.
2722         <rdar://problem/20688792> and https://bugs.webkit.org/show_bug.cgi?id=144466
2723
2724         Reviewed by Alex Christensen.
2725
2726         Test: storage/websql/alter-to-info-table.html
2727
2728         * Modules/webdatabase/DatabaseBackendBase.cpp:
2729         (WebCore::DatabaseBackendBase::databaseInfoTableName): Return the info table name.
2730         (WebCore::fullyQualifiedInfoTableName): Append "main." to the info table name.
2731         (WebCore::DatabaseBackendBase::DatabaseBackendBase): Use the fully qualified name.
2732         (WebCore::DatabaseBackendBase::performOpenAndVerify): Ditto.
2733         (WebCore::DatabaseBackendBase::getVersionFromDatabase): Ditto.
2734         (WebCore::DatabaseBackendBase::setVersionInDatabase): Ditto.
2735
2736 2015-04-30  Beth Dakin  <bdakin@apple.com>
2737
2738         Should choose UIScrollView indicatorStyle based on the document background color
2739         https://bugs.webkit.org/show_bug.cgi?id=144473
2740         -and corresponding-
2741         rdar://problem/19897699
2742
2743         Reviewed by Simon Fraser.
2744
2745         Export this function.
2746         * platform/graphics/Color.h:
2747
2748 2015-04-30  Brent Fulgham  <bfulgham@apple.com>
2749
2750         [Win] Allow WebKit to build without ANGLE support
2751         https://bugs.webkit.org/show_bug.cgi?id=144459
2752         <rdar://problem/20707307>
2753
2754         Reviewed by Dean Jackson.
2755
2756         * platform/graphics/GLContext.cpp: Use the ENABLE(GRAPHICS_CONTEXT_3D)
2757         macro to avoid compiling this code if not using WEBGL/3D contexts.
2758
2759 2015-04-29  David Hyatt  <hyatt@apple.com>
2760
2761         Avoid containingBlock() calls when no writing mode flipping is needed.
2762         https://bugs.webkit.org/show_bug.cgi?id=144407
2763
2764         Reviewed by Simon Fraser.
2765
2766         Add a bool to RenderView that indicates whether or not any flipped blocks have been
2767         added to the view. Once tainted, the view just stays dirty forever. If no flipped
2768         blocks are ever seen, we can then optimize away calls to containingBlock().
2769
2770         The motivation for this patch is to improve layer position updating, which makes many
2771         calls to topLeftLocationOffset(), one of the functions that can be optimized by this
2772         change.
2773
2774         * rendering/RenderBox.cpp:
2775         (WebCore::RenderBox::layoutOverflowRectForPropagation):
2776         * rendering/RenderBoxModelObject.cpp:
2777         (WebCore::RenderBoxModelObject::updateFromStyle):
2778         * rendering/RenderLayer.cpp:
2779         (WebCore::RenderLayer::calculateClipRects):
2780         * rendering/RenderLineBoxList.cpp:
2781         (WebCore::RenderLineBoxList::rangeIntersectsRect):
2782         * rendering/RenderView.cpp:
2783         (WebCore::RenderView::RenderView):
2784         * rendering/RenderView.h:
2785
2786 2015-04-29  Jer Noble  <jer.noble@apple.com>
2787
2788         Make GenericTaskQueue even more generic (and usable inside platform/)
2789         https://bugs.webkit.org/show_bug.cgi?id=144414
2790
2791         Reviewed by Eric Carlson.
2792
2793         Templatize GenericTaskQueue so that it can be used from within platform/.
2794
2795         * CMakeLists.txt:
2796         * WebCore.vcxproj/WebCore.vcxproj:
2797         * WebCore.vcxproj/WebCore.vcxproj.filters:
2798         * WebCore.xcodeproj/project.pbxproj:
2799         * dom/GenericTaskQueue.cpp: Removed.
2800         * html/HTMLMediaElement.h:
2801         * platform/GenericTaskQueue.h: Renamed from Source/WebCore/dom/GenericTaskQueue.h.
2802         (WebCore::TaskDispatcher::TaskDispatcher): Added default templatized class which just calls the parameter's postTask().
2803         (WebCore::TaskDispatcher::postTask): Call context's postTask().
2804         (WebCore::TaskDispatcher<Timer>::TaskDispatcher): Add a timer version which does not require a context.
2805         (WebCore::TaskDispatcher<Timer>::postTask): Set the timer.
2806         (WebCore::TaskDispatcher<Timer>::timerFired): Call the task.
2807         (WebCore::GenericTaskQueue::GenericTaskQueue): Moved from .cpp.
2808         (WebCore::GenericTaskQueue::enqueueTask): Ditto.
2809         (WebCore::GenericTaskQueue::close): Ditto.
2810         (WebCore::GenericTaskQueue::cancelAllTasks): Ditto.
2811         (WebCore::GenericTaskQueue::hasPendingTasks): Ditto.
2812
2813 2015-04-29  Joseph Pecoraro  <pecoraro@apple.com>
2814
2815         Unreviewed build fix. WebCore has a weak symbol.
2816
2817         WebCore has a weak external symbol in it. A common cause of weak external
2818         symbols is when an inline function is listed in the linker export file.
2819         ERROR: symbol __ZNK7WebCore4Page25expectsWheelEventTriggersEv
2820
2821         * page/Page.cpp:
2822         (WebCore::Page::expectsWheelEventTriggers):
2823         * page/Page.h:
2824         (WebCore::Page::expectsWheelEventTriggers): Deleted.
2825
2826 2015-04-29  Simon Fraser  <simon.fraser@apple.com>
2827
2828         Crash at WebCore::Document::absoluteRegionForEventTargets 
2829         https://bugs.webkit.org/show_bug.cgi?id=144426
2830         rdar://problem/20502166
2831
2832         Reviewed by Tim Horton.
2833
2834         When a frame had wheel event handlers, we would register the document itself
2835         as a handler in its parent document. This is problematic, because there's not
2836         code path that removes it when the frame is destroyed.
2837         
2838         It turns out we don't need to do this at all; the non-fast scrollable region
2839         already takes handlers in subframes into account.
2840
2841         Tests: fast/events/wheelevent-in-frame.html
2842                fast/events/wheelevent-in-reattached-frame.html
2843
2844         * dom/Document.cpp:
2845         (WebCore::Document::didAddWheelEventHandler):
2846         (WebCore::Document::didRemoveWheelEventHandler):
2847
2848 2015-04-29  Eric Carlson  <eric.carlson@apple.com>
2849
2850         Not all videos should automatically play to playback target
2851         https://bugs.webkit.org/show_bug.cgi?id=144430
2852         <rdar://problem/20718523>
2853
2854         Reviewed by Darin Adler.
2855
2856         * Modules/mediasession/WebMediaSessionManager.cpp:
2857         (WebCore::WebMediaSessionManager::clientStateDidChange): Consider ExternalDeviceAutoPlayCandidate.
2858         Minor cleanup.
2859
2860         * html/HTMLMediaElement.cpp:
2861         (WebCore::HTMLMediaElement::mediaState): Set ExternalDeviceAutoPlayCandidate when a <video>
2862         has a file with an audio track that does not loop.
2863
2864         * page/MediaProducer.h: Add ExternalDeviceAutoPlayCandidate.
2865
2866 2015-04-29  Joseph Pecoraro  <pecoraro@apple.com>
2867
2868         LiveNodeList may unexpectedly return an element for empty string
2869         https://bugs.webkit.org/show_bug.cgi?id=144429
2870
2871         Reviewed by Darin Adler.
2872
2873         * dom/LiveNodeList.cpp:
2874         (WebCore::LiveNodeList::namedItem):
2875         Never return a result for an empty string.
2876
2877 2015-04-29  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2878
2879         Remove PassRefPtr in SVGFEFooElement classes
2880         https://bugs.webkit.org/show_bug.cgi?id=144425
2881
2882         Reviewed by Darin Adler.
2883
2884         As a step to use Ref instead of PassRefPtr, this patch purges PassRefPtr
2885         in SVGFEFooElement.
2886
2887         No new tests, no behavior changes.
2888
2889         * css/RGBColor.cpp:
2890         (WebCore::RGBColor::create):
2891         * css/RGBColor.h:
2892         * platform/graphics/filters/PointLightSource.h:
2893         (WebCore::PointLightSource::create):
2894         * platform/graphics/filters/SpotLightSource.h:
2895         (WebCore::SpotLightSource::create):
2896         * svg/SVGColor.cpp:
2897         (WebCore::SVGColor::rgbColor):
2898         * svg/SVGColor.h:
2899         * svg/SVGFEDistantLightElement.cpp:
2900         (WebCore::SVGFEDistantLightElement::lightSource):
2901         * svg/SVGFEDistantLightElement.h:
2902         * svg/SVGFELightElement.cpp:
2903         (WebCore::SVGFELightElement::findLightSource):
2904         * svg/SVGFELightElement.h:
2905         * svg/SVGFEPointLightElement.cpp:
2906         (WebCore::SVGFEPointLightElement::lightSource):
2907         * svg/SVGFEPointLightElement.h:
2908         * svg/SVGFESpotLightElement.cpp:
2909         (WebCore::SVGFESpotLightElement::lightSource):
2910         * svg/SVGFESpotLightElement.h:
2911
2912 2015-04-29  Dean Jackson  <dino@apple.com>
2913
2914         Create a named CSS property for system colors
2915         https://bugs.webkit.org/show_bug.cgi?id=144423
2916         <rdar://problem/20491011>
2917
2918         Reviewed by Tim Horton.
2919
2920         Test: fast/css/apple-system-colors.html
2921
2922         Expose the following values to CSS color properties:
2923             -apple-system-blue
2924             -apple-system-brown
2925             -apple-system-gray
2926             -apple-system-green
2927             -apple-system-orange
2928             -apple-system-pink
2929             -apple-system-purple
2930             -apple-system-red
2931             -apple-system-yellow
2932
2933         On platforms other than OS X Yosemite and iOS, the
2934         actual color values are undefined and become transparent
2935         black. (In fact, not all are defined on iOS either.)
2936
2937         * WebCore.xcodeproj/project.pbxproj: Two new SPI header files.
2938
2939         * css/CSSParser.cpp:
2940         (WebCore::CSSParser::validSystemColorValue): New helper function that
2941         checks if a CSSValueID is between the two system color values. This
2942         was being tested everywhere, which meant adding a new system color was
2943         at risk of being ignored. It's a static method so it can be used
2944         from the SVG CSS parser too.
2945         (WebCore::validPrimitiveValueColor): Use the new helper.
2946         (WebCore::CSSParser::parseValue): Ditto.
2947         (WebCore::CSSParser::parseBackgroundColor): Ditto.
2948         (WebCore::CSSParser::parseShadow): Ditto.
2949         (WebCore::parseDeprecatedGradientColorStop): Ditto.
2950         (WebCore::parseGradientColorOrKeyword): Ditto.
2951         * css/CSSParser.h: New static helper function.
2952
2953         * css/CSSValueKeywords.in: Add the new CSS value keywords.
2954
2955         * css/SVGCSSParser.cpp:
2956         (WebCore::validSystemControlColorValue): SVG has a restricted
2957         set of system colors, so use the helper from CSSParser but with
2958         an extra condition.
2959         (WebCore::CSSParser::parseSVGValue): Use the helper.
2960
2961         * platform/spi/ios/UIColorSPI.h: Added.
2962         * platform/spi/cocoa/NSColorSPI.h: Added.
2963
2964         * rendering/RenderThemeIOS.h: New systemColor override. Also add a cache for system colors.
2965         * rendering/RenderThemeIOS.mm:
2966         (WebCore::RenderThemeIOS::systemColor): Ask UIColor to provide the color values for the new CSS values.
2967         * rendering/RenderThemeMac.mm:
2968         (WebCore::RenderThemeMac::systemColor): Ditto.
2969
2970 2015-04-29  Commit Queue  <commit-queue@webkit.org>
2971
2972         Unreviewed, rolling out r183600.
2973         https://bugs.webkit.org/show_bug.cgi?id=144432
2974
2975         New tests time out everywhere (Requested by ap on #webkit).
2976
2977         Reverted changeset:
2978
2979         "Crash at WebCore::Document::absoluteRegionForEventTargets"
2980         https://bugs.webkit.org/show_bug.cgi?id=144426
2981         http://trac.webkit.org/changeset/183600
2982
2983 2015-04-29  Joseph Pecoraro  <pecoraro@apple.com>
2984
2985         Unreviewed iOS build fix. Unused parameter no longer exists.
2986
2987         * page/scrolling/ScrollingCoordinator.cpp:
2988         (WebCore::ScrollingCoordinator::absoluteNonFastScrollableRegionForFrame):
2989
2990 2015-04-29  Simon Fraser  <simon.fraser@apple.com>
2991
2992         Crash at WebCore::Document::absoluteRegionForEventTargets 
2993         https://bugs.webkit.org/show_bug.cgi?id=144426
2994         rdar://problem/20502166
2995
2996         Reviewed by Tim Horton.
2997
2998         When a frame had wheel event handlers, we would register the document itself
2999         as a handler in its parent document. This is problematic, because there's not
3000         code path that removes it when the frame is destroyed.
3001         
3002         It turns out we don't need to do this at all; the non-fast scrollable region
3003         already takes handlers in subframes into account.
3004
3005         Tests: fast/events/wheelevent-in-frame.html
3006                fast/events/wheelevent-in-reattached-frame.html
3007
3008         * dom/Document.cpp:
3009         (WebCore::Document::didAddWheelEventHandler):
3010         (WebCore::Document::didRemoveWheelEventHandler):
3011
3012 2015-04-29  David Kilzer  <ddkilzer@apple.com>
3013
3014         Attempt #2: Switch QuickLook soft-linking to use QuickLookSoftLink.{h,mm}
3015         <http://webkit.org/b/144362>
3016
3017         Reviewed by Andy Estes.
3018
3019         This patch switches soft-linking of QuickLook.framework to
3020         QuickLookSoftLink.{h,mm} so that we stop exporting unintended
3021         symbols.
3022
3023         No new tests since no change in behavior.
3024
3025         * WebCore.xcodeproj/project.pbxproj:
3026         - Add QuickLookSoftLinking.{h,mm} to the project.
3027
3028         * platform/ios/QuickLookSoftLink.h: Added.
3029         * platform/ios/QuickLookSoftLink.mm: Added.
3030         * platform/mac/SoftLinking.h:
3031         (SOFT_LINK_CLASS_FOR_HEADER): Add macro.
3032         (SOFT_LINK_CLASS_FOR_SOURCE): Add macro.
3033         (SOFT_LINK_POINTER_FOR_HEADER): Add macro.
3034         (SOFT_LINK_POINTER_FOR_SOURCE): Add macro.
3035
3036         * platform/network/ios/QuickLook.h:
3037         - Remove unused declarations.
3038
3039         * platform/network/ios/QuickLook.mm:
3040         (WebCore::QLPreviewConverterClass): Deleted.
3041         (WebCore::QLTypeCopyBestMimeTypeForFileNameAndMimeType): Deleted.
3042         (WebCore::QLTypeCopyBestMimeTypeForURLAndMimeType): Deleted.
3043         (WebCore::QLTypeCopyUTIForURLAndMimeType): Deleted.
3044         - Remove SOFT_LINK macros and unused methods after switching to
3045           new QuickLookSoftLink.{h,mm}.
3046         (WebCore::QLPreviewGetSupportedMIMETypesSet):
3047         - Switch to use NeverDestroyed<>.
3048         (WebCore::registerQLPreviewConverterIfNeeded):
3049         (createQLPreviewProtocol):
3050         (WebCore::QLPreviewProtocol):
3051         (WebCore::QuickLookHandle::QuickLookHandle):
3052         (WebCore::QuickLookHandle::create):
3053         (WebCore::QuickLookHandle::shouldCreateForMIMEType):
3054         - Simplify code when using QuickLookSoftLink.h.
3055
3056         * platform/network/ios/WebCoreURLResponseIOS.mm:
3057         - Include QuickLookSoftLink.h header.
3058
3059 2015-04-29  Simon Fraser  <simon.fraser@apple.com>
3060
3061         Compute the non-fast-scrollable region in main-document coordinates
3062         https://bugs.webkit.org/show_bug.cgi?id=144420
3063
3064         Reviewed by Tim Horton.
3065
3066         Compute the non-fast-scrollable region in document coordinates, to make it easier
3067         to reason about. Previously, it was document coordinates offset by top content inset.
3068
3069         * page/DebugPageOverlays.cpp:
3070         (WebCore::MouseWheelRegionOverlay::updateRegion): Traverse all frames to compute the wheel
3071         event handler region, mapping each to root view coords, and then mapping back into document
3072         coords at the end.
3073         (WebCore::NonFastScrollableRegionOverlay::updateRegion): No offset needed here; the
3074         overlay and region are both document coordinates.
3075         * page/FrameView.h: Make some mapping function overrides public, and expose widgetsInRenderTree().
3076         * page/Page.cpp:
3077         (WebCore::Page::nonFastScrollableRects): Remove frame argument.
3078         * page/Page.h:
3079         * page/PageOverlay.cpp:
3080         (WebCore::PageOverlay::bounds):
3081         (WebCore::PageOverlay::viewToOverlayOffset): Convenience function to map between
3082         view and overlay coordinates.
3083         * page/PageOverlay.h:
3084         * page/scrolling/AsyncScrollingCoordinator.cpp: New computeNonFastScrollableRegion() signature.
3085         (WebCore::AsyncScrollingCoordinator::updateNonFastScrollableRegion):
3086         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
3087         (WebCore::AsyncScrollingCoordinator::scrollingStateTreeAsText):
3088         * page/scrolling/ScrollingCoordinator.cpp:
3089         (WebCore::ScrollingCoordinator::absoluteNonFastScrollableRegionForFrame): This function
3090         recurses on frames, computing an absolute (document-relative) region per frame. This
3091         removes the confusing offsetting through top content inset.
3092         Change how we get to plugins that want wheel events; we can't get from PluginViewBase
3093         to renderers, so use FrameView's list of Widgets, and their RenderWidgets. This fixes
3094         regions for transformed plugin-ins.
3095         For subframes, we get a region in the subframe's document coords. Map to that sub-frame,
3096         then to our frame, then to our document.
3097         (WebCore::ScrollingCoordinator::absoluteNonFastScrollableRegion): Wrapper that hides
3098         the recursive function.
3099         (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion): Deleted.
3100         * page/scrolling/ScrollingCoordinator.h:
3101         * page/scrolling/ScrollingTree.cpp:
3102         (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously): Map the event point
3103         from view coordinates to document coordinates for testing against the non-fast region.
3104         We previously assert that the root note is a FrameScrolling node.
3105         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
3106         (WebCore::ScrollingTreeFrameScrollingNode::viewToContentsOffset): Similar to ScrollView::viewToContents()
3107         for the scrolling tree.
3108         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
3109         * testing/Internals.cpp:
3110         (WebCore::Internals::nonFastScrollableRects): No need for frame arg.
3111
3112 2015-04-29  Brent Fulgham  <bfulgham@apple.com>
3113
3114         Expand test infrastructure to support scrolling tests
3115         https://bugs.webkit.org/show_bug.cgi?id=143684
3116         <rdar://problem/20375516>
3117
3118         Reviewed by Simon Fraser.
3119
3120         Tested by various fast/scrolling and platform/mac-wk2/tiled-drawing/scrolling tests.
3121
3122         This series of changes adds a new singleton class, 'WheelEventTestTrigger', which encapsulates a
3123         function object to be fired when scroll events are finished. The object also keeps track of reasons
3124         why the test should not yet fire (e.g., 'rubberbanding' is active) so that tests do not incorrectly
3125         check rendering state in the middle of an animation.
3126
3127         Switch from the original WeakPtr design to ThreadSafeRefPtr, because WeakPtr cannot be shared
3128         across multiple threads.
3129
3130         * page/FrameView.cpp:
3131         (WebCore::FrameView::layout): Make sure ScrollAnimator knows about any active test trigger.
3132         (WebCore::FrameView::setScrollPosition): Ditto.
3133         (WebCore::FrameView::didAddScrollbar): Ditto.
3134         * page/MainFrame.cpp:
3135         (WebCore::MainFrame::testTrigger): Moved to Page.
3136         (WebCore::MainFrame::ensureTestTrigger): Ditto.
3137         * page/MainFrame.h:
3138         * page/Page.cpp:
3139         (WebCore::Page::testTrigger): Moved from MainFrame, and converted to use RefPtr.
3140         (WebCore::Page::ensureTestTrigger): Ditto.
3141         * page/Page.h:
3142         * page/WheelEventTestTrigger.cpp:
3143         (WebCore::WheelEventTestTrigger::WheelEventTestTrigger): Remove WeakPtr code.
3144         (WebCore::WheelEventTestTrigger::createWeakPtr): Deleted.
3145         * page/WheelEventTestTrigger.h:
3146         * page/mac/EventHandlerMac.mm:
3147         (WebCore::EventHandler::platformPrepareForWheelEvents): Make sure the scroll animator knows about
3148         any active test trigger object.
3149         * page/scrolling/AsyncScrollingCoordinator.cpp:
3150         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll): Notify WheelEventTestTrigger
3151         that the scrolling thread is synced with the main thread.
3152         * platform/ScrollAnimator.h: Hold a RefPtr to the WheelEventTestTrigger. 
3153         (WebCore::ScrollAnimator::ScrollAnimator::setWheelEventTestTrigger):
3154         * platform/cocoa/ScrollController.h:
3155         * platform/cocoa/ScrollController.mm:
3156         (WebCore::ScrollController::startSnapRubberbandTimer): Notify test trigger to hold tests until rubber band
3157         snapping is complete.
3158         (WebCore::ScrollController::stopSnapRubberbandTimer): Notify test trigger that rubber band snapping is done.
3159         (WebCore::ScrollController::startScrollSnapTimer): Notify test trigger to hold tests until scroll snapping
3160         is complete.
3161         (WebCore::ScrollController::stopScrollSnapTimer): Notify test trigger that scroll snapping is done.
3162         * platform/mac/ScrollAnimatorMac.mm:
3163         (WebCore::ScrollAnimatorMac::didBeginScrollGesture): Notify test trigger that a content scroll is in progress.
3164         (WebCore::ScrollAnimatorMac::didEndScrollGesture): Notify test trigger that a content scroll is finished.
3165         (WebCore::ScrollAnimatorMac::sendContentAreaScrolledSoon): Notify test trigger to hold tests until the content
3166         scrolling is complete.
3167         (WebCore::ScrollAnimatorMac::sendContentAreaScrolledTimerFired): Notify test trigger that content scrolling is done.
3168         * rendering/RenderBox.cpp:
3169         (WebCore::connectScrollAnimatorToTestTrigger): Helper function.
3170         (WebCore::RenderBox::setScrollLeft): Call 'connectScrollAnimatorToTestTrigger' to connect the ScrollAnimator
3171         to the WheelEventTestTrigger so that future scroll operations can notify the test infrastructure.
3172         (WebCore::RenderBox::setScrollTop): Ditto.
3173         * rendering/RenderLayer.cpp:
3174         (WebCore::RenderLayer::createScrollbar): Make sure the ScrollAnimator knows about any active test triggers.
3175         * rendering/RenderListBox.cpp:
3176         (WebCore::connectScrollAnimatorToTestTrigger): Helper function.
3177         (WebCore::RenderListBox::setScrollLeft): Call 'connectScrollAnimatorToTestTrigger' to connect the ScrollAnimator
3178         to the WheelEventTestTrigger so that future scroll operations can notify the test infrastructure.
3179         (WebCore::RenderListBox::setScrollTop): Ditto.
3180         (WebCore::RenderListBox::createScrollbar): Ditto.
3181         * testing/js/WebCoreTestSupport.cpp:
3182         (WebCoreTestSupport::monitorWheelEvents): Look for WheelEventTestTrigger in Page, rather than MainFrame.
3183         (WebCoreTestSupport::setTestCallbackAndStartNotificationTimer): Ditto.
3184
3185 2015-04-29  Javier Fernandez  <jfernandez@igalia.com>
3186
3187         [CSS Box Alignment] Unifying alignment data in a single class
3188         https://bugs.webkit.org/show_bug.cgi?id=144384
3189
3190         Reviewed by David Hyatt.
3191
3192         The new CSS Box Alignment specification introduces more complex
3193         values and syntax for defining alignment properties. Most of the
3194         alignment values were just keyword identifiers, but the new syntax
3195         allows different combinations of identifiers to determine the
3196         alignment behavior (eg. overflow-alignment keyword).
3197
3198         This patch wll help to implement later overflow handling and
3199         specially Content Dstribution alignment, the most complex case by
3200         far. It will be more consistent against style changes and repaint,
3201         snce we will have just one field to monitoring for value
3202         modfications.
3203
3204         No new tests, because no new functionality was added; it's just a
3205         code refactoring which is just expected to pass current tests.
3206
3207         * css/CSSComputedStyleDeclaration.cpp:
3208         (WebCore::resolveSelfAlignmentAuto):
3209         (WebCore::ComputedStyleExtractor::propertyValue):
3210         * css/CSSPropertyNames.in:
3211         * css/StyleBuilderConverter.h:
3212         (WebCore::StyleBuilderConverter::convertSelfOrDefaultAlignmentData):
3213         (WebCore::StyleBuilderConverter::convertSVGColor): Deleted.
3214         * css/StyleBuilderCustom.h:
3215         (WebCore::StyleBuilderCustom::applyInitialWebkitMaskImage): Deleted.
3216         (WebCore::StyleBuilderCustom::applyInheritWebkitMaskImage): Deleted.
3217         (WebCore::ApplyPropertyBorderImageModifier::applyInheritValue): Deleted.
3218         (WebCore::ApplyPropertyBorderImageModifier::applyInitialValue): Deleted.
3219         (WebCore::ApplyPropertyBorderImageModifier::applyValue): Deleted.
3220         (WebCore::ApplyPropertyBorderImageModifier::getValue): Deleted.
3221         (WebCore::ApplyPropertyBorderImageModifier::setValue): Deleted.
3222         (WebCore::StyleBuilderCustom::applyInheritLineHeight): Deleted.
3223         * css/StyleResolver.cpp:
3224         (WebCore::StyleResolver::adjustRenderStyle):
3225         * mathml/MathMLTextElement.cpp:
3226         (WebCore::MathMLTextElement::createElementRenderer):
3227         * rendering/RenderFlexibleBox.cpp:
3228         (WebCore::RenderFlexibleBox::styleDidChange):
3229         * rendering/RenderFullScreen.cpp:
3230         (WebCore::createFullScreenStyle):
3231         * rendering/RenderMenuList.cpp:
3232         (WebCore::RenderMenuList::adjustInnerStyle):
3233         * rendering/mathml/RenderMathMLRoot.cpp:
3234         (WebCore::RenderMathMLRoot::updateStyle):
3235         * rendering/mathml/RenderMathMLScripts.cpp:
3236         (WebCore::RenderMathMLScripts::fixAnonymousStyleForSubSupPair):
3237         (WebCore::RenderMathMLScripts::fixAnonymousStyles):
3238         * rendering/style/RenderStyle.cpp:
3239         (WebCore::RenderStyle::resolveAlignment):
3240         (WebCore::RenderStyle::resolveJustification):
3241         * rendering/style/RenderStyle.h:
3242         * rendering/style/StyleRareNonInheritedData.cpp:
3243         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
3244         (WebCore::StyleRareNonInheritedData::operator==):
3245         (WebCore::StyleRareNonInheritedData::contentDataEquivalent): Deleted.
3246         * rendering/style/StyleRareNonInheritedData.h:
3247         * rendering/style/StyleSelfAlignmentData.h: Added.
3248         (WebCore::StyleSelfAlignmentData::StyleSelfAlignmentData):
3249         (WebCore::StyleSelfAlignmentData::setPosition):
3250         (WebCore::StyleSelfAlignmentData::setPositionType):
3251         (WebCore::StyleSelfAlignmentData::setOverflow):
3252         (WebCore::StyleSelfAlignmentData::position):
3253         (WebCore::StyleSelfAlignmentData::positionType):
3254         (WebCore::StyleSelfAlignmentData::overflow):
3255         (WebCore::StyleSelfAlignmentData::operator==):
3256         (WebCore::StyleSelfAlignmentData::operator!=):
3257
3258 2015-04-29  Joseph Pecoraro  <pecoraro@apple.com>
3259
3260         NodeList has issues with Symbol and empty string
3261         https://bugs.webkit.org/show_bug.cgi?id=144310
3262
3263         Reviewed by Darin Adler.
3264
3265         Tests: fast/dom/StyleSheet/stylesheet-symbol-names.html
3266                fast/dom/dataset-name-getter-symbols.html
3267                fast/dom/named-items-with-empty-name.html
3268                fast/dom/named-items-with-symbol-name.html
3269                storage/domstorage/localstorage/named-items.html
3270
3271         Test different bindings objects with custom named setter
3272         and getter handlers. Ensure that they handle Symbol properties
3273         gracefully. Often times avoiding the string path.
3274
3275         * dom/StaticNodeList.cpp:
3276         (WebCore::StaticNodeList::namedItem):
3277         (WebCore::StaticElementList::namedItem):
3278         Better handle the empty string. It should not match an item.
3279
3280         * bindings/js/JSDOMBinding.h:
3281         (WebCore::propertyNameToString):
3282         In cases where we would use this, we should have handled
3283         Symbol properties.
3284
3285         (WebCore::propertyNameToAtomicString):
3286         For Symbols, use the unique string. This should result
3287         in no matches for a Symbol property.
3288
3289         * bindings/js/JSDOMStringMapCustom.cpp:
3290         (WebCore::JSDOMStringMap::getOwnPropertySlotDelegate):
3291         (WebCore::JSDOMStringMap::deleteProperty):
3292         (WebCore::JSDOMStringMap::putDelegate):
3293         * bindings/js/JSStorageCustom.cpp:
3294         (WebCore::JSStorage::canGetItemsForName):
3295         (WebCore::JSStorage::nameGetter):
3296         (WebCore::JSStorage::deleteProperty):
3297         (WebCore::JSStorage::putDelegate):
3298         * bindings/js/JSStyleSheetListCustom.cpp:
3299         (WebCore::JSStyleSheetList::canGetItemsForName):
3300         Treat Symbol properties as private properties. They just
3301         go directly through to the Object, and avoid the string
3302         getter/setter property path.
3303
3304 2015-04-29  Eric Carlson  <eric.carlson@apple.com>
3305
3306         [Mac] Register with device picker whenever a page has <video>
3307         https://bugs.webkit.org/show_bug.cgi?id=144408
3308
3309         Reviewed by Jer Noble.
3310
3311         * Modules/mediasession/WebMediaSessionManager.cpp:
3312         (WebCore::WebMediaSessionManager::setPlaybackTarget): Drive-by fix: don't tell a client to play
3313         to the target when it has not routes.
3314
3315         * html/HTMLMediaElement.cpp:
3316         (WebCore::HTMLMediaElement::mediaState): Set RequiresPlaybackTargetMonitoring whenever the 
3317         element is <video> with a video track that does not block wireless playback.
3318
3319 2015-04-29  Martin Robinson  <mrobinson@igalia.com>
3320
3321         [GTK] Add support for automatic hyphenation
3322         https://bugs.webkit.org/show_bug.cgi?id=44478
3323
3324         Reviewed by Carlos Garcia Campos.
3325
3326         No new tests. This patch unskips and updates results for existing hyphenation tests.
3327
3328         * PlatformGTK.cmake: Add the libhypen implementation to the source list.
3329         * platform/gtk/GtkUtilities.cpp:
3330         (WebCore::topLevelPath): Add this helper function taken from the test harness.
3331         (WebCore::getWebKitBuildDirectory): Ditto.
3332         * platform/gtk/GtkUtilities.h: Add function declarations for the helper functions.
3333         * platform/text/Hyphenation.cpp: Surround this implementation with !USE(LIBHYPHEN),
3334           so that it can still be shared.
3335         * platform/text/gtk/HyphenationLibHyphen.cpp: Added.
3336         (WebCore::extractLocaleFromDictionaryFilePath): Take in a dictionary filename and
3337         determine the locale that it covers.
3338         (WebCore::scanDirectoryForDicionaries): Look for all installed dictionaries as well
3339         as ones in the JHBuild root for testing.
3340         (WebCore::scanTestDictionariesDirectoryIfNecessary): Try to scan the dictionaries installed
3341         in the JHBuild root.
3342         (WebCore::availableLocales): Getter for global hash of installed dictionaries.
3343         (WebCore::canHyphenate): Added libhyphen implementation.
3344         (WebCore::HyphenationDictionary): Helper class that properly manages the memory of
3345         an open libhyphen dictionary. This is useful so that they can be stored in an MRU
3346         cache. This is a similar approach to the CoreFoundation implementation.
3347         (WebCore::AtomicStringKeyedMRUCache<RefPtr<HyphenationDictionary>>::createValueForNullKey): MRU cache
3348         helper.
3349         (WebCore::AtomicStringKeyedMRUCache<RefPtr<HyphenationDictionary>>::createValueForKey): Ditto.
3350         (WebCore::hyphenDictionaryCache): A cache for opened hyphenation dictionaries.
3351         (WebCore::countLeadingSpaces): Count leading spaces, since WebCore often passes words with them.
3352         (WebCore::lastHyphenLocation): Added libhyphen implementation.
3353
3354 2015-04-29  Myles C. Maxfield  <mmaxfield@apple.com>
3355
3356         Unreviewed build fix.
3357
3358         * platform/graphics/mac/FontCacheMac.mm:
3359         (WebCore::fontWithFamily):
3360
3361 2015-04-29  Eric Carlson  <eric.carlson@apple.com>
3362
3363         Some media tests assert after r183096
3364         https://bugs.webkit.org/show_bug.cgi?id=144098
3365
3366         Reviewed by Brent Fulgham.
3367
3368         Never assert when a MediaPlaybackTargetClient client calls one of the methods on Document
3369         after it has been unregistered. A media element unregisters itself when it is removed from the 
3370         document, but scripts can still run and modify state that results in a call to
3371         playbackTargetPickerClientStateDidChange. Remove the asserts instead of adding checks to
3372         the various call sites.
3373
3374         * dom/Document.cpp:
3375         (WebCore::Document::showPlaybackTargetPicker): Don't assert if the client has already
3376         been unregistered.
3377         (WebCore::Document::playbackTargetPickerClientStateDidChange): Ditto.
3378
3379 2015-04-29  Zalan Bujtas  <zalan@apple.com>
3380
3381         Simple line layout: Web process spins endlessly below layoutSimpleLines.
3382         https://bugs.webkit.org/show_bug.cgi?id=144403
3383         rdar://problem/20742783
3384
3385         Reviewed by Antti Koivisto.
3386
3387         When a text fragment overlaps multiple renderes and it does not fit the current line,
3388         we revert the text fragment iterator position so that the overlapping content
3389         gets processed again for the next line.
3390         However, TextFragmentIterator::revertToFragment() was reverting too much and
3391         we started processing old content all over again -> infinite loop.
3392
3393         This patch ensures that text fragment iterator is reverted to the right position.
3394
3395         Test: fast/text/simple-line-layout-wrapping-multiple-renderers-hang.html
3396
3397         * rendering/SimpleLineLayout.cpp:
3398         (WebCore::SimpleLineLayout::createLineRuns):
3399         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
3400         (WebCore::SimpleLineLayout::TextFragmentIterator::revertToEndOfFragment):
3401         (WebCore::SimpleLineLayout::TextFragmentIterator::revertToFragment): Deleted.
3402         * rendering/SimpleLineLayoutTextFragmentIterator.h:
3403
3404 2015-04-29  Filip Pizlo  <fpizlo@apple.com>
3405
3406         JSTypeInfo should have an inline type flag to indicate of getCallData() has been overridden
3407         https://bugs.webkit.org/show_bug.cgi?id=144397
3408
3409         Reviewed by Andreas Kling.
3410
3411         If you override getCallData() and you want to be called a "function", then you need to use the
3412         new TypeOfShouldCallGetCallData flag.
3413
3414         * bindings/scripts/CodeGeneratorJS.pm:
3415         (GenerateHeader):
3416         * bridge/objc/objc_runtime.h:
3417         * bridge/runtime_method.h:
3418         * bridge/runtime_object.h:
3419
3420 2015-04-29  Commit Queue  <commit-queue@webkit.org>
3421
3422         Unreviewed, rolling out r183553 and r183561.
3423         https://bugs.webkit.org/show_bug.cgi?id=144406
3424
3425         broke the iOS build (Requested by thorton__ on #webkit).
3426
3427         Reverted changesets:
3428
3429         "Switch QuickLook soft-linking to use
3430         QuickLookSoftLink.{h,mm}"
3431         https://bugs.webkit.org/show_bug.cgi?id=144362
3432         http://trac.webkit.org/changeset/183553
3433
3434         "Unreviewed iOS build fix after r183553: fix declaration of
3435         QLPreviewScheme"
3436         http://trac.webkit.org/changeset/183561
3437
3438 2015-04-29  Antti Koivisto  <antti@apple.com>
3439
3440         ResourceLoadPriority should be enum class
3441         https://bugs.webkit.org/show_bug.cgi?id=144326
3442
3443         Reviewed by Darin Adler.
3444
3445         * html/HTMLLinkElement.cpp:
3446         (WebCore::HTMLLinkElement::process):
3447         * loader/LinkLoader.cpp:
3448         (WebCore::LinkLoader::loadLink):
3449         * loader/ResourceLoadScheduler.cpp:
3450         (WebCore::ResourceLoadScheduler::scheduleLoad):
3451         (WebCore::ResourceLoadScheduler::servePendingRequests):
3452         (WebCore::ResourceLoadScheduler::HostInformation::~HostInformation):
3453         (WebCore::ResourceLoadScheduler::HostInformation::priorityToIndex):
3454         (WebCore::ResourceLoadScheduler::HostInformation::schedule):
3455         (WebCore::ResourceLoadScheduler::HostInformation::remove):
3456         (WebCore::ResourceLoadScheduler::HostInformation::hasRequests):
3457         (WebCore::ResourceLoadScheduler::HostInformation::limitRequests):
3458         * loader/ResourceLoadScheduler.h:
3459         (WebCore::ResourceLoadScheduler::HostInformation::requestsPending):
3460
3461             Modernize ResourceLoadScheduler code a bit while switching to enum class.
3462
3463         * loader/cache/CachedResource.cpp:
3464         (WebCore::defaultPriorityForResourceType):
3465         * loader/cache/CachedResourceLoader.cpp:
3466         (WebCore::CachedResourceLoader::requestResource):
3467         * loader/icon/IconLoader.cpp:
3468         (WebCore::IconLoader::startLoading):
3469         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
3470         (WebCore::WebCoreAVFResourceLoader::startLoading):
3471         * platform/network/ResourceLoadPriority.h:
3472         (WebCore::operator++):
3473         (WebCore::operator--):
3474         * platform/network/ResourceRequestBase.cpp:
3475         (WebCore::ResourceRequestBase::adopt):
3476         (WebCore::ResourceRequestBase::copyData):
3477         (WebCore::ResourceRequestBase::cachePolicy):
3478         (WebCore::ResourceRequestBase::priority):
3479         (WebCore::ResourceRequestBase::setPriority):
3480         * platform/network/ResourceRequestBase.h:
3481
3482             Remove bitfields. ResourceRequests are not present in large enough numbers to require this kind of optimization.
3483             Use modern initialization syntax.
3484
3485         (WebCore::ResourceRequestBase::ResourceRequestBase):
3486         (WebCore::CrossThreadResourceRequestDataBase::CrossThreadResourceRequestDataBase): Deleted.
3487         * platform/network/cf/ResourceRequestCFNet.cpp:
3488         (WebCore::initializeMaximumHTTPConnectionCountPerHost):
3489         (WebCore::initializeHTTPConnectionSettingsOnStartup):
3490         * platform/network/cf/ResourceRequestCFNet.h:
3491         (WebCore::toResourceLoadPriority):
3492         (WebCore::toPlatformRequestPriority):
3493         * platform/network/soup/ResourceRequest.h:
3494         (WebCore::toSoupMessagePriority):
3495         * testing/Internals.cpp:
3496         (WebCore::stringToResourceLoadPriority):
3497
3498 2015-04-29  Myles C. Maxfield  <mmaxfield@apple.com>
3499
3500         [OS X] Use CTFontCreateForCSS instead of doing font search ourselves
3501         https://bugs.webkit.org/show_bug.cgi?id=132159
3502
3503         Reviewed by Darin Adler.
3504
3505         On platforms that support it, delegate font selection logic to the platform. Currently, this is
3506         only supported on Mac, using CTFontCreateForCSS().
3507
3508         This also changes the mechanism that enforces our font whitelist in our tests. We used to
3509         swizzle the implementations of NSFontManager methods. This patch migrates to using a whitelist of
3510         font family names instead.
3511
3512         Note that this patch is a work in progress, because it makes the following tests fail:
3513         fast/css/font-weight-1.html
3514         fast/forms/validation-message-appearance.html
3515         fast/forms/select/optgroup-rendering.html
3516
3517         No new tests, because there is no behavior change.
3518
3519         * platform/graphics/FontCache.h: Add a function to set the whitlist.
3520         * platform/graphics/mac/FontCacheMac.mm:
3521         (WebCore::fontWhitelist):
3522         (WebCore::FontCache::setFontWhitelist):
3523         (WebCore::toAppKitFontWeight):
3524         (WebCore::toCoreTextFontWeight):
3525         (WebCore::fontWithFamily): If ENABLE(PLATFORM_FONT_LOOKUP), use CTFontCreateForCSS().
3526         (WebCore::FontCache::createFontPlatformData):
3527         * platform/spi/cocoa/CoreTextSPI.h: Add signature for CTFontCreateForCSS().
3528
3529 2015-04-29  Jer Noble  <jer.noble@apple.com>
3530
3531         Unreviewed iOS build fix after r183553: fix declaration of QLPreviewScheme
3532
3533         * platform/ios/QuickLookSoftLink.mm:
3534
3535 2015-04-29  Eric Carlson  <eric.carlson@apple.com>
3536
3537         [Mac] Use new device picker menu API
3538         https://bugs.webkit.org/show_bug.cgi?id=144392
3539
3540         Reviewed by Jer Noble.
3541
3542         * Modules/mediasession/WebMediaSessionManager.cpp:
3543         (WebCore::WebMediaSessionManager::showPlaybackTargetPicker): Pass the route state to the picker.
3544         * platform/graphics/MediaPlaybackTargetPicker.h:
3545
3546         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
3547         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
3548         (WebCore::MediaPlaybackTargetPickerMac::MediaPlaybackTargetPickerMac):  m_deviceChangeTimer -> m_pendingActionTimer.
3549         (WebCore::MediaPlaybackTargetPickerMac::~MediaPlaybackTargetPickerMac): Ditto.
3550         (WebCore::MediaPlaybackTargetPickerMac::pendingActionTimerFired): Renamed from 
3551         outputeDeviceAvailabilityChangedTimerFired.
3552         (WebCore::MediaPlaybackTargetPickerMac::availableDevicesDidChange): Use addPendingAction.
3553         (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker): Call new picker API if it is
3554         available. New API returns true if a target is chosen, so call currentDeviceDidChange in that case.
3555         (WebCore::MediaPlaybackTargetPickerMac::addPendingAction): New.
3556         (WebCore::MediaPlaybackTargetPickerMac::currentDeviceDidChange): Make asynchronous because it 
3557         can now be called from showPlaybackTargetPicker.
3558         (WebCore::MediaPlaybackTargetPickerMac::outputeDeviceAvailabilityChangedTimerFired): Renamed
3559         pendingActionTimerFired.
3560
3561         * platform/spi/cocoa/AVKitSPI.h: Add new SPI.
3562
3563 2015-04-29  Antti Koivisto  <antti@apple.com>
3564
3565         Main resource loaded via 304 response becomes empty if reloaded by user
3566         https://bugs.webkit.org/show_bug.cgi?id=144386
3567
3568         Reviewed by Darin Adler.
3569
3570         Memory cache layer may make a main resource request conditional (add If-modified-since/If-none-match header).
3571         DocumentLoader stores the final ResourceRequest associated with document. If user triggered reload for
3572         conditionally loaded document DocumentLoader would include the same conditionals to the new request as well.
3573         Since these were not added by the memory cache it would pass any 304 response back to the DocumentLoader.
3574         However DocumentLoader has no code to handle 304 so we would end up with an empty document.
3575
3576         Test: http/tests/cache/main-resource-304-reload.html
3577
3578         * loader/DocumentLoader.cpp:
3579         (WebCore::DocumentLoader::startLoadingMainResource):
3580
3581             Ensure DocumentLoader doesn't issue conditional requests.
3582
3583 2015-04-28  Jer Noble  <jer.noble@apple.com>
3584
3585         Replace HTMLMediaElement's seek timer with a task queue.
3586         https://bugs.webkit.org/show_bug.cgi?id=144353
3587
3588         Reviewed by Eric Carlson.
3589
3590         No change in functionality, so no new tests added.
3591
3592         Replace a zero-length timer with an explicit task queue, backed by Document's postTask(). To
3593         make enqueued tasks cancellable, add a new GenericTaskQueue class modelled on
3594         GenericEventQueue which can cancel enqueued but not-yet-executed tasks.
3595
3596         * CMakeLists.txt:
3597         * WebCore.vcxproj/WebCore.vcxproj:
3598         * WebCore.vcxproj/WebCore.vcxproj.filters:
3599         * WebCore.xcodeproj/project.pbxproj:
3600         * dom/GenericTaskQueue.cpp: Added.
3601         (WebCore::GenericTaskQueue::GenericTaskQueue): Initialize ivars.
3602         (WebCore::GenericTaskQueue::enqueueTask): Wrap the task and pass it to the ScriptExecutionContext.
3603         (WebCore::GenericTaskQueue::close): Assert that the task queue will not accept any additional tasks.
3604         (WebCore::GenericTaskQueue::cancelAllTasks): Revoke outstanding weak pointers, thereby cancelling tasks.
3605         * dom/GenericTaskQueue.h: Added.
3606         (WebCore::GenericTaskQueue::hasPendingTasks):
3607         * html/HTMLMediaElement.cpp:
3608         (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize the task queue.
3609         (WebCore::HTMLMediaElement::~HTMLMediaElement): Close the task queue.
3610         (WebCore::HTMLMediaElement::seekWithTolerance): Post a task, rather than start a timer.
3611         (WebCore::HTMLMediaElement::seekTask): Renamed from seekTimerFired().
3612         (WebCore::HTMLMediaElement::seekTimerFired): Deleted.
3613         * html/HTMLMediaElement.h:
3614
3615 2015-04-28  David Kilzer  <ddkilzer@apple.com>
3616
3617         Switch QuickLook soft-linking to use QuickLookSoftLink.{h,mm}
3618         <http://webkit.org/b/144362>
3619
3620         Reviewed by Andy Estes.
3621
3622         This patch switches soft-linking of QuickLook.framework to
3623         QuickLookSoftLink.{h,mm} so that we stop exporting unintended
3624         symbols.
3625
3626         No new tests since no change in behavior.
3627
3628         * WebCore.xcodeproj/project.pbxproj:
3629         - Add QuickLookSoftLinking.{h,mm} to the project.
3630
3631         * platform/ios/QuickLookSoftLink.h: Added.
3632         * platform/ios/QuickLookSoftLink.mm: Added.
3633         * platform/mac/SoftLinking.h:
3634         (SOFT_LINK_CLASS_FOR_HEADER): Add macro.
3635         (SOFT_LINK_CLASS_FOR_SOURCE): Add macro.
3636
3637         * platform/network/ios/QuickLook.h:
3638         - Remove unused declarations.
3639
3640         * platform/network/ios/QuickLook.mm:
3641         (WebCore::QLPreviewConverterClass): Deleted.
3642         (WebCore::QLTypeCopyBestMimeTypeForFileNameAndMimeType): Deleted.
3643         (WebCore::QLTypeCopyBestMimeTypeForURLAndMimeType): Deleted.
3644         (WebCore::QLTypeCopyUTIForURLAndMimeType): Deleted.
3645         - Remove SOFT_LINK macros and unused methods after switching to
3646           new QuickLookSoftLink.{h,mm}.
3647         (WebCore::QLPreviewGetSupportedMIMETypesSet):
3648         - Switch to use NeverDestroyed<>.
3649         (WebCore::registerQLPreviewConverterIfNeeded):
3650         (createQLPreviewProtocol):
3651         (WebCore::QLPreviewProtocol):
3652         (WebCore::QuickLookHandle::QuickLookHandle):
3653         (WebCore::QuickLookHandle::create):
3654         (WebCore::QuickLookHandle::shouldCreateForMIMEType):
3655         - Simplify code when using QuickLookSoftLink.h.
3656
3657         * platform/network/ios/WebCoreURLResponseIOS.mm:
3658         - Include QuickLookSoftLink.h header.
3659
3660 2015-04-29  Darin Adler  <darin@apple.com>
3661
3662         [ES6] Implement Unicode code point escapes
3663         https://bugs.webkit.org/show_bug.cgi?id=144377
3664
3665         Reviewed by Antti Koivisto.
3666
3667         Test: js/unicode-escape-sequences.html
3668
3669         * css/CSSParser.cpp:
3670         (WebCore::CSSParser::parseEscape): Use ICU's UCHAR_MAX_VALUE instead of writing
3671         out 0x10FFFF; clearer this way. Also use our replacementCharacter instead of
3672         writing out 0xFFFD.
3673
3674         * html/parser/HTMLEntityParser.cpp:
3675         (WebCore::isAlphaNumeric): Deleted.
3676         (WebCore::HTMLEntityParser::legalEntityFor): Use ICU's UCHAR_MAX_VALUE and
3677         U_IS_SURROGATE instead of writing the code out. Didn't use U_IS_UNICODE_CHAR
3678         because that also includes U_IS_UNICODE_NONCHAR and thus would change behavior,
3679         but maye it's something we want to do in the future.
3680         (WebCore::HTMLEntityParser::consumeNamedEntity): Use isASCIIAlphanumeric instead
3681         of a the function in this file that does the same thing less efficiently.
3682
3683         * html/parser/InputStreamPreprocessor.h:
3684         (WebCore::InputStreamPreprocessor::processNextInputCharacter): Use
3685         replacementCharacter from CharacterNames.h instead of writing out 0xFFFd.
3686
3687         * xml/parser/CharacterReferenceParserInlines.h:
3688         (WebCore::consumeCharacterReference): Use ICU's UCHAR_MAX_VALUE instead of
3689         defining our own local highestValidCharacter constant.
3690
3691 2015-04-29  Martin Robinson  <mrobinson@igalia.com>
3692
3693         [CMake] [GTK] Organize and clean up unused CMake variables
3694         https://bugs.webkit.org/show_bug.cgi?id=144364
3695
3696         Reviewed by Gyuyoung Kim.
3697
3698         * PlatformGTK.cmake: Add variables specific to this project.
3699
3700 2015-04-29  Carlos Garcia Campos  <cgarcia@igalia.com>
3701
3702         REGRESSION(r182573): [GTK] The default context menu contains an empty item since r182573
3703         https://bugs.webkit.org/show_bug.cgi?id=144388
3704
3705         Reviewed by Brady Eidson.
3706
3707         There used to be a method in ContextMenuItem to check if share
3708         menu item was supported or not, but since r182573, there's a
3709         method to get the share menu item. If the returned menu item is
3710         null, it's not added to the menu, but we are not returning a null
3711         ContextMenu item even though we don't support share menu item.
3712
3713         * platform/gtk/ContextMenuItemGtk.cpp:
3714         (WebCore::ContextMenuItem::shareMenuItem): Return a null ContextMenuItem.
3715
3716 2015-04-29  Zan Dobersek  <zdobersek@igalia.com>
3717
3718         Switch to std::function<>, std::bind() in MediaPlayerPrivateAVFoundationObjC
3719         https://bugs.webkit.org/show_bug.cgi?id=144232
3720
3721         Reviewed by Darin Adler.
3722
3723         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3724         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]): 
3725         Replace uses of WTF::Function<> and WTF::bind() with the STL alternatives.
3726
3727 2015-04-29  Hyungwook Lee  <hyungwook.lee@navercorp.com>
3728
3729         Fix crash in WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::setBlock().
3730         https://bugs.webkit.org/show_bug.cgi?id=140261
3731
3732         Reviewed by Darin Adler.
3733
3734         We need to check whether RenderObject is valid in RenderView::fooSubtreeSelection functions
3735         because invalid object has caused a crash. This patch adds isValidObjectForNewSelection(), and use it.
3736
3737         * rendering/RenderView.cpp:
3738         (WebCore::isValidObjectForNewSelection):
3739         (WebCore::RenderView::clearSubtreeSelection):
3740         (WebCore::RenderView::applySubtreeSelection):
3741
3742 2015-04-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3743
3744         Synchronous XMLHttpRequest should get access to AppCache resources stored as flat files
3745         https://bugs.webkit.org/show_bug.cgi?id=143711
3746
3747         Reviewed by Darin Adler.
3748
3749         This patch checks whether a substitute resource data is stored in memory or in file for synchronous loads.
3750         If data is stored in file, it reads the data through SharedBuffer::createWithContentsOfFile.
3751         This patch refactors some routines to replace Vector<char> by SharedBuffer to transmit response data.
3752
3753         Test: http/tests/appcache/simple-video-sync.html
3754
3755         * html/HTMLMediaElement.cpp:
3756         (WebCore::HTMLMediaElement::parseAttribute):
3757         * loader/DocumentThreadableLoader.cpp:
3758         (WebCore::DocumentThreadableLoader::loadRequest):
3759         * loader/FrameLoader.cpp:
3760         (WebCore::FrameLoader::loadResourceSynchronously):
3761         * loader/FrameLoader.h:
3762         * loader/appcache/ApplicationCacheHost.cpp:
3763         (WebCore::ApplicationCacheHost::maybeLoadResource):
3764         (WebCore::ApplicationCacheHost::createFileURL):
3765         (WebCore::ApplicationCacheHost::maybeLoadSynchronously):
3766         (WebCore::ApplicationCacheHost::maybeLoadFallbackSynchronously):
3767         * loader/appcache/ApplicationCacheHost.h:
3768         * xml/XSLTProcessorLibxslt.cpp:
3769         (WebCore::docLoaderFunc):
3770         * xml/parser/XMLDocumentParserLibxml2.cpp:
3771         (WebCore::openFunc):
3772
3773 2015-04-29  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3774
3775         Purge PassRefPtr from createSVGPathSegFoo factory functions
3776         https://bugs.webkit.org/show_bug.cgi?id=144374
3777
3778         Reviewed by Darin Adler.
3779
3780         Use Ref instead of PassRefPtr in createSVGPathSegFoo functions because
3781         those factory functions can't return null. Additionally let's remove unnecessary
3782         #include<PassRefPtr.h> there.
3783
3784         No new tests, no behavior changes.
3785
3786         * svg/SVGColor.cpp:
3787         (WebCore::SVGColor::cloneForCSSOM):
3788         * svg/SVGColor.h:
3789         * svg/SVGGlyphMap.h:
3790         (WebCore::GlyphMapNode::create):
3791         * svg/SVGPaint.cpp:
3792         (WebCore::SVGPaint::cloneForCSSOM):
3793         * svg/SVGPaint.h:
3794         * svg/SVGPathElement.cpp:
3795         (WebCore::SVGPathElement::createSVGPathSegClosePath):
3796         (WebCore::SVGPathElement::createSVGPathSegMovetoAbs):
3797         (WebCore::SVGPathElement::createSVGPathSegMovetoRel):
3798         (WebCore::SVGPathElement::createSVGPathSegLinetoAbs):
3799         (WebCore::SVGPathElement::createSVGPathSegLinetoRel):
3800         (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicAbs):
3801         (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicRel):
3802         (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticAbs):
3803         (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticRel):
3804         (WebCore::SVGPathElement::createSVGPathSegArcAbs):
3805         (WebCore::SVGPathElement::createSVGPathSegArcRel):
3806         (WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalAbs):
3807         (WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalRel):
3808         (WebCore::SVGPathElement::createSVGPathSegLinetoVerticalAbs):
3809         (WebCore::SVGPathElement::createSVGPathSegLinetoVerticalRel):
3810         (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothAbs):
3811         (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothRel):
3812         (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothAbs):
3813         (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothRel):
3814         * svg/SVGPathElement.h:
3815         * svg/SVGPathSegArcAbs.h:
3816         (WebCore::SVGPathSegArcAbs::create):
3817         * svg/SVGPathSegArcRel.h:
3818         (WebCore::SVGPathSegArcRel::create):
3819         * svg/SVGPathSegClosePath.h:
3820         (WebCore::SVGPathSegClosePath::create):
3821         * svg/SVGPathSegCurvetoCubicAbs.h:
3822         (WebCore::SVGPathSegCurvetoCubicAbs::create):
3823         * svg/SVGPathSegCurvetoCubicRel.h:
3824         (WebCore::SVGPathSegCurvetoCubicRel::create):
3825         * svg/SVGPathSegCurvetoCubicSmoothAbs.h:
3826         (WebCore::SVGPathSegCurvetoCubicSmoothAbs::create):
3827         * svg/SVGPathSegCurvetoCubicSmoothRel.h:
3828         (WebCore::SVGPathSegCurvetoCubicSmoothRel::create):
3829         * svg/SVGPathSegCurvetoQuadraticAbs.h:
3830         (WebCore::SVGPathSegCurvetoQuadraticAbs::create):
3831         * svg/SVGPathSegCurvetoQuadraticRel.h:
3832         (WebCore::SVGPathSegCurvetoQuadraticRel::create):
3833         * svg/SVGPathSegCurvetoQuadraticSmoothAbs.h:
3834         (WebCore::SVGPathSegCurvetoQuadraticSmoothAbs::create):
3835         * svg/SVGPathSegCurvetoQuadraticSmoothRel.h:
3836         (WebCore::SVGPathSegCurvetoQuadraticSmoothRel::create):
3837         * svg/SVGPathSegLinetoAbs.h:
3838         (WebCore::SVGPathSegLinetoAbs::create):
3839         * svg/SVGPathSegLinetoHorizontalAbs.h:
3840         (WebCore::SVGPathSegLinetoHorizontalAbs::create):
3841         * svg/SVGPathSegLinetoHorizontalRel.h:
3842         (WebCore::SVGPathSegLinetoHorizontalRel::create):
3843         * svg/SVGPathSegLinetoRel.h:
3844         (WebCore::SVGPathSegLinetoRel::create):
3845         * svg/SVGPathSegLinetoVerticalAbs.h:
3846         (WebCore::SVGPathSegLinetoVerticalAbs::create):
3847         * svg/SVGPathSegLinetoVerticalRel.h:
3848         (WebCore::SVGPathSegLinetoVerticalRel::create):
3849         * svg/SVGPathSegMovetoAbs.h:
3850         (WebCore::SVGPathSegMovetoAbs::create):
3851         * svg/SVGPathSegMovetoRel.h:
3852         (WebCore::SVGPathSegMovetoRel::create):
3853         * svg/SVGViewSpec.h:
3854         (WebCore::SVGViewSpec::create):
3855         * svg/animation/SMILTimeContainer.h:
3856         (WebCore::SMILTimeContainer::create):
3857         * svg/animation/SVGSMILElement.cpp:
3858         (WebCore::ConditionEventListener::create):
3859         * svg/graphics/SVGImage.h:
3860         * svg/graphics/SVGImageForContainer.h:
3861         * svg/graphics/filters/SVGFilter.cpp:
3862         (WebCore::SVGFilter::create):
3863         * svg/graphics/filters/SVGFilter.h:
3864
3865 2015-04-28  Simon Fraser  <simon.fraser@apple.com>
3866
3867         Make a non-static version of FrameView::yPositionForRootContentLayer()
3868         https://bugs.webkit.org/show_bug.cgi?id=144375
3869
3870         Reviewed by Andy Estes.
3871
3872         There were two calls to the static FrameView::yPositionForRootContentLayer()
3873         which passed in all the arguments for the same FrameView. Make a member
3874         function for convenience.
3875
3876         * page/FrameView.cpp:
3877         (WebCore::FrameView::yPositionForRootContentLayer):
3878         * page/FrameView.h:
3879         * rendering/RenderLayerCompositor.cpp:
3880         (WebCore::RenderLayerCompositor::updateRootLayerPosition):
3881
3882 2015-04-28  Ryuan Choi  <ryuan.choi@navercorp.com>
3883
3884         [CoordinatedGraphics] Merge TILED_BACKING_STORE guard with COORDINATED_GRAPHICS
3885         https://bugs.webkit.org/show_bug.cgi?id=143001
3886
3887         Reviewed by Gyuyoung Kim.
3888
3889         TiledBackingStore has only been used by Coordinated Graphics since Qt and WebKit1/Efl were dropped.
3890         So, this patch replaces USE(TILED_BACKING_STORE) with USE(COORDINATED_GRAPHICS) to merge the features.
3891
3892         In addition, this moves TiledBackingStore and related files from platform to platform/texmap/coordinated
3893         where other coordinated graphics files are located.
3894
3895         * CMakeLists.txt: Move TiledBackingStore.cpp because this is not common file.
3896         * PlatformEfl.cmake:
3897         * PlatformGTK.cmake:
3898         * WebCore.vcxproj/WebCore.vcxproj: Follow new location of TiledBackingStore* files.
3899         * WebCore.vcxproj/WebCore.vcxproj.filters:
3900         * loader/EmptyClients.h:
3901         * page/Chrome.cpp:
3902         * page/Chrome.h:
3903         * page/ChromeClient.h:
3904         * page/Frame.cpp:
3905         (WebCore::Frame::createView):
3906         * page/FrameView.cpp:
3907         (WebCore::FrameView::requestScrollPositionUpdate):
3908         * page/FrameView.h:
3909         * page/Page.cpp:
3910         (WebCore::Page::setPageScaleFactor):
3911         * platform/HostWindow.h:
3912         * platform/ScrollView.cpp:
3913         (WebCore::ScrollView::unscaledVisibleContentSizeIncludingObscuredArea):
3914         (WebCore::ScrollView::unscaledUnobscuredVisibleContentSize):
3915         (WebCore::ScrollView::visibleContentRectInternal):
3916         (WebCore::ScrollView::scrollTo):
3917         * platform/ScrollView.h:
3918         * platform/graphics/cairo/TileCairo.h: Removed because it is dead code since r169328
3919         * platform/graphics/texmap/coordinated/Tile.h: Renamed from Source/WebCore/platform/graphics/Tile.h.
3920         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp: Renamed from Source/WebCore/platform/graphics/TiledBackingStore.cpp.
3921         * platform/graphics/texmap/coordinated/TiledBackingStore.h: Renamed from Source/WebCore/platform/graphics/TiledBackingStore.h.
3922         * platform/graphics/texmap/coordinated/TiledBackingStoreBackend.h: Renamed from Source/WebCore/platform/graphics/TiledBackingStoreBackend.h.
3923         * platform/graphics/texmap/coordinated/TiledBackingStoreClient.h: Renamed from Source/WebCore/platform/graphics/TiledBackingStoreClient.h.
3924
3925 2015-04-28  Brent Fulgham  <bfulgham@apple.com>
3926
3927         REGRESSION(180076): [Mac, iOS] Correct possible null dereference in printing code
3928         https://bugs.webkit.org/show_bug.cgi?id=144366
3929         <rdar://problem/20533513>
3930
3931         Reviewed by Dean Jackson.
3932
3933         * rendering/RenderBlockFlow.cpp:
3934         (WebCore::needsAppleMailPaginationQuirk): Check if the document settings is a nullptr
3935         before attempting to dereference it. 
3936
3937 2015-04-28  Andreas Kling  <akling@apple.com>
3938
3939         Simplify DOM wrapper destruction, don't deref() in finalizers.
3940         <https://webkit.org/b/144183>
3941
3942         Reviewed by Darin Adler.
3943
3944         DOM JS bindings had two mechanisms to call deref() on the WebCore object,
3945         once through a weak finalizer, and once through the JSCell's regular destructor.
3946
3947         That was once believed to be an optimization, but these days the finalizer will
3948         run just moments before the destructor anyway, all in the same call stack.
3949         And more importantly, the finalizer is not guaranteed to run, for instance in the
3950         case where a Weak is assigned to after going dead, but before the WeakBlock
3951         has been swept by the incremental sweeper.
3952
3953         Simplify this by just removing the deref() from the generated finalizers.
3954         This makes it easier to reason about DOM wrapper destruction, and eliminates
3955         the awkward time window  where a DOM wrapper could have a null impl().
3956
3957         We could spend more time on figuring out a way to have finalizers manage the
3958         destruction of these wrappers, but that would require fundamental changes to
3959         our implementation of JSC::Weak pointers. It would allow us to make JSDOMWrapper
3960         destructor-less, and shrink each wrapper object by 1 pointer (the ClassInfo*.)
3961         However the risk:reward ratio does not seem justified at this point in time.
3962
3963         * bindings/scripts/CodeGeneratorJS.pm:
3964         (GenerateHeader):
3965         (GenerateImplementation):
3966         * bindings/js/JSCSSValueCustom.cpp:
3967         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3968         (WebCore::JSTestActiveDOMObject::~JSTestActiveDOMObject):
3969         (WebCore::JSTestActiveDOMObjectOwner::finalize):
3970         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
3971         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
3972         (WebCore::JSTestCustomNamedGetter::~JSTestCustomNamedGetter):
3973         (WebCore::JSTestCustomNamedGetterOwner::finalize):
3974         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
3975         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3976         (WebCore::JSTestEventConstructor::~JSTestEventConstructor):
3977         (WebCore::JSTestEventConstructorOwner::finalize):
3978         * bindings/scripts/test/JS/JSTestEventConstructor.h:
3979         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3980         (WebCore::JSTestEventTarget::~JSTestEventTarget):
3981         (WebCore::JSTestEventTargetOwner::finalize):
3982         * bindings/scripts/test/JS/JSTestEventTarget.h:
3983         * bindings/scripts/test/JS/JSTestException.cpp:
3984         (WebCore::JSTestException::~JSTestException):
3985         (WebCore::JSTestExceptionOwner::finalize):
3986         * bindings/scripts/test/JS/JSTestException.h:
3987         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3988         (WebCore::JSTestGenerateIsReachable::~JSTestGenerateIsReachable):
3989         (WebCore::JSTestGenerateIsReachableOwner::finalize):