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