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