Scroll-snap animations should not start on axes with zero-delta
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-05-19  Brent Fulgham  <bfulgham@apple.com>
2
3         Scroll-snap animations should not start on axes with zero-delta
4         https://bugs.webkit.org/show_bug.cgi?id=145148
5
6         Reviewed by Dean Jackson.
7
8         Don't begin a scroll snap animation on an axis that had no change in position (on that axis)
9         during the gesture.
10
11         * platform/cocoa/ScrollController.mm:
12         (WebCore::ScrollController::processWheelEventForScrollSnapOnAxis): Don't begin a scroll snap
13         animation if no movement on this axis was ever made.
14
15 2015-05-19  Youenn Fablet  <youenn.fablet@crf.canon.fr>
16
17         AudioContext should resolve promises with jsUndefined() and not jsNull()
18         https://bugs.webkit.org/show_bug.cgi?id=145063
19
20         Reviewed by Sam Weinig.
21
22         Covered by updated test.
23
24         * bindings/js/JSDOMPromise.h:
25         (WebCore::DeferredWrapper::resolve): resolving std::nullptr_t as jsUndefined() and not jsNull()
26
27 2015-05-19  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
28
29         [Streams API] Migrate closed promise handling from ReadableStreamReader to ReadableStream
30         https://bugs.webkit.org/show_bug.cgi?id=145110
31
32         Reviewed by Darin Adler.
33
34         Reader is now just checking whether it is the reader locking the stream or not.
35         If not and stream is readable, it resolves the closed promise.
36         Otherwise, it delegates the promise handling to its stream.
37
38         No change in behavior.
39
40         * Modules/streams/ReadableStream.cpp:
41         (WebCore::ReadableStream::cleanCallbacks): Cleaning of closed callbacks.
42         (WebCore::ReadableStream::changeStateToClosed): Resolving closed promise if set.
43         (WebCore::ReadableStream::changeStateToErrored): Rejecting closed promise if set.
44         (WebCore::ReadableStream::getReader): Removed reader state notification.
45         (WebCore::ReadableStream::closed): Moved from reader to stream.
46         * Modules/streams/ReadableStream.h:
47         (WebCore::ReadableStream::reader): Added to allow reader to check whether it is locking its stream or not.
48         (WebCore::ReadableStream::isReadable): Added as an improvement over internalState which is removed.
49         (WebCore::ReadableStream::internalState): Deleted.
50         * Modules/streams/ReadableStreamReader.cpp:
51         (WebCore::ReadableStreamReader::closed):
52         * Modules/streams/ReadableStreamReader.h: Removed state and closed promise callbacks.
53         * bindings/js/JSReadableStreamControllerCustom.cpp:
54         (WebCore::JSReadableStreamController::close): Refactoring of internalState to isReadable.
55         (WebCore::JSReadableStreamController::error): Ditto.
56         * bindings/js/JSReadableStreamReaderCustom.cpp:
57         (WebCore::JSReadableStreamReader::closed): Refactoring to have the promise value as callback parameter.
58
59 2015-05-19  Jeremy Jones  <jeremyj@apple.com>
60
61         Remove use of deprecated AVKit SPI cancelOptimizedFullscreen.
62         https://bugs.webkit.org/show_bug.cgi?id=145159
63
64         Reviewed by Eric Carlson.
65
66         Remove cancelOptimizedFullscreen, and use stopOptimizedFullscreen instead.
67
68         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
69         (WebVideoFullscreenInterfaceAVKit::cleanupFullscreenInternal):
70         * platform/spi/cocoa/AVKitSPI.h: remove declaration.
71
72 2015-05-19  Zalan Bujtas  <zalan@apple.com>
73
74         Merged anonymous blocks should invalidate simple line layout path.
75         https://bugs.webkit.org/show_bug.cgi?id=145104
76         rdar://problem/20980930
77
78         Reviewed by Antti Koivisto.
79
80         When anonymous blocks are merged together, it's not guaranteed that the final block can use simple line layout.
81         This patch ensures that the flow block, where the other block's content gets moved to, is no longer on simple line layout path.
82         Whether the final flow block ends up using inline boxes or simple line layout will be determined during the next layout.
83
84         Test: fast/block/crash-when-anonymous-blocks-are-merged-with-simple-line-layout.html
85
86         * rendering/RenderElement.cpp:
87         (WebCore::RenderElement::insertChildInternal):
88
89 2015-05-19  Beth Dakin  <bdakin@apple.com>
90
91         Crash in WebCore::RenderLayer::updateScrollbarsAfterLayout
92         https://bugs.webkit.org/show_bug.cgi?id=145142
93
94         Reviewed by Simon Fraser.
95
96         I have not been able to reproduce this crash, but according to symbolication 
97         m_vBar is null. It seems like this crash was probably caused by 
98         http://trac.webkit.org/changeset/173668 which made it so that overflow:scroll 
99         behaves like overflow:auto when the scrollbars are overlay. I can see how you 
100         could encounter this crash with that change if the layout caused 
101         styleRequiresScrollbar() to return true when it used to return false. Then this 
102         code, by failing to null-check the scrollbars, assumes that 
103         styleRequiresScrollbar() could not have changed based on a layout. But it could 
104         change if the css changed the scrollbars to be custom or if the user managed 
105         switch to legacy style scrollbars at just the wrong time. Or I suppose it could 
106         also happen if the user has legacy scrollbars and the style switched from auto to 
107         scroll during the layout.
108
109         Anyway, we should null-check  the scrollbars. This is a speculative fix.
110         * rendering/RenderLayer.cpp:
111         (WebCore::RenderLayer::updateScrollbarsAfterLayout):
112
113 2015-05-19  Hunseop Jeong  <hs85.jeong@samsung.com>
114
115         Use modern for-loops in WebCore/xml.
116         https://bugs.webkit.org/show_bug.cgi?id=145046
117
118         Reviewed by Chris Dumez.
119
120         No new tests, no new tests.
121
122         * xml/XMLHttpRequest.cpp:
123         (WebCore::XMLHttpRequest::uppercaseKnownHTTPMethod):
124         * xml/XPathExpressionNode.cpp:
125         (WebCore::XPath::Expression::setSubexpressions):
126         * xml/XPathFunctions.cpp:
127         (WebCore::XPath::FunSum::evaluate):
128         (WebCore::XPath::populateFunctionMap):
129         * xml/XPathNodeSet.cpp:
130         (WebCore::XPath::NodeSet::traversalSort):
131         * xml/XPathParser.cpp:
132         (WebCore::XPath::populateAxisNamesMap):
133         * xml/XPathPath.cpp:
134         (WebCore::XPath::Filter::evaluate):
135         (WebCore::XPath::LocationPath::evaluate):
136         * xml/XPathPredicate.cpp:
137         (WebCore::XPath::EqTestOp::compare):
138         (WebCore::XPath::Union::evaluate):
139         * xml/XPathStep.cpp:
140         (WebCore::XPath::Step::optimize):
141         (WebCore::XPath::Step::predicatesAreContextListInsensitive):
142         (WebCore::XPath::Step::evaluate):
143         (WebCore::XPath::nodeMatches):
144         * xml/XSLStyleSheetLibxslt.cpp:
145         (WebCore::XSLStyleSheet::~XSLStyleSheet):
146         (WebCore::XSLStyleSheet::isLoading):
147         (WebCore::XSLStyleSheet::clearDocuments):
148         (WebCore::XSLStyleSheet::locateStylesheetSubResource):
149         * xml/XSLTProcessorLibxslt.cpp:
150         (WebCore::xsltParamArrayFromParameterMap):
151
152 2015-05-19  Jon Lee  <jonlee@apple.com>
153
154         Improve text rendering of placeholder
155         https://bugs.webkit.org/show_bug.cgi?id=145135
156
157         Reviewed by Eric Carlson.
158
159         * Modules/mediacontrols/mediaControlsApple.css: The <p> elements of the wireless playback
160         text are being popped out into separate layers, causing the text to render antialiased, which
161         looks bad on non-retina machines. Explicitly set the background color (which is ok since the
162         container element for the placeholder is also black). Also extend the height out 1pt to prevent
163         clipping of descenders.
164         (audio::-webkit-media-controls-wireless-playback-text-top): Set background color to black and add
165         1 to the height.
166         (audio::-webkit-media-controls-wireless-playback-text-bottom): Ditto.
167
168 2015-05-19  Jon Lee  <jonlee@apple.com>
169
170         [iOS] Current time display should be right-aligned
171         https://bugs.webkit.org/show_bug.cgi?id=145163
172         rdar://problem/21014339
173
174         Reviewed by Eric Carlson.
175
176         * Modules/mediacontrols/mediaControlsiOS.css: Use flex-start and flex-end
177         instead of right and left, similar to the Mac controls.
178         (video::-webkit-media-controls-current-time-display):
179         (video::-webkit-media-controls-time-remaining-display):
180
181 2015-05-14  Chris Fleizach  <cfleizach@apple.com>
182
183         AX: Select text mechanism returns results outside of text control regions
184         https://bugs.webkit.org/show_bug.cgi?id=145041
185
186         Reviewed by Mario Sanchez Prada.
187
188         The behavior of the select text mechanism (inside accessibility) should make sure that results
189         returned stay within text control elements if the search was initiated inside a text control element.
190
191         Test: platform/mac/accessibility/select-text-stays-inside-text-controls.html
192
193         * accessibility/AccessibilityObject.cpp:
194         (WebCore::rangeClosestToRange):
195         (WebCore::AccessibilityObject::selectText):
196
197 2015-05-19  Chris Dumez  <cdumez@apple.com>
198
199         Mark static variables as const when possible
200         https://bugs.webkit.org/show_bug.cgi?id=145161
201
202         Reviewed by Andreas Kling.
203
204         * Modules/mediasession/WebMediaSessionManager.cpp:
205         * Modules/mediasource/SourceBuffer.cpp:
206         * Modules/webdatabase/SQLException.cpp:
207         * dom/DOMCoreException.cpp:
208         * inspector/NetworkResourcesData.cpp:
209         * loader/icon/IconDatabase.cpp:
210         (WebCore::urlForLogging):
211         * page/AutoscrollController.cpp:
212         * page/Page.cpp:
213         * platform/RuntimeApplicationChecksIOS.mm:
214         (WebCore::applicationIsAdSheet):
215         (WebCore::applicationIsMobileMail):
216         (WebCore::applicationIsMobileSafari):
217         (WebCore::applicationIsDumpRenderTree):
218         (WebCore::applicationIsWebApp):
219         (WebCore::applicationIsOkCupid):
220         (WebCore::applicationIsFacebook):
221         (WebCore::applicationIsEpicurious):
222         (WebCore::applicationIsDaijisenDictionary):
223         (WebCore::applicationIsNASAHD):
224         (WebCore::applicationIsMASH):
225         (WebCore::applicationIsTheEconomistOnIPhone):
226         (WebCore::applicationIsWebProcess):
227         (WebCore::applicationIsIBooksOnIOS):
228         * platform/audio/HRTFElevation.cpp:
229         * platform/audio/mac/AudioHardwareListenerMac.cpp:
230         (WebCore::processIsRunningPropertyDescriptor):
231         (WebCore::outputDevicePropertyDescriptor):
232         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
233         * platform/graphics/ca/GraphicsLayerCA.cpp:
234         * platform/graphics/mac/FontCacheMac.mm:
235         (WebCore::toCoreTextFontWeight):
236         (WebCore::toAppKitFontWeight):
237         (WebCore::toNSFontWeight):
238         * platform/mac/ScrollAnimatorMac.mm:
239         (supportsUIStateTransitionProgress):
240         (supportsExpansionTransitionProgress):
241         (supportsContentAreaScrolledInDirection):
242         * platform/mac/ScrollbarThemeMac.mm:
243         * platform/mac/WebCoreNSURLExtras.mm:
244         (WebCore::dataForURLComponentType):
245         * platform/mock/ScrollbarThemeMock.cpp:
246         * platform/text/icu/UTextProviderLatin1.cpp:
247         * platform/text/ios/LocalizedDateCache.mm:
248         (WebCore::LocalizedDateCache::calculateMaximumWidth):
249         * rendering/RenderBlockLineLayout.cpp:
250         (WebCore::RenderBlockFlow::matchedEndLine):
251         * rendering/RenderBoxModelObject.cpp:
252         (WebCore::RenderBoxModelObject::paintTranslucentBorderSides):
253         * rendering/RenderFrameBase.cpp:
254         (WebCore::shouldExpandFrame):
255         * rendering/RenderTableSection.cpp:
256         * rendering/RenderThemeIOS.mm:
257         (WebCore::getInsetGradient):
258         (WebCore::getShineGradient):
259         (WebCore::getShadeGradient):
260         (WebCore::getConvexGradient):
261         (WebCore::getConcaveGradient):
262         (WebCore::getSliderTrackGradient):
263         (WebCore::getReadonlySliderTrackGradient):
264         (WebCore::getSliderThumbOpaquePressedGradient):
265         (WebCore::RenderThemeIOS::paintCheckboxDecorations):
266         (WebCore::RenderThemeIOS::paintRadioDecorations):
267         * rendering/RenderThemeMac.mm:
268         (WebCore::toFontWeight):
269         (WebCore::TopGradientInterpolate):
270         (WebCore::BottomGradientInterpolate):
271         (WebCore::MainGradientInterpolate):
272         (WebCore::TrackGradientInterpolate):
273
274 2015-05-18  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
275
276         Use Ref instead of PassRefPtr in WebCore/bindings
277         https://bugs.webkit.org/show_bug.cgi?id=144981
278
279         Reviewed by Darin Adler.
280
281         As a step to purge PassRefPtr, remove PassRefPtr in WebCore/bindings.
282
283         No new tests, no behavior changes.
284
285         * bindings/gobject/GObjectNodeFilterCondition.h:
286         (WebCore::GObjectNodeFilterCondition::create):
287         * bindings/gobject/GObjectXPathNSResolver.h:
288         (WebCore::GObjectXPathNSResolver::create):
289         * bindings/js/JSCustomXPathNSResolver.cpp:
290         (WebCore::JSCustomXPathNSResolver::create):
291         * bindings/js/JSCustomXPathNSResolver.h:
292         * bindings/js/JSDOMGlobalObjectTask.cpp:
293         * bindings/js/JSErrorHandler.h:
294         (WebCore::JSErrorHandler::create):
295         * bindings/js/JSLazyEventListener.cpp:
296         (WebCore::JSLazyEventListener::createForNode):
297         (WebCore::JSLazyEventListener::createForDOMWindow):
298         * bindings/js/JSLazyEventListener.h:
299         * bindings/js/JSMutationCallback.h:
300         (WebCore::JSMutationCallback::create):
301         * bindings/js/JSNodeFilterCondition.h:
302         (WebCore::JSNodeFilterCondition::create):
303         * bindings/js/SerializedScriptValue.cpp:
304         (WebCore::SerializedScriptValue::create):
305         (WebCore::SerializedScriptValue::numberValue):
306         (WebCore::SerializedScriptValue::undefinedValue):
307         (WebCore::SerializedScriptValue::nullValue):
308         * bindings/js/SerializedScriptValue.h:
309         * bindings/objc/ObjCEventListener.h:
310         * bindings/objc/ObjCEventListener.mm:
311         (WebCore::ObjCEventListener::wrap):
312         * bindings/objc/ObjCNodeFilterCondition.h:
313         (WebCore::ObjCNodeFilterCondition::create):
314
315 2015-05-18  Csaba Osztrogonác  <ossy@webkit.org>
316
317         Fix uninitialized warnings in RealtimeMediaSourceCenterOwr.cpp
318         https://bugs.webkit.org/show_bug.cgi?id=145119
319
320         Reviewed by Gyuyoung Kim.
321
322         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
323         (WebCore::RealtimeMediaSourceCenterOwr::validateRequestConstraints):
324         (WebCore::RealtimeMediaSourceCenterOwr::mediaSourcesAvailable):
325
326 2015-05-18  Michael Catanzaro  <mcatanzaro@igalia.com>
327
328         [CMake] Ignore warnings in system headers
329         https://bugs.webkit.org/show_bug.cgi?id=144747
330
331         Reviewed by Darin Adler.
332
333         Separate include directories into WebKit project includes and system includes. Suppress all
334         warnings from headers in system include directories using the SYSTEM argument to
335         the include_directories command.
336
337         * CMakeLists.txt:
338         * PlatformEfl.cmake:
339         * PlatformGTK.cmake:
340         * PlatformMac.cmake:
341
342 2015-05-18  Myles C. Maxfield  <mmaxfield@apple.com>
343
344         Addressing post-review comments on r184353
345         https://bugs.webkit.org/show_bug.cgi?id=145146
346
347         Reviewed by Benjamin Poulain.
348
349         See per-file comments.
350
351         No new tests because there is no behavior change.
352
353         * platform/graphics/mac/FontCacheMac.mm:
354         (WebCore::fontWithFamilySpecialCase): Use equalIgnoringASCIICase() AtomicString overload.
355         * rendering/RenderThemeMac.mm:
356         (WebCore::RenderThemeMac::updateCachedSystemFontDescription): Implement Ben's ideas for
357         cheaply constructing AtomicStrings only when necessary.
358
359 2015-05-18  Skachkov Alexandr  <gskachkov@gmail.com>
360
361         [ES6] Arrow function syntax. Feature flag for arrow function
362         https://bugs.webkit.org/show_bug.cgi?id=145108
363
364         Reviewed by Ryosuke Niwa.
365
366         Added feature flag ENABLE_ES6_ARROWFUNCTION_SYNTAX for arrow function
367
368         * Configurations/FeatureDefines.xcconfig:
369
370 2015-05-18  Brent Fulgham  <bfulgham@apple.com>
371
372         REGRESSION(142590): Scroll-snap points are improperly snapping to earlier index values
373         https://bugs.webkit.org/show_bug.cgi?id=145140
374         <rdar://problem/21006738>
375
376         Reviewed by Beth Dakin.
377
378         The new "nearestActiveSnapPoint" logic is firing while scroll snap animations are running. We need
379         to add an "isScrollSnapInProgress" predicate, much like the existing "isRubberBandInProgress" to avoid
380         certain "fix-up" logic that we don't want running while we are in the process of moving to a new position.
381
382         * platform/ScrollAnimator.h:
383         (WebCore::ScrollAnimator::ScrollAnimator::isScrollSnapInProgress): Added.
384         * platform/ScrollableArea.cpp:
385         (WebCore::ScrollableArea::updateScrollSnapState): If we are in the midst of a scroll snap operation,
386         do not attempt to reset position to the current active snap point.
387         * platform/cocoa/ScrollController.h:
388         * platform/cocoa/ScrollController.mm:
389         (WebCore::ScrollController::isScrollSnapInProgress): Added.
390         * platform/mac/ScrollAnimatorMac.h:
391         * platform/mac/ScrollAnimatorMac.mm:
392         (WebCore::ScrollAnimatorMac::isScrollSnapInProgress): Added.
393
394 2015-05-17  Manuel Rego Casasnovas  <rego@igalia.com>
395
396         [CSS Grid Layout] Add scrollbar width in intrinsic logical widths computation
397         https://bugs.webkit.org/show_bug.cgi?id=145021
398
399         Like for flexboxes we've to take into account the scrollbar logical
400         width while computing the intrinsic min and max logical widths.
401
402         Reviewed by Sergio Villar Senin.
403
404         Test: fast/css-grid-layout/compute-intrinsic-widths-scrollbar.html
405
406         * rendering/RenderGrid.cpp:
407         (WebCore::RenderGrid::computeIntrinsicLogicalWidths): Add scrollbar
408         logical width.
409
410 2015-05-17  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
411
412         [Streams API] Delegate ReadableStreamReader reference counting to ReadableStream
413         https://bugs.webkit.org/show_bug.cgi?id=144907
414
415         Reviewed by Darin Adler.
416
417         Changed the link between readadable stream and reader.
418         Controller ref()/deref() now increments/decrements its stream ref counter, similarly to ReadableStreamController.
419         This ensures that even if JS scripts do not keep track of the readable stream,
420         the readable stream will not be disposed as long as the JS script has access to its reader.
421
422         All readers of a given stream are kept by the stream, either in an array (for released readers) 
423         or and in ReadableStream::m_reader for the active reader.
424         This removes the need for the code synchronizing stream and reader.
425
426         As a reader can now already count on its stream, the reader no longer needs to store the error in errored state.
427         Removal of ReadableJSStream::Reader as closed promise rejection error is directly retrieved from the ReadableStream.
428         Moved the creation of reader directly in ReadableStream.
429
430         Next step should be to remove ReadableStreamReader::m_state and to delegate the handling of ReadableStreamReader closed promise callbacks to ReadableStream.
431
432         No change in behavior.
433
434         * Modules/streams/ReadableStream.cpp:
435         (WebCore::ReadableStream::changeStateToClosed):
436         (WebCore::ReadableStream::changeStateToErrored):
437         (WebCore::ReadableStream::getReader):
438         * Modules/streams/ReadableStream.h:
439         (WebCore::ReadableStream::reader):
440         * Modules/streams/ReadableStreamReader.cpp:
441         (WebCore::ReadableStreamReader::clean):
442         (WebCore::ReadableStreamReader::ref):
443         (WebCore::ReadableStreamReader::deref):
444         (WebCore::ReadableStreamReader::closed):
445         (WebCore::ReadableStreamReader::changeStateToClosed):
446         (WebCore::ReadableStreamReader::changeStateToErrored):
447         * Modules/streams/ReadableStreamReader.h:
448         (WebCore::ReadableStreamReader::ReadableStreamReader):
449         * Modules/streams/ReadableStreamReader.idl:
450         * bindings/js/JSReadableStreamCustom.cpp:
451         (WebCore::JSReadableStream::getReader):
452         * bindings/js/JSReadableStreamReaderCustom.cpp:
453         (WebCore::JSReadableStreamReader::closed):
454         (WebCore::constructJSReadableStreamReader):
455         * bindings/js/ReadableJSStream.cpp:
456         (WebCore::ReadableJSStream::storeError):
457         (WebCore::ReadableJSStream::ReadableJSStream): Deleted.
458         * bindings/js/ReadableJSStream.h:
459
460 2015-05-17  Alexey Proskuryakov  <ap@apple.com>
461
462         Crash when uploading huge files to YouTube or Google Drive
463         https://bugs.webkit.org/show_bug.cgi?id=145083
464         rdar://problem/15468529
465
466         Reviewed by Darin Adler.
467
468         This fixes the crash, but uploading will fail.
469
470         * fileapi/FileReaderLoader.cpp:
471         (WebCore::FileReaderLoader::start): Tell SubresourceLoader to not store a copy of
472         all received data, FileReaderLoader has its own buffer.
473         (WebCore::FileReaderLoader::didReceiveResponse): Fixed a bounds check - not every
474         64-bit value that doesn't fit into 32 bits is negative. With this, FileReader fails
475         on huge files right away, as intended.
476         (WebCore::FileReaderLoader::didReceiveData): Fixed multiple bugs in code that's
477         executed when size is not available upfront. This is the code that used to crash,
478         but with the above fix, it's not executed by YouTube.
479         Not only overflow was handled incorrectly, but even simply growing a buffer for
480         append was buggy.
481
482 2015-05-16  Zalan Bujtas  <zalan@apple.com>
483
484         REGRESSION (Subpixel): Dashed underline is missing when box is positioned at subpixels.
485         https://bugs.webkit.org/show_bug.cgi?id=145097
486         rdar://problem/18588415
487
488         Reviewed by Simon Fraser.
489
490         Dashed and dotted border painting needs clipping in order to properly display corners.
491         Similarly to solid border's quad calculation, we pixelsnap the border positions before computing the clipping quad values.
492
493         Test: fast/borders/dashed-border-on-subpixel-position.html
494               fast/borders/dotted-border-on-subpixel-position.html
495
496         * rendering/RenderBoxModelObject.cpp:
497         (WebCore::RenderBoxModelObject::clipBorderSidePolygon):
498
499 2015-05-16  Sungmann Cho  <sungmann.cho@navercorp.com>
500
501         Remove styleText() and applyStyleText() from InspectorStyle.
502         https://bugs.webkit.org/show_bug.cgi?id=145093
503
504         Reviewed by Darin Adler.
505
506         styleText() and applyStyleText() in InspectorStyle are private aliases for the public
507         accessors in the same class but are rarely used. I think it would be better off removing
508         these aliases and updating all the current call sites to use the public accessors directly
509         as noted in InspectorStyleSheet.h.
510
511         No new tests, no behavior change.
512
513         * inspector/InspectorStyleSheet.cpp:
514         (WebCore::InspectorStyle::populateAllProperties):
515         * inspector/InspectorStyleSheet.h:
516
517 2015-05-16  Sungmann Cho  <sungmann.cho@navercorp.com>
518
519         Remove MessageType variant of addMessageToConsole() from ChromeClient.
520         https://bugs.webkit.org/show_bug.cgi?id=145095
521
522         Reviewed by Darin Adler.
523
524         All addMessageToConsole() in ChromeClient are exactly the same thing.
525         So there is no reason to keep all this methods.
526
527         No new tests, no behavior change.
528
529         * page/ChromeClient.h:
530         * page/PageConsoleClient.cpp:
531         (WebCore::PageConsoleClient::messageWithTypeAndLevel):
532
533 2015-05-15  Sam Weinig  <sam@webkit.org>
534
535         Add getElementById to DocumentFragment
536         https://bugs.webkit.org/show_bug.cgi?id=145094
537
538         Reviewed by Alexey Proskuryakov.
539
540         Match the latest DOM standard and other browsers by adding getElementById
541         to DocumentFragment in addition to Document and SVGSVGElement. Add NonElementParentNode
542         interface that the DOM standard defines.
543
544         Test: fast/dom/DocumentFragment/getElementById.html
545
546         * DerivedSources.make:
547         * WebCore.xcodeproj/project.pbxproj:
548         Add NonElementParentNode.idl
549
550         * dom/Document.idl:
551         Mark Document as implementing NonElementParentNode and remove now redundant getElementById
552         declaration.
553
554         * dom/DocumentFragment.cpp:
555         (WebCore::DocumentFragment::getElementById):
556         * dom/DocumentFragment.h:
557         Add implementation of getElementById for DocumentFragments. Add a fast path for ShadowRoots
558         which can take advantage of the fact that they are TreeScopes to use the elements by id cache
559         in TreeScrope.
560
561         * dom/DocumentFragment.idl:
562         Mark DocumentFragment as implementing NonElementParentNode.
563
564         * dom/NonElementParentNode.idl: Copied from Source/WebCore/dom/NonDocumentTypeChildNode.idl.
565         Added.
566
567         * svg/SVGSVGElement.cpp:
568         (WebCore::SVGSVGElement::getElementById):
569         * svg/SVGSVGElement.h:
570         * svg/SVGSVGElement.idl:
571         Convert to taking an AtomicString to match other getElementByIds.
572
573 2015-05-15  Antti Koivisto  <antti@apple.com>
574
575         When redirecting to data URL use HTTP response for same origin policy checks
576         https://bugs.webkit.org/show_bug.cgi?id=145054
577         rdar://problem/20299050
578
579         Reviewed by Alexey Proskuryakov.
580
581         Test: http/tests/security/canvas-remote-read-data-url-image-redirect.html
582
583         * dom/ScriptElement.cpp:
584         (WebCore::ScriptElement::notifyFinished):
585         * dom/ScriptExecutionContext.cpp:
586         (WebCore::ScriptExecutionContext::sanitizeScriptError):
587         * html/canvas/CanvasRenderingContext.cpp:
588         (WebCore::CanvasRenderingContext::wouldTaintOrigin):
589         * loader/ImageLoader.cpp:
590         (WebCore::ImageLoader::notifyFinished):
591         * loader/MediaResourceLoader.cpp:
592         (WebCore::MediaResourceLoader::responseReceived):
593         * loader/TextTrackLoader.cpp:
594         (WebCore::TextTrackLoader::notifyFinished):
595         * loader/cache/CachedImage.cpp:
596         (WebCore::CachedImage::isOriginClean):
597         * loader/cache/CachedResource.cpp:
598         (WebCore::CachedResource::passesAccessControlCheck):
599         (WebCore::CachedResource::passesSameOriginPolicyCheck):
600
601             Factor repeatedly used same origin policy test into a function.
602
603         (WebCore::CachedResource::redirectReceived):
604
605             When redirecting to a data URL save the redirect response.
606
607         (WebCore::CachedResource::responseForSameOriginPolicyChecks):
608
609             In case we got redirected to data use that response instead of the final data response for policy checks.
610
611         * loader/cache/CachedResource.h:
612
613 2015-05-16  Jon Lee  <jonlee@apple.com>
614
615         [iOS] wireless playback picker button is drawn incorrectly
616         https://bugs.webkit.org/show_bug.cgi?id=145057
617         rdar://problem/20877518
618
619         Reviewed by Jer Noble.
620
621         * Modules/mediacontrols/mediaControlsiOS.js:
622         (ControllerIOS.prototype.updateWirelessTargetPickerButton): This method is
623         defined in Controller, but is only meant to run on Macs. Override it with
624         an empty function for iOS.
625
626 2015-05-15  Simon Fraser  <simon.fraser@apple.com>
627
628         REGRESSION (r183300): Background missing on top links on apple.com
629         https://bugs.webkit.org/show_bug.cgi?id=145079
630         rdar://problem/20914252
631
632         Reviewed by Tim Horton.
633         
634         Re-land r184421 with a fix to check against rects.coverageRect
635         rather than the stale m_coverageRect.
636
637         Test: compositing/visible-rect/backing-change-height-from-zero.html
638
639         * platform/graphics/ca/GraphicsLayerCA.cpp:
640         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
641         * rendering/RenderLayerBacking.cpp:
642         (WebCore::RenderLayerBacking::shouldSkipLayerInDump):
643
644 2015-05-15  Matt Baker  <mattbaker@apple.com>
645
646         Web Inspector: REGRESSION (r181625): Timeline recording started from console.profile is always empty
647         https://bugs.webkit.org/show_bug.cgi?id=144882
648
649         Reviewed by Joseph Pecoraro.
650
651         A timeline recording will always be stopped before the end of the current run loop is observed. Before
652         dispatching the recording stopped event, any events that are currently in progress should be considered
653         complete and sent to the frontend.
654
655         * inspector/InspectorTimelineAgent.cpp:
656         (WebCore::InspectorTimelineAgent::internalStop):
657
658 2015-05-15  Commit Queue  <commit-queue@webkit.org>
659
660         Unreviewed, rolling out r184421.
661         https://bugs.webkit.org/show_bug.cgi?id=145087
662
663         Introduced 42 layout test failures (Requested by rniwa on
664         #webkit).
665
666         Reverted changeset:
667
668         "REGRESSION (r183300): Background missing on top links on
669         apple.com"
670         https://bugs.webkit.org/show_bug.cgi?id=145079
671         http://trac.webkit.org/changeset/184421
672
673 2015-05-15  Simon Fraser  <simon.fraser@apple.com>
674
675         REGRESSION (r183300): Background missing on top links on apple.com
676         https://bugs.webkit.org/show_bug.cgi?id=145079
677         rdar://problem/20914252
678
679         Reviewed by Tim Horton.
680
681         GraphicsLayerCA::setVisibleAndCoverageRects() only set the m_intersectsCoverageRect
682         flag if the coverage rect changed, but it doesn't if you simply change the size of
683         the layer.
684
685         Instead, always re-evaluate the intersection, and set the CoverageRectChanged bit
686         if it changes.
687
688         Test: compositing/visible-rect/backing-change-height-from-zero.html
689
690         * platform/graphics/ca/GraphicsLayerCA.cpp:
691         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
692         * rendering/RenderLayerBacking.cpp:
693         (WebCore::RenderLayerBacking::shouldSkipLayerInDump): Don't skip any layers in a
694         debug layer dump, to assist debugging.
695
696 2015-05-15  Sam Weinig  <sam@webkit.org>
697
698         Move HTMLElement's children property to ParentNode
699         https://bugs.webkit.org/show_bug.cgi?id=145072
700
701         Reviewed by Chris Dumez.
702
703         Match the latest DOM standard and other browsers by moving the children property
704         to ParentNode, thus exposing it on Element, Document and DocumentFragment.
705
706         Test: fast/dom/ParentNode-children.html
707
708         * dom/ContainerNode.cpp:
709         (WebCore::ContainerNode::children):
710         Moved implementation from HTMLElement to here.
711
712         (WebCore::ContainerNode::ensureCachedHTMLCollection):
713         (WebCore::ContainerNode::cachedHTMLCollection):
714         Moved implementation from Element to here so that ContainerNode::children
715         can use it.
716
717         (WebCore::ContainerNode::firstElementChild):
718         (WebCore::ContainerNode::lastElementChild):
719         (WebCore::ContainerNode::childElementCount):
720         Remove unnecessary assertions.
721
722         * dom/ContainerNode.h:
723         Moved declarations from HTMLElement and Element to here.
724
725         * dom/Element.cpp:
726         (WebCore::Element::ensureCachedHTMLCollection): Deleted.
727         (WebCore::Element::cachedHTMLCollection): Deleted.
728         * dom/Element.h:
729         Moved to ContainerNode.
730
731         * dom/Node.cpp:
732         (WebCore::Node::previousElementSibling):
733         (WebCore::Node::nextElementSibling):
734         Remove unnecessary assertions.
735
736         * dom/ParentNode.idl:
737         Moved the children property here from HTMLElement.
738
739         * html/HTMLElement.cpp:
740         (WebCore::HTMLElement::children): Deleted.
741         * html/HTMLElement.h:
742         Moved to ContainerNode.
743
744         * html/HTMLElement.idl:
745         Get rid of the children property for all bindings except Objective-C which needs
746         to keep it to avoid changing the public API.
747
748 2015-05-15  Zalan Bujtas  <zalan@apple.com>
749
750         WebCore ASan debug build fails. ERROR: WebCore has a weak external symbol in it.
751         https://bugs.webkit.org/show_bug.cgi?id=145070
752
753         Reviewed by David Kilzer.
754
755         Build fix.
756
757         * Configurations/WebCore.unexp:
758
759 2015-05-15  Beth Dakin  <bdakin@apple.com>
760
761         Prefix force on MouseEvent and add constants for click and force click values
762         https://bugs.webkit.org/show_bug.cgi?id=145065
763         -and corresponding-
764         rdar://problem/20770052
765
766         Reviewed by Tim Horton.
767
768         (WebCore::MouseEvent::webkitForce):
769         * dom/MouseEvent.idl:
770
771 2015-05-15  Jer Noble  <jer.noble@apple.com>
772
773         [MediaControls] Refactor media controls & bring improvements made to iOS controls to Mac.
774         https://bugs.webkit.org/show_bug.cgi?id=144973
775
776         Reviewed by Dean Jackson.
777
778         Pull improvements made to the iOS media controls back into the Mac controls by moving
779         code from mediaControlsiOS.js into MediaControlsApple.js.
780
781         The largest refactored feature is the ability to drop individual controls from the media
782         controls when the video is too small to contain them. To allow these controls to resize
783         dynamically, a new "resize" event is fired inside the media element's shadow DOM.
784
785         * Modules/mediacontrols/mediaControlsApple.css:
786         (audio::-webkit-media-controls-panel .dropped): Added; sets "display: none".
787         * Modules/mediacontrols/mediaControlsApple.js:
788         (Controller): Set defaults for new variables.
789         (Controller.prototype.updateControls): Update the controls width; moved from iOS.js.
790         (Controller.prototype.handleReadyStateChange): Update the controls; moved from iOS.js.
791         (Controller.prototype.handleTimeUpdate): Update the progress; moved from iOS.js.
792         (Controller.prototype.handleTimelineInput): Pause if scrubbing; moved from iOS.js.
793         (Controller.prototype.handleTimelineChange): Update the progress; moved from iOS.js.
794         (Controller.prototype.showControls): Update the controls width; moved from iOS.js.
795         (Controller.prototype.hideControls): Removed _potentiallyScrubbing check; not needed due to changes
796             to controlsAlwaysVisible().
797         (Controller.prototype.scheduleUpdateLayoutForDisplayedWidth): Moved from iOS.js.
798         (Controller.prototype.isControlVisible): Added; checks whether control is parented & not hidden.
799         (Controller.prototype.updateLayoutForDisplayedWidth): Moved from iOS.js and refactored.
800         (Controller.prototype.controlsAlwaysVisible): Return true if scrubbing.
801         (Controller.prototype.updateHasAudio): Check currentPlaybackTargetIsWireless(); moved from iOS.js.
802         (Controller.prototype.get scrubbing): Simple getter for _scrubbing.
803         (Controller.prototype.set scrubbing): Check play state if scrubbing; start playback (if necessary)
804             if not scrubbing.
805         (Controller.prototype.get pageScaleFactor): Moved from iOS.js.
806         (Controller.prototype.set pageScaleFactor): Ditto.
807         (Controller.prototype.handleRootResize): Schedule an update of the contrtols width.
808
809         Remove a bunch of newly unnecessary code from the iOS media controls:
810
811         * Modules/mediacontrols/mediaControlsiOS.js:
812         (ControllerIOS):
813         (ControllerIOS.prototype.createControls): Remove ivars moved into Apple.js.
814         (ControllerIOS.prototype.configureInlineControls): Remove spacer; made unnecessary.
815         (ControllerIOS.prototype.showControls): Deleted.
816         (ControllerIOS.prototype.updateTime): Deleted.
817         (ControllerIOS.prototype.handleTimelineTouchStart): Just call "scrubbing = true", handled in Apple.js.
818         (ControllerIOS.prototype.handleTimelineTouchEnd): Just call "scrubbing = false", handled in Apple.js.
819         (ControllerIOS.prototype.handleReadyStateChange): Deleted.
820         (ControllerIOS.prototype.setPlaying): Don't check _timelineIsHidden; not needed.
821         (ControllerIOS.prototype.get pageScaleFactor): Deleted.
822         (ControllerIOS.prototype.set pageScaleFactor): Deleted.
823         (ControllerIOS.prototype.scheduleUpdateLayoutForDisplayedWidth): Deleted.
824         (ControllerIOS.prototypeupdateLayoutForDisplayedWidth): Deleted.
825
826         Fire a "resize" event at the shadow DOM root when layout results in a size change.
827
828         * html/HTMLMediaElement.cpp:
829         (WebCore::HTMLMediaElement::layoutSizeChanged): Fire the "resize" event at the shadow DOM.
830         * html/HTMLMediaElement.h:
831         * rendering/RenderMedia.cpp:
832         (WebCore::RenderMedia::layout): Trigger layoutSizeChanged()
833         * rendering/RenderMedia.h:
834
835         Drive-by fixes:
836
837         * Modules/mediacontrols/mediaControlsApple.js:
838         (Controller.prototype.createControls): aria-label text is totally wrong; removed.
839         (Controller.prototype.updateWirelessPlaybackStatus): Use class-names to hide controls, not inline styles.
840
841 2015-05-15  Alex Christensen  <achristensen@webkit.org>
842
843         [Content Extensions] Fail to load old content extension files
844         https://bugs.webkit.org/show_bug.cgi?id=145027
845
846         Reviewed by Eric Carlson.
847
848         * contentextensions/DFABytecode.h:
849
850 2015-05-15  Eric Carlson  <eric.carlson@apple.com>
851
852         Unreviewed build fix.
853
854         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: Add clang pragmas to ignore
855         deprecation warnings.
856
857 2015-05-15  Jeremy Jones  <jeremyj@apple.com>
858
859         Limit alternate fullscreen with linked on or after.
860         https://bugs.webkit.org/show_bug.cgi?id=144894
861
862         Reviewed by Dean Jackson.
863
864         * platform/ios/WebCoreSystemInterfaceIOS.h: add new wkIOSSystemVersion
865
866 2015-05-15  Roger Fong  <roger_fong@apple.com>
867
868         Unreviewed. Revert part of r184361.
869
870         * Modules/mediacontrols/mediaControlsApple.js:
871         (Controller.prototype.configureInlineControls):
872         HI wants the buttons flipped.
873
874 2015-05-15  Sungmann Cho  <sungmann.cho@navercorp.com>
875
876         Fix trivial typo in TextEncodingDetectorICU.cpp.
877         https://bugs.webkit.org/show_bug.cgi?id=145055
878
879         Reviewed by Alexey Proskuryakov.
880
881         No new tests, no behavior change..
882
883         * platform/text/TextEncodingDetectorICU.cpp:
884         (WebCore::detectTextEncoding):
885
886 2015-05-15  Alexey Proskuryakov  <ap@apple.com>
887
888         Cyrillic top-level domains are displayed as punycode
889         https://bugs.webkit.org/show_bug.cgi?id=145024
890         rdar://problem/17747133
891         rdar://problem/14116594
892
893         Reviewed by Tim Horton.
894
895         Handling each TLD in code is annoying, but we can probably survive like this
896         for a few more years, and maybe we'll think of an entirely different way to deal
897         with non-ASCII domain labels in the meanwhile.
898
899         * platform/mac/WebCoreNSURLExtras.mm:
900         (WebCore::isSecondLevelDomainNameAllowedByTLDRules):
901         (WebCore::allCharactersAllowedByTLDRules):
902
903 2015-05-15  Roger Fong  <roger_fong@apple.com>
904
905         Cursor is displayed after full screen video controls fade away.
906         https://bugs.webkit.org/show_bug.cgi?id=145034.
907         <rdar://problem/20458604>
908
909         Reviewed by Jer Noble.
910
911         * Modules/mediacontrols/mediaControlsApple.css:
912         (video::-webkit-media-controls-panel):
913         Unnecessary cursor style is on the control panel while hidden but
914         the cursor will already be hidden anyways from being auto-hidden.
915         Causes style to change when controls are hidden,
916         which causes the cursor to reappear.
917
918 2015-05-15  Roger Fong  <roger_fong@apple.com>
919
920         Checkmark on OFF option of captions sometimes does not appear.
921         https://bugs.webkit.org/show_bug.cgi?id=145060.
922         <rdar://problem/19388333>
923
924         Reviewed by Eric Carlson.
925
926         * Modules/mediacontrols/mediaControlsApple.js:
927         (Controller.prototype.buildCaptionMenu):
928         Audio tracks don’t have an OFF option.
929         Remove related code to allow OFF option for subtitles to work properly.
930
931 2015-05-15  Zalan Bujtas  <zalan@apple.com>
932
933         White edge on animating panel on http://rokkosunnyvale.com
934         https://bugs.webkit.org/show_bug.cgi?id=144986
935         rdar://problem/20907683
936
937         Reviewed by Simon Fraser.
938
939         Background image geometry calculation needs to be based on the final painting size of the container
940         in order to accurately compute tile sizes, repeating positions etc.
941         The container's size is pixelsnapped at painting using absolute coordinates. This patch
942         ensures that we snap to the same size while computing background geometry.
943
944         Test: fast/images/background-image-size-changes-fractional-position.html
945
946         * rendering/InlineFlowBox.cpp:
947         (WebCore::InlineFlowBox::paintBoxDecorations):
948         * rendering/RenderBox.cpp:
949         (WebCore::RenderBox::paintBoxDecorations):
950         (WebCore::RenderBox::paintBackground):
951         (WebCore::RenderBox::getBackgroundPaintedExtent):
952         (WebCore::RenderBox::computeBackgroundIsKnownToBeObscured):
953         (WebCore::RenderBox::maskClipRect):
954         (WebCore::RenderBox::repaintLayerRectsForImage): unable to get absolute coords.
955         * rendering/RenderBox.h:
956         * rendering/RenderBoxModelObject.cpp:
957         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
958         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
959         (WebCore::RenderBoxModelObject::getGeometryForBackgroundImage):
960         (WebCore::RenderBoxModelObject::boxShadowShouldBeAppliedToBackground):
961         * rendering/RenderBoxModelObject.h:
962         * rendering/RenderFieldset.cpp:
963         (WebCore::RenderFieldset::paintBoxDecorations):
964         * rendering/RenderImage.cpp:
965         (WebCore::RenderImage::boxShadowShouldBeAppliedToBackground):
966         (WebCore::RenderImage::computeBackgroundIsKnownToBeObscured):
967         * rendering/RenderImage.h:
968         * rendering/RenderLayer.cpp: unable to get absolute coords.
969         (WebCore::RenderLayer::calculateClipRects):
970         * rendering/RenderLayerBacking.cpp:
971         (WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundImage): currently not used.
972         * rendering/RenderObject.h:
973         (WebCore::RenderObject::computeBackgroundIsKnownToBeObscured):
974         (WebCore::RenderObject::backgroundIsKnownToBeObscured):
975         * rendering/RenderTable.cpp:
976         (WebCore::RenderTable::paintBoxDecorations):
977         * rendering/RenderTableCell.cpp:
978         (WebCore::RenderTableCell::boxShadowShouldBeAppliedToBackground):
979         * rendering/RenderTableCell.h:
980
981 2015-05-15  Jer Noble  <jer.noble@apple.com>
982
983         Crash in RenderFlowThread::popFlowThreadLayoutState() due to mismatched push/pop count
984         https://bugs.webkit.org/show_bug.cgi?id=145042
985
986         Reviewed by David Hyatt.
987
988         RenderFlowThread previously used a ListHashSet to store its stack of active objects. This
989         is problematic because, if the same object is pushed twice, only a single entry of that
990         object is added to the stack. After this occurs, a matching number of pushes will pop too
991         many items off the stack, causing a crash when popping a stack with zero items. This
992         specifically happens in FrameView::layout(), which will push its root renderer on the stack
993         of active items, and then ask the root to layout(), which will attempt to push itself on the
994         stack of active items.
995
996         Instead of a ListHashSet, use a Vector, which has similar memory characteristics and no 
997         uniqueness requirements.
998
999         * rendering/RenderFlowThread.cpp:
1000         (WebCore::RenderFlowThread::pushFlowThreadLayoutState):
1001         (WebCore::RenderFlowThread::popFlowThreadLayoutState):
1002         * rendering/RenderFlowThread.h:
1003
1004 2015-05-15  Per Arne Vollan  <peavo@outlook.com>
1005
1006         [Curl] WebSocket platform part is not implemented.
1007         https://bugs.webkit.org/show_bug.cgi?id=144628
1008
1009         Reviewed by Darin Adler.
1010
1011         Add Curl platform code implementation for WebSockets.
1012
1013         * platform/network/curl/SocketStreamHandle.h:
1014         (WebCore::SocketStreamHandle::create):
1015         (WebCore::SocketStreamHandle::SocketData::SocketData):
1016         * platform/network/curl/SocketStreamHandleCurl.cpp:
1017         (WebCore::SocketStreamHandle::SocketStreamHandle):
1018         (WebCore::SocketStreamHandle::~SocketStreamHandle):
1019         (WebCore::SocketStreamHandle::platformSend):
1020         (WebCore::SocketStreamHandle::platformClose):
1021         (WebCore::SocketStreamHandle::readData):
1022         (WebCore::SocketStreamHandle::sendData):
1023         (WebCore::SocketStreamHandle::waitForAvailableData):
1024         (WebCore::SocketStreamHandle::startThread):
1025         (WebCore::SocketStreamHandle::stopThread):
1026         (WebCore::SocketStreamHandle::didReceiveData):
1027         (WebCore::SocketStreamHandle::didOpenSocket):
1028         (WebCore::SocketStreamHandle::createCopy):
1029
1030 2015-05-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1031
1032         REGRESSION(r183861): [SOUP] Downloads are broken when using the Network Process
1033         https://bugs.webkit.org/show_bug.cgi?id=144738
1034
1035         Reviewed by Alexey Proskuryakov.
1036
1037         Add ResourceHandle::releaseForDownload() that releases the current
1038         handle to be used as a download.
1039
1040         * platform/network/ResourceHandle.h:
1041         * platform/network/soup/ResourceHandleSoup.cpp:
1042         (WebCore::ResourceHandle::releaseForDownload):
1043
1044 2015-05-15  Zan Dobersek  <zdobersek@igalia.com>
1045
1046         [GTK] Fix PlatformDisplayWayland construction error, implement the destructor
1047         https://bugs.webkit.org/show_bug.cgi?id=144997
1048
1049         Reviewed by Carlos Garcia Campos.
1050
1051         The PlatformDisplayWayland constructor is private, so we can't use
1052         std::make_unique<>() to construct an object of this class.
1053
1054         Implement the PlatformDisplayWayland destructor, cleaning out all
1055         the Wayland resources, if present.
1056
1057         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
1058         (WebCore::PlatformDisplayWayland::create):
1059         (WebCore::PlatformDisplayWayland::PlatformDisplayWayland):
1060         (WebCore::PlatformDisplayWayland::~PlatformDisplayWayland):
1061
1062 2015-05-14  Zalan Bujtas  <zalan@apple.com>
1063
1064         Images on www.fitstylelife.com jiggle on hover.
1065         https://bugs.webkit.org/show_bug.cgi?id=145020
1066         rdar://problem/20885337
1067
1068         Reviewed by Simon Fraser.
1069
1070         This patch ensures that the clipping layer of a composited content is pixel snapped properly.
1071
1072         Tests: compositing/composited-parent-clipping-layer-on-subpixel-position.html
1073                compositing/parent-clipping-layer-on-subpixel-position.html
1074
1075         * rendering/RenderLayerBacking.cpp:
1076         (WebCore::RenderLayerBacking::updateGeometry):
1077
1078 2015-05-14  Chris Dumez  <cdumez@apple.com>
1079
1080         Have DOMWindow::createWindow() take references to frames
1081         https://bugs.webkit.org/show_bug.cgi?id=145037
1082
1083         Reviewed by Gyuyoung Kim.
1084
1085         Have DOMWindow::createWindow() take references to frames instead of
1086         pointers as they are expected to be non-null. Also return a RefPtr
1087         instead of a PassRefPtr.
1088
1089         * inspector/InspectorFrontendClientLocal.cpp:
1090         (WebCore::InspectorFrontendClientLocal::openInNewTab):
1091         * loader/FrameLoader.cpp:
1092         (WebCore::createWindow):
1093         * loader/FrameLoader.h:
1094         * page/DOMWindow.cpp:
1095         (WebCore::DOMWindow::createWindow):
1096         (WebCore::DOMWindow::open):
1097         (WebCore::DOMWindow::showModalDialog):
1098         * page/DOMWindow.h:
1099
1100 2015-05-14  Simon Fraser  <simon.fraser@apple.com>
1101
1102         REGRESSION (r183794): Garbage tiles when body background switches to fixed
1103         https://bugs.webkit.org/show_bug.cgi?id=145032
1104         rdar://problem/20963679
1105
1106         Reviewed by Dean Jackson.
1107         
1108         After r183794 (or possibly an earlier commit), we failed to dynamically update
1109         the configuration of layers that handled fixed background attachment on the root.
1110         
1111         This would result in unpainted tiles, and non-fixed-background behavior.
1112         
1113         Fix by calling RenderLayerCompositor::rootOrBodyStyleChanged() whenever the
1114         style changes on the root or body renderers, and triggering a compositing update
1115         if the fixedness of the background changes. It calls the existing rootBackgroundTransparencyChanged()
1116         if the color changes.
1117
1118         Test: platform/mac-wk2/tiled-drawing/toggle-to-fixed-background.html
1119
1120         * rendering/RenderBox.cpp:
1121         (WebCore::RenderBox::styleDidChange):
1122         * rendering/RenderLayerCompositor.cpp:
1123         (WebCore::RenderLayerCompositor::rootOrBodyStyleChanged):
1124         (WebCore::RenderLayerCompositor::rootBackgroundTransparencyChanged):
1125         * rendering/RenderLayerCompositor.h:
1126
1127 2015-05-14  Commit Queue  <commit-queue@webkit.org>
1128
1129         Unreviewed, rolling out r184359 and r184362.
1130         https://bugs.webkit.org/show_bug.cgi?id=145035
1131
1132         Introduced a crash in six media element tests (Requested by
1133         rniwa on #webkit).
1134
1135         Reverted changesets:
1136
1137         "[MediaControls] Refactor media controls & bring improvements
1138         made to iOS controls to Mac."
1139         https://bugs.webkit.org/show_bug.cgi?id=144973
1140         http://trac.webkit.org/changeset/184359
1141
1142         "Unreviewed build fix after r184359; typo."
1143         http://trac.webkit.org/changeset/184362
1144
1145 2015-05-14  Jer Noble  <jer.noble@apple.com>
1146
1147         Unreviewed build fix after r184359; typo.
1148
1149         * html/HTMLMediaElement.cpp:
1150         (WebCore::HTMLMediaElement::layoutSizeChanged):
1151
1152 2015-05-14  Roger Fong  <roger_fong@apple.com>
1153
1154         Adjust button CSS and positioning in preparation.
1155         https://bugs.webkit.org/show_bug.cgi?id=144973.
1156         <rdar://problem/20306227>
1157
1158         Reviewed by Dean Jackson.
1159
1160         The only visual change here is the swapping of the rewind and play button positions.
1161         Also, position buttons based off of both left and right margins instead of just one of the two.
1162         This allows the controls drop off to work without having to use a spacer element to take the place
1163         of the timeline if the controls are too small.
1164         * Modules/mediacontrols/mediaControlsApple.css:
1165         (audio::-webkit-media-controls-rewind-button):
1166         (audio::-webkit-media-controls-play-button):
1167         (audio::-webkit-media-controls-panel .mute-box):
1168         (audio::-webkit-media-controls-wireless-playback-picker-button):
1169         (audio::-webkit-media-controls-toggle-closed-captions-button):
1170         (audio::-webkit-media-controls-fullscreen-button):
1171         (audio::-webkit-media-controls-fullscreen-button.exit):
1172         (audio::-webkit-media-controls-time-remaining-display):
1173         (audio:-webkit-full-screen::-webkit-media-controls-toggle-closed-captions-button):
1174         (audio:-webkit-full-screen::-webkit-media-controls-wireless-playback-picker-button):
1175         * Modules/mediacontrols/mediaControlsApple.js:
1176         (Controller.prototype.configureInlineControls):
1177
1178 2015-05-14  Dean Jackson  <dino@apple.com>
1179
1180         MediaControls: controls are live even when invisible
1181         https://bugs.webkit.org/show_bug.cgi?id=145029
1182         <rdar://problem/20865442>
1183
1184         Reviewed by Jer Noble.
1185
1186         When the controls are invisible they should ignore touch/mouse
1187         events.
1188
1189         * Modules/mediacontrols/mediaControlsiOS.css: Add pointer-events: none where appropriate.
1190         (video::-webkit-media-controls-panel-container):
1191         (video::-webkit-media-controls-panel-background):
1192         (video::-webkit-media-controls-panel):
1193         (video::-webkit-media-controls-panel.paused):
1194
1195 2015-05-14  Jer Noble  <jer.noble@apple.com>
1196
1197         [MediaControls] Refactor media controls & bring improvements made to iOS controls to Mac.
1198         https://bugs.webkit.org/show_bug.cgi?id=144973
1199
1200         Reviewed by Dean Jackson.
1201
1202         Pull improvements made to the iOS media controls back into the Mac controls by moving
1203         code from mediaControlsiOS.js into MediaControlsApple.js.
1204
1205         The largest refactored feature is the ability to drop individual controls from the media
1206         controls when the video is too small to contain them. To allow these controls to resize
1207         dynamically, a new "resize" event is fired inside the media element's shadow DOM.
1208
1209         * Modules/mediacontrols/mediaControlsApple.css:
1210         (audio::-webkit-media-controls-panel .dropped): Added; sets "display: none".
1211         * Modules/mediacontrols/mediaControlsApple.js:
1212         (Controller): Set defaults for new variables.
1213         (Controller.prototype.updateControls): Update the controls width; moved from iOS.js.
1214         (Controller.prototype.handleReadyStateChange): Update the controls; moved from iOS.js.
1215         (Controller.prototype.handleTimeUpdate): Update the progress; moved from iOS.js.
1216         (Controller.prototype.handleTimelineInput): Pause if scrubbing; moved from iOS.js.
1217         (Controller.prototype.handleTimelineChange): Update the progress; moved from iOS.js.
1218         (Controller.prototype.showControls): Update the controls width; moved from iOS.js.
1219         (Controller.prototype.hideControls): Removed _potentiallyScrubbing check; not needed due to changes
1220             to controlsAlwaysVisible().
1221         (Controller.prototype.scheduleUpdateLayoutForDisplayedWidth): Moved from iOS.js.
1222         (Controller.prototype.isControlVisible): Added; checks whether control is parented & not hidden.
1223         (Controller.prototype.updateLayoutForDisplayedWidth): Moved from iOS.js and refactored.
1224         (Controller.prototype.controlsAlwaysVisible): Return true if scrubbing.
1225         (Controller.prototype.updateHasAudio): Check currentPlaybackTargetIsWireless(); moved from iOS.js.
1226         (Controller.prototype.get scrubbing): Simple getter for _scrubbing.
1227         (Controller.prototype.set scrubbing): Check play state if scrubbing; start playback (if necessary)
1228             if not scrubbing.
1229         (Controller.prototype.get pageScaleFactor): Moved from iOS.js.
1230         (Controller.prototype.set pageScaleFactor): Ditto.
1231         (Controller.prototype.handleRootResize): Schedule an update of the contrtols width.
1232
1233         Remove a bunch of newly unnecessary code from the iOS media controls:
1234
1235         * Modules/mediacontrols/mediaControlsiOS.js:
1236         (ControllerIOS):
1237         (ControllerIOS.prototype.createControls): Remove ivars moved into Apple.js.
1238         (ControllerIOS.prototype.configureInlineControls): Remove spacer; made unnecessary.
1239         (ControllerIOS.prototype.showControls): Deleted.
1240         (ControllerIOS.prototype.updateTime): Deleted.
1241         (ControllerIOS.prototype.handleTimelineTouchStart): Just call "scrubbing = true", handled in Apple.js.
1242         (ControllerIOS.prototype.handleTimelineTouchEnd): Just call "scrubbing = false", handled in Apple.js.
1243         (ControllerIOS.prototype.handleReadyStateChange): Deleted.
1244         (ControllerIOS.prototype.setPlaying): Don't check _timelineIsHidden; not needed.
1245         (ControllerIOS.prototype.get pageScaleFactor): Deleted.
1246         (ControllerIOS.prototype.set pageScaleFactor): Deleted.
1247         (ControllerIOS.prototype.scheduleUpdateLayoutForDisplayedWidth): Deleted.
1248         (ControllerIOS.prototypeupdateLayoutForDisplayedWidth): Deleted.
1249
1250         Fire a "resize" event at the shadow DOM root when layout results in a size change.
1251
1252         * html/HTMLMediaElement.cpp:
1253         (WebCore::HTMLMediaElement::layoutSizeChanged): Fire the "resize" event at the shadow DOM.
1254         * html/HTMLMediaElement.h:
1255         * rendering/RenderMedia.cpp:
1256         (WebCore::RenderMedia::layout): Trigger layoutSizeChanged()
1257         * rendering/RenderMedia.h:
1258
1259         Drive-by fixes:
1260
1261         * Modules/mediacontrols/mediaControlsApple.js:
1262         (Controller.prototype.createControls): aria-label text is totally wrong; removed.
1263         (Controller.prototype.updateWirelessPlaybackStatus): Use class-names to hide controls, not inline styles.
1264
1265 2015-05-13  Ryosuke Niwa  <rniwa@webkit.org>
1266
1267         Crash in ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline
1268         https://bugs.webkit.org/show_bug.cgi?id=119068
1269
1270         Reviewed by Enrica Casucci.
1271
1272         The bug was caused by makeInsertedContentRoundTrippableWithHTMLTreeBuilder not updating
1273         nodes kept tracked by insertedNodes and moveNodeOutOfAncestor stumbling upon it.
1274
1275         Fixed the bug by updating insertedNodes in makeInsertedContentRoundTrippableWithHTMLTreeBuilder.
1276
1277         Test: editing/inserting/insert-table-in-paragraph-crash.html
1278
1279         * editing/ReplaceSelectionCommand.cpp:
1280         (WebCore::ReplaceSelectionCommand::makeInsertedContentRoundTrippableWithHTMLTreeBuilder):
1281         (WebCore::ReplaceSelectionCommand::moveNodeOutOfAncestor):
1282         * editing/ReplaceSelectionCommand.h:
1283
1284 2015-05-14  Myles C. Maxfield  <mmaxfield@apple.com>
1285
1286         [Mac] Expose more font weights for -apple-system
1287         https://bugs.webkit.org/show_bug.cgi?id=144707
1288
1289         Reviewed by Simon Fraser.
1290
1291         Previously, when we parsed a CSS declaration of the form font: keyword; where keyword
1292         is one of caption, icon, menu, message-box, small-caption, -webkit-mini-control, -webkit-small-control,
1293         or -webkit-control (which html.css does for form controls), we would ask the system what the appropriate
1294         system font is, get that font's family name, and synthesize a font-family CSS property for the element.
1295         Then, later when we actually go to look up the font, we would look up the font by family name using this
1296         information. However, this round-tripping of a font through a family name is actually lossy, and is not
1297         guaranteed to preserve system-font-ness (which we use for various things including metrics calculations).
1298
1299         This patch modifies this logic to specify a token family name instead, which the font lookup code special
1300         cases (and reacts by making the appropriate system-font lookup call). This approach is currently how iOS
1301         handles these system fonts; this patch simply brings this approach to OS X.
1302
1303         There is also an added progression here. We used to simply call [NSFont fontWithName:size:] on the system
1304         font family name (which the parser found for us) which entirely disregards weight. This means that we
1305         used to be getting synthesized bold in form controls which ask for a heavy weight. Migrating to this
1306         system-font aware call means that we get the real bold font instead of synthesized bold.
1307
1308         Once this system-font-ness is guaranteed to be preserved between parsing time and font lookup time, we
1309         can safely migrate to using [NSFont systemFontOfSize:weight] instead of [NSFont systemFontOfSize:] on
1310         platforms which support it.
1311
1312         Tests: fast/text/systemFont.html
1313                fast/css/css2-system-fonts.html
1314                fast/forms/select/optgroup-rendering.html
1315                fast/forms/validation-message-appearance.html
1316
1317         * css/CSSParser.cpp:
1318         (WebCore::CSSParser::parseSystemFont): Add a comment regarding why we are bothering with expanding out
1319         the font property in the first place.
1320         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1321         (WebCore::FontCascade::primaryFontIsSystemFont): Update to use new system font tokens.
1322         * platform/graphics/mac/FontCacheMac.mm:
1323         (WebCore::toNSFontWeight): New static method to map font weights to NSFontWeight constants available on
1324         Yosemite and later.
1325         (WebCore::fontWithFamilySpecialCase): Pull all these special-case font token name handling into a
1326         separate function, which returns an Optional.
1327         (WebCore::fontWithFamily):
1328         * platform/mac/ThemeMac.mm:
1329         (WebCore::ThemeMac::controlFont): Use the font token name instead of the generated system font family
1330         name.
1331         * platform/spi/mac/NSFontSPI.h: Add [NSFont systemFontWithSize:weight:] and the proper NSFontWeight
1332         constants.
1333         * rendering/RenderThemeMac.mm:
1334         (WebCore::RenderThemeMac::updateCachedSystemFontDescription): Use the font token names instead of the
1335         generated system font family name.
1336         (WebCore::RenderThemeMac::setFontFromControlSize): Ditto.
1337
1338 2015-05-14  Roger Fong  <roger_fong@apple.com>
1339
1340         Add internals setting to disable wireless playback availability for layout tests
1341         https://bugs.webkit.org/show_bug.cgi?id=145012.
1342         <rdar://problem/20946504>
1343
1344         Reviewed by Eric Carlson.
1345
1346         * testing/InternalSettings.cpp:
1347         (WebCore::InternalSettings::resetToConsistentState):
1348         (WebCore::InternalSettings::setWirelessPlaybackDisabled):
1349         * testing/InternalSettings.idl:
1350
1351 2015-05-14  Beth Dakin  <bdakin@apple.com>
1352
1353         Change range of possible forces for mouseforcechanged DOM event
1354         https://bugs.webkit.org/show_bug.cgi?id=144987
1355         -and corresponding-
1356         rdar://problem/20472802
1357
1358         Reviewed by Tim Horton.
1359
1360         Change to a 0-3 range.
1361         * platform/PlatformMouseEvent.h:
1362         * platform/mac/PlatformEventFactoryMac.mm:
1363         (WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
1364
1365 2015-05-14  Manuel Rego Casasnovas  <rego@igalia.com>
1366
1367         Fix typo in RenderBox::instrinsicScrollbarLogicalWidth()
1368         https://bugs.webkit.org/show_bug.cgi?id=144999
1369
1370         Reviewed by Sergio Villar Senin.
1371
1372         Rename RenderBox::instrinsicScrollbarLogicalWidth() to
1373         RenderBox::intrinsicScrollbarLogicalWidth().
1374
1375         No new tests, no behavior changes.
1376
1377         * rendering/RenderBlock.cpp:
1378         (WebCore::RenderBlock::computeIntrinsicLogicalWidths):
1379         * rendering/RenderBlockFlow.cpp:
1380         (WebCore::RenderBlockFlow::computeIntrinsicLogicalWidths):
1381         * rendering/RenderBox.cpp:
1382         (WebCore::RenderBox::intrinsicScrollbarLogicalWidth):
1383         (WebCore::RenderBox::instrinsicScrollbarLogicalWidth): Deleted.
1384         * rendering/RenderBox.h:
1385         * rendering/RenderDeprecatedFlexibleBox.cpp:
1386         (WebCore::RenderDeprecatedFlexibleBox::computeIntrinsicLogicalWidths):
1387         * rendering/RenderFlexibleBox.cpp:
1388         (WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths):
1389
1390 2015-05-14  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1391
1392         SharedBuffer::createWithContentsOfFile should use map file routines
1393         https://bugs.webkit.org/show_bug.cgi?id=144192
1394
1395         Reviewed by Darin Adler.
1396
1397         Made use of mmap routines within SharedBuffer::createWithContentsOfFile for EFL, GTK and Mac ports.
1398         If mapping is failing, it falls back to the previous version of SharedBuffer::createWithContentsOfFile renamed as
1399         SharedBuffer::createFromReadingFile (using open/read method).
1400         File content is mapped until SharedBuffer is cleared, destroyed or additional content is appended to the SharedBuffer.
1401
1402         A helper class, MappedFileData, is introduced to handle mapped files through calls to open/mmap/munmap/close.
1403
1404         Patch covered by existing layout tests and added unit tests.
1405
1406         * platform/FileSystem.cpp:
1407         (WebCore::MappedFileData::MappedFileData):
1408         (WebCore::MappedFileData::operator=):
1409         (WebCore::MappedFileData::~MappedFileData):
1410         * platform/FileSystem.h:
1411         (WebCore::MappedFileData::MappedFileData):
1412         (WebCore::MappedFileData::operator bool):
1413         (WebCore::MappedFileData::data):
1414         (WebCore::MappedFileData::size):
1415         * platform/SharedBuffer.cpp:
1416         (WebCore::SharedBuffer::SharedBuffer):
1417         (WebCore::SharedBuffer::createWithContentsOfFile): Making use of MappedFileData before using createFromReadingFile.
1418         (WebCore::SharedBuffer::size): Checking whether data is coming from a MappedFileData.
1419         (WebCore::SharedBuffer::data): Ditto.
1420         (WebCore::SharedBuffer::append): Ditto.
1421         (WebCore::SharedBuffer::clear): Clearing MappedFileData if needed.
1422         (WebCore::SharedBuffer::copy): Transferring mapped data to buffer if needed.
1423         (WebCore::SharedBuffer::getSomeData):
1424         (WebCore::SharedBuffer::maybeTransferMappedFileData):
1425         * platform/SharedBuffer.h:
1426         * platform/gtk/SharedBufferGtk.cpp:
1427         (WebCore::SharedBuffer::createFromReadingFile): renamed from createWithContentsOfFile.
1428         * platform/mac/SharedBufferMac.mm:
1429         (WebCore::SharedBuffer::createFromReadingFile): Dito.
1430         * platform/posix/SharedBufferPOSIX.cpp:
1431         (WebCore::SharedBuffer::createFromReadingFile): Ditto.
1432         * platform/win/SharedBufferWin.cpp:
1433         (WebCore::SharedBuffer::createFromReadingFile): Ditto.
1434
1435 2015-05-13  Simon Fraser  <simon.fraser@apple.com>
1436
1437         Get the ScriptController from the correct frame for media elements and plug-ins
1438         https://bugs.webkit.org/show_bug.cgi?id=144983
1439         rdar://problem/20692642&19943135
1440
1441         Reviewed by Sam Weinig.
1442
1443         HTMLMediaElement, QuickTimePluginReplacement and HTMLPlugInImageElement were
1444         getting the main frame's ScriptController instead of the one for their frame.
1445         This caused media controls JS to be running in the context of the main frame,
1446         which broke media controls which use getCSSCanvasContext() and -webkit-canvas.
1447         
1448         Fix by getting the frame via the element's document.
1449         
1450         Also undo r180584 which was working around this bug.
1451
1452         * Modules/mediacontrols/mediaControlsiOS.js:
1453         (ControllerIOS.prototype.drawTimelineBackground):
1454         * Modules/plugins/QuickTimePluginReplacement.mm:
1455         (WebCore::QuickTimePluginReplacement::ensureReplacementScriptInjected):
1456         (WebCore::QuickTimePluginReplacement::installReplacement):
1457         * html/HTMLMediaElement.cpp:
1458         (WebCore::HTMLMediaElement::updateCaptionContainer):
1459         (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
1460         (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
1461         (WebCore::HTMLMediaElement::pageScaleFactorChanged):
1462         * html/HTMLPlugInImageElement.cpp:
1463         (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):
1464
1465 2015-05-13  Sungmann Cho  <sungmann.cho@navercorp.com>
1466
1467         Fix trivial typos in ApplyBlockElementCommand
1468         https://bugs.webkit.org/show_bug.cgi?id=144984
1469
1470         Reviewed by Alexey Proskuryakov.
1471
1472         No new tests, no behavior change.
1473
1474         * editing/ApplyBlockElementCommand.cpp:
1475         (WebCore::ApplyBlockElementCommand::formatSelection):
1476         (WebCore::ApplyBlockElementCommand::endOfNextParagraphSplittingTextNodesIfNeeded):
1477         (WebCore::ApplyBlockElementCommand::endOfNextParagrahSplittingTextNodesIfNeeded): Deleted.
1478         * editing/ApplyBlockElementCommand.h:
1479
1480 2015-05-13  David Kilzer  <ddkilzer@apple.com>
1481
1482         REGRESION (r179958): Crash in WebCore::DocumentLoader::detachFromFrame when -[id<WebPolicyDelegate> decidePolicyForMIMEType:request:frame:decisionListener:] fails to call -[id<WebPolicyDecisionListener> download|ignore|use]
1483         <http://webkit.org/b/144975>
1484
1485         Reviewed by Andy Estes.
1486
1487         This change reverts r179958.  It changes RELEASE_ASSERT*()
1488         statements back to Debug-only ASSERT*() statements.
1489
1490         * loader/DocumentLoader.cpp:
1491         (WebCore::DocumentLoader::~DocumentLoader):
1492         (WebCore::DocumentLoader::continueAfterContentPolicy):
1493         (WebCore::DocumentLoader::detachFromFrame):
1494
1495 2015-05-13  Antti Koivisto  <antti@apple.com>
1496
1497         Cached CSS image resources don't show up after reloading <http://nightly.webkit.org/start/>
1498         https://bugs.webkit.org/show_bug.cgi?id=144952
1499         rdar://problem/13387307
1500
1501         Reviewed by Oliver Hunt.
1502
1503         This is a symptom of a general problem that we don't revalidate subresources of cached parsed stylesheets.
1504
1505         Fix by tightening the check we perform when choosing to used the cached sheet. If there are expired subresources
1506         we reparse the sheet.
1507
1508         Test: http/tests/cache/stylesheet-sharing.html
1509
1510         * css/CSSCrossfadeValue.cpp:
1511         (WebCore::CSSCrossfadeValue::traverseSubresources):
1512         (WebCore::CSSCrossfadeValue::hasFailedOrCanceledSubresources): Deleted.
1513
1514             Replace hasFailedOrCanceledSubresources with general purpose subresource traversal functions.
1515
1516         * css/CSSCrossfadeValue.h:
1517         * css/CSSFilterImageValue.cpp:
1518         (WebCore::CSSFilterImageValue::traverseSubresources):
1519         (WebCore::CSSFilterImageValue::hasFailedOrCanceledSubresources): Deleted.
1520         * css/CSSFilterImageValue.h:
1521         * css/CSSFontFaceSrcValue.cpp:
1522         (WebCore::CSSFontFaceSrcValue::traverseSubresources):
1523         (WebCore::CSSFontFaceSrcValue::hasFailedOrCanceledSubresources): Deleted.
1524         * css/CSSFontFaceSrcValue.h:
1525         * css/CSSImageSetValue.cpp:
1526         (WebCore::CSSImageSetValue::traverseSubresources):
1527         (WebCore::CSSImageSetValue::hasFailedOrCanceledSubresources): Deleted.
1528         * css/CSSImageSetValue.h:
1529         * css/CSSImageValue.cpp:
1530         (WebCore::CSSImageValue::traverseSubresources):
1531         (WebCore::CSSImageValue::hasFailedOrCanceledSubresources): Deleted.
1532         * css/CSSImageValue.h:
1533         * css/CSSValue.cpp:
1534         (WebCore::CSSValue::traverseSubresources):
1535         (WebCore::CSSValue::hasFailedOrCanceledSubresources): Deleted.
1536         * css/CSSValue.h:
1537         * css/CSSValueList.cpp:
1538         (WebCore::CSSValueList::traverseSubresources):
1539         (WebCore::CSSValueList::hasFailedOrCanceledSubresources): Deleted.
1540         * css/CSSValueList.h:
1541         * css/StyleProperties.cpp:
1542         (WebCore::StyleProperties::traverseSubresources):
1543         (WebCore::StyleProperties::hasFailedOrCanceledSubresources): Deleted.
1544         * css/StyleProperties.h:
1545         * css/StyleSheetContents.cpp:
1546         (WebCore::traverseSubresourcesInRules):
1547         (WebCore::StyleSheetContents::traverseSubresources):
1548         (WebCore::StyleSheetContents::subresourcesAllowReuse):
1549
1550             Disallow reuse if there are expired subresources.
1551
1552         (WebCore::StyleSheetContents::isLoadingSubresources):
1553
1554             Testing support.
1555
1556         (WebCore::childRulesHaveFailedOrCanceledSubresources): Deleted.
1557         (WebCore::StyleSheetContents::hasFailedOrCanceledSubresources): Deleted.
1558         * css/StyleSheetContents.h:
1559         (WebCore::StyleSheetContents::loadCompleted):
1560         * html/HTMLLinkElement.cpp:
1561         (WebCore::HTMLLinkElement::setCSSStyleSheet):
1562         * loader/cache/CachedCSSStyleSheet.cpp:
1563         (WebCore::CachedCSSStyleSheet::restoreParsedStyleSheet):
1564         * loader/cache/CachedCSSStyleSheet.h:
1565         * loader/cache/CachedImage.cpp:
1566         (WebCore::CachedImage::makeRevalidationDecision):
1567         (WebCore::CachedImage::mustRevalidateDueToCacheHeaders): Deleted.
1568
1569             Move the logging code out from this function (it requires frame access this function doesn't otherwise need)
1570             and refactor to return a decision enum.
1571
1572         * loader/cache/CachedImage.h:
1573         * loader/cache/CachedResource.cpp:
1574         (WebCore::CachedResource::makeRevalidationDecision):
1575         (WebCore::logResourceRevalidationReason): Deleted.
1576         (WebCore::CachedResource::mustRevalidateDueToCacheHeaders): Deleted.
1577         * loader/cache/CachedResource.h:
1578         (WebCore::CachedResource::loadFailedOrCanceled):
1579         * loader/cache/CachedResourceLoader.cpp:
1580         (WebCore::logRevalidation):
1581         (WebCore::logResourceRevalidationDecision):
1582         (WebCore::CachedResourceLoader::determineRevalidationPolicy):
1583
1584             Move logging here.
1585
1586         * testing/Internals.cpp:
1587         (WebCore::Internals::isSharingStyleSheetContents):
1588         (WebCore::Internals::isStyleSheetLoadingSubresources):
1589         * testing/Internals.h:
1590         * testing/Internals.idl:
1591
1592 2015-05-13  Ryuan Choi  <ryuan.choi@navercorp.com>
1593
1594         [CoordinatedGraphics] Remove scaleFactor from SurfaceUpdateInfo
1595         https://bugs.webkit.org/show_bug.cgi?id=144935
1596
1597         Reviewed by Darin Adler.
1598
1599         The members of SurfaceUpdateInfo are only used to update tile except scaleFactor.
1600         So, this patch removes scaleFactor from SurfaceUpdateInfo.
1601         In addition, removes unnecessary parameters in createTile() 
1602
1603         No new tests because there is no behavior change.
1604
1605         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1606         (WebCore::CoordinatedGraphicsLayer::createTile):
1607         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
1608         * platform/graphics/texmap/coordinated/CoordinatedTile.cpp:
1609         (WebCore::CoordinatedTile::updateBackBuffer):
1610         * platform/graphics/texmap/coordinated/CoordinatedTile.h:
1611         * platform/graphics/texmap/coordinated/SurfaceUpdateInfo.h:
1612
1613 2015-05-13  Sam Weinig  <sam@webkit.org>
1614
1615         Modernize ContainerNode::childElementCount
1616         https://bugs.webkit.org/show_bug.cgi?id=144930
1617
1618         Reviewed by Darin Adler.
1619
1620         * dom/ContainerNode.cpp:
1621         (WebCore::ContainerNode::childElementCount):
1622         Use std::distance to compute the number of child elements.
1623
1624         * dom/ElementChildIterator.h:
1625         Add typedefs to make the child element iterators conform STL standards.
1626
1627 2015-05-13  Ryosuke Niwa  <rniwa@webkit.org>
1628
1629         REGRESSION(r183770): Crash inside WebEditorClient::shouldApplyStyle when applying underline
1630         https://bugs.webkit.org/show_bug.cgi?id=144949
1631         <rdar://problem/20895753>
1632
1633         Reviewed by Darin Adler.
1634
1635         The crash was caused by the variant of applyStyleToSelection that takes EditingStyle passing
1636         a null pointer to shouldApplyStyle when we're only applying text decoration changes so that
1637         m_mutableStyle in the editing style is null. This didn't reproduce in execCommand since we
1638         wouldn't call shouldApplyStyle in that case. It didn't reproduce in my manual testing because
1639         font panel also sets text shadow, which ends up filling up m_mutableStyle.
1640
1641         Fixed the bug by creating a mutable style properties when one is not provided by EditingStyle.
1642         Also fixed the "FIXME" in the function by converting text decoration changes to a corresponding
1643         text decoration value. The values passed to shouldApplyStyle now matches the old behavior prior
1644         to r183770.
1645
1646         Test: editing/style/underline-by-user.html
1647
1648         * editing/EditingStyle.cpp:
1649         (WebCore::EditingStyle::styleWithResolvedTextDecorations): Added.
1650         * editing/EditingStyle.h:
1651         * editing/Editor.cpp:
1652         (WebCore::Editor::applyStyleToSelection): Use styleWithResolvedTextDecorations to avoid the crash.
1653
1654 2015-05-13  Eric Carlson  <eric.carlson@apple.com>
1655
1656         Work around HTMLMediaElement::documentDidResumeFromPageCache being called twice
1657         https://bugs.webkit.org/show_bug.cgi?id=144969
1658
1659         Reviewed by Alexey Proskuryakov.
1660
1661         * dom/Document.cpp:
1662         (WebCore::Document::addPlaybackTargetPickerClient): Replace ASSERT with early 
1663         return to work around https://webkit.org/b/144970.
1664
1665 2015-05-13  Timothy Horton  <timothy_horton@apple.com>
1666
1667         Going back after resizing causes scroll knob to appear in the middle of the page
1668         https://bugs.webkit.org/show_bug.cgi?id=144968
1669         <rdar://problem/18299827>
1670
1671         Reviewed by Beth Dakin.
1672
1673         * history/CachedPage.cpp:
1674         (WebCore::CachedPage::restore):
1675         (WebCore::CachedPage::clear):
1676         * history/CachedPage.h:
1677         (WebCore::CachedPage::markForContentsSizeChanged):
1678         * history/PageCache.cpp:
1679         (WebCore::PageCache::markPagesForContentsSizeChanged):
1680         * history/PageCache.h:
1681         Add a flag that will cause us to call updateContentsSize() after a page
1682         comes out of the page cache, if necessary.
1683
1684         * page/FrameView.cpp:
1685         (WebCore::FrameView::setContentsSize):
1686         * page/FrameView.h:
1687         Mark all cached pages for this frame as needing updateContentsSize()
1688         when setContentsSize happens. This will ensure that scrollbar layers
1689         are repositioned when coming out of the page cache.
1690
1691 2015-05-13  Beth Dakin  <bdakin@apple.com>
1692
1693         Need SPI to set the overlay scroll bar style
1694         https://bugs.webkit.org/show_bug.cgi?id=144928
1695         -and corresponding-
1696         rdar://problem/20143614
1697
1698         Reviewed by Anders Carlsson.
1699
1700         New ChromeClient function preferredScrollbarOverlayStyle() will fetch the 
1701         scrollbar style that was set via the new SPI.
1702         * page/ChromeClient.h:
1703
1704         If the preferredScrollbarOverlayStyle() is anything but None, then use it. None is 
1705         used to indicate that the normal heuristic should compute the appropriate color.
1706         * page/FrameView.cpp:
1707         (WebCore::FrameView::recalculateScrollbarOverlayStyle):
1708         * page/FrameView.h:
1709
1710 2015-05-13  Brent Fulgham  <bfulgham@apple.com>
1711
1712         Scrollbars in overflow regions are not vanishing after scrolling with scroll snap points
1713         https://bugs.webkit.org/show_bug.cgi?id=142521
1714         <rdar://problem/20100706>
1715
1716         Reviewed by Darin Adler.
1717
1718         The scrollbars were not being dismissed because they were not being notified that the wheel
1719         gesture was finished. This was happening because the wheel event 'ended' state has zero
1720         deltaX and deltaY. If the region did not allow stretching, it would exit early, never passing
1721         through the 'handleWheelEventPhase' code that would notify the scrollbar controller that
1722         the gesture had ended.
1723
1724         * platform/ScrollableArea.cpp:
1725         (WebCore::ScrollableArea::mouseExitedContentArea): The wrong ScrollAnimator method was being
1726         called when the mouse exited the content area.
1727         * platform/mac/ScrollAnimatorMac.mm:
1728         (WebCore::ScrollAnimatorMac::handleWheelEvent): Do not early return when the wheel event has
1729         no change in X or Y coordinate.
1730
1731 2015-05-12  David Hyatt  <hyatt@apple.com>
1732
1733         Don't compute selection painting info when we don't have selection.
1734         https://bugs.webkit.org/show_bug.cgi?id=144920
1735         <rdar://problem/20919920>
1736
1737         Reviewed by Simon Fraser.
1738
1739         * rendering/InlineTextBox.cpp:
1740         (WebCore::InlineTextBox::paint):
1741
1742         Just set the selection paint style to the text paint style when we don't have a selection
1743         at all. Computing the selection style takes time in the case where a ::selection pseudo is
1744         used on the page, so we don't want to waste time computing that info unless it's actually
1745         needed.
1746
1747 2015-05-13  Joseph Pecoraro  <pecoraro@apple.com>
1748
1749         Pass String as reference in more places
1750         https://bugs.webkit.org/show_bug.cgi?id=144769
1751
1752         Reviewed by Daniel Bates.
1753
1754         * bindings/js/SerializedScriptValue.cpp:
1755         (WebCore::CloneSerializer::dumpString):
1756         (WebCore::CloneSerializer::dumpStringObject):
1757         * dom/DocumentMarkerController.cpp:
1758         (WebCore::DocumentMarkerController::addMarker):
1759         * dom/DocumentMarkerController.h:
1760         * inspector/InspectorApplicationCacheAgent.cpp:
1761         (WebCore::InspectorApplicationCacheAgent::assertFrameWithDocumentLoader):
1762         * inspector/InspectorApplicationCacheAgent.h:
1763         * inspector/InspectorNodeFinder.cpp:
1764         (WebCore::stripCharacters):
1765         (WebCore::InspectorNodeFinder::InspectorNodeFinder):
1766         * inspector/InspectorNodeFinder.h:
1767
1768 2015-05-13  Timothy Horton  <timothy_horton@apple.com>
1769
1770         View scale changes are temporarily lost after restoring a page from the page cache
1771         https://bugs.webkit.org/show_bug.cgi?id=144934
1772
1773         Reviewed by Brady Eidson.
1774
1775         * history/CachedPage.cpp:
1776         (WebCore::CachedPage::CachedPage):
1777         (WebCore::CachedPage::restore):
1778         (WebCore::CachedPage::clear):
1779         * history/CachedPage.h:
1780         (WebCore::CachedPage::markForDeviceOrPageScaleChanged): Renamed.
1781         * history/PageCache.cpp:
1782         (WebCore::PageCache::markPagesForDeviceOrPageScaleChanged): Renamed.
1783         * history/PageCache.h:
1784         Rename PageCache/CachedPage methods to make it more clear that they
1785         will eventually result in calling deviceOrPageScaleFactorChanged().
1786         Also, use modern initialization for CachedPage members.
1787
1788         * loader/HistoryController.cpp:
1789         (WebCore::HistoryController::saveScrollPositionAndViewStateToItem):
1790         (WebCore::HistoryController::restoreScrollPositionAndViewState):
1791         Store the pageScaleFactor on HistoryItem with the view scale factored out,
1792         because the view scale can change while the page is in the page cache, and
1793         WebCore needs a way - without consulting with WebKit2 - to apply the changed
1794         view scale to the cached page scale.
1795
1796         * page/Page.cpp:
1797         (WebCore::Page::setViewScaleFactor):
1798         (WebCore::Page::setDeviceScaleFactor):
1799         * page/Page.h:
1800         (WebCore::Page::viewScaleFactor):
1801         Keep track of the viewScaleFactor, and mark all pages in the page cache
1802         as needing to call deviceOrPageScaleFactorChanged and do a full style recalc
1803         when they come back from the page cache.
1804
1805         For now, we expect all callers of setPageScaleFactor (including WebKit2 and
1806         HistoryController) to multiply the viewScale in manually, to avoid the
1807         significant amount of change in WebCore that would be required to keep them
1808         totally separately.
1809
1810 2015-05-12  Zan Dobersek  <zdobersek@igalia.com>
1811
1812         Reduce TransformationMatrix copies in MatrixTransformOperation, Matrix3DTransformOperation
1813         https://bugs.webkit.org/show_bug.cgi?id=144797
1814
1815         Reviewed by Darin Adler.
1816
1817         Using std::swap() on TransformationMatrix objects which don't
1818         provide move constructors will result in copies.
1819
1820         Instead, use a helper function in both MatrixTransformOperation
1821         and Matrix3DTransformOperation that calls TransformationMatrix::blend()
1822         and returns the new Matrix(3D)TransformOperation object, and call it
1823         with fromT and toT arguments switched when blending to identity.
1824
1825         * platform/graphics/transforms/Matrix3DTransformOperation.cpp:
1826         (WebCore::createOperation):
1827         (WebCore::Matrix3DTransformOperation::blend):
1828         * platform/graphics/transforms/Matrix3DTransformOperation.h: No need
1829         to copy the m_matrix member, it won't change when passed to
1830         TransformationMatrix::multiply().
1831         * platform/graphics/transforms/MatrixTransformOperation.cpp:
1832         (WebCore::createOperation):
1833         (WebCore::MatrixTransformOperation::blend):
1834
1835 2015-05-12  Carlos Garcia Campos  <cgarcia@igalia.com>
1836
1837         [EGL][X11] XPixmap created in GLContextEGL::createPixmapContext() is leaked
1838         https://bugs.webkit.org/show_bug.cgi?id=144909
1839
1840         Reviewed by Sergio Villar Senin and Žan Doberšek.
1841
1842         The pixmap is created and passed to eglCreatePixmapSurface(), but
1843         never released. eglCreatePixmapSurface() doesn't take the
1844         ownership of the pixmap, so we should explicitly free it when the
1845         GLContextEGL is destroyed.
1846
1847         * platform/graphics/egl/GLContextEGL.cpp:
1848         (WebCore::GLContextEGL::createPixmapContext): Use XUniquePixmap
1849         and transfer the ownership to the context by using the new
1850         constructor that receives a XUniquePixmap&&.
1851         (WebCore::GLContextEGL::createContext): createPixmapContext() is
1852         now only defined for X11.
1853         (WebCore::GLContextEGL::GLContextEGL): New constructor that
1854         receives a XUniquePixmap&&.
1855         * platform/graphics/egl/GLContextEGL.h: Add new constructor and
1856         initialize the cairo device when defined to simplify constructors.
1857
1858 2015-05-12  Sungmann Cho  <sungmann.cho@navercorp.com>
1859
1860         Reindent DIBPixelData.h for consistency.
1861         https://bugs.webkit.org/show_bug.cgi?id=144942
1862
1863         Reviewed by Darin Adler.
1864
1865         No new tests, no behavior change.
1866
1867         * platform/graphics/win/DIBPixelData.h:
1868         (WebCore::DIBPixelData::DIBPixelData):
1869         (WebCore::DIBPixelData::buffer):
1870         (WebCore::DIBPixelData::bufferLength):
1871         (WebCore::DIBPixelData::size):
1872         (WebCore::DIBPixelData::bytesPerRow):
1873         (WebCore::DIBPixelData::bitsPerPixel):
1874
1875 2015-05-12  Commit Queue  <commit-queue@webkit.org>
1876
1877         Unreviewed, rolling out r184224.
1878         https://bugs.webkit.org/show_bug.cgi?id=144946
1879
1880         Made inspector/page/main-frame-resource.html assert every time
1881         (Requested by ap on #webkit).
1882
1883         Reverted changeset:
1884
1885         "Web Inspector: REGRESSION (r181625): Timeline recording
1886         started from console.profile is always empty"
1887         https://bugs.webkit.org/show_bug.cgi?id=144882
1888         http://trac.webkit.org/changeset/184224
1889
1890 2015-05-12  Jer Noble  <jer.noble@apple.com>
1891
1892         [Mac] Hang in MediaPlayerPrivateAVFoundationObjC::audioSourceProvider() - 'tracks' property not yet loaded
1893         https://bugs.webkit.org/show_bug.cgi?id=144937
1894
1895         Reviewed by Eric Carlson.
1896
1897         Querying for the -[AVAsset tracks] property blocks for network loading; and could
1898         block forever if the asset in question is not reachable. Add a "safe" mechanism for
1899         querying the list of audible tracks, and use that when providing the audioSourceProvider()
1900         with an audible track.
1901
1902         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1903         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1904         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
1905         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
1906         (WebCore::MediaPlayerPrivateAVFoundationObjC::audioSourceProvider):
1907         (WebCore::MediaPlayerPrivateAVFoundationObjC::processLegacyClosedCaptionsTracks):
1908         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeAVAssetTracksForAudibleMedia):
1909
1910 2015-05-12  Ryosuke Niwa  <rniwa@webkit.org>
1911
1912         Mac build fix after r184228.
1913
1914         * bindings/scripts/CodeGeneratorJS.pm:
1915
1916 2015-05-12  Simon Fraser  <simon.fraser@apple.com>
1917
1918         Turn antialiased font dilation off by default
1919         https://bugs.webkit.org/show_bug.cgi?id=144940
1920         rdar://problem/20923031
1921
1922         Reviewed by Sam Weinig.
1923
1924         Turn antialised font dilation off by default.
1925
1926         * page/Settings.cpp:
1927         (WebCore::Settings::Settings):
1928         * platform/graphics/FontCascade.cpp:
1929
1930 2015-05-12  Alex Christensen  <achristensen@webkit.org>
1931
1932         Don't export all JS bindings classes.
1933         https://bugs.webkit.org/show_bug.cgi?id=144932
1934
1935         Reviewed by Dan Bernstein.
1936
1937         This change is good if it compiles and links successfully.
1938
1939         * bindings/scripts/CodeGeneratorJS.pm:
1940         (ExportLabelForClass):
1941         Add a list of the JS bindings classes that need WEBCORE_EXPORT to prevent exporting too many symbols from WebCore.
1942         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
1943         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
1944         * bindings/scripts/test/JS/JSTestEventConstructor.h:
1945         * bindings/scripts/test/JS/JSTestEventTarget.h:
1946         * bindings/scripts/test/JS/JSTestException.h:
1947         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
1948         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
1949         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
1950         * bindings/scripts/test/JS/JSTestNode.h:
1951         * bindings/scripts/test/JS/JSTestNondeterministic.h:
1952         * bindings/scripts/test/JS/JSTestObj.h:
1953         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
1954         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
1955         * bindings/scripts/test/JS/JSTestTypedefs.h:
1956         * bindings/scripts/test/JS/JSattribute.h:
1957         * bindings/scripts/test/JS/JSreadonly.h:
1958         Update bindings tests to remove WEBCORE_EXPORT from most of the tests,
1959         but keep one test with WEBCORE_EXPORT and one test with WEBCORE_TESTSUPPORT_EXPORT.
1960
1961 2015-05-12  Brent Fulgham  <bfulgham@apple.com>
1962
1963         [Win] Update DXSDK_DIR settings for build system.
1964
1965         Unreviewed build fix.
1966
1967         * WebCore.vcxproj/WebCore.proj: Add DXSDK_DIR definition for builder.
1968
1969 2015-05-12  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1970
1971         Return Ref instead of PassRefPtr in create() factory functions of WebCore/dom
1972         https://bugs.webkit.org/show_bug.cgi?id=144904
1973
1974         Reviewed by Andreas Kling.
1975
1976         We return Ref when we're sure if pointer can't be null. If not, we use RefPtr instead PassRefPtr.
1977
1978         No new tests, no behavior changes.
1979
1980         * dom/AutocompleteErrorEvent.h:
1981         * dom/DOMNamedFlowCollection.h:
1982         (WebCore::DOMNamedFlowCollection::create):
1983         * dom/MessageChannel.h:
1984         (WebCore::MessageChannel::create):
1985         * dom/MessagePort.h:
1986         * dom/MutationObserver.cpp:
1987         (WebCore::MutationObserver::create):
1988         * dom/MutationObserver.h:
1989         * dom/NamedFlowCollection.h:
1990         * dom/NodeFilter.h:
1991         (WebCore::NodeFilter::create):
1992         * dom/NodeIterator.h:
1993         (WebCore::NodeIterator::create):
1994         * dom/ProcessingInstruction.cpp:
1995         (WebCore::ProcessingInstruction::create):
1996         * dom/ProcessingInstruction.h:
1997         * dom/ScriptedAnimationController.h:
1998         (WebCore::ScriptedAnimationController::create):
1999         * dom/SecurityPolicyViolationEvent.h:
2000         * dom/StaticNodeList.h:
2001         * dom/TemplateContentDocumentFragment.h:
2002         * dom/Touch.cpp:
2003         (WebCore::Touch::cloneWithNewTarget):
2004         * dom/Touch.h:
2005         (WebCore::Touch::create):
2006         * dom/TouchEvent.h:
2007         * dom/TouchList.h:
2008         (WebCore::TouchList::create):
2009         * dom/TreeWalker.h:
2010         (WebCore::TreeWalker::create):
2011         * dom/WebKitNamedFlow.cpp:
2012         (WebCore::WebKitNamedFlow::create):
2013         * dom/WebKitNamedFlow.h:
2014         * dom/default/PlatformMessagePortChannel.cpp:
2015         (WebCore::PlatformMessagePortChannel::create):
2016         * dom/default/PlatformMessagePortChannel.h:
2017         (WebCore::PlatformMessagePortChannel::MessagePortQueue::create):
2018
2019 2015-05-12  Matt Baker  <mattbaker@apple.com>
2020
2021         Web Inspector: REGRESSION (r181625): Timeline recording started from console.profile is always empty
2022         https://bugs.webkit.org/show_bug.cgi?id=144882
2023
2024         Reviewed by Brian Burg.
2025
2026         A timeline recording will always be stopped before the end of the current run loop is observed. Before
2027         dispatching the recording stopped event, the last run loop record must be completed and sent to the frontend
2028         to prevent it from being discarded.
2029
2030         * inspector/InspectorTimelineAgent.cpp:
2031         (WebCore::InspectorTimelineAgent::internalStop):
2032
2033 2015-05-12  Zalan Bujtas  <zalan@apple.com>
2034
2035         REGRESSION(r175617): Some text doesn't render on internationalculinarycenter.com
2036         https://bugs.webkit.org/show_bug.cgi?id=144917
2037         rdar://problem/20545878
2038
2039         Reviewed by Andreas Kling.
2040
2041         This patch ensures that text stroke width value is taken into account while
2042         calculating visual overflow for simple line layout.
2043         Ceiling the text stroke width value matches the normal text layout behaviour.
2044
2045         Test: fast/text/simple-line-layout-text-stroke-width.html
2046
2047         * rendering/SimpleLineLayoutFunctions.cpp:
2048         (WebCore::SimpleLineLayout::paintFlow):
2049         (WebCore::SimpleLineLayout::collectFlowOverflow):
2050
2051 2015-05-12  Alexey Proskuryakov  <ap@apple.com>
2052
2053         Build fix.
2054
2055         * platform/spi/cf/CFNetworkSPI.h:
2056
2057 2015-05-12  Brent Fulgham  <bfulgham@apple.com>
2058
2059         ROLLOUT [Win] Unreviewed build fix for older DirectX build environments.
2060
2061         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2062
2063 2015-05-12  Joanmarie Diggs  <jdiggs@igalia.com>
2064
2065         AX: [ATK] ARIA menu items should not have anonymous block children
2066         https://bugs.webkit.org/show_bug.cgi?id=144653
2067
2068         Reviewed by Chris Fleizach.
2069
2070         Exclude anonymous block children of menu items from the accessible tree
2071         for ATK. Exclude list markers from the accessibility tree if the parent
2072         is not being exposed as an accessible list item.
2073
2074         No new tests. Instead, modified the existing tests to reflect the correct
2075         behavior.
2076
2077         * accessibility/AccessibilityRenderObject.cpp:
2078         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
2079         * accessibility/atk/AccessibilityObjectAtk.cpp:
2080         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
2081
2082 2015-05-08  Alexey Proskuryakov  <ap@apple.com>
2083
2084         [Mac] Share cookie storage between UI process and secondary processes
2085         https://bugs.webkit.org/show_bug.cgi?id=144820
2086         rdar://problem/20572830
2087
2088         Reviewed by Darin Adler.
2089
2090         * platform/network/mac/CookieJarMac.mm:
2091         * platform/spi/cf/CFNetworkSPI.h:
2092         Moved SPIs into an SPI header, so that WebKit2 could use them too without duplication.
2093
2094 2015-05-12  Chris Dumez  <cdumez@apple.com>
2095
2096         [WK2] Log using diagnostic logging how far back in history we navigate
2097         https://bugs.webkit.org/show_bug.cgi?id=144919
2098         <rdar://problem/20920043>
2099
2100         Reviewed by Gavin Barraclough.
2101
2102         Add diagnostic logging keys for logging back history navigation delta.
2103
2104         * page/DiagnosticLoggingKeys.cpp:
2105         (WebCore::DiagnosticLoggingKeys::deltaKey):
2106         (WebCore::DiagnosticLoggingKeys::backNavigationKey):
2107         * page/DiagnosticLoggingKeys.h:
2108
2109 2015-05-12  Yoav Weiss  <yoav@yoav.ws>
2110
2111         Avoid CSSPrimitiveValue allocation when parsing sizes
2112         https://bugs.webkit.org/show_bug.cgi?id=144910
2113
2114         Reviewed by Darin Adler.
2115
2116         Turn non-calc length calculation logic into a static method,
2117         so that it can be called without a CSSPrimitiveValue object.
2118         Then, call that method to calculate the default source-size length.
2119
2120         No new tests, since no functionality change.
2121
2122         * css/CSSPrimitiveValue.cpp:
2123         (WebCore::CSSPrimitiveValue::computeLengthDouble): Split out the logic for everything that's not calc into a static method.
2124         (WebCore::CSSPrimitiveValue::computeNonCalcLengthDouble): Static length computation logic for everything that is not calc.
2125         * css/CSSPrimitiveValue.h:
2126         (WebCore::CSSPrimitiveValue::isFontRelativeLength): Turn into static.
2127         * css/SourceSizeList.cpp:
2128         (WebCore::defaultLength): Use the new static method to compute the length.
2129         (WebCore::computeLength): Use the calc length computation methods directly.
2130
2131 2015-05-12  Brent Fulgham  <bfulgham@apple.com>
2132
2133         [Win] Unreviewed build fix for older DirectX build environments.
2134
2135         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: Switch back to our
2136         d3d stub header to avoid build failures on July 2004 DXSDK build environments.
2137
2138 2015-05-12  Eric Carlson  <eric.carlson@apple.com>
2139
2140         [Mac] Refine media playback target client configuration
2141         https://bugs.webkit.org/show_bug.cgi?id=144892
2142
2143         Reviewed by Brent Fulgham.
2144
2145         Client and target picker state changes fequently happen several times in quick succession, so
2146         don't react to immediately so we can batch callbacks to the web process. 
2147         * Modules/mediasession/WebMediaSessionManager.cpp:
2148         (WebCore::ClientState::ClientState): Store the client as a reference rather than a pointer
2149         because it can never be NULL.
2150         (WebCore::ClientState::operator == ): New.
2151         (WebCore::WebMediaSessionManager::addPlaybackTargetPickerClient): Schedule the initial client 
2152         configuration and a target configuration check.
2153         (WebCore::WebMediaSessionManager::removePlaybackTargetPickerClient): Schedule a target monitoring
2154         update, and a target configuration check.
2155         (WebCore::WebMediaSessionManager::removeAllPlaybackTargetPickerClients): Ditto.
2156         (WebCore::WebMediaSessionManager::showPlaybackTargetPicker): Schedule a target monitoring update.
2157         (WebCore::WebMediaSessionManager::clientStateDidChange): If the client whose state has changed
2158         can play to a target, tell it to start using the target even if it isn't playing as long as
2159         no other client is actively using a target.
2160         (WebCore::WebMediaSessionManager::setPlaybackTarget): Configure clients after a pause.
2161         (WebCore::WebMediaSessionManager::configureNewClients): New, do new client configuration.
2162         (WebCore::WebMediaSessionManager::configurePlaybackTargetClients): New, configure target clients.
2163         (WebCore::WebMediaSessionManager::scheduleDelayedTask): Schedule the timer.
2164         (WebCore::WebMediaSessionManager::taskTimerFired): Execute delayed tasks.
2165         (WebCore::WebMediaSessionManager::find): 
2166         * Modules/mediasession/WebMediaSessionManager.h:
2167
2168         * html/HTMLMediaElement.cpp:
2169         (WebCore::HTMLMediaElement::setMuted): Call updateMediaState.
2170         (WebCore::HTMLMediaElement::setPlaying): Ditto.
2171         (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged): Ditto.
2172         (WebCore::HTMLMediaElement::enqueuePlaybackTargetAvailabilityChangedEvent): Expand logging.
2173         (WebCore::HTMLMediaElement::updateMediaState): New, don't broadcast a media state change
2174         unless something actually changed.
2175         * html/HTMLMediaElement.h:
2176
2177         * html/HTMLMediaSession.cpp:
2178         (WebCore::HTMLMediaSession::externalOutputDeviceAvailableDidChange): Update logging.
2179         (WebCore::HTMLMediaSession::setShouldPlayToPlaybackTarget): Ditto.
2180         (WebCore::HTMLMediaSession::mediaEngineUpdated): Cleanup.
2181
2182         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
2183         (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker): Remove the call to
2184         deprecated API and the "-Wdeprecated-declarations".
2185
2186 2015-05-12  Joanmarie Diggs  <jdiggs@igalia.com>
2187
2188         AX: [GTK] Defer to WebCore Accessibility for table exposure
2189         https://bugs.webkit.org/show_bug.cgi?id=144896
2190
2191         Reviewed by Chris Fleizach.
2192
2193         Stop unconditionally exposing all HTMLTableElement nodes as AccessibilityTables
2194         for WebKitGtk.
2195
2196         No new tests. Several existing tests already cover table exposure. They have
2197         been updated accordingly.
2198
2199         * accessibility/AccessibilityTable.cpp:
2200         (WebCore::AccessibilityTable::computeIsTableExposableThroughAccessibility):
2201
2202 2015-05-12  Joanmarie Diggs  <jdiggs@igalia.com>
2203
2204         [GTK][WK2] rowAtIndex is not implemented in DRT/WKTR
2205         https://bugs.webkit.org/show_bug.cgi?id=116971
2206
2207         Reviewed by Chris Fleizach.
2208
2209         Because ATK lacks API to directly get an accessible row via its index,
2210         the implementation of rowAtIndex gets a cell in the indexed row and
2211         returns the parent row. The failing test continued to fail because
2212         AccessibilityARIAGridCell::parentTable called parentObjectUnignored at
2213         most twice, the second call in place to handle rows which are included
2214         in the tree. However, given a well-formed ARIA grid with a rowgroup that
2215         is interactive, that rowgroup also needs to be in the tree necessitating
2216         parentObjectUnignored be called a third time to get to the grid. Given a
2217         poorly-formed ARIA grid, there may additional objects which pass the test
2218         for inclusion standing in between the cell and grid necessitating more
2219         calls still. Therefore, ascend the hierarchy to find the parent grid.
2220
2221         No new tests. The failing test now passes.
2222
2223         * accessibility/AccessibilityARIAGridCell.cpp:
2224         (WebCore::AccessibilityARIAGridCell::parentTable):
2225
2226 2015-05-08  Carlos Garcia Campos  <cgarcia@igalia.com>
2227
2228         [X11] Add XUniquePtr and XUniqueResource to automatically free X resources
2229         https://bugs.webkit.org/show_bug.cgi?id=144521
2230
2231         Reviewed by Darin Adler.
2232
2233         Add XUniquePtr as a template alias of std:unique_ptr to handle X
2234         resources using pointers and XUniqueResource as a new class to
2235         handle X resources using a long unsigned identifier. This
2236         simplifies the code and makes it more difficult to leak X resources.
2237
2238         * PlatformEfl.cmake: Add new files to compilation.
2239         * PlatformGTK.cmake: Ditto.
2240         * platform/graphics/cairo/BackingStoreBackendCairoX11.cpp:
2241         (WebCore::BackingStoreBackendCairoX11::BackingStoreBackendCairoX11):
2242         Remove the display member, and use XUnique for Pixmap and GC.
2243         (WebCore::BackingStoreBackendCairoX11::~BackingStoreBackendCairoX11):
2244         Remove code to explicitly free Pixmap and GC.
2245         (WebCore::BackingStoreBackendCairoX11::scroll):
2246         * platform/graphics/cairo/BackingStoreBackendCairoX11.h:
2247         * platform/graphics/glx/GLContextGLX.cpp:
2248         (WebCore::GLContextGLX::createWindowContext): Use XUnique and the
2249         new constructor that receives a XID, since there's no longer
2250         conflict with the one receiving a Pbuffer.
2251         (WebCore::GLContextGLX::createPbufferContext): Use XUnique and the
2252         new constructor that receives a XUniqueGLXPbuffer&&.
2253         (WebCore::GLContextGLX::createPixmapContext):
2254         (WebCore::GLContextGLX::createContext):
2255         (WebCore::GLContextGLX::GLContextGLX):
2256         (WebCore::GLContextGLX::~GLContextGLX): Remove code to explicitly
2257         free X resources.
2258         (WebCore::GLContextGLX::makeContextCurrent):
2259         (WebCore::GLContextGLX::cairoDevice):
2260         (WebCore::GLContextGLX::platformContext):
2261         * platform/graphics/glx/GLContextGLX.h:
2262         * platform/graphics/surfaces/egl/EGLXSurface.cpp:
2263         (WebCore::EGLXTransportSurfaceClient::EGLXTransportSurfaceClient):
2264         (WebCore::EGLXTransportSurfaceClient::destroy):
2265         (WebCore::EGLXTransportSurfaceClient::prepareTexture):
2266         * platform/graphics/surfaces/egl/EGLXSurface.h:
2267         * platform/graphics/surfaces/glx/GLXConfigSelector.h:
2268         (WebCore::GLXConfigSelector::findMatchingConfig): Use XUnique
2269         instead of the custom std::unique X11Deleter.
2270         (WebCore::GLXConfigSelector::findMatchingConfigWithVisualId): Ditto.
2271         * platform/graphics/surfaces/glx/GLXSurface.cpp:
2272         (WebCore::GLXTransportSurface::GLXTransportSurface): Ditto.
2273         (WebCore::GLXOffScreenSurface::initialize):
2274         * platform/graphics/surfaces/glx/X11Helper.cpp:
2275         (WebCore::X11Helper::createOffScreenWindow): Ditto.
2276         (WebCore::X11Helper::createPixmap): Ditto.
2277         * platform/graphics/surfaces/glx/X11Helper.h:
2278         * platform/graphics/x11/XUniquePtr.h: Remove X11Deleter.
2279         (WebCore::XPtrDeleter::operator()):
2280         * platform/graphics/x11/XUniqueResource.cpp: Added.
2281         (WebCore::XUniqueResource<XResource::Colormap>::deleteXResource):
2282         (WebCore::XUniqueResource<XResource::Damage>::deleteXResource):
2283         (WebCore::XUniqueResource<XResource::Pixmap>::deleteXResource):
2284         (WebCore::XUniqueResource<XResource::Window>::deleteXResource):
2285         (WebCore::XUniqueResource<XResource::GLXPbuffer>::deleteXResource):
2286         (WebCore::XUniqueResource<XResource::GLXPixmap>::deleteXResource):
2287         * platform/graphics/x11/XUniqueResource.h: Added.
2288         (WebCore::XUniqueResource::XUniqueResource):
2289         (WebCore::XUniqueResource::operator=):
2290         (WebCore::XUniqueResource::~XUniqueResource):
2291         (WebCore::XUniqueResource::get):
2292         (WebCore::XUniqueResource::release):
2293         (WebCore::XUniqueResource::reset):
2294         (WebCore::XUniqueResource::operator!):
2295         (WebCore::XUniqueResource::operator UnspecifiedBoolType*):
2296
2297 2015-05-12  Zan Dobersek  <zdobersek@igalia.com>
2298
2299         Move TransformOperation-based classes off of PassRefPtr
2300         https://bugs.webkit.org/show_bug.cgi?id=144876
2301
2302         Reviewed by Darin Adler.
2303
2304         Remove uses of PassRefPtr from the TransformOperation class and its
2305         derivatives, operating on Ref and RefPtr objects instead.
2306
2307         * platform/graphics/transforms/IdentityTransformOperation.h:
2308         * platform/graphics/transforms/Matrix3DTransformOperation.cpp:
2309         (WebCore::Matrix3DTransformOperation::blend):
2310         * platform/graphics/transforms/Matrix3DTransformOperation.h:
2311         * platform/graphics/transforms/MatrixTransformOperation.cpp:
2312         (WebCore::MatrixTransformOperation::blend):
2313         * platform/graphics/transforms/MatrixTransformOperation.h:
2314         * platform/graphics/transforms/PerspectiveTransformOperation.cpp:
2315         (WebCore::PerspectiveTransformOperation::blend):
2316         * platform/graphics/transforms/PerspectiveTransformOperation.h:
2317         * platform/graphics/transforms/RotateTransformOperation.cpp:
2318         (WebCore::RotateTransformOperation::blend):
2319         * platform/graphics/transforms/RotateTransformOperation.h:
2320         * platform/graphics/transforms/ScaleTransformOperation.cpp:
2321         (WebCore::ScaleTransformOperation::blend):
2322         * platform/graphics/transforms/ScaleTransformOperation.h:
2323         * platform/graphics/transforms/SkewTransformOperation.cpp:
2324         (WebCore::SkewTransformOperation::blend):
2325         * platform/graphics/transforms/SkewTransformOperation.h:
2326         * platform/graphics/transforms/TransformOperation.h:
2327         * platform/graphics/transforms/TransformOperations.cpp:
2328         (WebCore::TransformOperations::blendByMatchingOperations):
2329         * platform/graphics/transforms/TranslateTransformOperation.cpp:
2330         (WebCore::TranslateTransformOperation::blend):
2331         * platform/graphics/transforms/TranslateTransformOperation.h:
2332
2333 2015-05-12  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
2334
2335         [Streams API] ReadableStream reader should not be disposable when having pending promises
2336         https://bugs.webkit.org/show_bug.cgi?id=144869
2337
2338         Reviewed by Darin Adler.
2339
2340         Made error promise callback to take a ref to the reader so that the reader is not disposed as long as the promise callback is not resolved.
2341
2342         Covered by tests added to streams/readable-stream-gc.html.
2343
2344         * Modules/streams/ReadableStreamReader.cpp:
2345         (WebCore::ReadableStreamReader::ReadableStreamReader): Moved initialize() call outside constructor as it can ref/unref.
2346         (WebCore::ReadableStreamReader::releaseStreamAndClean): Added protector.
2347         * Modules/streams/ReadableStreamReader.h:
2348         * bindings/js/JSReadableStreamReaderCustom.cpp:
2349         (WebCore::JSReadableStreamReader::closed): Lambda for error now takes a ref to the reader.
2350         * bindings/js/ReadableJSStream.cpp:
2351         (WebCore::ReadableJSStream::Reader::create): Calling initialize() after adoptRef().
2352
2353 2015-05-11  Zan Dobersek  <zdobersek@igalia.com>
2354
2355         Clean up redundant resources in case of failure in GLContextEGL context creation methods
2356         https://bugs.webkit.org/show_bug.cgi?id=144878
2357
2358         Reviewed by Martin Robinson.
2359
2360         GLContextEGL::createWindowContext() and GLContextEGL::createPixmapContext() methods
2361         should clean up the freshly-created resources when prematurely returning due to a
2362         failure.
2363
2364         * platform/graphics/egl/GLContextEGL.cpp:
2365         (WebCore::GLContextEGL::createWindowContext):
2366         (WebCore::GLContextEGL::createPixmapContext):
2367
2368 2015-05-11  Dan Bernstein  <mitz@apple.com>
2369
2370         WebCore part of <rdar://problem/20878075> Trying to navigate to an invalid URL loads about:blank, but -[WKWebView URL] returns the invalid URL
2371
2372         Reviewed by Alexey Proskuryakov.
2373
2374         Test: TestWebKitAPI/Tests/WebKit2Cocoa/ProvisionalURLChange.mm
2375
2376         In some cases, trying to navigate to an invalid URL results in navigation to about:blank.
2377         When the about:blank load is committed, the UI process still thinks that the provisional
2378         URL is the original, invalid URL, and updates its state to reflect that that’s the URL that
2379         has been committed.
2380
2381         The provisional URL changes (1) when a provisional load begins, (2) when a server redirect
2382         happens, (3) when the client changes the request in willSendRequest, and (4) in this
2383         about:blank case. For (1) and (2), there are frame loader client callbacks. (3) is client-
2384         initiated. So this patch addresses (4).
2385
2386         * loader/DocumentLoader.cpp:
2387         (WebCore::DocumentLoader::maybeLoadEmpty): If our request URL is changing to about:blank and
2388         while loading the main resource, call FrameLoaderClient::dispatchDidChangeProvisionalURL.
2389         * loader/FrameLoaderClient.h: Added dispatchDidChangeProvisionalURL with an empty
2390         implementation.
2391
2392 2015-05-11  Zalan Bujtas  <zalan@apple.com>
2393
2394         Text is misplaced when custom font does not have space glyph.
2395         https://bugs.webkit.org/show_bug.cgi?id=144879
2396
2397         Reviewed by Myles C. Maxfield
2398
2399         This patch ensures that we use fallback font for the missing space glyph only when the rendered text has space in it.
2400
2401         If a font does not provide all the glyphs required to render the associated text, we initiate fallback fonts. It is done while
2402         measuring the text at layout time. However due to the fact that we always pre-measure space, a font with no space glyph in it is never sufficient.
2403         (even when the text does not require space at all)
2404         Fallback fonts impact line positions through ascent/descent calculation.
2405
2406         Test: fast/text/font-with-no-space-glyph.html
2407
2408         * rendering/RenderText.cpp:
2409         (WebCore::RenderText::computePreferredLogicalWidths):
2410         * rendering/line/BreakingContext.h:
2411         (WebCore::WordTrailingSpace::WordTrailingSpace):
2412         (WebCore::WordTrailingSpace::width):
2413         (WebCore::BreakingContext::handleText):
2414
2415 2015-05-11  Simon Fraser  <simon.fraser@apple.com>
2416
2417         Small tidyup in animations code
2418         https://bugs.webkit.org/show_bug.cgi?id=144893
2419
2420         Reviewed by Eric Carlson.
2421
2422         Reading progress(1, 0, 0) in callers of AnimationBase::progress() was confusing,
2423         particularly as the last parameter is a TimingFunction*. Put default values 
2424         in the header (with nullptr) and fix the callers. Also fix variable names in
2425         the implementation.
2426
2427         * page/animation/AnimationBase.cpp:
2428         (WebCore::AnimationBase::progress):
2429         * page/animation/AnimationBase.h:
2430         * page/animation/ImplicitAnimation.cpp:
2431         (WebCore::ImplicitAnimation::animate):
2432         (WebCore::ImplicitAnimation::getAnimatedStyle):
2433         (WebCore::ImplicitAnimation::blendPropertyValueInStyle):
2434
2435 2015-05-11  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2436
2437         Purge PassRefPtr in WebCore/rendering
2438         https://bugs.webkit.org/show_bug.cgi?id=144872
2439
2440         Reviewed by Darin Adler.
2441
2442         As a step to remove PassRefPtr, this patch replaces PassRefPtr with Ref in WebCore/rendering.
2443
2444         No new tests, no behavior changes.
2445
2446         * rendering/HitTestingTransformState.h:
2447         (WebCore::HitTestingTransformState::create):
2448         * rendering/RenderLayer.cpp:
2449         (WebCore::ClipRects::create):
2450         * rendering/RenderThemeGtk.cpp:
2451         (WebCore::RenderThemeGtk::create):
2452         (WebCore::RenderTheme::themeForPage):
2453         * rendering/RenderThemeGtk.h:
2454         * rendering/RenderThemeIOS.h:
2455         * rendering/RenderThemeIOS.mm:
2456         (WebCore::RenderTheme::themeForPage):
2457         (WebCore::RenderThemeIOS::create):
2458         * rendering/RenderThemeMac.h:
2459         * rendering/RenderThemeMac.mm:
2460         (WebCore::RenderTheme::themeForPage):
2461         (WebCore::RenderThemeMac::create):
2462         * rendering/RenderThemeSafari.cpp:
2463         (WebCore::RenderThemeSafari::create):
2464         (WebCore::RenderTheme::themeForPage):
2465         * rendering/RenderThemeSafari.h:
2466         * rendering/RenderThemeWin.cpp:
2467         (WebCore::RenderThemeWin::create):
2468         (WebCore::RenderTheme::themeForPage):
2469         * rendering/RenderThemeWin.h:
2470         * rendering/TextAutoSizing.h:
2471         (WebCore::TextAutoSizingValue::create):
2472         * rendering/style/ShapeValue.h:
2473         (WebCore::ShapeValue::createShapeValue):
2474         (WebCore::ShapeValue::createBoxShapeValue):
2475         (WebCore::ShapeValue::createImageValue):
2476         * rendering/style/StyleCachedImage.h:
2477         * rendering/style/StyleCachedImageSet.h:
2478         * rendering/style/StyleGeneratedImage.h:
2479         * rendering/style/StylePendingImage.h:
2480         * rendering/style/StyleReflection.h:
2481         (WebCore::StyleReflection::create):
2482
2483 2015-05-11  Eric Carlson  <eric.carlson@apple.com>
2484
2485         [Mac] Update device picker icon when video tracks change
2486         https://bugs.webkit.org/show_bug.cgi?id=144889
2487         <rdar://problem/20907253>
2488
2489         Reviewed by Brent Fulgham.
2490
2491         * Modules/mediacontrols/mediaControlsApple.js:
2492         (Controller.prototype.updateHasVideo):
2493
2494 2015-05-11  Brent Fulgham  <bfulgham@apple.com>
2495
2496         Scroll snap logic should be triggered when resizing the WebView
2497         https://bugs.webkit.org/show_bug.cgi?id=142590
2498         <rdar://problem/20125088>
2499
2500         Reviewed by Simon Fraser.
2501
2502         Tests coming in a second patch.
2503
2504         Resizing of the main frame or overflow regions was properly recalculating the scroll snap points,
2505         but there was no code to honor these values when window resizing was occurring. The correction was
2506         handled in two ways:
2507         1. Scrolling thread operations that moved to new snap points needed to notify the main thread that
2508            it had shifted to a new snap point, so that the resize code (which happens on the main thread)
2509            could ensure that we stayed clamped to the correct 'tile' in the snap region.
2510         2. Main thread (overflow) resizes were likewise missing code to honor the current snap position
2511            after resizing calculations were complete.
2512
2513         This change also required the addition of two indices to the scrollable area to track which scroll
2514         snap point was currently being used. We don't bother with a 'none' case because you cannot have a
2515         'none' state when you have an active set of scroll snap points, and we do not execute this code
2516         if the scroll snap points are null.
2517
2518         The FrameView code was computing updated snap offsets after it had dispatched frame view layout
2519         information to the scrolling thread, which was wrong. This was also corrected.
2520
2521         I think it might be possible to track all of this state inside the ScrollController, but the current
2522         scroll snap architecture destroys and recreates the state each time a new set of interactions starts.
2523         This should be fixed in the future, which would allow us to remove some of this local state.
2524
2525         * page/FrameView.cpp:
2526         (WebCore::FrameView::performPostLayoutTasks): Make sure 'updateSnapOffsets' is called prior to
2527         calling 'frameViewLayoutUpdated' so the scrolling thread gets correct updated points. Add a new
2528         call to 'scrollToNearestActiveSnapPoint', which will keep us on our current snap point during
2529         resize (if appropriate).
2530         * page/scrolling/AsyncScrollingCoordinator.cpp:
2531         (WebCore::AsyncScrollingCoordinator::updateScrollSnapOffsetIndices): Added. This finds and notifies
2532         the correct scroll region when a new snap position (index) has been selected by user interaction on
2533         the scrolling thread.
2534         (WebCore::AsyncScrollingCoordinator::deferTestsForReason): Added an assertion for 'isMainThread'.
2535         (WebCore::AsyncScrollingCoordinator::removeTestDeferralForReason): Ditto.
2536         * page/scrolling/AsyncScrollingCoordinator.h:
2537         * page/scrolling/AxisScrollSnapOffsets.h:
2538         (WebCore::closestSnapOffset): Modified to also return the selected snap point index so we can track
2539         it to handle resize operations.
2540         * page/scrolling/ScrollingTree.h:
2541         (WebCore::ScrollingTree::updateScrollSnapOffsetIndices):
2542         * page/scrolling/ThreadedScrollingTree.cpp:
2543         (WebCore::ThreadedScrollingTree::updateScrollSnapOffsetIndices): Added method to dispatch the active
2544         horizontal and vertical scroll snap indices back to the main thread.
2545         * page/scrolling/ThreadedScrollingTree.h:
2546         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2547         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent): After the scroll controller processes
2548         the current event, notify the main thread of any change in the active scroll snap index.
2549         * platform/ScrollAnimator.cpp:
2550         (WebCore::ScrollAnimator::activeScrollSnapOffsetIndexDidChange): Added method to allow ScrollAnimator
2551         clients to find out about the current scroll snap state, which is only known by the ScrollController.
2552         (WebCore::ScrollAnimator::activeScrollSnapOffsetIndexForAxis): Ditto.
2553         * platform/ScrollAnimator.h:
2554         * platform/ScrollView.cpp:
2555         (WebCore::ScrollView::scrollToNearestActiveSnapPoint): Added method that allows us to set scroll position
2556         to one of our active scroll snap offsets.
2557         * platform/ScrollView.h:
2558         * platform/ScrollableArea.cpp:
2559         (WebCore::ScrollableArea::handleWheelEvent): If the active scroll snap offset has changed, make sure we
2560         keep track of the new values for potential resize operations.
2561         (WebCore::ScrollableArea::clearHorizontalSnapOffsets): Make sure to also clear out the current snap index.
2562         (WebCore::ScrollableArea::clearVerticalSnapOffsets): Ditto.
2563         (WebCore::ScrollableArea::nearestActiveSnapPoint): New method that returns an updated IntPoint reflecting
2564         the proper scroll position based on the active scroll snap offset.
2565         * platform/ScrollableArea.h:
2566         (WebCore::ScrollableArea::currentHorizontalSnapPointIndex): Added.
2567         (WebCore::ScrollableArea::setCurrentHorizontalSnapPointIndex): Added.
2568         (WebCore::ScrollableArea::currentVerticalSnapPointIndex): Added.
2569         (WebCore::ScrollableArea::setCurrentVerticalSnapPointIndex): Added.
2570         (WebCore::ScrollableArea::scrollToNearestActiveSnapPoint): Added.
2571         * platform/cocoa/ScrollController.h:
2572         (WebCore::ScrollControllerClient::activeScrollOffsetIndex): Added new method for clients to implement.
2573         (WebCore::ScrollController::activeScrollSnapOffsetIndexDidChange): Added.
2574         (WebCore::ScrollController::setScrollSnapOffsetIndexDidChange): Added.
2575         * platform/cocoa/ScrollController.mm:
2576         (WebCore::ScrollController::activeScrollSnapOffsetIndexForAxis): Helper method to return current active
2577         index (if applicable).
2578         (WebCore::ScrollController::setActiveScrollSnapOffsetIndexForAxis): Helper function to safely set
2579         the current active index.
2580         (WebCore::ScrollController::beginScrollSnapAnimation): Updated to keep track of the new active scroll snap
2581         index, as well as whether the current animation actually changed the active snap point offset.
2582         * platform/cocoa/ScrollSnapAnimatorState.h: Revise to use modern C++ initializers, and to track a new index
2583         that represents the current scroll snap offset.
2584         * platform/cocoa/ScrollSnapAnimatorState.mm:
2585         (WebCore::ScrollSnapAnimatorState::ScrollSnapAnimatorState): Update for modern C++ syntax.
2586         * rendering/RenderLayer.cpp:
2587         (WebCore::RenderLayer::scrollToNearestActiveSnapPoint): New method to set scroll position to be one of our
2588         active scroll snap points.
2589         (WebCore::RenderLayer::updateScrollInfoAfterLayout): Add a new call to 'scrollToNearestActiveSnapPoint' so that
2590         we stay on the current scroll snap offset during resizing.
2591         * rendering/RenderLayer.h:
2592
2593 2015-05-11  Myles C. Maxfield  <mmaxfield@apple.com>
2594
2595         Addressing post-review comments after r184037.
2596
2597         Unreviewed.
2598
2599         No new tests because there is no behavior change.
2600
2601         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
2602         (WebCore::SimpleLineLayout::TextFragmentIterator::runWidth):
2603
2604 2015-05-11  Brent Fulgham  <bfulgham@apple.com>
2605
2606         [Win] Move Windows build target to Windows 7 (or newer)
2607         https://bugs.webkit.org/show_bug.cgi?id=144890
2608         <rdar://problem/20707307>
2609
2610         Reviewed by Anders Carlsson.
2611
2612         Update linked SDK and minimal Windows level to be compatible with
2613         Windows 7 or newer.
2614
2615         * WebCore.vcxproj/WebCore.vcxproj:
2616         * WebCore.vcxproj/WebCoreGenerated.vcxproj:
2617         * WebCore.vcxproj/WebCoreTestSupport.vcxproj:
2618         * WebCorePrefix.h:
2619         * config.h:
2620         * testing/js/WebCoreTestSupportPrefix.h:
2621
2622 2015-05-11  Joanmarie Diggs  <jdiggs@igalia.com>
2623
2624         AX: [ATK] Always include rows in the tree of accessible tables
2625         https://bugs.webkit.org/show_bug.cgi?id=144885
2626
2627         Reviewed by Chris Fleizach.
2628
2629         Remove the code that excluded rows from the tree of accessible tables for
2630         Gtk and Efl, the latter of which inherited the exclusion from the former.
2631
2632         No new tests. We already have several tests which cover table hierarchy.
2633         The associated expectations have been updated as part of this fix.
2634
2635         * accessibility/AccessibilityTable.cpp:
2636         (WebCore::AccessibilityTable::addChildrenFromSection):
2637         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2638         (webkitAccessibleGetParent):
2639
2640 2015-05-11  Matt Baker  <mattbaker@apple.com>
2641
2642         Web Inspector: REGRESSION (r175203): No profile information is shown in Inspector
2643         https://bugs.webkit.org/show_bug.cgi?id=144808
2644
2645         Reviewed by Darin Adler.
2646
2647         Profiles started from the console should always use the Inspector environment's shared stopwatch.
2648
2649         * inspector/InspectorTimelineAgent.cpp:
2650         (WebCore::InspectorTimelineAgent::startFromConsole):
2651
2652 2015-05-11  Alex Christensen  <achristensen@webkit.org>
2653
2654         [Content Extensions] Support domain-specific rules and exceptions.
2655         https://bugs.webkit.org/show_bug.cgi?id=144833
2656
2657         Reviewed by Darin Adler.
2658
2659         Test: http/tests/contentextensions/domain-rules.html
2660         (And lots of API tests)
2661
2662         This patch adds if-domain and unless-domain to the trigger in the JSON format.
2663         if-domain makes the rule apply only to domains in the list.
2664         unless-domain makes the rule apply to domains that are not in the list.
2665         
2666         All rules without if-domain or unless-domain are compiled into a set of DFAs.  This behavior is unchanged.
2667         All rules with if-domain or unless-domain are compiled into a separate set of DFAs.
2668         The domains are also compiled into another set of DFAs.  This makes 3 arrays of DFA bytecode instead of 1.
2669         
2670         If there are no domain specific rules, there is no change in behavior.
2671         If there are domain specific rules, the URL will be checked for matches in both
2672         filtersWithoutDomainsBytecode and filtersWithDomainsBytecode.  If there are matches from 
2673         filtersWithDomainsBytecode then the domain of the main document will be checked with 
2674         domainFiltersBytecode to see which of the matches applies to this domain.
2675
2676         * contentextensions/CombinedURLFilters.cpp:
2677         (WebCore::ContentExtensions::CombinedURLFilters::isEmpty):
2678         (WebCore::ContentExtensions::CombinedURLFilters::addDomain):
2679         * contentextensions/CombinedURLFilters.h:
2680         Added addDomain, which adds characters from a domain to the prefix tree directly without using YARR.
2681         * contentextensions/CompiledContentExtension.cpp:
2682         (WebCore::ContentExtensions::CompiledContentExtension::globalDisplayNoneSelectors):
2683         * contentextensions/CompiledContentExtension.h:
2684         * contentextensions/ContentExtensionCompiler.cpp:
2685         (WebCore::ContentExtensions::serializeActions):
2686         (WebCore::ContentExtensions::compileRuleList):
2687         Separate the rules into rules with domains and rules without domains and compile to bytecode.
2688         * contentextensions/ContentExtensionCompiler.h:
2689         Updated compiler interface to reflect the slightly more complicated structure.
2690         * contentextensions/ContentExtensionError.cpp:
2691         (WebCore::ContentExtensions::contentExtensionErrorCategory):
2692         * contentextensions/ContentExtensionError.h:
2693         Added new parsing errors.
2694         * contentextensions/ContentExtensionParser.cpp:
2695         (WebCore::ContentExtensions::getDomainList):
2696         (WebCore::ContentExtensions::loadTrigger):
2697         (WebCore::ContentExtensions::loadEncodedRules):
2698         * contentextensions/ContentExtensionRule.h:
2699         (WebCore::ContentExtensions::Trigger::operator==):
2700         Parse the new domain structures from JSON into the Trigger structure.
2701         * contentextensions/ContentExtensionsBackend.cpp:
2702         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
2703         Interpret as much bytecode as necessary to determine which rules apply to this URL and domain.
2704         * contentextensions/DFABytecode.h:
2705         (WebCore::ContentExtensions::instructionSizeWithArguments):
2706         * contentextensions/DFABytecodeCompiler.cpp:
2707         (WebCore::ContentExtensions::DFABytecodeCompiler::emitAppendAction):
2708         (WebCore::ContentExtensions::DFABytecodeCompiler::emitTestFlagsAndAppendAction):
2709         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNode):
2710         * contentextensions/DFABytecodeCompiler.h:
2711         * contentextensions/DFABytecodeInterpreter.cpp:
2712         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretAppendAction):
2713         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretTestFlagsAndAppendAction):
2714         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsFromDFARoot):
2715         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
2716         * contentextensions/DFABytecodeInterpreter.h:
2717         * loader/ResourceLoadInfo.h:
2718         Keep track of which actions have an if-domain trigger.  If an action is in the 
2719         filtersWithDomainsBytecode, then it either has an if-domain or an unless-domain in its trigger.
2720         This requires additional information in the bytecode, so there are two new bytecode types.
2721
2722 2015-05-11  Yoav Weiss  <yoav@yoav.ws>
2723
2724         Add srcset, sizes and picture to the features json
2725         https://bugs.webkit.org/show_bug.cgi?id=144862
2726
2727         Reviewed by Benjamin Poulain.
2728
2729         Add the srcset w descriptor and sizes attribute as a new feature in the JSON file,
2730         as well as adding the picture element and srcset's x descriptor as seperate features.
2731
2732         No new tests, since no new functionality added.
2733
2734         * features.json:
2735
2736 2015-05-11  Chris Dumez  <cdumez@apple.com>
2737
2738         Fix checkingLogicalHeight initialization in Document::updateLayoutIfDimensionsOutOfDate()
2739         https://bugs.webkit.org/show_bug.cgi?id=144873
2740
2741         Reviewed by Simon Fraser.
2742
2743         Fix checkingLogicalHeight initialization in Document::updateLayoutIfDimensionsOutOfDate().
2744         checkingLogicalHeight should only be initialized to true when
2745         "dimensionsCheck & WidthDimensionsCheck" if isVertical is true.
2746
2747         * dom/Document.cpp:
2748         (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
2749
2750 2015-05-11  Daniel Bates  <dabates@apple.com>
2751
2752         [iOS] Close all open databases in expiration handler of process assertion
2753         https://bugs.webkit.org/show_bug.cgi?id=144661
2754         <rdar://problem/20845052>
2755
2756         Reviewed by Darin Adler.
2757
2758         Expose functionality in WebCore to close all open databases. Closing a SQLite database
2759         will interrupt any in-progress database transactions.
2760
2761         * Modules/webdatabase/AbstractDatabaseServer.h:
2762         * Modules/webdatabase/DatabaseManager.cpp:
2763         (WebCore::DatabaseManager::closeAllDatabases): Added; turns around and calls DatabaseServer::closeAllDatabases().
2764         * Modules/webdatabase/DatabaseManager.h: Export DatabaseManager::closeAllDatabases() so that
2765         we can call in from WebKit2.
2766         * Modules/webdatabase/DatabaseServer.cpp:
2767         (WebCore::DatabaseServer::closeAllDatabases): Added; turns around and calls DatabaseTracker::closeAllDatabases().
2768         * Modules/webdatabase/DatabaseServer.h:
2769         * Modules/webdatabase/DatabaseTracker.cpp:
2770         (WebCore::DatabaseTracker::closeAllDatabases): Added; closes all open databases.
2771         * Modules/webdatabase/DatabaseTracker.h: Export DatabaseTracker::closeAllDatabases() so that
2772         we can call in from Legacy WebKit.
2773
2774 2015-05-11  Antti Koivisto  <antti@apple.com>
2775
2776         WebContent crash under com.apple.WebCore: WebCore::WebKitCSSResourceValue::isCSSValueNone const + 6
2777         https://bugs.webkit.org/show_bug.cgi?id=144870
2778         rdar://problem/20727702
2779
2780         Reviewed by Simon Fraser.
2781
2782         No repro but we are seeing null pointer crashes like this:
2783
2784         Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
2785         0   com.apple.WebCore   0x00007fff92da5706 WebCore::WebKitCSSResourceValue::isCSSValueNone() const + 6
2786         1   com.apple.WebCore   0x00007fff93382b48 WebCore::MaskImageOperation::isCSSValueNone() const + 24
2787         2   com.apple.WebCore   0x00007fff92e0475e WebCore::FillLayer::hasNonEmptyMaskImage() const + 30
2788
2789         * platform/graphics/MaskImageOperation.cpp:
2790         (WebCore::MaskImageOperation::MaskImageOperation):
2791         (WebCore::MaskImageOperation::isCSSValueNone):
2792
2793             This would crash like this if both m_styleImage and m_cssMaskImageValue are null.
2794             There are no obvious guarantees that this doesn't happen. Two of the constructor variants allow it
2795             and there is setImage which may turn m_styleImage null later too.
2796
2797             Fix by making null m_cssMaskImageValue always signify CSSValueNone.
2798
2799         (WebCore::MaskImageOperation::cssValue):
2800
2801 2015-05-11  Chris Fleizach  <cfleizach@apple.com>
2802
2803         AX: Crash at WebCore::AccessibilityMenuList::addChildren()
2804         https://bugs.webkit.org/show_bug.cgi?id=144860
2805
2806         Reviewed by Mario Sanchez Prada.
2807
2808         There were some unsafe pointer accesses in AccessibilityMenuList code that needed to be cleaned up.
2809
2810         Test: accessibility/menu-list-crash2.html
2811
2812         * accessibility/AccessibilityMenuList.cpp:
2813         (WebCore::AccessibilityMenuList::addChildren):
2814
2815 2015-05-11  Przemyslaw Szymanski  <p.szymanski3@samsung.com>
2816
2817         [WebGL] Unnecessary condition check in the while loop
2818         https://bugs.webkit.org/show_bug.cgi?id=125001
2819
2820         Reviewed by Csaba Osztrogonác.
2821
2822         While loop in this case needs to be optimized a little.
2823         For now a conditional statement in while will execute two
2824         times at begin. do-while loop avoids to check first statement.
2825
2826         No new tests. No behaviour changed.
2827
2828         * html/canvas/WebGLFramebuffer.cpp:
2829         (WebCore::WebGLFramebuffer::removeAttachmentFromBoundFramebuffer):
2830
2831 2015-05-11  Joonghun Park  <jh718.park@samsung.com>
2832
2833         [GTK] Reorder Performance class's member initialization sequence
2834         https://bugs.webkit.org/show_bug.cgi?id=144858
2835
2836         Reviewed by Csaba Osztrogonác.
2837
2838         No new tests, no new behaviors.
2839
2840         * page/Performance.cpp:
2841         (WebCore::Performance::Performance):
2842
2843 2015-05-11  Zan Dobersek  <zdobersek@igalia.com>
2844
2845         Reduce TransformationMatrix copies in WebKitCSSMatrix operations
2846         https://bugs.webkit.org/show_bug.cgi?id=144795
2847
2848         Reviewed by Darin Adler.
2849
2850         Instead of copying the TransformationMatrix member, performing
2851         the operation on it and then copying it again when creating
2852         the new WebKitCSSMatrix object, copy it just once by first
2853         creating the new WebKitCSSMatrix object and then performing
2854         the operation on that object's TransformationMatrix directly.
2855
2856         * css/WebKitCSSMatrix.cpp:
2857         (WebCore::WebKitCSSMatrix::multiply):
2858         (WebCore::WebKitCSSMatrix::translate):
2859         (WebCore::WebKitCSSMatrix::scale):
2860         (WebCore::WebKitCSSMatrix::rotate):
2861         (WebCore::WebKitCSSMatrix::rotateAxisAngle):
2862         (WebCore::WebKitCSSMatrix::skewX):
2863         (WebCore::WebKitCSSMatrix::skewY):
2864
2865 2015-05-11  Zan Dobersek  <zdobersek@igalia.com>
2866
2867         Add missing vtable override specifiers under Source/WebCore/loader, Source/WebCore/xml
2868         https://bugs.webkit.org/show_bug.cgi?id=144793
2869
2870         Reviewed by Darin Adler.
2871
2872         Update virtual method overrides under Source/WebCore/loader
2873         and Source/WebCore/dom which are missing the override specifier.
2874
2875         * loader/DocumentThreadableLoader.h:
2876         (WebCore::DocumentThreadableLoader::refThreadableLoader):
2877         (WebCore::DocumentThreadableLoader::derefThreadableLoader):
2878         * loader/cache/CachedRawResource.h:
2879         * xml/parser/XMLDocumentParser.h:
2880
2881 2015-05-11  Zan Dobersek  <zdobersek@igalia.com>
2882
2883         Add missing vtable override specifiers under Source/WebCore/accessibility, Source/WebCore/dom
2884         https://bugs.webkit.org/show_bug.cgi?id=144792
2885
2886         Reviewed by Darin Adler.
2887
2888         Update virtual method overrides under Source/WebCore/accessibility
2889         and Source/WebCore/dom which are missing the override specifier.
2890
2891         * accessibility/AccessibilityMockObject.h:
2892         (WebCore::AccessibilityMockObject::isDetachedFromParent): Deleted.
2893         * accessibility/AccessibilityRenderObject.h:
2894         * dom/DecodedDataDocumentParser.h:
2895         * dom/TouchEvent.h:
2896
2897 2015-05-10  Zan Dobersek  <zdobersek@igalia.com>
2898
2899         Have MediaStream::getAudioTracks(), MediaStream::getVideoTracks() return const references
2900         https://bugs.webkit.org/show_bug.cgi?id=144794
2901
2902         Reviewed by Philippe Normand.
2903
2904         * Modules/mediastream/MediaStream.h: getAudioTracks() and getVideoTracks()
2905         should return a const reference to the member variables, instead of
2906         copying the objects on every call.
2907
2908 2015-05-10  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2909
2910         Use Ref instead of PassRefPtr in WebCore/page
2911         https://bugs.webkit.org/show_bug.cgi?id=144841
2912
2913         Reviewed by Darin Adler.
2914
2915         To kill PassRefPtr, this patch replaces PassRefPtr with Ref or RefPtr
2916         in WebCore/page.
2917
2918         No new tests, no behavior changes.
2919
2920         * page/DebugPageOverlays.cpp:
2921         * page/EventSource.cpp:
2922         (WebCore::EventSource::create):
2923         * page/EventSource.h:
2924         * page/History.h:
2925         (WebCore::History::create):
2926         * page/Location.h:
2927         (WebCore::Location::create):
2928         * page/MainFrame.cpp:
2929         (WebCore::MainFrame::create):
2930         * page/MainFrame.h:
2931         * page/Navigator.h:
2932         (WebCore::Navigator::create):
2933         * page/PageOverlay.cpp:
2934         (WebCore::PageOverlay::create):
2935         * page/PageOverlay.h:
2936         * page/Performance.h:
2937         * page/PerformanceEntryList.h:
2938         (WebCore::PerformanceEntryList::create):
2939         * page/PerformanceMark.h:
2940         (WebCore::PerformanceMark::create):
2941         * page/PerformanceMeasure.h:
2942         (WebCore::PerformanceMeasure::create):
2943         * page/PerformanceNavigation.h:
2944         (WebCore::PerformanceNavigation::create):
2945         * page/PerformanceResourceTiming.h:
2946         (WebCore::PerformanceResourceTiming::create):
2947         * page/PerformanceTiming.h:
2948         (WebCore::PerformanceTiming::create):
2949         * page/PerformanceUserTiming.h:
2950         (WebCore::UserTiming::create):
2951         * page/Screen.h:
2952         * page/Settings.cpp:
2953         (WebCore::Settings::create):
2954         * page/Settings.h:
2955         * page/TextIndicator.cpp:
2956         (WebCore::TextIndicator::create):
2957         * page/TextIndicator.h:
2958         * page/UserContentController.cpp:
2959         (WebCore::UserContentController::create):
2960         * page/UserContentController.h:
2961         * page/UserMessageHandlerDescriptor.h:
2962         (WebCore::UserMessageHandlerDescriptor::create):
2963         * page/UserMessageHandlersNamespace.h:
2964         * page/VisitedLinkStore.h:
2965         * page/WebKitNamespace.h:
2966         (WebCore::WebKitNamespace::create):
2967         * page/WebKitPoint.h:
2968         (WebCore::WebKitPoint::create):
2969         * page/WorkerNavigator.h:
2970         (WebCore::WorkerNavigator::create):
2971         * page/animation/ImplicitAnimation.h:
2972         (WebCore::ImplicitAnimation::create):
2973         * page/animation/KeyframeAnimation.h:
2974         * page/mac/ServicesOverlayController.h:
2975         * page/mac/ServicesOverlayController.mm:
2976         (WebCore::ServicesOverlayController::Highlight::createForSelection):
2977         (WebCore::ServicesOverlayController::Highlight::createForTelephoneNumber):
2978         * page/scrolling/ScrollingCoordinator.cpp:
2979         (WebCore::ScrollingCoordinator::create):
2980         * page/scrolling/ScrollingCoordinator.h:
2981         * page/scrolling/ScrollingStateFixedNode.cpp:
2982         (WebCore::ScrollingStateFixedNode::create):
2983         (WebCore::ScrollingStateFixedNode::clone):
2984         * page/scrolling/ScrollingStateFixedNode.h:
2985         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
2986         (WebCore::ScrollingStateFrameScrollingNode::create):
2987         (WebCore::ScrollingStateFrameScrollingNode::clone):
2988         * page/scrolling/ScrollingStateFrameScrollingNode.h:
2989         * page/scrolling/ScrollingStateNode.h:
2990         * page/scrolling/ScrollingStateOverflowScrollingNode.cpp:
2991         (WebCore::ScrollingStateOverflowScrollingNode::create):
2992         (WebCore::ScrollingStateOverflowScrollingNode::clone):
2993         * page/scrolling/ScrollingStateOverflowScrollingNode.h:
2994         * page/scrolling/ScrollingStateStickyNode.cpp:
2995         (WebCore::ScrollingStateStickyNode::create):
2996         (WebCore::ScrollingStateStickyNode::clone):
2997         * page/scrolling/ScrollingStateStickyNode.h:
2998         * page/scrolling/ios/ScrollingCoordinatorIOS.mm:
2999         (WebCore::ScrollingCoordinator::create):
3000         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
3001         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
3002         (WebCore::ScrollingTreeFrameScrollingNodeIOS::create):
3003         * page/scrolling/ios/ScrollingTreeIOS.cpp:
3004         (WebCore::ScrollingTreeIOS::create):
3005         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
3006         (WebCore::ScrollingCoordinator::create):
3007         * page/scrolling/mac/ScrollingTreeFixedNode.h:
3008         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
3009         (WebCore::ScrollingTreeFixedNode::create):
3010         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
3011         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
3012         (WebCore::ScrollingTreeFrameScrollingNodeMac::create):
3013         * page/scrolling/mac/ScrollingTreeMac.cpp:
3014         (ScrollingTreeMac::create):
3015         * page/scrolling/mac/ScrollingTreeMac.h:
3016         * page/scrolling/mac/ScrollingTreeStickyNode.h:
3017         * page/scrolling/mac/ScrollingTreeStickyNode.mm:
3018         (WebCore::ScrollingTreeStickyNode::create):
3019
3020 2015-05-10  Simon Fraser  <simon.fraser@apple.com>
3021
3022         background-position sometimes doesn't work properly with background-attachment: fixed
3023         https://bugs.webkit.org/show_bug.cgi?id=103757
3024         rdar://problem/18749925
3025
3026         Reviewed by Darin Adler.
3027         
3028         Fix sizing issues with fixed backgrounds when top content inset (blurred toolbar) is in
3029         effect.
3030         
3031         The primary issue was that positioningAreaSize was including the top content inset
3032         height, and should not have been, but there were also issues with the "fixedBackgroundPaintsInLocalCoordinates"
3033         code path, which kicks in when the root background is fixed.
3034
3035         Tests: platform/mac-wk2/tiled-drawing/top-content-inset-fixed-attachment-cover-local.html
3036                platform/mac-wk2/tiled-drawing/top-content-inset-fixed-attachment-cover.html
3037                platform/mac-wk2/tiled-drawing/top-content-inset-fixed-attachment-local.html
3038                platform/mac-wk2/tiled-drawing/top-content-inset-fixed-attachment-positioned.html
3039
3040         * rendering/RenderBoxModelObject.cpp:
3041         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
3042
3043 2015-05-10  Sungmann Cho  <sungmann.cho@navercorp.com>
3044
3045         Get rid of the public item accessors in BackForwardClient
3046         https://bugs.webkit.org/show_bug.cgi?id=144827
3047
3048         Reviewed by Darin Adler.
3049
3050         Remove backItem(), currentItem(), and forwardItem() from BackForwardClient.
3051         We can still use these functionalities through BackForwardController.
3052
3053         No new tests, no behavior change.
3054
3055         * history/BackForwardClient.h:
3056         (WebCore::BackForwardClient::backItem): Deleted.
3057         (WebCore::BackForwardClient::currentItem): Deleted.
3058         (WebCore::BackForwardClient::forwardItem): Deleted.
3059
3060 2015-05-10  Sungmann Cho  <sungmann.cho@navercorp.com>
3061
3062         Rename Length::isPercent() and Length::isPercentNotCalculated().
3063         https://bugs.webkit.org/show_bug.cgi?id=144791
3064
3065         Reviewed by Darin Adler.
3066
3067         1. Rename these methods as below for consistency and clarity.
3068
3069         Length::isPercentNotCalculated() => Length::isPercent()
3070         Length::isPercent() => Length::isPercentOrCalculated()
3071
3072         2. Simplify the condition check of length type in SVGLengthContext::valueForLength().
3073
3074         "length.isPercent() && !length.isCalculated()" => "length.isPercent()"
3075
3076         No new tests, no behavior change.
3077
3078         * css/CSSComputedStyleDeclaration.cpp:
3079         (WebCore::valueForImageSliceSide):
3080         (WebCore::valueForReflection):
3081         (WebCore::percentageOrZoomAdjustedValue):
3082         (WebCore::lineHeightFromStyle):
3083         (WebCore::ComputedStyleExtractor::propertyValue):
3084         * html/HTMLPlugInImageElement.cpp:
3085         (WebCore::is100Percent):
3086         * page/animation/AnimationBase.cpp:
3087         (WebCore::AnimationBase::computeTransformedExtentViaTransformList):
3088         * platform/Length.h:
3089         (WebCore::Length::percent):
3090         (WebCore::Length::isPercent):
3091         (WebCore::Length::isPercentOrCalculated):
3092         (WebCore::Length::isSpecified):
3093         (WebCore::Length::isPercentNotCalculated): Deleted.
3094         * platform/graphics/transforms/TranslateTransformOperation.h:
3095         * rendering/AutoTableLayout.cpp:
3096         (WebCore::AutoTableLayout::recalcColumn):
3097         (WebCore::AutoTableLayout::fullRecalc):
3098         (WebCore::shouldScaleColumns):
3099         (WebCore::AutoTableLayout::computeIntrinsicLogicalWidths):
3100         (WebCore::AutoTableLayout::calcEffectiveLogicalWidth):
3101         (WebCore::AutoTableLayout::layout):
3102         * rendering/FixedTableLayout.cpp:
3103         (WebCore::FixedTableLayout::calcWidthArray):
3104         (WebCore::FixedTableLayout::applyPreferredLogicalWidthQuirks):
3105         (WebCore::FixedTableLayout::layout):
3106         * rendering/RenderBlock.cpp:
3107         (WebCore::RenderBlock::isSelfCollapsingBlock):
3108         (WebCore::RenderBlock::textIndentOffset):
3109         * rendering/RenderBox.cpp:
3110         (WebCore::RenderBox::needsPreferredWidthsRecalculation):
3111         (WebCore::RenderBox::computeLogicalHeight):
3112         (WebCore::RenderBox::computeContentAndScrollbarLogicalHeightUsing):
3113         (WebCore::RenderBox::computePercentageLogicalHeight):
3114         (WebCore::RenderBox::computeReplacedLogicalWidthRespectingMinMaxWidth):
3115         (WebCore::RenderBox::computeReplacedLogicalWidthUsing):
3116         (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
3117         (WebCore::RenderBox::availableLogicalHeightUsing):
3118         (WebCore::logicalWidthIsResolvable):
3119         (WebCore::RenderBox::percentageLogicalHeightIsResolvableFromBlock):
3120         (WebCore::RenderBox::hasUnsplittableScrollingOverflow):
3121         (WebCore::RenderBox::layoutOverflowRectForPropagation):
3122         * rendering/RenderBoxModelObject.cpp:
3123         (WebCore::RenderBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight):
3124         (WebCore::RenderBoxModelObject::relativePositionOffset):
3125         (WebCore::RenderBoxModelObject::computedCSSPadding):
3126         (WebCore::RenderBoxModelObject::calculateImageIntrinsicDimensions):
3127         (WebCore::RenderBoxModelObject::calculateFillTileSize):
3128         * rendering/RenderDeprecatedFlexibleBox.cpp:
3129         (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
3130         (WebCore::RenderDeprecatedFlexibleBox::clearLineClamp):
3131         * rendering/RenderElement.cpp:
3132         (WebCore::mustRepaintFillLayers):
3133         * rendering/RenderFileUploadControl.cpp:
3134         (WebCore::RenderFileUploadControl::computeIntrinsicLogicalWidths):
3135         * rendering/RenderFrameSet.cpp:
3136         (WebCore::RenderFrameSet::layOutAxis):
3137         * rendering/RenderImage.cpp:
3138         (WebCore::RenderImage::repaintOrMarkForLayout):
3139         * rendering/RenderInline.cpp:
3140         (WebCore::computeMargin):
3141         * rendering/RenderListBox.cpp:
3142         (WebCore::RenderListBox::computeIntrinsicLogicalWidths):
3143         * rendering/RenderMenuList.cpp:
3144         (RenderMenuList::computeIntrinsicLogicalWidths):
3145         * rendering/RenderObject.cpp:
3146         (WebCore::objectIsRelayoutBoundary):
3147         * rendering/RenderReplaced.cpp:
3148         (WebCore::RenderReplaced::computePreferredLogicalWidths):
3149         * rendering/RenderSlider.cpp:
3150         (WebCore::RenderSlider::computeIntrinsicLogicalWidths):
3151         * rendering/RenderTable.cpp:
3152         (WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight):
3153         * rendering/RenderTableSection.cpp:
3154         (WebCore::RenderTableSection::layoutRows):
3155         * rendering/RenderTextControl.cpp:
3156         (WebCore::RenderTextControl::computeIntrinsicLogicalWidths):
3157         * rendering/RenderView.cpp:
3158         (WebCore::RenderView::layout):
3159         * rendering/RootInlineBox.cpp:
3160         (WebCore::RootInlineBox::verticalPositionForBox):
3161         * rendering/style/GridLength.h:
3162         (WebCore::GridLength::isPercentage):
3163         * rendering/style/GridTrackSize.h:
3164         (WebCore::GridTrackSize::isPercentage):
3165         * rendering/style/RenderStyle.cpp:
3166         (WebCore::RenderStyle::computedLineHeight):
3167         * rendering/svg/RenderSVGRoot.cpp:
3168         (WebCore::RenderSVGRoot::hasRelativeDimensions):
3169         * svg/SVGLengthContext.cpp:
3170         (WebCore::SVGLengthContext::valueForLength):
3171         * svg/graphics/SVGImage.cpp:
3172         (WebCore::SVGImage::hasRelativeWidth):
3173         (WebCore::SVGImage::hasRelativeHeight):
3174
3175 2015-05-10  Sungmann Cho  <sungmann.cho@navercorp.com>
3176
3177         Remove unnecessary semicolons.
3178         https://bugs.webkit.org/show_bug.cgi?id=144844
3179
3180         Reviewed by Darin Adler.
3181
3182         No new tests, no behavior change.
3183
3184         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3185         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
3186         * platform/ios/PasteboardIOS.mm:
3187         (WebCore::Pasteboard::readString):
3188         * platform/mediastream/RealtimeMediaSourceCapabilities.h:
3189         (WebCore::RealtimeMediaSourceCapabilities::setHasVideoSource):
3190         * platform/network/mac/ResourceErrorMac.mm:
3191         (WebCore::ResourceError::nsError):
3192         * rendering/RenderThemeIOS.mm:
3193         (WebCore::getSharedFunctionRef):
3194
3195 2015-05-10  Sungmann Cho  <sungmann.cho@navercorp.com>
3196
3197         Remove unnecessary forward declarations in StyleProperties.h
3198         https://bugs.webkit.org/show_bug.cgi?id=144843
3199
3200         Reviewed by Darin Adler.
3201
3202         No new tests, no behavior change.        
3203
3204         * css/StyleProperties.h:
3205
3206 2015-05-10  Darin Adler  <darin@apple.com>
3207
3208         [Cocoa] Fix paths and resort WebCore project file
3209         https://bugs.webkit.org/show_bug.cgi?id=144838
3210
3211         Reviewed by Dan Bernstein.
3212
3213         * WebCore.xcodeproj/project.pbxproj: Re-sorted this file with the
3214         sort-Xcode-project-file script and fixed the paths in the platform/ios directory.
3215
3216 2015-05-10  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
3217
3218         [Streams API] Refactor ReadableStreamReader close promise callback cleaning
3219         https://bugs.webkit.org/show_bug.cgi?id=144799
3220
3221         Reviewed by Darin Adler.
3222
3223         Moved close callback cleaning to releaseStream, which is now releaseStreamAndClean.
3224         Moved that method to private as it is no longer needed by subclasses.
3225
3226         No behavior changes.
3227
3228         * Modules/streams/ReadableStreamReader.cpp:
3229         (WebCore::ReadableStreamReader::releaseStreamAndClean):
3230         (WebCore::ReadableStreamReader::changeStateToClosed):
3231         (WebCore::ReadableStreamReader::changeStateToErrored):
3232         * Modules/streams/ReadableStreamReader.h:
3233
3234 2015-05-10  Darin Adler  <darin@apple.com>
3235
3236         [Cocoa] Don't soft link DataDetectorsCore
3237         https://bugs.webkit.org/show_bug.cgi?id=144837
3238
3239         Reviewed by Dan Bernstein.
3240
3241         Linking this in the normal way should slightly speed up the web process
3242         startup time. We don't need to soft link it: It's present in the
3243         OS X base system and there is no reference cycle with WebKit.
3244
3245         * Configurations/WebCore.xcconfig: Added PrivateFrameworks to
3246         FRAMEWORK_SEARCH_PATHS for Mac and added DataDetectorsCore to
3247         OTHER_LDFLAGS_PLATFORM for Mac. We may want to do this later for iOS too.
3248
3249         * WebCore.xcodeproj/project.pbxproj: Added DataDetectorsCoreSPI.h.
3250
3251         * editing/mac/DataDetection.mm:
3252         (WebCore::DataDetection::detectItemAroundHitTestResult): Removed check to see
3253         if DataDetectorsCore is available.
3254
3255         * page/mac/ServicesOverlayController.h: Simplified a forward declaration to
3256         only declare what we actually use.
3257         * page/mac/ServicesOverlayController.mm: Moved SOFT_LINK from here to the
3258         DataDetectorsSPI.h header.
3259
3260         * platform/spi/cocoa/DataDetectorsCoreSPI.h: Added. This is the low level
3261         DataDetectorsCore framework, which has no reference cycle with WebKit, and
3262         which we can link to normally. Moved the content here from DataDetectorsSPI.h,
3263         added a USE(APPLE_INTERNAL_SDK) path that uses the system headers, and fixed
3264         the incorrect return type on DDScannerScanQuery, which was detected when
3265         using the system headers in conjunction with this file.
3266
3267         * platform/spi/mac/DataDetectorsSPI.h: Removed the content of this file that
3268         was actually about DataDetectorsCore. Also added a USE(APPLE_INTERNAL_SDK)
3269         path that uses the system headers and moved a few stray DataDetectors SPI
3270         definitions from elsewhere into this header.
3271
3272 2015-05-10  Chris Fleizach  <cfleizach@apple.com>
3273
3274         AX: Don't expose elements as data tables just because they use display: table
3275         https://bugs.webkit.org/show_bug.cgi?id=144804
3276
3277         Reviewed by Mario Sanchez Prada.
3278
3279         Elements will create RenderTable objects if they have display:table. We shouldn't assume these are accessibility tables.
3280
3281         Test: accessibility/css-table-ignored.html
3282
3283         * accessibility/AccessibilityTable.cpp:
3284         (WebCore::AccessibilityTable::isDataTable):
3285
3286 2015-05-09  Chris Dumez  <cdumez@apple.com>
3287
3288         Introduce ParentNode.idl / NonDocumentTypeChildNode.idl
3289         https://bugs.webkit.org/show_bug.cgi?id=144825
3290
3291         Reviewed by Sam Weinig.
3292
3293         Introduce ParentNode.idl / NonDocumentTypeChildNode.idl as per DOM
3294         specification and to avoid IDL code duplication:
3295         - https://dom.spec.whatwg.org/#interface-parentnode
3296         - https://dom.spec.whatwg.org/#interface-nondocumenttypechildnode
3297
3298         No Web-Exposed behavior change.
3299
3300         * CMakeLists.txt:
3301         * DerivedSources.make:
3302         * WebCore.xcodeproj/project.pbxproj:
3303         * dom/CharacterData.idl:
3304         * dom/Document.idl:
3305         * dom/DocumentFragment.idl:
3306         * dom/Element.idl:
3307         * dom/NonDocumentTypeChildNode.idl: Copied from Source/WebCore/dom/DocumentFragment.idl.
3308         * dom/ParentNode.idl: Copied from Source/WebCore/dom/DocumentFragment.idl.
3309
3310 2015-05-09  Chris Dumez  <cdumez@apple.com>
3311
3312         Invalidate the FontCache on WebProcess suspension / critical memory pressure
3313         https://bugs.webkit.org/show_bug.cgi?id=144821
3314
3315         Reviewed by Antti Koivisto.
3316
3317         Invalidate the FontCache on WebProcess suspension / critical memory
3318         pressure to free a bit more memory (an extra 4-16Kb per WebProcess on
3319         the pages I tested). We already purge inactive font data on
3320         non-critical memory warning but invalidating the whole FontCache takes
3321         care of clearing the FontCascade cache and the fontPlatformData cache
3322         as well.
3323
3324         * platform/MemoryPressureHandler.cpp:
3325         (WebCore::MemoryPressureHandler::releaseCriticalMemory):
3326
3327 2015-05-09  Yoav Weiss  <yoav@yoav.ws>
3328
3329         Remove the PICTURE_SIZES build flag
3330         https://bugs.webkit.org/show_bug.cgi?id=144679
3331
3332         Reviewed by Benjamin Poulain.
3333
3334         Removed the PICTURE_SIZES build time flag.
3335
3336         No new tests, since there's no functionality change.
3337
3338         * Configurations/FeatureDefines.xcconfig:
3339         * css/CSSGrammar.y.in:
3340         * css/CSSParser.cpp:
3341         (WebCore::CSSParser::detectAtToken):
3342         * css/CSSParser.h:
3343         * css/SourceSizeList.cpp:
3344         (WebCore::parseSizesAttribute): Deleted.
3345         * html/HTMLImageElement.cpp:
3346         (WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
3347         * html/HTMLImageElement.h:
3348         (WebCore::HTMLImageElement::currentSrc):
3349         * html/HTMLImageElement.idl:
3350         * html/parser/HTMLPreloadScanner.cpp:
3351         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
3352         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
3353         * html/parser/HTMLSrcsetParser.cpp:
3354         (WebCore::parseDescriptors):
3355         (WebCore::pickBestImageCandidate):
3356
3357 2015-05-08  Myles C. Maxfield  <mmaxfield@apple.com>
3358
3359         Remove convenience constructors for TextRun
3360         https://bugs.webkit.org/show_bug.cgi?id=144752
3361
3362         These convenience constructors are unnecessary. Moving the code that makes the StringView
3363         back to the call site will also help us make things more elegant in future refactoring.
3364
3365         Reviewed by Darin Adler.
3366
3367         No new tests because there is no behavior change.
3368
3369         * css/CSSPrimitiveValue.cpp:
3370         (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText): Remove ambiguous call.
3371         * platform/graphics/StringTruncator.cpp:
3372         (WebCore::stringWidth):
3373         * platform/graphics/TextRun.h:
3374         (WebCore::TextRun::TextRun):
3375         * platform/mac/DragImageMac.mm:
3376         (WebCore::widthWithFont):
3377         (WebCore::drawAtPoint):
3378         * rendering/SimpleLineLayout.cpp:
3379         (WebCore::SimpleLineLayout::canUseFor):
3380         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
3381         (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
3382         (WebCore::SimpleLineLayout::TextFragmentIterator::runWidth):
3383         * rendering/TextPainter.cpp:
3384         (WebCore::TextPainter::paintText):
3385
3386 2015-05-08  Sam Weinig  <sam@webkit.org>
3387
3388         Element Traversal is not just Elements anymore
3389         https://bugs.webkit.org/show_bug.cgi?id=144822
3390
3391         Reviewed by Simon Fraser.
3392
3393         Match other browsers and the new DOM spec at https://dom.spec.whatwg.org by
3394         exposing the element traversal methods on non-Elements.
3395
3396         - Makes firstElementChild, lastElementChild and childElementCount available on
3397           Document and DocumentFragment in addition to Element.
3398         - Makes nextElementSibling and previousElementSibling available on CharacterData
3399           in addition to Element.
3400
3401         Tests: fast/dom/element-traversal-on-character-data.html
3402                fast/dom/element-traversal-on-document-fragment.html
3403                fast/dom/element-traversal-on-document.html
3404
3405         * dom/CharacterData.idl:
3406         Expose nextElementSibling and previousElementSibling.
3407
3408         * dom/ContainerNode.cpp:
3409         (WebCore::ContainerNode::firstElementChild):
3410         (WebCore::ContainerNode::lastElementChild):
3411         (WebCore::ContainerNode::childElementCount):
3412         * dom/ContainerNode.h:
3413         Move implementations of firstElementChild, lastElementChild and childElementCount here
3414         from Element to make them shareable.
3415
3416         * dom/Document.idl:
3417         * dom/DocumentFragment.idl:
3418         Expose firstElementChild, lastElementChild and childElementCount.
3419
3420         * dom/Element.cpp:
3421         (WebCore::Element::firstElementChild): Deleted.
3422         (WebCore::Element::lastElementChild): Deleted.
3423         (WebCore::Element::previousElementSibling): Deleted.
3424         (WebCore::Element::nextElementSibling): Deleted.
3425         (WebCore::Element::childElementCount): Deleted.
3426         * dom/Element.h:
3427         Move element traversal functions down to Node and ContainerNode.
3428
3429         * dom/Element.idl:
3430         Update comments to indicate where these functions are defined now.
3431
3432         * dom/Node.cpp:
3433         (WebCore::Node::previousElementSibling):
3434         (WebCore::Node::nextElementSibling):
3435         * dom/Node.h:
3436         Move implementations of nextElementSibling and previousElementSibling here
3437         from Element to make them shareable.
3438
3439 2015-05-08  Michael Catanzaro  <mcatanzaro@igalia.com>, Martin Robinson <mrobinson@igalia.com>
3440
3441         [GTK] Checks for DEVELOPMENT_BUILD are all wrong
3442         https://bugs.webkit.org/show_bug.cgi?id=144746
3443
3444         Reviewed by Carlos Garcia Campos.
3445
3446         Use ENABLE(DEVELOPER_MODE) rather than DEVELOPMENT_BUILD.
3447
3448         * platform/gtk/GtkUtilities.cpp:
3449         * platform/gtk/GtkUtilities.h:
3450         * platform/text/gtk/HyphenationLibHyphen.cpp:
3451         (WebCore::availableLocales):
3452
3453 2015-05-08  Alexey Proskuryakov  <ap@apple.com>
3454
3455         Crashes in SocketStreamHandleBase::close
3456         https://bugs.webkit.org/show_bug.cgi?id=144767
3457         rdar://problem/20486538
3458
3459         Reviewed by Brady Eidson.
3460
3461         This is a speculative fix, I could not reproduce the crash.
3462
3463         * Modules/websockets/WebSocketChannel.cpp: (WebCore::WebSocketChannel::processFrame):
3464         Normally, processOutgoingFrameQueue() closes the handle in the end when called in
3465         OutgoingFrameQueueClosing state. But there is no definitive protection against
3466         processing two CLOSE frames, in which case we'd try to close the handle twice.
3467
3468         * platform/network/cf/SocketStreamHandleCFNet.cpp:
3469         (WebCore::SocketStreamHandle::readStreamCallback): Passing empty data to the client
3470         results in the socket being closed, which makes no sense here.
3471
3472 2015-05-08  Commit Queue  <commit-queue@webkit.org>
3473
3474         Unreviewed, rolling out r183996.
3475         https://bugs.webkit.org/show_bug.cgi?id=144806
3476
3477         ASan detected use-after free (Requested by ap on #webkit).
3478
3479         Reverted changeset:
3480
3481         "Remove convenience constructors for TextRun"
3482         https://bugs.webkit.org/show_bug.cgi?id=144752
3483         http://trac.webkit.org/changeset/183996
3484
3485 2015-05-08  Eric Carlson  <eric.carlson@apple.com>
3486
3487         [Mac] Playback target clients do not unregister on page reload
3488         https://bugs.webkit.org/show_bug.cgi?id=144761
3489
3490         Reviewed by Brady Eidson.
3491
3492         * dom/Document.cpp:
3493         (WebCore::Document::prepareForDestruction): Unregister all target picker clients.
3494
3495         * html/HTMLMediaElement.cpp:
3496         (WebCore::HTMLMediaElement::registerWithDocument): Register for page cache callback.
3497         (WebCore::HTMLMediaElement::unregisterWithDocument): Unregister for page cache callback.
3498         (WebCore::HTMLMediaElement::documentWillSuspendForPageCache): New.
3499         (WebCore::HTMLMediaElement::documentDidResumeFromPageCache): New.
3500
3501 2015-05-08  Chris Dumez  <cdumez@apple.com>
3502
3503         Throttle RequestAnimationFrame in subframes that are outside the viewport
3504         https://bugs.webkit.org/show_bug.cgi?id=144718
3505         <rdar://problem/20688782>
3506
3507         Reviewed by Simon Fraser.
3508
3509         Throttle RequestAnimationFrame in subframes that are outside the
3510         viewport or have "display: none" for performance and power.
3511
3512         Tests: fast/animation/request-animation-frame-throttle-subframe-display-none.html
3513                fast/animation/request-animation-frame-throttle-subframe.html
3514
3515         * dom/Document.h:
3516         (WebCore::Document::scriptedAnimationController):
3517         * dom/ScriptedAnimationController.cpp:
3518         (WebCore::ScriptedAnimationController::setThrottled):
3519         (WebCore::ScriptedAnimationController::isThrottled):
3520         * dom/ScriptedAnimationController.h:
3521         * loader/FrameLoader.cpp:
3522         (WebCore::FrameLoader::open):
3523         Call FrameView::setFrameRect() only *after* the view has been
3524         set on the Frame. Otherwise, setFrameRect() ends up calling
3525         viewportContentsChanged() and we hit the
3526         ASSERT(frame().view() == this) assertion in windowClipRect()
3527         because the Frame still has its old FrameView. This is covered
3528         by loader/go-back-to-different-window-size.html layout test.
3529
3530         * page/FrameView.cpp:
3531         (WebCore::FrameView::viewportContentsChanged):
3532         (WebCore::FrameView::applyRecursivelyWithVisibleRect):
3533         (WebCore::FrameView::resumeVisibleImageAnimations):
3534         (WebCore::FrameView::updateScriptedAnimationsThrottlingState):
3535         (WebCore::FrameView::resumeVisibleImageAnimationsIncludingSubframes):
3536         (WebCore::FrameView::updateThrottledDOMTimersState):
3537         (WebCore::FrameView::scrollPositionChanged): Deleted.
3538         (WebCore::FrameView::sendResizeEventIfNeeded): Deleted.
3539         * page/FrameView.h:
3540         * testing/Internals.cpp:
3541         (WebCore::Internals::isRequestAnimationFrameThrottled):
3542         (WebCore::Internals::isTimerThrottled): Deleted.
3543         * testing/Internals.h:
3544         * testing/Internals.idl:
3545
3546 2015-05-08  Daniel Bates  <dabates@apple.com>
3547
3548         Fix the iOS Simulator external SDK build following <http://trac.webkit.org/changeset/181918>
3549
3550         Remove unused iOS Simulator-variant of CARenderServerRenderLayerWithTransform(). Also guard
3551         IOSurfaceRef-variant of CARenderServerRenderLayerWithTransform() with USE(IOSURFACE)
3552         since it is only applicable on platforms that use IOSurface.
3553
3554         * platform/spi/cocoa/QuartzCoreSPI.h:
3555
3556 2015-05-08  Myles C. Maxfield  <mmaxfield@apple.com>
3557
3558         Remove convenience constructors for TextRun
3559         https://bugs.webkit.org/show_bug.cgi?id=144752
3560
3561         These convenience constructors are unnecessary. Moving the code that makes the StringView
3562         back to the call site will also help us make things more elegant in future refactoring.
3563
3564         Reviewed by Darin Adler.
3565
3566         No new tests because there is no behavior change.
3567
3568         * css/CSSPrimitiveValue.cpp:
3569         (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText): Remove ambiguous call.
3570         * platform/graphics/StringTruncator.cpp:
3571         (WebCore::stringWidth):
3572         * platform/graphics/TextRun.h:
3573         (WebCore::TextRun::TextRun):
3574         * platform/mac/DragImageMac.mm:
3575         (WebCore::widthWithFont):
3576         (WebCore::drawAtPoint):
3577         * rendering/SimpleLineLayout.cpp:
3578         (WebCore::SimpleLineLayout::canUseFor):
3579         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
3580         (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
3581         (WebCore::SimpleLineLayout::TextFragmentIterator::runWidth):
3582         * rendering/TextPainter.cpp:
3583         (WebCore::TextPainter::paintText):
3584
3585 2015-05-08  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
3586
3587         [Streams API] ReadableStream constructor start function should be able to error the stream
3588         https://bugs.webkit.org/show_bug.cgi?id=141162
3589
3590         Reviewed by Darin Adler.
3591
3592         This patch implements the functionality of the ReadableStreamController error function.
3593         It basically changes the state of the stream to errored, resolves the ready promise and rejects the closed promise.
3594         Adding support to reject promise with any JSValue.
3595
3596         Support for storing the error is added to both reader and stream.
3597
3598         Test: streams/readable-stream-controller-error.html and rebased tests
3599
3600         * Modules/streams/ReadableStream.cpp:
3601         (WebCore::ReadableStream::changeStateToErrored):
3602         * Modules/streams/ReadableStream.h:
3603         * Modules/streams/ReadableStreamReader.cpp:
3604         (WebCore::ReadableStreamReader::initialize):
3605         (WebCore::ReadableStreamReader::closed):
3606         (WebCore::ReadableStreamReader::changeStateToClosed):
3607         (WebCore::ReadableStreamReader::changeStateToErrored):
3608         * Modules/streams/ReadableStreamReader.h:
3609         * bindings/js/JSDOMPromise.h:
3610         (WebCore::DeferredWrapper::reject):
3611         * bindings/js/JSReadableStreamControllerCustom.cpp:
3612         (WebCore::JSReadableStreamController::error):
3613         * bindings/js/JSReadableStreamReaderCustom.cpp:
3614         (WebCore::JSReadableStreamReader::closed):
3615         * bindings/js/ReadableJSStream.cpp:
3616         (WebCore::ReadableJSStream::createReader):
3617         (WebCore::ReadableJSStream::storeError):
3618         (WebCore::ReadableJSStream::Reader::storeError):
3619         (WebCore::ReadableJSStream::jsController): Deleted.
3620         * bindings/js/ReadableJSStream.h:
3621
3622 2015-05-08  Commit Queue  <commit-queue@webkit.org>
3623
3624         Unreviewed, rolling out r183985.
3625         https://bugs.webkit.org/show_bug.cgi?id=144796
3626
3627         broke loader/go-back-to-different-window-size.html (Requested
3628         by kling on #webkit).
3629
3630         Reverted changeset:
3631
3632         "Throttle RequestAnimationFrame in subframes that are outside
3633         the viewport"
3634         https://bugs.webkit.org/show_bug.cgi?id=144718
3635         http://trac.webkit.org/changeset/183985
3636
3637 2015-05-08  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3638
3639         SharedBuffer::m_size should be initialized to 0 when defining it
3640         https://bugs.webkit.org/show_bug.cgi?id=144740
3641
3642         Reviewed by Darin Adler.
3643
3644         Setting m_size to 0 when declaring it and updating constructor definitions.
3645
3646         No change in behaviour.
3647
3648         * platform/SharedBuffer.cpp:
3649         (WebCore::SharedBuffer::SharedBuffer):
3650         * platform/SharedBuffer.h:
3651         * platform/cf/SharedBufferCF.cpp:
3652         (WebCore::SharedBuffer::SharedBuffer):
3653         * platform/soup/SharedBufferSoup.cpp:
3654         (WebCore::SharedBuffer::SharedBuffer):
3655
3656 2015-05-08  Commit Queue  <commit-queue@webkit.org>
3657
3658         Unreviewed, rolling out r183945.
3659         https://bugs.webkit.org/show_bug.cgi?id=144789
3660
3661         "It broke all the GTK+ tests" (Requested by KaL on #webkit).
3662
3663         Reverted changeset:
3664
3665         "[GTK] Checks for DEVELOPMENT_BUILD are all wrong"
3666         https://bugs.webkit.org/show_bug.cgi?id=144746
3667         http://trac.webkit.org/changeset/183945
3668
3669 2015-05-07  Chris Dumez  <cdumez@apple.com>
3670
3671         Throttle RequestAnimationFrame in subframes that are outside the viewport
3672         https://bugs.webkit.org/show_bug.cgi?id=144718
3673         <rdar://problem/20688782>
3674
3675         Reviewed by Simon Fraser.
3676
3677         Throttle RequestAnimationFrame in subframes that are outside the
3678         viewport or have "display: none" for performance and power.
3679
3680         Tests: fast/animation/request-animation-frame-throttle-subframe-display-none.html
3681                fast/animation/request-animation-frame-throttle-subframe.html
3682
3683         * dom/Document.h:
3684         (WebCore::Document::scriptedAnimationController):
3685         * dom/ScriptedAnimationController.cpp:
3686         (WebCore::ScriptedAnimationController::setThrottled):
3687         (WebCore::ScriptedAnimationController::isThrottled):
3688         * dom/ScriptedAnimationController.h:
3689         * page/FrameView.cpp:
3690         (WebCore::FrameView::viewportContentsChanged):
3691         (WebCore::FrameView::applyRecursivelyWithVisibleRect):
3692         (WebCore::FrameView::resumeVisibleImageAnimations):
3693         (WebCore::FrameView::updateScriptedAnimationsThrottlingState):
3694         (WebCore::FrameView::resumeVisibleImageAnimationsIncludingSubframes):
3695         (WebCore::FrameView::updateThrottledDOMTimersState):
3696         (WebCore::FrameView::scrollPositionChanged): Deleted.
3697         (WebCore::FrameView::sendResizeEventIfNeeded): Deleted.
3698         * page/FrameView.h:
3699         * testing/Internals.cpp:
3700         (WebCore::Internals::isRequestAnimationFrameThrottled):
3701         (WebCore::Internals::isTimerThrottled): Deleted.
3702         * testing/Internals.h:
3703         * testing/Internals.idl:
3704
3705 2015-05-07  Yoav Weiss  <yoav@yoav.ws>
3706
3707         Calculate source-size length as a float
3708         https://bugs.webkit.org/show_bug.cgi?id=144766
3709
3710         Reviewed by Dean Jackson.
3711
3712         Make sure that the source-size length is calculated as a float,
3713         to align with the spec.
3714
3715         Test: fast/dom/HTMLImageElement/sizes/image-sizes-1x.html
3716               fast/dom/HTMLImageElement/sizes/image-sizes-2x.html
3717
3718         * css/SourceSizeList.cpp:
3719         (WebCore::parseSizesAttribute):
3720         (WebCore::defaultLength):
3721         (WebCore::computeLength):
3722         * css/SourceSizeList.h:
3723         * html/HTMLImageElement.cpp:
3724         (WebCore::HTMLImageElement::parseAttribute):
3725         * html/parser/HTMLPreloadScanner.cpp:
3726         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
3727         * html/parser/HTMLSrcsetParser.cpp:
3728         (WebCore::pickBestImageCandidate):
3729         (WebCore::bestFitSourceForImageAttributes):
3730         * html/parser/HTMLSrcsetParser.h:
3731
3732 2015-05-07  Commit Queue  <commit-queue@webkit.org>
3733
3734         Unreviewed, rolling out r183895.
3735         https://bugs.webkit.org/show_bug.cgi?id=144786
3736
3737         Many tests became flaky (Requested by ap on #webkit).
3738
3739         Reverted changeset:
3740
3741         "Expose more font weights for -apple-system"
3742         https://bugs.webkit.org/show_bug.cgi?id=144707
3743         http://trac.webkit.org/changeset/183895
3744
3745 2015-05-07  Hyungwook Lee  <hyungwook.lee@navercorp.com>
3746
3747         Add first-letter assert exception in RenderButton::setupInnerStyle().
3748         https://bugs.webkit.org/show_bug.cgi?id=140517OB
3749
3750         Reviewed by Darin Adler.
3751
3752         StyleResolver references inner block's render style temporary in
3753         RenderBlock::styleDidChange() when we have first-letter css pseudo
3754         element.
3755
3756         * rendering/RenderButton.cpp:
3757         (WebCore::RenderButton::setupInnerStyle):
3758
3759 2015-05-07  Chris Dumez  <cdumez@apple.com>
3760
3761         Unreviewed, fix build after r183970.
3762
3763         WEBCORE_EXPORT should not be used on inlined functions.
3764
3765         * platform/graphics/ca/GraphicsLayerCA.h:
3766
3767 2015-05-07  Anders Carlsson  <andersca@apple.com>
3768
3769         Build fixes.
3770
3771         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3772         (-[WebAccessibilityObjectWrapper doAXRTFForRange:]):
3773         * editing/cocoa/HTMLConverter.mm:
3774         (HTMLConverter::_addMarkersToList):
3775         * platform/mac/PasteboardMac.mm:
3776         (WebCore::writeFileWrapperAsRTFDAttachment):
3777         * platform/mac/PlatformPasteboardMac.mm:
3778         (WebCore::PlatformPasteboard::setTypes):
3779         Pass empty arrays and dictionaries instead of nil.
3780
3781         * rendering/RenderThemeMac.mm:
3782         (WebCore::RenderThemeMac::paintSliderThumb):
3783         Pass the document view to the AppKit paint method.
3784
3785 2015-05-07  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3786
3787         Purge PassRefPtr in WebCore/html - 3
3788         https://bugs.webkit.org/show_bug.cgi?id=144686
3789
3790         Reviewed by Andreas Kling.
3791
3792         Replace PassRefPtr with Ref in create() factory functions, because
3793         it doesn't have to change to be null.
3794
3795         No new tests, no behavior changes.
3796
3797         * html/FTPDirectoryDocument.h:
3798         * html/HTMLDetailsElement.cpp:
3799         (WebCore::DetailsContentElement::create):
3800         * html/HTMLKeygenElement.cpp:
3801         * html/HTMLSummaryElement.cpp:
3802         (WebCore::SummaryContentElement::create):
3803         * html/TimeRanges.cpp:
3804         (WebCore::TimeRanges::create):
3805         * html/shadow/SliderThumbElement.cpp:
3806         (WebCore::SliderContainerElement::create):
3807         * html/shadow/SliderThumbElement.h:
3808         (WebCore::SliderThumbElement::create):
3809         * html/shadow/SpinButtonElement.cpp:
3810         (WebCore::SpinButtonElement::create):
3811         * html/shadow/SpinButtonElement.h:
3812         * html/shadow/TextControlInnerElements.cpp:
3813         (WebCore::TextControlInnerContainer::create):
3814         (WebCore::TextControlInnerElement::create):
3815         (WebCore::TextControlInnerTextElement::create):
3816         (WebCore::SearchFieldResultsButtonElement::create):
3817         (WebCore::SearchFieldCancelButtonElement::create):
3818         * html/shadow/TextControlInnerElements.h:
3819         * html/shadow/YouTubeEmbedShadowElement.cpp:
3820         (WebCore::YouTubeEmbedShadowElement::create):
3821         * html/track/InbandDataTextTrack.cpp:
3822         (WebCore::InbandDataTextTrack::create):
3823         * html/track/InbandDataTextTrack.h:
3824         * html/track/InbandGenericTextTrack.cpp:
3825         (WebCore::InbandGenericTextTrack::create):
3826         * html/track/InbandGenericTextTrack.h:
3827         * html/track/InbandWebVTTTextTrack.cpp:
3828         (WebCore::InbandWebVTTTextTrack::create):
3829         * html/track/InbandWebVTTTextTrack.h:
3830         * html/track/LoadableTextTrack.h:
3831         * html/track/TextTrack.h:
3832         (WebCore::TextTrack::create):
3833         * html/track/TextTrackCueGeneric.cpp:
3834         * html/track/TextTrackCueGeneric.h:
3835         * html/track/TextTrackList.h:
3836         * html/track/VTTRegionList.h:
3837         (WebCore::VTTRegionList::create):
3838
3839 2015-05-07  Dean Jackson  <dino@apple.com>
3840
3841         [iOS] MediaControls: disappear while scrubbing
3842         https://bugs.webkit.org/show_bug.cgi?id=144777
3843         <rdar://problem/20065572>
3844
3845         Reviewed by Eric Carlson.
3846
3847         If we are scrubbing we shouldn't hide the controls.
3848
3849         * Modules/mediacontrols/mediaControlsApple.js:
3850         (Controller.prototype.hideControls): Return early if we are scrubbing.
3851         * Modules/mediacontrols/mediaControlsiOS.js:
3852         (ControllerIOS.prototype): Add initial value for _potentiallyScrubbing and
3853         rename from non-underscored value throughout the file.
3854         (ControllerIOS.prototype.handleTimelineTouchEnd): When we finish scrubbing, reset
3855         the timer to hide the controls.
3856
3857 2015-05-07  Simon Fraser  <simon.fraser@apple.com>
3858
3859         REGRESSION (r183300): Fixed elements flash when scrolling
3860         https://bugs.webkit.org/show_bug.cgi?id=144778
3861         rdar://problem/20769741
3862
3863         Reviewed by Dean Jackson.
3864
3865         After r183300 we can detached layer backing store when outside the coverage region.
3866         However, position:fixed layers are moved around by the ScrollingCoordinator behind
3867         GraphicsLayer's back, so we can do layer flushes with stale information about layer
3868         geometry.
3869         
3870         To avoid dropping backing store for layers in this situation, prevent backing
3871         store detachment on layers registered with the ScrollingCoordinator as viewport-constrained
3872         layers. Preventing detachment on a layer also prevents detachment on all descendant
3873         layers.
3874
3875         * platform/graphics/GraphicsLayer.h:
3876         (WebCore::GraphicsLayer::setAllowsBackingStoreDetachment):
3877         (WebCore::GraphicsLayer::allowsBackingStoreDetachment):
3878         * platform/graphics/ca/GraphicsLayerCA.cpp:
3879         (WebCore::GraphicsLayerCA::GraphicsLayerCA):
3880         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects): Set m_intersectsCoverageRect to true
3881         if backing store detachment is prevented.
3882         (WebCore::GraphicsLayerCA::recursiveCommitChanges): Set a bit in the CommitState to 
3883         communicate to descendants that detachment is prevented.
3884         * platform/graphics/ca/GraphicsLayerCA.h:
3885         (WebCore::GraphicsLayerCA::CommitState::CommitState): Deleted.
3886         * rendering/RenderLayerBacking.cpp:
3887         (WebCore::RenderLayerBacking::setIsScrollCoordinatedWithViewportConstrainedRole):
3888         * rendering/RenderLayerBacking.h:
3889         (WebCore::RenderLayerBacking::setScrollingNodeIDForRole): If registering with a non-zero
3890         nodeID for the ViewportConstrained role, turn off backing store detachment.
3891
3892 2015-05-07  Sam Weinig  <sam@webkit.org>
3893
3894         Consider implementing Document.scrollingElement
3895         <rdar://problem/20845213>
3896         https://bugs.webkit.org/show_bug.cgi?id=143609
3897
3898         Reviewed by Simon Fraser.
3899
3900         Add the non-compliant implementation of Document.scrollingElement that the spec,
3901         found at http://dev.w3.org/csswg/cssom-view/#dom-document-scrollingelement, 
3902         says we should have while we have non-compliant implementations of Element.scrollTop
3903         and Element.scrollLeft (fixing that is tracked by https://bugs.webkit.org/show_bug.cgi?id=106133).
3904
3905         Tests: fast/dom/Document/scrollingElement-quirks-mode.html
3906                fast/dom/Document/scrollingElement-standards-mode.html
3907
3908         * dom/Document.cpp:
3909         (WebCore::Document::scrollingElement):
3910         * dom/Document.h:
3911         * dom/Document.idl:
3912
3913 2015-05-07  Dean Jackson  <dino@apple.com>
3914
3915         [iOS] While scrubbing and holding down, video continues to play
3916         https://bugs.webkit.org/show_bug.cgi?id=144776
3917         <rdar://problem/20863757>
3918
3919         Reviewed by Simon Fraser.
3920
3921         When we are scrubbing a video, we should pause playback. As we
3922         let go of the scrubber playback can resume (but only if it was
3923         playing originally).
3924
3925         * Modules/mediacontrols/mediaControlsiOS.js:
3926         (ControllerIOS.prototype.createControls): Listen for touchstart on the scrubber.
3927         (ControllerIOS.prototype.handleTimelineInput): Call the prototype, but pause if necessary.
3928         (ControllerIOS.prototype.handleTimelineChange): Just moved this to be with the other timeline functions.
3929         (ControllerIOS.prototype.handleTimelineTouchStart): Add the listeners for end and cancel. Remember that we are
3930         potentially about to scrub.
3931         (ControllerIOS.prototype.handleTimelineTouchEnd): Remove the listeners.
3932
3933 2015-05-07  Said Abou-Hallawa  <sabouhallawa@apple.com>
3934
3935         Applying a filter on an SVG element, which is larger than 4096 pixels, causes this element to be rendered shifted to the left
3936         https://bugs.webkit.org/show_bug.cgi?id=144335
3937
3938         Reviewed by Daniel Bates.
3939
3940         Address comments raised by Darin Adler in review.
3941
3942         * platform/graphics/ImageBuffer.cpp:
3943         (WebCore::ImageBuffer::sizeNeedsClamping):
3944         (WebCore::ImageBuffer::clampedSize):
3945         (WebCore::ImageBuffer::isSizeClamped): Deleted.
3946         * platform/graphics/ImageBuffer.h:
3947         The condition for the negative width/height in isSizeClamped() was wrong. Use
3948         FloatSize::isEmpty() instead and rename the function to sizeNeedsClamping().
3949         The new function should return the opposite of the old function return value.
3950         
3951         * platform/graphics/filters/FilterEffect.cpp:
3952         (WebCore::FilterEffect::apply):
3953         (WebCore::FilterEffect::asUnmultipliedImage):
3954         (WebCore::FilterEffect::asPremultipliedImage):
3955         (WebCore::FilterEffect::copyUnmultipliedImage):
3956         (WebCore::FilterEffect::copyPremultipliedImage):
3957         (WebCore::FilterEffect::createUnmultipliedImageResult):
3958         (WebCore::FilterEffect::createPremultipliedImageResult):
3959         * rendering/FilterEffectRenderer.cpp:
3960         (WebCore::FilterEffectRenderer::updateBackingStoreRect):
3961         (WebCore::FilterEffectRendererHelper::beginFilterEffect):
3962         * rendering/svg/RenderSVGResourceFilter.cpp:
3963         (WebCore::RenderSVGResourceFilter::applyResource):
3964         Call the new function and negate the condition for the return value.
3965
3966 2015-05-07  Anders Carlsson  <andersca@apple.com>
3967
3968         Build fix.
3969
3970         * editing/mac/EditorMac.mm:
3971         (WebCore::dataInRTFDFormat):
3972         (WebCore::dataInRTFFormat):
3973
3974 2015-05-07  Said Abou-Hallawa  <sabouhallawa@apple.com>
3975
3976         Applying a filter on an SVG element, which is larger than 4096 pixels, causes this element to be rendered shifted to the left
3977         https://bugs.webkit.org/show_bug.cgi?id=144335
3978
3979         Reviewed by Darin Adler.
3980
3981         When the SVG element is larger than 4096x4096 pixels and it has a filter,
3982         a clipper or a masker, the ImageBuffer which is created for drawing the
3983         sourceGraphicBuffer has to be clamped to this size. The reason for this
3984         clamping is the FilterEffect simply ignores processing any ImageBuffer
3985         larger than this size.
3986         
3987         The bug was happening because we did not propagate the clamping logic to
3988         the FilterEffect. The FilterEffect result ImageBuffer was not clamped as
3989         what we do for drawing the sourceGraphicBuffer. If only the destination
3990         point is specified, the GraphicsContext::drawImageBuffer() assumes the
3991         source and the destination images have the same size which is not true
3992         with the clamping.
3993         
3994         The fix is to add the clamping logic to the FilterEffect. Two places we
3995         need to change. (1) FilterEffect::createImageBufferResult() has to apply
3996         the same clamping we do in SVGRenderingContext::createImageBuffer(). (2)
3997         FilterEffect::drawingRegionOfInputImage() has to consider the clamping 
3998         when mapping from absolute coordinates to the ImageBuffer coordinates.
3999         
4000         Tests: svg/filters/big-sized-off-viewport-filter.svg
4001
4002         * platform/graphics/ImageBuffer.cpp:
4003         (WebCore::ImageBuffer::isSizeClamped):
4004         (WebCore::ImageBuffer::clampedSize):
4005         (WebCore::ImageBuffer::clampedRect):
4006         * platform/graphics/ImageBuffer.h:
4007         (WebCore::ImageBuffer::setSpaceSize): Move all the clamping helper methods