Add a WebCore logging channel for images
[WebKit.git] / Source / WebCore / ChangeLog
1 2016-05-16  Simon Fraser  <simon.fraser@apple.com>
2
3         Add a WebCore logging channel for images
4         https://bugs.webkit.org/show_bug.cgi?id=157752
5
6         Reviewed by Zalan Bujtas.
7
8         Create an Images log channel, and log various things related to decoding and drawing
9         images.
10
11         * platform/Logging.h:
12         * platform/graphics/BitmapImage.cpp:
13         (WebCore::BitmapImage::destroyDecodedDataIfNecessary):
14         (WebCore::BitmapImage::cacheFrame):
15         (WebCore::BitmapImage::startAnimation):
16         * platform/graphics/cg/GraphicsContextCG.cpp:
17         (WebCore::GraphicsContext::drawNativeImage):
18         * platform/graphics/cg/ImageDecoderCG.cpp:
19         (WebCore::ImageDecoder::createFrameImageAtIndex):
20
21 2016-05-12  Ada Chan  <adachan@apple.com>
22
23         Don't execute JavaScript within HTMLMediaElement::stop()
24         https://bugs.webkit.org/show_bug.cgi?id=157655
25
26         Reviewed by Chris Dumez.
27
28         * dom/ScriptExecutionContext.cpp:
29         (WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
30         Move the setting of m_activeDOMObjectsAreSuspended to true earlier so we won't execute
31         any JS while suspending the objects.
32         * html/HTMLMediaElement.cpp:
33         (WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange):
34         Bail early if the controls script hasn't been injected yet or the DOM object has been
35         stopped or suspended.
36
37 2016-05-16  Ryosuke Niwa  <rniwa@webkit.org>
38
39         Focus ordering should respect slot elements
40         https://bugs.webkit.org/show_bug.cgi?id=151379
41
42         Reviewed by Antti Koivisto.
43
44         Implemented the sequential focus navigation ordering as discussed on
45         https://github.com/w3c/webcomponents/issues/375
46
47         New behavior treats each shadow root and slot as a "focus scope". The focus navigation ordering
48         is defined within each "focus scope" using tabindex, treating any "focus scope owner"
49         (e.g. shadow host or a slot) as if it was having tabindex=0 if it wasn't itself focusable.
50
51         This patch modifies FocusNavigationScope to support a focus scope defined for a slot element in
52         addition to the one defined for a shadow tree and a document as previously supported.
53
54         Tests: fast/shadow-dom/focus-across-details-element.html
55                fast/shadow-dom/focus-navigation-across-slots.html
56
57         * dom/Node.cpp:
58         (WebCore::parentShadowRoot): Extracted from assignedSlot.
59         (WebCore::Node::assignedSlot):
60         (WebCore::Node::assignedSlotForBindings): Added.
61         * dom/Node.h:
62         * dom/NonDocumentTypeChildNode.idl:
63         * html/HTMLDetailsElement.h:
64         (HTMLDetailsElement::hasCustomFocusLogic): Added. Don't treat details element as a "focus scope".
65         * html/HTMLSummaryElement.h:
66         (HTMLSummaryElement::hasCustomFocusLogic): Ditto for summary element.
67         * page/FocusController.cpp:
68         (WebCore::hasCustomFocusLogic): Moved.
69         (WebCore::isFocusScopeOwner): Added. Returns true on a shadow host without a custom focus logic or
70         on a slot inside a shadow tree whose shadow host doesn't have a custom focus logic.
71         (WebCore::FocusNavigationScope::firstChildInScope): Now takes a reference. Call isFocusScopeOwner
72         to check for both slots and shadow roots instead of just the latter. This fixes a subtle bug that
73         focus may never get out of textarea in some cases due to its failure to check hasCustomFocusLogic.
74         (WebCore::FocusNavigationScope::lastChildInScope): Ditto.
75         (WebCore::FocusNavigationScope::parentInScope): Made this a member function since it needs to check
76         against m_slotElement inside the focus scope of a slot.
77         (WebCore::FocusNavigationScope::nextSiblingInScope): Added. Finds the next assigned node in a slot
78         in the focus scope defined for a slot. Just calls nextSibling() in the focus scope for shadow tree
79         and document.
80         (WebCore::FocusNavigationScope::previousSiblingInScope): Ditto for finding the previous sibling.
81         (WebCore::FocusNavigationScope::firstNodeInScope): Added. This function replaces rootNode() which
82         doesn't exist for the focus scope of a slot element.
83         (WebCore::FocusNavigationScope::lastNodeInScope): Ditto for the last node.
84         (WebCore::FocusNavigationScope::nextInScope):
85         (WebCore::FocusNavigationScope::previousInScope):
86         (WebCore::FocusNavigationScope::FocusNavigationScope): Added a variant that takes HTMLSlotElement.
87         (WebCore::FocusNavigationScope::owner): Added the support for slot elements.
88         (WebCore::FocusNavigationScope::scopeOf): Ditto.
89         (WebCore::FocusNavigationScope::scopeOwnedByScopeOwner): Ditto.
90         (WebCore::isFocusableElementOrScopeOwner): Added the support for slot elements and renamed from
91         isFocusableOrHasShadowTreeWithoutCustomFocusLogic.
92         (WebCore::isNonFocusableScopeOwner): Ditto. Renamed from isNonFocusableShadowHost.
93         (WebCore::isFocusableScopeOwner): Ditto. Renamed from isFocusableShadowHost.
94         (WebCore::shadowAdjustedTabIndex): Added the support for slot elements.
95         (WebCore::FocusController::findFocusableElementAcrossFocusScope):
96         (WebCore::FocusController::nextFocusableElementWithinScope):
97         (WebCore::FocusController::previousFocusableElementWithinScope):
98         (WebCore::FocusController::findElementWithExactTabIndex):
99         (WebCore::nextElementWithGreaterTabIndex): Call firstNodeInScope() instead of rootNode() here since
100         there is no root node for the focus scope defined for a slot element.
101         (WebCore::previousElementWithLowerTabIndex): Ditto for scope.lastNodeInScope().
102         (WebCore::FocusController::nextFocusableElementOrScopeOwner):
103         (WebCore::FocusController::previousFocusableElementOrScopeOwner):
104         (WebCore::parentInScope): Deleted.
105         (WebCore::FocusNavigationScope::rootNode): Deleted.
106         (WebCore::FocusNavigationScope::scopeOwnedByShadowHost): Deleted.
107         (WebCore::isNonFocusableShadowHost): Deleted.
108         (WebCore::isFocusableShadowHost): Deleted.
109         (WebCore::isFocusableOrHasShadowTreeWithoutCustomFocusLogic): Deleted.
110
111 2016-05-16  Chris Dumez  <cdumez@apple.com>
112
113         Use WTF::Optional for ScrollView's m_deferredScrollDelta / m_deferredScrollOffsets
114         https://bugs.webkit.org/show_bug.cgi?id=157747
115
116         Reviewed by Zalan Bujtas.
117
118         Use WTF::Optional for ScrollView's m_deferredScrollDelta / m_deferredScrollOffsets
119         instead of std::unique_ptr as it is more suited for this purpose.
120
121         * platform/ScrollView.cpp:
122         (WebCore::ScrollView::scrollOffsetChangedViaPlatformWidget):
123         (WebCore::ScrollView::handleDeferredScrollUpdateAfterContentSizeChange):
124         (WebCore::ScrollView::scrollTo):
125         * platform/ScrollView.h:
126
127 2016-05-16  Zalan Bujtas  <zalan@apple.com>
128
129         containingBlockFor*Position functions should take the renderer instead of the parent.
130         https://bugs.webkit.org/show_bug.cgi?id=157659
131
132         Reviewed by Simon Fraser.
133
134         containingBlockForFixedPosition, containingBlockForAbsolutePosition and containingBlockForObjectInFlow functions
135         expect the renderer's parent to be passed in (unless it is a RenderInline!). It is rather misleading and highly error-prone.
136         We should call them with the renderer itself instead.
137
138         * dom/Element.cpp:
139         (WebCore::layoutOverflowRectContainsAllDescendants): This expects ancestor containing block.
140         * rendering/LogicalSelectionOffsetCaches.h:
141         (WebCore::LogicalSelectionOffsetCaches::LogicalSelectionOffsetCaches):
142         * rendering/RenderElement.cpp:
143         (WebCore::containingBlockForFixedPosition):
144         (WebCore::containingBlockForAbsolutePosition):
145         (WebCore::containingBlockForObjectInFlow):
146         * rendering/RenderElement.h:
147         * rendering/RenderInline.cpp:
148         (WebCore::RenderInline::styleWillChange):
149         * rendering/RenderLineBreak.cpp:
150         (WebCore::RenderLineBreak::collectSelectionRects): Not a behaviour change.
151         * rendering/RenderObject.cpp:
152         (WebCore::RenderObject::containingBlock): RenderScrollbarPart renderer now returns
153         the containing block based on its owning renderer's style.
154
155 2016-05-16  Brent Fulgham  <bfulgham@apple.com>
156
157         REGRESSION (r192098): Content missing after copy and paste to Notes App on retina displays
158         https://bugs.webkit.org/show_bug.cgi?id=157630
159         <rdar://problem/25277577>
160
161         Reviewed by Simon Fraser.
162
163         Tested by http/tests/images/hidpi-srcset-copy.html
164
165         The code to create a WebArchive (or other representation) of a webpage was using the 'src' attribute of
166         the image element, which might be changed to reflect the optimal image dimensions for a specific
167         display. Instead, we should use the 'imageSourceURL' method of the Element class so we get the correct
168         'original' image URL in our cached resources.
169
170         * editing/cocoa/HTMLConverter.mm:
171         (HTMLConverter::_processElement): Use 'imageSourceURL', rather than getting the raw 'src' attribute.
172         * html/HTMLImageElement.cpp:
173         (WebCore::HTMLImageElement::addSubresourceAttributeURLs): Ditto.
174
175 2016-05-16  Brady Eidson  <beidson@apple.com>
176
177         Random CachedFont.cpp cleanup.
178         https://bugs.webkit.org/show_bug.cgi?id=157740
179
180         Reviewed by Myles C. Maxfield.
181
182         No new tests (Refactor/cleanup, no behavior change)
183
184         * loader/cache/CachedFont.cpp:
185         (WebCore::CachedFont::ensureCustomFontData): Remove unneeded local RefPtr<>
186         (WebCore::CachedFont::createCustomFontData): Refactor to not require unnecessary Ref-churn in the common case.
187
188 2016-05-16  Chris Dumez  <cdumez@apple.com>
189
190         Modernize Track classes' code
191         https://bugs.webkit.org/show_bug.cgi?id=157735
192
193         Reviewed by Eric Carlson.
194
195         Modernize Track classes' code a bit.
196
197         * Modules/mediasource/MediaSource.cpp:
198         (WebCore::MediaSource::removeSourceBuffer):
199         * Modules/mediasource/SourceBuffer.cpp:
200         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
201         * bindings/js/JSTrackCustom.cpp:
202         (WebCore::toTrack):
203         (WebCore::toJS):
204         * html/HTMLMediaElement.cpp:
205         (WebCore::HTMLMediaElement::audioTrackEnabledChanged):
206         (WebCore::HTMLMediaElement::textTrackModeChanged):
207         (WebCore::HTMLMediaElement::videoTrackSelectedChanged):
208         (WebCore::HTMLMediaElement::textTrackRemoveCues):
209         (WebCore::HTMLMediaElement::mediaPlayerDidAddTextTrack):
210         (WebCore::HTMLMediaElement::addAudioTrack):
211         (WebCore::HTMLMediaElement::addTextTrack):
212         (WebCore::HTMLMediaElement::addVideoTrack):
213         (WebCore::HTMLMediaElement::removeAudioTrack):
214         (WebCore::HTMLMediaElement::removeTextTrack):
215         (WebCore::HTMLMediaElement::removeVideoTrack):
216         (WebCore::HTMLMediaElement::forgetResourceSpecificTracks):
217         (WebCore::HTMLMediaElement::audioTracks):
218         (WebCore::HTMLMediaElement::textTracks):
219         (WebCore::HTMLMediaElement::videoTracks):
220         (WebCore::HTMLMediaElement::didAddTextTrack):
221         (WebCore::HTMLMediaElement::didRemoveTextTrack):
222         (WebCore::HTMLMediaElement::setSelectedTextTrack):
223         (WebCore::HTMLMediaElement::textTrackAddCues): Deleted.
224         (WebCore::HTMLMediaElement::closeCaptionTracksChanged): Deleted.
225         * html/HTMLMediaElement.h:
226         * html/shadow/MediaControlElements.cpp:
227         (WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay):
228         (WebCore::MediaControlClosedCaptionsTrackListElement::rebuildTrackListMenu):
229         * html/track/AudioTrack.cpp:
230         (WebCore::AudioTrack::~AudioTrack):
231         (WebCore::AudioTrack::setPrivate):
232         (WebCore::AudioTrack::isValidKind):
233         (WebCore::AudioTrack::willRemove):
234         (WebCore::AudioTrack::setEnabled): Deleted.
235         (WebCore::AudioTrack::updateKindFromPrivate): Deleted.
236         * html/track/AudioTrack.h:
237         (isType):
238         * html/track/AudioTrackList.cpp:
239         (AudioTrackList::append):
240         (AudioTrackList::item):
241         (AudioTrackList::getTrackById):
242         (AudioTrackList::eventTargetInterface): Deleted.
243         * html/track/AudioTrackList.h:
244         * html/track/InbandTextTrack.cpp:
245         (WebCore::InbandTextTrack::willRemove):
246         * html/track/TextTrack.cpp:
247         (WebCore::TextTrack::setKind):
248         (WebCore::TextTrack::trackIndex):
249         (WebCore::TextTrack::trackIndexRelativeToRenderedTracks):
250         (WebCore::TextTrack::setLanguage):
251         * html/track/TextTrack.h:
252         (isType):
253         * html/track/TextTrackList.cpp:
254         (TextTrackList::getTrackIndex):
255         (TextTrackList::getTrackIndexRelativeToRenderedTracks):
256         (TextTrackList::item):
257         (TextTrackList::getTrackById):
258         (TextTrackList::invalidateTrackIndexesAfterTrack):
259         (TextTrackList::append):
260         (TextTrackList::remove):
261         (TextTrackList::contains):
262         * html/track/TextTrackList.h:
263         * html/track/TrackBase.h:
264         * html/track/TrackEvent.cpp:
265         (WebCore::TrackEvent::TrackEvent):
266         * html/track/TrackEvent.h:
267         * html/track/TrackListBase.cpp:
268         (TrackListBase::remove):
269         (TrackListBase::contains):
270         (TrackListBase::scheduleTrackEvent):
271         (TrackListBase::scheduleAddTrackEvent):
272         (TrackListBase::scheduleRemoveTrackEvent):
273         * html/track/TrackListBase.h:
274         * html/track/VideoTrack.cpp:
275         (WebCore::VideoTrack::willRemove):
276         (WebCore::VideoTrack::setKind):
277         (WebCore::VideoTrack::setLanguage):
278         * html/track/VideoTrack.h:
279         (isType):
280         * html/track/VideoTrackList.cpp:
281         (VideoTrackList::append):
282         (VideoTrackList::item):
283         (VideoTrackList::getTrackById):
284         (VideoTrackList::selectedIndex):
285         * html/track/VideoTrackList.h:
286
287 2016-05-16  Michael Catanzaro  <mcatanzaro@igalia.com>
288
289         CSSParser.cpp triggers -Wunused-parameter
290         https://bugs.webkit.org/show_bug.cgi?id=157734
291
292         Reviewed by Csaba Osztrogonác.
293
294         * css/CSSParser.cpp:
295         (WebCore::isValidKeywordPropertyAndValue):
296
297 2016-05-16  Zan Dobersek  <zdobersek@igalia.com>
298
299         [Cairo] GraphicsContext3D::ImageExtractor should use the correct size for copying non-image surfaces
300         https://bugs.webkit.org/show_bug.cgi?id=157580
301
302         Reviewed by Darin Adler.
303
304         GraphicsContext3D::ImageExtractor::extractImage() shouldn't use m_imageWidth
305         and m_imageHeight members when copying the non-image-backed Cairo surface into
306         the image-based replacement simply because these two are not initialized until
307         later in this method.
308
309         Instead, the size of the to-be-copied image should be queried via the
310         cairoSurfaceSize() utility function which properly handles Cairo surfaces of
311         different types.
312
313         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
314         (WebCore::GraphicsContext3D::ImageExtractor::extractImage):
315
316 2016-05-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
317
318         REGRESSION (r199821): Large animated GIFs with slow network do not animate till the last frame
319         https://bugs.webkit.org/show_bug.cgi?id=157500
320
321         Reviewed by Darin Adler.
322
323         r199821 relies on the assumption that the image frameCount can be retrieved
324         only once when the image size is available and it is not going to change. It
325         turned out this assumption is wrong for some animated GIFs. The frameCount
326         can change every time a new data block is decoded.
327
328         The fix is to invalidate the image cached metadata every time a new data
329         block is decoded.
330
331         Test: http/tests/misc/slow-loading-animated-image.html
332
333         * platform/graphics/BitmapImage.cpp:
334         (WebCore::BitmapImage::BitmapImage): Move the "fromImage" BitmapImage constructor
335         to BitmapImage.cpp. The ImageSource needs to be initialized differently for
336         this case from the decoder image case. Also get rid of the template constructor.
337         Most of the flags of the BitmapImage will be deleted with the asynchronous image
338         decoding work.
339         
340         (WebCore::BitmapImage::cacheFrame): Delete unused flag m_hasUniformFrameSize.
341         It was added in r35761 and was mainly used by BitmapImage::currentFrameSize().
342         But this function itself was deleted in r172348.
343         
344         (WebCore::BitmapImage::dataChanged): Invalidate the image metadata cache.
345         
346         * platform/graphics/BitmapImage.h:
347         (WebCore::BitmapImage::BitmapImage): Deleted.
348         Delete unused flag m_hasUniformFrameSize. Also define new static functions in
349         FrameData to calculate platform dependent properties of an image.
350         
351         * platform/graphics/ImageSource.cpp:
352         (WebCore::ImageSource::ImageSource): Add a new constructor for the "fromImage"
353         BitmapImage case. The purpose of this constructor is to keep m_needsUpdateMetadata
354         and m_maximumSubsamplingLevel be initialized as they are in the class definition.
355         This constructor will be used with the asynchronous image decoding work where the
356         ImageSource needs to cache the FrameData.
357         
358         (WebCore::ImageSource::updateMetadata): If needsUpdateMetaData() is true, cache new metadata.
359         
360         (WebCore::ImageSource::subsamplingLevelForScale): Call updateMetadata() with its new name.
361         (WebCore::ImageSource::frameCount): Ditto
362         (WebCore::ImageSource::cacheMetadata): Deleted.
363         
364         * platform/graphics/ImageSource.h:
365         (WebCore::ImageSource::setNeedsUpdateMetadata): Invalidate the image cached metadata.
366         
367         * platform/graphics/cairo/BitmapImageCairo.cpp:
368         (WebCore::NativeImage::size):
369         (WebCore::NativeImage::hasAlpha):
370         (WebCore::BitmapImage::BitmapImage): Deleted.
371         Delete the "fromImage" BitmapImage constructor from this file since it is now platform
372         independent and has been moved to BitmapImage.cpp. Also add the new NativeImage platform
373         dependent functions which are used by the new "fromImage" BitmapImage constructor.
374         
375         * platform/graphics/cg/BitmapImageCG.cpp:
376         (WebCore::NativeImage::size):
377         (WebCore::NativeImage::hasAlpha):
378         (WebCore::BitmapImage::BitmapImage): Deleted.
379         Ditto.
380
381 2016-05-15  Frederic Wang  <fwang@igalia.com>
382
383         Small removal of useless code for MathML token elements
384         https://bugs.webkit.org/show_bug.cgi?id=157568
385
386         Reviewed by Darin Adler.
387
388         We remove two pieces of code for MathML token elements with unclear purposes and that do not
389         have any effect on math rendering.
390
391         No new tests, behavior is unchanged.
392
393         * css/mathml.css:
394         (mtext): Deleted. This was probably a hack that is no longer needed with the latest math font
395         ascent/descent management.
396         * mathml/MathMLTextElement.cpp:
397         (WebCore::MathMLTextElement::createElementRenderer): Deleted. Removing this does not break
398         the mentioned test.
399
400 2016-05-15  Chris Dumez  <cdumez@apple.com>
401
402         Use more references in JS wrappers related code
403         https://bugs.webkit.org/show_bug.cgi?id=157721
404
405         Reviewed by Darin Adler.
406
407         - Use more references in JS wrappers related code.
408         - Avoid some refcounting churn when using toJSNewlyCreated() and in
409           HTML/SVG elements factories by moving the Ref<> around.
410         - Add toJS() / toJSNewlyCreated() implementations for Text, XMLDocument
411           and HTMLDocument. Now that toJSNewlyCreated() takes a Ref<>&& /
412           RefPtr<>&& in, the compiler is no longer able to implicitly use the
413           toJSNewlyCreated() implementation of a parent class for a subclass
414           type (complains about calls being ambiguous). I thought about updating
415           the bindings generator to always generate a toJSNewlyCreated() for
416           all wrapper types (that would call the one on the parent class if the
417           subclass does not have a proper implementation). However this would
418           add some complexity to the bindings generator and it did not seem
419           worth it because [NewObject] and therefore toJSNewlyCreated() is only
420           used for a very limited set of subtypes. I have therefore decided to
421           add the toJS() / toJSNewlyCreated() implementations for the subtypes
422           in question. This also has the benefit of avoiding calling the more
423           complex implementations on Node / Document.
424
425         * CMakeLists.txt:
426         * WebCore.xcodeproj/project.pbxproj:
427         * bindings/js/JSAnimationTimelineCustom.cpp:
428         (WebCore::toJS):
429         * bindings/js/JSAudioContextCustom.cpp:
430         (WebCore::constructJSAudioContext):
431         * bindings/js/JSBindingsAllInOne.cpp:
432         * bindings/js/JSBlobCustom.cpp:
433         (WebCore::constructJSBlob):
434         * bindings/js/JSCSSRuleCustom.cpp:
435         (WebCore::toJS):
436         * bindings/js/JSCSSValueCustom.cpp:
437         (WebCore::toJS):
438         * bindings/js/JSDOMBinding.h:
439         (WebCore::getCachedWrapper):
440         (WebCore::createWrapper):
441         (WebCore::wrap):
442         (WebCore::getExistingWrapper):
443         (WebCore::createNewWrapper):
444         (WebCore::toJS):
445         (WebCore::finiteInt32Value): Deleted.
446         * bindings/js/JSDocumentCustom.cpp:
447         (WebCore::createNewDocumentWrapper):
448         (WebCore::toJS):
449         (WebCore::cachedDocumentWrapper):
450         (WebCore::reportMemoryForFramelessDocument):
451         (WebCore::toJSNewlyCreated):
452         * bindings/js/JSDocumentCustom.h:
453         * bindings/js/JSDocumentFragmentCustom.cpp:
454         (WebCore::createNewDocumentFragmentWrapper):
455         (WebCore::toJSNewlyCreated):
456         (WebCore::toJS):
457         * bindings/js/JSElementCustom.cpp:
458         (WebCore::toJSNewlyCreated):
459         * bindings/js/JSElementCustom.h:
460         (WebCore::toJSNewlyCreated):
461         * bindings/js/JSEventCustom.cpp:
462         (WebCore::createNewEventWrapper):
463         (WebCore::toJS):
464         (WebCore::toJSNewlyCreated):
465         * bindings/js/JSFileCustom.cpp:
466         (WebCore::constructJSFile):
467         * bindings/js/JSHTMLCollectionCustom.cpp:
468         (WebCore::toJS):
469         * bindings/js/JSHTMLDocumentCustom.cpp:
470         (WebCore::createNewHTMLDocumentWrapper):
471         (WebCore::toJS):
472         (WebCore::toJSNewlyCreated):
473         * bindings/js/JSHTMLTemplateElementCustom.cpp:
474         (WebCore::JSHTMLTemplateElement::content):
475         * bindings/js/JSImageDataCustom.cpp:
476         (WebCore::toJS):
477         * bindings/js/JSNodeCustom.cpp:
478         (WebCore::createWrapperInline):
479         (WebCore::createWrapper):
480         (WebCore::toJSNewlyCreated):
481         (WebCore::getOutOfLineCachedWrapper):
482         * bindings/js/JSNodeCustom.h:
483         (WebCore::toJS):
484         * bindings/js/JSNodeListCustom.cpp:
485         (WebCore::createWrapper):
486         (WebCore::toJSNewlyCreated):
487         * bindings/js/JSNodeListCustom.h:
488         (WebCore::toJS):
489         * bindings/js/JSRTCPeerConnectionCustom.cpp:
490         (WebCore::constructJSRTCPeerConnection):
491         * bindings/js/JSRTCSessionDescriptionCustom.cpp:
492         (WebCore::constructJSRTCSessionDescription):
493         * bindings/js/JSSVGPathSegCustom.cpp:
494         (WebCore::toJS):
495         * bindings/js/JSStyleSheetCustom.cpp:
496         (WebCore::toJS):
497         * bindings/js/JSTextCustom.cpp: Copied from Source/WebCore/dom/XMLDocument.idl.
498         (WebCore::createNewTextWrapper):
499         (WebCore::toJS):
500         (WebCore::toJSNewlyCreated):
501         * bindings/js/JSTextTrackCueCustom.cpp:
502         (WebCore::toJS):
503         * bindings/js/JSTrackCustom.cpp:
504         (WebCore::toJS):
505         * bindings/js/JSXMLDocumentCustom.cpp: Copied from Source/WebCore/bindings/js/JSDocumentFragmentCustom.cpp.
506         (WebCore::createNewXMLDocumentWrapper):
507         (WebCore::toJS):
508         (WebCore::toJSNewlyCreated):
509         * bindings/scripts/CodeGeneratorJS.pm:
510         (GenerateHeader):
511         (GenerateImplementation):
512         * bindings/scripts/test/JS/*: Rebaseline bindings tests.
513         * dom/Element.cpp:
514         (WebCore::Element::setInnerHTML):
515         * dom/Text.idl:
516         * dom/XMLDocument.idl:
517         * dom/make_names.pl:
518         (printWrapperFunctions):
519         (printWrapperFactoryCppFile):
520         (printWrapperFactoryHeaderFile):
521         * editing/MarkupAccumulator.cpp:
522         (WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
523         * html/HTMLDocument.idl:
524         * html/HTMLTemplateElement.cpp:
525         (WebCore::HTMLTemplateElement::content):
526         (WebCore::HTMLTemplateElement::cloneNodeInternal):
527         * html/HTMLTemplateElement.h:
528         * html/parser/HTMLConstructionSite.cpp:
529         (WebCore::insert):
530         (WebCore::HTMLConstructionSite::insertTextNode):
531         (WebCore::HTMLConstructionSite::ownerDocumentForCurrentNode):
532         * inspector/InspectorDOMAgent.cpp:
533         (WebCore::InspectorDOMAgent::buildObjectForNode):
534         * xml/parser/XMLDocumentParserLibxml2.cpp:
535         (WebCore::XMLDocumentParser::startElementNs):
536
537 2016-05-15  Darin Adler  <darin@apple.com>
538
539         Something tiny left out of the last patch.
540
541         * WebCore.xcodeproj/project.pbxproj: Allow Xcode to update this file.
542         * editing/ApplyStyleCommand.cpp:
543         (WebCore::ApplyStyleCommand::applyInlineStyleChange): Removed unneeded null check; all
544         code paths already have null checks.
545
546 2016-05-15  Darin Adler  <darin@apple.com>
547
548         More CTTE and other cleanups for HTML editing header
549         https://bugs.webkit.org/show_bug.cgi?id=157722
550
551         Reviewed by Chris Dumez.
552
553         These changes are mostly things Chris asked for in his review of my last patch
554         or other related style and small efficiency improvements.
555
556         - using nullptr instead of 0
557         - using is<Text> instead of isTextNode and is<> instead of hasTagName
558         - changing argument type of functions like editingIgnoresContent to a reference
559         - using { } instead of constructor calls for classes like Position
560         - using words like position intead of abbreviations like pos
561         - using auto rather than explicit types
562         - rename functions that return true for HTMLElement to express that in the function names
563
564         * dom/Position.cpp:
565         (WebCore::nextRenderedEditable): nullptr
566         (WebCore::previousRenderedEditable): nullptr
567         (WebCore::Position::Position): is<>, reference
568         (WebCore::Position::moveToPosition): reference
569         (WebCore::Position::offsetForPositionAfterAnchor): Added a null assertion and
570         null check that replaces the one that used to be in lastOffsetForEditing.
571         (WebCore::Position::parentAnchoredEquivalent): { }, reference
572         (WebCore::Position::computeNodeBeforePosition): nullptr
573         (WebCore::Position::computeNodeAfterPosition): nullptr
574         (WebCore::Position::anchorTypeForLegacyEditingPosition): reference
575         (WebCore::Position::previous): reference
576         (WebCore::Position::next): reference
577         (WebCore::Position::parentEditingBoundary): nullptr
578         (WebCore::Position::previousCharacterPosition): { }, pos -> position
579         (WebCore::Position::nextCharacterPosition): { }, pos -> position
580         (WebCore::endsOfNodeAreVisuallyDistinctPositions): reference
581         (WebCore::Position::upstream): { }, pos -> position
582         (WebCore::Position::downstream): { }, pos -> position
583         (WebCore::Position::rootUserSelectAllForNode): nullptr
584         (WebCore::Position::isCandidate): auto, reference, is<>
585         (WebCore::Position::rendersInDifferentPosition): pos -> position, auto, is<>
586         (WebCore::Position::leadingWhitespacePosition): { }, is<>
587         (WebCore::Position::trailingWhitespacePosition): { }
588         (WebCore::Position::getInlineBoxAndOffset): reference
589         (WebCore::Position::equals): reference, is<>
590
591         * dom/PositionIterator.cpp:
592         (WebCore::PositionIterator::operator Position): reference
593         (WebCore::PositionIterator::isCandidate): reference
594
595         * editing/ApplyStyleCommand.cpp:
596         (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange): is<>
597         (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange): is<>, reference
598         (WebCore::ApplyStyleCommand::removeConflictingInlineStyleFromRun): reference
599         (WebCore::ApplyStyleCommand::removeInlineStyle): auto, is<>, reference
600         (WebCore::ApplyStyleCommand::nodeFullySelected): is<>
601         (WebCore::ApplyStyleCommand::nodeFullyUnselected): is<>
602         (WebCore::ApplyStyleCommand::splitTextAtStart): is<>
603         (WebCore::ApplyStyleCommand::splitTextElementAtStart): is<>
604         (WebCore::ApplyStyleCommand::splitTextElementAtEnd): is<>
605         (WebCore::ApplyStyleCommand::isValidCaretPositionInTextNode): is<>
606         (WebCore::ApplyStyleCommand::surroundNodeRangeWithElement): Removed unneeded
607         is<Element> calls before calling areIdenticalElements.
608         (WebCore::ApplyStyleCommand::positionToComputeInlineStyleChange): Tightened
609         up logic for the loop to avoid redundant checks.
610         (WebCore::ApplyStyleCommand::applyInlineStyleChange): auto
611
612         * editing/CompositeEditCommand.cpp:
613         (WebCore::CompositeEditCommand::insertNodeAt): reference
614         (WebCore::CompositeEditCommand::appendNode): reference
615         (WebCore::CompositeEditCommand::moveParagraphs): isListHTMLElement
616
617         * editing/DeleteSelectionCommand.cpp:
618         (WebCore::DeleteSelectionCommand::handleGeneralDelete): reference
619
620         * editing/FormatBlockCommand.cpp: Fixed order of includes.
621         (WebCore::enclosingBlockToSplitTreeTo): isListHTMLElement
622
623         * editing/InsertParagraphSeparatorCommand.cpp:
624         (WebCore::InsertParagraphSeparatorCommand::doApply): reference
625
626         * editing/ModifySelectionListLevel.cpp:
627         (WebCore::getStartEndListChildren): isListHTMLElement
628         (WebCore::IncreaseSelectionListLevelCommand::doApply):isListHTMLElement
629         (WebCore::canDecreaseListLevel):isListHTMLElement
630
631         * editing/RemoveNodeCommand.cpp: Removed unneeded include.
632
633         * editing/ReplaceNodeWithSpanCommand.cpp:
634         (WebCore::ReplaceNodeWithSpanCommand::doApply): Use HTMLSpanElement::create.
635
636         * editing/ReplaceSelectionCommand.cpp:
637         (WebCore::isInterchangeNewlineNode): is<>, downcast<>
638         (WebCore::isInterchangeConvertedSpaceSpan): is<>, downcast<>
639         (WebCore::positionAvoidingPrecedingNodes): pos -> position, reference
640         (WebCore::ReplaceSelectionCommand::doApply): isListHTMLElement
641         (WebCore::ReplaceSelectionCommand::insertAsListItems): isListHTMLElement
642
643         * editing/SpellChecker.cpp: Removed unneeded include.
644
645         * editing/TextIterator.cpp:
646         (WebCore::SimplifiedBackwardsTextIterator::advance): reference
647
648         * editing/VisibleSelection.cpp:
649         (WebCore::VisibleSelection::selectionFromContentsOfNode): reference
650
651         * editing/VisibleUnits.cpp:
652         (WebCore::previousLinePosition): reference
653         (WebCore::nextLinePosition): reference
654         (WebCore::findStartOfParagraph): reference
655         (WebCore::findEndOfParagraph): reference
656
657         * editing/htmlediting.cpp:
658         (WebCore::canHaveChildrenForEditing): Moved here from header file so we don't
659         have to include "Text.h". Not critical to inline this.
660         (WebCore::isAtomicNode): reference
661         (WebCore::lastOffsetForEditing): reference
662         (WebCore::stringWithRebalancedWhitespace): Changed to use StringBuilder instead
663         of Vector<UChar> so this won't turn 8-bit strings into 16-bit strings. Changed
664         to not use the StringBuilder at all until we encounter a character that needs
665         to be changed.
666         (WebCore::isSpecialHTMLElement): Renamed to make it clear that it only can return
667         true for a Node that is an HTMLElement.
668         (WebCore::firstInSpecialElement): isSpecialHTMLElement
669         (WebCore::lastInSpecialElement): isSpecialHTMLElement
670         (WebCore::isListHTMLElement): Renamed to make it clear that it can only return
671         true for a Node that is an HTMLElement.
672         (WebCore::isListItem): isListHTMLElement, is<>
673         (WebCore::enclosingNodeOfType): p -> position, nullptr
674         (WebCore::highestEnclosingNodeOfType): p -> position
675         (WebCore::enclosingListChild): isListHTMLElement, is<>
676         (WebCore::embeddedSublist): isListHTMLElement
677         (WebCore::appendedSublist):isListHTMLElement
678         (WebCore::caretMaxOffset): is<>
679         (WebCore::caretRendersInsideNode): changed to take a reference
680         (WebCore::rendererForCaretPainting): reference
681
682         * editing/htmlediting.h: Updated for name changes and type changes above.
683
684         * editing/markup.cpp:
685         (WebCore::StyledMarkupAccumulator::traverseNodesForSerialization): reference
686         (WebCore::highestAncestorToWrapMarkup): auto, reference, isListHTMLElement
687
688         * html/HTMLSpanElement.cpp:
689         (WebCore::HTMLSpanElement::create): Added overload that does not require a tag name.
690         * html/HTMLSpanElement.h: Ditto.
691
692         * page/DOMSelection.cpp: Removed unneeded includes.
693
694         * rendering/RenderBox.cpp:
695         (WebCore::RenderBox::localCaretRect): reference
696
697 2016-05-15  Commit Queue  <commit-queue@webkit.org>
698
699         Unreviewed, rolling out r200925.
700         https://bugs.webkit.org/show_bug.cgi?id=157725
701
702         Does not build if MEDIA_SESSION is enabled (Requested by
703         cdumez_ on #webkit).
704
705         Reverted changeset:
706
707         "Use new Web IDL dictionary support for
708         MediaSession.setMetadata()"
709         https://bugs.webkit.org/show_bug.cgi?id=157711
710         http://trac.webkit.org/changeset/200925
711
712 2016-05-14  Chris Dumez  <cdumez@apple.com>
713
714         Use new Web IDL dictionary support for MediaSession.setMetadata()
715         https://bugs.webkit.org/show_bug.cgi?id=157711
716
717         Reviewed by Eric Carlson.
718
719         Use new Web IDL dictionary support for MediaSession.setMetadata().
720
721         No new tests, no intended Web-exposed behavior change.
722
723         * Modules/mediasession/MediaSession.cpp:
724         (WebCore::MediaSession::setMetadata):
725         (WebCore::MediaSession::deactivate): Deleted.
726         * Modules/mediasession/MediaSession.h:
727         * Modules/mediasession/MediaSession.idl:
728
729 2016-05-14  Joseph Pecoraro  <pecoraro@apple.com>
730
731         Remove LegacyProfiler
732         https://bugs.webkit.org/show_bug.cgi?id=153565
733
734         Reviewed by Mark Lam.
735
736         * CMakeLists.txt:
737         * DerivedSources.cpp:
738         * DerivedSources.make:
739         * ForwardingHeaders/profiler/LegacyProfiler.h: Removed.
740         * ForwardingHeaders/profiler/Profile.h: Removed.
741         * ForwardingHeaders/profiler/ProfileNode.h: Removed.
742         * WebCore.xcodeproj/project.pbxproj:
743         * bindings/js/JSCustomXPathNSResolver.cpp:
744         * bindings/js/JSDOMWindowBase.cpp:
745         (WebCore::JSDOMWindowBase::supportsLegacyProfiling): Deleted.
746         (WebCore::JSDOMWindowBase::supportsRichSourceInfo): Deleted.
747         * bindings/js/JSDOMWindowBase.h:
748         * bindings/js/JSWorkerGlobalScopeBase.cpp:
749         (WebCore::JSWorkerGlobalScopeBase::supportsLegacyProfiling): Deleted.
750         * bindings/js/JSWorkerGlobalScopeBase.h:
751         * bindings/js/ScriptCachedFrameData.cpp:
752         * bindings/js/ScriptController.cpp:
753         (WebCore::ScriptController::clearWindowShell): Deleted.
754         * bindings/js/ScriptProfile.h: Removed.
755         * bindings/js/ScriptProfileNode.h: Removed.
756         * bindings/scripts/CodeGeneratorJS.pm:
757         (AddClassForwardIfNeeded): Deleted.
758         * bindings/scripts/test/JS/JSTestObj.cpp:
759         * bindings/scripts/test/TestObj.idl:
760         * css/CSSParser.cpp:
761         * dom/Document.cpp:
762         * inspector/InspectorConsoleInstrumentation.h:
763         (WebCore::InspectorInstrumentation::stopProfiling):
764         * inspector/InspectorController.cpp:
765         (WebCore::InspectorController::InspectorController):
766         (WebCore::InspectorController::legacyProfilerEnabled): Deleted.
767         (WebCore::InspectorController::setLegacyProfilerEnabled): Deleted.
768         * inspector/InspectorController.h:
769         * inspector/InspectorInstrumentation.cpp:
770         (WebCore::InspectorInstrumentation::stopProfilingImpl):
771         * inspector/InspectorInstrumentation.h:
772         * inspector/InspectorTimelineAgent.cpp:
773         (WebCore::InspectorTimelineAgent::startFromConsole):
774         (WebCore::InspectorTimelineAgent::stopFromConsole):
775         * inspector/InspectorTimelineAgent.h:
776         * inspector/PageDebuggerAgent.cpp:
777         * inspector/PageRuntimeAgent.cpp:
778         * inspector/ScriptProfile.idl: Removed.
779         * inspector/ScriptProfileNode.idl: Removed.
780         * inspector/TimelineRecordFactory.cpp:
781         (WebCore::buildAggregateCallInfoInspectorObject): Deleted.
782         (WebCore::buildInspectorObject): Deleted.
783         (WebCore::buildProfileInspectorObject): Deleted.
784         (WebCore::TimelineRecordFactory::appendProfile): Deleted.
785         * page/DOMWindow.cpp:
786         * page/Page.cpp:
787         * page/PageConsoleClient.cpp:
788         (WebCore::PageConsoleClient::profileEnd):
789         (WebCore::PageConsoleClient::clearProfiles): Deleted.
790         * page/PageConsoleClient.h:
791         * testing/Internals.cpp:
792         (WebCore::Internals::resetToConsistentState): Deleted.
793         (WebCore::Internals::consoleProfiles): Deleted.
794         (WebCore::Internals::setLegacyJavaScriptProfilingEnabled): Deleted.
795         * testing/Internals.h:
796         * testing/Internals.idl:
797         * testing/js/WebCoreTestSupport.cpp:
798         * xml/XSLStyleSheetLibxslt.cpp:
799         * xml/XSLTProcessorLibxslt.cpp:
800
801 2016-05-13  Ryosuke Niwa  <rniwa@webkit.org>
802
803         ToT WebKit doesn't show tooltip on perf dashboard's summary page
804         https://bugs.webkit.org/show_bug.cgi?id=157705
805
806         Reviewed by Darin Adler.
807
808         The bug was caused by WebKit doesn't look for the title attribute across shadow boundaries.
809         Fixed it by using a newly added Node::parentNodeInComposedTree in HitTestResult::title.
810
811         Test: fast/shadow-dom/tooltip-on-composed-tree.html
812
813         * dom/Node.cpp:
814         (WebCore::Node::parentInComposedTree): Added.
815         * dom/Node.h:
816         * rendering/HitTestResult.cpp:
817         (WebCore::HitTestResult::title): Fixed the bug.
818         (WebCore::HitTestResult::innerTextIfTruncated): Fixed a related bug when ShowsToolTipOverTruncatedText
819         is enabled. Unfortunately, there is no machinery to test this feature yet.
820
821 2016-05-14  Darin Adler  <darin@apple.com>
822
823         CTTE for the HTML editing header
824         https://bugs.webkit.org/show_bug.cgi?id=157676
825
826         Reviewed by Chris Dumez.
827
828         * accessibility/AXObjectCache.cpp:
829         (WebCore::AccessibilityReplacedText::postTextStateChangeNotification): Use auto so we have a
830         change to compile more efficient code using the more specific types returned, rather than
831         explicitly using a less specific type like Node.
832         (WebCore::AXObjectCache::startCharacterOffsetOfParagraph): Ditto.
833         * accessibility/atk/WebKitAccessibleInterfaceText.cpp: Update for deprecatedIsEditingWhitespace name.
834         * dom/Position.cpp:
835         (WebCore::Position::offsetForPositionAfterAnchor): Update to use a reference instead of a pointer.
836         (WebCore::Position::next): Ditto.
837         (WebCore::Position::atFirstEditingPositionForNode): Ditto.
838         (WebCore::Position::atLastEditingPositionForNode): Ditto.
839         (WebCore::Position::atStartOfTree): Ditto.
840         (WebCore::Position::atEndOfTree): Ditto.
841         (WebCore::Position::upstream): Ditto.
842         (WebCore::Position::downstream): Ditto.
843         (WebCore::Position::rendersInDifferentPosition): Ditto.
844         * dom/PositionIterator.cpp:
845         (WebCore::PositionIterator::increment): Ditto.
846         (WebCore::PositionIterator::decrement): Ditto.
847         (WebCore::PositionIterator::atEnd): Ditto.
848         (WebCore::PositionIterator::atEndOfNode): Ditto.
849         * editing/AlternativeTextController.cpp:
850         (WebCore::AlternativeTextController::markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand):
851         Use new name, deprecatedIsEditingWhitespace.
852         * editing/ApplyBlockElementCommand.cpp:
853         (WebCore::ApplyBlockElementCommand::formatSelection): Use auto (see rationale above).
854         * editing/ApplyStyleCommand.cpp:
855         (WebCore::ApplyStyleCommand::applyBlockStyle): More of the same.
856         (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange): Ditto.
857         (WebCore::ApplyStyleCommand::fixRangeAndApplyInlineStyle): Ditto.
858         (WebCore::ApplyStyleCommand::isValidCaretPositionInTextNode): Ditto.
859         (WebCore::ApplyStyleCommand::mergeStartWithPreviousIfIdentical): Ditto.
860         (WebCore::ApplyStyleCommand::mergeEndWithNextIfIdentical): Ditto.
861         (WebCore::ApplyStyleCommand::surroundNodeRangeWithElement): Ditto.
862         * editing/BreakBlockquoteCommand.cpp:
863         (WebCore::BreakBlockquoteCommand::doApply): Ditto.
864         * editing/CompositeEditCommand.cpp:
865         (WebCore::postTextStateChangeNotification): Ditto.
866         (WebCore::CompositeEditCommand::insertNodeAt): Ditto.
867         (WebCore::CompositeEditCommand::positionOutsideTabSpan): Ditto.
868         (WebCore::containsOnlyDeprecatedEditingWhitespace): Ditto.
869         (WebCore::CompositeEditCommand::shouldRebalanceLeadingWhitespaceFor): Ditto.
870         (WebCore::CompositeEditCommand::rebalanceWhitespaceAt): Ditto.
871         (WebCore::CompositeEditCommand::rebalanceWhitespaceOnTextSubstring): Ditto.
872         (WebCore::CompositeEditCommand::insertNewDefaultParagraphElementAt): Ditto.
873         (WebCore::CompositeEditCommand::moveParagraphWithClones): Ditto.
874         (WebCore::CompositeEditCommand::moveParagraphs): Ditto.
875         * editing/DeleteSelectionCommand.cpp:
876         (WebCore::DeleteSelectionCommand::initializeStartEnd): Ditto.
877         (WebCore::DeleteSelectionCommand::handleGeneralDelete): Ditto.
878         (WebCore::DeleteSelectionCommand::mergeParagraphs): Ditto.
879         (WebCore::DeleteSelectionCommand::doApply): Ditto.
880         * editing/EditCommand.cpp:
881         (WebCore::EditCommand::postTextStateChangeNotification): Ditto.
882         * editing/EditingStyle.cpp: Ditto.
883         * editing/Editor.cpp:
884         (WebCore::Editor::advanceToNextMisspelling): Ditto.
885         * editing/FormatBlockCommand.cpp:
886         (WebCore::FormatBlockCommand::formatRange): Ditto.
887         * editing/IndentOutdentCommand.cpp:
888         (WebCore::IndentOutdentCommand::outdentParagraph): Ditto.
889         * editing/InsertLineBreakCommand.cpp:
890         (WebCore::InsertLineBreakCommand::doApply): Ditto.
891         * editing/InsertListCommand.cpp:
892         (WebCore::InsertListCommand::fixOrphanedListChild): Ditto.
893         (WebCore::InsertListCommand::doApplyForSingleParagraph): Ditto.
894         (WebCore::InsertListCommand::unlistifyParagraph): Ditto.
895         (WebCore::InsertListCommand::listifyParagraph): Ditto.
896         * editing/InsertParagraphSeparatorCommand.cpp:
897         (WebCore::InsertParagraphSeparatorCommand::doApply): Ditto.
898         * editing/InsertTextCommand.cpp:
899         (WebCore::InsertTextCommand::insertTab): Ditto.
900         * editing/ModifySelectionListLevel.cpp:
901         (WebCore::IncreaseSelectionListLevelCommand::doApply): Ditto.
902         * editing/ReplaceSelectionCommand.cpp:
903         (WebCore::ReplacementFragment::removeUnrenderedNodes): Ditto.
904         (WebCore::ReplaceSelectionCommand::shouldMerge): Ditto.
905         (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline): Ditto.
906         (WebCore::ReplaceSelectionCommand::mergeEndIfNeeded): Ditto.
907         (WebCore::enclosingInline): Ditto.
908         (WebCore::ReplaceSelectionCommand::doApply): Ditto.
909         * editing/TextIterator.cpp:
910         (WebCore::maxOffsetIncludingCollapsedSpaces): Ditto.
911         * editing/TypingCommand.cpp:
912         (WebCore::TypingCommand::forwardDeleteKeyPressed): Ditto.
913         * editing/VisiblePosition.cpp:
914         (WebCore::VisiblePosition::honorEditingBoundaryAtOrBefore): Ditto.
915         (WebCore::VisiblePosition::honorEditingBoundaryAtOrAfter): Ditto.
916         * editing/VisibleSelection.cpp:
917         (WebCore::VisibleSelection::setStartAndEndFromBaseAndExtentRespectingGranularity): Ditto.
918         (WebCore::VisibleSelection::adjustSelectionToAvoidCrossingEditingBoundaries): Ditto.
919         * editing/VisibleUnits.cpp:
920         (WebCore::previousRootInlineBoxCandidatePosition): Ditto.
921         (WebCore::nextRootInlineBoxCandidatePosition): Ditto.
922         (WebCore::startOfParagraph): Ditto.
923         (WebCore::endOfParagraph): Ditto.
924         (WebCore::startOfEditableContent): Ditto.
925         (WebCore::endOfEditableContent): Ditto.
926
927         * editing/htmlediting.cpp:
928         (WebCore::highestEditableRoot): Changed return type to ContainerNode. Maybe later could
929         change it to Element.
930         (WebCore::lowestEditableAncestor): Changed return type to Element.
931         (WebCore::isEditableToAccessibility): Use auto.
932         (WebCore::isRichlyEditablePosition): Ditto.
933         (WebCore::editableRootForPosition): Ditto.
934         (WebCore::unsplittableElementForPosition):Ditto.
935         (WebCore::nextCandidate): Streamline.
936         (WebCore::nextVisuallyDistinctCandidate): Ditto.
937         (WebCore::previousCandidate): Ditto.
938         (WebCore::previousVisuallyDistinctCandidate): Ditto.
939         (WebCore::firstEditablePositionAfterPositionInRoot): Changed arugment type to
940         ContainerNode.
941         (WebCore::lastEditablePositionBeforePositionInRoot): Ditto.
942         (WebCore::lastOffsetForEditing): Changed argument type to reference.
943         (WebCore::stringWithRebalancedWhitespace): Optimized the case where the function does
944         not need to change the string, so it just returns the passed string rather than a copy.
945         (WebCore::isTableStructureNode): Use auto.
946         (WebCore::isSpecialElement): Made this function private to the file. Use auto.
947         (WebCore::firstInSpecialElement): Return an HTMLElement.
948         (WebCore::lastInSpecialElement): Ditto.
949         (WebCore::isFirstVisiblePositionInSpecialElement): Made this function private to the file.
950         (WebCore::positionBeforeContainingSpecialElement): Changed out argument to HTMLElement.
951         (WebCore::isLastVisiblePositionInSpecialElement): Ditto.
952         (WebCore::positionAfterContainingSpecialElement): Ditto.
953         (WebCore::positionOutsideContainingSpecialElement): Ditto.
954         (WebCore::isFirstPositionAfterTable): Changed return type to Element.
955         (WebCore::isLastPositionBeforeTable): Ditto.
956         (WebCore::visiblePositionBeforeNode): Changed argument type to reference.
957         (WebCore::visiblePositionAfterNode): Ditto.
958         (WebCore::enclosingElementWithTag): Use auto. Removed special case for null since the
959         algorithm already handles null correctly.
960         (WebCore::enclosingNodeOfType): Use auto.
961         (WebCore::highestEnclosingNodeOfType): Ditto.
962         (WebCore::highestNodeToRemoveInPruning): Ditto.
963         (WebCore::enclosingTableCell): Changed return type to Element.
964         (WebCore::enclosingAnchorElement): Removed special case for null since the algorithm
965         already handles null correctly.
966         (WebCore::enclosingList): Use auto.
967         (WebCore::enclosingListChild): Use auto.
968         (WebCore::enclosingEmptyListItem): Use auto.
969         (WebCore::outermostEnclosingList): Use auto.
970         (WebCore::canMergeLists): Use references and more specific type. Since both elements are
971         known to be HTMLElement, compare local names instead of using hasTagName.
972         (WebCore::isRenderedTable): Use auto.
973         (WebCore::isTableCell): Ditto.
974         (WebCore::isEmptyTableCell): Ditto.
975         (WebCore::createBreakElement): Deleted. Callers can use HTMLBRElement directly.
976         (WebCore::createOrderedListElement): Deleted. Callers can use HTMLOListElement directly.
977         (WebCore::createUnorderedListElement): Deleted. Callers can use HTMLUListElement directly.
978         (WebCore::createListItemElement): Deleted. Callers can use HTMLLIElement directly.
979         (WebCore::isTabSpanNode): Remove redundant checks and did more specific typecast.
980         (WebCore::isTabSpanTextNode): Removed redundant null checks.
981         (WebCore::tabSpanNode): Changed return type to HTMLSpanElement.
982         (WebCore::positionOutsideTabSpan): Deleted. Unused function.
983         (WebCore::createTabSpanElement): Made one of the overloads private to this file. Use auto.
984         Changed argument type since we don't need to support null. Moved createEditingTextNode code,
985         specific to the version without a string into that function rather than the helper function.
986         (WebCore::isNodeRendered): Changed argument type to a reference.
987         (WebCore::numEnclosingMailBlockquotes): Streamlined.
988         (WebCore::isMailBlockquote): Use downcast instead of static_cast.
989         (WebCore::caretMinOffset): Take a reference instead of a pointer.
990         (WebCore::caretMaxOffset): Ditto.
991         (WebCore::selectionForParagraphIteration): Use auto.
992         (WebCore::indexForVisiblePosition): Ditto.
993         (WebCore::visiblePositionForIndex): Ditto.
994         (WebCore::visiblePositionForIndexUsingCharacterIterator): Ditto.
995         (WebCore::isVisiblyAdjacent): Made this private to this file.
996         (WebCore::isNodeVisiblyContainedWithin): Changed argument type to a reference.
997         (WebCore::areIdenticalElements): Changed argument types to references.
998         (WebCore::adjustedSelectionStartForStyleComputation): Use auto.
999         (WebCore::isBlockFlowElement): Changed argument type to a reference. Use auto.
1000         (WebCore::deprecatedEnclosingBlockFlowElement): Updated for reference changes.
1001         (WebCore::rendererForCaretPainting): Use auto.
1002
1003         * editing/htmlediting.h: Use pragma once. Removed unneeded includes and forward declarations.
1004         Removed various non-helpful comments (the sections still don't make sense; not really good to
1005         group functions by their return types). Moved inline functoin bodies to the bottom of the file.
1006         Renamed isWhitespace to deprecatedIsEditingWhitespace.
1007
1008         * editing/markup.cpp:
1009         (WebCore::createFragmentFromText): Use HTMLBRElement.
1010         * page/DOMSelection.cpp:
1011         (WebCore::DOMSelection::extend): Updated since caretMaxOffset takes a reference.
1012
1013 2016-05-14  Myles C. Maxfield  <mmaxfield@apple.com>
1014
1015         Support ArrayBufferViews in the CSS Font Loading API
1016         https://bugs.webkit.org/show_bug.cgi?id=157694
1017         <rdar://problem/25554267>
1018
1019         This patch adds a new mode to CSSFontFaceSource for immediate (ArrayBuffer) data.
1020         Then, FontFace can simply be hooked up to this new mode.
1021
1022         Reviewed by Darin Adler.
1023
1024         Test: fast/text/css-font-loading-arraybuffer.html
1025
1026         * css/CSSFontFaceSource.cpp:
1027         (WebCore::CSSFontFaceSource::CSSFontFaceSource):
1028         (WebCore::CSSFontFaceSource::font):
1029         * css/CSSFontFaceSource.h:
1030         * css/FontFace.cpp:
1031         (WebCore::FontFace::create):
1032         * loader/cache/CachedFont.cpp:
1033         (WebCore::CachedFont::ensureCustomFontData):
1034         (WebCore::CachedFont::createCustomFontData):
1035         (WebCore::CachedFont::createFont):
1036         (WebCore::CachedFont::platformDataFromCustomData):
1037         * loader/cache/CachedFont.h:
1038
1039 2016-05-14  Chris Dumez  <cdumez@apple.com>
1040
1041         [WebIDL] Add support for dictionary members of integer types
1042         https://bugs.webkit.org/show_bug.cgi?id=157703
1043
1044         Reviewed by Darin Adler.
1045
1046         Add support for dictionary members of integer types, including support
1047         for the [Clamp] and [EnforceRange] IDL extended attributes on such
1048         members.
1049
1050         * bindings/js/JSDOMConvert.h:
1051         (WebCore::convert):
1052         (WebCore::convertOptional):
1053         - Add the needed template specializations so we can use convertOptional()
1054           with integral types.
1055         - Use std::enable_if so the template specializations meants to be used
1056           for floating point types or integral types can only be instantiated
1057           for such types.
1058
1059         * bindings/scripts/CodeGeneratorJS.pm:
1060         (GenerateConversionRuleWithLeadingComma):
1061         (GetIntegerConversionConfiguration):
1062         (JSValueToNative):
1063         Generate the right IntegerConversionConfiguration parameter for convert()
1064         and convertOptional() when converting dictionary members of integral
1065         types
1066
1067         * bindings/scripts/IDLParser.pm:
1068         (parseDictionaryMember):
1069         Fix bug in the IDL parser where we weren't initializing the extended
1070         attributes for dictionary members.
1071
1072         * bindings/scripts/test/JS/JSTestObj.cpp:
1073         * bindings/scripts/test/TestObj.idl:
1074         Add bindings tests coverage.
1075
1076 2016-05-14  Chris Dumez  <cdumez@apple.com>
1077
1078         Allocate MacGlyphToPathTranslator / CairoGlyphToPathTranslator on the stack
1079         https://bugs.webkit.org/show_bug.cgi?id=157690
1080
1081         Reviewed by Myles C. Maxfield.
1082
1083         Allocate MacGlyphToPathTranslator / CairoGlyphToPathTranslator on the
1084         stack. We also now use the subclass type for the local variable so it
1085         will bypass the vtable for various virtual function calls (if the compiler
1086         was not already smart enough to figure this out).
1087
1088         * platform/graphics/cairo/FontCairo.cpp:
1089         (WebCore::FontCascade::dashesForIntersectionsWithRect):
1090         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1091         (WebCore::FontCascade::dashesForIntersectionsWithRect):
1092
1093 2016-05-13  Chris Dumez  <cdumez@apple.com>
1094
1095         Unreviewed attempt to fix the iOS build after the protector variables renaming.
1096
1097         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
1098         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willSendRequest):
1099         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
1100         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveData):
1101         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFinishLoading):
1102         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFail):
1103         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
1104         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveChallenge):
1105         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didSendBodyData):
1106         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
1107         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveDataArray):
1108
1109 2016-05-13  Zalan Bujtas  <zalan@apple.com>
1110
1111         All scrolling height/width values should be integral rounded.
1112         https://bugs.webkit.org/show_bug.cgi?id=157687
1113
1114         Reviewed by Simon Fraser.
1115
1116         Both clientHeight(Width) and scrollHeight(width) need to be explicitly integral
1117         rounded in order to ensure that scrollable content is computed properly.
1118         This will evolve into subpixel snapping once we apply subpixel arithmetics on scrolling.
1119
1120         Not testable.
1121
1122         * rendering/RenderBox.cpp:
1123         (WebCore::RenderBox::scrollWidth):
1124         * rendering/RenderLayer.cpp:
1125         (WebCore::RenderLayer::scrollTo):
1126         (WebCore::RenderLayer::horizontalScrollbarStart):
1127         (WebCore::RenderLayer::scrollWidth):
1128         (WebCore::RenderLayer::scrollHeight):
1129         (WebCore::RenderLayer::computeScrollDimensions):
1130         (WebCore::RenderLayer::updateScrollbarsAfterLayout):
1131         * rendering/RenderLayer.h:
1132
1133 2016-05-13  Chris Dumez  <cdumez@apple.com>
1134
1135         [NetworkCache] Avoid having to re-parse URLs after deserializing them
1136         https://bugs.webkit.org/show_bug.cgi?id=157660
1137
1138         Reviewed by Darin Adler.
1139
1140         Avoid having to re-parse URLs after deserializing them in the WebKit2
1141         network cache storage implementation.
1142
1143         We previously serialized URLs as Strings, which meant that we had the
1144         re-parse them upon deserialization. We now serialize all of the URL
1145         data members to avoid having to parse the String again.
1146
1147         * platform/URL.h:
1148         (WebCore::URL::encode):
1149         (WebCore::URL::decode):
1150         * platform/network/ResourceRequestBase.h:
1151         (WebCore::ResourceRequestBase::encodeWithoutPlatformData):
1152         (WebCore::ResourceRequestBase::decodeWithoutPlatformData):
1153         * platform/network/ResourceResponseBase.h:
1154         (WebCore::ResourceResponseBase::encode):
1155         (WebCore::ResourceResponseBase::decode):
1156
1157 2016-05-13  Sam Weinig  <sam@webkit.org>
1158
1159         ScriptController::processingUserGesture should propagate across postMessage boundaries
1160         <rdar://problem/26273173>
1161         https://bugs.webkit.org/show_bug.cgi?id=157686
1162
1163         Reviewed by Anders Carlsson.
1164
1165         Test: fast/dom/Window/post-message-user-action.html
1166
1167         * dom/UserGestureIndicator.h:
1168         Export processingUserGesture() for testing.
1169
1170         * page/DOMWindow.cpp:
1171         (WebCore::PostMessageTimer::PostMessageTimer):
1172         (WebCore::PostMessageTimer::event):
1173         Maintain the processingUserGesture bit through postMessage.
1174
1175         * testing/Internals.cpp:
1176         (WebCore::Internals::setResourceTimingSupport):
1177         (WebCore::Internals::isProcessingUserGesture):
1178         * testing/Internals.h:
1179         * testing/Internals.idl:
1180         Add new internals function to get the current state of the UseGestureIndicator for testing.
1181
1182 2016-05-13  Chris Dumez  <cdumez@apple.com>
1183
1184         Align window.scroll() / scrollTo() / scrollBy() with the CSSOM specification
1185         https://bugs.webkit.org/show_bug.cgi?id=157666
1186
1187         Reviewed by Darin Adler.
1188
1189         Align window.scroll() / scrollTo() / scrollBy() with Firefox and the CSSOM
1190         specification:
1191         https://drafts.csswg.org/cssom-view/#extensions-to-the-window-interface
1192
1193         In particular, the following changes were made:
1194         1. Make parameters to scroll() / scrollTo() / scrollBy() mandatory.
1195         2. Add overloads for scroll() / scrollTo() / scrollBy() that take an
1196            optional ScrollToOptions dictionary.
1197         3. Update API to use "unrestricted double" typing for x/y instead of
1198            "long". This matches the specification but it does not really change
1199            our behavior at this point because the values are still casted to
1200            int in our implementation.
1201
1202         Web-Exposed behavior changes:
1203         1. JS can now pass a dictionary to scroll() / scrollTo() / scrollBy().
1204            This a new feature that Firefox already supports (Chrome does not).
1205         2. Passing only 1 parameter to scroll() / scrollTo() / scrollBy() that
1206            is not a dictionary will now throw a TypeError. The compatibility
1207            risky should be low because Firefox and Chrome already throw in this
1208            case (Chrome has been throwing for 2 years and a half).
1209         3. Calling scrollTo() / scroll() without any parameter no longer
1210            scrolls to 0. Instead we use the current viewport's x/y which means
1211            we don't scroll at all. The new behavior matches Firefox, Chrome and
1212            IE 11. This fixes scrolling on the following Website:
1213            https://members.chosun.com/cms_subscribe/application/index.jsp
1214
1215         No new tests, extended existing testing.
1216
1217         * bindings/js/JSDOMConvert.h:
1218         (WebCore::convert):
1219         (WebCore::convertOptional):
1220         * bindings/scripts/CodeGeneratorJS.pm:
1221         (ShouldAllowNonFiniteForFloatingPointType):
1222         (GenerateConversionRuleWithLeadingComma):
1223         (GenerateDictionaryImplementationContent):
1224         (JSValueToNative):
1225         * bindings/scripts/test/JS/JSTestObj.cpp:
1226         (WebCore::convert<TestObj::Dictionary>):
1227         * bindings/scripts/test/TestObj.idl:
1228         * page/DOMWindow.cpp:
1229         (WebCore::DOMWindow::scrollBy):
1230         (WebCore::DOMWindow::scrollTo):
1231         * page/DOMWindow.h:
1232         * page/DOMWindow.idl:
1233
1234 2016-05-13  Commit Queue  <commit-queue@webkit.org>
1235
1236         Unreviewed, rolling out r200894.
1237         https://bugs.webkit.org/show_bug.cgi?id=157695
1238
1239         This change broke the iOS build (Requested by ryanhaddad on
1240         #webkit).
1241
1242         Reverted changeset:
1243
1244         "Remove unused initializer for WebEvent on iOS."
1245         https://bugs.webkit.org/show_bug.cgi?id=157689
1246         http://trac.webkit.org/changeset/200894
1247
1248 2016-05-13  Brady Eidson  <beidson@apple.com>
1249
1250         Rename all protector variables that should be called `protectedThis`
1251         https://bugs.webkit.org/show_bug.cgi?id=157610
1252
1253         Reviewed by Alex Christensen.
1254
1255         No new tests (Renaming, no behavior change).
1256         
1257         WebCore has so many instances of these protectors as well as so much variance in naming them,
1258         that I think it deserved a new style pass.
1259
1260         * Modules/fetch/FetchResponse.cpp:
1261         * Modules/geolocation/GeoNotifier.cpp:
1262         * Modules/geolocation/Geolocation.cpp:
1263         * Modules/indexeddb/IDBTransaction.cpp:
1264         * Modules/indexeddb/client/TransactionOperation.h:
1265         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1266         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
1267         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
1268         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
1269         * Modules/mediastream/UserMediaRequest.cpp:
1270         * Modules/notifications/NotificationCenter.cpp:
1271         * Modules/webaudio/AudioContext.cpp:
1272         * Modules/webdatabase/Database.cpp:
1273         * Modules/websockets/WebSocket.cpp:
1274         * Modules/websockets/WebSocketChannel.cpp:
1275         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
1276         * accessibility/AccessibilityObject.cpp:
1277         * accessibility/AccessibilityRenderObject.cpp:
1278         * bindings/gobject/GObjectEventListener.cpp:
1279         * bindings/js/JSCustomElementInterface.cpp:
1280         * bindings/js/JSCustomSQLStatementErrorCallback.cpp:
1281         * bindings/js/JSCustomXPathNSResolver.cpp:
1282         * bindings/js/JSDOMGlobalObjectTask.cpp:
1283         * bindings/js/JSDOMWindowBase.cpp:
1284         * bindings/js/JSErrorHandler.cpp:
1285         * bindings/js/JSEventListener.cpp:
1286         * bindings/js/JSMutationCallback.cpp:
1287         * bindings/js/JSNodeFilterCustom.cpp:
1288         * bindings/js/SerializedScriptValue.cpp:
1289         * bindings/scripts/CodeGeneratorJS.pm:
1290         * bindings/scripts/test/JS/JSTestCallback.cpp:
1291         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
1292         * bridge/runtime_root.cpp:
1293         * css/CSSFontSelector.cpp:
1294         * css/StyleSheetContents.cpp:
1295         * dom/CharacterData.cpp:
1296         * dom/ContainerNode.cpp:
1297         * dom/Document.cpp:
1298         * dom/EventTarget.cpp:
1299         * dom/Node.cpp:
1300         * dom/ScriptExecutionContext.cpp:
1301         * dom/ScriptedAnimationController.cpp:
1302         * dom/StringCallback.cpp:
1303         * html/HTMLEmbedElement.cpp:
1304         * html/HTMLFormControlElement.cpp:
1305         * html/HTMLFormElement.cpp:
1306         * html/HTMLInputElement.cpp:
1307         * html/HTMLLinkElement.cpp:
1308         * html/HTMLMediaElement.cpp:
1309         * html/HTMLObjectElement.cpp:
1310         * html/HTMLOptionElement.cpp:
1311         * html/HTMLScriptElement.cpp:
1312         * html/HTMLTableElement.cpp:
1313         * html/HTMLTextAreaElement.cpp:
1314         * html/HTMLTitleElement.cpp:
1315         * html/parser/HTMLDocumentParser.cpp:
1316         * html/shadow/SliderThumbElement.cpp:
1317         * html/shadow/SpinButtonElement.cpp:
1318         * inspector/InspectorFrontendClientLocal.cpp:
1319         * loader/DocumentLoader.cpp:
1320         * loader/DocumentThreadableLoader.cpp:
1321         * loader/MediaResourceLoader.cpp:
1322         * loader/NetscapePlugInStreamLoader.cpp:
1323         * loader/ResourceLoader.cpp:
1324         * loader/SubresourceLoader.cpp:
1325         * loader/cache/CachedRawResource.cpp:
1326         * loader/cf/SubresourceLoaderCF.cpp:
1327         * loader/mac/ResourceLoaderMac.mm:
1328         * page/DOMWindow.cpp:
1329         * page/DOMWindowExtension.cpp:
1330         * page/FrameView.cpp:
1331         * page/animation/AnimationBase.cpp:
1332         * page/scrolling/ThreadedScrollingTree.cpp:
1333         * platform/ScrollView.cpp:
1334         * platform/graphics/DisplayRefreshMonitor.cpp:
1335         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
1336         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
1337         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1338         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1339         * platform/mac/WidgetMac.mm:
1340         * platform/network/BlobResourceHandle.cpp:
1341         * platform/network/cf/ResourceHandleCFNet.cpp:
1342         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
1343         * platform/network/curl/CurlDownload.cpp:
1344         * platform/network/mac/ResourceHandleMac.mm:
1345         * platform/network/soup/SocketStreamHandleSoup.cpp:
1346         * platform/win/PopupMenuWin.cpp:
1347         * workers/WorkerScriptLoader.cpp:
1348         * xml/XMLHttpRequest.cpp:
1349         * xml/parser/XMLDocumentParser.cpp:
1350         * xml/parser/XMLDocumentParserLibxml2.cpp:
1351
1352 2016-05-13  Enrica Casucci  <enrica@apple.com>
1353
1354         Remove unused initializer for WebEvent on iOS.
1355         https://bugs.webkit.org/show_bug.cgi?id=157689
1356
1357         Reviewed by Anders Carlsson.
1358
1359         This is no longer used and can be removed.
1360         The logic tied to isPopupVariant has been incorporated
1361         in keyboard flags. The characterSet property is no longer needed too.
1362
1363         * platform/ios/WebEvent.h:
1364         * platform/ios/WebEvent.mm:
1365         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]):
1366         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:isPopupVariant:keyCode:isTabKey:characterSet:]): Deleted.
1367         (-[WebEvent _characterSetDescription]): Deleted.
1368         (-[WebEvent isPopupVariant]): Deleted.
1369         (-[WebEvent characterSet]): Deleted.
1370
1371 2016-05-13  Simon Fraser  <simon.fraser@apple.com>
1372
1373         cross-fade() rendering doesn't match expectation
1374         https://bugs.webkit.org/show_bug.cgi?id=157665
1375         rdar://problem/17917708
1376
1377         Reviewed by Dean Jackson.
1378
1379         Cross-fading two opaque images would result in a non-opaque result in between the endpoints,
1380         probably because r157045 caused both images to be drawn with srcOver, since drawImage()
1381         clobbers the composite operation in the context.
1382
1383         Fix by passing the composite operation to the drawImage() calls for the non-transparency layer
1384         code path.
1385
1386         Converted css3/images/cross-fade-blending.html into a ref test to test this.
1387
1388         * platform/graphics/CrossfadeGeneratedImage.cpp:
1389         (WebCore::drawCrossfadeSubimage):
1390
1391 2016-05-13  Simon Fraser  <simon.fraser@apple.com>
1392
1393         Unprefix -webkit-cross-fade()
1394         https://bugs.webkit.org/show_bug.cgi?id=157632
1395
1396         Reviewed by Darin Adler.
1397
1398         Support unprefixed cross-fade() in addition to the prefixed value when parsing,
1399         and have computed style round-trip the correct one.
1400
1401         If computed style is queried during an image transition, return an unprefixed
1402         cross-fade(). If blending cross-fade values, only return the prefixed function if
1403         both inputs are prefixed.
1404
1405         Tested by modified and existing tests.
1406
1407         * css/CSSCrossfadeValue.cpp:
1408         (WebCore::CSSCrossfadeValue::customCSSText):
1409         (WebCore::CSSCrossfadeValue::blend):
1410         * css/CSSCrossfadeValue.h:
1411         (WebCore::CSSCrossfadeValue::create):
1412         (WebCore::CSSCrossfadeValue::isPrefixed):
1413         (WebCore::CSSCrossfadeValue::CSSCrossfadeValue):
1414         * css/CSSParser.cpp:
1415         (WebCore::CSSParser::isGeneratedImageValue):
1416         (WebCore::CSSParser::parseGeneratedImage):
1417         (WebCore::CSSParser::parseCrossfade):
1418         * css/CSSParser.h:
1419
1420 2016-05-13  Yoav Weiss  <yoav@yoav.ws>
1421
1422         ResourceTiming entries for cached resources and XHR
1423         https://bugs.webkit.org/show_bug.cgi?id=157669
1424
1425         Reviewed by Alex Christensen.
1426
1427          - Moves the ResourceTiming storage and addition logic into its own class, so that it
1428            can be accessed by both CachedResourceLoader and DocumentThreadableLoader.
1429          - Using the above, adds ResourceTiming collection into DocumentThreadableLoader,
1430            in order to support ResourceTiming entries for XHR based requests.
1431          - Adds ResourceTiming entries for resources that are reused from the memory cache.
1432
1433         Test: http/tests/performance/performance-resource-timing-cached-entries.html
1434
1435         * CMakeLists.txt: Add ResourceTimingInformation.
1436         * WebCore.xcodeproj/project.pbxproj: Add ResourceTimingInformation.
1437         * loader/DocumentThreadableLoader.cpp:
1438         (WebCore::DocumentThreadableLoader::didFinishLoading): Add a call to addResourceTiming.
1439         (WebCore::DocumentThreadableLoader::loadRequest): Store the initiator information.
1440         * loader/DocumentThreadableLoader.h:
1441         * loader/ResourceTimingInformation.cpp: Added.
1442         (WebCore::ResourceTimingInformation::addResourceTiming): Moved addResourceTiming logic from CachedResourceLoader.
1443         (WebCore::ResourceTimingInformation::storeResourceTimingInitiatorInformation): Moved addResourceTiming logic from
1444         CachedResourceLoader. Removed reliance on the committingFirstRealLoad bool when storing initiator info, as I don't
1445         see why it is required, and it made no sense in the context of DocumentThreadableLoader.
1446         * loader/ResourceTimingInformation.h: Added.
1447         * loader/cache/CachedResourceLoader.cpp:
1448         (WebCore::CachedResourceLoader::requestResource): Add a ResourceTiming entry when a resource is reused from MemoryCache.
1449         (WebCore::CachedResourceLoader::revalidateResource): Use ResourceTimingInformation::storeResourceTimingInitiatorInformation.
1450         (WebCore::CachedResourceLoader::loadResource): Use ResourceTimingInformation::storeResourceTimingInitiatorInformation.
1451         (WebCore::CachedResourceLoader::loadDone): Use ResourceTimingInformation::addResourceTiming.
1452         (WebCore::CachedResourceLoader::storeResourceTimingInitiatorInformation): Deleted.
1453         * loader/cache/CachedResourceLoader.h:
1454
1455 2016-05-13  Doug Russell  <d_russell@apple.com>
1456
1457         AX: Regressions in undo/redo accessibility from Bug 153361
1458         https://bugs.webkit.org/show_bug.cgi?id=157652
1459
1460         Reviewed by Darin Adler.
1461         
1462         Use indexForVisiblePosition & visiblePositionForIndex to store selection data
1463         so that AccessibilityUndoReplacedText can build valid selection ranges and
1464         retrieve strings for AT notifications.
1465
1466         Tests: accessibility/mac/value-change/value-change-user-info-contenteditable-expected.txt:
1467                accessibility/mac/value-change/value-change-user-info-contenteditable.html:
1468                accessibility/mac/value-change/value-change-user-info-textarea-expected.txt:
1469                accessibility/mac/value-change/value-change-user-info-textarea.html:
1470                accessibility/mac/value-change/value-change-user-info-textfield-expected.txt:
1471                accessibility/mac/value-change/value-change-user-info-textfield.html:
1472
1473         * accessibility/AXObjectCache.cpp:
1474         (WebCore::AccessibilityReplacedText::AccessibilityReplacedText):
1475         (WebCore::AXObjectCache::postTextStateChangeNotification):
1476         (WebCore::AXObjectCache::postTextReplacementNotification):
1477         * editing/CompositeEditCommand.cpp:
1478         (WebCore::AccessibilityUndoReplacedText::configureRangeDeletedByReapplyWithEndingSelection):
1479         (WebCore::AccessibilityUndoReplacedText::configureRangeDeletedByReapplyWithStartingSelection):
1480         (WebCore::AccessibilityUndoReplacedText::setRangeDeletedByUnapply):
1481         (WebCore::AccessibilityUndoReplacedText::captureTextForUnapply):
1482         (WebCore::AccessibilityUndoReplacedText::captureTextForReapply):
1483         (WebCore::AccessibilityUndoReplacedText::textDeletedByUnapply):
1484         (WebCore::AccessibilityUndoReplacedText::textDeletedByReapply):
1485         (WebCore::AccessibilityUndoReplacedText::postTextStateChangeNotificationForUnapply):
1486         (WebCore::AccessibilityUndoReplacedText::postTextStateChangeNotificationForReapply):
1487         (WebCore::EditCommandComposition::EditCommandComposition):
1488         (WebCore::EditCommandComposition::unapply):
1489         (WebCore::EditCommandComposition::reapply):
1490         (WebCore::EditCommandComposition::setStartingSelection):
1491         (WebCore::EditCommandComposition::setEndingSelection):
1492         (WebCore::EditCommandComposition::setRangeDeletedByUnapply):
1493         (WebCore::AccessibilityUndoReplacedText::confgureTextToBeDeletedByUnapplyIndexesWithEditCommandEndingSelection): Deleted.
1494         (WebCore::AccessibilityUndoReplacedText::confgureTextToBeDeletedByUnapplyStartIndexWithEditCommandStartingSelection): Deleted.
1495         (WebCore::AccessibilityUndoReplacedText::setTextInsertedByUnapplyRange): Deleted.
1496         (WebCore::AccessibilityUndoReplacedText::captureTextToBeDeletedByUnapply): Deleted.
1497         (WebCore::AccessibilityUndoReplacedText::captureTextToBeDeletedByReapply): Deleted.
1498         (WebCore::AccessibilityUndoReplacedText::textInsertedByUnapply): Deleted.
1499         (WebCore::AccessibilityUndoReplacedText::textInsertedByReapply): Deleted.
1500         (WebCore::EditCommandComposition::setTextInsertedByUnapplyRange): Deleted.
1501         * editing/CompositeEditCommand.h:
1502         * editing/Editor.cpp:
1503         (WebCore::Editor::replaceSelectionWithFragment):
1504         * editing/TypingCommand.cpp:
1505         (WebCore::TypingCommand::postTextStateChangeNotificationForDeletion):
1506         (WebCore::TypingCommand::insertTextAndNotifyAccessibility):
1507         (WebCore::TypingCommand::insertLineBreakAndNotifyAccessibility):
1508         (WebCore::TypingCommand::insertParagraphSeparatorAndNotifyAccessibility):
1509         (WebCore::TypingCommand::insertParagraphSeparatorInQuotedContentAndNotifyAccessibility):
1510
1511 2016-05-13  Chris Dumez  <cdumez@apple.com>
1512
1513         Unreviewed, rolling out r200837.
1514
1515         Seems to have regressed Speedometer and JetStream on iOS
1516
1517         Reverted changeset:
1518
1519         "DOMPromise should only restrict the resolution type"
1520         https://bugs.webkit.org/show_bug.cgi?id=157307
1521         http://trac.webkit.org/changeset/200837
1522
1523 2016-05-13  Sam Weinig  <sam@webkit.org>
1524
1525         Rename WKDataDetectorTypeSpotlightSuggestion to WKDataDetectorTypeLookupSuggestion
1526         <rdar://problem/26269611>
1527
1528         Reviewed by Dan Bernstein and Enrica Casucci. 
1529
1530         * editing/cocoa/DataDetection.h:
1531         * editing/cocoa/DataDetection.mm:
1532         (WebCore::constructURLStringForResult):
1533         (WebCore::DataDetection::detectContentInRange):
1534
1535 2016-05-13  Nan Wang  <n_wang@apple.com>
1536
1537         AX: Wrong CharacterOffset from an upstream VisiblePosition
1538         https://bugs.webkit.org/show_bug.cgi?id=157644
1539
1540         Reviewed by Chris Fleizach.
1541
1542         We should adjust the text marker's CharacterOffset if its corresponding
1543         VisiblePosition has upstream affinity.
1544
1545         Test: accessibility/mac/character-offset-from-upstream-position.html
1546
1547         * accessibility/AXObjectCache.cpp:
1548         (WebCore::AXObjectCache::characterOffsetForTextMarkerData):
1549         (WebCore::AXObjectCache::traverseToOffsetInRange):
1550         (WebCore::AXObjectCache::localCaretRectForCharacterOffset):
1551
1552 2016-05-13  Beth Dakin  <bdakin@apple.com>
1553
1554         Add dyldSPI.h for linked on or after checks, and add one for link preview
1555         https://bugs.webkit.org/show_bug.cgi?id=157401
1556         -and corresponding-
1557         rdar://problem/26253396
1558
1559         Reviewed by Darin Adler.
1560
1561         This patch removes DynamicLinkerSPI.h and replaces it with 
1562         wtf/spi/darwin/dyldSPI.h
1563
1564         * WebCore.xcodeproj/project.pbxproj:
1565         * html/HTMLObjectElement.cpp:
1566         * platform/graphics/ios/FontServicesIOS.mm:
1567         * platform/spi/cocoa/DynamicLinkerSPI.h: Removed.
1568
1569 2016-05-13  Brady Eidson  <beidson@apple.com>
1570
1571         Give CrossThreadCopier a default specialization for Vectors of objects.
1572         https://bugs.webkit.org/show_bug.cgi?id=157675
1573
1574         Reviewed by Darin Adler.
1575
1576         No new tests (Refactor, no change in behavior).
1577
1578         * platform/CrossThreadCopier.cpp:
1579         (WebCore::Vector<String>>::copy): Deleted.
1580         * platform/CrossThreadCopier.h: Add a default specialization for Vector<T> where T is a type
1581           that is CrossThreadCopyable itself.
1582
1583 2016-05-13  Chris Dumez  <cdumez@apple.com>
1584
1585         Have the WorkerGlobalScope API return more references
1586         https://bugs.webkit.org/show_bug.cgi?id=157663
1587
1588         Reviewed by Alexey Proskuryakov.
1589
1590         Have the WorkerGlobalScope API return more references instead of
1591         pointers.
1592
1593         * workers/WorkerGlobalScope.cpp:
1594         (WebCore::WorkerGlobalScope::location):
1595         (WebCore::WorkerGlobalScope::navigator):
1596         * workers/WorkerGlobalScope.h:
1597         (WebCore::WorkerGlobalScope::self):
1598
1599 2016-05-13  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1600
1601         DOMPromise should only restrict the resolution type
1602         https://bugs.webkit.org/show_bug.cgi?id=157307
1603
1604         Reviewed by Darin Adler.
1605
1606         Removing from DOMPromise the rejection template parameter.
1607         Supported rejection types are integers (Exception codes) and DOM objects (DOMError typically).
1608
1609         Updated toJS and DeferredWrapper to accept Ref<>&& and RefPtr<>&&.
1610         Previously Ref<>&& were not accepted and only "const RefPtr<>&" was accepted.
1611         This in turn created an unecessary churn count when calling toJS.
1612
1613         Changes also allow in most cases to remove the need for explictly declaring the
1614         rejection/resolution type.
1615
1616         Minor refactoring of FontFaceSet promise handling to use DOMPromise in lieu of DeferredWrapper.
1617
1618         Covered by existing tests.
1619         Changes should not be visible from user scripts.
1620
1621         * Modules/fetch/FetchBody.cpp:
1622         (WebCore::FetchBody::consume):
1623         (WebCore::FetchBody::consumeText):
1624         (WebCore::blobFromArrayBuffer):
1625         (WebCore::FetchBody::loadingFailed):
1626         * Modules/fetch/FetchBody.h:
1627         (WebCore::FetchBody::formData):
1628         * Modules/fetch/FetchBodyOwner.cpp:
1629         (WebCore::FetchBodyOwner::arrayBuffer):
1630         (WebCore::FetchBodyOwner::blob):
1631         (WebCore::FetchBodyOwner::formData):
1632         (WebCore::FetchBodyOwner::json):
1633         (WebCore::FetchBodyOwner::text):
1634         * Modules/fetch/FetchResponse.cpp:
1635         (WebCore::FetchResponse::BodyLoader::didReceiveResponse):
1636         * Modules/fetch/FetchResponse.h:
1637         * Modules/mediastream/MediaDevices.h:
1638         * Modules/mediastream/PeerConnectionBackend.h:
1639         * Modules/mediastream/UserMediaRequest.cpp:
1640         (WebCore::UserMediaRequest::didCreateStream):
1641         * Modules/streams/ReadableStreamSource.h:
1642         * Modules/webaudio/AudioContext.h:
1643         * bindings/js/JSDOMBinding.h:
1644         (WebCore::toJS):
1645         (WebCore::jsPair):
1646         * bindings/js/JSDOMPromise.cpp:
1647         (WebCore::fulfillPromiseWithJSON):
1648         * bindings/js/JSDOMPromise.h:
1649         (WebCore::TypeInspector::decltype):
1650         (WebCore::TypeInspector::testIsVector):
1651         (WebCore::TypeInspector::testIsRefOrRefPtr):
1652         (WebCore::DeferredWrapper::resolve):
1653         (WebCore::DeferredWrapper::reject):
1654         (WebCore::DOMPromise::resolve):
1655         (WebCore::DOMPromise::reject):
1656         (WebCore::DeferredWrapper::resolveWithValue):
1657         (WebCore::DeferredWrapper::rejectWithValue):
1658         (WebCore::callPromiseFunction):
1659         * bindings/js/JSSubtleCryptoCustom.cpp:
1660         (WebCore::JSSubtleCrypto::importKey):
1661         (WebCore::JSSubtleCrypto::unwrapKey):
1662         * css/FontFace.h:
1663         * css/FontFaceSet.cpp:
1664         (WebCore::FontFaceSet::PendingPromise::PendingPromise):
1665         (WebCore::FontFaceSet::load):
1666         (WebCore::FontFaceSet::registerReady):
1667         * css/FontFaceSet.h:
1668         * html/HTMLMediaElement.h:
1669
1670 2016-05-12  Sergio Villar Senin  <svillar@igalia.com>
1671
1672         [css-grid] Show auto-repeat line names in ComputedStyle
1673         https://bugs.webkit.org/show_bug.cgi?id=157622
1674
1675         Reviewed by Darin Adler.
1676
1677         Add the necessary machinery to show the named lines from auto-repeat tracks in
1678         getComputedStyle(). A new class OrderedNamedLinesCollector was added to abstract the
1679         retrieval of line names no matter where they come from (explicit or auto-repeat tracks).
1680
1681         * css/CSSComputedStyleDeclaration.cpp:
1682         (WebCore::OrderedNamedLinesCollector::OrderedNamedLinesCollector):
1683         (WebCore::OrderedNamedLinesCollector::isEmpty): TRUE if we don't have named lines neither on
1684         explicit nor auto-repeat tracks.
1685         (WebCore::OrderedNamedLinesCollector::appendLines): Add the named lines found for a given
1686         index to the CSSGridLineNamesValue.
1687         (WebCore::OrderedNamedLinesCollector::collectLineNamesForIndex): Collects named lines found
1688         for a given index.
1689         (WebCore::addValuesForNamedGridLinesAtIndex): Use the collector to gather named lines.
1690         (WebCore::valueForGridTrackList): Ditto.
1691
1692 2016-05-13  Tina Liu  <iting_liu@apple.com>
1693
1694         Revert r199691.
1695         https://bugs.webkit.org/show_bug.cgi?id=157645
1696         <rdar://problem/26235373>
1697
1698         Reviewed by Darin Adler.
1699
1700         * plugins/PluginStrategy.h:
1701
1702 2016-05-12  Chris Dumez  <cdumez@apple.com>
1703
1704         Drop WorkerGlobalScope's custom GetOwnPropertySlot() implementation
1705         https://bugs.webkit.org/show_bug.cgi?id=157662
1706
1707         Reviewed by Darin Adler.
1708
1709         Drop WorkerGlobalScope's custom GetOwnPropertySlot() implementation as
1710         it is no longer needed after <http://trac.webkit.org/changeset/196678>.
1711
1712         JSC::getStaticPropertySlot() now properly checks for overrides *before*
1713         checking the static table.
1714
1715         No new tests, no web-exposed behavior change.
1716
1717         * bindings/js/JSWorkerGlobalScopeCustom.cpp:
1718         (WebCore::JSWorkerGlobalScope::getOwnPropertySlotDelegate): Deleted.
1719         * workers/WorkerGlobalScope.idl:
1720
1721 2016-05-12  Zan Dobersek  <zdobersek@igalia.com>
1722
1723         CoordinatedGraphicsLayer::syncLayerState() should set the m_layerState.contentsOpaque flag
1724         https://bugs.webkit.org/show_bug.cgi?id=157575
1725
1726         Reviewed by Darin Adler.
1727
1728         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1729         (WebCore::CoordinatedGraphicsLayer::syncLayerState): The contentsOpaque flag in the
1730         layer's CoordinatedGraphicsLayerState object should also be set to the current value
1731         of the layer. This is the only flag in the union of 9 members that's not being updated
1732         in this method.
1733
1734 2016-05-12  Zan Dobersek  <zdobersek@igalia.com>
1735
1736         [TexMap] Handle TextureMapperShaderProgram objects through references
1737         https://bugs.webkit.org/show_bug.cgi?id=157619
1738
1739         Reviewed by Antonio Gomes.
1740
1741         TextureMapper code always expects valid TextureMapperShaderProgram
1742         objects to be created, so it doesn't make sense to access these
1743         objects through raw pointers or RefPtr<>s.
1744
1745         * platform/graphics/texmap/TextureMapperGL.cpp:
1746         (WebCore::TextureMapperGL::drawBorder):
1747         (WebCore::prepareFilterProgram):
1748         (WebCore::TextureMapperGL::drawTexture):
1749         (WebCore::TextureMapperGL::drawSolidColor):
1750         (WebCore::TextureMapperGL::drawEdgeTriangles):
1751         (WebCore::TextureMapperGL::drawUnitRect):
1752         (WebCore::TextureMapperGL::draw):
1753         (WebCore::TextureMapperGL::drawTexturedQuadWithProgram):
1754         (WebCore::TextureMapperGL::drawFiltered):
1755         (WebCore::TextureMapperGL::beginClip):
1756         * platform/graphics/texmap/TextureMapperGL.h:
1757
1758 2016-05-12  Zan Dobersek  <zdobersek@igalia.com>
1759
1760         VideoSinkGStreamer: plug a GstBuffer leak in webkitVideoSinkRequestRender()
1761         https://bugs.webkit.org/show_bug.cgi?id=157617
1762
1763         Reviewed by Darin Adler.
1764
1765         Unref the newly-created GstBuffer object after creating the new GstSample
1766         that's based on it. gst_sample_new() doesn't take the ownership of it.
1767
1768         Also, don't unref the GstBuffer object that's passed in to the
1769         webkitVideoSinkRequestRender() function in case the allocation of the
1770         replacement buffer fails. We don't have any ownership over that buffer
1771         and it's not unreffed anywhere else in this function.
1772
1773         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
1774         (webkitVideoSinkRequestRender):
1775
1776 2016-05-12  Myles C. Maxfield  <mmaxfield@apple.com>
1777
1778         [Cocoa] Text shadow sometimes clipped unexpectedly
1779         https://bugs.webkit.org/show_bug.cgi?id=108929
1780
1781         Reviewed by Dean Jackson.
1782
1783         CoreGraphics can only draw one text shadow at a time. We work around that by drawing
1784         the text multiple times, one for each shadow. However, we want to make sure that the
1785         original text isn't also drawn multiple times, so we bump up the shadow offsets so
1786         the text and the shadow don't intersect, and then we clip out the original text (so
1787         only the shadow remains).
1788
1789         Unfortunately, this clipping requires knowing where the visual extent of the text is,
1790         which WebKit currently has trouble with. In particular, we often use layout extents
1791         in lieu of visual extents, which is a problem when the glyphs draw outside of their
1792         layout boxes. In this case, it causes us to think the text shadow is much smaller
1793         than it really is, so our clipping operation clips to an area which is too small.
1794
1795         A quick solution to this is to inflate the clip rect by an amount proportional to the
1796         font size, and offset the text shadow accordingly. If this amount is large enough,
1797         this bug will occur on few enough sites that it is reasonable to consider this bug
1798         fixed without the real solution of educating WebKit properly about the difference
1799         between text layout rects and text visual extent rects.
1800
1801         Test: fast/text/multiple-text-shadow-overflow-layout-rect.html
1802
1803         * rendering/TextPainter.cpp:
1804         (WebCore::ShadowApplier::ShadowApplier):
1805
1806 2016-05-12  Myles C. Maxfield  <mmaxfield@apple.com>
1807
1808         REGRESSION(r200601): Crash when using local() and unicode-range in @font-face blocks
1809         https://bugs.webkit.org/show_bug.cgi?id=157646
1810
1811         Reviewed by Geoffrey Garen.
1812
1813         I simply forgot a null check.
1814
1815         Test: fast/text/isLoading-crash-failed-font.html
1816
1817         * css/CSSSegmentedFontFace.cpp:
1818
1819 2016-05-12  Jiewen Tan  <jiewen_tan@apple.com>
1820
1821         REGRESSION (r199313): ICBC app: text field In the webview is not tappable
1822         https://bugs.webkit.org/show_bug.cgi?id=157396
1823         <rdar://problem/25931513>
1824
1825         Reviewed by David Kilzer.
1826
1827         Add a quirk for WebKit1 apps.
1828
1829         * loader/SubframeLoader.cpp:
1830         (WebCore::SubframeLoader::requestFrame):
1831         Even though the HTML spec suggests that we should navigate to about:blank
1832         for subframes/iframes, of which the src cannot be resolved to an valid URL,
1833         many existing WebKit1 apps are relying on invalid URLs to bridge their WebView
1834         codes and their native Objective-C codes. Therefore, a quirk is added to
1835         escape the URL validation for existing WebKit1 apps.
1836         (WebCore::SubframeLoader::shouldConvertInvalidURLsToBlank):
1837         * loader/SubframeLoader.h:
1838         * page/Settings.in:
1839
1840 2016-05-12  Ada Chan  <adachan@apple.com>
1841
1842         Prevent clicks in the placeholder from playing or pausing the video in a MediaDocument.
1843         https://bugs.webkit.org/show_bug.cgi?id=157625
1844
1845         Reviewed by Jer Noble.
1846
1847         * Modules/mediacontrols/mediaControlsApple.js:
1848         (Controller.prototype.createControls):
1849         (Controller.prototype.handlePlaceholderClick):
1850
1851 2016-05-12  Chris Dumez  <cdumez@apple.com>
1852
1853         Drop toJS() overload taking a PassRefPtr<> parameter
1854         https://bugs.webkit.org/show_bug.cgi?id=157627
1855
1856         Reviewed by Alex Christensen.
1857
1858         Update our implementation stop stop returning PassRefPtrs to the
1859         JS bindings and drop the toJS() overload taking a PassRefPtr<>
1860         parameter
1861
1862         * Modules/mediasource/SourceBuffer.cpp:
1863         (WebCore::SourceBuffer::buffered):
1864         * Modules/mediasource/SourceBuffer.h:
1865         * Modules/webaudio/AudioBuffer.cpp:
1866         (WebCore::AudioBuffer::getChannelData):
1867         * Modules/webaudio/AudioBuffer.h:
1868         * animation/DocumentTimeline.cpp:
1869         (WebCore::DocumentTimeline::create):
1870         * animation/DocumentTimeline.h:
1871         * bindings/js/JSDOMBinding.h:
1872         (WebCore::toJS): Deleted.
1873         (WebCore::toJSNewlyCreated): Deleted.
1874         * css/CSSPrimitiveValue.cpp:
1875         (WebCore::CSSPrimitiveValue::getRGBColorValue):
1876         * css/CSSPrimitiveValue.h:
1877         * html/HTMLMediaElement.cpp:
1878         (WebCore::HTMLMediaElement::error):
1879         * html/HTMLMediaElement.h:
1880         * html/LabelableElement.cpp:
1881         (WebCore::LabelableElement::labels):
1882         * html/LabelableElement.h:
1883         * html/canvas/WebGLGetInfo.cpp:
1884         (WebCore::WebGLGetInfo::getWebGLBuffer):
1885         (WebCore::WebGLGetInfo::getWebGLFloatArray):
1886         (WebCore::WebGLGetInfo::getWebGLFramebuffer):
1887         (WebCore::WebGLGetInfo::getWebGLIntArray):
1888         (WebCore::WebGLGetInfo::getWebGLProgram):
1889         (WebCore::WebGLGetInfo::getWebGLRenderbuffer):
1890         (WebCore::WebGLGetInfo::getWebGLTexture):
1891         (WebCore::WebGLGetInfo::getWebGLUnsignedByteArray):
1892         (WebCore::WebGLGetInfo::getWebGLUnsignedIntArray):
1893         (WebCore::WebGLGetInfo::getWebGLVertexArrayObjectOES):
1894         (WebCore::WebGLGetInfo::getWebGLVertexArrayObject):
1895         * html/canvas/WebGLGetInfo.h:
1896         * html/canvas/WebGLRenderingContextBase.cpp:
1897         (WebCore::WebGLRenderingContextBase::paintRenderingResultsToImageData):
1898         (WebCore::WebGLRenderingContextBase::createBuffer):
1899         (WebCore::WebGLRenderingContextBase::createFramebuffer):
1900         (WebCore::WebGLRenderingContextBase::createTexture):
1901         (WebCore::WebGLRenderingContextBase::createProgram):
1902         (WebCore::WebGLRenderingContextBase::createRenderbuffer):
1903         (WebCore::WebGLRenderingContextBase::createShader):
1904         (WebCore::WebGLRenderingContextBase::getActiveAttrib):
1905         (WebCore::WebGLRenderingContextBase::getActiveUniform):
1906         (WebCore::WebGLRenderingContextBase::getShaderPrecisionFormat):
1907         (WebCore::WebGLRenderingContextBase::getUniformLocation):
1908         (WebCore::WebGLRenderingContextBase::drawImageIntoBuffer):
1909         (WebCore::WebGLRenderingContextBase::videoFrameToImage):
1910         * html/canvas/WebGLRenderingContextBase.h:
1911         * html/track/TextTrackCue.cpp:
1912         (WebCore::TextTrackCue::create):
1913         * html/track/TextTrackCue.h:
1914         * html/track/VTTCue.cpp:
1915         (WebCore::VTTCueBox::create):
1916         * html/track/VTTCue.h:
1917         * page/DOMSelection.cpp:
1918         (WebCore::DOMSelection::getRangeAt):
1919         * page/DOMSelection.h:
1920         * page/DOMWindow.cpp:
1921         (WebCore::DOMWindow::matchMedia):
1922         (WebCore::DOMWindow::styleMedia):
1923         (WebCore::DOMWindow::getComputedStyle):
1924         (WebCore::DOMWindow::getMatchedCSSRules):
1925         (WebCore::DOMWindow::webkitConvertPointFromNodeToPage):
1926         (WebCore::DOMWindow::webkitConvertPointFromPageToNode):
1927         (WebCore::DOMWindow::open):
1928         * page/DOMWindow.h:
1929         * page/Location.cpp:
1930         (WebCore::Location::ancestorOrigins):
1931         * page/Location.h:
1932
1933 2016-05-12  Ryosuke Niwa  <rniwa@webkit.org>
1934
1935         Touch.prototype is undefined on iOS
1936         https://bugs.webkit.org/show_bug.cgi?id=157560
1937         <rdar://problem/26143008>
1938
1939         Reviewed by Chris Dumez.
1940
1941         Remove Touch and TouchList attributes from DOMWindow.
1942         These attributes should be exposed via generated binding code (JSDOMWindow.cpp).
1943
1944         * bindings/js/JSDOMWindowCustom.cpp:
1945         (WebCore::JSDOMWindow::touch): Deleted.
1946         (WebCore::JSDOMWindow::touchList): Deleted.
1947         * bindings/js/ios/TouchConstructors.cpp:
1948         * page/DOMWindow.idl:
1949
1950 2016-05-12  Ryosuke Niwa  <rniwa@webkit.org>
1951
1952         indexForVisiblePosition should use the root editable element as the scope
1953         https://bugs.webkit.org/show_bug.cgi?id=157611
1954
1955         Reviewed by Darin Adler.
1956
1957         Use the highest editing host instead of the document node as the scope in indexForVisiblePosition
1958         when it's called inside an editable region. This refactoring is necessary to unblock the work to support
1959         undo/redo in VoiceOver after r199030.
1960
1961         We have to workaround a bug in indexForVisiblePosition that it could return a slightly higher index than
1962         the expected value because TextIterator emits an extra new line after a block element with a large margin
1963         at the bottom. Unfortunately, fixing this requires a lot of code changes since the rest of the editing
1964         code assumes this behavior and/or happens to cancel it out with some other quirks.
1965
1966         * editing/ApplyBlockElementCommand.cpp:
1967         (WebCore::ApplyBlockElementCommand::doApply):
1968         * editing/htmlediting.cpp:
1969         (WebCore::indexForVisiblePosition):
1970
1971 2016-05-12  Zalan Bujtas  <zalan@apple.com>
1972
1973         Cleanup RenderObject::containingBlock.
1974         https://bugs.webkit.org/show_bug.cgi?id=157628
1975
1976         Reviewed by Chris Dumez.
1977
1978         No change in functionality.
1979
1980         * rendering/RenderObject.cpp:
1981         (WebCore::RenderObject::containingBlock):
1982
1983 2016-05-12  Eric Carlson  <eric.carlson@apple.com>
1984
1985         Adjust "main content" video heuristic
1986         https://bugs.webkit.org/show_bug.cgi?id=157532
1987         <rdar://problem/25840861>
1988
1989         Reviewed by Darin Adler.
1990
1991         Test: media/video-main-content-autoplay.html, plus existing tests updated.
1992
1993         * html/MediaElementSession.cpp:
1994         (WebCore::MediaElementSession::canControlControlsManager): Use isElementLargeEnoughForMainContent.
1995         (WebCore::isMainContent): Ditto.
1996         (WebCore::isElementLargeEnoughForMainContent): Check video area and aspect ratio.
1997         (WebCore::MediaElementSession::mainContentCheckTimerFired): Call result.setToNonUserAgentShadowAncestor 
1998           so it doesn't hit test the video controls in the shadow DOM.
1999
2000 2016-05-12  Fujii Hironori  <Hironori.Fujii@sony.com>
2001
2002         [curl] ASSERTION FAILED: isLocalFile() || url == m_string in fast/dom/34176.html
2003         https://bugs.webkit.org/show_bug.cgi?id=157059
2004
2005         Reviewed by Darin Adler.
2006
2007         Fix incorrect usage of URL constructor. CURLINFO_EFFECTIVE_URL
2008         does not conform to URL's ParsedURLString.  Created a new utility
2009         function to convert CURLINFO_EFFECTIVE_URL to a URL, and replaced
2010         all codes converting CURLINFO_EFFECTIVE_URL with it.
2011
2012         Test: fast/dom/34176.html
2013
2014         * platform/network/curl/CurlDownload.cpp:
2015         (WebCore::CurlDownload::didReceiveHeader): Use getCurlEffectiveURL
2016         * platform/network/curl/ResourceHandleManager.cpp:
2017         (WebCore::getCurlEffectiveURL): Added.
2018         (WebCore::handleLocalReceiveResponse): Use getCurlEffectiveURL
2019         (WebCore::getProtectionSpace): Ditto.
2020         (WebCore::headerCallback): Ditto.
2021         (WebCore::ResourceHandleManager::downloadTimerCallback): Ditto.
2022         * platform/network/curl/ResourceHandleManager.h: Add a declaration
2023         of getCurlEffectiveURL.
2024
2025 2016-05-12  Chris Dumez  <cdumez@apple.com>
2026
2027         Avoid unnecessary null checks in toJS() when the implementation returns a reference or Ref<>
2028         https://bugs.webkit.org/show_bug.cgi?id=157604
2029
2030         Reviewed by Darin Adler.
2031
2032         Avoid unnecessary null checks in toJS() when the implementation returns
2033         a C++ reference or Ref<>. To achieve this, the following changes were
2034         made:
2035         1. Have toJS() overload that takes a raw pointer call the one that
2036            takes in a C++ reference, instead of the other way around. This way,
2037            we only do the null check when passing a raw pointer in.
2038         2. Stop calling WTF::getPtr() on the value returned by the
2039            implementation because this causes us to call toJS() with a raw
2040            pointer every time.
2041         3. Add an toJS() overload in JSDOMBinding.h that takes a Ref<T> in and
2042            that calls toJS() with a C++ reference internally. This way, we
2043            bypass the null check if the implementation returns a Ref<T>.
2044
2045         Further refactoring could be done but I try to keep the size of this
2046         patch as small as possible. toJS() should probably take the ExecState
2047         and the globalObject by reference, for e.g.
2048
2049         * bindings/js/JSAnimationTimelineCustom.cpp:
2050         (WebCore::toJS):
2051         * bindings/js/JSBlobCustom.cpp:
2052         (WebCore::toJS):
2053         (WebCore::constructJSBlob): Deleted.
2054         * bindings/js/JSCSSRuleCustom.cpp:
2055         (WebCore::toJS):
2056         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
2057         (WebCore::JSCSSStyleDeclaration::getPropertyCSSValue):
2058         * bindings/js/JSCSSValueCustom.cpp:
2059         (WebCore::toJS):
2060         * bindings/js/JSCanvasRenderingContextCustom.cpp:
2061         (WebCore::toJS):
2062         * bindings/js/JSCustomElementInterface.cpp:
2063         (WebCore::JSCustomElementInterface::attributeChanged):
2064         * bindings/js/JSDOMBinding.h:
2065         (WebCore::toJS):
2066         (WebCore::toJSNewlyCreated):
2067         * bindings/js/JSDOMFormDataCustom.cpp:
2068         (WebCore::constructJSDOMFormData):
2069         * bindings/js/JSDOMMimeTypeArrayCustom.cpp:
2070         (WebCore::JSDOMMimeTypeArray::nameGetter):
2071         * bindings/js/JSDOMNamedFlowCollectionCustom.cpp:
2072         (WebCore::JSDOMNamedFlowCollection::nameGetter):
2073         * bindings/js/JSDOMPluginArrayCustom.cpp:
2074         (WebCore::JSDOMPluginArray::nameGetter):
2075         * bindings/js/JSDOMPluginCustom.cpp:
2076         (WebCore::JSDOMPlugin::nameGetter):
2077         * bindings/js/JSDOMWindowBase.cpp:
2078         (WebCore::toJS):
2079         * bindings/js/JSDOMWindowBase.h:
2080         (WebCore::toJS):
2081         * bindings/js/JSDOMWindowCustom.cpp:
2082         (WebCore::jsDOMWindowGetOwnPropertySlotNamedItemGetter):
2083         * bindings/js/JSDocumentCustom.cpp:
2084         (WebCore::toJS):
2085         (WebCore::toJSNewlyCreated):
2086         (WebCore::JSDocument::createTouchList):
2087         (WebCore::JSDocument::prepend): Deleted.
2088         * bindings/js/JSDocumentFragmentCustom.cpp:
2089         (WebCore::toJSNewlyCreated):
2090         (WebCore::toJS):
2091         * bindings/js/JSEventCustom.cpp:
2092         (WebCore::toJS):
2093         (WebCore::toJSNewlyCreated):
2094         * bindings/js/JSEventTargetCustom.cpp:
2095         (WebCore::toJS):
2096         * bindings/js/JSFileReaderCustom.cpp:
2097         (WebCore::JSFileReader::result):
2098         * bindings/js/JSHTMLAllCollectionCustom.cpp:
2099         (WebCore::namedItems):
2100         (WebCore::callHTMLAllCollection):
2101         * bindings/js/JSHTMLCanvasElementCustom.cpp:
2102         (WebCore::JSHTMLCanvasElement::getContext):
2103         * bindings/js/JSHTMLCollectionCustom.cpp:
2104         (WebCore::JSHTMLCollection::nameGetter):
2105         (WebCore::toJS):
2106         * bindings/js/JSHTMLDocumentCustom.cpp:
2107         (WebCore::JSHTMLDocument::nameGetter):
2108         * bindings/js/JSHTMLElementCustom.cpp:
2109         (WebCore::constructJSHTMLElement):
2110         (WebCore::JSHTMLElement::pushEventHandlerScope):
2111         * bindings/js/JSHTMLFormControlsCollectionCustom.cpp:
2112         (WebCore::namedItems):
2113         * bindings/js/JSHTMLFormElementCustom.cpp:
2114         (WebCore::JSHTMLFormElement::nameGetter):
2115         * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
2116         (WebCore::JSHTMLOptionsCollection::nameGetter):
2117         * bindings/js/JSIDBCursorCustom.cpp:
2118         (WebCore::JSIDBCursor::source):
2119         (WebCore::toJS):
2120         * bindings/js/JSIDBDatabaseCustom.cpp:
2121         (WebCore::JSIDBDatabase::createObjectStore):
2122         (WebCore::JSIDBDatabase::transaction):
2123         * bindings/js/JSIDBRequestCustom.cpp:
2124         (WebCore::JSIDBRequest::result):
2125         (WebCore::JSIDBRequest::source):
2126         * bindings/js/JSImageConstructor.cpp:
2127         (WebCore::JSImageConstructor::construct):
2128         * bindings/js/JSImageDataCustom.cpp:
2129         (WebCore::toJS):
2130         * bindings/js/JSLazyEventListener.cpp:
2131         (WebCore::JSLazyEventListener::initializeJSFunction):
2132         * bindings/js/JSMediaSessionCustom.cpp:
2133         (WebCore::constructJSMediaSession):
2134         * bindings/js/JSMediaStreamCapabilitiesCustom.cpp:
2135         (WebCore::toJS):
2136         * bindings/js/JSNamedNodeMapCustom.cpp:
2137         (WebCore::JSNamedNodeMap::nameGetter):
2138         * bindings/js/JSNodeCustom.cpp:
2139         (WebCore::createWrapperInline):
2140         (WebCore::toJSNewlyCreated):
2141         (WebCore::willCreatePossiblyOrphanedTreeByRemovalSlowCase):
2142         (WebCore::getOutOfLineCachedWrapper): Deleted.
2143         * bindings/js/JSNodeCustom.h:
2144         (WebCore::toJS):
2145         * bindings/js/JSNodeListCustom.cpp:
2146         (WebCore::toJSNewlyCreated):
2147         * bindings/js/JSNodeListCustom.h:
2148         (WebCore::toJS):
2149         * bindings/js/JSPerformanceEntryCustom.cpp:
2150         (WebCore::toJS):
2151         * bindings/js/JSPopStateEventCustom.cpp:
2152         (WebCore::JSPopStateEvent::state):
2153         * bindings/js/JSRTCStatsResponseCustom.cpp:
2154         (WebCore::JSRTCStatsResponse::nameGetter):
2155         * bindings/js/JSSVGPathSegCustom.cpp:
2156         (WebCore::toJS):
2157         * bindings/js/JSStyleSheetCustom.cpp:
2158         (WebCore::toJS):
2159         * bindings/js/JSTextTrackCueCustom.cpp:
2160         (WebCore::toJS):
2161         * bindings/js/JSTrackCustom.cpp:
2162         (WebCore::toJS):
2163         * bindings/js/JSTrackCustom.h:
2164         * bindings/js/JSTrackEventCustom.cpp:
2165         (WebCore::JSTrackEvent::track):
2166         * bindings/js/JSUserMessageHandlersNamespaceCustom.cpp:
2167         (WebCore::JSUserMessageHandlersNamespace::getOwnPropertySlotDelegate):
2168         * bindings/js/JSWorkerCustom.cpp:
2169         (WebCore::constructJSWorker):
2170         * bindings/js/ReadableStreamController.cpp:
2171         (WebCore::createReadableStream):
2172         * bindings/scripts/CodeGeneratorJS.pm:
2173         (GenerateHeader):
2174         (GenerateImplementation):
2175         (GenerateCallbackHeader):
2176         (GenerateCallbackImplementation):
2177         (NativeToJSValue):
2178         (GenerateConstructorDefinition):
2179         (ceilingToPowerOf2): Deleted.
2180         (ConstructorHasProperties): Deleted.
2181         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2182         (WebCore::toJSNewlyCreated):
2183         (WebCore::toJS):
2184         (WebCore::JSTestActiveDOMObject::toWrapped): Deleted.
2185         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
2186         (WebCore::toJS):
2187         (WebCore::toJSNewlyCreated):
2188         * bindings/scripts/test/JS/JSTestCallback.cpp:
2189         (WebCore::JSTestCallback::callbackWithArrayParam):
2190         (WebCore::JSTestCallback::callbackWithStringList):
2191         (WebCore::JSTestCallback::callbackRequiresThisToPass):
2192         (WebCore::toJS):
2193         * bindings/scripts/test/JS/JSTestCallback.h:
2194         (WebCore::toJS):
2195         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
2196         (WebCore::JSTestCallbackFunction::callbackWithArrayParam):
2197         (WebCore::JSTestCallbackFunction::callbackWithStringList):
2198         (WebCore::JSTestCallbackFunction::callbackRequiresThisToPass):
2199         (WebCore::toJS):
2200         * bindings/scripts/test/JS/JSTestCallbackFunction.h:
2201         (WebCore::toJS):
2202         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
2203         (WebCore::toJSNewlyCreated):
2204         (WebCore::toJS):
2205         (WebCore::JSTestClassWithJSBuiltinConstructor::toWrapped): Deleted.
2206         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
2207         (WebCore::toJS):
2208         (WebCore::toJSNewlyCreated):
2209         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
2210         (WebCore::toJSNewlyCreated):
2211         (WebCore::toJS):
2212         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::toWrapped): Deleted.
2213         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
2214         (WebCore::toJS):
2215         (WebCore::toJSNewlyCreated):
2216         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
2217         (WebCore::toJSNewlyCreated):
2218         (WebCore::toJS):
2219         (WebCore::JSTestCustomNamedGetter::toWrapped): Deleted.
2220         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
2221         (WebCore::toJS):
2222         (WebCore::toJSNewlyCreated):
2223         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2224         (WebCore::JSTestEventConstructorConstructor::construct):
2225         (WebCore::toJSNewlyCreated):
2226         (WebCore::toJS):
2227         (WebCore::JSTestEventConstructor::toWrapped): Deleted.
2228         * bindings/scripts/test/JS/JSTestEventConstructor.h:
2229         (WebCore::toJS):
2230         (WebCore::toJSNewlyCreated):
2231         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2232         (WebCore::jsTestEventTargetPrototypeFunctionItem):
2233         (WebCore::toJSNewlyCreated):
2234         (WebCore::toJS):
2235         (WebCore::JSTestEventTarget::toWrapped): Deleted.
2236         * bindings/scripts/test/JS/JSTestEventTarget.h:
2237         (WebCore::toJS):
2238         (WebCore::toJSNewlyCreated):
2239         * bindings/scripts/test/JS/JSTestException.cpp:
2240         (WebCore::toJSNewlyCreated):
2241         (WebCore::toJS):
2242         (WebCore::JSTestException::toWrapped): Deleted.
2243         * bindings/scripts/test/JS/JSTestException.h:
2244         (WebCore::toJS):
2245         (WebCore::toJSNewlyCreated):
2246         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2247         (WebCore::toJSNewlyCreated):
2248         (WebCore::toJS):
2249         (WebCore::JSTestGenerateIsReachable::toWrapped): Deleted.
2250         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
2251         (WebCore::toJS):
2252         (WebCore::toJSNewlyCreated):
2253         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2254         (WebCore::toJSNewlyCreated):
2255         (WebCore::toJS):
2256         (WebCore::JSTestGlobalObject::toWrapped): Deleted.
2257         * bindings/scripts/test/JS/JSTestGlobalObject.h:
2258         (WebCore::toJS):
2259         (WebCore::toJSNewlyCreated):
2260         * bindings/scripts/test/JS/JSTestInterface.cpp:
2261         (WebCore::JSTestInterfaceConstructor::construct):
2262         (WebCore::jsTestInterfaceImplementsNode):
2263         (WebCore::jsTestInterfaceSupplementalNode):
2264         (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
2265         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
2266         (WebCore::toJSNewlyCreated):
2267         (WebCore::toJS):
2268         (WebCore::JSTestInterface::toWrapped): Deleted.
2269         * bindings/scripts/test/JS/JSTestInterface.h:
2270         (WebCore::toJS):
2271         (WebCore::toJSNewlyCreated):
2272         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2273         (WebCore::toJSNewlyCreated):
2274         (WebCore::toJS):
2275         (WebCore::JSTestMediaQueryListListener::toWrapped): Deleted.
2276         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
2277         (WebCore::toJS):
2278         (WebCore::toJSNewlyCreated):
2279         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2280         (WebCore::JSTestNamedConstructorNamedConstructor::construct):
2281         (WebCore::toJSNewlyCreated):
2282         (WebCore::toJS):
2283         (WebCore::JSTestNamedConstructor::toWrapped): Deleted.
2284         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
2285         (WebCore::toJS):
2286         (WebCore::toJSNewlyCreated):
2287         * bindings/scripts/test/JS/JSTestNode.cpp:
2288         (WebCore::JSTestNodeConstructor::construct):
2289         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
2290         (WebCore::toJSNewlyCreated):
2291         (WebCore::toJS):
2292         (WebCore::JSTestNondeterministic::toWrapped): Deleted.
2293         * bindings/scripts/test/JS/JSTestNondeterministic.h:
2294         (WebCore::toJS):
2295         (WebCore::toJSNewlyCreated):
2296         * bindings/scripts/test/JS/JSTestObj.cpp:
2297         (WebCore::JSTestObjConstructor::construct):
2298         (WebCore::jsTestObjReadOnlyTestObjAttr):
2299         (WebCore::jsTestObjTestObjAttr):
2300         (WebCore::jsTestObjTestNullableObjAttr):
2301         (WebCore::jsTestObjLenientTestObjAttr):
2302         (WebCore::jsTestObjXMLObjAttr):
2303         (WebCore::jsTestObjTypedArrayAttr):
2304         (WebCore::jsTestObjStrictTypeCheckingAttribute):
2305         (WebCore::jsTestObjWithScriptExecutionContextAttribute):
2306         (WebCore::jsTestObjWithScriptStateAttributeRaises):
2307         (WebCore::jsTestObjWithScriptExecutionContextAttributeRaises):
2308         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttribute):
2309         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
2310         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
2311         (WebCore::jsTestObjWithScriptArgumentsAndCallStackAttribute):
2312         (WebCore::jsTestObjContentDocument):
2313         (WebCore::jsTestObjMutablePoint):
2314         (WebCore::jsTestObjImmutablePoint):
2315         (WebCore::jsTestObjPutForwardsAttribute):
2316         (WebCore::jsTestObjPutForwardsNullableAttribute):
2317         (WebCore::jsTestObjPrototypeFunctionObjMethod):
2318         (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
2319         (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
2320         (WebCore::jsTestObjPrototypeFunctionWithScriptStateObj):
2321         (WebCore::jsTestObjPrototypeFunctionWithScriptStateObjException):
2322         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException):
2323         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces):
2324         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod):
2325         (WebCore::jsTestObjPrototypeFunctionDomStringListFunction):
2326         (WebCore::jsTestObjPrototypeFunctionGetElementById):
2327         (WebCore::jsTestObjPrototypeFunctionGetSVGDocument):
2328         (WebCore::jsTestObjPrototypeFunctionMutablePointFunction):
2329         (WebCore::jsTestObjPrototypeFunctionImmutablePointFunction):
2330         (WebCore::toJSNewlyCreated):
2331         (WebCore::toJS):
2332         (WebCore::JSTestObj::toWrapped): Deleted.
2333         * bindings/scripts/test/JS/JSTestObj.h:
2334         (WebCore::toJS):
2335         (WebCore::toJSNewlyCreated):
2336         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2337         (WebCore::constructJSTestOverloadedConstructors1):
2338         (WebCore::constructJSTestOverloadedConstructors2):
2339         (WebCore::constructJSTestOverloadedConstructors3):
2340         (WebCore::constructJSTestOverloadedConstructors4):
2341         (WebCore::constructJSTestOverloadedConstructors5):
2342         (WebCore::toJSNewlyCreated):
2343         (WebCore::toJS):
2344         (WebCore::JSTestOverloadedConstructors::toWrapped): Deleted.
2345         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
2346         (WebCore::toJS):
2347         (WebCore::toJSNewlyCreated):
2348         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2349         (WebCore::jsTestOverrideBuiltinsPrototypeFunctionNamedItem):
2350         (WebCore::toJSNewlyCreated):
2351         (WebCore::toJS):
2352         (WebCore::JSTestOverrideBuiltins::toWrapped): Deleted.
2353         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
2354         (WebCore::toJS):
2355         (WebCore::toJSNewlyCreated):
2356         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2357         (WebCore::toJSNewlyCreated):
2358         (WebCore::toJS):
2359         (WebCore::JSTestSerializedScriptValueInterface::toWrapped): Deleted.
2360         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
2361         (WebCore::toJS):
2362         (WebCore::toJSNewlyCreated):
2363         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2364         (WebCore::JSTestTypedefsConstructor::construct):
2365         (WebCore::jsTestTypedefsPrototypeFunctionImmutablePointFunction):
2366         (WebCore::toJSNewlyCreated):
2367         (WebCore::toJS):
2368         (WebCore::JSTestTypedefs::toWrapped): Deleted.
2369         * bindings/scripts/test/JS/JSTestTypedefs.h:
2370         (WebCore::toJS):
2371         (WebCore::toJSNewlyCreated):
2372         * bindings/scripts/test/JS/JSattribute.cpp:
2373         (WebCore::toJSNewlyCreated):
2374         (WebCore::toJS):
2375         (WebCore::JSattribute::toWrapped): Deleted.
2376         * bindings/scripts/test/JS/JSattribute.h:
2377         (WebCore::toJS):
2378         (WebCore::toJSNewlyCreated):
2379         * bindings/scripts/test/JS/JSreadonly.cpp:
2380         (WebCore::toJSNewlyCreated):
2381         (WebCore::toJS):
2382         (WebCore::JSreadonly::toWrapped): Deleted.
2383         * bindings/scripts/test/JS/JSreadonly.h:
2384         (WebCore::toJS):
2385         (WebCore::toJSNewlyCreated):
2386         * html/HTMLMediaElement.cpp:
2387         (WebCore::controllerJSValue):
2388         (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
2389
2390 2016-05-12  Konstantin Tokarev  <annulen@yandex.ru>
2391
2392         Use reference instead of pointer in FrameLoaderClient::saveViewStateToItem.
2393         https://bugs.webkit.org/show_bug.cgi?id=157624
2394
2395         Reviewed by Darin Adler.
2396
2397         No new tests needed.
2398
2399         * loader/EmptyClients.h:
2400         * loader/FrameLoaderClient.h:
2401         * loader/HistoryController.cpp:
2402         (WebCore::HistoryController::saveScrollPositionAndViewStateToItem):
2403
2404 2016-05-12  Antoine Quint  <graouts@apple.com>
2405
2406         Correctly handle prefixed and unprefixed variants in CSSStyleDeclaration
2407         https://bugs.webkit.org/show_bug.cgi?id=157569
2408         <rdar://problem/26223115>
2409
2410         Reviewed by Dean Jackson.
2411
2412         Tests: fast/css/prefixed-unprefixed-variant-style-declaration.html
2413                fast/css/shorthand-omitted-initial-value-overrides-shorthand.html
2414
2415         We essentially revert the code added with https://bugs.webkit.org/show_bug.cgi?id=110011
2416         which duplicated properties that had a prefixed or unprefixed variant. What we do now is
2417         to return the value of the prefixed or unprefixed variant through a CSSStyleDeclaration,
2418         but only return the properties specified by the author when reading from the `cssText` property.
2419
2420         * css/CSSParser.cpp:
2421         (WebCore::CSSParser::parseValue):
2422         (WebCore::CSSParser::parseTransitionShorthand):
2423         (WebCore::CSSParser::addPropertyWithPrefixingVariant): Deleted.
2424         * css/CSSParser.h:
2425         Remove all code adding duplicated properties for the prefixed or unprefixed
2426         variant of properties that exist in both forms.
2427
2428         * css/CSSPropertyNames.in:
2429         Treat transition properties as we do animation properties. 
2430
2431         * css/PropertySetCSSStyleDeclaration.cpp:
2432         (WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValue):
2433         (WebCore::PropertySetCSSStyleDeclaration::getPropertyValue):
2434         Make these two methods call into the matching getXXXInternal() variant instead
2435         of going through the property set directly so that they would correctly pick up
2436         on the prefixed or unprefixed variant should there be one when the specified property
2437         is not specified directly.
2438
2439         (WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValueInternal):
2440         (WebCore::PropertySetCSSStyleDeclaration::getPropertyValueInternal):
2441         We used to simply return the value for the given property from the property set, which
2442         we still do but now also check if there is prefixed or unprefixed variant for the provided
2443         property in case it was absent.
2444
2445         * css/StyleProperties.cpp:
2446         (WebCore::MutableStyleProperties::removeShorthandProperty):
2447         Remove all code adding duplicated properties for the prefixed or unprefixed
2448         variant of properties that exist in both forms.
2449
2450         (WebCore::StyleProperties::asText):
2451         Drive-by fix to also handle the animation-play-state and -webkit-animation-play-state properties
2452         when serializing to the shorthand.
2453
2454         (WebCore::MutableStyleProperties::removeProperty): Deleted.
2455         (WebCore::MutableStyleProperties::removePrefixedOrUnprefixedProperty): Deleted.
2456         (WebCore::MutableStyleProperties::setProperty): Deleted.
2457         (WebCore::getIndexInShorthandVectorForPrefixingVariant): Deleted.
2458         (WebCore::MutableStyleProperties::appendPrefixingVariantProperty): Deleted.
2459         (WebCore::MutableStyleProperties::setPrefixingVariantProperty): Deleted.
2460         * css/StyleProperties.h:
2461         Remove all code adding duplicated properties for the prefixed or unprefixed
2462         variant of properties that exist in both forms.
2463
2464 2016-05-12  Commit Queue  <commit-queue@webkit.org>
2465
2466         Unreviewed, rolling out r200766.
2467         https://bugs.webkit.org/show_bug.cgi?id=157623
2468
2469         it is breaking yosemite builds (Requested by youenn on
2470         #webkit).
2471
2472         Reverted changeset:
2473
2474         "DOMPromise should only restrict the resolution type"
2475         https://bugs.webkit.org/show_bug.cgi?id=157307
2476         http://trac.webkit.org/changeset/200766
2477
2478 2016-05-12  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2479
2480         DOMPromise should only restrict the resolution type
2481         https://bugs.webkit.org/show_bug.cgi?id=157307
2482
2483         Reviewed by Darin Adler.
2484
2485         Removing from DOMPromise the rejection template parameter.
2486         Supported rejection types are integers (Exception codes) and DOM objects (DOMError typically).
2487
2488         Updated toJS and DeferredWrapper to accept Ref<>&& and RefPtr<>&&.
2489         Previously Ref<>&& were not accepted and only "const RefPtr<>&" was accepted.
2490         This in turn created an unecessary churn count when calling toJS.
2491
2492         Changes also allow in most cases to remove the need for explictly declaring the
2493         rejection/resolution type.
2494
2495         Minor refactoring of FontFaceSet promise handling to use DOMPromise in lieu of DeferredWrapper.
2496
2497         Covered by existing tests.
2498         Changes should not be visible from user scripts.
2499
2500         * Modules/fetch/FetchBody.cpp:
2501         (WebCore::FetchBody::consume):
2502         (WebCore::FetchBody::consumeText):
2503         (WebCore::blobFromArrayBuffer):
2504         (WebCore::FetchBody::loadingFailed):
2505         * Modules/fetch/FetchBody.h:
2506         (WebCore::FetchBody::formData):
2507         * Modules/fetch/FetchBodyOwner.cpp:
2508         (WebCore::FetchBodyOwner::arrayBuffer):
2509         (WebCore::FetchBodyOwner::blob):
2510         (WebCore::FetchBodyOwner::formData):
2511         (WebCore::FetchBodyOwner::json):
2512         (WebCore::FetchBodyOwner::text):
2513         * Modules/fetch/FetchResponse.cpp:
2514         (WebCore::FetchResponse::BodyLoader::didReceiveResponse):
2515         * Modules/fetch/FetchResponse.h:
2516         * Modules/mediastream/MediaDevices.h:
2517         * Modules/mediastream/PeerConnectionBackend.h:
2518         * Modules/mediastream/UserMediaRequest.cpp:
2519         (WebCore::UserMediaRequest::didCreateStream):
2520         * Modules/streams/ReadableStreamSource.h:
2521         * Modules/webaudio/AudioContext.h:
2522         * bindings/js/JSDOMBinding.h:
2523         (WebCore::toJS):
2524         (WebCore::jsPair):
2525         * bindings/js/JSDOMPromise.cpp:
2526         (WebCore::fulfillPromiseWithJSON):
2527         * bindings/js/JSDOMPromise.h:
2528         (WebCore::TypeInspector::decltype):
2529         (WebCore::TypeInspector::testIsVector):
2530         (WebCore::TypeInspector::testIsRefOrRefPtr):
2531         (WebCore::DeferredWrapper::resolve):
2532         (WebCore::DeferredWrapper::reject):
2533         (WebCore::DOMPromise::resolve):
2534         (WebCore::DOMPromise::reject):
2535         (WebCore::DeferredWrapper::resolveWithValue):
2536         (WebCore::DeferredWrapper::rejectWithValue):
2537         (WebCore::callPromiseFunction):
2538         * bindings/js/JSSubtleCryptoCustom.cpp:
2539         (WebCore::JSSubtleCrypto::importKey):
2540         (WebCore::JSSubtleCrypto::unwrapKey):
2541         * css/FontFace.h:
2542         * css/FontFaceSet.cpp:
2543         (WebCore::FontFaceSet::PendingPromise::PendingPromise):
2544         (WebCore::FontFaceSet::load):
2545         (WebCore::FontFaceSet::registerReady):
2546         * css/FontFaceSet.h:
2547         * html/HTMLMediaElement.h:
2548
2549 2016-05-12  Manuel Rego Casasnovas  <rego@igalia.com>
2550
2551         [css-grid] Incorrect parsing when using just 'span" as grid-line value
2552         https://bugs.webkit.org/show_bug.cgi?id=157615
2553
2554         Reviewed by Sergio Villar Senin.
2555
2556         The spec is pretty clear about this:
2557         https://drafts.csswg.org/css-grid/#typedef-grid-row-start-grid-line
2558
2559         The possible options when using "span" to reference a grid line are:
2560           [ span && [ <integer> || <custom-ident> ] ]
2561
2562         Thus, "span" keyword alone produces an invalid declaration.
2563
2564         * css/CSSParser.cpp:
2565         (WebCore::CSSParser::parseGridPosition):
2566
2567 2016-05-12  Csaba Osztrogonác  <ossy@webkit.org>
2568
2569         Remove ENABLE(ES6_ARROWFUNCTION_SYNTAX) guards
2570         https://bugs.webkit.org/show_bug.cgi?id=157564
2571
2572         Reviewed by Darin Adler.
2573
2574         * Configurations/FeatureDefines.xcconfig:
2575
2576 2016-05-11  Ryosuke Niwa  <rniwa@webkit.org>
2577
2578         TextIteratorStopsOnFormControls is never used
2579         https://bugs.webkit.org/show_bug.cgi?id=157609
2580
2581         Reviewed by Alex Christensen.
2582
2583         Removed SurroundingText.cpp and TextIteratorStopsOnFormControls from TextIterator as they're no longer used.
2584
2585         * editing/SurroundingText.cpp: Removed.
2586         * editing/TextIterator.cpp:
2587         (WebCore::TextIterator::advance):
2588         (WebCore::TextIterator::exitNode):
2589         (WebCore::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
2590         (WebCore::SimplifiedBackwardsTextIterator::advance):
2591         (WebCore::characterSubrange):
2592         (WebCore::BackwardsCharacterIterator::BackwardsCharacterIterator):
2593         * editing/TextIterator.h:
2594         (WebCore::SimplifiedBackwardsTextIterator::atEnd):
2595         * editing/TextIteratorBehavior.h:
2596
2597 2016-05-11  Chris Dumez  <cdumez@apple.com>
2598
2599         Kill Node::ancestorElement()
2600         https://bugs.webkit.org/show_bug.cgi?id=157599
2601
2602         Reviewed by Darin Adler.
2603
2604         Kill Node::ancestorElement() and use Node::parentElement() instead. If
2605         our parent is not an Element then none of our ancestors will be.
2606
2607         * dom/Node.cpp:
2608         (WebCore::Node::isDefaultNamespace):
2609         (WebCore::Node::lookupPrefix):
2610         (WebCore::Node::lookupNamespaceURI):
2611         (WebCore::Node::lookupNamespacePrefix):
2612         (WebCore::Node::convertToPage):
2613         (WebCore::Node::convertFromPage):
2614         (WebCore::Node::ancestorElement): Deleted.
2615         * dom/Node.h:
2616
2617 2016-05-11  Zalan Bujtas  <zalan@apple.com>
2618
2619         Absolute positioned element is not placed properly when parent becomes the containing block.
2620         https://bugs.webkit.org/show_bug.cgi?id=157455
2621         <rdar://problem/26212568>
2622
2623         Reviewed by Simon Fraser.
2624
2625         When a container becomes a containing block, we need to check if there are any positioned boxes in its subtree
2626         in order to "re-parent" them. It basically means that we remove them from RenderBlock::positionedDescendants map
2627         and they'll get re-inserted during the next layout correctly.
2628         This patch fixes the case when a container becomes the containing block by setting the transform property and its positioned
2629         child gets misplaced.  
2630
2631         Test: fast/block/containing-block-changes.html
2632
2633         * rendering/RenderBlock.cpp:
2634         (WebCore::RenderBlock::removePositionedObjectsIfNeeded):
2635         (WebCore::RenderBlock::styleWillChange):
2636         * rendering/RenderBlock.h:
2637
2638 2016-05-11  Commit Queue  <commit-queue@webkit.org>
2639
2640         Unreviewed, rolling out r200700, r200703, and r200713.
2641         https://bugs.webkit.org/show_bug.cgi?id=157601
2642
2643         Broke iOS builds (Requested by rniwa on #webkit).
2644
2645         Reverted changesets:
2646
2647         "Touch.prototype is undefined on iOS"
2648         https://bugs.webkit.org/show_bug.cgi?id=157560
2649         http://trac.webkit.org/changeset/200700
2650
2651         "iOS build fix attempt after r200700."
2652         http://trac.webkit.org/changeset/200703
2653
2654         "iOS clean build fix after r200700."
2655         http://trac.webkit.org/changeset/200713
2656
2657 2016-05-11  Ryosuke Niwa  <rniwa@webkit.org>
2658
2659         iOS clean build fix after r200700.
2660
2661         * bindings/js/JSDOMWindowCustom.cpp:
2662
2663 2016-05-11  Ryosuke Niwa  <rniwa@webkit.org>
2664
2665         Moving focus by tab could erroneously focus a non-focusable shadow host
2666         https://bugs.webkit.org/show_bug.cgi?id=157585
2667
2668         Reviewed by Antti Koivisto.
2669
2670         The bug was caused by findFocusableElementDescendingDownIntoFrameDocument erroneously returning a shadow host
2671         that contains a focusable element instead of traversing it through to find a focusable element within. Fixed
2672         the bug calling findFocusableElementWithinScope which traverses shadow trees to find a focusable element unlike
2673         findFocusableElementOrScopeOwner which returns a focusable element or a shadow host.
2674
2675         Also done some refactoring for clarity.
2676
2677         Test: fast/shadow-dom/focus-on-iframe.html
2678
2679         * page/FocusController.cpp:
2680         (WebCore::FocusController::findFocusableElementDescendingDownIntoFrameDocument): See above.
2681
2682         (WebCore::FocusController::findFocusableElementAcrossFocusScope): Declare outerScope as late as possible.
2683         (WebCore::nextElementWithGreaterTabIndex): Merged if conditions for clarity.
2684         (WebCore::previousElementWithLowerTabIndex): Removed the check for isNonFocusableShadowHost since
2685         isFocusableOrHasShadowTreeWithoutCustomFocusLogic returns true whenever isNonFocusableShadowHost returns true.
2686
2687 2016-05-11  Ryan Haddad  <ryanhaddad@apple.com>
2688
2689         Updating bindings tests results after r200699
2690
2691         Unreviewed test gardening.
2692
2693         * bindings/scripts/test/JS/JSTestObj.cpp:
2694         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod):
2695
2696 2016-05-11  Chris Dumez  <cdumez@apple.com>
2697
2698         Unreviewed attempt to fix the Windows build after r200699.
2699
2700         * bindings/js/JSIDBObjectStoreCustom.cpp:
2701
2702 2016-05-11  Ryosuke Niwa  <rniwa@webkit.org>
2703
2704         iOS build fix attempt after r200700.
2705
2706         * bindings/js/ios/TouchConstructors.cpp:
2707
2708 2016-05-10  Ryosuke Niwa  <rniwa@webkit.org>
2709
2710         Touch.prototype is undefined on iOS
2711         https://bugs.webkit.org/show_bug.cgi?id=157560
2712         <rdar://problem/26143008>
2713
2714         Reviewed by Chris Dumez.
2715
2716         Remove Touch and TouchList attributes from DOMWindow.
2717         These attributes should be exposed via generated binding code (JSDOMWindow.cpp).
2718
2719         * bindings/js/JSDOMWindowCustom.cpp:
2720         (WebCore::JSDOMWindow::touch): Deleted.
2721         (WebCore::JSDOMWindow::touchList): Deleted.
2722         * page/DOMWindow.idl:
2723
2724 2016-05-11  Darin Adler  <darin@apple.com>
2725
2726         Change IDBObjectStore.createIndex to take an IDL dictionary
2727         https://bugs.webkit.org/show_bug.cgi?id=157520
2728
2729         Reviewed by Chris Dumez.
2730
2731         * Modules/indexeddb/IDBDatabase.cpp:
2732         (WebCore::IDBDatabase::createObjectStore): Use IDBKeyPath::Type instead of
2733         IndexedDB::KeyPathType.
2734         * Modules/indexeddb/IDBKeyPath.cpp:
2735         (WebCore::IDBKeyPath::IDBKeyPath): Ditto.
2736         (WebCore::IDBKeyPath::isValid): Ditto.
2737         (WebCore::IDBKeyPath::operator==): Ditto.
2738         (WebCore::IDBKeyPath::encode): Ditto.
2739         (WebCore::IDBKeyPath::decode): Ditto.
2740
2741         * Modules/indexeddb/IDBKeyPath.h: Use pragma once. Make constructors non-explicit so
2742         we can just pass a string or vector and have it turn into an IDBKeyPath. Added an enum
2743         class named Type here and use it instead of IndexedDB::KeyPathType.
2744
2745         * Modules/indexeddb/IDBObjectStore.cpp:
2746         (WebCore::IDBObjectStore::openCursor): Remove unneeded local variable.
2747         (WebCore::IDBObjectStore::get): Ditto.
2748         (WebCore::IDBObjectStore::doDelete): Ditto.
2749         (WebCore::IDBObjectStore::createIndex): Changed argument type to take IndexParameters
2750         instead of two seaparate booleans. Also updated to use IDBKeyPath::Type.
2751
2752         * Modules/indexeddb/IDBObjectStore.h: Removed include of IndexedDB, using a forward
2753         decalration instead. Marked the class final. Added an IndexParameters struct and used
2754         it for the argument to createIndex.
2755
2756         * Modules/indexeddb/IDBObjectStore.idl: Stopped using Custom for put, add, and
2757         createIndex functions. Stopped using Dictionary for createIndex, using IDBIndexParameters
2758         instead as in the specification. Added IDBIndexParameters dictionary definition.
2759
2760         * Modules/indexeddb/IndexedDB.h: Use pragma once. Removed KeyPathType.
2761
2762         * bindings/js/IDBBindingUtilities.cpp:
2763         (WebCore::injectIDBKeyIntoScriptValue): Use IDBKeyPath::Type instead of
2764         IndexedDB::KeyPathType.
2765         (WebCore::maybeCreateIDBKeyFromScriptValueAndKeyPath): Ditto.
2766         (WebCore::canInjectIDBKeyIntoScriptValue): Ditto.
2767         (WebCore::createKeyPathArray): Ditto.
2768         (WebCore::toJS): Ditto.
2769         * bindings/js/JSIDBObjectStoreCustom.cpp:
2770         (WebCore::putOrAdd): Deleted.
2771         (WebCore::JSIDBObjectStore::putFunction): Deleted.
2772         (WebCore::JSIDBObjectStore::add): Deleted.
2773         (WebCore::JSIDBObjectStore::createIndex): Deleted.
2774
2775         * bindings/scripts/CodeGeneratorJS.pm:
2776         (GenerateParametersCheckExpression): Fixed code that generates a type check for
2777         wrappers to only check types is knows how to check: wrappers and arrays, including
2778         typed arrays. This prevents it from trying to check dictionaries.
2779
2780         * inspector/InspectorIndexedDBAgent.cpp: Use IDBKeyPath::Type instead of
2781         IndexedDB::KeyPathType.
2782
2783 2016-05-11  Brady Eidson  <beidson@apple.com>
2784
2785         Modern IDB: WebWorker support.
2786         https://bugs.webkit.org/show_bug.cgi?id=149953
2787
2788         Reviewed by Alex Christensen.
2789
2790         No new tests (Covered by changes to existing tests).
2791
2792         * bindings/generic/RuntimeEnabledFeatures.cpp:
2793         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
2794
2795 2016-05-11  Chris Dumez  <cdumez@apple.com>
2796
2797         Update Node::appendChild() / replaceChild() / removeChild() / insertBefore() to take references instead of pointers
2798         https://bugs.webkit.org/show_bug.cgi?id=157556
2799
2800         Reviewed by Darin Adler.
2801
2802         Update Node::appendChild() / replaceChild() / removeChild() / insertBefore()
2803         to take references instead of pointers. Do the parameter null checks in the
2804         bindings instead of doing it in the implementation on Node.
2805
2806         Also update the ContainerNode::appendChild() / replaceChild() /
2807         insertBefore() to take C++ references instead of Ref<>&& to avoid
2808         unnecessarily causing ref counting churns at some call sites (including
2809         in the bindings since they are a raw pointer to the nodes). The
2810         implementation on ContainerNode was not actually using WTFMove() on the
2811         Ref<>&& anyway.
2812
2813         * Modules/plugins/YouTubePluginReplacement.cpp:
2814         (WebCore::YouTubePluginReplacement::installReplacement):
2815         * bindings/js/JSNodeCustom.cpp:
2816         (WebCore::JSNode::insertBefore):
2817         (WebCore::JSNode::replaceChild):
2818         (WebCore::JSNode::removeChild):
2819         (WebCore::JSNode::appendChild):
2820         * dom/ContainerNode.cpp:
2821         (WebCore::ContainerNode::insertBefore):
2822         (WebCore::ContainerNode::parserInsertBefore):
2823         (WebCore::ContainerNode::replaceChild):
2824         (WebCore::ContainerNode::appendChild):
2825         (WebCore::ContainerNode::parserAppendChild):
2826         (WebCore::ContainerNode::cloneChildNodes):
2827         (WebCore::ContainerNode::append):
2828         (WebCore::ContainerNode::prepend):
2829         * dom/ContainerNode.h:
2830         * dom/DOMImplementation.cpp:
2831         (WebCore::DOMImplementation::createDocument):
2832         (WebCore::DOMImplementation::createHTMLDocument):
2833         * dom/Document.cpp:
2834         (WebCore::Document::setBodyOrFrameset):
2835         * dom/Element.cpp:
2836         (WebCore::Element::setOuterHTML):
2837         * dom/Node.cpp:
2838         (WebCore::Node::insertBefore):
2839         (WebCore::Node::replaceChild):
2840         (WebCore::Node::removeChild):
2841         (WebCore::Node::appendChild):
2842         (WebCore::Node::before):
2843         (WebCore::Node::after):
2844         (WebCore::Node::replaceWith):
2845         (WebCore::nodeSetPreTransformedFromNodeOrStringVector): Deleted.
2846         (WebCore::Node::normalize): Deleted.
2847         * dom/Node.h:
2848         * dom/Node.idl:
2849         * dom/NodeOrString.cpp:
2850         (WebCore::convertNodesOrStringsIntoNode):
2851         * dom/Range.cpp:
2852         (WebCore::Range::processContents):
2853         (WebCore::Range::processContentsBetweenOffsets):
2854         (WebCore::Range::processNodes):
2855         (WebCore::Range::processAncestorsAndTheirSiblings):
2856         (WebCore::Range::insertNode):
2857         (WebCore::Range::surroundContents):
2858         * dom/Range.h:
2859         * dom/Text.cpp:
2860         (WebCore::Text::splitText):
2861         * editing/AppendNodeCommand.cpp:
2862         (WebCore::AppendNodeCommand::doApply):
2863         * editing/Editor.cpp:
2864         (WebCore::Editor::setTextAsChildOfElement):
2865         * editing/EditorCommand.cpp:
2866         (WebCore::executeInsertNode):
2867         * editing/MergeIdenticalElementsCommand.cpp:
2868         (WebCore::MergeIdenticalElementsCommand::doApply):
2869         (WebCore::MergeIdenticalElementsCommand::doUnapply):
2870         * editing/RemoveNodeCommand.cpp:
2871         (WebCore::RemoveNodeCommand::doUnapply):
2872         * editing/ReplaceNodeWithSpanCommand.cpp:
2873         (WebCore::swapInNodePreservingAttributesAndChildren):
2874         * editing/ReplaceSelectionCommand.cpp:
2875         (WebCore::ReplacementFragment::insertFragmentForTestRendering):
2876         * editing/SplitElementCommand.cpp:
2877         (WebCore::SplitElementCommand::executeApply):
2878         (WebCore::SplitElementCommand::doUnapply):
2879         * editing/WrapContentsInDummySpanCommand.cpp:
2880         (WebCore::WrapContentsInDummySpanCommand::executeApply):
2881         (WebCore::WrapContentsInDummySpanCommand::doUnapply):
2882         * editing/cocoa/EditorCocoa.mm:
2883         (WebCore::Editor::styleForSelectionStart):
2884         * editing/htmlediting.cpp:
2885         (WebCore::createTabSpanElement):
2886         * editing/ios/EditorIOS.mm:
2887         (WebCore::Editor::WebContentReader::readURL):
2888         (WebCore::Editor::createFragmentForImageResourceAndAddResource):
2889         * editing/mac/EditorMac.mm:
2890         (WebCore::Editor::WebContentReader::readFilenames):
2891         (WebCore::Editor::WebContentReader::readURL):
2892         (WebCore::Editor::createFragmentForImageResourceAndAddResource):
2893         * editing/markup.cpp:
2894         (WebCore::fillContainerFromString):
2895         (WebCore::createFragmentFromText):
2896         (WebCore::replaceChildrenWithFragment):
2897         (WebCore::replaceChildrenWithText):
2898         * html/BaseChooserOnlyDateAndTimeInputType.cpp:
2899         (WebCore::BaseChooserOnlyDateAndTimeInputType::createShadowSubtree):
2900         * html/ColorInputType.cpp:
2901         (WebCore::ColorInputType::createShadowSubtree):
2902         * html/FTPDirectoryDocument.cpp:
2903         (WebCore::FTPDirectoryDocumentParser::appendEntry):
2904         (WebCore::FTPDirectoryDocumentParser::createTDForFilename):
2905         (WebCore::FTPDirectoryDocumentParser::createBasicDocument):
2906         * html/HTMLDetailsElement.cpp:
2907         (WebCore::HTMLDetailsElement::didAddUserAgentShadowRoot):
2908         * html/HTMLElement.cpp:
2909         (WebCore::HTMLElement::setOuterText):
2910         (WebCore::HTMLElement::insertAdjacent):
2911         * html/HTMLImageElement.cpp:
2912         (WebCore::HTMLImageElement::tryCreateImageControls):
2913         * html/HTMLKeygenElement.cpp:
2914         (WebCore::HTMLKeygenElement::HTMLKeygenElement):
2915         * html/HTMLMeterElement.cpp:
2916         (WebCore::HTMLMeterElement::didAddUserAgentShadowRoot):
2917         * html/HTMLOptionElement.cpp:
2918         (WebCore::HTMLOptionElement::createForJSConstructor):
2919         * html/HTMLProgressElement.cpp:
2920         (WebCore::HTMLProgressElement::didAddUserAgentShadowRoot):
2921         * html/HTMLTableElement.cpp:
2922         (WebCore::HTMLTableElement::createTBody):
2923         (WebCore::HTMLTableElement::insertRow):
2924         * html/HTMLTableRowElement.cpp:
2925         (WebCore::HTMLTableRowElement::insertCell):
2926         * html/ImageDocument.cpp:
2927         (WebCore::ImageDocument::createDocumentStructure):
2928         * html/MediaDocument.cpp:
2929         (WebCore::MediaDocumentParser::createDocumentStructure):
2930         * html/PluginDocument.cpp:
2931         (WebCore::PluginDocumentParser::createDocumentStructure):
2932         * html/RangeInputType.cpp:
2933         (WebCore::RangeInputType::createShadowSubtree):
2934         * html/SearchInputType.cpp:
2935         (WebCore::SearchInputType::createShadowSubtree):
2936         * html/ValidationMessage.cpp:
2937         (WebCore::ValidationMessage::buildBubbleTree):
2938         * html/shadow/MediaControlElements.cpp:
2939         (WebCore::MediaControlClosedCaptionsTrackListElement::rebuildTrackListMenu):
2940         * html/shadow/MediaControls.cpp:
2941         (WebCore::MediaControls::createTextTrackDisplay):
2942         * html/shadow/MediaControlsApple.cpp:
2943         (WebCore::MediaControlsApple::tryCreateControls):
2944         * html/shadow/mac/ImageControlsRootElementMac.cpp:
2945         (WebCore::ImageControlsRootElement::tryCreate):
2946         * html/track/VTTCue.cpp:
2947         (WebCore::VTTCue::updateDisplayTree):
2948         * html/track/WebVTTParser.cpp:
2949         (WebCore::WebVTTTreeBuilder::constructTreeFromToken):
2950         * inspector/DOMEditor.cpp:
2951         (WebCore::DOMEditor::RemoveChildAction::RemoveChildAction):
2952         (WebCore::DOMEditor::InsertBeforeAction::InsertBeforeAction):
2953         (WebCore::DOMEditor::ReplaceChildNodeAction::ReplaceChildNodeAction):
2954         (WebCore::DOMEditor::insertBefore):
2955         (WebCore::DOMEditor::removeChild):
2956         (WebCore::DOMEditor::replaceChild):
2957         * inspector/DOMEditor.h:
2958         * inspector/DOMPatchSupport.cpp:
2959         (WebCore::DOMPatchSupport::patchNode):
2960         (WebCore::DOMPatchSupport::innerPatchNode):
2961         (WebCore::DOMPatchSupport::innerPatchChildren):
2962         (WebCore::DOMPatchSupport::insertBeforeAndMarkAsUsed):
2963         (WebCore::DOMPatchSupport::removeChildAndMoveToNew):
2964         * inspector/DOMPatchSupport.h:
2965         * inspector/InspectorCSSAgent.cpp:
2966         (WebCore::InspectorCSSAgent::createInspectorStyleSheetForDocument):
2967         * inspector/InspectorDOMAgent.cpp:
2968         (WebCore::InspectorDOMAgent::removeNode):
2969         (WebCore::InspectorDOMAgent::setNodeName):
2970         (WebCore::InspectorDOMAgent::moveTo):
2971         * page/DragController.cpp:
2972         (WebCore::documentFragmentFromDragData):
2973         * page/ios/FrameIOS.mm:
2974         (WebCore::Frame::initWithSimpleHTMLDocument):
2975         * svg/SVGUseElement.cpp:
2976         (WebCore::SVGUseElement::cloneTarget):
2977         (WebCore::SVGUseElement::expandUseElementsInShadowTree):
2978         (WebCore::SVGUseElement::expandSymbolElementsInShadowTree):
2979         * xml/XMLErrors.cpp:
2980         (WebCore::createXHTMLParserErrorHeader):
2981         (WebCore::XMLErrors::insertErrorMessageBlock):
2982         * xml/XMLTreeViewer.cpp:
2983         (WebCore::XMLTreeViewer::transformDocumentToTreeView):
2984         * xml/parser/XMLDocumentParserLibxml2.cpp:
2985         (WebCore::XMLDocumentParser::startElementNs):
2986         (WebCore::XMLDocumentParser::processingInstruction):
2987         (WebCore::XMLDocumentParser::cdataBlock):
2988         (WebCore::XMLDocumentParser::comment):
2989
2990 2016-05-11  Brady Eidson  <beidson@apple.com>
2991
2992         Modern IDB: IDBOpenDBRequests that are stop()'ed don't notify the IDBServer of that fact.
2993         https://bugs.webkit.org/show_bug.cgi?id=157448
2994
2995         Reviewed by Alex Christensen.
2996
2997         No new tests (Previously skipped tests cover new behavior, and are now unskipped).
2998
2999         There's two main parts to this patch:
3000         
3001         1 - When an IDBOpenDBRequest is stop()'ed due to page navigation or worker termination,
3002             we now notify the IDBServer of that.
3003         2 - Lot's of little tweaks to UniqueIDBDatabase to handle shutting down version change
3004             transactions and/or connections related to the cancelled openDB request.
3005             
3006         Fortunately the changes to UniqueIDBDatabase were all well covered by existing tests.
3007         
3008         * Modules/indexeddb/IDBOpenDBRequest.cpp:
3009         (WebCore::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit):
3010         (WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion):
3011         (WebCore::IDBOpenDBRequest::cancelForStop):
3012         (WebCore::IDBOpenDBRequest::dispatchEvent):
3013         * Modules/indexeddb/IDBOpenDBRequest.h:
3014
3015         * Modules/indexeddb/IDBRequest.cpp:
3016         (WebCore::IDBRequest::stop):
3017         (WebCore::IDBRequest::cancelForStop):
3018         * Modules/indexeddb/IDBRequest.h:
3019
3020         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
3021         (WebCore::IDBClient::IDBConnectionProxy::openDBRequestCancelled):
3022         (WebCore::IDBClient::IDBConnectionProxy::didFinishHandlingVersionChangeTransaction):
3023         * Modules/indexeddb/client/IDBConnectionProxy.h:
3024
3025         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
3026         (WebCore::IDBClient::IDBConnectionToServer::didFinishHandlingVersionChangeTransaction):
3027         (WebCore::IDBClient::IDBConnectionToServer::openDBRequestCancelled):
3028         * Modules/indexeddb/client/IDBConnectionToServer.h:
3029
3030         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
3031
3032         * Modules/indexeddb/server/IDBServer.cpp:
3033         (WebCore::IDBServer::IDBServer::didFinishHandlingVersionChangeTransaction):
3034         (WebCore::IDBServer::IDBServer::databaseConnectionClosed):
3035         (WebCore::IDBServer::IDBServer::openDBRequestCancelled):
3036         * Modules/indexeddb/server/IDBServer.h:
3037
3038         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3039         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
3040         (WebCore::IDBServer::UniqueIDBDatabase::handleCurrentOperation):
3041         (WebCore::IDBServer::UniqueIDBDatabase::openDBRequestCancelled):
3042         (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
3043         (WebCore::IDBServer::UniqueIDBDatabase::performCommitTransaction):
3044         (WebCore::IDBServer::UniqueIDBDatabase::didPerformCommitTransaction):
3045         (WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):
3046         (WebCore::IDBServer::UniqueIDBDatabase::didFinishHandlingVersionChange):
3047         (WebCore::IDBServer::UniqueIDBDatabase::performAbortTransaction):
3048         (WebCore::IDBServer::UniqueIDBDatabase::didPerformAbortTransaction):
3049         (WebCore::IDBServer::UniqueIDBDatabase::connectionClosedFromClient):
3050         (WebCore::IDBServer::UniqueIDBDatabase::transactionCompleted):
3051         (WebCore::IDBServer::UniqueIDBDatabase::forgetErrorCallback):
3052         * Modules/indexeddb/server/UniqueIDBDatabase.h:
3053
3054         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
3055         (WebCore::IDBServer::UniqueIDBDatabaseConnection::abortTransactionWithoutCallback):
3056         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didFinishHandlingVersionChange):
3057         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
3058
3059         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
3060         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::didFinishHandlingVersionChange): Deleted.
3061         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
3062
3063         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
3064         (WebCore::InProcessIDBServer::didFinishHandlingVersionChangeTransaction):
3065         (WebCore::InProcessIDBServer::openDBRequestCancelled):
3066         * Modules/indexeddb/shared/InProcessIDBServer.h:
3067
3068 2016-05-11  Chris Dumez  <cdumez@apple.com>
3069
3070         Unreviewed, rolling out r200686.
3071
3072         Caused a lot of layout test failures
3073
3074         Reverted changeset:
3075
3076         "Sites served over insecure connections should not be allowed
3077         to use geolocation."
3078         https://bugs.webkit.org/show_bug.cgi?id=157423
3079         http://trac.webkit.org/changeset/200686
3080
3081 2016-05-11  Chris Dumez  <cdumez@apple.com>
3082
3083         Optimize DataDetection's searchForLinkRemovingExistingDDLinks()
3084         https://bugs.webkit.org/show_bug.cgi?id=157561
3085
3086         Reviewed by Ryosuke Niwa.
3087
3088         Optimize DataDetection's searchForLinkRemovingExistingDDLinks():
3089         1. The first loop was using Node::childNodes() to iterate over the child
3090            elements. Because of the recursive call, we may end up prepending
3091            children as we iterate over them. This is an issue because the
3092            childCount was cached before the loop and vector it would blow away
3093            the cache inside the NodeList. Switch to using ElementTraversal which
3094            should be both safer and more efficient. I don't believe we can use
3095            our nice ElementChildIterator here unfortunately as we would hit
3096            assertions due the the DOM mutations while iterating.
3097         2. The second loop was using again Node::childNodes() and kept calling
3098            item(0) to get the first child and move it to make it the previous
3099            sibling of its old parent. Again, using childNodes() here is super
3100            inefficient because we keep modifying the children and childNodes()
3101            returns a live NodeList. The call to NodeList::length() would cache
3102            all the children in a Vector, only to blow that cache away after
3103           removing the first child. Switch to using ContainerNode::firstChild().
3104         3. Drop the parentElement parameter as we can just get it from the child.
3105         4. Use tighter typing so we don't end up calling the implementations of
3106            insertBefore() / removeChild() that are on Node, thus unnecessarily
3107            doing a is<ContainerNode>() check every time.
3108         5. Pass element by reference instead of pointer as it cannot be null.
3109
3110         * editing/cocoa/DataDetection.mm:
3111         (WebCore::removeResultLinksFromAnchor):
3112         (WebCore::searchForLinkRemovingExistingDDLinks):
3113
3114 2016-05-11  Rawinder Singh  <rawinder.singh-webkit@cisra.canon.com.au>
3115
3116         preprocess-idls.pl not ignoring comments during processing
3117         https://bugs.webkit.org/show_bug.cgi?id=157559
3118
3119         Reviewed by Darin Adler.
3120
3121         Remove comments from IDL file before processing.
3122
3123         * bindings/scripts/preprocess-idls.pl:
3124         (getInterfaceExtendedAttributesFromIDL):
3125
3126 2016-05-11  Jer Noble  <jer.noble@apple.com>
3127
3128         Videos allowed to play through the Main Content restriction should not pause when scrolled off-screen.
3129         https://bugs.webkit.org/show_bug.cgi?id=157555
3130
3131         Reviewed by Eric Carlson.
3132
3133         Test: media/video-main-content-allow-then-scroll.html
3134
3135         * html/MediaElementSession.cpp:
3136         (WebCore::isMainContent):
3137
3138 2016-05-11  Fujii Hironori  <Hironori.Fujii@sony.com>
3139
3140         [curl] curl_easy_setopt(CURLOPT_CONNECT_ONLY) should take a long parameter
3141         https://bugs.webkit.org/show_bug.cgi?id=157562
3142
3143         Reviewed by Darin Adler.
3144
3145         The third argument of a calling curl_easy_setopt is missing.
3146
3147         * platform/network/curl/SocketStreamHandleCurl.cpp:
3148         (WebCore::SocketStreamHandle::startThread): Give the third
3149         argument of curl_easy_setopt.
3150
3151 2016-05-11  Pranjal Jumde  <pjumde@apple.com>
3152
3153         Sites served over insecure connections should not be allowed to use geolocation.
3154         https://bugs.webkit.org/show_bug.cgi?id=157423
3155         <rdar://problem/23751632>
3156
3157         Reviewed by Brent Fulgham.
3158
3159         Tests: http/tests/security/insecure-geolocation.html
3160                http/tests/security/mixedcontent-geolocation-block-insecure-content.html
3161                http/tests/security/mixedcontent-geolocation.html
3162
3163         * Modules/geolocation/Geolocation.cpp:
3164         (WebCore::Geolocation::logError):
3165         (WebCore::Geolocation::startRequest):
3166         Access to Geolocation will be blocked if site is not secure. An error will be logged when access to Geolocation is blocked.
3167         (WebCore::Geolocation::shouldBlockGeolocationRequests)
3168         Returns true if the access to the geolocation should be blocked.
3169         * Modules/geolocation/Geolocation.h:
3170         * dom/SecurityContext.h:
3171         (WebCore::SecurityContext::foundMixedContent):
3172         Returns true if insecure content was accessed over secure connection.
3173         (WebCore::SecurityContext::setFoundMixedContent):
3174         Sets m_foundMixedContent to true if insecure content is accessed over secure connection.
3175         (WebCore::SecurityContext::geolocationAccessed):
3176         Returns true if geolocation was accessed
3177         (WebCore::SecurityContext::setGeolocationAccessed):
3178         Sets m_geolocationAccessed to true if geolocation was accessed.
3179         * loader/MixedContentChecker.cpp:
3180         (WebCore::MixedContentChecker::canDisplayInsecureContent):
3181         Insecure content will be blocked if geolocation was accessed by the page. Updates document to keep track of mixed content.
3182         (WebCore::MixedContentChecker::canRunInsecureContent):
3183         Insecure content will be blocked if geolocation was accessed by the page. Updates document to keep track of mixed content.
3184
3185 2016-05-11  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3186
3187         Ensure DOM iterators remain done
3188         https://bugs.webkit.org/show_bug.cgi?id=157453
3189
3190         Reviewed by Darin Adler.
3191
3192         Covered by updated test.
3193
3194         Making DOMWrapped::Iterator an Optional.
3195         Setting it to Nullopt on the first time Iterator is returning null.
3196
3197         For set iterators, incrementing a counter which value is used in forEach callbacks and entries iterators.
3198
3199         * bindings/js/JSDOMIterator.h:
3200         (WebCore::JSDOMIterator<JSWrapper>::asJS):
3201         (WebCore::appendForEachArguments):
3202         (WebCore::iteratorForEach):
3203         (WebCore::JSDOMIterator<JSWrapper>::next):
3204
3205 2016-05-11  Joanmarie Diggs  <jdiggs@igalia.com>
3206
3207         [GTK] accessibility/aria-readonly.html is failing
3208         https://bugs.webkit.org/show_bug.cgi?id=98357
3209
3210         Reviewed by Chris Fleizach.
3211
3212         Add support for ATK_STATE_READ_ONLY and expose the value of aria-readonly
3213         as an AtkObject attribute. In order to eliminate duplicate checks, remove
3214         isReadOnly() and just use canSetAttributeValue(), moving all the logic into
3215         AccessibilityNodeObject. Add AccessibilityObject::supportsARIAReadOnly() so
3216         that we can explicitly expose the implicit value for aria-readonly on roles
3217         which support this property. Also add support for ATK_STATE_CHECKABLE, both
3218         because this state was missing and because it serves a similar function to
3219         ATK_STATE_EDITABLE for the purpose of verifying exposure of toggle-able
3220         elements that are not read-only.
3221
3222         Test: accessibility/form-control-value-settable.html
3223
3224         * accessibility/AccessibilityNodeObject.cpp:
3225         (WebCore::AccessibilityNodeObject::canSetValueAttribute):
3226         (WebCore::AccessibilityNodeObject::isRequired): Deleted.
3227         (WebCore::AccessibilityNodeObject::supportsRequiredAttribute): Deleted.
3228         * accessibility/AccessibilityNodeObject.h:
3229         * accessibility/AccessibilityObject.cpp:
3230         (WebCore::AccessibilityObject::supportsARIAReadOnly):
3231         (WebCore::AccessibilityObject::ariaReadOnlyValue):
3232         * accessibility/AccessibilityObject.h:
3233         (WebCore::AccessibilityObject::isUnvisited): Deleted.
3234         * accessibility/AccessibilityRenderObject.cpp:
3235         (WebCore::AccessibilityRenderObject::clickPoint):
3236         (WebCore::AccessibilityRenderObject::isOffScreen): Deleted.
3237         (WebCore::AccessibilityRenderObject::anchorElement): Deleted.
3238         (WebCore::AccessibilityRenderObject::internalLinkElement): Deleted.
3239         (WebCore::AccessibilityRenderObject::textChanged): Deleted.
3240         (WebCore::AccessibilityRenderObject::clearChildren): Deleted.
3241         (WebCore::AccessibilityRenderObject::addImageMapChildren): Deleted.
3242         * accessibility/AccessibilityRenderObject.h:
3243         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
3244         (getAttributeSetForAccessibilityObject):
3245         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
3246         (webkitAccessibleGetAttributes):
3247         (setAtkStateSetFromCoreObject):
3248         (getInterfaceMaskFromObject):
3249         * inspector/InspectorDOMAgent.cpp:
3250         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
3251
3252 2016-05-10  Jeremy Jones  <jeremyj@apple.com>
3253
3254         Don't update media duration at playback end while seeking.
3255         https://bugs.webkit.org/show_bug.cgi?id=157557
3256
3257         Reviewed by Jer Noble.
3258
3259         If JavaScript initiates a media element seek just as the media playback ends, don't update duration
3260         to the current time as the current time is now the new seek time, not the time when playback ended.
3261
3262         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
3263         (WebCore::MediaPlayerPrivateAVFoundation::didEnd):
3264
3265 2016-05-10  Joseph Pecoraro  <pecoraro@apple.com>
3266
3267         Fix typo CaptionUserPreferences::updateCaptionStyleSheetOveride
3268         https://bugs.webkit.org/show_bug.cgi?id=157544
3269
3270         Reviewed by Darin Adler.
3271
3272         * page/CaptionUserPreferences.cpp:
3273         (WebCore::CaptionUserPreferences::setCaptionsStyleSheetOverride):
3274         (WebCore::CaptionUserPreferences::updateCaptionStyleSheetOverride):
3275         (WebCore::CaptionUserPreferences::updateCaptionStyleSheetOveride): Deleted.
3276         * page/CaptionUserPreferences.h:
3277         * page/CaptionUserPreferencesMediaAF.cpp:
3278         (WebCore::CaptionUserPreferencesMediaAF::updateTimerFired):
3279         (WebCore::CaptionUserPreferencesMediaAF::captionPreferencesChanged):
3280
3281 2016-05-10  Simon Fraser  <simon.fraser@apple.com>
3282
3283         Remove scrolledContentOffset() from rendering code
3284         https://bugs.webkit.org/show_bug.cgi?id=157552
3285
3286         Reviewed by Zalan Bujtas.
3287
3288         scrolledContentOffset() is misleading because it returns a scrollPosition().
3289         Just use the name scrollPosition(), returning a ScrollPosition (IntPoint),
3290         and fix callers that need to convert to layout size.
3291
3292         * editing/VisibleUnits.cpp:
3293         (WebCore::absoluteLineDirectionPointToLocalPointInBlock):
3294         * rendering/LayoutState.cpp:
3295         (WebCore::LayoutState::LayoutState):
3296         * rendering/RenderBlock.cpp:
3297         (WebCore::RenderBlock::paintObject):
3298         (WebCore::RenderBlock::selectionGapRectsForRepaint):
3299         (WebCore::RenderBlock::paintSelection):
3300         (WebCore::RenderBlock::nodeAtPoint):
3301         (WebCore::RenderBlock::offsetForContents):
3302         * rendering/RenderBlockFlow.cpp:
3303         (WebCore::RenderBlockFlow::layoutBlock):
3304         * rendering/RenderBox.cpp:
3305         (WebCore::RenderBox::scrollPosition):
3306         (WebCore::RenderBox::applyCachedClipAndScrollOffsetForRepaint):
3307         (WebCore::isCandidateForOpaquenessTest):
3308         (WebCore::RenderBox::offsetFromContainer):
3309         (WebCore::RenderBox::layoutOverflowRectForPropagation):
3310         (WebCore::RenderBox::scrolledContentOffset): Deleted.
3311         * rendering/RenderBox.h:
3312         * rendering/RenderBoxModelObject.cpp:
3313         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
3314         * rendering/RenderInline.cpp:
3315         (WebCore::RenderInline::offsetFromContainer):
3316         * rendering/RenderLayer.cpp:
3317         (WebCore::RenderLayer::updateLayerPosition):
3318         (WebCore::RenderLayer::mapLayerClipRectsToFragmentationLayer):
3319         (WebCore::RenderLayer::calculateClipRects):
3320         * rendering/RenderLayer.h:
3321         * rendering/RenderLayerBacking.cpp:
3322         (WebCore::RenderLayerBacking::updateGeometry):
3323         * rendering/RenderMultiColumnFlowThread.cpp:
3324         (WebCore::RenderMultiColumnFlowThread::offsetFromContainer):
3325         * rendering/RenderNamedFlowThread.cpp:
3326         (WebCore::RenderNamedFlowThread::decorationsClipRectForBoxInNamedFlowFragment):
3327         * rendering/RenderObject.cpp:
3328         (WebCore::RenderObject::mapLocalToContainer):
3329         (WebCore::RenderObject::pushMappingToContainer):
3330         (WebCore::RenderObject::mapAbsoluteToLocalPoint):
3331         (WebCore::RenderObject::offsetFromContainer):
3332         * rendering/RenderTextControl.cpp:
3333         (WebCore::RenderTextControl::hitInnerTextElement):
3334
3335 2016-05-10  Simon Fraser  <simon.fraser@apple.com>
3336
3337         Horizontally-scrollable items with a 3d transform are rendered incorrectly in RTL when container has -webkit-overflow-scroll: touch
3338         https://bugs.webkit.org/show_bug.cgi?id=157482
3339         rdar://problem/26204794
3340
3341         Reviewed by Zalan Bujtas.
3342
3343         The compositing code was confused about scroll offsets vs. scroll positions, because
3344         of the badly named scrolledContentOffset(); we used that in one place, and scrollOffset()
3345         lower down. Change both to use scrollOffset().
3346
3347         Test: compositing/rtl/rtl-with-transformed-descendants.html
3348
3349         * rendering/RenderLayerBacking.cpp:
3350         (WebCore::RenderLayerBacking::updateGeometry):
3351
3352 2016-05-10  Enrica Casucci  <enrica@apple.com>
3353
3354         Numerous block selection issues on iOS.
3355         https://bugs.webkit.org/show_bug.cgi?id=157490
3356         rdar://problem/25717977
3357         rdar://problem/23042215
3358
3359         Reviewed by Tim Horton.
3360
3361         * rendering/style/RenderStyle.h:
3362         Exporting method.
3363
3364 2016-05-10  Sam Weinig  <sam@webkit.org>
3365
3366         Tweak underline style for data detected links
3367         https://bugs.webkit.org/show_bug.cgi?id=157546
3368
3369         Reviewed by Tim Horton.
3370
3371         Added API Tests in Color.cpp.
3372
3373         * editing/cocoa/DataDetection.mm:
3374         (WebCore::DataDetection::detectContentInRange):
3375         Tweak the underline's opacity based on the text color. White-ish text gets
3376         46% opacity, everything else gets 26% opacity.
3377
3378         * platform/graphics/Color.cpp:
3379         (WebCore::Color::getHSV):
3380         * platform/graphics/Color.h:
3381         Add support for getting the HSV (also know as HSB) computation of the color
3382         to help determine the "whiteness" of a color.
3383
3384 2016-05-10  Alex Christensen  <achristensen@webkit.org>
3385
3386         Handle _schemeUpgraded delegate callbacks in NSURLSessionDataDelegate
3387         https://bugs.webkit.org/show_bug.cgi?id=157354
3388         rdar://problem/25842107
3389
3390         Reviewed by Darin Adler.
3391
3392         No new tests.  This cannot be tested with a self-signed certificate.
3393         This needs to be tested once we use real ssl certificates for testing.
3394
3395         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
3396         (-[WebCoreResourceHandleAsDelegate connection:willSendRequest:redirectResponse:]):
3397         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
3398         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
3399         * platform/network/mac/WebCoreURLResponse.h:
3400         * platform/network/mac/WebCoreURLResponse.mm:
3401         (WebCore::synthesizeRedirectResponseIfNecessary):
3402         Take the NSURLRequest instead of the NSURLConnection as a parameter so we can share this code with the NSURLSession loader,
3403         which has an NSURLSessionDataTask.  Both have the currentRequest, which is all we need in this function anyway.
3404
3405 2016-05-10  Joseph Pecoraro  <pecoraro@apple.com>
3406
3407         Web Inspector: Backend should initiate timeline recordings on page navigations to ensure nothing is missed
3408         https://bugs.webkit.org/show_bug.cgi?id=157504
3409         <rdar://problem/26188642>
3410
3411         Reviewed by Brian Burg.
3412
3413         Test: inspector/timeline/setAutoCaptureInstruments-errors.html
3414
3415         * inspector/InspectorController.cpp:
3416         (WebCore::InspectorController::InspectorController):
3417         Pass other agents into the TimelineAgent constructor.
3418
3419         * inspector/InspectorInstrumentation.cpp:
3420         (WebCore::InspectorInstrumentation::frameStartedLoadingImpl):
3421         Inform the TimelineAgent whenever the main frame starts a new load.
3422
3423         * inspector/InspectorTimelineAgent.h:
3424         * inspector/InspectorTimelineAgent.cpp:
3425         (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
3426         Initialize new members.
3427
3428         (WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
3429         Cleanup auto capture state when tearing down.
3430
3431         (WebCore::InspectorTimelineAgent::setAutoCaptureEnabled):
3432         (WebCore::InspectorTimelineAgent::setAutoCaptureInstruments):
3433         Set and validate new auto capture state from the frontend.
3434
3435         (WebCore::InspectorTimelineAgent::mainFrameStartedLoading):
3436         When page navigates start an auto capture if needed.
3437
3438 2016-05-10  Csaba Osztrogonác  <ossy@webkit.org>
3439
3440         Fix the !ENABLE(SHADOW_DOM) && !ENABLE(DETAILS_ELEMENT) build
3441         https://bugs.webkit.org/show_bug.cgi?id=157514
3442
3443         Reviewed by Ryosuke Niwa.
3444
3445         * dom/Element.cpp:
3446         (WebCore::Element::insertedInto):
3447         (WebCore::Element::removedFrom):
3448
3449 2016-05-10  Csaba Osztrogonác  <ossy@webkit.org>
3450
3451         Fix the !ENABLE(WEB_TIMING) build
3452         https://bugs.webkit.org/show_bug.cgi?id=157515
3453
3454         Reviewed by Alex Christensen.
3455
3456         * loader/cache/CachedResourceLoader.cpp:
3457         (WebCore::CachedResourceLoader::loadDone):
3458
3459 2016-05-10  Csaba Osztrogonác  <ossy@webkit.org>
3460
3461         Fix the !ENABLE(INDEXED_DATABASE) build
3462         https://bugs.webkit.org/show_bug.cgi?id=157517
3463
3464         Reviewed by Alex Christensen.
3465
3466         * workers/WorkerGlobalScope.cpp:
3467         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
3468         * workers/WorkerThread.cpp:
3469         (WebCore::WorkerThread::WorkerThread):
3470
3471 2016-05-05  Jer Noble  <jer.noble@apple.com>
3472
3473         Return a Promise from HTMLMediaElement.play()
3474         https://bugs.webkit.org/show_bug.cgi?id=157400
3475
3476         Reviewed by Eric Carlson.
3477
3478         Tests: media/media-play-promise-reject-error-notsupported.html
3479                media/media-play-promise-reject-load-abort.html
3480                media/media-play-promise-reject-pause-abort.html
3481                media/media-play-promise-reject-play-notallowed.html
3482                media/media-play-promise-reject-play-notsupported.html
3483                media/media-play-promise-resolve-when-playing.html
3484                media/media-play-promise-resolve.html
3485
3486         The HTML Living Standard Spec <https://html.spec.whatwg.org/multipage/embedded-content.html>
3487         (5 May 2016) adds support for a Promise to be returned by the play() method, to be reso