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