407860fc8be0582747fc3862754e220940497a46
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-05-10  Csaba Osztrogonác  <ossy@webkit.org>
2
3         Fix the !ENABLE(CSS_REGIONS) build after r198990
4         https://bugs.webkit.org/show_bug.cgi?id=157516
5
6         Reviewed by Ryosuke Niwa.
7
8         * style/StyleTreeResolver.cpp:
9         (WebCore::Style::affectsRenderedSubtree):
10
11 2016-05-05  Jer Noble  <jer.noble@apple.com>
12
13         Return a Promise from HTMLMediaElement.play()
14         https://bugs.webkit.org/show_bug.cgi?id=157400
15
16         Reviewed by Eric Carlson.
17
18         Tests: media/media-play-promise-reject-error-notsupported.html
19                media/media-play-promise-reject-load-abort.html
20                media/media-play-promise-reject-pause-abort.html
21                media/media-play-promise-reject-play-notallowed.html
22                media/media-play-promise-reject-play-notsupported.html
23                media/media-play-promise-resolve-when-playing.html
24                media/media-play-promise-resolve.html
25
26         The HTML Living Standard Spec <https://html.spec.whatwg.org/multipage/embedded-content.html>
27         (5 May 2016) adds support for a Promise to be returned by the play() method, to be resolved
28         or rejected at defined points during loading and playback.
29
30         Add utility methods which encapsulate the definitions of the equivalent algorithms from the
31         HTML Spec.  Add a new, overloaded play() method on HTMLMediaElement which takes a DeferredWrapper
32         reference.
33
34         After the change to use scheduleNotifyAboutPlaying() instead of enqueueing the "playing" event
35         directly, we must ensure that the notifyAboutPlaying() task does not get fired before the
36         "play" event preceeding it does. So re-implement GenericEventQueue (which previously used
37         a timer to dispatch events) to use a GenericTaskQueue instead. This ensures that all tasks and
38         events are interleaved in the order in which they were enqueued.
39
40         Additionally, the new pauseAfterDetachedTimerFired() event was firing out of microtask order, which
41         broke some W3C tests after the changes to GenericEventQueue. Move GenericEventQueue and
42         GenericTaskQueue to the same timing source (namely, a WebCore Timer) and interleave Events
43         and Tasks by having GenericEventQueue use GenericTaskQueue to issue its Events. Because
44         Document::postTask() cannot ensure ordering with Timer-based events, switch HTMLMediaElement
45         over to Timer-backed GenericTaskQueues.
46
47         * dom/GenericEventQueue.cpp:
48         (WebCore::GenericEventQueue::GenericEventQueue):
49         (WebCore::GenericEventQueue::enqueueEvent):
50         (WebCore::GenericEventQueue::close):
51         (WebCore::GenericEventQueue::cancelAllEvents):
52         (WebCore::GenericEventQueue::suspend):
53         (WebCore::GenericEventQueue::resume):
54         (WebCore::GenericEventQueue::sharedTimer): Deleted.
55         (WebCore::GenericEventQueue::sharedTimerFired): Deleted.
56         (WebCore::GenericEventQueue::pendingQueues): Deleted.
57         * dom/GenericEventQueue.h:
58         * platform/GenericTaskQueue.cpp: Added.
59         (WebCore::TaskDispatcher<Timer>::~TaskDispatcher):
60         (WebCore::TaskDispatcher<Timer>::postTask):
61         (WebCore::TaskDispatcher<Timer>::sharedTimer):
62         (WebCore::TaskDispatcher<Timer>::sharedTimerFired):
63         (WebCore::TaskDispatcher<Timer>::pendingDispatchers):
64         (WebCore::TaskDispatcher<Timer>::dispatchOneTask):
65         * platform/GenericTaskQueue.h:
66         (WebCore::TaskDispatcher<Timer>::TaskDispatcher): Deleted.
67         (WebCore::TaskDispatcher<Timer>::postTask): Deleted.
68         (WebCore::TaskDispatcher<Timer>::timerFired): Deleted.
69         * html/HTMLMediaElement.cpp:
70         (WebCore::HTMLMediaElement::HTMLMediaElement):
71         (WebCore::HTMLMediaElement::~HTMLMediaElement):
72         (WebCore::HTMLMediaElement::scheduleResolvePendingPlayPromises):
73         (WebCore::HTMLMediaElement::rejectPendingPlayPromises):
74         (WebCore::HTMLMediaElement::resolvePendingPlayPromises):
75         (WebCore::HTMLMediaElement::scheduleNotifyAboutPlaying):
76         (WebCore::HTMLMediaElement::notifyAboutPlaying):
77         (WebCore::HTMLMediaElement::noneSupported):
78         (WebCore::HTMLMediaElement::cancelPendingEventsAndCallbacks):
79         (WebCore::HTMLMediaElement::setReadyState):
80         (WebCore::HTMLMediaElement::play):
81         (WebCore::HTMLMediaElement::playInternal):
82         (WebCore::HTMLMediaElement::pauseInternal):
83         (WebCore::HTMLMediaElement::contextDestroyed):
84         (WebCore::HTMLMediaElement::stop):
85         (WebCore::HTMLMediaElement::pauseAfterDetachedTask): Renamed from pauseAfterDetachedTimerFired.
86         (WebCore::HTMLMediaElement::removedFrom):
87         (WebCore::HTMLMediaElement::contextDestroyed):
88         * html/HTMLMediaElement.h:
89         * html/HTMLMediaElement.idl:
90         * CMakeLists.txt:
91         * WebCore.xcodeproj/project.pbxproj:
92
93 2016-05-10  Chris Dumez  <cdumez@apple.com>
94
95         Get rid of a lot of calls to RefPtr::release()
96         https://bugs.webkit.org/show_bug.cgi?id=157505
97
98         Reviewed by Alex Christensen.
99
100         Get rid of a lot of calls to RefPtr::release() and use WTFMove() instead.
101
102         * Modules/encryptedmedia/MediaKeySession.cpp:
103         (WebCore::MediaKeySession::addKeyTimerFired):
104         (WebCore::MediaKeySession::sendMessage):
105         (WebCore::MediaKeySession::sendError):
106         * Modules/geolocation/Geolocation.cpp:
107         (WebCore::createGeoposition):
108         * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
109         (WebCore::DOMWindowIndexedDatabase::disconnectFrameForDocumentSuspension):
110         (WebCore::DOMWindowIndexedDatabase::reconnectFrameFromDocumentSuspension):
111         * Modules/indexeddb/IDBKey.h:
112         (WebCore::IDBKey::createMultiEntryArray):
113         * Modules/mediasource/MediaSource.cpp:
114         (WebCore::MediaSource::scheduleEvent):
115         * Modules/mediasource/SourceBuffer.cpp:
116         (WebCore::SourceBuffer::scheduleEvent):
117         * Modules/mediasource/SourceBufferList.cpp:
118         (WebCore::SourceBufferList::scheduleEvent):
119         * Modules/notifications/DOMWindowNotifications.cpp:
120         (WebCore::DOMWindowNotifications::disconnectFrameForDocumentSuspension):
121         (WebCore::DOMWindowNotifications::reconnectFrameFromDocumentSuspension):
122         * Modules/webdatabase/DatabaseManager.cpp:
123         (WebCore::DatabaseManager::openDatabaseBackend):
124         * Modules/webdatabase/DatabaseManager.h:
125         * Modules/webdatabase/SQLCallbackWrapper.h:
126         (WebCore::SQLCallbackWrapper::unwrap):
127         * Modules/websockets/WebSocketChannel.cpp:
128         (WebCore::WebSocketChannel::enqueueTextFrame):
129         (WebCore::WebSocketChannel::enqueueRawFrame):
130         (WebCore::WebSocketChannel::enqueueBlobFrame):
131         (WebCore::WebSocketChannel::processOutgoingFrameQueue):
132         * bindings/js/JSBlobCustom.cpp:
133         (WebCore::constructJSBlob):
134         * bindings/js/JSGeolocationCustom.cpp:
135         (WebCore::createPositionOptions):
136         (WebCore::JSGeolocation::getCurrentPosition):
137         (WebCore::JSGeolocation::watchPosition):
138         * bindings/js/JSMessagePortCustom.cpp:
139         (WebCore::fillMessagePortArray):
140         * bindings/js/JSSQLTransactionCustom.cpp:
141         (WebCore::JSSQLTransaction::executeSql):
142         * bindings/js/ScriptControllerMac.mm:
143         (WebCore::ScriptController::createScriptInstanceForWidget):
144         * bindings/scripts/CodeGeneratorJS.pm:
145         (GenerateCallWith):
146         * crypto/mac/CryptoKeyRSAMac.cpp:
147         (WebCore::CryptoKeyRSA::generatePair):
148         * css/CSSBasicShapes.cpp:
149         (WebCore::buildSerializablePositionOffset):
150         * css/CSSComputedStyleDeclaration.cpp:
151         (WebCore::valueForNinePieceImageRepeat):
152         (WebCore::counterToCSSValue):
153         (WebCore::ComputedStyleExtractor::propertyValue):
154         * css/CSSContentDistributionValue.cpp:
155         (WebCore::CSSContentDistributionValue::customCSSText):
156         * css/CSSFilterImageValue.cpp:
157         (WebCore::CSSFilterImageValue::image):
158         * css/CSSFilterImageValue.h:
159         * css/CSSGrammar.y.in:
160         * css/CSSNamedImageValue.cpp:
161         (WebCore::CSSNamedImageValue::image):
162         * css/CSSNamedImageValue.h:
163         * css/CSSParser.cpp:
164         (WebCore::CSSParser::parseFillProperty):
165         (WebCore::CSSParser::parseAnimationProperty):
166         (WebCore::CSSParser::parseInsetRoundedCorners):
167         (WebCore::ShadowParseContext::commitLength):
168         (WebCore::CSSParser::parseShadow):
169         (WebCore::BorderImageSliceParseContext::commitNumber):
170         (WebCore::BorderImageQuadParseContext::commitNumber):
171         (WebCore::CSSParser::parseBorderRadius):
172         (WebCore::CSSParser::parseCounter):
173         (WebCore::CSSParser::parseDeprecatedGradient):
174         (WebCore::CSSParser::parseDeprecatedLinearGradient):
175         (WebCore::CSSParser::parseDeprecatedRadialGradient):
176         (WebCore::CSSParser::parseLinearGradient):
177         (WebCore::CSSParser::parseRadialGradient):
178         (WebCore::CSSParser::parseTransformValue):
179         (WebCore::CSSParser::parseBuiltinFilterArguments):
180         (WebCore::CSSParser::parseTextIndent):
181         (WebCore::CSSParser::popRuleData):
182         (WebCore::CSSParser::markRuleHeaderStart):
183         (WebCore::CSSParser::createViewportRule):
184         * css/CSSParser.h:
185         * css/CSSParserValues.cpp:
186         (WebCore::CSSParserValue::createCSSValue):
187         * css/CSSParserValues.h:
188         * css/CSSValueList.cpp:
189         (WebCore::CSSValueList::copy):
190         * css/CSSValueList.h:
191         * css/SVGCSSComputedStyleDeclaration.cpp:
192         (WebCore::ComputedStyleExtractor::svgPropertyValue):
193         * css/StyleBuilderConverter.h:
194         (WebCore::StyleBuilderConverter::convertClipPath):
195         (WebCore::StyleBuilderConverter::convertReflection):
196         * css/StyleResolver.cpp:
197         (WebCore::StyleResolver::cachedOrPendingFromValue):
198         (WebCore::StyleResolver::setOrPendingFromValue):
199         (WebCore::StyleResolver::cursorOrPendingFromValue):
200         * css/StyleResolver.h:
201         * css/StyleRule.cpp:
202         (WebCore::StyleRuleBase::createCSSOMWrapper):
203         * css/StyleRule.h:
204         * dom/Attr.cpp:
205         (WebCore::Attr::create):
206         * dom/Attr.h:
207         * dom/ContainerNode.h:
208         (WebCore::ChildNodesLazySnapshot::nextNode):
209         * dom/Document.cpp:
210         (WebCore::Document::setFocusedElement):
211         (WebCore::Document::takeDOMWindowFrom):
212         (WebCore::Document::updateHoverActiveState):
213         * dom/Element.cpp:
214         (WebCore::Element::detachAttribute):
215         (WebCore::Element::setAttributeNodeNS):
216         (WebCore::Element::ensureAttr):
217         * dom/Element.h:
218         * dom/MessagePort.cpp:
219         (WebCore::MessagePort::dispatchMessages):
220         (WebCore::MessagePort::entanglePorts):
221         * dom/NodeIterator.cpp:
222         (WebCore::NodeIterator::nextNode):
223         (WebCore::NodeIterator::previousNode):
224         * dom/Range.cpp:
225         (WebCore::Range::processContentsBetweenOffsets):
226         * dom/StyledElement.cpp:
227         (WebCore::StyledElement::rebuildPresentationAttributeStyle):
228         * editing/ApplyBlockElementCommand.cpp:
229         (WebCore::ApplyBlockElementCommand::createBlockElement):
230         * editing/ApplyBlockElementCommand.h:
231         * editing/ApplyStyleCommand.cpp:
232         (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
233         * editing/CompositeEditCommand.cpp:
234         (WebCore::CompositeEditCommand::applyCommandToComposite):
235         (WebCore::CompositeEditCommand::appendBlockPlaceholder):
236         (WebCore::CompositeEditCommand::insertBlockPlaceholder):
237         (WebCore::CompositeEditCommand::addBlockPlaceholderIfNeeded):
238         (WebCore::CompositeEditCommand::insertNewDefaultParagraphElementAt):
239         (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
240         (WebCore::CompositeEditCommand::cloneParagraphUnderNewElement):
241         (WebCore::CompositeEditCommand::moveParagraphs):
242         * editing/CompositeEditCommand.h:
243         * editing/EditingStyle.cpp:
244         (WebCore::EditingStyle::wrappingStyleForSerialization):
245         (WebCore::styleFromMatchedRulesForElement):
246         (WebCore::extractPropertiesNotIn):
247         (WebCore::backgroundColorInEffect):
248         * editing/EditingStyle.h:
249         * editing/Editor.cpp:
250         (WebCore::Editor::increaseSelectionListLevel):
251         (WebCore::Editor::increaseSelectionListLevelOrdered):
252         (WebCore::Editor::increaseSelectionListLevelUnordered):
253         (WebCore::Editor::findStringAndScrollToVisible):
254         (WebCore::Editor::rangeOfString):
255         * editing/Editor.h:
256         * editing/InsertParagraphSeparatorCommand.cpp:
257         (WebCore::InsertParagraphSeparatorCommand::cloneHierarchyUnderNewBlock):
258         * editing/InsertParagraphSeparatorCommand.h:
259         * editing/MergeIdenticalElementsCommand.cpp:
260         (WebCore::MergeIdenticalElementsCommand::doUnapply):
261         * editing/ModifySelectionListLevel.cpp:
262         (WebCore::IncreaseSelectionListLevelCommand::doApply):
263         (WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevel):
264         * editing/ModifySelectionListLevel.h:
265         * editing/RemoveNodeCommand.cpp:
266         (WebCore::RemoveNodeCommand::doUnapply):
267         * editing/RemoveNodePreservingChildrenCommand.cpp:
268         (WebCore::RemoveNodePreservingChildrenCommand::doApply):
269         * editing/ReplaceSelectionCommand.cpp:
270         (WebCore::ReplacementFragment::insertFragmentForTestRendering):
271         * editing/SpellingCorrectionCommand.cpp:
272         (WebCore::SpellingCorrectionCommand::doApply):
273         * editing/mac/DictionaryLookup.h:
274         * editing/mac/DictionaryLookup.mm:
275         (WebCore::DictionaryLookup::rangeForSelection):
276         (WebCore::DictionaryLookup::rangeAtHitTestResult):
277         * html/HTMLFormElement.cpp:
278         (WebCore::HTMLFormElement::finishRequestAutocomplete):
279         * html/HTMLMediaElement.cpp:
280         (WebCore::HTMLMediaElement::scheduleEvent):
281         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
282         (WebCore::HTMLMediaElement::mediaPlayerKeyNeeded):
283         (WebCore::HTMLMediaElement::addTextTrack):
284         (WebCore::HTMLMediaElement::enqueuePlaybackTargetAvailabilityChangedEvent):
285         * html/HTMLMediaElement.h:
286         * html/canvas/OESVertexArrayObject.cpp:
287         (WebCore::OESVertexArrayObject::createVertexArrayOES):
288         * html/canvas/OESVertexArrayObject.h:
289         * html/canvas/WebGLRenderingContextBase.cpp:
290         (WebCore::WebGLRenderingContextBase::getContextAttributes):
291         * html/canvas/WebGLRenderingContextBase.h:
292         * html/track/VTTCue.cpp:
293         (WebCore::VTTCue::getCueAsHTML):
294         (WebCore::VTTCue::createCueRenderingTree):
295         * html/track/VTTCue.h:
296         * html/track/WebVTTElement.cpp:
297         (WebCore::WebVTTElement::createEquivalentHTMLElement):
298         * html/track/WebVTTElement.h:
299         * html/track/WebVTTParser.cpp:
300         (WebCore::WebVTTTreeBuilder::buildFromString):
301         (WebCore::WebVTTParser::createDocumentFragmentFromCueText):
302         * html/track/WebVTTParser.h:
303
304 2016-05-05  Gavin Barraclough  <barraclough@apple.com>
305
306         Allow some leeway after page load before throttling, to allow post load events to complete.
307         https://bugs.webkit.org/show_bug.cgi?id=157499
308
309         Reviewed by Ryosuke Niwa
310
311         * page/PageThrottler.cpp:
312         (WebCore::PageThrottler::PageThrottler):
313             - m_pageLoadActivityCounter now affects activity state indirecty, via m_pageLoadActivityHysteresis.
314         (WebCore::PageThrottler::pageLoadActivityCounterChanged):
315             - counter updates hysteresis object, which in turn will affect activity state.
316         * page/PageThrottler.h:
317             - added m_pageLoadActivityHysteresis, pageLoadActivityCounterChanged.
318
319 2016-05-10  Zalan Bujtas  <zalan@apple.com>
320
321         REGRESSION (r193610): Drop down menu doesn’t expand at allofbach.com
322         https://bugs.webkit.org/show_bug.cgi?id=157445
323
324         Reviewed by Simon Fraser.
325
326         When we don't run transitions (becasuse of to/from 'auto' values) we should also not
327         report the 'from' value and behave as if we finished the transition already.
328
329         Test: fast/animation/height-auto-transition-computed-value.html
330
331         * page/animation/KeyframeAnimation.cpp:
332         (WebCore::KeyframeAnimation::fetchIntervalEndpointsForProperty): This is a revert of
333         looping the 'to' value back to the first keyframe when reverse animation is at the start value (last keyframe).
334
335         * platform/Length.cpp:
336         (WebCore::blend):
337
338 2016-05-09  Dean Jackson  <dino@apple.com>
339
340         [iOS] <select> elements should render right-aligned when in RTL mode
341         https://bugs.webkit.org/show_bug.cgi?id=157501
342         <rdar://problem/26187870>
343
344         Reviewed by Antoine Quint.
345
346         This is the equivalent of http://webkit.org/b/157112 for iOS.
347         Handle <select> elements when we're in RTL mode. This means
348         drawing the button with the drop-down arrow on the left
349         side, and the button text right-aligned.
350
351         Test: fast/forms/select-non-native-rendering-direction.html
352         plus a bunch of other ones that needed rebaselining.
353
354         * rendering/RenderThemeIOS.mm: Rename MenuListButtonPaddingRight to MenuListButtonPaddingAfter.
355         (WebCore::RenderThemeIOS::popupInternalPaddingBox): Handle both directions.
356         (WebCore::adjustInputElementButtonStyle):
357         (WebCore::RenderThemeIOS::paintMenuListButtonDecorations): Handle drawing in
358         RTL mode.
359
360 2016-05-10  Youenn Fablet  <youenn.fablet@crf.canon.fr>
361
362         NodeList should be iterable
363         https://bugs.webkit.org/show_bug.cgi?id=131443
364         <rdar://problem/25731519>
365
366         Reviewed by Darin Adler.
367
368         Test: fast/dom/nodeListIterator.html
369
370         Updating JSKeyValueIterator to support map and set iterators,
371         depending on the signature of the result type of DOMClass::Iterator::next method.
372         Symbol.iterator method is made the same as values method for set iterators.
373
374         Adding support for NodeList.
375         Updating FontFaceSet to take benefit of that. 
376
377         * bindings/js/JSDOMBinding.h:
378         (WebCore::jsPair):.
379         * bindings/js/JSKeyValueIterator.h:
380         (WebCore::IteratorInspector::decltype): IteratorInspector detects whether the iterator is a set or map iterator.
381         (WebCore::IteratorInspector::test):
382         (WebCore::fillForEachArgumentsWithIteratorValue): Specializing according set/map iterator.
383         (WebCore::iteratorValueToJS): Ditto.
384         (WebCore::keyValueIteratorForEach):
385         (WebCore::JSKeyValueIterator<JSWrapper>::next):
386         * bindings/scripts/CodeGeneratorJS.pm:
387         (GenerateImplementationIterableFunctions): Removed the line forbidding set iterators.
388         Making Symbol.iterator function equal to values for set iterators.
389         * bindings/scripts/test/JS/JSTestNode.cpp: Rebasing with set iterator functions.
390         * bindings/scripts/test/JS/JSTestObj.cpp: Rebasing according updated function names.
391         * bindings/scripts/test/TestNode.idl: Making TestNode set iterable.
392         * css/FontFaceSet.cpp:
393         (WebCore::FontFaceSet::Iterator::next): Refactoring to make it a set iterator.
394         * css/FontFaceSet.h:
395         * css/FontFaceSet.idl:
396         * dom/NodeList.h: Making NodeList iterable.
397         (WebCore::NodeList::Iterator::Iterator):
398         (WebCore::NodeList::Iterator::next):
399         (WebCore::NodeList::createIterator):
400         * dom/NodeList.idl:
401
402 2016-05-09  Sergio Villar Senin  <svillar@igalia.com>
403
404         [css-grid] Implement auto-repeat computation
405         https://bugs.webkit.org/show_bug.cgi?id=157473
406
407         Reviewed by Darin Adler.
408
409         We added support for parsing and style for the new auto-repeat syntax. This patch actually
410         implements the feature by computing the number of auto-repeat tracks that will be part of
411         the explicit grid depending on the available size on the corresponding axis.
412
413         Note that we still do not drop the empty tracks, i.e., auto-fit will work exactly as
414         auto-fill until the empty track removal is implemented.
415
416         Some test results are not totally correct yet because we need to add the line names to the
417         computed style. As that requires a rather large piece of code it will be done in a follow up
418         patch. Track sizes are correct though.
419
420         Tests: fast/css-grid-layout/grid-auto-fill-columns.html
421                fast/css-grid-layout/grid-auto-fill-rows.html
422                fast/css-grid-layout/grid-change-auto-repeat-tracks.html
423                fast/css-grid-layout/mozilla/grid-repeat-auto-fill-fit-001.html
424                fast/css-grid-layout/mozilla/grid-repeat-auto-fill-fit-002.html
425                fast/css-grid-layout/mozilla/grid-repeat-auto-fill-fit-003.html
426                fast/css-grid-layout/mozilla/grid-repeat-auto-fill-fit-004.html
427                fast/css-grid-layout/mozilla/grid-repeat-auto-fill-fit-005.html
428
429         * css/CSSParser.cpp:
430         (WebCore::CSSParser::parseGridTrackRepeatFunction): Add the CSSAutoRepeatValue directly
431         instead of adding the track size.
432         * css/StyleBuilderCustom.h: Store the insertion point in style.
433         * rendering/RenderGrid.cpp:
434         (WebCore::RenderGrid::guttersSize): Replaced size_t by unsigned.
435         (WebCore::RenderGrid::rawGridTrackSize): New function which retrieves the track size from
436         either explicit (including auto-repeat tracks) or implicit tracks.
437         (WebCore::RenderGrid::gridTrackSize): Use rawGridTrackSize().
438         (WebCore::RenderGrid::computeAutoRepeatTracksCount): This is the core of the patch. This
439         method computes the number of auto-repeat tracks that fits on the available size for a given
440         axis (or 1 if that's indefinite).
441         * rendering/RenderGrid.h:
442
443 2016-05-09  Alex Christensen  <achristensen@webkit.org>
444
445         Fix GTK build after r200607
446
447         * Modules/notifications/Notification.h:
448         dir and replaceId are used in WebNotificationManager with NOTIFICATIONS and with LEGACY_NOTIFICATIONS
449
450 2016-05-09  Simon Fraser  <simon.fraser@apple.com>
451
452         Fix the Windows build after r200602, and do some minor tidyup.
453
454         * platform/graphics/ca/PlatformCALayer.h:
455         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
456         (PlatformCALayerCocoa::contentsHidden):
457         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
458         (PlatformCALayerWin::contentsHidden):
459         (PlatformCALayerWin::setContentsHidden):
460         * platform/graphics/ca/win/PlatformCALayerWin.h:
461
462 2016-05-09  Darin Adler  <darin@apple.com>
463
464         Change Notification constructor to take an IDL dictionary instead of a WebCore::Dictionary
465         https://bugs.webkit.org/show_bug.cgi?id=157466
466
467         Reviewed by Alex Christensen.
468
469         * Modules/notifications/Notification.cpp: Got rid of unneeded includes.
470         (WebCore::Notification::Notification): Deleted the unused default constructor. Changed
471         NotificationCenter argument to be reference rather than PassRefPtr. Changed one of the
472         ScriptExecutionContext arguments to be a Document since the code relies on that already.
473         Used the lambda form of timer creation instead of the class member form. Added a FIXME
474         about when m_notificationCenter can be null.
475         (WebCore::Notification::create): Changed NotificationCenter argument to be reference
476         rather than PassRefPtr. Changed options argument to be Options rather than Dictionary.
477         (WebCore::directionString): Added. Helper because the class still wants to store the
478         direction as a string, at least for now.
479         (WebCore::Notification::show): Streamlined the code a bit.
480         (WebCore::Notification::taskTimerFired): Deleted. Not needed now that we use a lambda
481         inside the constructor.
482         (WebCore::Notification::permission): Removed unneeded const from return type.
483         (WebCore::Notification::permissionString): Ditto.
484
485         * Modules/notifications/Notification.h: Used pragma once, updated for changes above.
486         Removed a number of unused functions, including cancel, setIconURL, setLang,
487         stopLoadingIcon, detachPresenter, setBody, startLoadingIcon, finishLoadingIcon, and
488         taskTimerFired.
489
490         * Modules/notifications/Notification.idl: Add NotificationOptions and pass it instead
491         of Dictionary to the constructor. Note that this is only a subset of what is
492         currently specified in the Notifications API document. The latest document specifies
493         a much more complex feature with lots more options.
494
495         * Modules/notifications/NotificationCenter.cpp:
496         (WebCore::NotificationCenter::createNotification): Pass a reference rather than a
497         pointer to this.
498         * Modules/notifications/NotificationClient.h: Use pragma once. Removed unneeded
499         includes and forward declarations. Fixed #if to be easier to read.
500
501         * bindings/js/JSDOMConvert.h: Reworked the convert functions to use Converter and
502         DefaultConverter structs so we can do partial specialization in the future and so
503         we can get custom types for optional values. Used this to make an optional String
504         just be a null String, so it won't try to use Optional<String> instead. Might get
505         more complex latter when we add support for nullable.
506
507         * bindings/scripts/CodeGeneratorJS.pm:
508         (GenerateEnumerationImplementationContent): Generate a blank line to make the output
509         slightly clearer. Tweaked a comment.
510         (GenerateDefaultValue): Added. Converts the default syntax from IDL into the syntax
511         needed in C++ code.
512         (GenerateDefaultValueWithLeadingComma): Added. Helper for use below.
513         (GenerateDictionaryImplementationContent): Use GenerateDefaultValue and
514         GenerateDefaultValueWithLeadingComma to make default values.
515         (GenerateParametersCheck): Use GenerateDefaultValue here in the enumeration code
516         path. This is a step in the direction of being able to make the whole thing more
517         generic in the future.
518
519         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
520         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
521         * bindings/scripts/test/JS/JSTestObj.cpp:
522         * bindings/scripts/test/ObjC/DOMTestObj.h:
523         * bindings/scripts/test/ObjC/DOMTestObj.mm:
524         Regenerated.
525
526         * bindings/scripts/test/TestObj.idl: Simplified and extended some of the test cases
527         to cover more combinations of the dictionary and enumeration support.
528
529 2016-05-09  Brady Eidson  <beidson@apple.com>
530
531         Modern IDB: Have server database connections remember the OpenDB request that spawned them.
532         https://bugs.webkit.org/show_bug.cgi?id=157498
533
534         Reviewed by Tim Horton.
535
536         No new tests (No testable change in behavior, debug only for now).
537
538         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
539         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation):
540         
541         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
542         (WebCore::IDBServer::UniqueIDBDatabaseConnection::create):
543         (WebCore::IDBServer::UniqueIDBDatabaseConnection::UniqueIDBDatabaseConnection):
544         (WebCore::IDBServer::UniqueIDBDatabaseConnection::connectionClosedFromClient):
545         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didFireVersionChangeEvent):
546         (WebCore::IDBServer::UniqueIDBDatabaseConnection::createVersionChangeTransaction):
547         (WebCore::IDBServer::UniqueIDBDatabaseConnection::establishTransaction):
548         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didAbortTransaction):
549         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didCommitTransaction):
550         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
551         (WebCore::IDBServer::UniqueIDBDatabaseConnection::openRequestIdentifier):
552
553 2016-05-09  Simon Fraser  <simon.fraser@apple.com>
554
555         [iOS] visibility:hidden -webkit-overflow-scrolling: touch divs can interfere with page scrolling
556         https://bugs.webkit.org/show_bug.cgi?id=157496
557
558         Reviewed by Tim Horton.
559
560         UIScrollViews are constructed in the UI process for visibility:hidden scrollable elements
561         with -webkit-overflow-scrolling: touch, and these intercept user events when they should not.
562
563         Fix by propagating a "contentsHidden" flag from the web process which is used to turn off
564         user interaction on these views.
565
566         Test: fast/scrolling/ios/touch-scroll-visibility-hidden.html
567
568         * platform/graphics/ca/GraphicsLayerCA.cpp:
569         (WebCore::GraphicsLayerCA::updateContentsVisibility): We have to tell the scrolling layer
570         if we have visibility:hidden.
571         * platform/graphics/ca/PlatformCALayer.h:
572         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
573         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
574         (PlatformCALayerCocoa::contentsHidden):
575         (PlatformCALayerCocoa::setContentsHidden):
576         * rendering/RenderLayerBacking.cpp:
577         (WebCore::RenderLayerBacking::updateAfterDescendants):
578
579 2016-05-09  Myles C. Maxfield  <mmaxfield@apple.com>
580
581         Web Font is downloaded even when all the characters in the document are outside its unicode-range
582         https://bugs.webkit.org/show_bug.cgi?id=42154
583         <rdar://problem/17779042>
584
585         Reviewed by Darin Adler.
586
587         Fonts are requested in two stages:
588         - For a given font family, all the relevant @font-face rules are consulted. We build up a
589         mapping of unicode-range -> Font object. This result is cached.
590         - Then, when we have the mapping, we look up the character we are trying to render to
591         find the appropriate Font object.
592
593         However, we are not supposed to create any Font objects (because that causes a download to
594         be triggered) until we consult with the character we're trying to render. Therefore, this
595         patch swaps out the Font objects with a FontAccessor. This FontAccessor is essentially a
596         lazily-created Font. When step 2 starts looking up the appropriate character, the
597         FontAccessor will be asked to start the download.
598
599         Test: fast/text/unicode-range-download.html
600
601         * css/CSSFontFace.cpp:
602         (WebCore::CSSFontFace::removeClient): 
603         as a client from all its CSSFontFaces.
604         * css/CSSFontFaceSet.cpp:
605         (WebCore::CSSFontFaceSet::clear): Clearing the CSSFontFaceSet needs to remove itself as a
606         client from all its CSSFontFaces.
607         * css/CSSSegmentedFontFace.cpp:
608         (WebCore::CSSFontAccessor::create): The lazy Font object.
609         (WebCore::CSSFontAccessor::CSSFontAccessor): Ditto.
610         (WebCore::appendFontWithInvalidUnicodeRangeIfLoading): Appends a FontAccessor.
611         (WebCore::CSSSegmentedFontFace::fontRanges): Create the FontAccessor and use it instead.
612         * platform/graphics/FontCascadeFonts.cpp:
613         (WebCore::FontCascadeFonts::determinePitch): Use the fontForFirstRange() convenience
614         function.
615         (WebCore::glyphPageFromFontRanges): font() may now return nullptr. Update this function to
616         handle that.
617         * platform/graphics/FontRanges.cpp:
618         (WebCore::FontRanges::Range::font): Trigger the lazy initialization.
619         (WebCore::TrivialFontAccessor::create): Used in the case where there is only one font in
620         the Ranges object and it has a full unicode-range.
621         (WebCore::TrivialFontAccessor::TrivialFontAccessor):
622         (WebCore::FontRanges::FontRanges): Use TrivialFontAccessor.
623         (WebCore::FontRanges::glyphDataForCharacter): font() may now return nullptr. Update this
624         function to handle that. This is where the magic happens: this is where we trigger
625         downloads only if the character falls within the unicode-range.
626         (WebCore::FontRanges::fontForFirstRange): Add ASSERT.
627         (WebCore::FontRanges::isLoading): Update to use the new FontAccessor.
628         * platform/graphics/FontRanges.h: Ditto.
629         (WebCore::FontRanges::Range::Range):
630         (WebCore::FontRanges::Range::fontAccessor):
631         (WebCore::FontRanges::appendRange):
632         (WebCore::FontRanges::Range::font): Deleted.
633         * platform/graphics/FontSelector.h: The virtual base class of FontAccessor. This is
634         necessary because it must be shared between platform code and non-platform code.
635         (WebCore::FontAccessor::~FontAccessor):
636
637 2016-05-09  Brady Eidson  <beidson@apple.com>
638
639         Modern IDB: Prevent the same transaction from being commited/aborted twice.
640         https://bugs.webkit.org/show_bug.cgi?id=157494
641
642         Reviewed by Tim Horton.
643
644         When a page navigates or a worker terminates, in rare cases with specific unfortunate timing, the IDBServer
645         might receive a request to commit/abort a transaction that is already in the process of committing/aborting.
646         
647         By moving transactions that are finishing into their own map we can at least detect this situation and
648         return an error. This seems like an improvement over some mysterious ASSERTs/timeouts.
649
650         No new tests:
651         While apparent that this is at least partially to blame for some existing timeouts/ASSERTs, I could not nail 
652         down a reliable way to reproduce this with a dedicated test.
653         
654         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
655         (WebCore::IDBServer::UniqueIDBDatabase::~UniqueIDBDatabase):
656         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentDeleteOperation):
657         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
658         (WebCore::IDBServer::UniqueIDBDatabase::prepareToFinishTransaction):
659         (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
660         (WebCore::IDBServer::UniqueIDBDatabase::didPerformCommitTransaction):
661         (WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):
662         (WebCore::IDBServer::UniqueIDBDatabase::didPerformAbortTransaction):
663         (WebCore::IDBServer::UniqueIDBDatabase::hasUnfinishedTransactions):
664         (WebCore::IDBServer::UniqueIDBDatabase::operationAndTransactionTimerFired):
665         (WebCore::IDBServer::UniqueIDBDatabase::takeNextRunnableTransaction):
666         (WebCore::IDBServer::UniqueIDBDatabase::transactionCompleted): Renamed from inProgressTransactionCompleted.
667         (WebCore::IDBServer::UniqueIDBDatabase::inProgressTransactionCompleted): Deleted.
668         * Modules/indexeddb/server/UniqueIDBDatabase.h:
669
670 2016-05-09  Tim Horton  <timothy_horton@apple.com>
671
672         Draw border and correct icon for placeholder attachments
673         https://bugs.webkit.org/show_bug.cgi?id=157495
674         rdar://problem/19982510
675
676         Reviewed by Anders Carlsson.
677
678         * Resources/AttachmentPlaceholder.png: Added.
679         * Resources/AttachmentPlaceholder@2x.png: Added.
680         * WebCore.xcodeproj/project.pbxproj:
681         * rendering/RenderThemeMac.mm:
682         (WebCore::attachmentPlaceholderBorderColor):
683         (WebCore::paintAttachmentIconPlaceholder):
684         (WebCore::paintAttachmentProgress):
685         (WebCore::paintAttachmentPlaceholderBorder):
686         (WebCore::RenderThemeMac::paintAttachment):
687         If progress is set, but set to 0, draw a dashed border around the attachment
688         and use the placeholder "download" artwork.
689
690 2016-05-09  Ada Chan  <adachan@apple.com>
691
692         Introduce WebVideoFullscreenInterfaceMac::isPlayingVideoInEnhancedFullscreen() and use it in WebVideoFullscreenManagerProxy::isPlayingVideoInEnhancedFullscreen()
693         https://bugs.webkit.org/show_bug.cgi?id=157493
694
695         Reviewed by Dan Bernstein.
696
697         * platform/mac/WebVideoFullscreenInterfaceMac.h:
698         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
699         (WebCore::WebVideoFullscreenInterfaceMac::isPlayingVideoInEnhancedFullscreen):
700
701 2016-05-09  Simon Fraser  <simon.fraser@apple.com>
702
703         Clean up iOS text autosizing code
704         https://bugs.webkit.org/show_bug.cgi?id=157489
705
706         Reviewed by Zalan Bujtas.
707
708         Change the TraverseNextInclusionFunction and HeightTypeTraverseNextInclusionFunction
709         to take references.
710         
711         Use downcast<> more.
712         
713         Whitespace cleanup.
714
715         * rendering/RenderBlockFlow.cpp:
716         (WebCore::isNonBlocksOrNonFixedHeightListItems):
717         * rendering/RenderElement.cpp:
718         (WebCore::includeNonFixedHeight):
719         * rendering/RenderObject.cpp:
720         (WebCore::RenderObject::traverseNext):
721         * rendering/RenderObject.h:
722         * rendering/TextAutoSizing.cpp:
723         (WebCore::TextAutoSizingValue::adjustNodeSizes):
724         (WebCore::TextAutoSizingValue::reset):
725
726 2016-05-09  Anders Carlsson  <andersca@apple.com>
727
728         Add injected bundle SPI for getting favicon and touch icon URLs
729         https://bugs.webkit.org/show_bug.cgi?id=157435
730
731         Reviewed by Darin Adler.
732
733         * CMakeLists.txt:
734         Add new files.
735
736         * WebCore.xcodeproj/project.pbxproj:
737         Add new files.
738
739         * html/HTMLLinkElement.cpp:
740         (WebCore::HTMLLinkElement::iconType):
741         * html/HTMLLinkElement.h:
742         Rename LinkRelAttribute::IconType to LinkIconType.
743
744         * html/LinkIconCollector.cpp: Added.
745         (WebCore::iconSize):
746         New helper function that returns the icon size for an icon.
747
748         (WebCore::compareIcons):
749         Icon comparison function, to be used by for sorting.
750
751         (LinkIconCollector::iconsOfTypes):
752         Gather the right icons, sort them (descending by size) and return them.
753
754         * html/LinkIconCollector.h:
755         Added.
756
757         * html/LinkIconType.h:
758         Move icon type declarations here and arrange them so we can use them in an OptionSet.
759
760         * html/LinkRelAttribute.cpp:
761         (WebCore::LinkRelAttribute::LinkRelAttribute):
762         * html/LinkRelAttribute.h:
763         * loader/icon/IconController.cpp:
764         (WebCore::iconFromLinkElements):
765         Rename IconType to LinkIconType.
766
767 2016-05-06  Simon Fraser  <simon.fraser@apple.com>
768
769         [iOS WK2] Font size increases on some pages after navigating then going back
770         https://bugs.webkit.org/show_bug.cgi?id=157441
771         rdar://problem/22873240
772
773         Reviewed by Darin Adler.
774
775         Sometimes I want to dump ViewportConfigurations from WebKit2 so export dump().
776
777         Test: fast/text-autosizing/ios/text-autosizing-after-back.html
778
779         * page/ViewportConfiguration.h:
780
781 2016-05-09  Eric Carlson  <eric.carlson@apple.com>
782
783         "Main content" restrictions should not apply to media documents
784         https://bugs.webkit.org/show_bug.cgi?id=157479
785         <rdar://problem/25840861>
786
787         Reviewed by Jer Noble.
788
789         No new tests, this change only applies to media documents in a top level document so it
790         isn't possible to have a layout test.
791
792         * html/HTMLMediaElement.cpp:
793         (WebCore::HTMLMediaElement::HTMLMediaElement): Don't apply restrictions to a media document.
794
795 2016-05-09  Dean Jackson  <dino@apple.com>
796
797         Update Picture-in-picture artwork
798         https://bugs.webkit.org/show_bug.cgi?id=157484
799         <rdar://problem/26177784>
800
801         Reviewed by Eric Carlson.
802
803         We have new artwork for the picture-in-picture presentation mode. I
804         also converted it to use SVG (and moved the button style to a
805         more consistent part of the file).
806
807         * Modules/mediacontrols/mediaControlsApple.css:
808         (video::-webkit-media-controls-panel .picture-in-picture-button):
809         (video::-webkit-media-controls-panel .picture-in-picture-button.return-from-picture-in-picture):
810         (video::-webkit-media-controls-panel .picture-in-picture-button:active):
811         (video::-webkit-media-controls-panel .picture-in-picture-button.return-from-picture-in-picture:active):
812
813 2016-05-09  Chris Dumez  <cdumez@apple.com>
814
815         Optimize [StrictTypeChecking] on IDL operations
816         https://bugs.webkit.org/show_bug.cgi?id=157467
817
818         Reviewed by Darin Adler.
819
820         Optimize [StrictTypeChecking] on IDL operations so that:
821         - Only generate extra code for nullable parameters because for non-nullable
822           parameters, JSXXX::toWrapped() will return null in case of a bad input
823           type. We will then throw a TypeError when null-checking it already.
824         - After the JSValue::isNullOrUndefined() check, avoid calling
825           JSXXX::toWrapped() and set nativeValue to nullptr directly.
826         - Drop the check for JSValue::inherits(JSXXX::info()) and just do a null
827           check on the value returned by JSXXX::toWrapped(). toWrapped() already
828           does a JSValue::inherits(JSXXX::info() check. Since we only call
829           toWrapped() if the JSValue is not null/undefined, a null return value
830           always indicates a bad input type.
831
832         Also update the TypeError message to be more useful when passing null
833         for non-nullable parameters or assigning null to a non-nullable
834         attribute. The message is now consistent with the one used for strict
835         type checking.
836
837         No new tests, rebaselined existing tests.
838
839         * bindings/js/JSDOMBinding.h:
840         * bindings/scripts/CodeGeneratorJS.pm:
841         (GenerateImplementation):
842         (GenerateParametersCheck):
843         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
844         (WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunction):
845         * bindings/scripts/test/JS/JSTestInterface.cpp:
846         (WebCore::setJSTestInterfaceImplementsNode):
847         (WebCore::setJSTestInterfaceSupplementalNode):
848         (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
849         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
850         * bindings/scripts/test/JS/JSTestObj.cpp:
851         (WebCore::setJSTestObjTestObjAttr):
852         (WebCore::setJSTestObjLenientTestObjAttr):
853         (WebCore::setJSTestObjXMLObjAttr):
854         (WebCore::setJSTestObjTypedArrayAttr):
855         (WebCore::setJSTestObjWithScriptExecutionContextAttribute):
856         (WebCore::setJSTestObjWithScriptStateAttributeRaises):
857         (WebCore::setJSTestObjWithScriptExecutionContextAttributeRaises):
858         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute):
859         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
860         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
861         (WebCore::setJSTestObjWithScriptArgumentsAndCallStackAttribute):
862         (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs):
863         (WebCore::jsTestObjPrototypeFunctionByteMethodWithArgs):
864         (WebCore::jsTestObjPrototypeFunctionOctetMethodWithArgs):
865         (WebCore::jsTestObjPrototypeFunctionLongMethodWithArgs):
866         (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
867         (WebCore::jsTestObjPrototypeFunctionMethodWithXPathNSResolverParameter):
868         (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
869         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod8):
870         (WebCore::jsTestObjPrototypeFunctionDomStringListFunction):
871         (WebCore::jsTestObjPrototypeFunctionConvert1):
872         (WebCore::jsTestObjPrototypeFunctionStrictFunctionWithSequence):
873         (WebCore::jsTestObjPrototypeFunctionStrictFunctionWithArray):
874         (WebCore::jsTestObjPrototypeFunctionVariadicNodeMethod):
875         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise):
876         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
877         (WebCore::constructJSTestOverloadedConstructors1):
878         (WebCore::constructJSTestOverloadedConstructors2):
879         (WebCore::constructJSTestOverloadedConstructors3):
880         * bindings/scripts/test/TestObj.idl:
881
882 2016-05-09  Tim Horton  <timothy_horton@apple.com>
883
884         Download progress on attachment elements sometimes exceeds element bounds
885         https://bugs.webkit.org/show_bug.cgi?id=157440
886         <rdar://problem/25245440>
887
888         Reviewed by Darin Adler.
889
890         In the case of very large dynamic type sizes, we can overflow the
891         bounds of the attachment. It turns out that we used to limit to one
892         line in many cases anyway, so only wrap if we have only a title and/or icon.
893         This looks better when you have many of the other elements even in
894         non-large-type modes.
895
896         * rendering/RenderThemeIOS.mm:
897         (WebCore::AttachmentInfo::buildTitleLines):
898         (WebCore::AttachmentInfo::AttachmentInfo):
899         Limit the title to a single line if we have anything
900         other than a title and icon.
901
902         (WebCore::attachmentBorderPath):
903         (WebCore::paintAttachmentBorder):
904         (WebCore::RenderThemeIOS::paintAttachment):
905         Clip to the border, so that even if somehow we paint outside of
906         the bounds, we don't paint over other parts of the page.
907
908 2016-05-09  Ryosuke Niwa  <rniwa@webkit.org>
909
910         REGRESSION (198056): Unable to use edit buttons on WordPress
911         https://bugs.webkit.org/show_bug.cgi?id=157475
912
913         Reviewed by Antti Koivisto.
914
915         Renamed Event.prototype.deepPath() to composedPath() per discussions on
916         https://github.com/whatwg/dom/issues/242 as the old name was not Web compatible.
917
918         Test: fast/shadow-dom/Extensions-to-Event-Interface.html
919
920         * dom/Event.cpp:
921         (WebCore::Event::composedPath): Renamed from deepPath.
922         * dom/Event.h:
923         * dom/Event.idl:
924
925 2016-05-09  Alex Christensen  <achristensen@webkit.org>
926
927         Don't use DiskCache for media resource loads
928         https://bugs.webkit.org/show_bug.cgi?id=157405
929
930         Reviewed by Darin Adler.
931
932         http/tests/security/video-cross-origin-caching.html was loading from the disk cache.
933         This patch adds an assertion that fires in that test without this fix.
934
935         * loader/MediaResourceLoader.cpp:
936         (WebCore::MediaResourceLoader::requestResource):
937         * platform/graphics/PlatformMediaResourceLoader.h:
938         * platform/network/ResourceRequestBase.h:
939         (WebCore::ResourceRequestBase::hiddenFromInspector):
940         (WebCore::ResourceRequestBase::setHiddenFromInspector):
941         (WebCore::ResourceRequestBase::requester):
942         (WebCore::ResourceRequestBase::setRequester):
943         * platform/network/cocoa/WebCoreNSURLSession.mm:
944         (-[WebCoreNSURLSessionDataTask _restart]):
945         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:]):
946
947 2016-05-09  Ryosuke Niwa  <rniwa@webkit.org>
948
949         Refactor FocusController::findFocusableElementRecursively
950         https://bugs.webkit.org/show_bug.cgi?id=157415
951
952         Reviewed by Darin Adler.
953
954         Refactor FocusController::findFocusableElementRecursively and related functions. Extracted two functions:
955         nextFocusableElementWithinScope and previousFocusableElementWithinScope out of it since they didn't really share
956         any code other than calling findFocusableElement at the beginning.
957
958         Also renamed internal variant of nextFocusableElement and previousFocusableElement to nextFocusableElementOrScopeOwner
959         and previousFocusableElementOrScopeOwner. It was confusing to have these internal functions in addition to public
960         member functions that are used in Objective-C DOM API.
961
962         No new tests are added since there should be no behavioral change.
963
964         * page/FocusController.cpp:
965         (WebCore::FocusController::findFocusableElementDescendingDownIntoFrameDocument): Added a FIXME.
966         (WebCore::FocusController::advanceFocusInDocumentOrder): Use findFocusableElementAcrossFocusScope instead of manually
967         calling findFocusableElementRecursively and findFocusableElementDescendingDownIntoFrameDocument separately.
968         (WebCore::FocusController::findFocusableElementAcrossFocusScope): Now that findFocusableElementWithinScope calls
969         findFocusableElementDescendingDownIntoFrameDocument internally, there is no need to keep around "found" local variable.
970         Introduce a few early exists for a better clarity.
971         (WebCore::FocusController::findFocusableElementWithinScope): Renamed from findFocusableElementRecursively. Also call
972         findFocusableElementDescendingDownIntoFrameDocument here instead of findFocusableElementAcrossFocusScope.
973         (WebCore::FocusController::nextFocusableElementWithinScope): Extracted from findFocusableElementRecursively.
974         (WebCore::FocusController::previousFocusableElementWithinScope): Ditto.
975         (WebCore::FocusController::findFocusableElement):
976         (WebCore::FocusController::nextFocusableElement): Added a FIXME.
977         (WebCore::FocusController::previousFocusableElement): Ditto.
978         (WebCore::FocusController::findFocusableElementOrScopeOwner): Renamed from findFocusableElement for clarity.
979         (WebCore::FocusController::nextFocusableElementOrScopeOwner): Ditto from nextFocusableElement.
980         (WebCore::FocusController::previousFocusableElementOrScopeOwner): Ditto from nextFocusableElement.
981         * page/FocusController.h:
982
983 2016-05-09  Manuel Rego Casasnovas  <rego@igalia.com>
984
985         [css-grid] Fix static position for positioned grid items
986         https://bugs.webkit.org/show_bug.cgi?id=157417
987
988         Reviewed by Darin Adler.
989
990         The spec was updated to define properly the static position
991         for positioned grid items, but we didn't update the implementation yet:
992         https://drafts.csswg.org/css-grid-1/issues-wd-20150108#issue-1
993
994         We were only setting the static position when the start line
995         was not auto. Otherwise we were using the default one
996         which includes the padding.
997         With the spec change we need to set it always,
998         even if the start line is auto.
999
1000         * rendering/RenderGrid.cpp:
1001         (WebCore::RenderGrid::layoutPositionedObject):
1002         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
1003
1004 2016-05-08  Frederic Wang  <fwang@igalia.com>
1005
1006         RenderMathMLOperator: refactor management of stretchy data and italic correction
1007         https://bugs.webkit.org/show_bug.cgi?id=156913
1008
1009         Reviewed by Darin Adler.
1010
1011         No new tests, behavior is not changed.
1012
1013         The stretchy data uses a shared space to describe horizontal / vertical directions and
1014         unstretched / size variant / glyph assembly. We use a simple struct with some unions to
1015         represent it instead of the current implementation with a class.
1016         We also modify the signature of some functions to retrieve display operator and stretchy
1017         data to use that new structure and prepare the move to a separate MathOperator class.
1018         Finally, we introduce some helper functions to easily set the stretchy data.
1019
1020         * rendering/mathml/RenderMathMLOperator.cpp:
1021         (WebCore::RenderMathMLOperator::computePreferredLogicalWidths): Use the new data members and
1022         function signatures.
1023         (WebCore::RenderMathMLOperator::setSizeVariant): New helper function to set a size variant.
1024         (WebCore::RenderMathMLOperator::setGlyphAssembly): New helper function to set a glyph
1025         assembly.
1026         (WebCore::RenderMathMLOperator::getGlyphAssemblyFallBack): We change the signature to use a
1027         GlyphAssemblyData.
1028         (WebCore::RenderMathMLOperator::findDisplayStyleLargeOperator): We rename the function and
1029         change its signature to remove the return value. We now also set the italic correction when
1030         a display operator is found.
1031         (WebCore::RenderMathMLOperator::findStretchyData): We change the signature to introduce a
1032         target size and remove the return value. This also does the early return when the base glyph
1033         is large enough.
1034         (WebCore::RenderMathMLOperator::updateStyle): We use the new data members and function
1035         signatures. The check for the base glyph size is now done in findStretchyData, so we just
1036         check whether m_stretchType is Unstretched to do an early return.
1037         (WebCore::RenderMathMLOperator::firstLineBaseline): We use m_stretchType.
1038         (WebCore::RenderMathMLOperator::computeLogicalHeight): Ditto.
1039         (WebCore::RenderMathMLOperator::fillWithVerticalExtensionGlyph): Use the new class members.
1040         (WebCore::RenderMathMLOperator::fillWithHorizontalExtensionGlyph): Ditto.
1041         (WebCore::RenderMathMLOperator::paint): Ditto.
1042         (WebCore::RenderMathMLOperator::paintVerticalGlyphAssembly): Ditto.
1043         (WebCore::RenderMathMLOperator::paintHorizontalGlyphAssembly): Ditto.
1044         (WebCore::RenderMathMLOperator::paintChildren): Ditto.
1045         (WebCore::RenderMathMLOperator::trailingSpaceError): Ditto.
1046         (WebCore::RenderMathMLOperator::italicCorrection): Moved to RenderMathMLOperator.h.
1047         (WebCore::RenderMathMLOperator::getDisplayStyleLargeOperator): Deleted.
1048         * rendering/mathml/RenderMathMLOperator.h:
1049         (WebCore::RenderMathMLOperator::italicCorrection): We just return m_italicCorrection.
1050         (WebCore::RenderMathMLOperator::GlyphAssemblyData::GlyphAssemblyData): New class to store an
1051         assembly of GlyphData.
1052         (WebCore::RenderMathMLOperator::StretchyData::mode): Deleted.
1053         (WebCore::RenderMathMLOperator::StretchyData::variant): Deleted.
1054         (WebCore::RenderMathMLOperator::StretchyData::top): Deleted.
1055         (WebCore::RenderMathMLOperator::StretchyData::extension): Deleted.
1056         (WebCore::RenderMathMLOperator::StretchyData::bottom): Deleted.
1057         (WebCore::RenderMathMLOperator::StretchyData::middle): Deleted.
1058         (WebCore::RenderMathMLOperator::StretchyData::left): Deleted.
1059         (WebCore::RenderMathMLOperator::StretchyData::right): Deleted.
1060         (WebCore::RenderMathMLOperator::StretchyData::setNormalMode): Deleted.
1061         (WebCore::RenderMathMLOperator::StretchyData::setSizeVariantMode): Deleted.
1062         (WebCore::RenderMathMLOperator::StretchyData::setGlyphAssemblyMode): Deleted.
1063         (WebCore::RenderMathMLOperator::StretchyData::StretchyData): Deleted.
1064
1065 2016-05-08  Zalan Bujtas  <zalan@apple.com>
1066
1067         iOS selection: Use inflow containing block for positioned <br>.
1068         https://bugs.webkit.org/show_bug.cgi?id=157115
1069         <rdar://problem/25969295>
1070
1071         Reviewed by Ryosuke Niwa.
1072
1073         Similarly to RenderText, we should just use the inflow containing block for
1074         selected <br> even when it is positioned out of flow. This visually matches Mac OS X
1075         behaviour (selection painting does not get extended to the positioned <br>).
1076
1077         Test: fast/text/fixed-positioned-br-crash.html
1078
1079         * rendering/RenderLineBreak.cpp:
1080         (WebCore::RenderLineBreak::collectSelectionRects):
1081
1082 2016-05-08  Myles C. Maxfield  <mmaxfield@apple.com>
1083
1084         [iOS] Build fix after r200563
1085
1086         Unreviewed.
1087
1088         * editing/cocoa/HTMLConverter.mm:
1089         (_font):
1090
1091 2016-05-08  Myles C. Maxfield  <mmaxfield@apple.com>
1092
1093         [OS X] Migrate our Font classes entirely off of NSFont
1094         https://bugs.webkit.org/show_bug.cgi?id=157464
1095
1096         Reviewed by Darin Adler.
1097
1098         Because NSFont and CTFont are toll-free-bridged, we don't need NSFont at all anywhere.
1099
1100         No new tests because there is no behavior change.
1101
1102         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1103         (accessibilitySearchCriteriaForSearchPredicateParameterizedAttribute):
1104         (textMarkerRangeFromRange):
1105         (visiblePositionForStartOfTextMarkerRange):
1106         (visiblePositionForEndOfTextMarkerRange):
1107         (AXAttributedStringRangeIsValid):
1108         (AXAttributeStringSetFont):
1109         (CreateCGColorIfDifferent):
1110         (AXAttributeStringSetStyle):
1111         (textMarkerRangeFromVisiblePositions):
1112         * bindings/objc/DOM.mm:
1113         (-[DOMElement _font]):
1114         * bindings/objc/DOMPrivate.h:
1115         * editing/cocoa/HTMLConverter.mm:
1116         (_font):
1117         (WebCore::editingAttributedStringFromRange):
1118         * editing/mac/EditorMac.mm:
1119         (WebCore::Editor::fontAttributesForSelectionStart):
1120         * platform/graphics/Font.h:
1121         (WebCore::Font::getCTFont):
1122         (WebCore::Font::getNSFont): Deleted.
1123         * platform/graphics/FontPlatformData.h:
1124         (WebCore::FontPlatformData::nsFont): Deleted.
1125         * platform/graphics/cocoa/FontCocoa.mm:
1126         (WebCore::Font::determinePitch):
1127         (WebCore::advanceForColorBitmapFont):
1128         (WebCore::Font::platformWidthForGlyph):
1129         (WebCore::renderingStyle): Deleted.
1130         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1131
1132 2016-05-08  Chris Dumez  <cdumez@apple.com>
1133
1134         [Bindings] Simplify [RequiresExistingAtomicString] IDL extended attribute handling
1135         https://bugs.webkit.org/show_bug.cgi?id=157465
1136
1137         Reviewed by Darin Adler.
1138
1139         Simplify [RequiresExistingAtomicString] IDL extended attribute handling
1140         in the bindings generator.
1141
1142         * bindings/scripts/CodeGeneratorJS.pm:
1143         (GenerateParametersCheck):
1144         Drop code specific to [RequiresExistingAtomicString].
1145
1146         (JSValueToNative):
1147         Deal with [RequiresExistingAtomicString] IDL extended attribute,
1148         similarly to [AtomicString] and [TreatNullAs].
1149
1150         * bindings/scripts/test/JS/JSTestObj.cpp:
1151         * bindings/scripts/test/TestObj.idl:
1152         Add bindings test coverage.
1153
1154         * dom/DocumentFragment.cpp:
1155         (WebCore::DocumentFragment::getElementById):
1156         * svg/SVGSVGElement.cpp:
1157         (WebCore::SVGSVGElement::getElementById):
1158         Add null check for the id parameter. The generated bindings used to do
1159         this null check for us but it is no longer the case (to make the bindings
1160         generator a bit simpler). This extended attribute is not commonly used
1161         and is meant as a micro-optimization for getElementById().
1162
1163 2016-05-08  David Kilzer  <ddkilzer@apple.com>
1164
1165         Roll out: ThreadSanitizer: Data race and thread leak in WebCore::ScrollingThread::createThreadIfNeeded
1166         <https://webkit.org/b/157462>
1167
1168         This reverts commit r200554.
1169
1170         This doesn't fix the data race, and the thread leak is a
1171         separate issue.
1172
1173         * page/scrolling/ScrollingThread.cpp:
1174         (WebCore::ScrollingThread::createThreadIfNeeded): Roll out the
1175         change.
1176
1177 2016-05-08  Darin Adler  <darin@apple.com>
1178
1179         Follow-up to that last patch (missed review comments).
1180
1181         * page/EventSource.cpp:
1182         (WebCore::EventSource::parseEventStream): Pre-increment, not post-increment.
1183         (WebCore::EventSource::dispatchMessageEvent): More elegant form without explicit StringView.
1184
1185 2016-05-08  Darin Adler  <darin@apple.com>
1186
1187         Change EventSource constructor to take an IDL dictionary instead of a WebCore::Dictionary
1188         https://bugs.webkit.org/show_bug.cgi?id=157459
1189
1190         Reviewed by Chris Dumez.
1191
1192         Patch also includes some updating of EventSource class to modern idioms.
1193
1194         * page/EventSource.cpp:
1195         (WebCore::EventSource::EventSource): Initialize based on Init.
1196         (WebCore::EventSource::create): Take/pass Init instead of Dictionary.
1197
1198         * bindings/js/SerializedScriptValue.cpp:
1199         (WebCore::CloneSerializer::serialize): Take a StringView instead of a string
1200         so callers don't have to allocate a String just to use this.
1201         (WebCore::SerializedScriptValue::create): Ditto.
1202         * bindings/js/SerializedScriptValue.h: Ditto.
1203
1204         * page/EventSource.cpp: Changed defaultReconnectDelay to be a uint64_t
1205         instead of an unsigned long long.
1206         (WebCore::EventSource::EventSource): Changed constructor to take a struct
1207         instead of a Dictionary for eventSourceInit. Also moved initialization of
1208         data members to the header and used ASCIILiteral.
1209         (WebCore::EventSource::create): Changed type to Init and streamlined code
1210         a little bit using auto.
1211         (WebCore::EventSource::connect): Used a reference instead of a pointer.
1212         Also added a FIXME since I noticed that m_requestInFlight is probably not
1213         needed, since it's basically the same thing as "is m_loader null".
1214         (WebCore::EventSource::url): Moved to the header and made it inline.
1215         (WebCore::EventSource::networkRequestEnded): Removed unneeded check that
1216         is already done by all callers and turned it into an assertion.
1217         (WebCore::EventSource::withCredentials): Ditto.
1218         (WebCore::EventSource::readyState): Ditto.
1219         (WebCore::EventSource::responseIsValid): Added. Helper function to make
1220         the logic in didReceiveResponse easier to read. Fixed logic to compare
1221         MIME type ignoring ASCII case, since that's how MIME types work.
1222         (WebCore::EventSource::didReceiveResponse): Use the helper above, and also
1223         move the m_eventStreamOrigin set up code into the valid response case,
1224         since there is no point doing it if the response is not valid. Also use
1225         the early return idiom.
1226         (WebCore::EventSource::didReceiveData): Removed the unneeded explicit
1227         conversion to StringView here. Also removed a FIXME that I fixed.
1228         (WebCore::EventSource::didFinishLoading): Added code to flush the decoder
1229         as mentioned in didReceiveData. Added FIXME about peculiar clearing code
1230         that exists only here. Removed check for empty receive buffer and data
1231         that is not needed since parseEventStream does sufficient checking.
1232         (WebCore::EventSource::didFail): Added FIXME because of things that
1233         didFinishLoading does that seem equally valuable here.
1234         (WebCore::EventSource::parseEventStream): Tweaked types and names of local
1235         variables, and changed to use Optional instead of magic number -1. Also
1236         added a FIXME about how the buffer type is probably not right since we
1237         keep moving the characters in the buffer as we consume the start of it.
1238         (WebCore::EventSource::parseEventStreamLine): Refactor and reorganize so
1239         this doesn't do so much string allocation and is easier to read
1240         (WebCore::EventSource::canSuspendForDocumentSuspension): Tweaked comment.
1241         (WebCore::EventSource::dispatchMessageEvent): Renamed this from
1242         createMessageEvent, and moved more code in here. We now don't have to
1243         allocate a temporary string just to pass it to SerializedScriptValue.
1244
1245         * page/EventSource.h: Updated for changes above. Use pragma once.
1246         Define and use EventSource::Init struct. Other small cleanup.
1247
1248         * page/EventSource.idl: Define EventSourceInit dictionary and use it.
1249         Other small cleanup.
1250
1251 2016-05-07  Darin Adler  <darin@apple.com>
1252
1253         Change HTMLSlotElement::assignedNodes to take a IDL dictionary instead of a WebCore::Dictionary
1254         https://bugs.webkit.org/show_bug.cgi?id=157457
1255
1256         Reviewed by Chris Dumez.
1257
1258         * html/HTMLSlotElement.cpp:
1259         (WebCore::HTMLSlotElement::removedFrom): Fixed typo in comment.
1260         (WebCore::HTMLSlotElement::assignedNodes): Renamed assignedNodesForBindings back to this
1261         and changed the argument type to Optional<AssignedNodesOptions> instead of Dictionary.
1262         Also streamlined the logic a bit.
1263         (WebCore::HTMLSlotElement::enqueueSlotChangeEvent): Changed to use a pointer to the
1264         enqueued event instead of a boolean. With only a boolean, we could end up clearing the
1265         flag in cases where we don't really want to.
1266         (WebCore::HTMLSlotElement::dispatchEvent): Ditto.
1267         (WebCore::HTMLSlotElement::assignedNodesForBindings): Deleted.
1268         * html/HTMLSlotElement.h: Use pragma once. Added AssignedNodeOptions. Changed for the
1269         above, including changing the data member.
1270         * html/HTMLSlotElement.idl: Removed use of ImplementedAs. Fixed the type of the options
1271         dictionary.
1272
1273 2016-05-08  Chris Dumez  <cdumez@apple.com>
1274
1275         [Bindings] Add convert<>() template specializations for integer types
1276         https://bugs.webkit.org/show_bug.cgi?id=157458
1277
1278         Reviewed by Darin Adler.
1279
1280         Add convert<>() template specializations for integer types and use them
1281         in the JS bindings. Also, treat non-32bit types the same way as the
1282         32bit ones, allowing the compiler to optimize out branching based on
1283         the IntegerConversionConfiguration.
1284
1285         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
1286
1287         * bindings/js/JSDOMBinding.cpp:
1288         (WebCore::enforceRange):
1289         (WebCore::toSmallerInt):
1290         (WebCore::toSmallerUInt):
1291         (WebCore::toInt8EnforceRange):
1292         (WebCore::toUInt8EnforceRange):
1293         (WebCore::toInt8Clamp):
1294         (WebCore::toUInt8Clamp):
1295         (WebCore::toInt8):
1296         (WebCore::toUInt8):
1297         (WebCore::toInt16EnforceRange):
1298         (WebCore::toUInt16EnforceRange):
1299         (WebCore::toInt16Clamp):
1300         (WebCore::toUInt16Clamp):
1301         (WebCore::toInt16):
1302         (WebCore::toUInt16):
1303         (WebCore::toInt32EnforceRange):
1304         (WebCore::toInt32Clamp):
1305         (WebCore::toUInt32Clamp):
1306         (WebCore::toUInt32EnforceRange):
1307         (WebCore::toInt64EnforceRange):
1308         (WebCore::toUInt64EnforceRange):
1309         (WebCore::toInt64Clamp):
1310         (WebCore::toUInt64Clamp):
1311         (WebCore::toInt64):
1312         (WebCore::toUInt64):
1313         * bindings/js/JSDOMBinding.h:
1314         - Splt some integer conversion functions into 3 Normal / Clamp /
1315           Enforce versions, similarly to what was done for 32bit types already.
1316           This is so that these can be called from the inline functions in
1317           JSDOMConvert.h, allowing the compiler to optimize out the branches.
1318         - Get rid of some unnecessary state.hadException() checks.
1319
1320         * bindings/js/JSDOMConvert.h:
1321         Add convert<> specializations for integer types.
1322
1323         * bindings/js/JSNodeFilterCustom.cpp:
1324         (WebCore::JSNodeFilter::acceptNode):
1325
1326         * bindings/scripts/CodeGenerator.pm:
1327         - Add utility function to distinguish integer types.
1328         - Have IsNumericType() using the integerType / floatingPointType
1329           hashes to avoid duplication.
1330         - Stop int / unsigned int from integer types as those are not
1331           in Web IDL and they are not used.
1332
1333         * bindings/scripts/CodeGeneratorJS.pm:
1334         (GetIntegerConversionType):
1335         (JSValueToNative):
1336         Use convert<>() for converting JSValue to integer types.
1337
1338         * bindings/scripts/IDLParser.pm:
1339         Stop allowing int / unsigned int types as those are not in Web IDL.
1340
1341         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1342         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1343         * bindings/scripts/test/JS/JSTestObj.cpp:
1344         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1345         Rebaseline bindings tests.
1346
1347 2016-05-08  Darin Adler  <darin@apple.com>
1348
1349         Correct dictionary bindings handling of optional, null, and undefined
1350         https://bugs.webkit.org/show_bug.cgi?id=157463
1351
1352         Reviewed by Chris Dumez.
1353
1354         * bindings/js/JSDOMBinding.cpp:
1355         (WebCore::propertyValue): Deleted.
1356         * bindings/js/JSDOMBinding.h: Deleted propertyValue, not all that helpful for now.
1357
1358         * bindings/scripts/CodeGeneratorJS.pm:
1359         (GenerateDictionaryImplementationContent): Added a new early exit for convert to
1360         a dictionary type when the value is undefined or null and all members are either
1361         optional or have a default value. This returns the default values for everything
1362         without raising an exception. Added checking that requires that the dictionary
1363         argument is an object and not a regular expression, since that's also called for
1364         in the latest draft of the Web IDL specification. This ends up speeding up the
1365         code a bit since we now use JSObject::get for properties instead of JSValue::get.
1366         (GenerateParametersCheck): Renamed some local variables. Taught the code that
1367         optional dictionaries all have a default value; before it was doing that for the
1368         type "Dictionary" but not the real dictionary types (IsDictionaryType).
1369
1370         * bindings/scripts/test/JS/JSTestObj.cpp: Regenerated.
1371
1372         * css/FontFace.cpp:
1373         (WebCore::FontFace::create): Changed argument to be Descriptors instead of
1374         Optional<Descriptors>. It would have compiled the other way, but there is now
1375         no caller that will pass a null. Because the IDL dictionary support was new,
1376         this was the only place that was doing it wrong. Good that we "nipped it in the bud"
1377         before doing this in more places.
1378         * css/FontFace.h: Ditto.
1379
1380 2016-05-08  David Kilzer  <ddkilzer@apple.com>
1381
1382         ThreadSanitizer: Data race and thread leak in WebCore::ScrollingThread::createThreadIfNeeded
1383         <https://webkit.org/b/157462>
1384
1385         Reviewed by Darin Adler.
1386
1387         Reproduced with multiple existing tests.
1388
1389         * page/scrolling/ScrollingThread.cpp:
1390         (WebCore::ScrollingThread::createThreadIfNeeded): Use a
1391         std::once_flag to initialize Scrolling Thread since this may be
1392         called from background threads.
1393
1394 2016-05-08  Darin Adler  <darin@apple.com>
1395
1396         Try to fix build without rolling out that last change.
1397
1398         * bindings/js/JSDOMConvert.h:
1399         (WebCore::convert<Vector<String>>): Make this an inline. Just call toNativeArray.
1400
1401 2016-05-07  Darin Adler  <darin@apple.com>
1402
1403         Change MutationObserver::observe to take an IDL dictionary, rather than WebCore::Dictionary
1404         https://bugs.webkit.org/show_bug.cgi?id=157456
1405
1406         Reviewed by Chris Dumez.
1407
1408         * bindings/js/JSDOMConvert.h:
1409         (WebCore::convertOptional): Use a specific Optional null rather than Nullopt so we
1410         can compile the ternary operator.
1411         (WebCore::convert<bool>): Added.
1412         (WebCore::convert<Vector<String>>): Added. Later we probably need to change convert to use
1413         a member function of a class template rather than a function template so we can make partial
1414         specialization work and do this just once for all Vector<T>.
1415
1416         * bindings/js/JSMutationObserverCustom.cpp:
1417         (WebCore::JSMutationObserverOwner::isReachableFromOpaqueRoots): Streamlined code and removed
1418         some local variables. Changed to call the new observedNodes rather than getObservedNodes.
1419
1420         * bindings/scripts/CodeGeneratorJS.pm:
1421         (GenerateDictionaryImplementationContent): Fixed bug where we tried to call the version of
1422         the convert function with a default value even when there was none.
1423
1424         * bindings/scripts/test/TestObj.idl: Added a test case basically identical to what's needed
1425         in MutationObserver.idl.
1426         * bindings/scripts/test/JS/JSTestObj.cpp: Regenerated.
1427
1428         * dom/MutationObserver.cpp:
1429         (WebCore::MutationObserver::observe): Chagned function to take a MutationObserver::Init
1430         instead of a Dictionary.
1431         (WebCore::MutationObserver::observationStarted): Changed argument type to a reference.
1432         (WebCore::MutationObserver::observationEnded): Ditto.
1433         (WebCore::MutationObserverMicrotask): Removed unneeded explicit constructor and destructor.
1434         (WebCore::queueMutationObserverCompoundMicrotask): Got rid of unnneeded local variable.
1435         (WebCore::MutationObserver::observedNodes): Renamed to remove the "get" prefix.
1436
1437         * dom/MutationObserver.h: Reduced includes. Added MutationObserver::Init struct and
1438         used it for the type of the argument to the observe function. Changed a few argument
1439         types and removed unused forward declarations.
1440
1441         * dom/MutationObserver.idl: Added MutationObserverInit and used it instead of Dictionary.
1442
1443         * dom/MutationObserverRegistration.cpp:
1444         (WebCore::MutationObserverRegistration::MutationObserverRegistration): Pass a reference.
1445         (WebCore::MutationObserverRegistration::~MutationObserverRegistration): Ditto.
1446
1447 2016-05-07  Chris Dumez  <cdumez@apple.com>
1448
1449         Reduce special handling of XPathNSResolver type in the bindings
1450         https://bugs.webkit.org/show_bug.cgi?id=157454
1451
1452         Reviewed by Darin Adler.
1453
1454         Reduce special handling of XPathNSResolver type in the bindings.
1455
1456         * CMakeLists.txt:
1457         * WebCore.xcodeproj/project.pbxproj:
1458         * bindings/js/JSBindingsAllInOne.cpp:
1459         Add new JSXPathNSResolverCustom.cpp file.
1460
1461         * bindings/js/JSDOMStringListCustom.cpp:
1462         (WebCore::JSDOMStringList::toWrapped):
1463         Take the ExecState by reference instead of pointer.
1464
1465         * bindings/js/JSDOMWindowCustom.cpp:
1466         (WebCore::JSDOMWindow::toWrapped):
1467         Update to take an ExecState& parameter. The bindings now pass
1468         an ExecState to all custom toWrapped() methods for consistency
1469         and flexibility.
1470
1471         * bindings/js/JSDictionary.cpp:
1472         (WebCore::JSDictionary::convertValue):
1473         Pass an ExecState now that those toWrapped() methods expect
1474         it.
1475
1476         * bindings/js/JSEventTargetCustom.cpp:
1477         (WebCore::JSEventTarget::toWrapped):
1478         Update to take an ExecState& parameter.
1479
1480         * bindings/js/JSIDBDatabaseCustom.cpp:
1481         (WebCore::JSIDBDatabase::transaction):
1482         Pass ExecState by reference instead of pointer.
1483
1484         * bindings/js/JSMessageEventCustom.cpp:
1485         (WebCore::handleInitMessageEvent):
1486         Pass ExecState to JSDOMWindow::toWrapped().
1487
1488         * bindings/js/JSXPathNSResolverCustom.cpp: Added.
1489         (WebCore::JSXPathNSResolver::toWrapped):
1490         Provide a custom implementation of JSXPathNSResolver::toWrapped()
1491         instead of having the custom code in the bindings generator.
1492
1493         * bindings/scripts/CodeGeneratorJS.pm:
1494         (AddIncludesForType):
1495         Drop special includes for XPathNSResolver as they are no longer needed.
1496
1497         (GenerateHeader):
1498         Drop special casing of certain types for generating the toWrapped()
1499         declaration by:
1500         1. Relying on GetNativeType() for the return value as certain types
1501            return a RefPtr instead of a raw pointer.
1502         2. Adding an extra ExecState parameter when a custom implementation of
1503            toWrapped() is provided, given that some of them need it.
1504
1505         (GenerateParametersCheck):
1506         Drop custom code for XPathNSResolver and use the normal code path for
1507         this type now. The custom code now resides in the custom implementation
1508         of JSXPathNSResolver::toWrapped(), in custom bindings.
1509
1510         (JSValueToNative):
1511         - Drop NodeFilter from the nativeType hash map as it was updated to
1512           be a callback interface a while back.
1513         - Add XPathNSResolver to nativeType hash map so that we now to use
1514           a RefPtr<> instead of a raw pointer in the bindings. We should
1515           probably add an IDL extended attribute for this at some point.
1516         - Drop special casing for DOMStringList which was outdated since there
1517           is no toDOMStringList() function. DOMStringList has a custom
1518           toWrapped() function instead nowadays so we now call this one
1519           instead. We apparently do not have any DOMStringList parameters
1520           outside our bindings tests at the moment, which is why no one
1521           noticed.
1522         - Pass an ExecState to toWrapped() if the interface has the
1523           JSCustomToNativeObject IDL extended attribute.
1524
1525         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
1526         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
1527         * bindings/scripts/test/JS/JSTestObj.cpp:
1528         * bindings/scripts/test/ObjC/DOMTestObj.h:
1529         * bindings/scripts/test/ObjC/DOMTestObj.mm:
1530         * bindings/scripts/test/TestObj.idl:
1531         Add bindings test coverage for having an operation with an
1532         XPathNSResolver parameter.
1533
1534         * dom/Document.idl:
1535         * xml/XPathEvaluator.idl:
1536         Drop some unnecessary default parameter values.
1537
1538         * xml/XPathNSResolver.idl:
1539         Add JSCustomToNativeObject IDL extended attribute so that we can
1540         provide our own custom implementation of JSXPathNSResolver::toWrapped(),
1541         instead of having the custom code in the bindings generator.
1542
1543         * dom/Document.cpp:
1544         (WebCore::Document::createExpression):
1545         (WebCore::Document::evaluate):
1546         * dom/Document.h:
1547         * inspector/InspectorNodeFinder.cpp:
1548         * xml/XPathEvaluator.cpp:
1549         (WebCore::XPathEvaluator::createExpression):
1550         (WebCore::XPathEvaluator::evaluate):
1551         * xml/XPathEvaluator.h:
1552         * xml/XPathExpression.cpp:
1553         (WebCore::XPathExpression::createExpression):
1554         * xml/XPathExpression.h:
1555         * xml/XPathParser.cpp:
1556         (WebCore::XPath::Parser::Parser):
1557         (WebCore::XPath::Parser::parseStatement):
1558         * xml/XPathParser.h:
1559         Take XPathNSResolver parameter as a Ref<XPathNSResolver>&& as this is
1560         what the generated bindings now provide us, given that this sometimes
1561         have to create a wrapper around a JSObject.
1562
1563 2016-05-07  Darin Adler  <darin@apple.com>
1564
1565         Fix crash introduced by the last patch.
1566
1567         Fix suggested by Chris Dumez.
1568
1569         * css/FontFace.cpp:
1570         (WebCore::FontFace::FontFace): Roll out incorrect change. Things were getting
1571         initialized in the wrong order in a change I had made to the FontFace constructor
1572         that takes a CSSFontSelector.
1573
1574 2016-05-07  Chris Dumez  <cdumez@apple.com>
1575
1576         Unreviewed, rebaseline bindings tests after r200547.
1577
1578         * bindings/scripts/test/JS/JSTestObj.cpp:
1579         (WebCore::convert<TestObj::FontFaceDescriptors>):
1580
1581 2016-05-07  Darin Adler  <darin@apple.com>
1582
1583         Next step on dictionary bindings, along with other bindings refinements
1584         https://bugs.webkit.org/show_bug.cgi?id=157451
1585
1586         Reviewed by Chris Dumez.
1587
1588         Converted one dictionary, the one passed to the constructor in FontFace.
1589
1590         * WebCore.xcodeproj/project.pbxproj: Updated for name change of JSDOMBuild.h to
1591         JSDOMConvert.h and also let Xcode update a file type.
1592
1593         * bindings/js/JSDOMBinding.cpp:
1594         (WebCore::propertyValue): Added.
1595         * bindings/js/JSDOMBinding.h: Use pragma once. Remove unnecessary forward declaration.
1596         Move all declarations to the top of the file, separating them from definitions. This
1597         is a small step toward better overview of what's in this file and paves the way for
1598         future simplifications and improvements we can make after we observe patterns.
1599         Also removed a couple unused functions.
1600
1601         * bindings/js/JSDOMConvert.h: Renamed from JSDOMBuild.h.
1602         Renamed function templates from build to convert. Added convertOptional.
1603
1604         * bindings/js/ReadableStreamController.cpp:
1605         (WebCore::callFunction): Use auto and remove some unneeded namespacing.
1606         (WebCore::ReadableStreamController::invoke): Ditto. Also remove use of helper function
1607         getPropertyFromObject, since this was the only call site and it was not very helpful.
1608         (WebCore::ReadableStreamController::isControlledReadableStreamLocked): Ditto.
1609         (WebCore::createReadableStream): Ditto.
1610         (WebCore::getReadableStreamReader): Ditto.
1611
1612         * bindings/scripts/CodeGeneratorJS.pm:
1613         (GenerateEnumerationImplementationContent): Updated for name change from build to
1614         convert and JSDOMBuild.h to JSDOMConvert.h.
1615         (GenerateDictionaryImplementationContent): Ditto. Also added code to handle optional
1616         and added explicit exception checking, using local variables. Not clear longer term
1617         if the local variable approach is OK since this will unnecessarily change types like
1618         const String& to String.
1619         (GenerateParametersCheck): Removed local variable $optional and use $parameter->isOptional
1620         directly consistently. This is slightly clearer because the old code used a mix of the
1621         two, and also is a better pattern for when we refactor this into smaller functions.
1622         Note that this function name is not good any more--this is a lot more then parameter checks.
1623         (GetNativeType): Return appropriate name for dictionary types.
1624         (JSValueToNative): Updated for name change from build to convert and JSDOMBuild.h to
1625         JSDOMConvert.h.
1626
1627         * bindings/scripts/test/JS/JSTestObj.cpp:
1628         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1629         Regenerated results.
1630
1631         * bindings/scripts/test/TestObj.idl: Added another dictionary test case, just a copy
1632         of the current state of the one in FontFace.idl.
1633
1634         * css/CSSFontFace.cpp:
1635         (WebCore::CSSFontFace::setUnicodeRange): Update for simplified UnicodeRange struct.
1636         (WebCore::CSSFontFace::setFeatureSettings): Fix to correctly handle being called
1637         with "normal". Also fix so it doesn't call fontPropertyChanged if nothing changed.
1638         Also got rid of return value, which had no real value: it was returning false for
1639         some bad inputs, but others would just lead to assertions, and the real reason this
1640         was OK is that this function is only passed known-valid values.
1641
1642         * css/CSSFontFace.h: Used prama once. Tweaked formatting. Removed return value from
1643         the setFeatureSettings function. Changed UnicodeRange to be struct with public data
1644         members instead a struct with a constructor and getter functions.
1645
1646         * css/CSSFontSelector.cpp:
1647         (WebCore::CSSFontSelector::addFontFaceRule): Updated since setFeatureSettings no
1648         longer has a boolean return value.
1649
1650         * css/CSSSegmentedFontFace.cpp:
1651         (WebCore::appendFontWithInvalidUnicodeRangeIfLoading): Updated for simplified
1652         UnicodeRange struct.
1653
1654         * css/FontFace.cpp:
1655         (WebCore::valueFromDictionary): Deleted.
1656         (WebCore::FontFace::create): Updated to take the descriptors as a struct instead of
1657         a WebCore::Dictionary. Also made that argument optional as specified in the current
1658         specification draft.
1659         (WebCore::FontFace::setFeatureSettings): Updated since setFeatureSettings no longer
1660         has a boolean return value.
1661         (WebCore::FontFace::unicodeRange): Updated for simplified UnicodeRange struct.
1662
1663         * css/FontFace.h: Used pragma once. Removed unneeded includes and forward declarations.
1664         Derived privately from CSSFontFace::Client. Added a FontFace::Descriptors struct and
1665         used it as an argument to the create function as described above.
1666
1667         * css/FontFace.idl: Added FontFaceDescriptors and changed the argument to the
1668         constructor to be an optional FontFaceDescriptors instead of a Dictionary.
1669
1670 2016-05-07  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1671
1672         Rework FontFace promise attribute handling
1673         https://bugs.webkit.org/show_bug.cgi?id=157310
1674
1675         Reviewed by Myles C. Maxfield.
1676
1677         Making promise attributes cached attributes, so that they are created only once.
1678         They are created in the custom binding code and passed to DOM class as needed.
1679
1680         Removed usage of ExecState& from DOM iterators.
1681
1682         No change should be visible from user scripts.
1683
1684         * Modules/fetch/FetchHeaders.cpp:
1685         (WebCore::FetchHeaders::Iterator::next): Removing ExecState parameter.
1686         * Modules/fetch/FetchHeaders.h:
1687         * bindings/js/JSDOMIterator.h:
1688         (WebCore::keyValueIteratorForEach):
1689         (WebCore::JSDOMIterator<JSWrapper>::next): Ditto.
1690         * bindings/js/JSDOMPromise.cpp:
1691         (WebCore::DeferredWrapper::promise): Removed deferred() and added access to promise directly.
1692         * bindings/js/JSDOMPromise.h:
1693         * bindings/js/JSFontFaceCustom.cpp:
1694         (WebCore::JSFontFace::loaded): Using cached attribute to call FontFace::loaded only once.
1695         * bindings/js/JSFontFaceSetCustom.cpp:
1696         (WebCore::JSFontFaceSet::ready): Using cached attribute to call FontFaceSet::ready only once.
1697         * css/CSSFontFace.cpp:
1698         (WebCore::CSSFontFace::wrapper): Removing ExecState parameter.
1699         * css/CSSFontFace.h:
1700         * css/FontFace.cpp:
1701         (WebCore::FontFace::create): Ditto.
1702         (WebCore::FontFace::FontFace): Ditto.
1703         (WebCore::FontFace::fontStateChanged): Updating promise handling.
1704         (WebCore::FontFace::registerLoaded): Resolving/rejecting promise if backing CSSFontFace loading is ended.
1705         (WebCore::FontFace::load): Calling backing load.
1706         * css/FontFace.h:
1707         * css/FontFaceSet.cpp:
1708         (WebCore::FontFaceSet::Iterator::next): Removing ExecState parameter.
1709         (WebCore::FontFaceSet::load): Removing ExecState and ExceptionCode parameter.
1710         (WebCore::FontFaceSet::registerReady): Resolving promise if ready otherwise storing it for resolving it later.
1711         (WebCore::FontFaceSet::completedLoading): Resolving promise if any is stored.
1712         (WebCore::FontFaceSet::create): Deleted.
1713         * css/FontFaceSet.h:
1714         * css/FontFaceSet.idl:
1715
1716 2016-05-07  Jeremy Huddleston Sequoia  <jeremyhu@apple.com>
1717
1718         Fix an incorrect usage of OS(DARWIN) with PLATFORM(COCOA)
1719         https://bugs.webkit.org/show_bug.cgi?id=157167
1720
1721         Reviewed by Myles C. Maxfield.
1722
1723         * platform/graphics/FontPlatformData.h:
1724         (WebCore::FontPlatformData::hash):
1725
1726 2016-05-07  Joanmarie Diggs  <jdiggs@igalia.com>
1727
1728         REGRESSION(r196222): [AX][GTK] accessibility/gtk/caret-offsets.html failing
1729         https://bugs.webkit.org/show_bug.cgi?id=153956
1730
1731         Reviewed by Chris Fleizach.
1732
1733         The reason the test began failing is that it was checking the new caret offset
1734         synchronously. For most of the test cases, this was not a problem. But when the
1735         caret was moved out of a focused link, the focus change (and associated repainting)
1736         delayed the caret-moved event long enough to cause the associated test case to fail.
1737         The test now uses shouldBecomeEqualToString() instead of shouldBeEqualToString().
1738
1739         The test also had a supposedly-correct expectation which was wrong: When moving the
1740         caret to a valid accessible offset, the caret-moved event should be for that offset.
1741         This was not the case for the list item test case because emitTextSelectionChange()
1742         was not adjusting the offset for the RenderListMarker, the text of which is exposed
1743         as part of the ATK_ROLE_LIST_ITEM object. This bug was also fixed and the test case
1744         updated accordingly.
1745
1746         No new tests are needed. The previously-failing test is now passing.
1747
1748         * editing/atk/FrameSelectionAtk.cpp:
1749         (WebCore::emitTextSelectionChange):
1750
1751 2016-05-06  Joseph Pecoraro  <pecoraro@apple.com>
1752
1753         Rename HitTestRequest DisallowShadowContent to DisallowUserAgentShadowContent
1754         https://bugs.webkit.org/show_bug.cgi?id=157447
1755
1756         Reviewed by Ryosuke Niwa.
1757
1758         HitTesting is intended to reach nodes inside shadow content. This property
1759         on the HitTestRequest is intended to avoid hit testing in UserAgent shadow
1760         content. Rename the enum value, and cascading methods for clarity.
1761
1762         * html/MediaElementSession.cpp:
1763         (WebCore::isMainContent):
1764         * page/EventHandler.cpp:
1765         (WebCore::EventHandler::eventMayStartDrag):
1766         (WebCore::EventHandler::updateSelectionForMouseDrag):
1767         (WebCore::EventHandler::hitTestResultAtPoint):
1768         (WebCore::EventHandler::handleMousePressEvent):
1769         (WebCore::EventHandler::handleMouseDoubleClickEvent):
1770         (WebCore::EventHandler::mouseMoved):
1771         (WebCore::EventHandler::handleMouseMoveEvent):
1772         (WebCore::EventHandler::handleMouseReleaseEvent):
1773         (WebCore::EventHandler::handleMouseForceEvent):
1774         (WebCore::EventHandler::updateDragAndDrop):
1775         (WebCore::EventHandler::isInsideScrollbar):
1776         (WebCore::EventHandler::sendContextMenuEvent):
1777         (WebCore::EventHandler::sendContextMenuEventForKey):
1778         (WebCore::EventHandler::hoverTimerFired):
1779         (WebCore::EventHandler::dragSourceEndedAt):
1780         (WebCore::EventHandler::handleDrag):
1781         (WebCore::EventHandler::dispatchSyntheticTouchEventIfEnabled):
1782         * page/EventHandler.h:
1783         * page/FocusController.cpp:
1784         (WebCore::updateFocusCandidateIfNeeded):
1785         * rendering/HitTestRequest.h:
1786         (WebCore::HitTestRequest::HitTestRequest):
1787         (WebCore::HitTestRequest::disallowsUserAgentShadowContent):
1788         (WebCore::HitTestRequest::disallowsShadowContent): Deleted.
1789         * rendering/HitTestResult.cpp:
1790         (WebCore::HitTestResult::setToNonUserAgentShadowAncestor):
1791         (WebCore::HitTestResult::addNodeToRectBasedTestResult):
1792         (WebCore::HitTestResult::setToNonShadowAncestor): Deleted.
1793         * rendering/HitTestResult.h:
1794         * rendering/RenderEmbeddedObject.cpp:
1795         (WebCore::RenderEmbeddedObject::isReplacementObscured):
1796         * rendering/RenderLayer.cpp:
1797         (WebCore::RenderLayer::calculateClipRects):
1798         * rendering/svg/RenderSVGResourceClipper.cpp:
1799         (WebCore::RenderSVGResourceClipper::hitTestClipContent):
1800         * testing/Internals.cpp:
1801         (WebCore::Internals::nodesFromRect):
1802
1803 2016-05-06  Joseph Pecoraro  <pecoraro@apple.com>
1804
1805         Web Inspector: Inspect Element and Element Selection searching should work with Shadow DOM Nodes
1806         https://bugs.webkit.org/show_bug.cgi?id=157446
1807         <rdar://problem/24688447>
1808
1809         Reviewed by Ryosuke Niwa.
1810
1811         * inspector/InspectorDOMAgent.cpp:
1812         (WebCore::InspectorDOMAgent::innerParentNode):
1813         The Inspector backend was informing the frontend that all ShadowRoots
1814         were floating and had no parent. Get the host element for ShadowRoots.
1815
1816         * rendering/HitTestResult.cpp:
1817         (WebCore::moveOutOfUserAgentShadowTree):
1818         (WebCore::HitTestResult::setToNonShadowAncestor):
1819         EventHandler::mouseMoved is calling setToNonShadowAncestor before
1820         notifying Page::chrome / Inspector about the moused over element.
1821         This should be the deepest non-user-agent-shadow node.
1822
1823 2016-05-06  Joseph Pecoraro  <pecoraro@apple.com>
1824
1825         Web Inspector: Misc CommandLineAPI cleanup
1826         https://bugs.webkit.org/show_bug.cgi?id=157450
1827
1828         Reviewed by Ryosuke Niwa.
1829
1830         * inspector/CommandLineAPIModuleSource.js:
1831         (bind):
1832
1833 2016-05-06  Simon Fraser  <simon.fraser@apple.com>
1834
1835         Enable IOS_TEXT_AUTOSIZING on Mac and make it testable
1836         https://bugs.webkit.org/show_bug.cgi?id=157432
1837         rdar://problem/16406720
1838
1839         Reviewed by Dean Jackson.
1840
1841         Enable IOS_TEXT_AUTOSIZING on Mac so it can be tested.
1842
1843         Make the setTextAutosizingEnabled() Setting work, and plumb it through WK1 and WK2
1844         preferences for WTR and DRT. Make textAutosizingWindowSizeOverride() work, for layout tests.
1845         These two settings are shared with TEXT_AUTOSIZING.
1846
1847         Add a TextAutosizing log channel, which is useful for generated -expected.html results.
1848
1849         Move adjustComputedFontSizesOnBlocks() and related code from RenderObject to RenderElement
1850         without changes.
1851
1852         An implication of this set of changes is that the way clients enable text autosizing
1853         has changed. Previously, they set the "MinimumZoomFontSize" preference to 0.
1854         Settings::defaultMinimumZoomFontSize() used to do this in order to enable text autosizing
1855         on iPhone only, not iPad.
1856
1857         Now the preferred technique is to leave minimumZoomFontSize alone, and to use textAutosizingEnabled()
1858         instead. Settings::defaultTextAutosizingEnabled() now does the check for iPhone.
1859
1860         UIWebView calls WebKitGetMinimumZoomFontSize() to setup the default minimum font zoom size,
1861         which will now always return 15, but had no other code that toggled this. So it's safe to just rely
1862         on Settings::defaultTextAutosizingEnabled() doing the right thing for iPhone/iPad.
1863
1864         Test: fast/text-autosizing/ios/autosize-width.html
1865
1866         * Configurations/FeatureDefines.xcconfig:
1867         * dom/Document.cpp:
1868         (WebCore::Document::addAutoSizingNode):
1869         * page/FrameView.cpp:
1870         (WebCore::FrameView::layout):
1871         * page/Settings.cpp:
1872         (WebCore::Settings::Settings): Deleted.
1873         (WebCore::Settings::setTextAutosizingEnabled): Deleted.
1874         (WebCore::Settings::setTextAutosizingWindowSizeOverride): Deleted.
1875         * page/Settings.h:
1876         (WebCore::Settings::textAutosizingEnabled): Deleted.
1877         (WebCore::Settings::textAutosizingWindowSizeOverride): Deleted.
1878         * page/Settings.in:
1879         * page/cocoa/SettingsCocoa.mm:
1880         (WebCore::Settings::defaultMinimumZoomFontSize):
1881         (WebCore::Settings::defaultTextAutosizingEnabled):
1882         * platform/Logging.h:
1883         * rendering/RenderBlockFlow.cpp:
1884         (WebCore::RenderBlockFlow::adjustComputedFontSizes):
1885         * rendering/RenderElement.cpp:
1886         (WebCore::includeNonFixedHeight):
1887         (WebCore::RenderElement::adjustComputedFontSizesOnBlocks):
1888         (WebCore::RenderElement::resetTextAutosizing):
1889         * rendering/RenderElement.h:
1890         * rendering/RenderObject.cpp:
1891         (WebCore::includeNonFixedHeight): Deleted.
1892         (WebCore::RenderObject::adjustComputedFontSizesOnBlocks): Deleted.
1893         (WebCore::RenderObject::resetTextAutosizing): Deleted.
1894         * rendering/RenderObject.h:
1895         * rendering/TextAutoSizing.cpp:
1896         (WebCore::TextAutoSizingValue::adjustNodeSizes):
1897         * testing/InternalSettings.cpp:
1898         (WebCore::InternalSettings::Backup::Backup):
1899         (WebCore::InternalSettings::Backup::restoreTo):
1900         (WebCore::InternalSettings::setTextAutosizingEnabled):
1901         (WebCore::InternalSettings::setTextAutosizingWindowSizeOverride):
1902         * testing/InternalSettings.h:
1903
1904 2016-05-06  Joseph Pecoraro  <pecoraro@apple.com>
1905
1906         Web Inspector: Console: Variables defined with let/const aren't accessible outside of console's scope
1907         https://bugs.webkit.org/show_bug.cgi?id=150752
1908         <rdar://problem/23343385>
1909
1910         Reviewed by Mark Lam.
1911
1912         Test: inspector/runtime/evaluate-CommandLineAPI.html
1913
1914         * inspector/CommandLineAPIModuleSource.js:
1915         (bind):
1916         (this.member.toString):
1917         (CommandLineAPI):
1918         (CommandLineAPIImpl.prototype):
1919         (slice): Deleted.
1920         (bound): Deleted.
1921         (bound.toString): Deleted.
1922         (inScopeVariables): Deleted.
1923         (customToStringMethod): Deleted.
1924         Simplify now that we don't need to do our own variable shadow checking.
1925
1926 2016-05-06  Tim Horton  <timothy_horton@apple.com>
1927
1928         <attachment> element should understand UTIs
1929         https://bugs.webkit.org/show_bug.cgi?id=157425
1930         <rdar://problem/25585401>
1931
1932         Reviewed by Anders Carlsson.
1933
1934         UTIs are often much more specific than MIME types, so we should allow
1935         clients of <attachment> to use them to get more accurate icons.
1936
1937         Test: fast/attachment/attachment-uti.html
1938
1939         * platform/graphics/Icon.h:
1940         * platform/graphics/mac/IconMac.mm:
1941         (WebCore::Icon::createIconForMIMEType): Deleted.
1942         Remove the now-unused createIconForMIMEType.
1943
1944         * platform/network/mac/UTIUtilities.h:
1945         * platform/network/mac/UTIUtilities.mm:
1946         (WebCore::isDeclaredUTI):
1947         Expose UTTypeIsDeclared as isDeclaredUTI.
1948
1949         * rendering/RenderThemeIOS.mm:
1950         (WebCore::iconForAttachment):
1951         * rendering/RenderThemeMac.mm:
1952         (WebCore::iconForAttachment):
1953         If the attachment's type is a UTI, request the icon for it directly.
1954         If it's a MIME type, convert to a UTI before requesting.
1955
1956 2016-05-06  Chris Dumez  <cdumez@apple.com>
1957
1958         Clean up converting from JSValue to float / double in the bindings generator
1959         https://bugs.webkit.org/show_bug.cgi?id=157407
1960
1961         Reviewed by Darin Adler.
1962
1963         Clean up converting from JSValue to float / double in the bindings generator:
1964         - Handle all aspects of converting to float / double inside JSValueToNative()
1965           instead of relying partly on the call sites.
1966         - Add a build<>() template function to JSDOMBuild.h that is now
1967           called from the bindings to convert to float / double and deal with
1968           non-finite values.
1969         - Provide a better message with the TypeError that is thrown for non-finite
1970           values.
1971
1972         No new tests, rebaselined existing tests.
1973
1974         * bindings/js/JSDOMBinding.cpp:
1975         (WebCore::throwSequenceTypeError):
1976         (WebCore::throwNonFiniteTypeError):
1977         * bindings/js/JSDOMBinding.h:
1978         * bindings/js/JSDOMBuild.h:
1979         (WebCore::build):
1980         * bindings/scripts/CodeGenerator.pm:
1981         (IsFloatingPointType):
1982         * bindings/scripts/CodeGeneratorJS.pm:
1983         (JSValueToNative):
1984         (GenerateImplementation): Deleted.
1985         (GenerateParametersCheck): Deleted.
1986         (GenerateReturnParameters): Deleted.
1987         * bindings/scripts/test/JS/JSTestObj.cpp:
1988         (WebCore::setJSTestObjStrictFloat):
1989         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalDoubleIsNaN):
1990         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalFloatIsNaN):
1991         (WebCore::jsTestObjPrototypeFunctionStrictFunction):
1992         (WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethod):
1993         (WebCore::jsTestObjPrototypeFunctionAny):
1994         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
1995         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise):
1996         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1997         (WebCore::jsTestTypedefsPrototypeFunctionSetShadow):
1998
1999 2016-05-06  Dean Jackson  <dino@apple.com>
2000
2001         Regions, Shapes and Tracks don't need runtime features
2002         https://bugs.webkit.org/show_bug.cgi?id=157426
2003         <rdar://problem/26146262>
2004
2005         Reviewed by Simon Fraser.
2006
2007         The following RuntimeEnabledFeatures can be removed since
2008         we have no need to disable them (they are stable and have
2009         shipped for a while):
2010         - CSS Regions
2011         - CSS Shapes
2012         - Media tracks
2013
2014         * bindings/generic/RuntimeEnabledFeatures.cpp:
2015         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures): Deleted.
2016         * bindings/generic/RuntimeEnabledFeatures.h:
2017         (WebCore::RuntimeEnabledFeatures::setCSSShapesEnabled): Deleted.
2018         (WebCore::RuntimeEnabledFeatures::cssShapesEnabled): Deleted.
2019         (WebCore::RuntimeEnabledFeatures::setCSSRegionsEnabled): Deleted.
2020         (WebCore::RuntimeEnabledFeatures::cssRegionsEnabled): Deleted.
2021         (WebCore::RuntimeEnabledFeatures::setCSSCompositingEnabled): Deleted.
2022         (WebCore::RuntimeEnabledFeatures::cssCompositingEnabled): Deleted.
2023         (WebCore::RuntimeEnabledFeatures::webkitVideoTrackEnabled): Deleted.
2024         (WebCore::RuntimeEnabledFeatures::setWebkitVideoTrackEnabled): Deleted.
2025         * css/CSSParser.cpp:
2026         (WebCore::isSimpleLengthPropertyID):
2027         (WebCore::isValidKeywordPropertyAndValue):
2028         (WebCore::CSSParser::parseValue):
2029         (WebCore::CSSParser::parseFillProperty):
2030         (WebCore::CSSParser::createRegionRule):
2031         (WebCore::CSSParserContext::CSSParserContext): Deleted.
2032         (WebCore::operator==): Deleted.
2033         (WebCore::CSSParser::parseShapeProperty): Deleted.
2034         (WebCore::CSSParser::cssRegionsEnabled): Deleted.
2035         (WebCore::CSSParser::cssCompositingEnabled): Deleted.
2036         (WebCore::CSSParser::parseFlowThread): Deleted.
2037         (WebCore::CSSParser::parseRegionThread): Deleted.
2038         * css/CSSParser.h:
2039         * css/CSSParserMode.h:
2040         * dom/Document.cpp:
2041         (WebCore::Document::webkitGetNamedFlows):
2042         (WebCore::Document::cssRegionsEnabled): Deleted.
2043         (WebCore::Document::cssCompositingEnabled): Deleted.
2044         * dom/Document.h:
2045         * dom/Element.cpp:
2046         (WebCore::Element::unregisterNamedFlowContentElement):
2047         (WebCore::Element::webkitRegionOverset):
2048         (WebCore::Element::webkitGetRegionFlowRanges): Deleted.
2049         * html/HTMLMediaElement.cpp:
2050         (WebCore::HTMLMediaElement::scheduleDelayedAction):
2051         (WebCore::HTMLMediaElement::pendingActionTimerFired):
2052         (WebCore::HTMLMediaElement::prepareForLoad):
2053         (WebCore::HTMLMediaElement::loadInternal):
2054         (WebCore::HTMLMediaElement::setReadyState):
2055         (WebCore::HTMLMediaElement::playbackProgressTimerFired):
2056         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
2057         (WebCore::HTMLMediaElement::userCancelledLoad):
2058         (WebCore::HTMLMediaElement::setVideoFullscreenLayer):
2059         (WebCore::HTMLMediaElement::hasClosedCaptions):
2060         (WebCore::HTMLMediaElement::setClosedCaptionsVisible):
2061         (WebCore::HTMLMediaElement::configureTextTrackDisplay):
2062         (WebCore::HTMLMediaElement::finishParsingChildren): Deleted.
2063         (WebCore::HTMLMediaElement::audioTrackEnabledChanged): Deleted.
2064         (WebCore::HTMLMediaElement::videoTrackSelectedChanged): Deleted.
2065         (WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack): Deleted.
2066         (WebCore::HTMLMediaElement::mediaPlayerDidAddTextTrack): Deleted.
2067         (WebCore::HTMLMediaElement::mediaPlayerDidAddVideoTrack): Deleted.
2068         (WebCore::HTMLMediaElement::addAudioTrack): Deleted.
2069         (WebCore::HTMLMediaElement::addTextTrack): Deleted.
2070         (WebCore::HTMLMediaElement::addVideoTrack): Deleted.
2071         (WebCore::HTMLMediaElement::removeAudioTrack): Deleted.
2072         (WebCore::HTMLMediaElement::removeTextTrack): Deleted.
2073         (WebCore::HTMLMediaElement::removeVideoTrack): Deleted.
2074         (WebCore::HTMLMediaElement::audioTracks): Deleted.
2075         (WebCore::HTMLMediaElement::textTracks): Deleted.
2076         (WebCore::HTMLMediaElement::videoTracks): Deleted.
2077         (WebCore::HTMLMediaElement::didAddTextTrack): Deleted.
2078         (WebCore::HTMLMediaElement::didRemoveTextTrack): Deleted.
2079         * html/HTMLTrackElement.cpp:
2080         (WebCore::HTMLTrackElement::parseAttribute):
2081         (WebCore::HTMLTrackElement::scheduleLoad): Deleted.
2082         (WebCore::HTMLTrackElement::canLoadURL): Deleted.
2083         * rendering/RenderBlockFlow.cpp:
2084         (WebCore::RenderBlockFlow::createRenderNamedFlowFragmentIfNeeded):
2085         * testing/InternalSettings.cpp:
2086         (WebCore::InternalSettings::Backup::Backup):
2087         (WebCore::InternalSettings::Backup::restoreTo): Deleted.
2088         (WebCore::InternalSettings::setCSSShapesEnabled): Deleted.
2089         * testing/InternalSettings.h:
2090         * testing/InternalSettings.idl:
2091
2092 2016-05-06  Brady Eidson  <beidson@apple.com>
2093
2094         Modern IDB (Workers): Start running a lot of the workers tests.
2095         https://bugs.webkit.org/show_bug.cgi?id=157424
2096
2097         Reviewed by Sam Weinig.
2098
2099         No new tests (Covered by enabling a whole bunch of existing tests).
2100
2101         * Modules/indexeddb/IDBDatabase.cpp:
2102         (WebCore::IDBDatabase::stop): Call removeAllEventListeners() to clean up the Worker VM
2103           before it shuts down.
2104
2105         * Modules/indexeddb/IDBRequest.cpp:
2106         (WebCore::IDBRequest::stop): Call removeAllEventListeners()
2107
2108         * Modules/indexeddb/IDBTransaction.cpp:
2109         (WebCore::IDBTransaction::IDBTransaction): Initialize with the correct VM.
2110         (WebCore::IDBTransaction::stop): Call removeAllEventListeners()
2111         (WebCore::IDBTransaction::operationDidComplete):
2112
2113         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
2114         (WebCore::IDBClient::IDBConnectionProxy::takeIDBOpenDBRequest):
2115         (WebCore::IDBClient::IDBConnectionProxy::completeOpenDBRequest): Don't take the request from
2116           the map, but rather let the request take itself from its appropriate thread.
2117         * Modules/indexeddb/client/IDBConnectionProxy.h:
2118
2119         * Modules/indexeddb/client/TransactionOperation.h:
2120         (WebCore::IDBClient::TransactionOperation::completed): Rework clearing out the completion 
2121           handler, as the handler itself might hold the last reference to `this`.
2122
2123         * page/SecurityOrigin.h:
2124         (WebCore::SecurityOrigin::hasUniversalAccess):
2125
2126         * workers/WorkerGlobalScope.cpp:
2127         (WebCore::WorkerGlobalScope::WorkerGlobalScope): If the parent context's SecurityOrigin had
2128           universal access, grant it to this one.
2129
2130 2016-05-06  Ryosuke Niwa  <rniwa@webkit.org>
2131
2132         FKA: No way to get focus from DOM to shadow DOM components (Was: HTML5 media controls not keyboard accessible)
2133         https://bugs.webkit.org/show_bug.cgi?id=117857
2134
2135         Reviewed by Jer Noble.
2136
2137         The bug was caused by hasCustomFocusLogic returning true on media elements.
2138
2139         Fix the bug by removing this function so that FocusController will walk into the shadow tree of media elements
2140         to look for focusable elements. This will allow AT such as Voice Over to iterate through controls.
2141
2142         We don't seem to draw focus rings inside the media elements but that could be tweaked in a separate patch.
2143
2144         Test: media/tab-focus-inside-media-elements.html
2145
2146         * html/HTMLMediaElement.cpp:
2147         (WebCore::HTMLMediaElement::hasCustomFocusLogic): Deleted.
2148         * html/HTMLMediaElement.h:
2149
2150 2016-05-06  Anders Carlsson  <andersca@apple.com>
2151
2152         Tidy up the LinkRelAttribute code
2153         https://bugs.webkit.org/show_bug.cgi?id=157429
2154
2155         Reviewed by Sam Weinig.
2156
2157         Get rid of IconURL.h and move the IconType enumeration inside LinkRelAttribute.
2158         Remove the InvalidIcon enum declaration and use WTF::Optional instead.
2159
2160         * WebCore.xcodeproj/project.pbxproj:
2161         * dom/IconURL.h: Removed.
2162         * html/HTMLLinkElement.cpp:
2163         (WebCore::HTMLLinkElement::iconType):
2164         (WebCore::HTMLLinkElement::addSubresourceAttributeURLs):
2165         * html/HTMLLinkElement.h:
2166         * html/LinkRelAttribute.cpp:
2167         (WebCore::LinkRelAttribute::LinkRelAttribute):
2168         * html/LinkRelAttribute.h:
2169         * html/parser/HTMLPreloadScanner.cpp:
2170         (WebCore::TokenPreloadScanner::StartTagScanner::relAttributeIsStyleSheet):
2171         * loader/FrameLoader.h:
2172         * loader/FrameLoaderClient.h:
2173         * loader/icon/IconController.cpp:
2174         (WebCore::iconFromLinkElements):
2175
2176 2016-05-06  Jer Noble  <jer.noble@apple.com>
2177
2178         Muted media elements should be allowed to autoplay, even if RequireUserGestureForAudioRateChange is set.
2179         https://bugs.webkit.org/show_bug.cgi?id=157404
2180         <rdar://problem/26016802>
2181
2182         Reviewed by Eric Carlson.
2183
2184         Test: media/audio-playback-restriction-play-muted.html
2185
2186         Add element.muted() as a critera of whether playback is permitted when
2187         RequireUserGestureForAudioRateChange is set. Also, make sure to re-evaluate whether the
2188         element should be playing when muted is changed without a user gesture.
2189
2190         * html/HTMLMediaElement.cpp:
2191         (WebCore::HTMLMediaElement::setMuted):
2192         * html/MediaElementSession.cpp:
2193         (WebCore::MediaElementSession::playbackPermitted):
2194
2195 2016-05-06  Brent Fulgham  <bfulgham@apple.com>
2196
2197         Don't use invalidated ResourceLoadStatistics iterators
2198         https://bugs.webkit.org/show_bug.cgi?id=157412
2199         <rdar://problem/26133153>
2200
2201         Reviewed by Chris Dumez.
2202
2203         ResourceLoadObserver::logFrameNavigation was using references bound to the 'value'
2204         member of iterators from the ResourceLoadStatistics HashMap. When new entries were
2205         added, these iterators were invalidated causing the references to refer to invalid
2206         memory.
2207
2208         Renamed 'resourceStatisticsForPrimaryDomain' to 'ensureResourceStatisticsForPrimaryDomain'
2209         to clarify that it may mutate the underlying HashMap, thereby invalidating any
2210         existing iterators.
2211
2212         * loader/ResourceLoadObserver.cpp:
2213         (WebCore::ResourceLoadObserver::logFrameNavigation): Protect against HashMap
2214         elements being copied/moved when new intries are added.
2215         * loader/ResourceLoadStatisticsStore.cpp:
2216         (WebCore::ResourceLoadStatisticsStore::setResourceStatisticsForPrimaryDomain): Added.
2217         * loader/ResourceLoadStatisticsStore.h:
2218
2219 2016-05-06  Manuel Rego Casasnovas  <rego@igalia.com>
2220
2221         [css-grid] Unprefix CSS Grid Layout properties
2222         https://bugs.webkit.org/show_bug.cgi?id=157137
2223
2224         Reviewed by Simon Fraser.
2225
2226         Remove "-webkit" prefix from all the grid layout properties,
2227         including the display value.
2228         Update the source code to remove the prefix where it was used too.
2229
2230         * css/CSSComputedStyleDeclaration.cpp:
2231         (WebCore::isLayoutDependent):
2232         (WebCore::ComputedStyleExtractor::propertyValue):
2233         * css/CSSParser.cpp:
2234         (WebCore::isSimpleLengthPropertyID):
2235         (WebCore::isValidKeywordPropertyAndValue):
2236         (WebCore::CSSParser::parseValue):
2237         (WebCore::CSSParser::parseGridGapShorthand):
2238         (WebCore::CSSParser::parseGridTemplateRowsAndAreasAndColumns):
2239         (WebCore::CSSParser::parseGridTemplateShorthand):
2240         (WebCore::CSSParser::parseGridShorthand):
2241         (WebCore::CSSParser::parseGridAreaShorthand):
2242         * css/CSSPrimitiveValueMappings.h:
2243         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2244         * css/CSSPropertyNames.in:
2245         * css/CSSValueKeywords.in:
2246         * css/StyleBuilderCustom.h:
2247         (WebCore::StyleBuilderCustom::applyInitialGridTemplateAreas):
2248         (WebCore::StyleBuilderCustom::applyInheritGridTemplateAreas):
2249         (WebCore::StyleBuilderCustom::applyValueGridTemplateAreas):
2250         (WebCore::StyleBuilderCustom::applyInitialGridTemplateColumns):
2251         (WebCore::StyleBuilderCustom::applyInheritGridTemplateColumns):
2252         (WebCore::StyleBuilderCustom::applyValueGridTemplateColumns):
2253         (WebCore::StyleBuilderCustom::applyInitialGridTemplateRows):
2254         (WebCore::StyleBuilderCustom::applyInheritGridTemplateRows):
2255         (WebCore::StyleBuilderCustom::applyValueGridTemplateRows):
2256         * css/StyleProperties.cpp:
2257         (WebCore::StyleProperties::getPropertyValue):
2258
2259 2016-05-06  Nan Wang  <n_wang@apple.com>
2260
2261         AX: <attachment> element should have a replacement character
2262         https://bugs.webkit.org/show_bug.cgi?id=157406
2263
2264         Reviewed by Chris Fleizach.
2265
2266         Make sure attachment element is considered as a replaced node.
2267
2268         Test: accessibility/mac/attachment-element-replacement-character.html
2269
2270         * editing/TextIterator.cpp:
2271         (WebCore::isRendererReplacedElement):
2272
2273 2016-05-06  Nan Wang  <n_wang@apple.com>
2274
2275         AX: String for document range is empty if end visible position anchors to a ignored replaced node
2276         https://bugs.webkit.org/show_bug.cgi?id=157403
2277
2278         Reviewed by Chris Fleizach.
2279
2280         The CharacterOffset that is converted from VisiblePositon is wrong when the VisiblePostion anchors
2281         to an ignored replaced node. Fixed it by adjusting the offset of the CharacterOffset correctly in 
2282         such case.
2283
2284         Test: accessibility/mac/text-marker-string-for-document-end-replaced-node.html
2285
2286         * accessibility/AXObjectCache.cpp:
2287         (WebCore::characterOffsetsInOrder):
2288         (WebCore::AXObjectCache::characterOffsetFromVisiblePosition):
2289         (WebCore::AXObjectCache::accessibilityObjectForTextMarkerData):
2290
2291 2016-05-05  David Kilzer  <ddkilzer@apple.com>
2292
2293         [iOS] WebCore does not need to link to CoreAudio, GraphicsServices, SystemConfiguration frameworks
2294         <https://webkit.org/b/157413>
2295         <rdar://problem/26104189>
2296
2297         Reviewed by Gavin Barraclough.
2298
2299         * Configurations/WebCore.xcconfig:
2300         (OTHER_LDFLAGS_BASE_ios): Remove "-framework GraphicsServices".
2301         (OTHER_LDFLAGS_PLATFORM[sdk=macosx*]): Add "-framework CoreAudio"
2302         and "-framework SystemConfiguration".
2303         * WebCore.xcodeproj/project.pbxproj: Remove CoreAudio.framework
2304         and SystemConfiguration.framework from the project file.
2305
2306 2016-05-05  Brady Eidson  <beidson@apple.com>
2307
2308         Modern IDB (Workers): Get everything to the right threads.
2309         https://bugs.webkit.org/show_bug.cgi?id=157398
2310
2311         Reviewed by Alex Christensen.
2312
2313         No new tests (No current change in behavior, will be tested as bug 149953 is resolved, enabling IDB in workers).
2314
2315         * dom/ScriptExecutionContext.h:
2316         (WebCore::ScriptExecutionContext::postCrossThreadTask): Add a helper to post a CrossThreadTask to a context.
2317                 
2318         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
2319         (WebCore::IDBClient::performCallbackOnCorrectThread): Helper to perform an IDB callback on either the main thread
2320           or Worker thread as necessary.
2321         (WebCore::IDBClient::IDBConnectionProxy::openDatabase):
2322         (WebCore::IDBClient::IDBConnectionProxy::deleteDatabase):
2323         (WebCore::IDBClient::IDBConnectionProxy::completeOpenDBRequest):
2324         (WebCore::IDBClient::IDBConnectionProxy::createObjectStore):
2325         (WebCore::IDBClient::IDBConnectionProxy::deleteObjectStore):
2326         (WebCore::IDBClient::IDBConnectionProxy::clearObjectStore):
2327         (WebCore::IDBClient::IDBConnectionProxy::createIndex):
2328         (WebCore::IDBClient::IDBConnectionProxy::deleteIndex):
2329         (WebCore::IDBClient::IDBConnectionProxy::putOrAdd):
2330         (WebCore::IDBClient::IDBConnectionProxy::getRecord):
2331         (WebCore::IDBClient::IDBConnectionProxy::getCount):
2332         (WebCore::IDBClient::IDBConnectionProxy::deleteRecord):
2333         (WebCore::IDBClient::IDBConnectionProxy::openCursor):
2334         (WebCore::IDBClient::IDBConnectionProxy::iterateCursor):
2335         (WebCore::IDBClient::IDBConnectionProxy::completeOperation):
2336         (WebCore::IDBClient::IDBConnectionProxy::abortOpenAndUpgradeNeeded):
2337         (WebCore::IDBClient::IDBConnectionProxy::fireVersionChangeEvent):
2338         (WebCore::IDBClient::IDBConnectionProxy::didFireVersionChangeEvent):
2339         (WebCore::IDBClient::IDBConnectionProxy::notifyOpenDBRequestBlocked):
2340         (WebCore::IDBClient::IDBConnectionProxy::establishTransaction):
2341         (WebCore::IDBClient::IDBConnectionProxy::didStartTransaction):
2342         (WebCore::IDBClient::IDBConnectionProxy::commitTransaction):
2343         (WebCore::IDBClient::IDBConnectionProxy::didCommitTransaction):
2344         (WebCore::IDBClient::IDBConnectionProxy::abortTransaction):
2345         (WebCore::IDBClient::IDBConnectionProxy::didAbortTransaction):
2346         (WebCore::IDBClient::IDBConnectionProxy::didFinishHandlingVersionChangeTransaction):
2347         (WebCore::IDBClient::IDBConnectionProxy::databaseConnectionClosed):
2348         (WebCore::IDBClient::IDBConnectionProxy::scheduleMainThreadTasks):
2349         (WebCore::IDBClient::IDBConnectionProxy::handleMainThreadTasks):
2350         * Modules/indexeddb/client/IDBConnectionProxy.h:
2351         (WebCore::IDBClient::IDBConnectionProxy::callConnectionOnMainThread): Helper to marshall IDB operations from the
2352           Worker thread to the main thread.
2353         (WebCore::IDBClient::IDBConnectionProxy::postMainThreadTask):
2354
2355         * Modules/indexeddb/IDBTransaction.cpp:
2356         (WebCore::IDBTransaction::originThreadID):
2357         * Modules/indexeddb/IDBTransaction.h:
2358         
2359         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
2360         (WebCore::IDBClient::IDBConnectionToServer::putOrAdd):
2361         * Modules/indexeddb/client/IDBConnectionToServer.h:
2362
2363         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
2364
2365         * Modules/indexeddb/client/TransactionOperation.cpp:
2366         (WebCore::IDBClient::TransactionOperation::scriptExecutionContext):
2367         * Modules/indexeddb/client/TransactionOperation.h:
2368
2369         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
2370         (WebCore::nextClientResourceNumber):
2371
2372         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
2373         (WebCore::InProcessIDBServer::putOrAdd):
2374         * Modules/indexeddb/shared/InProcessIDBServer.h:
2375
2376 2016-05-05  Dean Jackson  <dino@apple.com>
2377
2378         4 and 8 digit color attributes should use the crazypants algorithm, not the CSS one.
2379         https://bugs.webkit.org/show_bug.cgi?id=157402
2380         <rdar://problem/26131142>
2381
2382         Reviewed by Simon Fraser.
2383
2384         Noel and Tab from Google alerted me to the fact I broke some legacy
2385         HTML color attributes when I added support for 4 and 8 digit hex colors
2386         in CSS. The fix is to favor the "crazy" parsing unless we know it is a 3 or 6
2387         digit hex value (in which case we try the CSS algorithm first).
2388
2389         Covered by reverting an existing test.
2390
2391         * html/HTMLElement.cpp:
2392         (WebCore::HTMLElement::addHTMLColorToStyle):
2393
2394 2016-05-05  Brady Eidson  <beidson@apple.com>
2395
2396         Modern IDB (Workers): Remove the need for IDBConnectionProxy to expose its IDBConnectionToServer.
2397         https://bugs.webkit.org/show_bug.cgi?id=157394
2398
2399         Reviewed by Alex Christensen.
2400
2401         No new tests (No current change in behavior, will be tested as bug 149953 makes progress).
2402
2403         * Modules/indexeddb/IDBDatabase.cpp:
2404         (WebCore::IDBDatabase::transaction):
2405         (WebCore::IDBDatabase::fireVersionChangeEvent):
2406         (WebCore::IDBDatabase::dispatchEvent):
2407         * Modules/indexeddb/IDBDatabase.h:
2408         (WebCore::IDBDatabase::serverConnection): Deleted.
2409
2410         * Modules/indexeddb/IDBOpenDBRequest.cpp:
2411         (WebCore::IDBOpenDBRequest::requestCompleted):
2412
2413         * Modules/indexeddb/IDBRequest.cpp:
2414         (WebCore::IDBRequest::IDBRequest):
2415
2416         * Modules/indexeddb/IDBTransaction.cpp:
2417         (WebCore::IDBTransaction::connectionProxy):
2418         (WebCore::IDBTransaction::serverConnection): Deleted.
2419         * Modules/indexeddb/IDBTransaction.h:
2420
2421         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
2422         (WebCore::IDBClient::IDBConnectionProxy::abortOpenAndUpgradeNeeded):
2423         (WebCore::IDBClient::IDBConnectionProxy::connectionToServer): Deleted.
2424         * Modules/indexeddb/client/IDBConnectionProxy.h:
2425
2426         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
2427         (WebCore::IDBClient::IDBConnectionToServer::abortOpenAndUpgradeNeeded):
2428
2429         * Modules/indexeddb/client/TransactionOperation.h:
2430         (WebCore::IDBClient::TransactionOperation::TransactionOperation):
2431
2432         * Modules/indexeddb/shared/IDBCursorInfo.cpp:
2433         (WebCore::IDBCursorInfo::IDBCursorInfo):
2434
2435         * Modules/indexeddb/shared/IDBRequestData.cpp:
2436         (WebCore::IDBRequestData::IDBRequestData):
2437
2438         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
2439         (WebCore::IDBResourceIdentifier::IDBResourceIdentifier):
2440         * Modules/indexeddb/shared/IDBResourceIdentifier.h:
2441
2442         * Modules/indexeddb/shared/IDBTransactionInfo.cpp:
2443         (WebCore::IDBTransactionInfo::clientTransaction):
2444         * Modules/indexeddb/shared/IDBTransactionInfo.h:
2445
2446 2016-05-05  Commit Queue  <commit-queue@webkit.org>
2447
2448         Unreviewed, rolling out r200479.
2449         https://bugs.webkit.org/show_bug.cgi?id=157397
2450
2451         A LayoutTest added with this change is crashing on Mac WK1
2452         test runs. (Requested by ryanhaddad on #webkit).
2453
2454         Reverted changeset:
2455
2456         "For keyboard users, activating a fragment URL should transfer
2457         focus and caret to the destination"
2458         https://bugs.webkit.org/show_bug.cgi?id=116046
2459         http://trac.webkit.org/changeset/200479
2460
2461 2016-05-05  Chris Dumez  <cdumez@apple.com>
2462
2463         CORS check is sometimes incorrectly failing for media loads
2464         https://bugs.webkit.org/show_bug.cgi?id=157370
2465         <rdar://problem/26071607>
2466
2467         Reviewed by Alex Christensen.
2468
2469         When the media library is issuing a conditional request for a media
2470         element that had the 'crossorigin' attribute, we would fail the CORS
2471         check and log an error if the server were to respond with a "304 Not
2472         Modified" response because the 304 response usually does not have
2473         the necessary "Access-Control-Allow-Origin: *" header (At least for
2474         Apache) and we cannot use the cached headers either since WebKit
2475         does not have them.
2476
2477         To work around the problem in the short term, we now drop the
2478         conditional headers from the request that the media library is
2479         giving us when the media element has the 'crossorigin' attribute
2480         set. As a result, the server will never respond with a 304 and we
2481         will be able to do a CORS check on the full (e.g. 206) response.
2482
2483         In the long term, we need to deal with this better as this means
2484         we may sometimes fail to reuse cached data. For now, this is only
2485         potentially inefficient in the cases that were broken (i.e. no
2486         video would play and we would log an error in the console).
2487
2488         Test: http/tests/security/video-cross-origin-caching.html
2489
2490         * loader/MediaResourceLoader.cpp:
2491         (WebCore::MediaResourceLoader::requestResource):
2492         Make the request unconditional if the media element has the
2493         'crossorigin' attribute set.
2494
2495         * platform/network/ResourceRequestBase.cpp:
2496         (WebCore::ResourceRequestBase::isConditional):
2497         (WebCore::ResourceRequestBase::makeUnconditional):
2498         When fixing the bug above, I noticed that those method do not do
2499         the right thing if the m_httpHeaderFields data member has not
2500         been populated yet. m_httpHeaderFields is lazily initialized so
2501         we need to call updateResourceRequest() before using it.
2502
2503 2016-05-05  Zalan Bujtas  <zalan@apple.com>
2504
2505         Stop traversing at the container block when computing RTL inline static distance.
2506         https://bugs.webkit.org/show_bug.cgi?id=157349
2507         <rdar://problem/25994087>
2508
2509         Reviewed by David Hyatt.
2510
2511         When computing the inline static distance for a child renderer, we start at its enclosing box
2512         and traverse up all the way to the container block.
2513         However when the enclosing box is the ancestor of the container block, we
2514         should just bail out right away since there's no container to use to adjust the position.
2515
2516         Test: fast/multicol/positioned-rtl-column-crash.html
2517
2518         * rendering/RenderBox.cpp:
2519         (WebCore::computeInlineStaticDistance):
2520
2521 2016-05-05  Ada Chan  <adachan@apple.com>
2522
2523         Add WebKitAdditions extension points in media controls related code in RenderThemeMac
2524         https://bugs.webkit.org/show_bug.cgi?id=157390
2525
2526         Reviewed by Anders Carlsson.
2527
2528         * rendering/RenderThemeMac.mm:
2529         (WebCore::RenderThemeMac::mediaControlsStyleSheet):
2530         (WebCore::RenderThemeMac::mediaControlsScript):
2531
2532 2016-05-05  Jer Noble  <jer.noble@apple.com>
2533
2534         [WK2] Media controls don't update if controller is created after the interface is created
2535         https://bugs.webkit.org/show_bug.cgi?id=157376
2536
2537         Reviewed by Beth Dakin.
2538
2539         Add getter methods to WebPlaybackSessionModel so that the model's values can be retrieved
2540         if those values were missed before the equivalent WebPlaybackSessionInterface methods were
2541         called. This necessatates a bunch of changes in HTMLMediaElement and related classes to
2542         change PassRefPtr<TimeRanges> types to Ref<TimeRanges> (and one change in TimeRanges itself).
2543         WebPlaybackSessionModelMediaElement can implement these new getter methods by querying the
2544         values from the HTMLMediaElement, something it was doing already, so most of those changes
2545         are simple refactoring.
2546
2547         There's no reason any longer for WebVideoFullscreenModel to inherit from WebPlaybackSessionModel,
2548         so remove that superclass.
2549
2550         In WebPlaybackSessionInterfaceMac, when a new WebPlaybackControlsManager is set, use the new
2551         getter methods on WebPlaybackSessionModel to update the values in the manager.
2552
2553         * html/HTMLMediaElement.cpp:
2554         (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
2555         (WebCore::HTMLMediaElement::maxBufferedTime):
2556         (WebCore::HTMLMediaElement::played):
2557         (WebCore::HTMLMediaElement::buffered): Deleted.
2558         (WebCore::HTMLMediaElement::seekable): Deleted.
2559         * html/HTMLMediaElement.h:
2560         * html/MediaController.cpp:
2561         (MediaController::buffered):
2562         (MediaController::seekable):
2563         (MediaController::played):
2564         * html/MediaController.h:
2565         * html/MediaControllerInterface.h:
2566         * html/TimeRanges.cpp:
2567         (WebCore::TimeRanges::copy):
2568         * html/TimeRanges.h:
2569         * platform/cocoa/WebPlaybackSessionModel.h:
2570         * platform/cocoa/WebPlaybackSessionModelMediaElement.h:
2571         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
2572         (WebPlaybackSessionModelMediaElement::setWebPlaybackSessionInterface):
2573         (WebPlaybackSessionModelMediaElement::updateForEventName):
2574         (WebPlaybackSessionModelMediaElement::updateLegibleOptions):
2575         (WebPlaybackSessionModelMediaElement::observedEventNames):
2576         (WebPlaybackSessionModelMediaElement::eventNameAll):
2577         (WebPlaybackSessionModelMediaElement::duration):
2578         (WebPlaybackSessionModelMediaElement::currentTime):
2579         (WebPlaybackSessionModelMediaElement::bufferedTime):
2580         (WebPlaybackSessionModelMediaElement::isPlaying):
2581         (WebPlaybackSessionModelMediaElement::playbackRate):
2582         (WebPlaybackSessionModelMediaElement::seekableRanges):
2583         (WebPlaybackSessionModelMediaElement::canPlayFastReverse):
2584         (WebPlaybackSessionModelMediaElement::audioMediaSelectionOptions):
2585         (WebPlaybackSessionModelMediaElement::audioMediaSelectedIndex):
2586         (WebPlaybackSessionModelMediaElement::legibleMediaSelectionOptions):
2587         (WebPlaybackSessionModelMediaElement::legibleMediaSelectedIndex):
2588         (WebPlaybackSessionModelMediaElement::externalPlaybackEnabled):
2589         (WebPlaybackSessionModelMediaElement::wirelessVideoPlaybackDisabled):
2590         * platform/cocoa/WebVideoFullscreenModel.h:
2591         * platform/cocoa/WebVideoFullscreenModelVideoElement.h:
2592         * platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
2593         (WebVideoFullscreenModelVideoElement::requestFullscreenMode): Deleted.
2594         (WebVideoFullscreenModelVideoElement::setVideoLayerFrame): Deleted.
2595         (WebVideoFullscreenModelVideoElement::setVideoLayerGravity): Deleted.
2596         (WebVideoFullscreenModelVideoElement::observedEventNames): Deleted.
2597         (WebVideoFullscreenModelVideoElement::eventNameAll): Deleted.
2598         (WebVideoFullscreenModelVideoElement::fullscreenModeChanged): Deleted.
2599         * platform/ios/WebPlaybackSessionInterfaceAVKit.h:
2600         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
2601         (WebVideoFullscreenControllerContext::play): Deleted.
2602         (WebVideoFullscreenControllerContext::pause): Deleted.
2603         (WebVideoFullscreenControllerContext::togglePlayState): Deleted.
2604         (WebVideoFullscreenControllerContext::beginScrubbing): Deleted.
2605         (WebVideoFullscreenControllerContext::endScrubbing): Deleted.
2606         (WebVideoFullscreenControllerContext::seekToTime): Deleted.
2607         (WebVideoFullscreenControllerContext::fastSeek): Deleted.
2608         (WebVideoFullscreenControllerContext::beginScanningForward): Deleted.
2609         (WebVideoFullscreenControllerContext::beginScanningBackward): Deleted.
2610         (WebVideoFullscreenControllerContext::endScanning): Deleted.
2611         (WebVideoFullscreenControllerContext::selectAudioMediaOption): Deleted.
2612         (WebVideoFullscreenControllerContext::selectLegibleMediaOption): Deleted.
2613         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
2614         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2615         (WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen):
2616         (WebVideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
2617         * platform/mac/WebPlaybackSessionInterfaceMac.mm:
2618         (WebCore::timeRangesToArray):
2619         (WebCore::WebPlaybackSessionInterfaceMac::setSeekableRanges):
2620         (WebCore::WebPlaybackSessionInterfaceMac::setPlayBackControlsManager):
2621         * platform/mac/WebVideoFullscreenInterfaceMac.h:
2622
2623 2016-05-05  Brady Eidson  <beidson@apple.com>
2624
2625         Modern IDB (Workers): Move TransactionOperation management from IDBConnectionToServer to IDBConnectionProxy.
2626         https://bugs.webkit.org/show_bug.cgi?id=157392
2627
2628         Reviewed by Alex Christensen.
2629
2630         No new tests (No current change in behavior, will be tested as bug 149953 makes progress).
2631
2632         Set up TransactionOperations on the IDBConnectionProxy instead of the IDBConnectionToServer:
2633         * Modules/indexeddb/IDBTransaction.cpp:
2634         (WebCore::IDBTransaction::createObjectStoreOnServer):
2635         (WebCore::IDBTransaction::createIndexOnServer):
2636         (WebCore::IDBTransaction::openCursorOnServer):
2637         (WebCore::IDBTransaction::iterateCursorOnServer):
2638         (WebCore::IDBTransaction::getRecordOnServer):
2639         (WebCore::IDBTransaction::getCountOnServer):
2640         (WebCore::IDBTransaction::deleteRecordOnServer):
2641         (WebCore::IDBTransaction::clearObjectStoreOnServer):
2642         (WebCore::IDBTransaction::putOrAddOnServer):
2643         (WebCore::IDBTransaction::deleteObjectStoreOnServer):
2644         (WebCore::IDBTransaction::deleteIndexOnServer):
2645         
2646         IDBConnectionProxy is now the owner of dispatched TransactionOperations:
2647         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
2648         (WebCore::IDBClient::IDBConnectionProxy::createObjectStore):
2649         (WebCore::IDBClient::IDBConnectionProxy::deleteObjectStore):
2650         (WebCore::IDBClient::IDBConnectionProxy::clearObjectStore):
2651         (WebCore::IDBClient::IDBConnectionProxy::createIndex):
2652         (WebCore::IDBClient::IDBConnectionProxy::deleteIndex):
2653         (WebCore::IDBClient::IDBConnectionProxy::putOrAdd):
2654         (WebCore::IDBClient::IDBConnectionProxy::getRecord):
2655         (WebCore::IDBClient::IDBConnectionProxy::getCount):
2656         (WebCore::IDBClient::IDBConnectionProxy::deleteRecord):
2657         (WebCore::IDBClient::IDBConnectionProxy::openCursor):
2658         (WebCore::IDBClient::IDBConnectionProxy::iterateCursor):
2659         (WebCore::IDBClient::IDBConnectionProxy::saveOperation):
2660         (WebCore::IDBClient::IDBConnectionProxy::completeOperation):
2661         * Modules/indexeddb/client/IDBConnectionProxy.h:
2662         
2663         Proxy this in-and-out calls to the ConnectionProxy:
2664         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
2665         (WebCore::IDBClient::IDBConnectionToServer::createObjectStore):
2666         (WebCore::IDBClient::IDBConnectionToServer::didCreateObjectStore):
2667         (WebCore::IDBClient::IDBConnectionToServer::deleteObjectStore):
2668         (WebCore::IDBClient::IDBConnectionToServer::didDeleteObjectStore):
2669         (WebCore::IDBClient::IDBConnectionToServer::clearObjectStore):
2670         (WebCore::IDBClient::IDBConnectionToServer::didClearObjectStore):
2671         (WebCore::IDBClient::IDBConnectionToServer::createIndex):
2672         (WebCore::IDBClient::IDBConnectionToServer::didCreateIndex):
2673         (WebCore::IDBClient::IDBConnectionToServer::deleteIndex):
2674         (WebCore::IDBClient::IDBConnectionToServer::didDeleteIndex):
2675         (WebCore::IDBClient::IDBConnectionToServer::putOrAdd):
2676         (WebCore::IDBClient::IDBConnectionToServer::didPutOrAdd):
2677         (WebCore::IDBClient::IDBConnectionToServer::getRecord):
2678         (WebCore::IDBClient::IDBConnectionToServer::didGetRecord):
2679         (WebCore::IDBClient::IDBConnectionToServer::getCount):
2680         (WebCore::IDBClient::IDBConnectionToServer::didGetCount):
2681         (WebCore::IDBClient::IDBConnectionToServer::deleteRecord):
2682         (WebCore::IDBClient::IDBConnectionToServer::didDeleteRecord):
2683         (WebCore::IDBClient::IDBConnectionToServer::openCursor):
2684         (WebCore::IDBClient::IDBConnectionToServer::didOpenCursor):
2685         (WebCore::IDBClient::IDBConnectionToServer::iterateCursor):
2686         (WebCore::IDBClient::IDBConnectionToServer::didIterateCursor):
2687         (WebCore::IDBClient::IDBConnectionToServer::saveOperation): Deleted.
2688         (WebCore::IDBClient::IDBConnectionToServer::completeOperation): Deleted.
2689         * Modules/indexeddb/client/IDBConnectionToServer.h:
2690
2691         - Give TransactionOperation a ThreadIdentifier member
2692         - Privatize most public methods from TransactionOperation
2693         - Make IDBRequestData a friend so it can get at the private methods
2694         * Modules/indexeddb/client/TransactionOperation.h:
2695         (WebCore::IDBClient::TransactionOperation::~TransactionOperation):
2696         (WebCore::IDBClient::TransactionOperation::perform):
2697         (WebCore::IDBClient::TransactionOperation::completed):
2698         (WebCore::IDBClient::TransactionOperation::originThreadID):
2699         (WebCore::IDBClient::TransactionOperation::transactionIdentifier):
2700         (WebCore::IDBClient::TransactionOperation::objectStoreIdentifier):
2701         (WebCore::IDBClient::TransactionOperation::indexIdentifier):
2702         (WebCore::IDBClient::TransactionOperation::cursorIdentifier):
2703         (WebCore::IDBClient::TransactionOperation::transaction):
2704         (WebCore::IDBClient::TransactionOperation::indexRecordType):
2705
2706 2016-05-05  Zalan Bujtas  <zalan@apple.com>
2707
2708         Do not attempt to compute min/max width.
2709         https://bugs.webkit.org/show_bug.cgi?id=157320
2710
2711         Reviewed by David Hyatt.
2712
2713         Replaced elements with no intrinsic size (only with ratio) should not call the containing
2714         block to compute the min/max width when the containing block's min/max width
2715         depends on the children's intrinsic size. It could lead to infinite recursion.
2716
2717         Test: fast/replaced/before-content-intrinsic-crash.html
2718
2719         * rendering/RenderBox.cpp:
2720         (WebCore::RenderBox::computeReplacedLogicalWidthRespectingMinMaxWidth): Unrelated code change.
2721         * rendering/RenderImage.cpp: Unrelated code change.
2722         (WebCore::RenderImage::RenderImage): Deleted.
2723         * rendering/RenderImage.h:
2724         * rendering/RenderReplaced.cpp:
2725         (WebCore::RenderReplaced::computeReplacedLogicalWidth):
2726
2727 2016-05-04  Brady Eidson  <beidson@apple.com>
2728
2729         Modern IDB: Move all IDB DOM object management from IDBConnectionToServer to IDBConnectionProxy.
2730         https://bugs.webkit.org/show_bug.cgi?id=157348
2731
2732         Reviewed by Alex Christensen.
2733
2734         No new tests (Refactor, no change in behavior yet).
2735
2736         This is in-progress IDB-in-Workers code that is isolated enough to land right now.
2737         
2738         The goal is to have IDBConnectionToServer be a main-thread-only object, leaving IDBConnectionProxy
2739         as the threading bridge between the worker thread and the main thread.
2740         
2741         As such, IDBConnectionToServer no longer maintains maps of IDB DOM objects, but instead the proxy
2742         does and guards that access with locks.
2743         
2744         No threading changes takes place in this patch but it does scatter some isMainThread() checks and FIXMEs 
2745         accurately representing where threading changes will take place once I can return to this.
2746         
2747         * Modules/indexeddb/IDBDatabase.cpp:
2748         (WebCore::IDBDatabase::IDBDatabase):
2749         (WebCore::IDBDatabase::~IDBDatabase):
2750         (WebCore::IDBDatabase::maybeCloseInServer):
2751
2752         * Modules/indexeddb/IDBOpenDBRequest.cpp:
2753         (WebCore::IDBOpenDBRequest::dispatchEvent):
2754
2755         * Modules/indexeddb/IDBTransaction.cpp:
2756         (WebCore::IDBTransaction::abortOnServerAndCancelRequests):
2757         (WebCore::IDBTransaction::commitOnServer):
2758         (WebCore::IDBTransaction::establishOnServer):
2759
2760         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
2761         (WebCore::IDBClient::IDBConnectionProxy::openDatabase):
2762         (WebCore::IDBClient::IDBConnectionProxy::deleteDatabase):
2763         (WebCore::IDBClient::IDBConnectionProxy::didOpenDatabase):
2764         (WebCore::IDBClient::IDBConnectionProxy::didDeleteDatabase):
2765         (WebCore::IDBClient::IDBConnectionProxy::completeOpenDBRequest):
2766         (WebCore::IDBClient::IDBConnectionProxy::fireVersionChangeEvent):
2767         (WebCore::IDBClient::IDBConnectionProxy::didFireVersionChangeEvent):
2768         (WebCore::IDBClient::IDBConnectionProxy::notifyOpenDBRequestBlocked):
2769         (WebCore::IDBClient::IDBConnectionProxy::establishTransaction):
2770         (WebCore::IDBClient::IDBConnectionProxy::didStartTransaction):
2771         (WebCore::IDBClient::IDBConnectionProxy::commitTransaction):
2772         (WebCore::IDBClient::IDBConnectionProxy::didCommitTransaction):
2773         (WebCore::IDBClient::IDBConnectionProxy::abortTransaction):
2774         (WebCore::IDBClient::IDBConnectionProxy::didAbortTransaction):
2775         (WebCore::IDBClient::IDBConnectionProxy::hasRecordOfTransaction):
2776         (WebCore::IDBClient::IDBConnectionProxy::didFinishHandlingVersionChangeTransaction):
2777         (WebCore::IDBClient::IDBConnectionProxy::databaseConnectionClosed):
2778         (WebCore::IDBClient::IDBConnectionProxy::registerDatabaseConnection):
2779         (WebCore::IDBClient::IDBConnectionProxy::unregisterDatabaseConnection):
2780         * Modules/indexeddb/client/IDBConnectionProxy.h:
2781         
2782         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
2783         (WebCore::IDBClient::IDBConnectionToServer::deleteDatabase):
2784         (WebCore::IDBClient::IDBConnectionToServer::didDeleteDatabase):
2785         (WebCore::IDBClient::IDBConnectionToServer::openDatabase):
2786         (WebCore::IDBClient::IDBConnectionToServer::didOpenDatabase):
2787         (WebCore::IDBClient::IDBConnectionToServer::establishTransaction):
2788         (WebCore::IDBClient::IDBConnectionToServer::commitTransaction):
2789         (WebCore::IDBClient::IDBConnectionToServer::didCommitTransaction):
2790         (WebCore::IDBClient::IDBConnectionToServer::didFinishHandlingVersionChangeTransaction):
2791         (WebCore::IDBClient::IDBConnectionToServer::abortTransaction):
2792         (WebCore::IDBClient::IDBConnectionToServer::didAbortTransaction):
2793         (WebCore::IDBClient::IDBConnectionToServer::fireVersionChangeEvent):
2794         (WebCore::IDBClient::IDBConnectionToServer::didFireVersionChangeEvent):
2795         (WebCore::IDBClient::IDBConnectionToServer::didStartTransaction):
2796         (WebCore::IDBClient::IDBConnectionToServer::notifyOpenDBRequestBlocked):
2797         (WebCore::IDBClient::IDBConnectionToServer::databaseConnectionClosed):
2798         (WebCore::IDBClient::IDBConnectionToServer::registerDatabaseConnection): Deleted.
2799         (WebCore::IDBClient::IDBConnectionToServer::unregisterDatabaseConnection): Deleted.
2800         (WebCore::IDBClient::IDBConnectionToServer::hasRecordOfTransaction): Deleted.
2801         * Modules/indexeddb/client/IDBConnectionToServer.h:
2802         
2803         * Modules/indexeddb/shared/IDBRequestData.cpp:
2804         (WebCore::IDBRequestData::IDBRequestData):
2805         * Modules/indexeddb/shared/IDBRequestData.h:
2806         
2807         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
2808         (WebCore::IDBResourceIdentifier::IDBResourceIdentifier):
2809         * Modules/indexeddb/shared/IDBResourceIdentifier.h:
2810
2811 2016-05-04  Brady Eidson  <beidson@apple.com>
2812
2813         Modern IDB: Add isolatedCopy to a few more objects.
2814         https://bugs.webkit.org/show_bug.cgi?id=157330
2815
2816         Reviewed by Alex Christensen.
2817
2818         No new tests (No current change in behavior, will be tested as bug 149953 makes progress).
2819
2820         * Modules/indexeddb/shared/IDBRequestData.cpp:
2821         (WebCore::IDBRequestData::IDBRequestData):
2822         (WebCore::IDBRequestData::isolatedCopy):
2823         * Modules/indexeddb/shared/IDBRequestData.h:
2824
2825         * Modules/indexeddb/shared/IDBResultData.cpp:
2826         (WebCore::IDBResultData::IDBResultData):
2827         (WebCore::IDBResultData::isolatedCopy):
2828         * Modules/indexeddb/shared/IDBResultData.h:
2829
2830 2016-05-04  Brady Eidson  <beidson@apple.com>
2831
2832         Modern IDB: Add thread identifiers and assertions to IDB DOM objects.
2833         https://bugs.webkit.org/show_bug.cgi?id=157329
2834
2835         Reviewed by Alex Christensen.
2836
2837         No new tests (No current change in behavior, will be tested as bug 149953 makes progress).
2838
2839         * Modules/indexeddb/IDBCursor.cpp:
2840         (WebCore::IDBCursor::IDBCursor):
2841         (WebCore::IDBCursor::~IDBCursor):
2842         (WebCore::IDBCursor::sourcesDeleted):
2843         (WebCore::IDBCursor::transaction):
2844         (WebCore::IDBCursor::direction):
2845         (WebCore::IDBCursor::update):
2846         (WebCore::IDBCursor::advance):
2847         (WebCore::IDBCursor::continueFunction):
2848         (WebCore::IDBCursor::uncheckedIterateCursor):
2849         (WebCore::IDBCursor::deleteFunction):
2850         (WebCore::IDBCursor::setGetResult):
2851         
2852         * Modules/indexeddb/IDBDatabase.cpp:
2853         (WebCore::IDBDatabase::~IDBDatabase):
2854         (WebCore::IDBDatabase::hasPendingActivity):
2855         (WebCore::IDBDatabase::name):
2856         (WebCore::IDBDatabase::version):
2857         (WebCore::IDBDatabase::objectStoreNames):
2858         (WebCore::IDBDatabase::createObjectStore):
2859         (WebCore::IDBDatabase::transaction):
2860         (WebCore::IDBDatabase::deleteObjectStore):
2861         (WebCore::IDBDatabase::close):
2862         (WebCore::IDBDatabase::maybeCloseInServer):
2863         (WebCore::IDBDatabase::activeDOMObjectName):
2864         (WebCore::IDBDatabase::canSuspendForDocumentSuspension):
2865         (WebCore::IDBDatabase::stop):
2866         (WebCore::IDBDatabase::startVersionChangeTransaction):
2867         (WebCore::IDBDatabase::didStartTransaction):
2868         (WebCore::IDBDatabase::willCommitTransaction):
2869         (WebCore::IDBDatabase::didCommitTransaction):
2870         (WebCore::IDBDatabase::willAbortTransaction):
2871         (WebCore::IDBDatabase::didAbortTransaction):
2872         (WebCore::IDBDatabase::didCommitOrAbortTransaction):
2873         (WebCore::IDBDatabase::fireVersionChangeEvent):
2874         (WebCore::IDBDatabase::dispatchEvent):
2875         (WebCore::IDBDatabase::didCreateIndexInfo):
2876         (WebCore::IDBDatabase::didDeleteIndexInfo):
2877         * Modules/indexeddb/IDBDatabase.h:
2878         (WebCore::IDBDatabase::originThreadID):
2879         
2880         * Modules/indexeddb/IDBIndex.cpp:
2881         (WebCore::IDBIndex::IDBIndex):
2882         (WebCore::IDBIndex::~IDBIndex):
2883         (WebCore::IDBIndex::name):
2884         (WebCore::IDBIndex::objectStore):
2885         (WebCore::IDBIndex::keyPath):
2886         (WebCore::IDBIndex::unique):
2887         (WebCore::IDBIndex::multiEntry):
2888         (WebCore::IDBIndex::openCursor):
2889         (WebCore::IDBIndex::doCount):
2890         (WebCore::IDBIndex::openKeyCursor):
2891         (WebCore::IDBIndex::doGet):
2892         (WebCore::IDBIndex::doGetKey):
2893         (WebCore::IDBIndex::markAsDeleted):
2894         
2895         * Modules/indexeddb/IDBObjectStore.cpp:
2896         (WebCore::IDBObjectStore::IDBObjectStore):
2897         (WebCore::IDBObjectStore::~IDBObjectStore):
2898         (WebCore::IDBObjectStore::name):
2899         (WebCore::IDBObjectStore::keyPath):
2900         (WebCore::IDBObjectStore::indexNames):
2901         (WebCore::IDBObjectStore::transaction):
2902         (WebCore::IDBObjectStore::autoIncrement):
2903         (WebCore::IDBObjectStore::openCursor):
2904         (WebCore::IDBObjectStore::get):
2905         (WebCore::IDBObjectStore::putOrAdd):
2906         (WebCore::IDBObjectStore::doDelete):
2907         (WebCore::IDBObjectStore::clear):
2908         (WebCore::IDBObjectStore::createIndex):
2909         (WebCore::IDBObjectStore::index):
2910         (WebCore::IDBObjectStore::deleteIndex):
2911         (WebCore::IDBObjectStore::doCount):
2912         (WebCore::IDBObjectStore::markAsDeleted):
2913         (WebCore::IDBObjectStore::rollbackInfoForVersionChangeAbort):
2914         
2915         * Modules/indexeddb/IDBOpenDBRequest.cpp:
2916         (WebCore::IDBOpenDBRequest::~IDBOpenDBRequest):
2917         (WebCore::IDBOpenDBRequest::onError):
2918         (WebCore::IDBOpenDBRequest::versionChangeTransactionDidFinish):
2919         (WebCore::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit):
2920         (WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion):
2921         (WebCore::IDBOpenDBRequest::dispatchEvent):
2922         (WebCore::IDBOpenDBRequest::onSuccess):
2923         (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
2924         (WebCore::IDBOpenDBRequest::onDeleteDatabaseSuccess):
2925         (WebCore::IDBOpenDBRequest::requestCompleted):
2926         (WebCore::IDBOpenDBRequest::requestBlocked):
2927         
2928         * Modules/indexeddb/IDBRequest.cpp:
2929         (WebCore::IDBRequest::~IDBRequest):
2930         (WebCore::IDBRequest::errorCode):
2931         (WebCore::IDBRequest::error):
2932         (WebCore::IDBRequest::setSource):
2933         (WebCore::IDBRequest::setVersionChangeTransaction):
2934         (WebCore::IDBRequest::transaction):
2935         (WebCore::IDBRequest::readyState):
2936         (WebCore::IDBRequest::sourceObjectStoreIdentifier):
2937         (WebCore::IDBRequest::sourceIndexIdentifier):
2938         (WebCore::IDBRequest::requestedIndexRecordType):
2939         (WebCore::IDBRequest::eventTargetInterface):
2940         (WebCore::IDBRequest::activeDOMObjectName):
2941         (WebCore::IDBRequest::canSuspendForDocumentSuspension):
2942         (WebCore::IDBRequest::hasPendingActivity):
2943         (WebCore::IDBRequest::stop):
2944         (WebCore::IDBRequest::enqueueEvent):
2945         (WebCore::IDBRequest::dispatchEvent):
2946         (WebCore::IDBRequest::uncaughtExceptionInEventHandler):
2947         (WebCore::IDBRequest::setResult):
2948         (WebCore::IDBRequest::setResultToStructuredClone):
2949         (WebCore::IDBRequest::clearResult):
2950         (WebCore::IDBRequest::setResultToUndefined):
2951         (WebCore::IDBRequest::resultCursor):
2952         (WebCore::IDBRequest::willIterateCursor):
2953         (WebCore::IDBRequest::didOpenOrIterateCursor):
2954         (WebCore::IDBRequest::requestCompleted):
2955         (WebCore::IDBRequest::onError):
2956         (WebCore::IDBRequest::onSuccess):
2957         * Modules/indexeddb/IDBRequest.h:
2958         (WebCore::IDBRequest::originThreadID):
2959         
2960         * Modules/indexeddb/IDBTransaction.cpp:
2961         (WebCore::IDBTransaction::IDBTransaction):
2962         (WebCore::IDBTransaction::~IDBTransaction):
2963         (WebCore::IDBTransaction::mode):
2964         (WebCore::IDBTransaction::db):
2965         (WebCore::IDBTransaction::serverConnection):
2966         (WebCore::IDBTransaction::error):
2967         (WebCore::IDBTransaction::objectStore):
2968         (WebCore::IDBTransaction::abortDueToFailedRequest):
2969         (WebCore::IDBTransaction::transitionedToFinishing):
2970         (WebCore::IDBTransaction::abort):
2971         (WebCore::IDBTransaction::abortOnServerAndCancelRequests):
2972         (WebCore::IDBTransaction::activeDOMObjectName):
2973         (WebCore::IDBTransaction::canSuspendForDocumentSuspension):
2974         (WebCore::IDBTransaction::hasPendingActivity):
2975         (WebCore::IDBTransaction::stop):
2976         (WebCore::IDBTransaction::isActive):
2977         (WebCore::IDBTransaction::isFinishedOrFinishing):
2978         (WebCore::IDBTransaction::addRequest):
2979         (WebCore::IDBTransaction::removeRequest):
2980         (WebCore::IDBTransaction::scheduleOperation):
2981         (WebCore::IDBTransaction::scheduleOperationTimer):
2982         (WebCore::IDBTransaction::operationTimerFired):
2983         (WebCore::IDBTransaction::commit):
2984         (WebCore::IDBTransaction::commitOnServer):
2985         (WebCore::IDBTransaction::finishAbortOrCommit):
2986         (WebCore::IDBTransaction::didStart):
2987         (WebCore::IDBTransaction::notifyDidAbort):
2988         (WebCore::IDBTransaction::didAbort):
2989         (WebCore::IDBTransaction::didCommit):
2990         (WebCore::IDBTransaction::fireOnComplete):
2991         (WebCore::IDBTransaction::fireOnAbort):
2992         (WebCore::IDBTransaction::enqueueEvent):
2993         (WebCore::IDBTransaction::dispatchEvent):
2994         (WebCore::IDBTransaction::createObjectStore):
2995         (WebCore::IDBTransaction::createObjectStoreOnServer):
2996         (WebCore::IDBTransaction::didCreateObjectStoreOnServer):
2997         (WebCore::IDBTransaction::createIndex):
2998         (WebCore::IDBTransaction::createIndexOnServer):
2999         (WebCore::IDBTransaction::didCreateIndexOnServer):
3000         (WebCore::IDBTransaction::requestOpenCursor):
3001         (WebCore::IDBTransaction::doRequestOpenCursor):
3002         (WebCore::IDBTransaction::openCursorOnServer):
3003         (WebCore::IDBTransaction::didOpenCursorOnServer):
3004         (WebCore::IDBTransaction::iterateCursor):
3005         (WebCore::IDBTransaction::iterateCursorOnServer):
3006         (WebCore::IDBTransaction::didIterateCursorOnServer):
3007         (WebCore::IDBTransaction::requestGetRecord):
3008         (WebCore::IDBTransaction::requestGetValue):
3009         (WebCore::IDBTransaction::requestGetKey):
3010         (WebCore::IDBTransaction::requestIndexRecord):
3011         (WebCore::IDBTransaction::getRecordOnServer):
3012         (WebCore::IDBTransaction::didGetRecordOnServer):
3013         (WebCore::IDBTransaction::requestCount):
3014         (WebCore::IDBTransaction::getCountOnServer):
3015         (WebCore::IDBTransaction::didGetCountOnServer):
3016         (WebCore::IDBTransaction::requestDeleteRecord):
3017         (WebCore::IDBTransaction::deleteRecordOnServer):
3018         (WebCore::IDBTransaction::didDeleteRecordOnServer):
3019         (WebCore::IDBTransaction::requestClearObjectStore):
3020         (WebCore::IDBTransaction::clearObjectStoreOnServer):
3021         (WebCore::IDBTransaction::didClearObjectStoreOnServer):
3022         (WebCore::IDBTransaction::requestPutOrAdd):
3023         (WebCore::IDBTransaction::putOrAddOnServer):
3024         (WebCore::IDBTransaction::didPutOrAddOnServer):
3025         (WebCore::IDBTransaction::deleteObjectStore):
3026         (WebCore::IDBTransaction::deleteObjectStoreOnServer):
3027         (WebCore::IDBTransaction::didDeleteObjectStoreOnServer):
3028         (WebCore::IDBTransaction::deleteIndex):
3029         (WebCore::IDBTransaction::deleteIndexOnServer):
3030         (WebCore::IDBTransaction::didDeleteIndexOnServer):
3031         (WebCore::IDBTransaction::operationDidComplete):
3032         (WebCore::IDBTransaction::establishOnServer):
3033         (WebCore::IDBTransaction::activate):
3034         (WebCore::IDBTransaction::deactivate):
3035
3036 2016-05-05  Nan Wang  <n_wang@apple.com>
3037
3038         For keyboard users, activating a fragment URL should transfer focus and caret to the destination
3039         https://bugs.webkit.org/show_bug.cgi?id=116046
3040
3041         Reviewed by Ryosuke Niwa.
3042
3043         Added a sequential focus navigation starting node to document. When TAB or SHIFT-TAB is pressed
3044         and there is no focused element, we start searching for next focus candidates at the sequential
3045         focus navigation node.
3046
3047         Test: fast/events/sequential-focus-navigation-starting-point.html
3048
3049         * dom/Document.cpp:
3050         (WebCore::Document::removedLastRef):
3051         (WebCore::Document::destroyRenderTree):
3052         (WebCore::Document::removeFocusedNodeOfSubtree):
3053         (WebCore::Document::hoveredElementDidDetach):
3054         (WebCore::Document::setFocusedElement):
3055         (WebCore::isNodeFrameOrDocument):
3056         (WebCore::Document::setFocusNavigationStartingNode):
3057         (WebCore::Document::focusNavigationStartingNode):
3058         (WebCore::Document::setCSSTarget):
3059         (WebCore::Document::nodeChildrenWillBeRemoved):
3060         (WebCore::Document::nodeWillBeRemoved):
3061         (WebCore::fallbackFocusNavigationStartingNodeAfterRemoval):
3062         (WebCore::Document::updateFocusNavigationStartingNodeWithNodeRemoval):
3063         (WebCore::Document::textInserted):
3064         * dom/Document.h:
3065         (WebCore::Document::userActionElements):
3066         * page/EventHandler.cpp:
3067         (WebCore::EventHandler::handleMousePressEvent):
3068         * page/FocusController.cpp:
3069         (WebCore::FocusController::advanceFocusInDocumentOrder):
3070         * page/FrameView.cpp:
3071         (WebCore::FrameView::scrollToAnchor):
3072
3073 2016-05-05  Ryosuke Niwa  <rniwa@webkit.org>
3074
3075         Another iOS debug build fix after r200464.
3076
3077         * dom/EventContext.h:
3078         (WebCore::EventContext::isUnreachableNode):
3079
3080 2016-05-05  Ryosuke Niwa  <rniwa@webkit.org>
3081
3082         iOS debug build fix after r200464.
3083
3084         * dom/EventContext.cpp:
3085         (WebCore::TouchEventContext::checkReachability):
3086
3087 2016-05-05  Simon Fraser  <simon.fraser@apple.com>
3088
3089         Revert r200390, thus putting r199259 and r200161 and back.
3090
3091         * loader/HistoryController.cpp:
3092         (WebCore::HistoryController::saveScrollPositionAndViewStateToItem):
3093         * page/FrameView.cpp:
3094         (WebCore::FrameView::adjustTiledBackingScrollability):
3095         * page/Page.h:
3096         (WebCore::Page::obscuredInset):
3097         (WebCore::Page::setObscuredInset):
3098         (WebCore::Page::enclosedInScrollableAncestorView):
3099         (WebCore::Page::setEnclosedInScrollableAncestorView):
3100         * platform/ScrollView.h:
3101         (WebCore::ScrollView::platformObscuredInset): Deleted.
3102         (WebCore::ScrollView::platformSetObscuredInset): Deleted.
3103
3104 2016-05-05  Sam Weinig  <sam@webkit.org>
3105
3106         Fix the build.
3107
3108         * platform/network/cf/CertificateInfo.h:
3109
3110 2016-05-05  Eric Carlson  <eric.carlson@apple.com>
3111
3112         [iOS] Media information is sometimes not shown in Control Center
3113         https://bugs.webkit.org/show_bug.cgi?id=157377
3114
3115         Reviewed by Jer Noble.
3116
3117         * platform/audio/ios/MediaSessionManagerIOS.h:
3118         * platform/audio/ios/MediaSessionManagerIOS.mm:
3119         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Store values passed to MPNowPlayingInfoCenter
3120           individually instead of in a dictionary.
3121
3122 2016-05-04  Simon Fraser  <simon.fraser@apple.com>
3123
3124         Comments on wired.com are blurry
3125         https://bugs.webkit.org/show_bug.cgi?id=148630
3126         rdar://problem/22499655
3127
3128         Reviewed by Tim Horton.
3129
3130         Make sure to set -rasterizationScale on TileGrid container layers to avoid blurry layers
3131         with some configurations of transforms, perspective and clipping.
3132
3133         Test: compositing/contents-scale/rasterization-scale.html
3134
3135         * platform/graphics/ca/TileController.cpp:
3136         (WebCore::TileController::TileController): Initialize m_deviceScaleFactor before m_tileGrid,
3137         because TileGrid's constructor needs to read the device scale.
3138         * platform/graphics/ca/TileController.h:
3139         * platform/graphics/ca/TileGrid.cpp:
3140         (WebCore::TileGrid::TileGrid): Push a contentsScale (which also sets rasterizationScale) onto 
3141         the tile grid container layer on constructions, and in setScale().
3142         (WebCore::TileGrid::setScale):
3143
3144 2016-05-05  Ryosuke Niwa  <rniwa@webkit.org>
3145
3146         event.target shouldn't be retargeted as the event bubbles into a slot
3147         https://bugs.webkit.org/show_bug.cgi?id=157369
3148
3149         Reviewed by Antti Koivisto.
3150
3151         When an event bubbles up from an assigned node to its assigned slot, we shouldn't be adjusting
3152         event.target to point to the slot. Since a shadow tree should have access to nodes outside
3153         the shadow tree, event.target is accessible inside the shadow tree of such a slot.
3154
3155         New behavior matches the behavior of Google Chrome Canary as well as the shadow DOM specification:
3156         http://w3c.github.io/webcomponents/spec/shadow/#dfn-retargeting-algorithm
3157
3158         Test: fast/shadow-dom/event-inside-slotted-node.html
3159
3160         * dom/Event.cpp:
3161         (WebCore::Event::deepPath):
3162         * dom/EventContext.h:
3163         (WebCore::EventContext::isUnreachableNode): Use Node::isUnclosedNode instead of isReachable.
3164         (WebCore::EventContext::isReachable): Deleted.
3165         * dom/EventPath.cpp:
3166         (WebCore::EventPath::EventPath): Don't set the target to the slot when entering a slot. Also moved
3167         the code to adjust the target as we exit a shadow tree to the end of the outer loop for clarity.
3168         (WebCore::isUnclosedNodeOf): Deleted. Renamed to Node::isUnclosedNode.
3169         (WebCore::EventPath::setRelatedTarget):
3170         (WebCore::EventPath::computePathUnclosedToTarget): Renamed from computePathDisclosedToTarget.
3171         (WebCore::moveOutOfAllShadowRoots): Extracted from RelatedNodeRetargeter::RelatedNodeRetargeter.
3172         (WebCore::RelatedNodeRetargeter::RelatedNodeRetargeter): Fixed a bug that we were exiting early
3173         without setting m_hasDifferentTreeRoot true when target and relatedNode are disconnected from
3174         a document.
3175         (WebCore::RelatedNodeRetargeter::currentNode):
3176         (WebCore::RelatedNodeRetargeter::checkConsistency): Updated to match the spec with one exception.
3177         We don't use null as the adjusted related target when the (original) related target and the target
3178         are in two distinct disconnected trees since such a behavior is not Web compatible. This spec bug is
3179         tracked by https://github.com/w3c/webcomponents/issues/494
3180         * dom/EventPath.h:
3181         (WebCore::EventPath::eventTargetRespectingTargetRules): Returns Node* instead of EventTarget* since
3182         we need a Node in RelatedNodeRetargeter::checkConsistency.
3183         * dom/Node.cpp:
3184         (WebCore::Node::isUnclosedNode): Moved from RelatedNodeRetargeter.cpp
3185         * dom/Node.h:
3186
3187 2016-05-02  Sam Weinig  <sam@webkit.org>
3188
3189         On platforms that support it, use a SecTrustRef as the basis of CertificateInfo instead of a chain of SecCertificateRefs.
3190         https://bugs.webkit.org/show_bug.cgi?id=157220
3191
3192         Reviewed by Darin Adler.
3193
3194         * platform/network/cf/CertificateInfo.h:
3195         (WebCore::CertificateInfo::CertificateInfo):
3196         (WebCore::CertificateInfo::trust):
3197         (WebCore::CertificateInfo::isEmpty):
3198         (WebCore::CertificateInfo::setCertificateChain): Deleted.
3199         (WebCore::CertificateInfo::certificateChain): Deleted.
3200         * platform/network/mac/CertificateInfoMac.mm:
3201         (WebCore::CertificateInfo::type):
3202         (WebCore::CertificateInfo::certificateChain):
3203         (WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate):
3204         (WebCore::CertificateInfo::dump):
3205         When supported, allow CertificateInfo to contain a SecTrustRef instead of a certificate chain. We keep
3206         support for holding on to a certificate chain as well, since there is API that depends on this.
3207
3208         * platform/network/cocoa/ResourceResponseCocoa.mm:
3209         (WebCore::ResourceResponse::platformCertificateInfo):
3210         When supported, use the SecTrustRef from the error instead of extracting it's certificate chain.
3211
3212 2016-05-04  Ada Chan  <adachan@apple.com>
3213
3214         When exiting fullscreen, call a JS method immediately to implement the style changes for the presentation mode change right away
3215         https://bugs.webkit.org/show_bug.cgi?id=157359
3216
3217         Reviewed by Eric Carlson.
3218
3219         No new tests as this is done to just mitigate a visual glitch.
3220
3221         * html/HTMLMediaElement.cpp:
3222         (WebCore::HTMLMediaElement::exitFullscreen):
3223         (WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange):
3224         * html/HTMLMediaElement.h:
3225
3226 2016-05-04  Alex Christensen  <achristensen@webkit.org>
3227
3228         Blocked redirected main resource requests need descriptive errors
3229         https://bugs.webkit.org/show_bug.cgi?id=156828
3230         rdar://problem/25711316
3231
3232         Reviewed by Daniel Bates.
3233
3234         Test: http/tests/contentextensions/main-resource-redirect-error.html
3235
3236         * loader/DocumentLoader.cpp:
3237         (WebCore::DocumentLoader::startLoadingMainResource):
3238         Call cancelMainResourceLoad() so that InjectedBundlePage::didFailProvisionalLoadWithErrorForFrame()
3239         is called to be consistent with blocked redirected main resource requests.
3240         * loader/ResourceLoader.cpp:
3241         (WebCore::ResourceLoader::willSendRequestInternal):
3242         (WebCore::ResourceLoader::blockedError):
3243         (WebCore::ResourceLoader::blockedByContentBlockerError):
3244         (WebCore::ResourceLoader::cannotShowURLError):
3245         * loader/ResourceLoader.h:
3246         Use a blockedByContentBlockerError() instead of a cannotShowURLError() when we blocked the load.
3247
3248 2016-05-05  Zan Dobersek  <zdobersek@igalia.com>
3249
3250         Fix assertions in debug builds for the GTK+ port.
3251
3252         Rubber-stamped by Carlos Garcia Campos.
3253
3254         * platform/graphics/texmap/TextureMapperGL.cpp:
3255         (WebCore::TextureMapperGLData::SharedGLData::currentSharedGLData):
3256         Switch back to the find() + add() combo for retrieving the pointer
3257         to the SharedGLData object stored for the specific GraphicsContext3D.
3258         add() + isNewEntry is causing assertions in debug builds when adding
3259         the first entry.
3260
3261 2016-05-05  Carlos Garcia Campos  <cgarcia@igalia.com>
3262
3263         [GStreamer] Adaptive streaming issues
3264         https://bugs.webkit.org/show_bug.cgi?id=144040
3265
3266         Reviewed by Philippe Normand.
3267
3268         In the case of adaptive streaming, the GST URI downloader object is creating the source object, in our case
3269         WebKitWebSrc, without taking its ownership. This is breaking the lifetime of the WebKitWebSrc element. We are
3270         using GRefPtr in WebKitWebSrc to ref/unref the object when sending notifications to the main thread, ensuring
3271         that the object is not destroyed before the main thread dispatches the message. But our smart pointers are so
3272         smart that in case of receiving a floating reference, it's converted to a full reference, so that the first time
3273         we try to take a ref of a WebKitWebSrc having a floating reference we are actually taking the ownership
3274         instead. When we try to release the reference, we are actuallty destroying the object, something that the actual
3275         owner is not expecting and causing runtime critical warnings and very often web process crashes.
3276
3277             (WebKitWebProcess:6863): GStreamer-CRITICAL **:
3278             Trying to dispose element appsrc1, but it is in READY instead of the NULL state.
3279             You need to explicitly set elements to the NULL state before
3280             dropping the final reference, to allow them to clean up.
3281             This problem may also be caused by a refcounting bug in the
3282             application or some element.
3283
3284             (WebKitWebProcess:6863): GStreamer-CRITICAL **: gst_uri_handler_get_uri: assertion 'GST_IS_URI_HANDLER(handler)' failed
3285
3286             (WebKitWebProcess:6863): GStreamer-CRITICAL **: gst_uri_get_protocol: assertion 'uri != NULL' failed
3287
3288         This should be fixed in GST, but we can workaround it in WebKit while it's fixed in GST or to prevent this from
3289         happening if other users make the same mistake. The idea is to add a ensureGRef() only available for GRefPtr
3290         when using WebKitWebSrc objects that consumes the floating reference if needed before taking the actual reference.
3291
3292         * platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
3293         (WTF::ensureGRef): Consume the floating ref if needed.
3294         * platform/graphics/gstreamer/GRefPtrGStreamer.h:
3295         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
3296         (webKitWebSrcChangeState): Use ensureGRef().
3297
3298 2016-05-05  Csaba Osztrogonác  <ossy@webkit.org>
3299
3300         [Mac][cmake] Unreviewed speculative buildfix after r200433, just for fun.
3301
3302         * PlatformMac.cmake:
3303
3304 2016-05-04  Zan Dobersek  <zdobersek@igalia.com>
3305
3306         [TexMap] Clean up TextureMapperShaderProgram
3307         https://bugs.webkit.org/show_bug.cgi?id=157302
3308
3309         Reviewed by Carlos Garcia Campos.
3310
3311         Clean up the header and the implementation file of the
3312         TextureMapperShaderProgram class. Reference the GraphicsContext3D
3313         object through a Ref<>, and have the context() return a reference,
3314         not a pointer.
3315
3316         Sort the parts of the implementation file into something more
3317         sensible. StringBuilder usage in create() is improved. getLocation()
3318         only needs to do one lookup in the m_variables map by using ensure().
3319
3320         No new tests -- no change in behavior.
3321
3322         * platform/graphics/surfaces/GLTransportSurface.cpp:
3323         (WebCore::GLTransportSurface::initializeShaderProgram):
3324         * platform/graphics/texmap/TextureMapperGL.cpp:
3325         (WebCore::TextureMapperGLData::SharedGLData::getShaderProgram):
3326         (WebCore::prepareFilterProgram):
3327         * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
3328         (WebCore::TextureMapperShaderProgram::create):
3329         (WebCore::TextureMapperShaderProgram::TextureMapperShaderProgram):
3330         (WebCore::TextureMapperShaderProgram::~TextureMapperShaderProgram):
3331         (WebCore::TextureMapperShaderProgram::setMatrix):
3332         (WebCore::TextureMapperShaderProgram::getLocation):
3333         * platform/graphics/texmap/TextureMapperShaderProgram.h:
3334         (WebCore::TextureMapperShaderProgram::context):
3335
3336 2016-05-03  Darin Adler  <darin@apple.com>
3337
3338         Start on dictionary support for IDL, getting enough to work for one dictionary
3339         https://bugs.webkit.org/show_bug.cgi?id=157336
3340
3341         Reviewed by Alex Christensen.
3342
3343         * bindings/js/JSDOMBinding.h: Return RefPtr instead of PassRefPtr for the return
3344         value of toArrayBufferView. Not only is this the correct modern idiom, it also
3345         works properly with auto, and PassRefPtr does not.
3346
3347         * bindings/js/JSDOMBuild.h: Added. This has the build function template in it.
3348         It's used to build values like dictionaries. We specialize and call the tempate
3349         in generated code. This is only the initial simplistic version; will be refining
3350         for exception handling, optional handling, default value handling, and lots of
3351         other things not yet needed for this first dictionary.
3352
3353         * bindings/scripts/CodeGenerator.pm:
3354         (ProcessDocument): Handle dictionaries much like how we handle enumerations.
3355         (SkipIncludeHeader): Moved small list of special types here from CodeGeneratorJS.
3356         (IsDictionaryType): Added.
3357         (IsRefPtrType): Make this return 0 for dictionary types.
3358
3359         * bindings/scripts/CodeGeneratorJS.pm:
3360         (GenerateInterface): Added handling for dictionaries.
3361         (SkipIncludeHeader): Deleted.
3362         (AddIncludesForType): Call the the SkipIncludeHeader from CodeGenerator.pm directly.
3363         (GetNestedClassName): Factored out the work that was previously in
3364         GetEnumerationClassName so we could reuse it for dictionaries too.
3365         (GetEnumerationClassName): Changed to call GetNestedClassName.
3366         (GetEnumerationClassIdentifier): Deleted. Instead of using this, we now use templates
3367         so we can use the actual class name.
3368         (GenerateEnumerationImplementationContent): Changed parse and expectedEnumerationValues
3369         to use function template specialization instead of functions. This cleans up the code
3370         a bit and makes it eaiser to use from other templates. Later we may want to merge the
3371         parse function template build function template from JSDOMBuild.h. Added specialization
3372         of the build function template.
3373         (GetDictionaryClassName): Added. Calls GetNestedClassName.
3374         (GenerateDictionaryImplementationContent): Added. Generates the build function for each
3375         dictionary type. Initial simplistic version to be refined.
3376         (GenerateImplementation): Added dictionaries argument and called the
3377         GenerateDictionaryImplementationContent function. Also changed many functions to take
3378         interface arguments and also removed redundant interfaceName arguments from functions
3379         that formerly took both.
3380         (GenerateParametersCheck): Updated for changes above. That includes calling the new
3381         parse function template. Also changed to use auto and WTFMove, which makes the code
3382         both more generic and potentially more efficient and obviates the need for a special
3383         case for dictionary types.
3384         (GenerateCallbackHeader): Updated for changes above.
3385         (GenerateCallbackImplementation): Ditto.
3386         (GenerateImplementationFunctionCall): Ditto.
3387         (GetNativeTypeFromSignature): Ditto.
3388         (GetNativeType): Changed this function to take the interface because that's needed to
3389         get the type name right for enumeration types rather than returning "auto". Made that
3390         change as well. Moved one type, DOMStringList, into the nativeType hash instead of
3391         having explicit code here for it. Didn't add a dictionary type case here yet, but
3392         probably will need to do that in the next patch.
3393         (ShouldPassWrapperByReference): Pass interface in to GetNativeType.
3394         (GetNativeVectorInnerType): Removed unneeded special case for DOMString.
3395         (GetNativeTypeForCallbacks): Changed to take the interface.
3396         (GetNativeTypeForMemoization): Ditto.
3397         (JSValueToNative): Changed expression for Dictionary (the thing I am working to make
3398         obsolete) to name the type so it will work with auto. Added a case for dictionary
3399         types and updated the case for enumeration types.
3400         (NativeToJSValue): Updated to take an interface rather than an interface name, and to
3401         pass that along as needed.
3402
3403         * bindings/scripts/IDLParser.pm:
3404         (Parse): Add dictionaries to a list.
3405         (parseDictionary): Put name, extended attributes, and members into the dictionary.
3406         (parseDictionaryMembers): Build up a members array.
3407         (parseDictionaryMember): Put isOptional, type, name, and default value into the
3408         dictionary member.
3409
3410         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
3411         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
3412         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3413         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
3414         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3415         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
3416         * bindings/scripts/test/JS/JSTestInterface.cpp:
3417         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3418         * bindings/scripts/test/JS/JSTestNode.cpp:
3419         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
3420         * bindings/scripts/test/JS/JSTestObj.cpp:
3421         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3422         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
3423         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3424         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3425         * bindings/scripts/test/ObjC/DOMTestObj.h:
3426         * bindings/scripts/test/ObjC/DOMTestObj.mm:
3427         Regenerated.
3428
3429         * bindings/scripts/test/TestObj.idl: Added some test cases that I was using to
3430         get the bindings script to work. Right now this is basically identical to the
3431         actual use of this in Element.idl, but over time I will modify it to cover more
3432         features of dictionaries. Also fixed some incorrect test cases trying to use
3433         the type "bool", which doesn't exist in IDL.
3434
3435         * dom/Element.cpp:
3436         (WebCore::Element::canHaveUserAgentShadowRoot): Added. The existing code used a
3437         combination of a virtual function on HTMLElement and type checking. It's better
3438         to just use a virtual function on Element.
3439         (WebCore::Element::attachShadow): Updated to take a ShadowRootInit struct instead
3440         of a Dictionary. Also tweaked the code in a couple other minor ways.
3441
3442         * dom/Element.h: Added the ShadowRootMode enum class and the ShadowRootInit struct,
3443         and changed attachShadow to take ShadowRootInit instead of Dictionary. Also added
3444         the private canHaveUserAgentShadowRoot virtual function.
3445
3446         * dom/Element.idl: Added ShadowRootMode, ShadowRootInit, and used them in as the
3447         arguemnt type for attachShadow.
3448
3449         * html/HTMLElement.h: Made canHaveUserAgentShadowRoot a private override instead
3450         of a public virtual function.
3451
3452 2016-05-04  Eric Carlson  <eric.carlson@apple.com>
3453
3454         [iOS] Playback does not pause when locking screen after playing to AirPlay.
3455         https://bugs.webkit.org/show_bug.cgi?id=157366
3456         <rdar://problem/22100651>
3457
3458         Reviewed by Dean Jackson.
3459
3460         * platform/audio/PlatformMediaSession.cpp:
3461         (WebCore::PlatformMediaSession::isPlayingToWirelessPlaybackTargetChanged): Save and restore
3462           m_interruptionCount around calling sessionIsPlayingToWirelessPlaybackTargetChanged because
3463           it will call beginInterruption if we are already in the background and the counter will
3464           get out of sync.
3465
3466 2016-05-04  Daniel Bates  <dabates@apple.com>
3467
3468         CSP: Perform case sensitive match against path portion of source expression URL that ends in '/'
3469         https://bugs.webkit.org/show_bug.cgi?id=157275
3470
3471         Reviewed by Darin Adler.
3472
3473         Merged from Blink:
3474         <https://chromium.googlesource.com/chromium/src/+/7bd0a75e3f71a10e71ded31ea5905d5ee3d992eb>
3475
3476         Perform a case-sensitive prefix match of the path portion a source expression that ends in '/'
3477         against the path portion of a request URL as per step 8.5.4 of section Does url match expression
3478         in origin with redirect count of the Content Security Policy Level 3 spec., <https://w3c.github.io/webappsec-csp>
3479         (Editor's Draft, 27 April 2016).
3480
3481         * page/csp/ContentSecurityPolicySource.cpp:
3482         (WebCore::ContentSecurityPolicySource::pathMatches):
3483
3484 2016-05-04  Aaron Chu  <aaron_chu@apple.com>
3485
3486         AX: Nonfunctional controls appear before every HTML5 video when using VoiceOver
3487         https://bugs.webkit.org/show_bug.cgi?id=153089
3488         <rdar://problem/24050668>
3489
3490         Reviewed by Dean Jackson.
3491
3492         Test: media/video-controls-show-on-kb-or-ax-event.html
3493
3494         * Modules/mediacontrols/mediaControlsApple.js:
3495         (Controller):
3496         (Controller.prototype.createControls):
3497         (Controller.prototype.updateControls):
3498         (Controller.prototype.handlePlayButtonClicked):
3499         (Controller.prototype.setPlaying):
3500         (Controller.prototype.showShowControlsButton):
3501         (Controller.prototype.showControls):
3502         (Controller.prototype.hideControls):
3503         * Modules/mediacontrols/mediaControlsiOS.js:
3504         (ControllerIOS.prototype.addStartPlaybackControls):
3505         (ControllerIOS.prototype.handleStartPlaybackButtonTouchEnd):
3506         (ControllerIOS.prototype.showControls):
3507
3508         Fix to make sure the showControls button in a media player behaves correctly.
3509
3510 2016-05-04  Dean Jackson  <dino@apple.com>
3511
3512         Disabling WebGL2 should mean no context is created
3513         https://bugs.webkit.org/show_bug.cgi?id=157352
3514         <rdar://problem/26096346>
3515
3516         Reviewed by Eric Carlson.
3517
3518         If WebGL2 is disabled by the runtime flag, we should
3519         not create a context.
3520
3521         Test: fast/canvas/webgl/webgl2-runtime-flag.html
3522
3523         * html/canvas/WebGLRenderingContextBase.cpp:
3524         (WebCore::WebGLRenderingContextBase::create):
3525         * testing/Internals.cpp: Added some helpers to toggle the runtime setting.
3526         (WebCore::Internals::webGL2Enabled):
3527         (WebCore::Internals::setWebGL2Enabled):
3528         * testing/Internals.h:
3529         * testing/Internals.idl:
3530
3531 2016-05-04  Anders Carlsson  <andersca@apple.com>
3532
3533         Add an override point for drawing named images in ThemeCocoa
3534         https://bugs.webkit.org/show_bug.cgi?id=157357
3535         rdar://problem/25878445
3536
3537         Reviewed by Dean Jackson.
3538
3539         Rename ThemeCocoa.cpp to ThemeCocoa.mm and rearrange the code that draws the wireless-playback image
3540         so we can import ThemeCocoaDrawNamedImage.mm below.
3541
3542         * WebCore.xcodeproj/project.pbxproj:
3543         * platform/cocoa/ThemeCocoa.cpp:
3544         (WebCore::fitContextToBox): Deleted.
3545         (WebCore::ThemeCocoa::drawNamedImage): Deleted.
3546         * platform/cocoa/ThemeCocoa.mm: Renamed from Source/WebCore/platform/cocoa/ThemeCocoa.cpp.
3547         (WebCore::fitContextToBox):
3548         (WebCore::ThemeCocoa::drawNamedImage):
3549
3550 2016-05-04  Jeremy Jones  <jeremyj@apple.com>
3551
3552         Don't disconnect WebAVPlayerController from its delegate since there is no way to reconnect it.
3553         https://bugs.webkit.org/show_bug.cgi?id=157337
3554
3555         Reviewed by Jer Noble.
3556
3557         WebAVPlayerController used to be deleted and recreated each time we begin fullscreen video mode.
3558         Since it is now preserved, we shouldn't paritally tear it down in cleanupFullscreen by disconnecting it
3559         from its delegate, especially since we have no way to reconnect it.
3560
3561         The side effect of leaving it connected is that it can continue to make callbacks during cleanup.
3562         Of importance is that it sets the audio and legible media selctions to nil. We don't want to change 
3563         the selection as a result of teardown. Nil selection is unsupported by WebVideoFullscreenModelVideoElement
3564         and causes an assert. This transition to nil selection is now ignored.
3565
3566         * platform/ios/WebAVPlayerController.mm:
3567         (-[WebAVPlayerController setCurrentAudioMediaSelectionOption:]):
3568         (-[WebAVPlayerController setCurrentLegibleMediaSelectionOption:]):
3569         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3570         (WebVideoFullscreenInterfaceAVKit::cleanupFullscreen):
3571
3572 2016-05-04  Chris Dumez  <cdumez@apple.com>
3573
3574         Media elements should not be paused right away when removed from the document
3575         https://bugs.webkit.org/show_bug.cgi?id=157347
3576         <rdar://problem/25888758>
3577
3578         Reviewed by Alex Christensen.
3579
3580         Media elements should not be paused right away when removed from the document.
3581         Instead we should allow the task that removed the media element from the
3582         document to finish because considering pausing.
3583
3584         This avoid inadvertently pausing media elements when the JS merely moves them
3585         on the page (e.g. using Node.replaceChild()).
3586
3587         Text from the HTML specification:
3588         """
3589         When a media element is removed from a Document, the user agent must run the
3590         following steps:
3591         1.  Await a stable state, allowing the task that removed the media element
3592             from the Document to continue. The synchronous section consists of all the
3593             remaining steps of this algorithm. (Steps in the synchronous section are
3594             marked with ⌛.)
3595         2. ⌛ If the media element is in a Document, abort these steps.
3596         3. ⌛ Run the internal pause steps for the media element.
3597         """
3598
3599         c.f. https://html.spec.whatwg.org/multipage/embedded-content.html#htmlmediaelement
3600
3601         Test: media/replaceChild-should-not-pause-video.html
3602
3603         * dom/GenericEventQueue.cpp:
3604         (WebCore::GenericEventQueue::sharedTimerFired):
3605         Copy the queue of events before processing it so that we don't fire events that
3606         get scheduled by the event handlers as a result of us firing the pending events.
3607         Otherwise, we end up firing events synchronously right after they've been queued,
3608         which is wrong. This was causing several W3C tests to fail.
3609
3610         * html/HTMLMediaElement.cpp:
3611         (WebCore::HTMLMediaElement::HTMLMediaElement):
3612         (WebCore::HTMLMediaElement::pauseAfterDetachedTimerFired):
3613         (WebCore::HTMLMediaElement::removedFrom):
3614         * html/HTMLMediaElement.h:
3615         After the media element gets removed from the document, schedule a 0 timer before
3616         pausing the media element, to give the task that removed us a chance to finish.
3617         When the timer fires, we check if we were added back into an active document and
3618         avoid pausing in such case.
3619
3620 2016-05-04  Filip Pizlo  <fpizlo@apple.com>
3621
3622         Speed up JSGlobalObject initialization by making some properties lazy
3623         https://bugs.webkit.org/show_bug.cgi?id=157045
3624
3625         Reviewed by Keith Miller.
3626
3627         No new tests because no change in behavior.
3628         
3629         This adapts JSHTMLElementCustom.cpp to the new JSWithScope API. Note that this revealed
3630         that this was using a curious choice of global object, which may not be right. I decided
3631         to do a very literal refactoring that exactly preserves what this code got before, but I
3632         added a FIXME to reconsider this later.
3633
3634         * bindings/js/JSHTMLElementCustom.cpp:
3635         (WebCore::JSHTMLElement::pushEventHandlerScope):
3636
3637 2016-05-04  Manuel Rego Casasnovas  <rego@igalia.com>
3638
3639         [css-grid] Refactor information stored related to column positions
3640         https://bugs.webkit.org/show_bug.cgi?id=157342
3641
3642         Reviewed by Darin Adler.
3643
3644         In m_columnPositions we were storing position of each column
3645         including the alignment offset, always from the logical left,
3646         and the border and padding, depending on the direction.
3647
3648         This was really confusing as in the case of RTL direction
3649         we were adding the offset from the left and
3650         the right border and padding.
3651
3652         This patches changes it to store always the info from the left,
3653         so even in RTL direction we use the left border and padding.
3654
3655         This allows us to simplify translateRTLCoordinate() as
3656         it doesn't need to care about border and padding anymore.
3657         And also to refactor offsetAndBreadthForPositionedChild()
3658         which became really complex after adding RTL support.
3659
3660         No new tests, no change of behavior.
3661
3662         * rendering/RenderGrid.cpp:
3663         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
3664         (WebCore::RenderGrid::populateGridPositions):
3665         (WebCore::RenderGrid::translateRTLCoordinate):
3666
3667 2016-05-04  Mark Lam  <mark.lam@apple.com>
3668
3669         ES6 Function.name inferred from property names of literal objects can break some websites.
3670         https://bugs.webkit.org/show_bug.cgi?id=157246
3671
3672         Reviewed by Geoffrey Garen.
3673
3674         Test: js/dom/regress-157246.html
3675
3676         * bindings/js/JSDOMWindowBase.cpp:
3677         (WebCore::JSDOMWindowBase::finishCreation):
3678         - Set the needsSiteSpecificQuirks flag in the JSGlobalObject if needed.
3679
3680 2016-05-04  Konstantin Tokarev  <annulen@yandex.ru>
3681
3682         Deduplicated initializer lists of BitmapImage constructors.
3683         https://bugs.webkit.org/show_bug.cgi?id=157249
3684
3685         Reviewed by Darin Adler.
3686
3687         No new tests needed.
3688
3689         * platform/graphics/BitmapImage.cpp:
3690         (WebCore::BitmapImage::BitmapImage): Added new private constructor of
3691         BitmapImage for delegation purpose only.
3692         * platform/graphics/BitmapImage.h: Use inline initialization for some
3693         BitmapImage fields.
3694         * platform/graphics/cairo/BitmapImageCairo.cpp:
3695         (WebCore::BitmapImage::BitmapImage): Delegate field initialization to
3696         new private constructor.
3697         * platform/graphics/cg/BitmapImageCG.cpp:
3698         (WebCore::BitmapImage::BitmapImage): Ditto.
3699
3700 2016-05-04  Chris Dumez  <cdumez@apple.com>
3701
3702         Unreviewed, rolling out r200383 and r200406.
3703
3704         Seems to have caused crashes on iOS / ARMv7s
3705
3706         Reverted changesets:
3707
3708         "Speed up JSGlobalObject initialization by making some
3709         properties lazy"
3710         https://bugs.webkit.org/show_bug.cgi?id=157045
3711         http://trac.webkit.org/changeset/200383
3712
3713         "REGRESSION(r200383): Setting lazily initialized properties
3714         across frame boundaries crashes"
3715         https://bugs.webkit.org/show_bug.cgi?id=157333
3716         http://trac.webkit.org/changeset/200406
3717
3718 2016-05-04  Joanmarie Diggs  <jdiggs@igalia.com>
3719
3720         AX: ARIA 'region' role is now a landmark; HTML 'section' element should be a landmark only if named
3721         https://bugs.webkit.org/show_bug.cgi?id=157331
3722
3723         Reviewed by Chris Fleizach.
3724
3725         The 'region' role is now mapped as a landmark: The WebCore DocumentRegionRole
3726         AccessibilityRole has been renamed to LandmarkRegionRole. The AXDocumentRegion
3727         subrole has been renamed to AXLandmarkRegion. A 'section' element is mapped to
3728         the LandmarkRegionRole if it has an author-provided accessible name via either
3729         the aria-label or aria-labelledby attribute. Otherwise, it is mapped as GroupRole
3730         with no subrole.
3731
3732         Our existing test coverage for exposure of the 'region' role and the 'section'
3733         element is sufficient. These tests were updated to reflect the new behavior.
3734         Several new test cases were added to cover both sections with accessible names
3735         and those without.
3736
3737         * accessibility/AccessibilityObject.cpp:
3738         (WebCore::AccessibilityObject::accessibleNameDerivesFromContent):
3739         (WebCore::AccessibilityObject::isLandmark):
3740         (WebCore::initializeRoleMap):
3741         * accessibility/AccessibilityObject.h:
3742         * accessibility/AccessibilityRenderObject.cpp:
3743         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
3744         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
3745         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
3746         (atkRole):
3747         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3748         (-[WebAccessibilityObjectWrapper _accessibilityIsLandmarkRole:]):
3749         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
3750         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
3751         (-[WebAccessibilityObjectWrapperBase ariaLandmarkRoleDescription]):
3752         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3753         (createAccessibilityRoleMap):
3754         (-[WebAccessibilityObjectWrapper subrole]):
3755         * platform/LocalizedStrings.cpp:
3756         (WebCore::AXARIAContentGroupText):
3757
3758 2016-05-04  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3759
3760         Clicks inside button elements are sometimes discarded when the mouse moves
3761         https://bugs.webkit.org/show_bug.cgi?id=39620
3762
3763         Reviewed by Darin Adler.
3764
3765         Test: fast/events/click-over-descendant-elements.html
3766
3767         * dom/Node.cpp:
3768         (WebCore::ancestor):
3769         (WebCore::commonAncestor): Method inspired from
3770         http://src.chromium.org/viewvc/blink?view=revision&revision=162081.
3771         (WebCore::commonAncestorCrossingShadowBoundary): Helper routine
3772         that handles the case of nodes into a shadow node.
3773         * dom/Node.h:
3774         * page/EventHandler.cpp:
3775         (WebCore::EventHandler::handleMouseReleaseEvent): Selecting click event
3776         target node according commonAncestorOverShadowBoundary method.
3777         (WebCore::EventHandler::targetNodeForClickEvent): Deleted.
3778
3779 2016-05-04  Zan Dobersek  <zdobersek@igalia.com>
3780
3781         Unreviewed, fixing crashing GTK+ tests after r200407.
3782
3783         * platform/graphics/texmap/TextureMapperGL.cpp:
3784         (WebCore::TextureMapperGLData::SharedGLData::~SharedGLData):
3785         Don't use RELEASE_ASSERT. Also fix the actual assertion,
3786         checking that any of the values in the map matches the object
3787         that's being destroyed, instead of checking the keys.
3788
3789 2016-05-04  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3790
3791         Add WKPreference for SelectionPaintingWithoutSelectionGaps
3792         https://bugs.webkit.org/show_bug.cgi?id=156900
3793
3794         Reviewed by Michael Catanzaro.
3795
3796         Unlike other browsers WebKit has been drawing selection gaps
3797         between render blocks during the text selection. This often
3798         cause text selection screen looks messy.
3799
3800         This patch adds a setting method to disable the functionality,
3801         and EFL port disables it by default.
3802
3803         * page/Settings.in:
3804         * rendering/RenderBlock.cpp:
3805         (WebCore::RenderBlock::shouldPaintSelectionGaps):
3806
3807 2016-05-04  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3808
3809         Rename JSKeyValueIterator as JSDOMIterator
3810         https://bugs.webkit.org/show_bug.cgi?id=157308
3811
3812         Reviewed by Darin Adler.
3813
3814         No change of behavior.
3815
3816         * bindings/js/JSDOMIterator.h: Renamed from Source/WebCore/bindings/js/JSKeyValueIterator.h.
3817         (WebCore::JSDOMIteratorPrototype::create):
3818         (WebCore::JSDOMIteratorPrototype::createStructure):
3819         (WebCore::JSDOMIteratorPrototype::JSDOMIteratorPrototype):
3820         (WebCore::createKeyValueIterator):
3821         (WebCore::keyValueIteratorForEach):
3822         (WebCore::JSDOMIterator<JSWrapper>::destroy):
3823         (WebCore::JSDOMIterator<JSWrapper>::next):
3824         (WebCore::JSDOMIteratorPrototype<JSWrapper>::next):
3825         (WebCore::JSDOMIteratorPrototype<JSWrapper>::finishCreation):
3826         * bindings/js/JSFontFaceSetCustom.cpp:
3827         * bindings/scripts/CodeGeneratorJS.pm:
3828         (GenerateImplementationIterableFunctions):
3829         * bindings/scripts/test/JS/JSTestObj.cpp:
3830
3831 2016-05-04  Jiewen Tan  <jiewen_tan@apple.com>
3832
3833         CrashTracer: [USER] com.apple.WebKit.WebContent at …ple.WebCore: WebCore::EditCommandComposition::unapply + 105
3834         https://bugs.webkit.org/show_bug.cgi?id=157282
3835         <rdar://problem/25391441>
3836
3837         Reviewed by Darin Adler.
3838
3839         A frame could be destroyed in the middle of executing undo/redo command.
3840         Therefore, add an early return.
3841
3842         * editing/CompositeEditCommand.cpp:
3843         (WebCore::EditCommandComposition::unapply):
3844         (WebCore::EditCommandComposition::reapply):
3845
3846 2016-05-04  Zan Dobersek  <zdobersek@igalia.com>
3847
3848         [CoordGraphics] CompositingCoordinator should hande root compositing and view overlay layers separately
3849         https://bugs.webkit.org/show_bug.cgi?id=157305
3850
3851         Reviewed by Carlos Garcia Campos.
3852
3853         Split out handling of the root compositing and the view overlay layers
3854         into two separate methods. Both do nothing if the passed-in layer is
3855         the same as the current one. Otherwise, the current one is removed
3856         from the tree and the new one added to it.
3857
3858         No change in behavior is expected.
3859
3860         * platform/graphics/texmap/coordinated/CompositingCoordinator.cpp:
3861         (WebCore::CompositingCoordinator::setRootCompositingLayer):
3862         (WebCore::CompositingCoordinator::setViewOverlayRootLayer):
3863         * platform/graphics/texmap/coordinated/CompositingCoordinator.h:
3864
3865 2016-05-04  Zan Dobersek  <zdobersek@igalia.com>
3866
3867         [TexMap] Clean up TextureMapperGLData, TextureMapperGLData::SharedGLData
3868         https://bugs.webkit.org/show_bug.cgi?id=157303
3869
3870         Reviewed by Carlos Garcia Campos.
3871
3872         Torch the TextureMapperGLData and TextureMapperGLData::SharedGLData
3873         classes into a better form.
3874
3875         SharedGLData is now private to the TextureMapperGLData class, but
3876         lists that class as a friend. This enables moving the getShaderProgram()
3877         method to TextureMapperGLData and removes the need to expose the
3878         SharedGLData publicly. SharedGLData also doesn't have to keep a
3879         reference to the GraphicsContext3D object.
3880
3881         TextureMapperGLData now default-initializes the publicly accessible
3882         member variables while making some other members private, not exposing
3883         anything that isn't necessary.
3884
3885         Usual whitespace cleanup included. More elegant HashMap::ensure()
3886         insertions are used where they don't obfuscate object creation.
3887
3888         No new tests -- no change in behavior.
3889
3890         * platform/graphics/texmap/TextureMapperGL.cpp:
3891         (WebCore::TextureMapperGLData::SharedGLData::currentSharedGLData):
3892         (WebCore::TextureMapperGLData::SharedGLData::~SharedGLData):
3893         (WebCore::TextureMapperGLData::SharedGLData::contextDataMap):
3894         (WebCore::TextureMapperGLData::SharedGLData::SharedGLData):
3895         (WebCore::TextureMapperGLData::TextureMapperGLData):
3896         (WebCore::TextureMapperGLData::~TextureMapperGLData):
3897         (WebCore::TextureMapperGLData::initializeStencil):
3898         (WebCore::TextureMapperGLData::getStaticVBO):
3899         (WebCore::TextureMapperGLData::getShaderProgram):
3900         (WebCore::TextureMapperGL::TextureMapperGL):
3901         (WebCore::TextureMapperGL::drawBorder):
3902         (WebCore::TextureMapperGL::drawTexture):
3903         (WebCore::TextureMapperGL::drawSolidColor):
3904         (WebCore::TextureMapperGL::drawFiltered):
3905         (WebCore::TextureMapperGL::beginClip):
3906         (WebCore::TextureMapperGLData::SharedGLData::glContextDataMap): Deleted.
3907         (WebCore::TextureMapperGLData::SharedGLData::getShaderProgram): Deleted.
3908         (WebCore::TextureMapperGLData::sharedGLData): Deleted.
3909         * platform/graphics/texmap/TextureMapperGL.h:
3910
3911 2016-05-03  Chris Dumez  <cdumez@apple.com>
3912
3913         Optimize [StrictTypeChecking] on IDL attributes
3914         https://bugs.webkit.org/show_bug.cgi?id=157321
3915
3916         Reviewed by Geoffrey Garen.
3917
3918         Optimize [StrictTypeChecking] on IDL attributes:
3919         - Only generate extra code for nullable attributes because for non-nullable
3920           attributes, JSXXX::toWrapped() will return null in case of a bad input
3921           type. We will then throw a TypeError when null-checking it already.
3922         - After the JSValue::isNullOrUndefined() check, avoid calling
3923           JSXXX::toWrapped() and set nativeValue to nullptr directly.
3924         - Drop the check for JSValue::inherits(JSXXX::info()) and just do a null
3925           check on the value returned by JSXXX::toWrapped(). toWrapped() already
3926           does a JSValue::inherits(JSXXX::info() check. Since we only call
3927           toWrapped() if the JSValue is not null/undefined, a null return value
3928           always indicates a bad input type.
3929
3930         * bindings/scripts/CodeGeneratorJS.pm:
3931         (GenerateImplementation):