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