Don't run transitions to/from 'auto' values
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-05-02  Simon Fraser  <simon.fraser@apple.com>
2
3         Don't run transitions to/from 'auto' values
4         https://bugs.webkit.org/show_bug.cgi?id=38243
5         rdar://problem/20904225
6
7         Reviewed by Dean Jackson.
8         
9         The specified behavior of transitions and animations is to not animate when either endpoint is 'auto'.
10         Previously, we were treating 'auto' as zero and interpolating, which caused unwanted animations
11         on fandango.com, airbnb.com and others.
12         
13         Fix by having blend() return the from value if progress is 0, otherwise the to value. The
14         isZero() check can be removed, since this was effectively picking up auto value for one endpoint.
15
16         Tests: transitions/lengthsize-transition-to-from-auto.html
17                transitions/transition-to-from-auto.html
18
19         * platform/Length.cpp:
20         (WebCore::blend):
21
22 2016-05-02  Chris Dumez  <cdumez@apple.com>
23
24         Indexing CSSStyleDeclaration object with out-of-range index should return undefined
25         https://bugs.webkit.org/show_bug.cgi?id=157283
26
27         Reviewed by Darin Adler.
28
29         Indexing CSSStyleDeclaration object with out-of-range index should return undefined,
30         as per:
31         - http://heycam.github.io/webidl/#idl-indexed-properties
32         - http://heycam.github.io/webidl/#getownproperty-guts
33
34         WebKit was incorrectly returning the empty string in this case. We however, still
35         return the empty string if calling the indexed property getter via item(), as is
36         expected.
37
38         The new behavior matches Firefox and the Web IDL specification. Chrome returns the
39         empty string in this case though.
40
41         Test: fast/dom/indexed-getters-returning-string.html
42
43         * css/CSSComputedStyleDeclaration.cpp:
44         (WebCore::CSSComputedStyleDeclaration::item):
45         * css/PropertySetCSSStyleDeclaration.cpp:
46         (WebCore::PropertySetCSSStyleDeclaration::item):
47
48 2016-05-02  Antoine Quint  <graouts@apple.com>
49
50         Specifying a longhand property should not serialize to a shorthand property
51         https://bugs.webkit.org/show_bug.cgi?id=157180
52
53         Reviewed by Dean Jackson.
54
55         Ensure that we don't serialize to a shorthand property when the required longhand components
56         are not specified, per http://www.w3.org/TR/cssom-1/#serialize-a-css-declaration-block.
57
58         Test: fast/css/no-shorthand-with-incomplete-longhands.html
59
60         * css/StyleProperties.cpp:
61         (WebCore::StyleProperties::getLayeredShorthandValue):
62         Returning an empty string here means that calling getPropertyValue() with
63         the shorthand property matching the currently processed longhand property
64         in asText() will return an empty string as well and the shorthand property
65         will be disregarded.
66
67 2016-05-02  Dean Jackson  <dino@apple.com>
68
69         REGRESSION: Page layout of Manga/Picture books and all Fixed Layout ePubs corrupted
70         https://bugs.webkit.org/show_bug.cgi?id=157292
71         <rdar://problem/25750144>
72
73         Reviewed by Tim Horton.
74
75         The scroll state restoration fixes caused a regression in UIWebViews.
76         Code in UIKit checks for a non-zero page scale in a history item, and
77         r199233 changed the initialization from 0 to 1.
78
79         * history/HistoryItem.h: Use 0 instead of 1 as the initial m_scale.
80
81 2016-05-02  Eric Carlson  <eric.carlson@apple.com>
82
83         [Mac] AirPlay fails if target is set before AVPlayer has been created
84         https://bugs.webkit.org/show_bug.cgi?id=157147
85         <rdar://problem/24197592>
86
87         Reviewed by Dean Jackson.
88
89         No new tests, it won't be possible to test this until 
90         https://bugs.webkit.org/show_bug.cgi?id=157290 has been fixed.
91
92         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
93         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
94
95 2016-05-02  Brady Eidson  <beidson@apple.com>
96
97         Const-ify some IDB code.
98         https://bugs.webkit.org/show_bug.cgi?id=157287
99
100         Reviewed by Alex Christensen.
101
102         No new tests (Refactor only).
103
104         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
105         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
106         (WebCore::InProcessIDBServer::deleteDatabase):
107         (WebCore::InProcessIDBServer::openDatabase):
108         (WebCore::InProcessIDBServer::abortTransaction):
109         (WebCore::InProcessIDBServer::commitTransaction):
110         (WebCore::InProcessIDBServer::didFinishHandlingVersionChangeTransaction):
111         * Modules/indexeddb/shared/InProcessIDBServer.h:
112
113 2016-05-02  Antti Koivisto  <antti@apple.com>
114
115         REGRESSION(r199964): Animation on pseudo elements doesn't trigger if first frame matches the current style
116         https://bugs.webkit.org/show_bug.cgi?id=157284
117
118         Reviewed by Simon Fraser.
119
120         r199964 accidentally changed the logic for computing style change for animations.
121
122         Test: fast/css/animation-pseudo-style-change.html
123
124         * style/RenderTreeUpdater.cpp:
125         (WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement):
126
127             If there is an animated style determine the style change using it rather than the originally resolved style.
128
129         * style/StyleTreeResolver.cpp:
130         (WebCore::Style::TreeResolver::resolveElement):
131
132             Here too.
133
134 2016-05-02  Brady Eidson  <beidson@apple.com>
135
136         Add the ability to accumulate logs for specific logging channels to help diagnose test timeouts.
137         https://bugs.webkit.org/show_bug.cgi?id=157274
138
139         Reviewed by Alex Christensen.
140
141         * platform/Logging.cpp:
142         (WebCore::setLogChannelToAccumulate): Set the given log channel to accumulate logging,
143           and dirty the initializeLoggingChannelsIfNecessary flag.
144         (WebCore::initializeLoggingChannelsIfNecessary): Change from being a one-time-only call to a 
145           one-time-for-each-time-somebody-calls-setLogChannelToAccumulate call.
146         * platform/Logging.h:
147
148         * testing/js/WebCoreTestSupport.cpp:
149         (WebCoreTestSupport::setLogChannelToAccumulate):
150         (WebCoreTestSupport::initializeLoggingChannelsIfNecessary):
151         * testing/js/WebCoreTestSupport.h:
152
153 2016-05-02  Simon Fraser  <simon.fraser@apple.com>
154
155         Sort the project file.
156
157         * WebCore.xcodeproj/project.pbxproj:
158
159 2016-05-02  Simon Fraser  <simon.fraser@apple.com>
160
161         Make Length, LengthSize and LengthPoint blending not use member functions
162         https://bugs.webkit.org/show_bug.cgi?id=157281
163
164         Reviewed by Zalan Bujtas.
165
166         Having blend() be a member function is ambiguous because it's hard to tell which are
167         the 'from' and 'to' values. Fix Length, LengthSize and LengthPoint accordingly.
168
169         No behavior change.
170
171         * page/animation/CSSPropertyAnimation.cpp:
172         (WebCore::blendFunc):
173         * platform/Length.cpp:
174         (WebCore::blendMixedTypes):
175         (WebCore::blend):
176         (WebCore::Length::blendMixedTypes): Deleted.
177         * platform/Length.h:
178         (WebCore::Length::blend): Deleted.
179         * platform/LengthPoint.h:
180         (WebCore::blend):
181         (WebCore::LengthPoint::blend): Deleted.
182         * platform/LengthSize.h:
183         (WebCore::blend):
184         (WebCore::LengthSize::blend): Deleted.
185         * platform/graphics/filters/FilterOperation.cpp:
186         (WebCore::BlurFilterOperation::blend):
187         * platform/graphics/transforms/TranslateTransformOperation.cpp:
188         (WebCore::TranslateTransformOperation::blend):
189         * rendering/style/BasicShapes.cpp:
190         (WebCore::BasicShapePolygon::blend):
191         (WebCore::BasicShapeInset::blend):
192         * rendering/style/BasicShapes.h:
193         (WebCore::BasicShapeCenterCoordinate::blend):
194         (WebCore::BasicShapeRadius::blend):
195
196 2016-05-02  Simon Fraser  <simon.fraser@apple.com>
197
198         Fix shouldUpdateScrollLayerPositionSynchronously() for non-main frames. Remove updatesScrollLayerPositionOnMainThread()
199         https://bugs.webkit.org/show_bug.cgi?id=157277
200
201         Reviewed by Dean Jackson, Tim Horton.
202
203         shouldUpdateScrollLayerPositionSynchronously() gave an answer for the main frame even if
204         called for a subframe. This could have caused scroll snapping, and isRubberBandInProgress()
205         to give wrong answers sometimes. Fix by passing in the FrameView.
206
207         I was unable to easily come up with a testcase to detect the incorrect behavior.
208
209         Remove updatesScrollLayerPositionOnMainThread() which is unused by all ports.
210
211         * page/FrameView.cpp:
212         (WebCore::FrameView::isScrollSnapInProgress):
213         (WebCore::FrameView::shouldUpdateCompositingLayersAfterScrolling):
214         (WebCore::FrameView::isRubberBandInProgress):
215         (WebCore::FrameView::updatesScrollLayerPositionOnMainThread): Deleted.
216         * page/FrameView.h:
217         * page/scrolling/ScrollingCoordinator.cpp:
218         (WebCore::ScrollingCoordinator::updateSynchronousScrollingReasons):
219         (WebCore::ScrollingCoordinator::shouldUpdateScrollLayerPositionSynchronously):
220         * page/scrolling/ScrollingCoordinator.h:
221         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
222         (WebCore::ScrollingCoordinatorMac::updateTiledScrollingIndicator):
223         * platform/ScrollableArea.h:
224         * platform/win/PopupMenuWin.h:
225         * rendering/RenderLayer.cpp:
226         (WebCore::RenderLayer::setupFontSubpixelQuantization):
227         * rendering/RenderLayer.h:
228         * rendering/RenderListBox.h:
229
230 2016-05-02  Simon Fraser  <simon.fraser@apple.com>
231
232         Add to the Animations log channel output about which properties are being blended
233         https://bugs.webkit.org/show_bug.cgi?id=157271
234
235         Reviewed by Dean Jackson.
236
237         Make the Animations log channel dump information as CSS properties are being blended.
238         Sample output:
239
240           blending left from 0px to 400px at 0.57 -> 227.76px
241           blending transform from translate(0px, 0px, 0px) to translate(400px, 0px, 0px) at 0.74 -> translate(294.97px, 0px, 0px)
242
243         This makes it easier to see, for example, transitions to or from "auto" values.
244
245         * CMakeLists.txt:
246         * WebCore.xcodeproj/project.pbxproj:
247         * page/animation/CSSPropertyAnimation.cpp:
248         (WebCore::PropertyWrapperGetter::value):
249         (WebCore::PropertyWrapperMaybeInvalidColor::value):
250         (WebCore::CSSPropertyAnimationWrapperMap::wrapperForProperty):
251         (WebCore::CSSPropertyAnimation::blendProperties):
252         * platform/Length.cpp:
253         (WebCore::operator<<):
254         * platform/LengthBox.h:
255         * platform/graphics/transforms/IdentityTransformOperation.h:
256         * platform/graphics/transforms/Matrix3DTransformOperation.cpp:
257         (WebCore::Matrix3DTransformOperation::dump):
258         * platform/graphics/transforms/Matrix3DTransformOperation.h:
259         * platform/graphics/transforms/MatrixTransformOperation.cpp:
260         (WebCore::MatrixTransformOperation::dump):
261         * platform/graphics/transforms/MatrixTransformOperation.h:
262         * platform/graphics/transforms/PerspectiveTransformOperation.cpp:
263         (WebCore::PerspectiveTransformOperation::dump):
264         * platform/graphics/transforms/PerspectiveTransformOperation.h:
265         * platform/graphics/transforms/RotateTransformOperation.cpp:
266         (WebCore::RotateTransformOperation::dump):
267         * platform/graphics/transforms/RotateTransformOperation.h:
268         * platform/graphics/transforms/ScaleTransformOperation.cpp:
269         (WebCore::ScaleTransformOperation::dump):
270         * platform/graphics/transforms/ScaleTransformOperation.h:
271         * platform/graphics/transforms/SkewTransformOperation.cpp:
272         (WebCore::SkewTransformOperation::dump):
273         * platform/graphics/transforms/SkewTransformOperation.h:
274         * platform/graphics/transforms/TransformOperation.h:
275         * platform/graphics/transforms/TransformOperations.cpp:
276         (WebCore::operator<<):
277         * platform/graphics/transforms/TransformOperations.h:
278         * platform/graphics/transforms/TranslateTransformOperation.cpp:
279         (WebCore::TranslateTransformOperation::dump):
280         * platform/graphics/transforms/TranslateTransformOperation.h:
281         * rendering/style/NinePieceImage.cpp:
282         (WebCore::operator<<):
283         * rendering/style/NinePieceImage.h:
284         * svg/SVGLength.cpp:
285         (WebCore::operator<<):
286         * svg/SVGLength.h:
287
288 2016-05-02  Chris Dumez  <cdumez@apple.com>
289
290         Modernize HTMLConstructionSite
291         https://bugs.webkit.org/show_bug.cgi?id=157279
292
293         Reviewed by Alex Christensen.
294
295         Modernize HTMLConstructionSite: Use less raw pointers, more auto, more
296         range loops and more nullptr.
297
298         * dom/ScriptElement.h:
299         * html/parser/HTMLConstructionSite.cpp:
300         (WebCore::setAttributes):
301         (WebCore::shouldUseLengthLimit):
302         (WebCore::executeReparentTask):
303         (WebCore::HTMLConstructionSite::attachLater):
304         (WebCore::HTMLConstructionSite::executeQueuedTasks):
305         (WebCore::HTMLConstructionSite::HTMLConstructionSite):
306         (WebCore::HTMLConstructionSite::takeForm):
307         (WebCore::HTMLConstructionSite::dispatchDocumentElementAvailableIfNeeded):
308         (WebCore::HTMLConstructionSite::insertHTMLHtmlStartTagBeforeHTML):
309         (WebCore::HTMLConstructionSite::mergeAttributesFromTokenIntoElement):
310         (WebCore::HTMLConstructionSite::insertHTMLHtmlStartTagInBody):
311         (WebCore::HTMLConstructionSite::insertHTMLBodyStartTagInBody):
312         (WebCore::HTMLConstructionSite::setDefaultCompatibilityMode):
313         (WebCore::HTMLConstructionSite::setCompatibilityMode):
314         (WebCore::HTMLConstructionSite::finishedParsing):
315         (WebCore::HTMLConstructionSite::insertDoctype):
316         (WebCore::HTMLConstructionSite::insertComment):
317         (WebCore::HTMLConstructionSite::insertCommentOnDocument):
318         (WebCore::HTMLConstructionSite::insertCommentOnHTMLHtmlElement):
319         (WebCore::HTMLConstructionSite::insertHTMLHeadElement):
320         (WebCore::HTMLConstructionSite::insertHTMLBodyElement):
321         (WebCore::HTMLConstructionSite::insertHTMLFormElement):
322         (WebCore::HTMLConstructionSite::insertHTMLElement):
323         (WebCore::HTMLConstructionSite::insertHTMLElementOrFindCustomElementInterface):
324         (WebCore::HTMLConstructionSite::insertCustomElement):
325         (WebCore::HTMLConstructionSite::insertSelfClosingHTMLElement):
326         (WebCore::HTMLConstructionSite::insertFormattingElement):
327         (WebCore::HTMLConstructionSite::insertScriptElement):
328         (WebCore::HTMLConstructionSite::insertForeignElement):
329         (WebCore::HTMLConstructionSite::insertTextNode):
330         (WebCore::HTMLConstructionSite::reparent):
331         (WebCore::HTMLConstructionSite::insertAlreadyParsedChild):
332         (WebCore::HTMLConstructionSite::takeAllChildren):
333         (WebCore::HTMLConstructionSite::createElement):
334         (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
335         (WebCore::HTMLConstructionSite::createHTMLElement):
336         (WebCore::HTMLConstructionSite::createElementFromSavedToken):
337         (WebCore::HTMLConstructionSite::indexOfFirstUnopenFormattingElement):
338         (WebCore::HTMLConstructionSite::reconstructTheActiveFormattingElements):
339         (WebCore::HTMLConstructionSite::findFosterSite):
340         (WebCore::HTMLConstructionSite::shouldFosterParent):
341         (WebCore::HTMLConstructionSite::fosterParent):
342         (WebCore::HTMLConstructionSite::~HTMLConstructionSite): Deleted.
343         (WebCore::HTMLConstructionSite::setForm): Deleted.
344         (WebCore::HTMLConstructionSite::setCompatibilityModeFromDoctype): Deleted.
345         (WebCore::HTMLConstructionSite::ownerDocumentForCurrentNode): Deleted.
346         (WebCore::HTMLConstructionSite::generateImpliedEndTagsWithExclusion): Deleted.
347         * html/parser/HTMLConstructionSite.h:
348         (WebCore::HTMLConstructionSite::inQuirksMode):
349         (WebCore::HTMLConstructionSite::isTelephoneNumberParsingEnabled):
350         (WebCore::HTMLConstructionSite::RedirectToFosterParentGuard::RedirectToFosterParentGuard):
351         * html/parser/HTMLElementStack.cpp:
352         (WebCore::HTMLNames::isRootNode):
353         (WebCore::HTMLElementStack::ElementRecord::ElementRecord):
354         (WebCore::HTMLElementStack::ElementRecord::replaceElement):
355         (WebCore::HTMLElementStack::ElementRecord::isAbove):
356         (WebCore::HTMLElementStack::popAll):
357         (WebCore::HTMLElementStack::popUntil):
358         (WebCore::HTMLElementStack::popUntilPopped):
359         (WebCore::HTMLElementStack::pushRootNode):
360         (WebCore::HTMLElementStack::pushHTMLHtmlElement):
361         (WebCore::HTMLElementStack::pushRootNodeCommon):
362         (WebCore::HTMLElementStack::pushHTMLHeadElement):
363         (WebCore::HTMLElementStack::pushHTMLBodyElement):
364         (WebCore::HTMLElementStack::push):
365         (WebCore::HTMLElementStack::insertAbove):
366         (WebCore::HTMLElementStack::removeHTMLHeadElement):
367         (WebCore::HTMLElementStack::remove):
368         (WebCore::HTMLElementStack::contains):
369         (WebCore::inScopeCommon):
370         (WebCore::HTMLElementStack::hasNumberedHeaderElementInScope):
371         (WebCore::HTMLElementStack::inScope):
372         (WebCore::HTMLElementStack::pushCommon):
373         (WebCore::HTMLElementStack::popCommon):
374         (WebCore::HTMLElementStack::removeNonTopCommon):
375         (WebCore::HTMLElementStack::show):
376         (WebCore::HTMLElementStack::hasOnlyOneElement): Deleted.
377         (WebCore::HTMLElementStack::secondElementIsHTMLBodyElement): Deleted.
378         (WebCore::HTMLElementStack::pop): Deleted.
379         (WebCore::HTMLElementStack::popUntilTableScopeMarker): Deleted.
380         (WebCore::HTMLElementStack::oneBelowTop): Deleted.
381         * html/parser/HTMLElementStack.h:
382         (WebCore::HTMLElementStack::ElementRecord::stackItem):
383         (WebCore::HTMLElementStack::ElementRecord::setNext): Deleted.
384         (WebCore::HTMLElementStack::popUntilPopped): Deleted.
385         * html/parser/HTMLFormattingElementList.cpp:
386         (WebCore::HTMLFormattingElementList::contains):
387         (WebCore::HTMLFormattingElementList::swapTo):
388         (WebCore::HTMLFormattingElementList::append):
389         (WebCore::HTMLFormattingElementList::remove):
390         (WebCore::HTMLFormattingElementList::tryToEnsureNoahsArkConditionQuickly):
391         (WebCore::HTMLFormattingElementList::ensureNoahsArkCondition):
392         * html/parser/HTMLFormattingElementList.h:
393         (WebCore::HTMLFormattingElementList::Entry::Entry):
394         (WebCore::HTMLFormattingElementList::Entry::replaceElement):
395         (WebCore::HTMLFormattingElementList::Bookmark::Bookmark):
396         (WebCore::HTMLFormattingElementList::Bookmark::moveToAfter):
397         (WebCore::HTMLFormattingElementList::Bookmark::mark):
398         (WebCore::HTMLFormattingElementList::first):
399         (WebCore::HTMLFormattingElementList::Entry::isMarker): Deleted.
400         (WebCore::HTMLFormattingElementList::Entry::stackItem): Deleted.
401         (WebCore::HTMLFormattingElementList::Entry::operator!=): Deleted.
402         * html/parser/HTMLTreeBuilder.cpp:
403         (WebCore::HTMLTreeBuilder::processDoctypeToken):
404         (WebCore::HTMLTreeBuilder::processCloseWhenNestedTag):
405         (WebCore::HTMLTreeBuilder::processStartTagForInBody):
406         (WebCore::HTMLTreeBuilder::insertGenericHTMLElement):
407         (WebCore::HTMLTreeBuilder::processTemplateStartTag):
408         (WebCore::HTMLTreeBuilder::processStartTagForInTable):
409         (WebCore::HTMLTreeBuilder::processStartTag):
410         (WebCore::HTMLTreeBuilder::processHtmlStartTagForInBody):
411         (WebCore::HTMLTreeBuilder::processAnyOtherEndTagForInBody):
412         (WebCore::HTMLTreeBuilder::callTheAdoptionAgency):
413         (WebCore::HTMLTreeBuilder::processEndTagForInBody):
414         (WebCore::HTMLTreeBuilder::processComment):
415         (WebCore::HTMLTreeBuilder::defaultForBeforeHTML):
416         (WebCore::HTMLTreeBuilder::processStartTagForInHead):
417         (WebCore::HTMLTreeBuilder::processGenericRCDATAStartTag):
418         (WebCore::HTMLTreeBuilder::processGenericRawTextStartTag):
419         (WebCore::HTMLTreeBuilder::processScriptStartTag):
420         (WebCore::HTMLTreeBuilder::processTokenInForeignContent):
421
422 2016-05-02  Per Arne Vollan  <peavo@outlook.com>
423
424         Remove unneeded casts once we upgrade to a version of Visual Studio that is not broken
425         https://bugs.webkit.org/show_bug.cgi?id=121235
426
427         Reviewed by Darin Adler.
428
429         * css/MediaQueryEvaluator.cpp:
430         (WebCore::createFunctionMap):
431         * dom/make_names.pl:
432         (printWrapperFactoryCppFile):
433         * loader/archive/ArchiveFactory.cpp:
434         (WebCore::archiveMIMETypes):
435         * rendering/svg/SVGPathData.cpp:
436         (WebCore::updatePathFromGraphicsElement):
437
438 2016-05-02  Anders Carlsson  <andersca@apple.com>
439
440         Fix build.
441
442         * platform/mac/WebPlaybackControlsManager.h:
443
444 2016-05-02  Sam Weinig  <sam@webkit.org>
445
446         DataDetector underline color should be based on the text color
447         https://bugs.webkit.org/show_bug.cgi?id=157272
448
449         Fixes:
450             <rdar://problem/25663930> DataDetectors links should use the default text color for their parent nodes
451             <rdar://problem/25663983> DataDetectors links underline color update
452
453         Reviewed by Tim Horton.
454
455         * editing/cocoa/DataDetection.mm:
456         (WebCore::DataDetection::detectContentInRange):
457         When using light links, use the color of the parent element as the text color, and that same color with
458         20% alpha as the underline color.
459
460 2016-05-01  Ryosuke Niwa  <rniwa@webkit.org>
461
462         document.currentScript must be null when we're executing a script inside a shadow tree
463         https://bugs.webkit.org/show_bug.cgi?id=157245
464
465         Reviewed by Darin Adler.
466
467         Fix the bug by not setting currentScript as spec'ed in HTML5 specification:
468         https://html.spec.whatwg.org/multipage/dom.html#dom-document-currentscript
469         https://html.spec.whatwg.org/multipage/scripting.html#execute-the-script-block
470         as of 3dc763829ca1598427b588cf08830c1e2af5a05c
471
472         New behavior matches that of Google Chrome Canary.
473
474         Test: fast/shadow-dom/Document-prototype-currentScript.html
475
476         * dom/CurrentScriptIncrementer.h:
477         (WebCore::CurrentScriptIncrementer::CurrentScriptIncrementer):
478         (WebCore::CurrentScriptIncrementer::~CurrentScriptIncrementer):
479         * dom/ScriptElement.cpp:
480         (WebCore::ScriptElement::executeScript):
481
482 2016-04-29  Alex Christensen  <achristensen@webkit.org>
483
484         Do not reuse cache entries with conditional headers
485         https://bugs.webkit.org/show_bug.cgi?id=157205
486         rdar://problem/25856933
487
488         Reviewed by Chris Dumez.
489
490         Test: http/tests/xmlhttprequest/if-modified-since-0.html
491
492         * loader/cache/CachedRawResource.cpp:
493         (WebCore::CachedRawResource::canReuse):
494         CachedResourceLoader::determineRevalidationPolicy asserts that the request is not conditional,
495         which means that it does not have any headers like If-Modified-Since.  They are usually different,
496         because we put the timestamp in the If-Modified-Since header, so it fails the canReuse test because
497         time has passed since the last If-Modified-Since header was sent.  When a user sets the If-Modified-Since
498         manually to something that is constant, we reuse cache entries when we should not.
499         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
500         (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]):
501         Set the source so we can use it in Internals.
502
503 2016-05-02  Yoav Weiss  <yoav@yoav.ws>
504
505         Speculatively fix the cmake build
506         https://bugs.webkit.org/show_bug.cgi?id=157262
507
508         Reviewed by Darin Adler.
509
510         This patch adds WEB_TIMING build flag guards around calls to DOMWindow()->performance(),
511         in order to make sure builds that have WEB_TIMING disabled (e.g. cmake on Mac) continue
512         to build.
513
514         No new tests as there's no functional change.
515
516         * loader/cache/CachedResourceLoader.cpp:
517         (WebCore::CachedResourceLoader::loadDone):
518
519 2016-05-02  Daniel Bates  <dabates@apple.com>
520
521         CSP: Add workaround for XtraMath
522         https://bugs.webkit.org/show_bug.cgi?id=157252
523
524         Reviewed by Andy Estes.
525
526         * platform/RuntimeApplicationChecks.h:
527         * platform/RuntimeApplicationChecks.mm:
528         (WebCore::IOSApplication::isXtraMath): Added.
529
530 2016-05-02  Daniel Bates  <dabates@apple.com>
531
532         DatabaseTracker::closeAllDatabases calls Database::close from the wrong thread
533         https://bugs.webkit.org/show_bug.cgi?id=147672
534         <rdar://problem/22357464>
535
536         Reviewed by Brady Eidson.
537
538         Schedule a DatabaseCloseTask when Database::close() is called from a thread other than the
539         database thread as the database thread is responsible for interacting with the database.
540
541         Currently -[WebDatabaseManager startBackgroundTask] and WebProcess::processWillSuspendImminently()
542         call DatabaseTracker::closeAllDatabases() indirectly and directly, respectively, from a
543         thread other than the database thread. In a debug build, this causes an assertion failure
544         in Database::close(). In a release/production build, this starts a race between the calling
545         thread and the database thread that can lead to a crash. It is the responsibility of the
546         database thread to manage the database. We should ensure that calling Database::close()
547         delegates the responsibility of actually closing the database to the database thread to
548         avoid interfering with the database thread or the need to synchronize access to data
549         structures used by the database thread.
550
551         * Modules/webdatabase/Database.cpp:
552         (WebCore::Database::interrupt): Added. Turns around and calls SQLiteDatabase::interrupt().
553         (WebCore::Database::close): Added. Schedules a DatabaseCloseTask to close the database and
554         wait for it to complete if we have not already scheduled closing the database.
555         (WebCore::Database::performClose): Renamed; formerly named close.
556         (WebCore::Database::markAsDeletedAndClose): Extracted logic to schedule a DatabaseCloseTask
557         from here to Database::close() and modified this function to call Database::close().
558         * Modules/webdatabase/Database.h:
559         * Modules/webdatabase/DatabaseTask.cpp:
560         (WebCore::DatabaseCloseTask::doPerformTask): Call Database::performClose() instead of Database::close()
561         as the latter has been repurposed to schedule closing the database.
562         * Modules/webdatabase/DatabaseThread.cpp:
563         (WebCore::DatabaseThread::databaseThread): Ditto.
564         * Modules/webdatabase/DatabaseTracker.cpp:
565         (WebCore::DatabaseTracker::closeAllDatabases): Added argument currentQueryBehavior (defaults
566         to CurrentQueryBehavior::RunToCompletion - close every database after completion of the
567         current database query, if any).
568         * Modules/webdatabase/DatabaseTracker.h:
569         * platform/sql/SQLiteDatabase.cpp:
570         (WebCore::SQLiteDatabase::interrupt): Added. This is safe to call regardless of the state
571         of the database and thread safe by <https://www.sqlite.org/c3ref/interrupt.html>.
572         * platform/sql/SQLiteDatabase.h:
573
574 2016-05-02  Yoav Weiss  <yoav@yoav.ws>
575
576         Move ResourceTiming behind a runtime flag
577         https://bugs.webkit.org/show_bug.cgi?id=157133
578
579         Reviewed by Alex Christensen.
580
581         Move the ResourceTiming API from being behind a build time flag to be behind an
582         off-by-default runtime flag, that can be turned on using internals.
583
584         Tests: fast/dom/Window/window-properties-performance-resource-timing.html
585                http/tests/performance/performance-resource-timing-entries.html
586
587         * DerivedSources.make: Added idl files for PerformanceEntry, PerformanceEntryList and PerformanceResourceTiming.
588         * WebCore.xcodeproj/project.pbxproj: Added the various Performance* files to the project.
589         * bindings/generic/RuntimeEnabledFeatures.cpp: Added ResourceTiming as a runtime flag.
590         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
591         * bindings/generic/RuntimeEnabledFeatures.h: Added ResourceTiming as a runtime flag.
592         (WebCore::RuntimeEnabledFeatures::setResourceTimingEnabled):
593         (WebCore::RuntimeEnabledFeatures::resourceTimingEnabled):
594         * bindings/js/JSPerformanceEntryCustom.cpp: Removed #if for ResourceTiming, and replaced PERFORMANCE_TIMELINE for WEB_TIMING.
595         Added build flag around UserTiming related h files.
596         (WebCore::toJS): Deleted.
597         * dom/EventNames.h: Renamed webkitresourcetimingbufferfull to resourcetimingbufferfull.
598         * loader/DocumentThreadableLoader.cpp: Replace #if for ResourceTiming with runtime flag.
599         (WebCore::DocumentThreadableLoader::loadRequest):
600         * loader/ResourceLoadNotifier.cpp: Replace #if for ResourceTiming with runtime flag.
601         (WebCore::ResourceLoadNotifier::dispatchWillSendRequest):
602         * loader/cache/CachedResourceLoader.cpp: Replace #if for ResourceTiming with runtime flag.
603         (WebCore::CachedResourceLoader::revalidateResource):
604         (WebCore::CachedResourceLoader::loadResource):
605         (WebCore::CachedResourceLoader::storeResourceTimingInitiatorInformation):
606         (WebCore::CachedResourceLoader::loadDone):
607         * loader/cache/CachedResourceLoader.h: Remove #if for ResourceTiming.
608         * page/Performance.cpp: Remove #if for ResourceTiming.
609         (WebCore::Performance::Performance): Removed #if for ResourceTiming related initialization.
610         (WebCore::Performance::webkitGetEntries): Renamed to getEntries.
611         (WebCore::Performance::webkitGetEntriesByType): Renamed to getEntriesByType.
612         (WebCore::Performance::webkitGetEntriesByName): Renamed to getEntriesByName.
613         * page/Performance.h: Remove #if for ResourceTiming.
614         * page/Performance.idl: Replace #if for ResourceTiming with runtime flag.
615         * page/PerformanceEntry.cpp: Remove the PERFORMANCE_TIMELINE build flag.
616         * page/PerformanceEntry.h: Remove the PERFORMANCE_TIMELINE build flag.
617         * page/PerformanceEntry.idl: Replace the PERFORMANCE_TIMELINE build flag with runtime flag.
618         * page/PerformanceEntryList.cpp: Remove the PERFORMANCE_TIMELINE build flag.
619         * page/PerformanceEntryList.h: Remove the PERFORMANCE_TIMELINE build flag.
620         * page/PerformanceEntryList.idl: Replace the PERFORMANCE_TIMELINE build flag with runtime flag.
621         * page/PerformanceResourceTiming.cpp: Remove the RESOURCE_TIMING build flag.
622         * page/PerformanceResourceTiming.h: Remove the RESOURCE_TIMING build flag.
623         * page/PerformanceResourceTiming.idl: Replace the RESOURCE_TIMING build flag with runtime flag.
624         * testing/Internals.cpp: Add a method that enables ResourceTiming.
625         (WebCore::Internals::setResourceTimingSupport):
626         * testing/Internals.h: Add a method that enables ResourceTiming.
627         * testing/Internals.idl: Add a method that enables ResourceTiming.
628
629 2016-05-01  Nan Wang  <n_wang@apple.com>
630
631         AX: Crash at  WebCore::AccessibilityObject::getAttribute const + 9
632         https://bugs.webkit.org/show_bug.cgi?id=157256
633
634         Reviewed by Chris Fleizach.
635
636         When the <label> for the input element has no renderer, it will cause
637         crash when we ask for the title element text. Fixed it by getting the 
638         aria-label attribute directly from the <label> element instead of its 
639         accessibility object. 
640
641         Test case covered in accessibility/mac/aria-label-on-label-element.html.
642
643         * accessibility/AccessibilityNodeObject.cpp:
644         (WebCore::AccessibilityNodeObject::titleElementText):
645
646 2016-05-01  Darin Adler  <darin@apple.com>
647
648         Stop using string-based enumerations in TextTrack, and eliminate support for string-based enumerations
649         https://bugs.webkit.org/show_bug.cgi?id=157253
650
651         Reviewed by Chris Dumez.
652
653         This was the most difficult case to convert from the old style of enumeration to enum class.
654         Afterward there is a bit of messy duplication, but it still seems like an improvement overall.
655
656         After this patch, I plan to change the rule for the name of the enumeration; instead of
657         living at the top level of the WebCore namespace, we will look for them inside the class for the
658         first interface defined in the same file along with the enumeration, and remove the name prefix,
659         if the interfaces's name is a prefix of the enumerations's name.
660
661         Once that's done, next step is to do something in the bindings for dictionaries. And adopt both the
662         enumeration and dictionary mechanisms more widely, and remove the old use of "dictionary" as a type name.
663
664         * Modules/mediasource/MediaSource.cpp:
665         (WebCore::MediaSource::removeSourceBuffer): Use enum values instead of keywords.
666         * Modules/mediasource/SourceBuffer.cpp:
667         (WebCore::SourceBuffer::textTrackModeChanged): Ditto.
668
669         * bindings/js/JSTextTrackCustom.cpp:
670         (WebCore::JSTextTrack::setKind): Deleted.
671
672         * bindings/scripts/CodeGenerator.pm:
673         (IsStringBasedEnumType): Deleted.
674
675         * bindings/scripts/CodeGeneratorJS.pm:
676         (GetEnumerationImplementationContent): Removed IsStringBasedEnumType check.
677         (GenerateParametersCheck): Ditto.
678         (GenerateImplementation): Ditto.
679         (GetNativeType): Ditto.
680         (JSValueToNative): Ditto.
681
682         * html/HTMLMediaElement.cpp:
683         (WebCore::HTMLMediaElement::loadInternal): Use enum values instead of keywords.
684         (WebCore::HTMLMediaElement::textTrackModeChanged): Ditto.
685         (WebCore::HTMLMediaElement::textTrackKindChanged): Ditto.
686         (WebCore::HTMLMediaElement::textTrackAddCues): Ditto.
687         (WebCore::HTMLMediaElement::textTrackAddCue): Ditto.
688         (WebCore::HTMLMediaElement::addTextTrack): Ditto.
689         (WebCore::HTMLMediaElement::configureTextTrackGroup): Ditto.
690         (WebCore::HTMLMediaElement::setSelectedTextTrack): Ditto.
691         (WebCore::HTMLMediaElement::configureTextTracks): Ditto.
692         (WebCore::HTMLMediaElement::hasClosedCaptions): Ditto.
693         (WebCore::HTMLMediaElement::configureTextTrackDisplay): Ditto.
694         (WebCore::HTMLMediaElement::markCaptionAndSubtitleTracksAsUnconfigured): Ditto.
695         (WebCore::toPlatform): Added helpers for the outOfBandTrackSources function.
696         (WebCore::HTMLMediaElement::outOfBandTrackSources): Removed unneeded fastHasAttribute
697         check since getNonEmptyURLAttribute already returns an empty URL when the attribute is
698         not present. Changed to use enum values instead of keywords.
699
700         * html/HTMLTrackElement.cpp:
701         (WebCore::HTMLTrackElement::parseAttribute): Use new setKindKeywordIgnoringASCIICase
702         function rather than calling setKind and convertToASCIILowercase. Also use ensureTrack
703         instead of track since the latter is a cover that calls it and dumbs down the return type.
704         (WebCore::HTMLTrackElement::kind): Changed return type to const AtomicString& since
705         that's what we will have for kind keywords and because it matches what we normally have
706         for attribute getting fuctions. Also use ensureTrack.
707         (WebCore::HTMLTrackElement::setKind): Changed argument to AtomicString so we don't waste
708         time making a string and then destroying it before turning it into an AtomicString so it
709         can be an attribute value.
710         (WebCore::HTMLTrackElement::srclang): Changed return type to const AtomicString& as is
711         customary and efficient for attribute value convenience functions. Also use fastGetAttribute.
712         (WebCore::HTMLTrackElement::setSrclang): Deleted.
713         (WebCore::HTMLTrackElement::label): Ditto.
714         (WebCore::HTMLTrackElement::setLabel): Deleted.
715         (WebCore::HTMLTrackElement::setIsDefault): Deleted.
716         (WebCore::HTMLTrackElement::scheduleLoad): Use enum values instead of keywords.
717
718         * html/HTMLTrackElement.h: Use pragma once. Update for changes mentioned above.
719         Also mark things final instead of override as per our recent style discussion.
720
721         * html/HTMLTrackElement.idl: Use [Reflect] for srclang and label.
722
723         * html/shadow/MediaControlElements.cpp:
724         (WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay): Use enum value
725         instead of keyword.
726         (WebCore::MediaControlTextTrackContainerElement::updateDisplay): Ditto.
727
728         * html/track/AudioTrack.cpp:
729         (WebCore::AudioTrack::AudioTrack): Use new base class MediaTrackBase.
730
731         * html/track/AudioTrack.h: Use pragma once. Make base class be MediaTrackBase instead
732         of TrackBase.
733
734         * html/track/InbandTextTrack.cpp:
735         (WebCore::InbandTextTrack::setMode): Change argument type to enum instead of string.
736         (WebCore::toPrivate): Added. Helper for setModeInternal.
737         (WebCore::InbandTextTrack::setModeInternal): Change argument type to enum instead of string.
738         (WebCore::InbandTextTrack::updateKindFromPrivate): Use enum instead of string to call setKind.
739
740         * html/track/InbandTextTrack.h: Use pragma once. Use TextTrackMode for argument types.
741
742         * html/track/TextTrack.cpp:
743         (WebCore::captionsKeyword): Converted this to a non-member function since it is now
744         private to this file.
745         (WebCore::descriptionsKeyword): Ditto.
746         (WebCore::chaptersKeyword): Ditto.
747         (WebCore::metadataKeyword): Ditto.
748         (WebCore::forcedKeyword): Ditto.
749         (WebCore::TextTrack::disabledKeyword): Deleted.
750         (WebCore::TextTrack::hiddenKeyword): Deleted.
751         (WebCore::TextTrack::showingKeyword): Deleted.
752         (WebCore::TextTrack::TextTrack): Moved some initialization to be done in the header where
753         the data members are defined. Put the code that is the equivalent to setKindInternal here,
754         because it turns out it's not needed anywhere else. Over time we might change the types
755         involved and there's no need to have that be across multiple functions.
756         (WebCore::TextTrack::~TextTrack): Removed unneeded call to clearClient, right when the
757         object is about to be destroyed. Perhaps there was an illusion that the old call might
758         be a virtual function call that invokes the clearClient from a derived class, but that
759         doesn't work in a destructor, so this code was only clearing out the data member and
760         that does not need to be done.
761         (WebCore::TextTrack::isValidKind): Deleted.
762         (WebCore::TextTrack::enabled): Use enum value instead of keyword.
763         (WebCore::TextTrack::kindKeyword): Added. Function for callers who need a string, not the
764         enum value.
765         (WebCore::TextTrack::setKind): Take enum value instead of keyword. Also changed since
766         we store the kind in a data member in this class, not inherited.
767         (WebCore::TextTrack::setKindKeywordIgnoringASCIICase): Added. For HTMLTrackElement to use
768         when setting the kind attribute.
769         (WebCore::TextTrack::setMode): Take enum value instread of keyword. Also removed assertion
770         since the enum already makes it intrinsically clear what values are valid, unlike a string.
771         (WebCore::TextTrack::cues): Use enum value instead of keyword.
772         (WebCore::TextTrack::activeCues): Ditto.
773         (WebCore::TextTrack::addCue): Ditto.
774         (WebCore::TextTrack::ensureVTTRegionList): Changed return type to reference.
775         (WebCore::TextTrack::regions): Use enum value instead of keyword.
776         (WebCore::TextTrack::addRegion): Use reference.
777         (WebCore::TextTrack::cueDidChange): Ditto.
778         (WebCore::TextTrack::isRendered): Use enum values instead of keywords. Also write to be
779         a boolean expression instead of a couple different if statements.
780         (WebCore::TextTrack::ensureTextTrackCueList): Changed return type to reference.
781         (WebCore::TextTrack::isMainProgramContent): Use enum value instead of keyword.
782         (WebCore::TextTrack::containsOnlyForcedSubtitles): Ditto.
783
784         * html/track/TextTrack.h: Use pragma once. Removed unneeded include. Added enums for
785         TextTrackKind and TextTrackMode. Updated for changes to functions listed above.
786         Added m_mode and m_kind and initialized those data members and some others.
787
788         * html/track/TextTrack.idl: Tweaked formatting. Used ImplementedAs for the kind
789         attribute rather than using a CustomSetter. This preserves the strange behavior
790         where setting kind does nothing when !ENABLE(MEDIA_SOURCE). If we discover we don't
791         need that, then we won't need ImplementedAs any more either.
792
793         * html/track/TextTrackCue.cpp:
794         (WebCore::TextTrackCue::dispatchEvent): Use enum instad of keyword.
795         (WebCore::TextTrackCue::isActive): Ditto.
796
797         * html/track/TrackBase.cpp:
798         (WebCore::TrackBase::TrackBase): Removed unneeded initialization that is handled in
799         the data member definition in the header now.
800         (WebCore::MediaTrackBase::MediaTrackBase): Added. Calls through to TrackBase.
801         (WebCore::MediaTrackBase::setKind): Moved to MediaTrackBase from TrackBase, because
802         this isn't needed for text tracks.
803         (WebCore::MediaTrackBase::setKindInternal): Ditto.
804
805         * html/track/TrackBase.h: Use pragma once. Move kind, setKind, isValidKind, defaultKindKeyword,
806         setKindInternal, and m_kind all to a derived class, MediaTrackBase, since TextTrack doesn't need
807         any of those any more. Later we might adopt enumerations more and it's possible the need for
808         MediaTrackBase will go away.
809
810         * html/track/VideoTrack.cpp:
811         (WebCore::VideoTrack::VideoTrack): Updated to use MediaTrackBase.
812         (WebCore::VideoTrack::setLanguage): Ditto.
813
814         * html/track/VideoTrack.h: Use pragma once. Removed unneeded header include.
815         Derive from MediaTrackBase instead of TrackBase.
816
817         * page/CaptionUserPreferences.cpp:
818         (WebCore::CaptionUserPreferences::sortedTrackListForMenu): Use enum values instead
819         of keywords.
820         (WebCore::CaptionUserPreferences::textTrackSelectionScore): Ditto.
821         * page/CaptionUserPreferencesMediaAF.cpp:
822         (WebCore::CaptionUserPreferencesMediaAF::textTrackSelectionScore): Ditto.
823         (WebCore::CaptionUserPreferencesMediaAF::sortedTrackListForMenu): Ditto. Also used
824         kindKeyword since we want a string for logging.
825         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
826         (WebPlaybackSessionModelMediaElement::updateLegibleOptions): Ditto.
827
828 2016-05-01  Chris Dumez  <cdumez@apple.com>
829
830         Pass reference instead of pointer to IDL attribute setters if not nullable
831         https://bugs.webkit.org/show_bug.cgi?id=157250
832
833         Reviewed by Darin Adler.
834
835         Update the bindings generator so that we pass wrapper types by reference
836         to attribute setters instead of by raw pointer when the attribute is not
837         marked as nullable in the IDL.
838
839         There is no intended Web-exposed behavior change.
840
841         * Modules/speech/SpeechSynthesisUtterance.idl:
842         * Modules/webaudio/ConvolverNode.idl:
843         * bindings/js/JSDataCueCustom.cpp:
844         (WebCore::constructJSDataCue):
845         * bindings/scripts/CodeGeneratorJS.pm:
846         (GenerateImplementation):
847         * bindings/scripts/CodeGeneratorObjC.pm:
848         (GenerateImplementation):
849
850         * bindings/scripts/test/JS/JSTestInterface.cpp:
851         * bindings/scripts/test/JS/JSTestObj.cpp:
852         * bindings/scripts/test/ObjC/DOMTestInterface.mm:
853         * bindings/scripts/test/ObjC/DOMTestObj.mm:
854         Rebaseline bindings tests.
855
856         * dom/Document.cpp:
857         (WebCore::Document::moveNodeIteratorsToNewDocument):
858         * dom/NodeIterator.cpp:
859         (WebCore::NodeIterator::NodePointer::NodePointer):
860         (WebCore::NodeIterator::NodePointer::moveToNext):
861         (WebCore::NodeIterator::NodePointer::moveToPrevious):
862         (WebCore::NodeIterator::NodeIterator):
863         (WebCore::NodeIterator::~NodeIterator):
864         (WebCore::NodeIterator::updateForNodeRemoval):
865         (WebCore::NodeIterator::NodePointer::clear): Deleted.
866         (WebCore::NodeIterator::nextNode): Deleted.
867         * dom/NodeIterator.h:
868         * dom/Traversal.cpp:
869         (WebCore::NodeIteratorBase::NodeIteratorBase):
870         * dom/Traversal.h:
871         (WebCore::NodeIteratorBase::root):
872         * dom/TreeWalker.cpp:
873         (WebCore::TreeWalker::setCurrentNode):
874         (WebCore::TreeWalker::setCurrent):
875         (WebCore::TreeWalker::parentNode):
876         (WebCore::TreeWalker::firstChild):
877         (WebCore::TreeWalker::lastChild):
878         (WebCore::TreeWalker::traverseSiblings):
879         (WebCore::TreeWalker::previousNode):
880         (WebCore::TreeWalker::nextNode):
881         * dom/TreeWalker.h:
882         (WebCore::TreeWalker::currentNode):
883         * dom/TreeWalker.idl:
884         * html/HTMLAttachmentElement.idl:
885         * html/HTMLInputElement.idl:
886         * html/HTMLTableElement.idl:
887         * html/track/DataCue.cpp:
888         (WebCore::DataCue::DataCue):
889         (WebCore::DataCue::setData):
890         (WebCore::toDataCue): Deleted.
891         * html/track/DataCue.h:
892         * html/track/DataCue.idl:
893
894 2016-05-01  Commit Queue  <commit-queue@webkit.org>
895
896         Unreviewed, rolling out r200264 and r200266.
897         https://bugs.webkit.org/show_bug.cgi?id=157251
898
899         This change caused existing LayoutTest media/media-source
900         /media-source-stalled-holds-sleep-assertion.html to time out
901         on Mac on every run. (Requested by ryanhaddad on #webkit).
902
903         Reverted changesets:
904
905         "[Mac] AirPlay fails if target is set before AVPlayer has been
906         created"
907         https://bugs.webkit.org/show_bug.cgi?id=157147
908         http://trac.webkit.org/changeset/200264
909
910         "[Mac] AirPlay fails if target is set before AVPlayer has been
911         created"
912         https://bugs.webkit.org/show_bug.cgi?id=157147
913         http://trac.webkit.org/changeset/200266
914
915 2016-05-01  Chris Dumez  <cdumez@apple.com>
916
917         Drop CanUseWTFOptionalForParameter() from bindings generator
918         https://bugs.webkit.org/show_bug.cgi?id=157247
919
920         Reviewed by Darin Adler.
921
922         * bindings/scripts/CodeGeneratorJS.pm:
923         (GenerateParametersCheck):
924         (CanUseWTFOptionalForParameter): Deleted.
925
926 2016-05-01  Darin Adler  <darin@apple.com>
927
928         Update Fetch to use enum class instead of string for enumerations
929         https://bugs.webkit.org/show_bug.cgi?id=157241
930
931         Reviewed by Chris Dumez.
932
933         * Modules/fetch/FetchOptions.h: Changed this class into a struct,
934         getting rid of all the getter and setter functions. Moved all the
935         enumeration types out of this class to the WebCore namespace level
936         and gave them all the names and values that match the ones from the
937         IDL file.
938
939         * Modules/fetch/FetchRequest.cpp:
940         (WebCore::setReferrerPolicy): Updated for the changes to FetchOptions.
941         The string matching here will likely go away when we change dictionary
942         so it sets up a structure, which will parse the enumeration values, but
943         that won't be for a while, so this stays for now.
944         (WebCore::setMode): Ditto.
945         (WebCore::setCredentials): Ditto.
946         (WebCore::setCache): Ditto.
947         (WebCore::setRedirect): Ditto.
948         (WebCore::buildOptions): Updated for changes to FetchOptions.
949         (WebCore::buildHeaders): Ditto.
950         (WebCore::FetchRequest::create): Ditto.
951         (WebCore::FetchRequest::type): Moved this to the header and changed its
952         return type to the enum; it's not just a single return statement.
953         (WebCore::FetchRequest::destination): Ditto.
954         (WebCore::FetchRequest::referrerPolicy): Ditto.
955         (WebCore::FetchRequest::mode): Ditto.
956         (WebCore::FetchRequest::credentials): Ditto.
957         (WebCore::FetchRequest::cache): Ditto.
958         (WebCore::FetchRequest::redirect): Ditto.
959
960         * Modules/fetch/FetchRequest.h: Changed all the getters that return
961         enumerations to return the enum class values instead of strings.
962         Put all the inline versions here in the header.
963
964         * bindings/scripts/CodeGenerator.pm: Removed the seven enum types that
965         are in FetchRequest.idl from the list of "string-based" enums.
966
967         * dom/Document.cpp:
968         (WebCore::Document::Document): Updated for the change where I
969         renamed ReferrerPolicy to ReferrerHeaderPolicy, at least for now.
970         (WebCore::Document::processReferrerPolicy): Ditto.
971         (WebCore::Document::applyContentDispositionAttachmentSandbox): Ditto.
972         * dom/Document.h: Ditto.
973         * loader/FrameNetworkingContext.h: Ditto.
974         * page/SecurityPolicy.cpp:
975         (WebCore::SecurityPolicy::generateReferrerHeader): Ditto.
976         * page/SecurityPolicy.h: Ditto.
977
978         * platform/ReferrerPolicy.h: Renamed this enum from ReferrerPolicy to
979         ReferrerHeaderPolicy, since the one specified in the Fetch API has the
980         name ReferrerPolicy. I think the best way to resolve this longer term is
981         to merge them since they really do represent the same concept, although
982         the one from the Fetch API has a few more features.
983
984 2016-05-01  Chris Dumez  <cdumez@apple.com>
985
986         Unreviewed attempt to fix Windows build after r200288.
987
988         * bindings/scripts/CodeGeneratorJS.pm:
989         (GenerateParametersCheck):
990
991 2016-05-01  Chris Dumez  <cdumez@apple.com>
992
993         Unreviewed attempt to fix Windows build after r200288.
994
995         * bindings/scripts/CodeGeneratorJS.pm:
996         (GetEnumerationImplementationContent):
997
998 2016-05-01  Chris Dumez  <cdumez@apple.com>
999
1000         Unreviewed, rebaseline bindings tests after r200300.
1001
1002         * bindings/scripts/test/JS/JSTestObj.cpp:
1003         (WebCore::jsStringWithCache):
1004
1005 2016-05-01  Darin Adler  <darin@apple.com>
1006
1007         Use enum class instead of string-based enums in RTC code
1008         https://bugs.webkit.org/show_bug.cgi?id=157242
1009
1010         Reviewed by Alex Christensen.
1011
1012         * Modules/mediastream/RTCConfiguration.cpp:
1013         (WebCore::RTCConfiguration::RTCConfiguration): Don't initialize members here,
1014         do it in the header instead.
1015         (WebCore::RTCConfiguration::initialize): Initialize data members to enum values,
1016         not strings.
1017
1018         * Modules/mediastream/RTCConfiguration.h: Tried to keep this class compiling.
1019         Added the new enum class, and changed to use that instead of strings. But note,
1020         this should not even be a class. Needs to become a dictionary.
1021
1022         * Modules/mediastream/RTCConfiguration.idl: Updated the names and values of the
1023         enums to match the current RTC specification. Again, as I said, this should be
1024         a dictionary, not an interface.
1025
1026         * bindings/scripts/CodeGenerator.pm: Removed the RTC enumerations from the list
1027         of string-based enums.
1028
1029 2016-04-30  Antti Koivisto  <antti@apple.com>
1030
1031         REGRESSION (r199640): position:absolute generated content inherits text-decoration from its element
1032         https://bugs.webkit.org/show_bug.cgi?id=157199
1033         <rdar://problem/26013111>
1034
1035         Reviewed by Zalan Bujtas.
1036
1037         Test: fast/css/text-decoration-inheritance-pseudo.html
1038
1039         * css/StyleResolver.cpp:
1040         (WebCore::doesNotInheritTextDecoration):
1041         (WebCore::StyleResolver::adjustRenderStyle):
1042
1043             There was an accidental logic change here. Even if element is null other conditions may make this test true.
1044
1045 2016-04-30  Zalan Bujtas  <zalan@apple.com>
1046
1047         Some content causes deep recursion.
1048         https://bugs.webkit.org/show_bug.cgi?id=157230
1049         <rdar://problem/7694756>
1050
1051         Reviewed by Antti Koivisto.
1052
1053         This patch sets a limit(512) on content nesting for the render tree. Elements injected over the limit
1054         are still accessible through DOM APIs but
1055         1. we stop generating renderers for them -they behave like display: none. 
1056         2. their layout related computed style values are set to default (e.g. window.computedStyle(document.elementById("over512").width -> auto) 
1057
1058         Test: fast/block/nested-renderers.html
1059
1060         * page/Settings.h:
1061         * style/StyleTreeResolver.cpp: Skip renderer constructing and continue with the sibling node. 
1062         (WebCore::Style::TreeResolver::resolveComposedTree):
1063
1064 2016-04-30  Darin Adler  <darin@apple.com>
1065
1066         Update XMLHttpRequest to use enum class instead of string for enumeration
1067         https://bugs.webkit.org/show_bug.cgi?id=157238
1068
1069         Reviewed by Chris Dumez.
1070
1071         * bindings/js/JSXMLHttpRequestCustom.cpp:
1072         (WebCore::JSXMLHttpRequest::response): Rewrite to use responseType function
1073         instead of responseTypeCode function.
1074
1075         * bindings/scripts/CodeGenerator.pm: Removed XMLHttpRequestResponseType
1076         from the list of enumerations that use a string-based implementation.
1077
1078         * bindings/scripts/CodeGeneratorJS.pm:
1079         (GetEnumerationImplementationContent): Use emptyString instead of ASCIILiteral
1080         when the string constant is empty, to avoid the assertion.
1081
1082         * xml/XMLHttpRequest.cpp:
1083         (WebCore::XMLHttpRequest::XMLHttpRequest): Move simple scalar data member
1084         initialization to where the data members are defined in the header.
1085         (WebCore::XMLHttpRequest::responseText): Use m_responseType instead of
1086         m_responseTypeCode.
1087         (WebCore::XMLHttpRequest::didCacheResponseJSON): Ditto.
1088         (WebCore::XMLHttpRequest::responseXML): Ditto.
1089         (WebCore::XMLHttpRequest::responseBlob): Ditto.
1090         (WebCore::XMLHttpRequest::responseArrayBuffer): Ditto.
1091         (WebCore::XMLHttpRequest::setResponseType): Ditto.
1092         (WebCore::XMLHttpRequest::responseType): Moved to header now that it's a
1093         trivial function that should be inlined.
1094         (WebCore::XMLHttpRequest::open): Use m_responseType instead of
1095         m_responseTypeCode.
1096         (WebCore::XMLHttpRequest::responseMIMEType): Removed one redundant check.
1097         (WebCore::XMLHttpRequest::status): Ditto.
1098         (WebCore::XMLHttpRequest::statusText): Ditto.
1099         (WebCore::shouldDecodeResponse): Moved here from the header. This is now
1100         a non-member function that gets passed a response type. It uses a switch
1101         now instead of ordering the types so that the binary ones are all at the
1102         end of the list.
1103         (WebCore::XMLHttpRequest::didReceiveData): Use the new shouldDecodeResponse.
1104         Also removed an unnecessary check that non-decoded responses are of type
1105         "arraybuffer" or "blob"; that's the same check that shouldDecodeResponse does.
1106
1107         * xml/XMLHttpRequest.h: Removed some unneeded includes and forward declarations.
1108         Removed a comment about the State values needing to be stable numbers; for one
1109         thing the bindings already check that these values have no changed. It's not a
1110         valuable comment. Removed ResponseTypeCode, responseTypeCode, and
1111         m_responseTypeCode. Changed the type of the result of responseType and the
1112         argument to setResponseType from a string to XMLHttpRequestResponseType.
1113         Removed shouldDecodeResponse. Added the initial values for lots of data members
1114         that are simple scalars, matching what was set in the constructor before.
1115
1116 2016-04-30  Darin Adler  <darin@apple.com>
1117
1118         Streamline and remove unused bindings generation code
1119         https://bugs.webkit.org/show_bug.cgi?id=157237
1120
1121         Reviewed by Chris Dumez.
1122
1123         * Modules/notifications/NotificationCenter.idl: Replace non-standard "int"
1124         with standard "long", which means the same thing.
1125
1126         * bindings/scripts/CodeGenerator.pm:
1127         (UpdateFile): Use a better perl idiom for open.
1128         (IsTypedArrayType): Use a hash instead of a list of checks in the code.
1129         (IsRefPtrType): Use GetArrayOrSequenceType. Add handling for "any", which
1130         is not a "RefPtr" type.
1131         (IsWrapperType): Build on top of IsRefPtr type so we don't have to repeat
1132         the list.
1133         (getInterfaceExtendedAttributesFromName): Added a FIXME about why this is no good.
1134         (ComputeIsCallbackInterface): Renamed.
1135         (IsCallbackInterface): Added a cache so we don't keep reading the same file
1136         over and over again. Added a FIXME about why this is no good.
1137         (ComputeIsFunctionOnlyCallbackInterface): Ditto.
1138         (IsFunctionOnlyCallbackInterface): Ditto.
1139
1140         * bindings/scripts/CodeGeneratorJS.pm:
1141         (AddIncludesForType): Use GetArrayOrSequenceType.
1142         (IsScriptProfileType): Deleted.
1143         (AddTypedefForScriptProfileType): Deleted.
1144         (AddClassForwardIfNeeded): Streamlined the code and made the ScriptProfileNode
1145         special case easier to read.
1146         (GenerateParametersCheckExpression): Use GetArrayOrSequenceType.
1147         (GetFunctionLength): Tweaked formatting and argument names.
1148         (GenerateImplementation): Merged a couple checks into a single if statement.
1149         (WillConvertUndefinedToDefaultParameterValue): Streamlined the function by
1150         using a hash instead of a sequence of if statements for most cases.
1151         (GetNativeType): Use GetArrayOrSequenceType.
1152         (JSValueToNative): Do the integer conversion based on a hash rather than
1153         with lots of separate lines of code. Moved more of the simple names down to
1154         the bottom of the function and streamlined the logic. Removed unnecessary
1155         includes of the DOM headers directly, since our header file includes those.
1156         (NativeToJSValue): Factored out the global object handling so it works across
1157         more cases. Simplified the logic for dates. Use IsNumericType instead of
1158         IsPrimitiveType to guard code that is right only for the numeric types.
1159         Removed code to handle "Symbol" since we don't ever use that.
1160
1161         * bindings/scripts/test/JS/JSTestCallback.cpp:
1162         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
1163         * bindings/scripts/test/JS/JSTestInterface.cpp:
1164         * bindings/scripts/test/JS/JSTestObj.cpp:
1165         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1166         Regenerated.
1167
1168         * bindings/scripts/test/TestObj.idl: Removed test coverage for Symbol, which
1169         we never use anywhere.
1170
1171         * html/canvas/EXTBlendMinMax.idl: Replace non-standard "int" with standard
1172         "long", which means the same thing.
1173         * html/canvas/EXTTextureFilterAnisotropic.idl: Ditto.
1174         * html/canvas/EXTsRGB.idl: Ditto.
1175         * html/canvas/OESStandardDerivatives.idl: Ditto.
1176         * html/canvas/OESVertexArrayObject.idl: Ditto.
1177         * html/canvas/WebGLCompressedTextureATC.idl: Ditto.
1178         * html/canvas/WebGLCompressedTexturePVRTC.idl: Ditto.
1179         * html/canvas/WebGLCompressedTextureS3TC.idl: Ditto.
1180         * html/canvas/WebGLDebugRendererInfo.idl: Ditto.
1181         * html/canvas/WebGLDepthTexture.idl: Ditto.
1182
1183 2016-04-30  Chris Dumez  <cdumez@apple.com>
1184
1185         [Web IDL] Pass even more types by reference
1186         https://bugs.webkit.org/show_bug.cgi?id=157231
1187
1188         Reviewed by Darin Adler.
1189
1190         Pass even more types by reference when the parameters are not marked as
1191         nullable in the IDL.
1192
1193         * Modules/encryptedmedia/MediaKeySession.cpp:
1194         (WebCore::MediaKeySession::generateKeyRequest):
1195         (WebCore::MediaKeySession::keyRequestTimerFired):
1196         (WebCore::MediaKeySession::update):
1197         (WebCore::MediaKeySession::addKeyTimerFired):
1198         * Modules/encryptedmedia/MediaKeySession.h:
1199         * Modules/encryptedmedia/MediaKeys.cpp:
1200         (WebCore::MediaKeys::createSession):
1201         * Modules/encryptedmedia/MediaKeys.h:
1202         * Modules/encryptedmedia/MediaKeys.idl:
1203         * Modules/mediasource/SourceBuffer.cpp:
1204         (WebCore::SourceBuffer::appendBuffer):
1205         (WebCore::SourceBuffer::resetParserState): Deleted.
1206         * Modules/mediasource/SourceBuffer.h:
1207         * Modules/mediastream/RTCDataChannel.cpp:
1208         (WebCore::RTCDataChannel::send):
1209         * Modules/mediastream/RTCDataChannel.h:
1210         * Modules/webaudio/AnalyserNode.h:
1211         (WebCore::AnalyserNode::getFloatFrequencyData):
1212         (WebCore::AnalyserNode::getByteFrequencyData):
1213         (WebCore::AnalyserNode::getByteTimeDomainData):
1214         * Modules/webaudio/AnalyserNode.idl:
1215         * Modules/webaudio/AudioContext.cpp:
1216         (WebCore::AudioContext::createPeriodicWave):
1217         * Modules/webaudio/AudioContext.h:
1218         * Modules/webaudio/AudioParam.h:
1219         (WebCore::AudioParam::setValueCurveAtTime):
1220         * Modules/webaudio/AudioParam.idl:
1221         * Modules/webaudio/BiquadFilterNode.cpp:
1222         (WebCore::BiquadFilterNode::getFrequencyResponse):
1223         * Modules/webaudio/BiquadFilterNode.h:
1224         * Modules/webaudio/BiquadFilterNode.idl:
1225         * Modules/webaudio/PeriodicWave.cpp:
1226         (WebCore::PeriodicWave::create):
1227         (WebCore::PeriodicWave::createSine): Deleted.
1228         * Modules/webaudio/PeriodicWave.h:
1229         * Modules/websockets/WebSocket.cpp:
1230         (WebCore::WebSocket::send):
1231         * Modules/websockets/WebSocket.h:
1232         * bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
1233         (WebCore::dataFunctionf):
1234         (WebCore::dataFunctioni):
1235         (WebCore::dataFunctionMatrix):
1236         * bindings/scripts/CodeGeneratorJS.pm:
1237         (GenerateParametersCheck):
1238         (ShouldPassWrapperByReference):
1239         * bindings/scripts/test/JS/JSTestObj.cpp:
1240         (WebCore::jsTestObjPrototypeFunctionDomStringListFunction):
1241         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1242         (WebCore::constructJSTestOverloadedConstructors2):
1243         * html/HTMLMediaElement.cpp:
1244         (WebCore::HTMLMediaElement::webkitAddKey):
1245         (WebCore::HTMLMediaElement::webkitCancelKeyRequest): Deleted.
1246         * html/HTMLMediaElement.h:
1247         * html/HTMLMediaElement.idl:
1248         * html/ImageData.cpp:
1249         (WebCore::ImageData::create):
1250         (WebCore::ImageData::ImageData):
1251         * html/ImageData.h:
1252         * html/canvas/CanvasRenderingContext2D.cpp:
1253         (WebCore::CanvasRenderingContext2D::getImageData):
1254         * html/canvas/WebGL2RenderingContext.cpp:
1255         (WebCore::WebGL2RenderingContext::texImage3D):
1256         (WebCore::WebGL2RenderingContext::texSubImage3D):
1257         (WebCore::WebGL2RenderingContext::compressedTexImage3D):
1258         (WebCore::WebGL2RenderingContext::compressedTexSubImage3D):
1259         (WebCore::WebGL2RenderingContext::uniform1uiv):
1260         (WebCore::WebGL2RenderingContext::uniform2uiv):
1261         (WebCore::WebGL2RenderingContext::uniform3uiv):
1262         (WebCore::WebGL2RenderingContext::uniform4uiv):
1263         (WebCore::WebGL2RenderingContext::uniformMatrix2x3fv):
1264         (WebCore::WebGL2RenderingContext::uniformMatrix3x2fv):
1265         (WebCore::WebGL2RenderingContext::uniformMatrix2x4fv):
1266         (WebCore::WebGL2RenderingContext::uniformMatrix4x2fv):
1267         (WebCore::WebGL2RenderingContext::uniformMatrix3x4fv):
1268         (WebCore::WebGL2RenderingContext::uniformMatrix4x3fv):
1269         (WebCore::WebGL2RenderingContext::vertexAttribI4iv):
1270         (WebCore::WebGL2RenderingContext::vertexAttribI4uiv):
1271         (WebCore::WebGL2RenderingContext::clearBufferiv):
1272         (WebCore::WebGL2RenderingContext::clearBufferuiv):
1273         (WebCore::WebGL2RenderingContext::clearBufferfv):
1274         (WebCore::WebGL2RenderingContext::getActiveUniforms):
1275         (WebCore::WebGL2RenderingContext::texSubImage2D):
1276         * html/canvas/WebGL2RenderingContext.h:
1277         * html/canvas/WebGL2RenderingContext.idl:
1278         * html/canvas/WebGLRenderingContext.cpp:
1279         (WebCore::WebGLRenderingContext::texSubImage2D):
1280         * html/canvas/WebGLRenderingContext.h:
1281         * html/canvas/WebGLRenderingContextBase.cpp:
1282         (WebCore::WebGLRenderingContextBase::bufferData):
1283         (WebCore::WebGLRenderingContextBase::bufferSubData):
1284         (WebCore::WebGLRenderingContextBase::compressedTexImage2D):
1285         (WebCore::WebGLRenderingContextBase::compressedTexSubImage2D):
1286         (WebCore::WebGLRenderingContextBase::readPixels):
1287         (WebCore::WebGLRenderingContextBase::texImage2D):
1288         (WebCore::WebGLRenderingContextBase::uniform1fv):
1289         (WebCore::WebGLRenderingContextBase::uniform1iv):
1290         (WebCore::WebGLRenderingContextBase::uniform2fv):
1291         (WebCore::WebGLRenderingContextBase::uniform2iv):
1292         (WebCore::WebGLRenderingContextBase::uniform3fv):
1293         (WebCore::WebGLRenderingContextBase::uniform3iv):
1294         (WebCore::WebGLRenderingContextBase::uniform4fv):
1295         (WebCore::WebGLRenderingContextBase::uniform4iv):
1296         (WebCore::WebGLRenderingContextBase::uniformMatrix2fv):
1297         (WebCore::WebGLRenderingContextBase::uniformMatrix3fv):
1298         (WebCore::WebGLRenderingContextBase::uniformMatrix4fv):
1299         (WebCore::WebGLRenderingContextBase::vertexAttrib1fv):
1300         (WebCore::WebGLRenderingContextBase::vertexAttrib2fv):
1301         (WebCore::WebGLRenderingContextBase::vertexAttrib3fv):
1302         (WebCore::WebGLRenderingContextBase::vertexAttrib4fv):
1303         (WebCore::WebGLRenderingContextBase::validateCompressedTexFuncData):
1304         (WebCore::WebGLRenderingContextBase::validateUniformParameters):
1305         (WebCore::WebGLRenderingContextBase::validateUniformMatrixParameters):
1306         (WebCore::WebGLRenderingContextBase::vertexAttribfvImpl):
1307         (WebCore::WebGLRenderingContextBase::validateSettableTexFormat): Deleted.
1308         (WebCore::WebGLRenderingContextBase::uniform1i): Deleted.
1309         (WebCore::WebGLRenderingContextBase::uniform2i): Deleted.
1310         (WebCore::WebGLRenderingContextBase::uniform3f): Deleted.
1311         (WebCore::WebGLRenderingContextBase::uniform3i): Deleted.
1312         (WebCore::WebGLRenderingContextBase::uniform4f): Deleted.
1313         (WebCore::WebGLRenderingContextBase::uniform4i): Deleted.
1314         (WebCore::WebGLRenderingContextBase::useProgram): Deleted.
1315         (WebCore::WebGLRenderingContextBase::vertexAttribPointer): Deleted.
1316         (WebCore::WebGLRenderingContextBase::validateCompressedTexDimensions): Deleted.
1317         (WebCore::WebGLRenderingContextBase::validateBufferDataParameters): Deleted.
1318         * html/canvas/WebGLRenderingContextBase.h:
1319         * html/canvas/WebGLRenderingContextBase.idl:
1320         * testing/Internals.cpp:
1321         (WebCore::Internals::createTimeRanges):
1322         * testing/Internals.h:
1323
1324 2016-04-30  Ryosuke Niwa  <rniwa@webkit.org>
1325
1326         Node.prototype.rootNode is not Web compatible
1327         https://bugs.webkit.org/show_bug.cgi?id=157233
1328
1329         Reviewed by Chris Dumez.
1330
1331         Turns out that the name rootNode is not Web compatible. Remove the method for now
1332         until we can come up with a better name in https://github.com/whatwg/dom/issues/241.
1333
1334         No new tests since we're just removing a method.
1335
1336         * dom/Node.idl:
1337
1338 2016-04-30  Darin Adler  <darin@apple.com>
1339
1340         Try to fix GTK build.
1341
1342         * testing/Internals.h: Added conditional around include of
1343         MediaSessionInterruptionProvider.h.
1344
1345 2016-04-30  Darin Adler  <darin@apple.com>
1346
1347         Stop using old-style string-based enums in Internals.idl
1348         https://bugs.webkit.org/show_bug.cgi?id=157235
1349
1350         Reviewed by Chris Dumez.
1351
1352         * bindings/scripts/CodeGenerator.pm: Removed the six enumeration names
1353         that are used in Internals.idl.
1354         (GenerateCompileTimeCheckForEnumsIfNeeded): Unrelated cleanup. Tighten
1355         code and use static_assert instead of COMPILE_ASSERT.
1356         (IsStringType): Marked this function as deprecated. Calling a function
1357         just to check if something is specifically "DOMString" isn't a good pattern.
1358         Lots of call sites were checking "DOMString" directly and there is no
1359         reason to mix the two different idioms.
1360
1361         * bindings/scripts/CodeGeneratorJS.pm:
1362         (GetEnumerationImplementationContent): Use GenerateConditionalString.
1363         (GenerateImplementation): Use static_assert instead of COMPILE_ASSERT.
1364         (GenerateCallbackHeader): Tighten code. Remove peculiar code that was
1365         trying to emit COMPILE_ASSERT(false); not an important case to detect, and
1366         if we did want to detect it, then having the code generator report an error
1367         is better than COMPILE_ASSERT when compiling the output.
1368         (NativeToJSValue): Stop using IsStringType.
1369
1370         * bindings/scripts/CodeGeneratorObjC.pm:
1371         (GetClassName): Stop using IsStringType.
1372         (GetPropertyAttributes): Ditto.
1373         (ConversionNeeded): Ditto.
1374         (GetObjCTypeGetter): Ditto.
1375         (AddIncludesForType): Ditto.
1376         (GenerateImplementation): Removed unused @needsAssert. It was a write-only
1377         variable.
1378
1379         * bindings/scripts/IDLParser.pm:
1380         (parseEnum): Put the extended attributes into the enumeration object.
1381
1382         * bindings/scripts/test/TestObj.idl: Added test cases for the Conditional
1383         extended attribute, used with enumerations.
1384
1385         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1386         * bindings/scripts/test/JS/JSTestCallback.cpp:
1387         * bindings/scripts/test/JS/JSTestCallback.h:
1388         * bindings/scripts/test/JS/JSTestCallbackFunction.h:
1389         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
1390         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
1391         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
1392         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1393         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1394         * bindings/scripts/test/JS/JSTestException.cpp:
1395         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1396         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1397         * bindings/scripts/test/JS/JSTestInterface.cpp:
1398         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1399         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1400         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
1401         * bindings/scripts/test/JS/JSTestObj.cpp:
1402         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1403         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1404         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1405         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1406         * bindings/scripts/test/JS/JSattribute.cpp:
1407         * bindings/scripts/test/JS/JSreadonly.cpp:
1408         Regenerated.
1409
1410         * testing/Internals.cpp:
1411         (WebCore::toResourceRequestCachePolicy): Take enum instead of string.
1412         (WebCore::Internals::setOverrideCachePolicy): Ditto.
1413         (WebCore::toResourceLoadPriority): Ditto.
1414         (WebCore::Internals::setOverrideResourceLoadPriority): Ditto.
1415         (WebCore::toAutoFillButtonType): Ditto.
1416         (WebCore::Internals::setShowAutoFillButton): Ditto.
1417         (WebCore::interruptingCategoryFromString): Deleted.
1418         (WebCore::Internals::sendMediaSessionStartOfInterruptionNotification): Ditto.
1419         (WebCore::Internals::sendMediaSessionEndOfInterruptionNotification): Ditto.
1420         (WebCore::Internals::sendMediaControlEvent): Ditto.
1421         (WebCore::Internals::installMockPageOverlay): Ditto.
1422
1423         * testing/Internals.h: Added enum class and use those instead of strings for
1424         enumerations defined in the IDL.
1425
1426         * testing/Internals.idl: Renamed enumerations that conflict with ones that already
1427         exist in WebCore; added Internals prefix. Made MediaSessionInterruptingCategory and
1428         MediaControlEvent conditional to match the functions they are used on. Added some
1429         FIXMEs about peculiarities of some of the enumerations.
1430
1431 2016-04-30  Darin Adler  <darin@apple.com>
1432
1433         Fixed expected results from bindings tests.
1434
1435         * bindings/scripts/test/JS/JSTestObj.cpp: Regenerated.
1436
1437 2016-04-30  Darin Adler  <darin@apple.com>
1438
1439         Next batch of conversions to use C++ enum class instead of strings for enumerations
1440         https://bugs.webkit.org/show_bug.cgi?id=157232
1441
1442         Reviewed by Chris Dumez.
1443
1444         * Modules/fetch/FetchResponse.cpp:
1445         (WebCore::FetchResponse::error): Use ResponseType.
1446         (WebCore::FetchResponse::redirect): Ditto.
1447         (WebCore::FetchResponse::FetchResponse): Ditto.
1448         (WebCore::FetchResponse::clone): Ditto.
1449         (WebCore::FetchResponse::type): Return ResponseType.
1450         (WebCore::FetchResponse::startFetching): Use auto.
1451         * Modules/fetch/FetchResponse.h: Added ResponseType and used it for the return value
1452         of the type function, and also to replace FetchResponse::Type.
1453
1454         * Modules/mediacontrols/MediaControlsHost.cpp:
1455         (WebCore::MediaControlsHost::externalDeviceType): Return DeviceType.
1456         * Modules/mediacontrols/MediaControlsHost.h: Added DeviceType and use it for the
1457         return value for the externalDeviceType function.
1458
1459         * Modules/mediasession/MediaSession.cpp:
1460         (WebCore::MediaSession::parseKind): Deleted.
1461         (WebCore::MediaSession::MediaSession): Use MediaSessionKind.
1462         (WebCore::MediaSession::kind): Deleted.
1463         * Modules/mediasession/MediaSession.h: Added MediaSessionKind and use it as the
1464         argument to MediaSession::create and the return type for the kind function.
1465         Probably didn't get this 100% right because this code does not seem to be compiled.
1466         * Modules/mediasession/MediaSession.idl: Added default value for kind, as specified
1467         in the current version of the specification for this class.
1468         * Modules/mediasession/MediaSessionManager.cpp:
1469         (WebCore::MediaSessionManager::didReceiveStartOfInterruptionNotification):
1470         Tried to update for changes above.
1471         (WebCore::MediaSessionManager::didReceiveEndOfInterruptionNotification): Ditto.
1472
1473         * Modules/mediasource/MediaSource.cpp:
1474         (WebCore::MediaSource::endOfStream): Changed to take Optional<EndOfStreamError>
1475         instead of overloading and taking const AtomicString&.
1476         (WebCore::MediaSource::streamEndedWithError): Ditto. Also removed exception code.
1477         (WebCore::MediaSource::addSourceBuffer): Updated to use EndOfStreamError. Also
1478         used an if statement.
1479         (WebCore::MediaSource::sourceBufferDidChangeActiveState): Updated to take a reference
1480         instead of a pointer.
1481         * Modules/mediasource/MediaSource.h: Added EndOfStreamError and changed as above.
1482
1483         * Modules/mediasource/SourceBuffer.cpp:
1484         (WebCore::SourceBuffer::segmentsKeyword): Deleted.
1485         (WebCore::SourceBuffer::sequenceKeyword): Deleted.
1486         (WebCore::SourceBuffer::TrackBuffer::TrackBuffer): Initialize booleans where they are
1487         defined rather than in this constructor.
1488         (WebCore::SourceBuffer::create): Use Ref instead of RefPtr.
1489         (WebCore::SourceBuffer::SourceBuffer): Initialize many data members where they are
1490         defined rather than in this constructor.
1491         (WebCore::SourceBuffer::setTimestampOffset): Use AppendMode.
1492         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveRenderingError): Ditto.
1493         (WebCore::SourceBuffer::decodeError): Deleted.
1494         (WebCore::SourceBuffer::networkError): Deleted.
1495         (WebCore::SourceBuffer::setActive): Pass reference instead of pointer.
1496         (WebCore::SourceBuffer::sourceBufferPrivateDidEndStream): Deleted. No callers.
1497         (WebCore::SourceBuffer::appendError): Use AppendMode.
1498         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): Ditto.
1499         (WebCore::SourceBuffer::setMode): Take AppendMode.
1500         * Modules/mediasource/SourceBuffer.h: Added AppendMode, removed various string
1501         constant functions, initialize more data emebers in this header. Removed unused
1502         sourceBufferPrivateDidEndStream function.
1503
1504         * Modules/mediastream/MediaDeviceInfo.cpp:
1505         (WebCore::MediaDeviceInfo::MediaDeviceInfo): Take MediaDeviceKind instead of string.
1506         (WebCore::MediaDeviceInfo::create): Ditto.
1507         (WebCore::MediaDeviceInfo::audioInputType): Deleted.
1508         (WebCore::MediaDeviceInfo::audioOutputType): Deleted.
1509         (WebCore::MediaDeviceInfo::videoInputType): Deleted.
1510         * Modules/mediastream/MediaDeviceInfo.h: Aedded MediaDeviceKind and used it.
1511         * Modules/mediastream/MediaDeviceInfo.idl: Changed type of the kind attribute
1512         to be MediaDeviceKind as in the specification.
1513
1514         * Modules/mediastream/MediaDevicesRequest.cpp:
1515         (WebCore::MediaDevicesRequest::didCompleteTrackSourceInfoRequest): Fix loop to not
1516         churn the reference countds. Also updated to use String instead of AtomicString for
1517         label, and MediaDeviceKind instead of string for kind.
1518
1519         * Modules/mediastream/MediaStreamTrack.cpp:
1520         (WebCore::MediaStreamTrack::readyState): Return MediaStreamTrackState.
1521         * Modules/mediastream/MediaStreamTrack.h: Added MediaStreamTrackState and used it
1522         for the return value from the readyState function.
1523
1524         * Modules/webaudio/AudioContext.cpp:
1525         (WebCore::AudioContext::state): Return AudioContextState.
1526         * Modules/webaudio/AudioContext.h: Added AudioContextState and used it.
1527
1528         * Modules/webaudio/WaveShaperNode.cpp:
1529         (WebCore::processorType): Added.
1530         (WebCore::WaveShaperNode::setOversample): Take OverSampletype instead of a string.
1531         (WebCore::WaveShaperNode::oversample): Return OverSampleType.
1532         * Modules/webaudio/WaveShaperNode.h: Added OverSampleType and used it.
1533         * Modules/webaudio/WaveShaperNode.idl: Removed unneeded [SetterRaisesException].
1534
1535         * bindings/scripts/CodeGenerator.pm: Removed special cases for 18 enumerations that
1536         either don't exist or were converted to no longer pass strings in to the C++ DOM.
1537
1538         * bindings/scripts/CodeGeneratorJS.pm:
1539         (GenerateHeaderContentHeader): Use #pragma once instead of header guards.
1540         (GetEnumerationValueName): Added logic to handle names with "-" and starting with
1541         a numeric digit.
1542         (GetEnumerationImplementationContent): Changed functions so they do more of the
1543         binding work. Added JSValueTraits specialization so we can generate bindings for
1544         a vector of any enumeration. Added special cases for null string. Removed special
1545         case to keep the style checker happy.
1546         (GenerateHeader): Removed the #endif that matched the header guards in
1547         GenerateHeaderContentHeader.
1548         (GenerateImplementation): Use the $type local variable rather than writing out
1549         $attribute->signature->type or $attributeType. Fixed code path that checks for
1550         valid enumeration values to work for non-string-based enumerations.
1551         (CanUseWTFOptionalForParameter): Turn this function off for the new enumerations.
1552         For now, leave it on for the old string-based enumerations.
1553         (GenerateParametersCheck): Added appropriate parameter checking for the new
1554         enumerations.
1555         (GenerateCallbackHeader): Removed the #endif that matched the header guards in
1556         GenerateHeaderContentHeader.
1557         (GetNativeType): Use "auto" instead of the enumeration name in generated code.
1558         (JSValueToNative): Updated since the name of enumerationValueMyEnum was changed
1559         to parseMyEnum.
1560         (NativeToJSValue): Took out call to stringValue, since we now overload the
1561         jsStringWithCache function instead.
1562
1563         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
1564         * bindings/scripts/test/JS/JSTestCallback.h:
1565         * bindings/scripts/test/JS/JSTestCallbackFunction.h:
1566         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
1567         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
1568         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
1569         * bindings/scripts/test/JS/JSTestEventConstructor.h:
1570         * bindings/scripts/test/JS/JSTestEventTarget.h:
1571         * bindings/scripts/test/JS/JSTestException.h:
1572         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
1573         * bindings/scripts/test/JS/JSTestGlobalObject.h:
1574         * bindings/scripts/test/JS/JSTestInterface.h:
1575         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
1576         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
1577         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
1578         * bindings/scripts/test/JS/JSTestNode.h:
1579         * bindings/scripts/test/JS/JSTestNondeterministic.h:
1580         * bindings/scripts/test/JS/JSTestObj.cpp:
1581         * bindings/scripts/test/JS/JSTestObj.h:
1582         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
1583         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
1584         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
1585         * bindings/scripts/test/JS/JSTestTypedefs.h:
1586         * bindings/scripts/test/JS/JSattribute.h:
1587         * bindings/scripts/test/JS/JSreadonly.h:
1588         Regenerated.
1589
1590         * crypto/CryptoKey.cpp:
1591         (WebCore::CryptoKey::type): Use CryptoKeyType.
1592         (WebCore::CryptoKey::usages): Use KeyUsage.
1593         * crypto/CryptoKey.h: Added KeyUsage and use CryptoKeyType.
1594
1595         * css/FontFaceSet.cpp:
1596         (WebCore::FontFaceSet::status): Use FontFaceSetLoadStatus.
1597         * css/FontFaceSet.h: Added FontFaceSetLoadStatus and used it.
1598
1599         * html/HTMLMediaElement.cpp:
1600         (WebCore::HTMLMediaElement::playInternal): Use kind instead of kindEnum.
1601
1602         * html/HTMLVideoElement.cpp:
1603         (WebCore::presentationModeFullscreen): Deleted.
1604         (WebCore::presentationModePictureInPicture): Deleted.
1605         (WebCore::presentationModeInline): Deleted.
1606         (WebCore::HTMLVideoElement::webkitSupportsPresentationMode): Use VideoPresentationMode.
1607         (WebCore::toFullscreenMode): Ditto.
1608         (WebCore::HTMLVideoElement::webkitSetPresentationMode): Ditto.
1609         (WebCore::toPresentationMode): Ditto.
1610         (WebCore::HTMLVideoElement::webkitPresentationMode): Ditto.
1611         * html/HTMLVideoElement.h: Added VideoPresentationMode and used it.
1612
1613         * html/canvas/CanvasRenderingContext2D.cpp: Tweaked formatting. Changed
1614         DefaultSmoothingQuality macro to a constant.
1615         (WebCore::toWindRule): Replaces parseWinding.
1616         (WebCore::CanvasRenderingContext2D::fill): Use CanvasWindingRule instead of string.
1617         (WebCore::CanvasRenderingContext2D::clip): Ditto.
1618         (WebCore::CanvasRenderingContext2D::fillInternal): Ditto.
1619         (WebCore::CanvasRenderingContext2D::clipInternal): Ditto.
1620         (WebCore::CanvasRenderingContext2D::isPointInPath): Ditto.
1621         (WebCore::CanvasRenderingContext2D::isPointInStroke): Ditto.
1622         (WebCore::CanvasRenderingContext2D::isPointInPathInternal): Ditto.
1623         (WebCore::smoothingToInterpolationQuality): Ditto.
1624         (WebCore::CanvasRenderingContext2D::imageSmoothingQuality): Ditto.
1625         (WebCore::CanvasRenderingContext2D::setImageSmoothingQuality): Ditto.
1626         * html/canvas/CanvasRenderingContext2D.h: Added CanvasWindingRule and
1627         ImageSmoothingQuality, and use them throughout the class.
1628
1629         * platform/graphics/SourceBufferPrivateClient.h: Removed unused
1630         sourceBufferPrivateDidEndStream function.
1631
1632 2016-04-30  Nan Wang  <n_wang@apple.com>
1633
1634         AX: @aria-label attribute should work on <label> element
1635         https://bugs.webkit.org/show_bug.cgi?id=157219
1636
1637         Reviewed by Chris Fleizach.
1638
1639         When there's aria-label on a <label> element, we shouldn't expose it
1640         as the titleUIElement. Instead, we return its aria-label as a title.
1641
1642         Test: accessibility/mac/aria-label-on-label-element.html
1643
1644         * accessibility/AccessibilityNodeObject.cpp:
1645         (WebCore::AccessibilityNodeObject::titleElementText):
1646         * accessibility/AccessibilityRenderObject.cpp:
1647         (WebCore::AccessibilityRenderObject::exposesTitleUIElement):
1648
1649         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
1650         (WebCore::WebPlaybackSessionModelMediaElement::updateForEventName):
1651         Use DeviceType instead of String for externalDeviceType.
1652
1653 2016-04-29  Chris Dumez  <cdumez@apple.com>
1654
1655         [Web IDL] Specify default parameter values for callback parameters
1656         https://bugs.webkit.org/show_bug.cgi?id=157188
1657
1658         Reviewed by Darin Adler.
1659
1660         Specify default parameter values for callback parameters.
1661
1662         * Modules/geolocation/Geolocation.idl:
1663         * Modules/notifications/Notification.cpp:
1664         (WebCore::Notification::requestPermission):
1665         * Modules/notifications/Notification.h:
1666         * Modules/notifications/Notification.idl:
1667         * Modules/notifications/NotificationCenter.idl:
1668         * Modules/quota/StorageInfo.cpp:
1669         (WebCore::StorageInfo::queryUsageAndQuota):
1670         (WebCore::StorageInfo::requestQuota):
1671         * Modules/quota/StorageInfo.h:
1672         * Modules/quota/StorageInfo.idl:
1673         * Modules/quota/StorageQuota.h:
1674         * Modules/quota/StorageQuota.idl:
1675         * Modules/webaudio/AudioContext.idl:
1676         * Modules/webdatabase/DOMWindowWebDatabase.cpp:
1677         (WebCore::DOMWindowWebDatabase::openDatabase):
1678         * Modules/webdatabase/DOMWindowWebDatabase.h:
1679         (WebCore::DOMWindowWebDatabase::DOMWindowWebDatabase):
1680         (WebCore::DOMWindowWebDatabase::~DOMWindowWebDatabase):
1681         * Modules/webdatabase/DOMWindowWebDatabase.idl:
1682         * Modules/webdatabase/Database.cpp:
1683         (WebCore::Database::runTransaction):
1684         (WebCore::Database::changeVersion):
1685         (WebCore::Database::transaction):
1686         (WebCore::Database::readTransaction):
1687         * Modules/webdatabase/Database.h:
1688         * Modules/webdatabase/Database.idl:
1689         * Modules/webdatabase/SQLTransaction.idl:
1690         * bindings/scripts/CodeGeneratorJS.pm:
1691         (GenerateParametersCheck):
1692         (CanUseWTFOptionalForParameter): Deleted.
1693         * bindings/scripts/test/TestObj.idl:
1694         * dom/DataTransferItem.h:
1695         * dom/DataTransferItem.idl:
1696
1697 2016-04-28  Darin Adler  <darin@apple.com>
1698
1699         First step in using "enum class" instead of "String" for enumerations in DOM
1700         https://bugs.webkit.org/show_bug.cgi?id=157163
1701
1702         Reviewed by Chris Dumez.
1703
1704         This patch adds the basic support for using "enum class" to implement enumerations
1705         in the C++ DOM. This is enough so we can use it for one case, but not enough for
1706         others. For example, it correctly generates code to get an attribute, but likely
1707         does not correctly generate code to set an attribute or call a function with an
1708         argument type that is the new style of enum.
1709
1710         * bindings/scripts/CodeGenerator.pm: Cleaned up the formatting of the hashes
1711         at the start of this file. Added a new one named stringBasedEnumerationHash
1712         and a comment explaining that we need to eventually make it empty.
1713         (ProcessDocument): Pass the enumerations into the GenerateInterface function.
1714         (IsStringBasedEnumType): Added. Returns 1 for the old-style string-based enumerations,
1715         as opposed to enumerations we use "enum class" for.
1716
1717         * bindings/scripts/CodeGeneratorJS.pm:
1718         (GenerateInterface): Take the enumerations argument and pass it along to the
1719         functions that generate headers and implementation files.
1720         (EnumerationClassName): Added. Maps from an enumeration type name as seen
1721         in the IDL file to the enumeration class name used in the C++ DOM implementation.
1722         (EnumerationValueName): Added. Maps from an anumeration string value as seen
1723         in the IDL file to an enumeration value name used in the C++ DOM implementatino.
1724         (EnumerationImplementationContent): Added. Generates a string with all the content
1725         needed in the implementation file to define the helper functions for enumerations.
1726         (GenerateHeader): Tweak.
1727         (GenerateImplementation): Added call to EnumerationImplementationContent.
1728         (GenerateParametersCheck): Use toWTFString instead of toString/value, which is a
1729         longer way of writing out the same thing.
1730         (GenerateCallbackHeader): Tweak.
1731         (GenerateCallbackImplementation): Added call to EnumerationImplementationContent.
1732         (GetNativeType): Continue to return String for string-based enum types, but for
1733         other enum types, return the result of EnumerationClassName instead.
1734         (JSValueToNative): Use toWTFString instead of toString/value (see above), convert
1735         to a string only for string-based enum types, and add a preliminary, probably not
1736         yet working, version of the code for non-string-based enum types. Will finish this
1737         in the next patch when we are trying to use one of the new enumerations for a setter
1738         or a function argument.
1739         (NativeToJSValue): Call the stringValue function to convert an enumeration value
1740         into a string when it's not a string-based enumeration.
1741
1742         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1743         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
1744         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1745         * bindings/scripts/test/JS/JSTestInterface.cpp:
1746         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1747         * bindings/scripts/test/JS/JSTestNode.cpp:
1748         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
1749         * bindings/scripts/test/JS/JSTestObj.cpp:
1750         * bindings/scripts/test/JS/JSTestObj.h:
1751         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1752         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1753         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1754         Regenerated.
1755
1756         * css/FontFace.cpp:
1757         (WebCore::FontFace::status): Updated to return enum values rather than strings.
1758
1759         * css/FontFace.h: Removed unneeded forward declaration of Deprecated::ScriptValue.
1760         Added enum class for FontFaceLoadStatus, with names that match the names from the
1761         enumeration in the IDL, but with our standard enum capitalization style. Changed
1762         the return value of the status function to FontFaceLoadStatus.
1763
1764 2016-04-29  Chris Dumez  <cdumez@apple.com>
1765
1766         Get rid of unnecessary null check in wrap(JSDOMGlobalObject*, DOMClass*)
1767         https://bugs.webkit.org/show_bug.cgi?id=157224
1768
1769         Reviewed by Ryosuke Niwa.
1770
1771         Get rid of unnecessary null check in wrap(JSDOMGlobalObject*, DOMClass*)
1772         since all the call sites already do a null check. Also update the function
1773         to take the implementation object by reference instead of pointer. Finally,
1774         use is<>() / downcast<>() more at the call sites.
1775
1776         * Modules/indexeddb/IDBCursor.cpp:
1777         (WebCore::IDBCursor::update):
1778         (WebCore::IDBCursor::deleteFunction):
1779         (WebCore::IDBCursor::setGetResult):
1780         * Modules/indexeddb/IDBCursor.h:
1781         (WebCore::IDBCursor::isKeyCursorWithValue):
1782         (WebCore::IDBCursor::isKeyCursor): Deleted.
1783         * Modules/indexeddb/IDBCursorWithValue.h:
1784         (isType):
1785         * bindings/js/JSBlobCustom.cpp:
1786         (WebCore::toJS):
1787         * bindings/js/JSCanvasRenderingContextCustom.cpp:
1788         (WebCore::toJS):
1789         * bindings/js/JSDOMBinding.h:
1790         (WebCore::wrap):
1791         * bindings/js/JSIDBCursorCustom.cpp:
1792         (WebCore::toJS):
1793         * bindings/js/JSMediaStreamCapabilitiesCustom.cpp:
1794         (WebCore::toJS):
1795         * bindings/js/JSPerformanceEntryCustom.cpp:
1796         (WebCore::toJS):
1797         * html/canvas/WebGL2RenderingContext.h:
1798         * html/canvas/WebGLRenderingContext.h:
1799         * page/PerformanceMark.h:
1800         (isType):
1801         (WebCore::PerformanceMark::isMark): Deleted.
1802         * page/PerformanceMeasure.h:
1803         (isType):
1804         (WebCore::PerformanceMeasure::isMeasure): Deleted.
1805         * page/PerformanceResourceTiming.h:
1806         (isType):
1807         (WebCore::PerformanceResourceTiming::isResource): Deleted.
1808
1809 2016-04-29  Chris Dumez  <cdumez@apple.com>
1810
1811         Use LIKELY() / UNLIKELY() hints when suitable in the JavaScript bindings
1812         https://bugs.webkit.org/show_bug.cgi?id=157210
1813
1814         Reviewed by Darin Adler.
1815
1816         Use LIKELY() / UNLIKELY() hints when suitable in the JavaScript bindings.
1817         We already make use of them in the JS bindings but they are some cases
1818         where we don't and they may be useful.
1819
1820         * bindings/scripts/CodeGeneratorJS.pm:
1821         (GenerateOverloadedFunction):
1822         (GenerateImplementation):
1823         (GenerateParametersCheck):
1824         (GenerateImplementationFunctionCall):
1825         (GenerateOverloadedConstructorDefinition):
1826         (GenerateConstructorDefinition):
1827         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1828         (WebCore::jsTestActiveDOMObjectConstructor):
1829         (WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunction):
1830         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
1831         (WebCore::jsTestClassWithJSBuiltinConstructorConstructor):
1832         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
1833         (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
1834         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
1835         (WebCore::jsTestCustomNamedGetterConstructor):
1836         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1837         (WebCore::jsTestEventConstructorConstructor):
1838         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1839         (WebCore::JSTestEventTarget::getOwnPropertySlotByIndex):
1840         (WebCore::jsTestEventTargetConstructor):
1841         * bindings/scripts/test/JS/JSTestException.cpp:
1842         (WebCore::jsTestExceptionConstructor):
1843         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1844         (WebCore::jsTestGenerateIsReachableConstructor):
1845         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1846         (WebCore::jsTestGlobalObjectConstructor):
1847         (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation):
1848         * bindings/scripts/test/JS/JSTestInterface.cpp:
1849         (WebCore::JSTestInterfaceConstructor::construct):
1850         (WebCore::jsTestInterfaceConstructor):
1851         (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
1852         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
1853         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
1854         (WebCore::jsTestJSBuiltinConstructorConstructor):
1855         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1856         (WebCore::jsTestMediaQueryListListenerConstructor):
1857         (WebCore::jsTestMediaQueryListListenerPrototypeFunctionMethod):
1858         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1859         (WebCore::JSTestNamedConstructorNamedConstructor::construct):
1860         (WebCore::jsTestNamedConstructorConstructor):
1861         * bindings/scripts/test/JS/JSTestNode.cpp:
1862         (WebCore::jsTestNodeConstructor):
1863         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
1864         (WebCore::jsTestNondeterministicConstructor):
1865         * bindings/scripts/test/JS/JSTestObj.cpp:
1866         (WebCore::JSTestObjConstructor::construct):
1867         (WebCore::JSTestObj::getOwnPropertySlotByIndex):
1868         (WebCore::jsTestObjTestSubObjEnabledBySettingConstructor):
1869         (WebCore::jsTestObjConstructor):
1870         (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation):
1871         (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs):
1872         (WebCore::jsTestObjPrototypeFunctionByteMethodWithArgs):
1873         (WebCore::jsTestObjPrototypeFunctionOctetMethodWithArgs):
1874         (WebCore::jsTestObjPrototypeFunctionLongMethodWithArgs):
1875         (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
1876         (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
1877         (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackArg):
1878         (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg):
1879         (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackFunctionArg):
1880         (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackFunctionArg):
1881         (WebCore::jsTestObjConstructorFunctionStaticMethodWithCallbackArg):
1882         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod5):
1883         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod8):
1884         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod):
1885         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter):
1886         (WebCore::jsTestObjConstructorFunctionOverloadedMethod1):
1887         (WebCore::jsTestObjPrototypeFunctionConvert1):
1888         (WebCore::jsTestObjPrototypeFunctionStrictFunctionWithSequence):
1889         (WebCore::jsTestObjPrototypeFunctionStrictFunctionWithArray):
1890         (WebCore::jsTestObjPrototypeFunctionVariadicNodeMethod):
1891         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
1892         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise):
1893         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise):
1894         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction):
1895         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1896         (WebCore::constructJSTestOverloadedConstructors1):
1897         (WebCore::constructJSTestOverloadedConstructors3):
1898         (WebCore::JSTestOverloadedConstructorsConstructor::construct):
1899         (WebCore::jsTestOverloadedConstructorsConstructor):
1900         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1901         (WebCore::jsTestOverrideBuiltinsConstructor):
1902         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1903         (WebCore::jsTestSerializedScriptValueInterfaceConstructor):
1904         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1905         (WebCore::JSTestTypedefsConstructor::construct):
1906         (WebCore::jsTestTypedefsConstructor):
1907         * bindings/scripts/test/JS/JSattribute.cpp:
1908         (WebCore::jsattributeConstructor):
1909         * bindings/scripts/test/JS/JSreadonly.cpp:
1910         (WebCore::jsreadonlyConstructor):
1911
1912 2016-04-29  Ryosuke Niwa  <rniwa@webkit.org>
1913
1914         Rename getAssignedNodes to assignedNodes and support flattened option
1915         https://bugs.webkit.org/show_bug.cgi?id=157225
1916
1917         Reviewed by Antti Koivisto.
1918
1919         Renamed getAssignedNodes and added the the support for {flattened: true/false} as spec'ed at
1920         http://w3c.github.io/webcomponents/spec/shadow/#widl-HTMLSlotElement-assignedNodes-sequence-Node--AssignedNodesOptions-options
1921
1922         Test: fast/shadow-dom/HTMLSlotElement-interface.html
1923
1924         * html/HTMLSlotElement.cpp:
1925         (WebCore::flattenAssignedNodes): Added.
1926         (WebCore::HTMLSlotElement::assignedNodesForBindings): Added.
1927         * html/HTMLSlotElement.h:
1928         * html/HTMLSlotElement.idl:
1929
1930 2016-04-29  Simon Fraser  <simon.fraser@apple.com>
1931
1932         Make clipToRect() and restoreClip() have similar signatures
1933         https://bugs.webkit.org/show_bug.cgi?id=157229
1934
1935         Reviewed by Zalan Bujtas.
1936
1937         clipToRect() and restoreClip() are always called in pairs, but had different
1938         parameter order, and parameter types. So make them more similar.
1939         
1940         In future we could use them in a stack-based class.
1941
1942         No behavior change.
1943
1944         * rendering/RenderLayer.cpp:
1945         (WebCore::RenderLayer::clipToRect):
1946         (WebCore::RenderLayer::restoreClip):
1947         (WebCore::RenderLayer::paintLayer):
1948         (WebCore::RenderLayer::applyFilters):
1949         (WebCore::RenderLayer::paintTransformedLayerIntoFragments):
1950         (WebCore::RenderLayer::paintBackgroundForFragments):
1951         (WebCore::RenderLayer::paintForegroundForFragments):
1952         (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
1953         (WebCore::RenderLayer::paintOutlineForFragments):
1954         (WebCore::RenderLayer::paintMaskForFragments):
1955         (WebCore::RenderLayer::paintChildClippingMaskForFragments):
1956         (WebCore::RenderLayer::paintOverflowControlsForFragments):
1957         (WebCore::RenderLayer::calculateClipRects):
1958         * rendering/RenderLayer.h:
1959
1960 2016-04-29  Simon Fraser  <simon.fraser@apple.com>
1961
1962         Blur filter escapes an enclosing overflow:hidden
1963         https://bugs.webkit.org/show_bug.cgi?id=155029
1964
1965         Reviewed by Zalan Bujtas.
1966
1967         The clipping that was applied when drawing the results of filters was wrong for two reasons.
1968
1969         First, it used localPaintingInfo which has already been contaminated when setting up the filters.
1970         When painting the result, we need to use the original paintingInfo, to get the right paintDirtyRect.
1971
1972         Secondly, when setting up the clip to paint the filter result, it was relying on layerFragments[0].backgroundRect.
1973         However, that was also contaminated by filter setup, since calculateRects() intersects with paintDirtyRect to
1974         compute that backgroundRect, and that paintDirtyRect came from filterPainter->repaintRect().
1975         
1976         Fix this second issue by re-running collectFragments(), which computes a fragment backgroundRect using
1977         the original paintDirtyRect.
1978
1979         Tests: css3/filters/blur-clipped-by-ancestor.html
1980                css3/filters/blur-clipped-with-overflow.html
1981                css3/filters/drop-shadow-with-overflow-hidden.html
1982                css3/filters/drop-shadow.html
1983
1984         * platform/graphics/filters/FilterEffect.cpp:
1985         (WebCore::FilterEffect::clearResult): Unconditionally null these out.
1986         * rendering/FilterEffectRenderer.cpp:
1987         (WebCore::FilterEffectRendererHelper::beginFilterEffect): Typo fix.
1988         * rendering/FilterEffectRenderer.h:
1989         (WebCore::FilterEffectRendererHelper::FilterEffectRendererHelper): C++11 initialization.
1990         * rendering/RenderLayer.cpp:
1991         (WebCore::RenderLayer::applyFilters):
1992         (WebCore::RenderLayer::paintLayerContents):
1993         * rendering/RenderLayer.h: const
1994
1995 2016-04-29  Myles C. Maxfield  <mmaxfield@apple.com>
1996
1997         REGRESSION(194502): overflow: scroll; direction: rtl; divs jump horizontally when scrolled vertically
1998         https://bugs.webkit.org/show_bug.cgi?id=157201
1999
2000         Reviewed by Simon Fraser.
2001
2002         ScrollableArea::scrollToOffsetWithoutAnimation() was mistakenly conflating scroll offsets with
2003         scroll positions.
2004
2005         Test: fast/scrolling/rtl-drag-vertical-scroller.html
2006
2007         * platform/ScrollableArea.cpp:
2008         (WebCore::ScrollableArea::scrollToOffsetWithoutAnimation):
2009
2010 2016-04-29  Simon Fraser  <simon.fraser@apple.com>
2011
2012         Clean up GraphicsContext use in RenderLayer::paintLayerContents()
2013         https://bugs.webkit.org/show_bug.cgi?id=157193
2014
2015         Reviewed by Zalan Bujtas.
2016
2017         Make the lifetime of the temporary GraphicsContext used to paint filters more explicit
2018         by putting it in an inner scope.
2019         
2020         Make currentContext a reference.
2021         
2022         transparencyLayerContext was a confusing name (it doens't mean we've started a
2023         transparency layer), so just use "context" to refer to the original context. When
2024         passed to other functions, this is called "contextForTransparencyLayer".
2025         
2026         No longer leaves "context" as a null pointer if filterPainter->filterContext() returns
2027         a null pointer. It's unclear if this ever happened.
2028
2029         * rendering/FilterEffectRenderer.cpp:
2030         (WebCore::FilterEffectRendererHelper::filterContext):
2031         * rendering/RenderLayer.cpp:
2032         (WebCore::RenderLayer::beginTransparencyLayers):
2033         (WebCore::RenderLayer::applyFilters):
2034         (WebCore::RenderLayer::paintLayerContents):
2035         (WebCore::RenderLayer::paintBackgroundForFragments):
2036         (WebCore::RenderLayer::paintForegroundForFragments):
2037         * rendering/RenderLayer.h:
2038
2039 2016-04-29  Joseph Pecoraro  <pecoraro@apple.com>
2040
2041         Web Inspector: Issues inspecting the inspector, pausing on breakpoints causes content to not load
2042         https://bugs.webkit.org/show_bug.cgi?id=157198
2043         <rdar://problem/26011049>
2044
2045         Reviewed by Timothy Hatcher.
2046
2047         No new tests. This only affects inspecting an inspector.
2048
2049         * inspector/InspectorController.h:
2050         * inspector/InspectorFrontendClient.h:
2051         (WebCore::InspectorFrontendClient::pagePaused):
2052         (WebCore::InspectorFrontendClient::pageUnpaused):
2053         * inspector/PageScriptDebugServer.cpp:
2054         (WebCore::PageScriptDebugServer::setJavaScriptPaused):
2055         Inform a frontend client if the frontend page itself pauses/unpauses.
2056
2057 2016-04-29  Eric Carlson  <eric.carlson@apple.com>
2058
2059         [iOS] do not exit AirPlay when the screen locks
2060         https://bugs.webkit.org/show_bug.cgi?id=156502
2061         <rdar://problem/24616592>
2062
2063         Reviewed by Dean Jackson
2064
2065         * html/HTMLMediaElement.cpp:
2066         (WebCore::HTMLMediaElement::pendingActionTimerFired): Use m_isPlayingToWirelessTarget.
2067         (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless): Ditto.
2068         (WebCore::HTMLMediaElement::wirelessRoutesAvailableDidChange): Set m_isPlayingToWirelessTarget.
2069         (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged): Use
2070           m_isPlayingToWirelessTarget.
2071         (WebCore::HTMLMediaElement::isPlayingToWirelessPlaybackTarget): Ditto.
2072         (WebCore::HTMLMediaElement::configureMediaControls): Ditto.
2073         (WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction): Add logging.
2074         (WebCore::HTMLMediaElement::purgeBufferedDataIfPossible): Don't tell the media engine to purge 
2075           data if it is playing to a wireless target because that will drop the connection.
2076         * html/HTMLMediaElement.h:
2077
2078         * html/MediaElementSession.cpp:
2079         (WebCore::MediaElementSession::playbackPermitted): Add logging.
2080         (WebCore::MediaElementSession::canPlayToWirelessPlaybackTarget): Drive by fix: iOS doesn't 
2081           have an explicit playbackTarget, don't test for it.
2082         (WebCore::MediaElementSession::isPlayingToWirelessPlaybackTarget): Ditto.
2083
2084 2016-04-29  Chris Dumez  <cdumez@apple.com>
2085
2086         Node.nodeName should not be nullable
2087         https://bugs.webkit.org/show_bug.cgi?id=157211
2088
2089         Reviewed by Ryosuke Niwa.
2090
2091         Node.nodeName should not be nullable as per the specification:
2092         https://dom.spec.whatwg.org/#interface-node
2093
2094         Our implementation never returns null anyway. However, having
2095         it as nullable in the IDL means we use jsStringOrNull() instead
2096         of jsStringWithCache(), thus doing an unnecessary null check.
2097
2098         This should not be observable by JS.
2099
2100         * dom/Node.idl:
2101
2102 2016-04-29  Commit Queue  <commit-queue@webkit.org>
2103
2104         Unreviewed, rolling out r200150 and r200256.
2105         https://bugs.webkit.org/show_bug.cgi?id=157216
2106
2107         This change introduced flakiness in existing CJK LayoutTests.
2108         Also reverting the change that marked the tests as flaky.
2109         (Requested by ryanhaddad on #webkit).
2110
2111         Reverted changesets:
2112
2113         "Clean up Font::removeFromSystemFallbackCache()"
2114         https://bugs.webkit.org/show_bug.cgi?id=157093
2115         http://trac.webkit.org/changeset/200150
2116
2117         "Marking fast/ruby/ruby-expansion-cjk.html and fast/ruby/ruby-
2118         expansion-cjk-4.html as flaky on Mac"
2119         https://bugs.webkit.org/show_bug.cgi?id=157197
2120         http://trac.webkit.org/changeset/200256
2121
2122 2016-04-29  Antonio Gomes  <tonikitoo@webkit.org>
2123
2124         <select multiple> padding should react when scrolling
2125
2126         https://bugs.webkit.org/show_bug.cgi?id=156590
2127         https://bugs.webkit.org/show_bug.cgi?id=156591
2128
2129         Reviewed by Reviewed by Darin Adler.
2130
2131         Tests: fast/forms/listbox-respects-padding-bottom.html
2132                fast/forms/listbox-top-padding-do-not-clip-items.html
2133
2134         Non-dropdown listboxes have support to padding-{top,bottom} implemented similarly
2135         to the border model: the padding area does not move when the listbox' content gets scrolled,
2136         but instead it clips out its content.
2137         This is not consistent with other browsers and is not consistent with the CSS box model.
2138
2139         This in practice, if a <select> has padding-top set, the padding-top area will clip out listbox'
2140         content as one scrolls upwards.
2141         It also means that if padding-bottom is set, when one scrolls all the way to the bottom
2142         of the listbox content, padding-bottom is not respected.
2143
2144         In order to fix these two problems, and make WebKit match Blink with respect to the the way
2145         padding-{top,bottom} are handled, patch adds two class member variables that control the number
2146         of list items (i.e. <option>s) that can be painted over the current listbox' padding area.
2147
2148         In short, depending on the scroll position and the amount of space available in the padding top/bottom
2149         areas, items are painted or not on top of it, mimic'ing the CSS box model behavior of other browsers.
2150
2151         Note that this is specific solution is worth it to pursue on the short/mid term, but a long-term solution
2152         to this problem and many other listbox discrepancies on WebKit's implementation, would be to reimplement
2153         RenderListBox class in terms of RenderLayer. This will be a follow up work.
2154
2155         * rendering/RenderListBox.cpp:
2156         (WebCore::RenderListBox::updateFromElement):
2157         (WebCore::RenderListBox::numVisibleItems):
2158         (WebCore::RenderListBox::paintObject):
2159         (WebCore::RenderListBox::scrollToRevealElementAtListIndex):
2160         (WebCore::RenderListBox::listIndexIsVisible):
2161         (WebCore::RenderListBox::maximumNumberOfItemsThatFitInPaddingBottomArea):
2162         (WebCore::RenderListBox::numberOfVisibleItemsInPaddingTop):
2163         (WebCore::RenderListBox::numberOfVisibleItemsInPaddingBottom):
2164         (WebCore::RenderListBox::computeFirstIndexesVisibleInPaddingTopBottomAreas):
2165         (WebCore::RenderListBox::scrollTo):
2166         * rendering/RenderListBox.h:
2167
2168 2016-04-29  Eric Carlson  <eric.carlson@apple.com>
2169
2170         [Mac] AirPlay fails if target is set before AVPlayer has been created
2171         https://bugs.webkit.org/show_bug.cgi?id=157147
2172         <rdar://problem/24197592>
2173
2174         Reviewed by Jer Noble.
2175
2176         Test: media/media-source/media-source-airplay.html
2177
2178         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2179         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): Clear flag before calling
2180           setShouldPlayToPlaybackTarget so it does the necessary setup.
2181
2182         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2183         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isAvailable): Return false if the mock
2184           MSE source has been registered.
2185         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType): Return 'not supported' if
2186           isAvailable is false.
2187         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load): Fail if isAvailable is false.
2188         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isCurrentPlaybackTargetWireless): Cleanup.
2189
2190         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
2191         (WebCore::registered): Global accessor.
2192         (WebCore::MockMediaPlayerMediaSource::isRegistered): 
2193         (WebCore::MockMediaPlayerMediaSource::registerMediaEngine): Set registered to true.
2194         (WebCore::MockMediaPlayerMediaSource::setWirelessPlaybackTarget): New, remember the target.
2195         (WebCore::MockMediaPlayerMediaSource::setShouldPlayToPlaybackTarget): New, remember the setting.
2196         (WebCore::MockMediaPlayerMediaSource::isCurrentPlaybackTargetWireless):
2197         * platform/mock/mediasource/MockMediaPlayerMediaSource.h:
2198
2199         * testing/Internals.cpp:
2200         (WebCore::Internals::initializeMockMediaSource): Don't disable AVFoundation.
2201
2202 2016-04-29  Myles C. Maxfield  <mmaxfield@apple.com>
2203
2204         [RTL Scrollbars] REGRESSION(r200116): Positioned contents can overlap RTL scrollbars
2205         https://bugs.webkit.org/show_bug.cgi?id=157164
2206         <rdar://problem/25993610>
2207
2208         Reviewed by Darin Adler.
2209
2210         There was some code left over from the old implementation of RTL_SCROLLBARS
2211         which had some faulty assumptions about the interaction between direction
2212         and scrollbar placement. In particular, once we began obeying the "dir"
2213         attribute in r200116, these assumptions were no longer valid.
2214
2215         Test: fast/scrolling/rtl-scrollbars-positioned-intersect-scrollbars.html
2216               scrollbars/rtl/div-absolute.html
2217               scrollbars/rtl/div-horizontal.html
2218
2219         * rendering/InlineFlowBox.h:
2220         (WebCore::InlineFlowBox::layoutOverflowRect):
2221         * rendering/RenderBlock.cpp:
2222         (WebCore::RenderBlock::computeOverflow): Deleted.
2223         * rendering/RenderBox.cpp:
2224         (WebCore::RenderBox::layoutOverflowRectForPropagation):
2225         * rendering/RenderLayer.cpp:
2226         (WebCore::RenderLayer::computeScrollDimensions):
2227
2228 2016-04-29  Nan Wang  <n_wang@apple.com>
2229
2230         AX: CharacterOffset not working correctly with composed characters and collapsed white spaces
2231         https://bugs.webkit.org/show_bug.cgi?id=157190
2232
2233         Reviewed by Chris Fleizach.
2234
2235         When navigating emoji, next/previous text marker call is only moving by one character. Fixed it by
2236         using the helper function in Position to get the real character count for the composed character sequence.
2237         Also there's another issue with collapsed white spaces, TextIterator emits only one space. So we have to 
2238         use the actual space length to create the CharacterOffset in order to generate valid Range object from it.
2239
2240         New test cases in accessibility/text-marker/text-marker-previous-next.html.
2241
2242         * accessibility/AXObjectCache.cpp:
2243         (WebCore::AXObjectCache::traverseToOffsetInRange):
2244         (WebCore::AXObjectCache::textMarkerDataForNextCharacterOffset):
2245         (WebCore::AXObjectCache::textMarkerDataForPreviousCharacterOffset):
2246         (WebCore::AXObjectCache::nextNode):
2247         (WebCore::AXObjectCache::characterOffsetFromVisiblePosition):
2248         (WebCore::AXObjectCache::nextCharacterOffset):
2249         (WebCore::AXObjectCache::previousCharacterOffset):
2250         (WebCore::AXObjectCache::startCharacterOffsetOfWord):
2251
2252 2016-04-28  Jer Noble  <jer.noble@apple.com>
2253
2254         WebPlaybackControlsManager should not be owned by the WebPlaybackSessionInterfaceMac.
2255         https://bugs.webkit.org/show_bug.cgi?id=157155
2256         <rdar://problem/25991724>
2257
2258         Reviewed by Beth Dakin.
2259
2260         Move the WebPlaybackControlsManager class into its own header and implementation files.
2261
2262         * WebCore.xcodeproj/project.pbxproj:
2263         * platform/mac/WebPlaybackControlsManager.h: Added.
2264         * platform/mac/WebPlaybackControlsManager.mm: Added.
2265         (-[WebPlaybackControlsManager timing]): Moved from WebPlaybackSessionInterfaceMac.
2266         (-[WebPlaybackControlsManager setTiming:]): Ditto.
2267         (-[WebPlaybackControlsManager seekableTimeRanges]): Ditto.
2268         (-[WebPlaybackControlsManager setSeekableTimeRanges:]): Ditto.
2269         (-[WebPlaybackControlsManager setAudioMediaSelectionOptions:withSelectedIndex:]): Ditto.
2270         (-[WebPlaybackControlsManager setLegibleMediaSelectionOptions:withSelectedIndex:]): Ditto.
2271         * platform/mac/WebPlaybackSessionInterfaceMac.h:
2272         * platform/mac/WebPlaybackSessionInterfaceMac.mm:
2273         (WebCore::WebPlaybackSessionInterfaceMac::setPlayBackControlsManager):
2274         (-[WebPlaybackControlsManager initWithWebPlaybackSessionInterfaceMac:]): Deleted.
2275         (-[WebPlaybackControlsManager timing]): Deleted.
2276         (-[WebPlaybackControlsManager setTiming:]): Deleted.
2277         (-[WebPlaybackControlsManager seekableTimeRanges]): Deleted.
2278         (-[WebPlaybackControlsManager setSeekableTimeRanges:]): Deleted.
2279         (-[WebPlaybackControlsManager setAudioMediaSelectionOptions:withSelectedIndex:]): Deleted.
2280         (-[WebPlaybackControlsManager setLegibleMediaSelectionOptions:withSelectedIndex:]): Deleted.
2281         (WebCore::WebPlaybackSessionInterfaceMac::playBackControlsManager): Deleted.
2282
2283 2016-04-29  Commit Queue  <commit-queue@webkit.org>
2284
2285         Unreviewed, rolling out r200232.
2286         https://bugs.webkit.org/show_bug.cgi?id=157189
2287
2288         This change broke the Mac CMake build and its LayoutTest is
2289         failing and/or flaky on all platforms (Requested by ryanhaddad
2290         on #webkit).
2291
2292         Reverted changeset:
2293
2294         "Move ResourceTiming behind a runtime flag"
2295         https://bugs.webkit.org/show_bug.cgi?id=157133
2296         http://trac.webkit.org/changeset/200232
2297
2298 2016-04-29  Jeremy Huddleston Sequoia  <jeremyhu@apple.com>
2299
2300         [GTK] Fix build failure introduced by r199738
2301         https://bugs.webkit.org/show_bug.cgi?id=157182
2302
2303         Reviewed by Alex Christensen.
2304
2305         * CMakeLists.txt:
2306
2307 2016-04-29  Brady Eidson  <beidson@apple.com>
2308
2309         Add a default ".isolatedCopy()" specialization to CrossThreadCopier, and other small cleanup.
2310         https://bugs.webkit.org/show_bug.cgi?id=157185
2311
2312         Reviewed by Anders Carlsson.
2313
2314         No new tests (Code cleanup, no change in behavior).
2315
2316         * platform/CrossThreadCopier.cpp:
2317         (WebCore::IndexedDB::TransactionMode>::copy): Deleted.
2318         (WebCore::IndexedDB::CursorDirection>::copy): Deleted.
2319         (WebCore::IndexedDB::CursorType>::copy): Deleted.
2320         (WebCore::IDBGetResult>::copy): Deleted.
2321         (WebCore::IDBKeyData>::copy): Deleted.
2322         (WebCore::IDBKeyRangeData>::copy): Deleted.
2323         (WebCore::IDBDatabaseInfo>::copy): Deleted.
2324         (WebCore::IDBDatabaseIdentifier>::copy): Deleted.
2325         (WebCore::IDBTransactionInfo>::copy): Deleted.
2326         (WebCore::IDBResourceIdentifier>::copy): Deleted.
2327         (WebCore::IDBError>::copy): Deleted.
2328         (WebCore::IDBObjectStoreInfo>::copy): Deleted.
2329         (WebCore::IDBIndexInfo>::copy): Deleted.
2330         (WebCore::IDBCursorInfo>::copy): Deleted.
2331         (WebCore::IDBValue>::copy): Deleted.
2332
2333         * platform/CrossThreadCopier.h:
2334         (WebCore::AllowCrossThreadAccessWrapper::AllowCrossThreadAccessWrapper): Deleted dead code.
2335         (WebCore::AllowCrossThreadAccessWrapper::value): Deleted dead code.
2336         (WebCore::AllowCrossThreadAccess): Deleted dead code.
2337         (WebCore::AllowAccessLaterWrapper::AllowAccessLaterWrapper): Deleted dead code.
2338         (WebCore::AllowAccessLaterWrapper::value): Deleted dead code.
2339         (WebCore::AllowAccessLater): Deleted dead code.
2340
2341 2016-04-29  Simon Fraser  <simon.fraser@apple.com>
2342
2343         Wheel Event Not Fired For `body,html { height:100% }`
2344         https://bugs.webkit.org/show_bug.cgi?id=148450
2345
2346         Reviewed by Brent Fulgham.
2347         
2348         EventHandler::handleWheelEvent() didn't pass the Active flag in the HitTestRequest,
2349         which causes code in RenderLayer::hitTest() to fail to fall back to returning the
2350         root layer if no other element is hit. "Active" is in the default flags,
2351         so just create the HitTestRequest with the default flags.
2352
2353         Test: fast/events/wheel-event-outside-body.html
2354
2355         * page/EventHandler.cpp:
2356         (WebCore::EventHandler::handleWheelEvent):
2357
2358 2016-04-29  Chris Dumez  <cdumez@apple.com>
2359
2360         [Web IDL] Specify default values for optional parameters of wrapper types
2361         https://bugs.webkit.org/show_bug.cgi?id=157161
2362
2363         Reviewed by Darin Adler.
2364
2365         Specify default values for optional parameters of wrapper types.
2366
2367         * Modules/indexeddb/IDBIndex.cpp:
2368         (WebCore::IDBIndex::count): Deleted.
2369         * Modules/indexeddb/IDBIndex.h:
2370         * Modules/indexeddb/IDBIndex.idl:
2371         * Modules/indexeddb/IDBObjectStore.cpp:
2372         (WebCore::IDBObjectStore::count): Deleted.
2373         * Modules/indexeddb/IDBObjectStore.h:
2374         * Modules/indexeddb/IDBObjectStore.idl:
2375         * Modules/mediastream/RTCPeerConnection.cpp:
2376         (WebCore::RTCPeerConnection::createDataChannel): Deleted.
2377         * Modules/mediastream/RTCPeerConnection.h:
2378         * Modules/mediastream/RTCPeerConnection.idl:
2379
2380         * bindings/scripts/CodeGeneratorJS.pm:
2381         (WillConvertUndefinedToDefaultParameterValue):
2382         Optimization to avoid generating a ternary if the default
2383         value of a wrapper type parameter is null, since undefined
2384         will already convert to null for those.
2385
2386         (GenerateParametersCheck):
2387         Use null as implicit default value for nullable parameters, given that Web IDL
2388         converts undefined to null for such parameters:
2389         http://heycam.github.io/webidl/#es-nullable-type
2390
2391         (CanUseWTFOptionalForParameter):
2392         Drop the check for wrapper types.
2393
2394         * bindings/scripts/test/*:
2395         Improve bindings tests coverage / rebaseline.
2396
2397         * css/MediaQueryList.idl:
2398         * css/MediaQueryListListener.idl:
2399         * dom/Document.idl:
2400
2401         * html/canvas/DOMPath.idl:
2402         The previous syntax was working because the bindings was generating an early
2403         return if addPath() was called with only one parameter, calling the
2404         implementation method with only 1 parameter. However, since we no longer
2405         generate early returns for optional parameters, we now have to use a slightly
2406         different syntax to maintain the previous behavior. This is only temporary,
2407         I just did not want to deal with SVG tear off types in this patch since they
2408         are very special in the bindings generator.
2409
2410         * page/DOMSelection.idl:
2411         The node parameter to extend() was confusingly marked as optional. However,
2412         when omitted, it would get translated into null, which would throw an
2413         exception since the type is not nullable. Since the specification says 'node'
2414         should not be optional, and since there is no behavior change, I dropped
2415         the 'optional'. The only web-exposed difference is the message provided with
2416         the TypeError that is thrown when called without enough parameters. The new
2417         message is more accurate (see rebaselined layout test).
2418
2419         * svg/SVGMarkerElement.idl:
2420         The parameter for setOrientToAngle() was confusingly marked as optional and
2421         having a default value of null. However, the bindings would throw a TypeError
2422         if called with no parameters or when calling it with null. This is because
2423         this is an SVG Tear off type and the bindings always throw when passing null
2424         for an SVG Tear off type. I therefore updated the IDL to reflect the actual
2425         behavior (no actual behavior change). The new IDL also now matches the spec:
2426         http://www.w3.org/TR/SVG2/painting.html#InterfaceSVGMarkerElement
2427
2428         * svg/SVGSVGElement.idl:
2429         Same comments as for SVGMarkerElement. The new IDL matches the actual
2430         behavior and is closer to the specification. I added FIXME comments for when
2431         it does not match the specification:
2432         http://www.w3.org/TR/SVG2/struct.html#InterfaceSVGSVGElement
2433         I did not change web-exposed behavior in this patch.
2434
2435         * svg/SVGTextContentElement.idl:
2436         Same as above. No actual behavior change.
2437
2438         * testing/Internals.cpp:
2439         * testing/Internals.h:
2440         * testing/Internals.idl:
2441         * xml/XPathEvaluator.idl:
2442
2443 2016-04-29  Joanmarie Diggs  <jdiggs@igalia.com>
2444
2445         [ATK] Expose the value of aria-roledescription via an AtkObject attribute
2446         https://bugs.webkit.org/show_bug.cgi?id=146719
2447
2448         Reviewed by Chris Fleizach.
2449
2450         The author-provided value is now exposed via an AtkObject attribute.
2451
2452         Implementation is already covered by aria-roledescription.html. The ATK
2453         expectations are slightly different than those for AX API because falling
2454         back on the default role description is done by assistive technologies.
2455         That this fall back is needed is identified by the lack of an author-
2456         provided value. Thus we do not wish to expose the default role description
2457         in our implementation.
2458
2459         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2460         (webkitAccessibleGetAttributes):
2461
2462 2016-04-29  Joanmarie Diggs  <jdiggs@igalia.com>
2463
2464         [ATK] accessibility/aria-current-global-attribute.html has been failed since r198303
2465         https://bugs.webkit.org/show_bug.cgi?id=155935
2466
2467         Reviewed by Chris Fleizach.
2468
2469         In ATK, the text of span elements is typically exposed through the parent
2470         element, unless the span has some attribute requiring inclusion in the
2471         accessibility tree. We were not checking for the presence of global ARIA
2472         attributes (including aria-current), other than describedby and role.
2473         The fix is to also check AccessibilityObject::supportsARIAAttributes().
2474
2475         No new tests. This issue was caught as a result of a failing test.
2476
2477         * accessibility/atk/AccessibilityObjectAtk.cpp:
2478         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
2479
2480 2016-04-29  Chris Dumez  <cdumez@apple.com>
2481
2482         [Web IDL] Drop 'any' type handling from CanUseWTFOptionalForParameter()
2483         https://bugs.webkit.org/show_bug.cgi?id=157152
2484
2485         Reviewed by Darin Adler.
2486
2487         Drop 'any' type handling from CanUseWTFOptionalForParameter(). Always
2488         use undefined as default value for parameters of type 'any' unless
2489         specified otherwise.
2490
2491         * Modules/indexeddb/IDBCursor.cpp:
2492         (WebCore::IDBCursor::continueFunction): Deleted.
2493         * Modules/indexeddb/IDBCursor.h:
2494         * Modules/indexeddb/IDBObjectStore.cpp:
2495         (WebCore::IDBObjectStore::add): Deleted.
2496         (WebCore::IDBObjectStore::putOrAdd): Deleted.
2497         * Modules/indexeddb/IDBObjectStore.h:
2498         * bindings/scripts/CodeGeneratorJS.pm:
2499
2500         (WillConvertUndefinedToDefaultParameterValue):
2501         Fix optimization for optional DOMString attributes whose default value
2502         is the string "undefined". I also added bindings test coverage for it.
2503
2504         (GenerateParametersCheck):
2505         (CanUseWTFOptionalForParameter): Deleted.
2506         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
2507         (webkit_dom_test_obj_method_with_optional_string_is_undefined):
2508         (webkit_dom_test_obj_method_with_optional_any):
2509         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
2510         * bindings/scripts/test/JS/JSTestObj.cpp:
2511         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefined):
2512         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAny):
2513         * bindings/scripts/test/ObjC/DOMTestObj.h:
2514         * bindings/scripts/test/ObjC/DOMTestObj.mm:
2515         (-[DOMTestObj methodWithOptionalStringIsUndefined:]):
2516         (-[DOMTestObj methodWithOptionalAny:]):
2517         * bindings/scripts/test/TestObj.idl:
2518         * testing/Internals.h:
2519
2520 2016-04-29  Joanmarie Diggs  <jdiggs@igalia.com>
2521
2522         AX: [ATK] Expose elements with ARIA's "text" role
2523         https://bugs.webkit.org/show_bug.cgi?id=157160
2524
2525         Reviewed by Chris Fleizach.
2526
2527         WebCore Accessibility's StaticTextRole is used for exposed RenderText
2528         objects and for the ARIA "text" role. The former should be folded into
2529         the parent element; the latter should not be, but was. Now we check to
2530         see which type we have when building the accessibility tree. Also map
2531         the "text" role to ATK_ROLE_STATIC.
2532
2533         We already have sufficient test coverage. Three previously-failing tests
2534         are now passing.
2535
2536         * accessibility/atk/AccessibilityObjectAtk.cpp:
2537         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
2538         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2539         (atkRole):
2540
2541 2016-04-29  Carlos Garcia Campos  <cgarcia@igalia.com>
2542
2543         [FreeType] ASSERTION FAILED: !lookupForWriting(Extractor::extract(entry)).second in FontCache::getVerticalData()
2544         https://bugs.webkit.org/show_bug.cgi?id=157132
2545
2546         Reviewed by Darin Adler.
2547
2548         I've noticed that some tests fail randomly in the GTK+ debug bot due to an assertion in HashMap when getting
2549         vertical data from the FontCache. I don't know exactly what's wrong, but looks like a problem with the
2550         FontVerticalDataCache hash traits implementation. Looking at the code, I've realized that we could simplify
2551         everything by reusing the FontDataCache hash and traits, since we are actually using the
2552         FontPlatformData::hash() in the end in both cases. Also, I don't see why we need to get the vertical data from
2553         the FontPlatformData while it's actually cached by the font cache. We could just use the FontCache directly
2554         passing only the FontPlatformData. These changes seem to fix the crashes and make the code a lot simpler.
2555
2556         * platform/graphics/Font.cpp:
2557         (WebCore::Font::Font): Use FontCache::verticalData().
2558         * platform/graphics/FontCache.cpp:
2559         (WebCore::fontVerticalDataCache):
2560         (WebCore::FontCache::verticalData):
2561         (WebCore::FontCache::purgeInactiveFontData): Also remove the cached vertical data when removing a font.
2562         (WebCore::FontCache::invalidate): Clear also the vertical data.
2563         * platform/graphics/FontCache.h:
2564         * platform/graphics/FontPlatformData.h:
2565         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
2566         (WebCore::FontPlatformData::openTypeTable): Deleted.
2567         * platform/graphics/opentype/OpenTypeVerticalData.h: Remove the m_inFontCache member that is now unused.
2568
2569 2016-04-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2570
2571         Remove UsePointersEvenForNonNullableObjectArguments keyword
2572         https://bugs.webkit.org/show_bug.cgi?id=156844
2573
2574         Reviewed by Darin Adler.
2575
2576         No change of behavior.
2577
2578         * bindings/scripts/CodeGenerator.pm:
2579         (ShouldPassWrapperByReference): Removed UsePointersEvenForNonNullableObjectArguments support.
2580         * bindings/scripts/IDLAttributes.txt: Removed UsePointersEvenForNonNullableObjectArguments.
2581
2582 2016-04-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2583
2584         FetchResponse should return a ReadableStream even if disturbed
2585         https://bugs.webkit.org/show_bug.cgi?id=156911
2586
2587         Reviewed by Darin Adler.
2588
2589         Covered by rebased test.
2590
2591         * Modules/fetch/FetchResponse.cpp:
2592         (WebCore::FetchResponse::createReadableStreamSource): Asserting in case response is disturbed.
2593         * bindings/js/JSFetchResponseCustom.cpp:
2594         (WebCore::JSFetchResponse::body): Creating a locked empty readable stream if response is disturbed.
2595         * bindings/js/ReadableStreamController.cpp:
2596         (WebCore::createReadableStream): Constructing a readable stream even if source is null.
2597         (WebCore::getReadableStreamReader): Retrieving the reader from a readable stream. Stream must not be locked.
2598         * bindings/js/ReadableStreamController.h:
2599
2600 2016-04-29  Yoav Weiss  <yoav@yoav.ws>
2601
2602         Move ResourceTiming behind a runtime flag
2603         https://bugs.webkit.org/show_bug.cgi?id=157133
2604
2605         Reviewed by Alex Christensen.
2606
2607         Move the ResourceTiming API from being behind a build time flag to be behind an
2608         off-by-default runtime flag, that can be turned on using internals.
2609
2610         Tests: fast/dom/Window/window-properties-performance-resource-timing.html
2611                http/tests/performance/performance-resource-timing-entries.html
2612
2613         * DerivedSources.make: Added idl files for PerformanceEntry, PerformanceEntryList and PerformanceResourceTiming.
2614         * WebCore.xcodeproj/project.pbxproj: Added the various Performance* files to the project.
2615         * bindings/generic/RuntimeEnabledFeatures.cpp: Added ResourceTiming as a runtime flag.
2616         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
2617         * bindings/generic/RuntimeEnabledFeatures.h: Added ResourceTiming as a runtime flag.
2618         (WebCore::RuntimeEnabledFeatures::setResourceTimingEnabled):
2619         (WebCore::RuntimeEnabledFeatures::resourceTimingEnabled):
2620         * bindings/js/JSPerformanceEntryCustom.cpp: Removed #if for ResourceTiming. Added build flag around UserTiming related h files.
2621         (WebCore::toJS): Deleted.
2622         * dom/EventNames.h: Renamed webkitresourcetimingbufferfull to resourcetimingbufferfull.
2623         * loader/DocumentThreadableLoader.cpp: Replace #if for ResourceTiming with runtime flag.
2624         (WebCore::DocumentThreadableLoader::loadRequest):
2625         * loader/ResourceLoadNotifier.cpp: Replace #if for ResourceTiming with runtime flag.
2626         (WebCore::ResourceLoadNotifier::dispatchWillSendRequest):
2627         * loader/cache/CachedResourceLoader.cpp: Replace #if for ResourceTiming with runtime flag.
2628         (WebCore::CachedResourceLoader::revalidateResource):
2629         (WebCore::CachedResourceLoader::loadResource):
2630         (WebCore::CachedResourceLoader::storeResourceTimingInitiatorInformation):
2631         (WebCore::CachedResourceLoader::loadDone):
2632         * loader/cache/CachedResourceLoader.h: Remove #if for ResourceTiming.
2633         * page/Performance.cpp: Remove #if for ResourceTiming.
2634         (WebCore::Performance::Performance): Removed #if for ResourceTiming related initialization.
2635         (WebCore::Performance::webkitGetEntries): Renamed to getEntries.
2636         (WebCore::Performance::webkitGetEntriesByType): Renamed to getEntriesByType.
2637         (WebCore::Performance::webkitGetEntriesByName): Renamed to getEntriesByName.
2638         * page/Performance.h: Remove #if for ResourceTiming.
2639         * page/Performance.idl: Replace #if for ResourceTiming with runtime flag.
2640         * page/PerformanceEntry.cpp: Remove the PERFORMANCE_TIMELINE build flag.
2641         * page/PerformanceEntry.h: Remove the PERFORMANCE_TIMELINE build flag.
2642         * page/PerformanceEntry.idl: Replace the PERFORMANCE_TIMELINE build flag with runtime flag.
2643         * page/PerformanceEntryList.cpp: Remove the PERFORMANCE_TIMELINE build flag.
2644         * page/PerformanceEntryList.h: Remove the PERFORMANCE_TIMELINE build flag.
2645         * page/PerformanceEntryList.idl: Replace the PERFORMANCE_TIMELINE build flag with runtime flag.
2646         * page/PerformanceResourceTiming.cpp: Remove the RESOURCE_TIMING build flag.
2647         * page/PerformanceResourceTiming.h: Remove the RESOURCE_TIMING build flag.
2648         * page/PerformanceResourceTiming.idl: Replace the RESOURCE_TIMING build flag with runtime flag.
2649         * testing/Internals.cpp: Add a method that enables ResourceTiming.
2650         (WebCore::Internals::setResourceTimingSupport):
2651         * testing/Internals.h: Add a method that enables ResourceTiming.
2652         * testing/Internals.idl: Add a method that enables ResourceTiming.
2653
2654 2016-04-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2655
2656         Drop [UsePointersEvenForNonNullableObjectArguments] from MediaStream interfaces
2657         https://bugs.webkit.org/show_bug.cgi?id=156905
2658
2659         Reviewed by Darin Adler.
2660
2661         Removing UsePointersEvenForNonNullableObjectArguments from MediaStream, RTCPeerConnection and RTCRtpSender.
2662         Updating methods to take references and making some related refactoring.
2663
2664         Test: fast/mediastream/MediaStream-add-remove-null-undefined-tracks.html
2665         Changes also covered by updated tests.
2666
2667         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
2668         (WebCore::MediaEndpointPeerConnection::createOfferTask):
2669         * Modules/mediastream/MediaStream.cpp:
2670         (WebCore::MediaStream::create):
2671         (WebCore::MediaStream::addTrack):
2672         (WebCore::MediaStream::removeTrack):
2673         (WebCore::MediaStream::didAddTrack):
2674         (WebCore::MediaStream::didRemoveTrack):
2675         (WebCore::MediaStream::internalAddTrack):
2676         (WebCore::MediaStream::internalRemoveTrack):
2677         * Modules/mediastream/MediaStream.h:
2678         * Modules/mediastream/MediaStream.idl:
2679         * Modules/mediastream/RTCDataChannel.cpp:
2680         (WebCore::RTCDataChannel::send):
2681         * Modules/mediastream/RTCDataChannel.h:
2682         * Modules/mediastream/RTCDataChannel.idl:
2683         * Modules/mediastream/RTCPeerConnection.cpp:
2684         (WebCore::RTCPeerConnection::addTrack):
2685         (WebCore::RTCPeerConnection::removeTrack):
2686         (WebCore::RTCPeerConnection::queuedSetLocalDescription):
2687         (WebCore::RTCPeerConnection::queuedSetRemoteDescription):
2688         (WebCore::RTCPeerConnection::queuedAddIceCandidate):
2689         (WebCore::RTCPeerConnection::privateGetStats):
2690         (WebCore::RTCPeerConnection::queuedCreateOffer): Deleted.
2691         (WebCore::RTCPeerConnection::localDescription): Deleted.
2692         (WebCore::RTCPeerConnection::currentLocalDescription): Deleted.
2693         (WebCore::RTCPeerConnection::remoteDescription): Deleted.
2694         (WebCore::RTCPeerConnection::currentRemoteDescription): Deleted.
2695         (WebCore::RTCPeerConnection::signalingState): Deleted.
2696         (WebCore::RTCPeerConnection::createDataChannel): Deleted.
2697         (WebCore::RTCPeerConnection::close): Deleted.
2698         * Modules/mediastream/RTCPeerConnection.h:
2699         * Modules/mediastream/RTCPeerConnection.idl:
2700         * Modules/mediastream/RTCRtpReceiver.cpp:
2701         (WebCore::RTCRtpReceiver::RTCRtpReceiver):
2702         * Modules/mediastream/RTCRtpReceiver.h:
2703         (WebCore::RTCRtpReceiver::create):
2704         * Modules/mediastream/RTCRtpSender.cpp:
2705         (WebCore::RTCRtpSender::RTCRtpSender):
2706         (WebCore::RTCRtpSender::replaceTrack):
2707         * Modules/mediastream/RTCRtpSender.h:
2708         (WebCore::RTCRtpSender::create):
2709         * Modules/mediastream/RTCRtpSender.idl:
2710         * Modules/mediastream/RTCRtpSenderReceiverBase.h:
2711         (WebCore::RTCRtpSenderReceiverBase::track):
2712         (WebCore::RTCRtpSenderReceiverBase::RTCRtpSenderReceiverBase):
2713
2714 2016-04-28  Daniel Bates  <dabates@apple.com>
2715
2716         Remove extraneous space characters from parameter list for RenderListBox::paintItem()
2717         that were added in r200190 (https://bugs.webkit.org/show_bug.cgi?id=157117).
2718
2719         * rendering/RenderListBox.h:
2720
2721 2016-04-28  Joanmarie Diggs  <jdiggs@igalia.com>
2722
2723         AX: [ATK] Expose subscript and superscript format style groups using ATK_ROLE_SUBSCRIPT and ATK_ROLE_SUPERSCRIPT
2724         https://bugs.webkit.org/show_bug.cgi?id=157158
2725
2726         Reviewed by Chris Fleizach.
2727
2728         r200214 caused the sup and sub elements to be exposed as ATK_ROLE_STATIC.
2729         While this exposure is much better than folding the text into the parent
2730         element, ATK has roles for subscript and superscript, so use them instead.
2731
2732         The roles-exposed.html and roles-computedRoleString.html tests were updated
2733         to reflect the new behavior.
2734
2735         * accessibility/AccessibilityObject.cpp:
2736         (WebCore::AccessibilityObject::isSubscriptStyleGroup):
2737         (WebCore::AccessibilityObject::isSuperscriptStyleGroup):
2738         * accessibility/AccessibilityObject.h:
2739         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2740         (atkRole):
2741
2742 2016-04-28  Zalan Bujtas  <zalan@apple.com>
2743
2744         Content disappears on mouse over.
2745         https://bugs.webkit.org/show_bug.cgi?id=157073
2746         <rdar://problem/24389168>
2747
2748         Reviewed by Simon Fraser.
2749
2750         When a redundant inlinebox is found after constructing the line, we remove it from the tree.
2751         The remove operation marks the ancestor tree dirty (and this newly constructed line is supposed to be clean).
2752         This patch resets this dirty flag on the boxes all the way up to the rootlinebox.
2753         Previously we only cleared the rootinlinebox and we ended up with dirty inlineflowboxes.
2754
2755         Test: fast/text/text-node-remains-dirty-after-calling-surroundContents.html
2756
2757         * rendering/BidiRun.h:
2758         (WebCore::BidiRun::setBox):
2759         * rendering/RenderBlockFlow.h:
2760         * rendering/RenderBlockLineLayout.cpp:
2761         (WebCore::RenderBlockFlow::constructLine):
2762         (WebCore::RenderBlockFlow::removeLineBoxIfNeeded):
2763         (WebCore::RenderBlockFlow::computeBlockDirectionPositionsForLine):
2764         * rendering/RenderBox.cpp:
2765         (WebCore::RenderBox::positionLineBox): Deleted.
2766         * rendering/RenderText.cpp:
2767         (WebCore::RenderText::setText):
2768         (WebCore::RenderText::positionLineBox): Deleted.
2769
2770 2016-04-28  John Wilander  <wilander@apple.com>
2771
2772         Allow non-standard HTTP headers in WebSocket handshake
2773         https://bugs.webkit.org/show_bug.cgi?id=157157
2774
2775         Reviewed by Brent Fulgham.
2776
2777         No new tests since https://bugs.webkit.org/show_bug.cgi?id=157095
2778         tests that non-standard headers are allowed.
2779
2780         * Modules/websockets/WebSocketHandshake.cpp:
2781         (WebCore::WebSocketHandshake::readHTTPHeaders):
2782             Changed from fail to allow for unrecognized headers.
2783             This was the behavior before https://bugs.webkit.org/show_bug.cgi?id=155602.
2784         * platform/network/HTTPHeaderNames.in:
2785             Removed whitelisted legacy headers since we now allow all non-standard headers.
2786
2787 2016-04-27  Brent Fulgham  <bfulgham@apple.com>
2788
2789         Make sure we don't mishandle HTMLFrameOwnerElement lifecycle
2790         https://bugs.webkit.org/show_bug.cgi?id=157040
2791
2792         Reviewed by Chris Dumez.
2793
2794         Protect a couple of sites where event handling could result in the owning frame
2795         being destroyed during execution.
2796
2797         Tested by fast/dom/HTMLAnchorElement/anchor-in-noscroll-iframe-crash.html.
2798
2799         * inspector/InspectorDOMAgent.cpp:
2800         (WebCore::InspectorDOMAgent::didCommitLoad):
2801         * rendering/RenderLayer.cpp:
2802         (WebCore::RenderLayer::scrollRectToVisible):
2803
2804 2016-04-28  Manuel Rego Casasnovas  <rego@igalia.com>
2805
2806         [css-grid] Add CSS Grid Layout runtime flag
2807         https://bugs.webkit.org/show_bug.cgi?id=157134
2808
2809         Reviewed by Simon Fraser.
2810
2811         Add CSS Grid Layout runtime flag enabled by default.
2812         Disable parsing of CSS Grid Layout properties
2813         if the runtime flag is not enabled.
2814         Expose runtime flag through internals to verify that
2815         it's working as expected.
2816
2817         Test: fast/css-grid-layout/grid-disable.html
2818
2819         * bindings/generic/RuntimeEnabledFeatures.cpp:
2820         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
2821         * bindings/generic/RuntimeEnabledFeatures.h:
2822         (WebCore::RuntimeEnabledFeatures::setCSSGridLayoutEnabled):
2823         (WebCore::RuntimeEnabledFeatures::isCSSGridLayoutEnabled):
2824         * css/CSSParser.cpp:
2825         (WebCore::CSSParserContext::CSSParserContext):
2826         (WebCore::operator==):
2827         (WebCore::isValidKeywordPropertyAndValue):
2828         (WebCore::CSSParser::parseValue):
2829         (WebCore::CSSParser::parseIntegerOrCustomIdentFromGridPosition):
2830         (WebCore::CSSParser::parseGridPosition):
2831         (WebCore::CSSParser::parseGridItemPositionShorthand):
2832         (WebCore::CSSParser::parseGridGapShorthand):
2833         (WebCore::CSSParser::parseGridTemplateColumns):
2834         (WebCore::CSSParser::parseGridTemplateRowsAndAreasAndColumns):
2835         (WebCore::CSSParser::parseGridTemplateShorthand):
2836         (WebCore::CSSParser::parseGridShorthand):
2837         (WebCore::CSSParser::parseGridAreaShorthand):
2838         (WebCore::CSSParser::parseSingleGridAreaLonghand):
2839         (WebCore::CSSParser::parseGridLineNames):
2840         (WebCore::CSSParser::parseGridTrackList):
2841         (WebCore::CSSParser::parseGridTrackRepeatFunction):
2842         (WebCore::CSSParser::parseGridTrackSize):
2843         (WebCore::CSSParser::parseGridBreadth):
2844         (WebCore::CSSParser::parseGridAutoFlow):
2845         (WebCore::CSSParser::parseGridTemplateAreasRow):
2846         (WebCore::CSSParser::parseGridTemplateAreas):
2847         (WebCore::CSSParser::iscSSGridLayoutEnabled):
2848         * css/CSSParser.h:
2849         * css/CSSParserMode.h:
2850         * dom/Document.cpp:
2851         (WebCore::Document::isCSSGridLayoutEnabled):
2852         * dom/Document.h:
2853         * testing/Internals.cpp:
2854         (WebCore::Internals::setCSSGridLayoutEnabled):
2855         * testing/Internals.h:
2856         * testing/Internals.idl:
2857
2858 2016-04-28  Chris Fleizach  <cfleizach@apple.com>
2859
2860         AX: superscript content exposed as plain text; VoiceOver does not speak or pause to make this understandable
2861         https://bugs.webkit.org/show_bug.cgi?id=157122
2862         <rdar://problem/21231487>
2863
2864         Reviewed by Daniel Bates.
2865
2866         Expose role types for subscript and superscript.
2867
2868         Modified: accessibility/mac/subroles-for-formatted-groups.html
2869
2870         * accessibility/AccessibilityObject.cpp:
2871         (WebCore::AccessibilityObject::isStyleFormatGroup):
2872         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2873         (-[WebAccessibilityObjectWrapper subrole]):
2874
2875 2016-04-28  Brady Eidson  <beidson@apple.com>
2876
2877         inspector/indexeddb/requestDatabaseNames.html is flaky on Mac.
2878         https://bugs.webkit.org/show_bug.cgi?id=157141
2879
2880         Reviewed by Alex Christensen.
2881
2882         Test: inspector/indexeddb/deleteDatabaseNamesWithSpace.html
2883
2884         * platform/FileSystem.cpp:
2885         (WebCore::decodeFromFilename): Advance iterator after decoding.
2886
2887 2016-04-28  Dan Bernstein  <mitz@apple.com>
2888
2889         <rdar://problem/25986324> WebKit build broken with error: undeclared selector 'childViewControllerForWhitePointAdaptivityStyle'
2890
2891         Fixed the build by removing use of API that no longer does anything.
2892
2893         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2894         (WebVideoFullscreenInterfaceAVKit::setupFullscreen): Revert to using a plain UIViewController.
2895         (createFullScreenVideoRootViewControllerClass): Deleted.
2896         (allocWebFullScreenVideoRootViewControllerInstance): Deleted.
2897
2898 2016-04-28  Brady Eidson  <beidson@apple.com>
2899
2900         Modern IDB: Reimplement Web Inspector code that was tied to Legacy IDB.
2901         https://bugs.webkit.org/show_bug.cgi?id=154686
2902
2903         Reviewed by Alex Christensen.
2904
2905         No new tests (Inspector folks will have to write them if they're possible).
2906
2907         * inspector/InspectorIndexedDBAgent.cpp: Reimplement missing functionality mostly with code that was 
2908           removed in http://trac.webkit.org/changeset/197131/trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp
2909
2910 2016-04-28  Daniel Bates  <dabates@apple.com>
2911
2912         Fix the Apple Internal OS X build
2913
2914         * platform/graphics/mac/PDFDocumentImageMac.mm:
2915         (WebCore::PDFDocumentImage::drawPDFPage): Ignore deprecation warning for -[PDFPage drawWithBox:].
2916
2917 2016-04-28  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2918
2919         Drop [UsePointersEvenForNonNullableObjectArguments] from MediaSource interfaces
2920         https://bugs.webkit.org/show_bug.cgi?id=156904
2921
2922         Reviewed by Darin Adler.
2923
2924         MediaSource::addSourceBuffer will now throw a TypeError if a null parameter is passed.
2925         MediaSource::removeSourceBuffer will now throw a TypeError if a null parameter is passed.
2926         SourceBuffer::appendBuffer will now throw a TypeError if a null parameter is passed.
2927
2928         Did some refactoring to use more references.
2929
2930         Covered by updated test.
2931
2932         * Modules/mediasource/MediaSource.cpp:
2933         (WebCore::MediaSource::endOfStream):
2934         (WebCore::MediaSource::addSourceBuffer):
2935         (WebCore::MediaSource::removeSourceBuffer):
2936         * Modules/mediasource/MediaSource.h:
2937         * Modules/mediasource/MediaSource.idl:
2938         * Modules/mediasource/SourceBuffer.cpp:
2939         (WebCore::SourceBuffer::appendBuffer):
2940         * Modules/mediasource/SourceBuffer.h:
2941         * Modules/mediasource/SourceBuffer.idl:
2942         * Modules/mediasource/SourceBufferList.cpp:
2943         (WebCore::SourceBufferList::add):
2944         (WebCore::SourceBufferList::remove):
2945         * Modules/mediasource/SourceBufferList.h:
2946
2947 2016-04-28  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2948
2949         Drop [UsePointersEvenForNonNullableObjectArguments] from Node
2950         https://bugs.webkit.org/show_bug.cgi?id=156978
2951
2952         Reviewed by Chris Dumez.
2953
2954         No change of behavior.
2955
2956         * dom/Node.idl: Marking some parameters nullable.
2957
2958 2016-04-27  Ada Chan  <adachan@apple.com>
2959
2960         Set overflow: hidden on ::-webkit-media-controls in mediaControlsApple.css
2961         https://bugs.webkit.org/show_bug.cgi?id=157110
2962
2963         Reviewed by Eric Carlson.
2964
2965         Test: fast/regions/inline-block-inside-anonymous-overflow-with-covered-controls.html
2966
2967         This matches what we do in mediaControlsiOS.css.
2968
2969         * Modules/mediacontrols/mediaControlsApple.css:
2970         (::-webkit-media-controls):
2971
2972 2016-04-28  Chris Dumez  <cdumez@apple.com>
2973
2974         [Web IDL] Specify default values for optional parameters of type 'DOMString'
2975         https://bugs.webkit.org/show_bug.cgi?id=157116
2976
2977         Reviewed by Darin Adler.
2978
2979         Specify default values for optional parameters of type 'DOMString' so
2980         that this default value is used if the parameter is either omitted or
2981         undefined. For parameters of type DOMString and that are not nullable,
2982         the bindings generator now uses the null string as implicit default
2983         value (unless explicitely specified otherwise in the IDL). This
2984         simplifies the IDL a little and makes it a bit less confusing (it is
2985         a bit weird to see something like "optional DOMString param = null",
2986         considering the parameter is not nullable). I also think it makes
2987         more sense to use the null String() rather than Optional<String> in
2988         this case.
2989
2990         No new tests, existing tests were rebaselined.
2991
2992         * Modules/encryptedmedia/MediaKeys.idl:
2993         * Modules/indexeddb/IDBDatabase.idl:
2994         * Modules/indexeddb/IDBIndex.h:
2995         * Modules/indexeddb/IDBIndex.idl:
2996         * Modules/indexeddb/IDBObjectStore.cpp:
2997         (WebCore::IDBObjectStore::openCursor): Deleted.
2998         * Modules/indexeddb/IDBObjectStore.h:
2999         * Modules/indexeddb/IDBObjectStore.idl:
3000         * Modules/speech/SpeechSynthesisUtterance.idl:
3001         * Modules/websockets/WebSocket.idl:
3002         * bindings/scripts/CodeGeneratorJS.pm:
3003         (GenerateParametersCheck):
3004         (CanUseWTFOptionalForParameter): Deleted.
3005         * bindings/scripts/test/JS/JSTestObj.cpp:
3006         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalString):
3007         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicString):
3008         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringAndDefaultValue): Deleted.
3009         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3010         (WebCore::jsTestTypedefsPrototypeFunctionSetShadow):
3011         * bindings/scripts/test/TestNamedConstructor.idl:
3012         * css/FontFaceSet.cpp:
3013         * css/FontFaceSet.h:
3014         * css/FontFaceSet.idl:
3015         * css/WebKitCSSMatrix.idl:
3016         * dom/Comment.idl:
3017         * dom/DOMImplementation.idl:
3018         * dom/DataTransfer.cpp:
3019         (WebCore::DataTransfer::clearData):
3020         (WebCore::DataTransfer::getData): Deleted.
3021         * dom/DataTransfer.h:
3022         * dom/Document.idl:
3023         * dom/Text.idl:
3024         * fileapi/FileReader.cpp:
3025         (WebCore::FileReader::readAsDataURL): Deleted.
3026         * fileapi/FileReader.h:
3027         * fileapi/FileReaderSync.h:
3028         * fileapi/FileReaderSync.idl:
3029         * html/HTMLAudioElement.idl:
3030         * html/HTMLInputElement.idl:
3031
3032         * html/HTMLMediaElement.cpp:
3033         (WebCore::HTMLMediaElement::addTextTrack):
3034         Throw a TypeError if the 'kind' parameter is not a valid string in the
3035         TextTrackKind enum:
3036         https://html.spec.whatwg.org/multipage/embedded-content.html#htmlmediaelement
3037
3038         We previously threw a SYNTAX_ERR instead of a TypeError in such case,
3039         which was not correct as per Web IDL specification.
3040
3041         * html/HTMLMediaElement.h:
3042         * html/HTMLMediaElement.idl:
3043         * html/HTMLOptionElement.idl:
3044         * html/HTMLTextAreaElement.idl:
3045         * html/canvas/CanvasRenderingContext2D.cpp:
3046         (WebCore::CanvasRenderingContext2D::setShadow):
3047         * html/canvas/CanvasRenderingContext2D.h:
3048         * page/Performance.idl:
3049
3050 2016-04-28  Antonio Gomes  <tonikitoo@webkit.org>
3051
3052         Factor out the "paint item" logic in RenderListBox into a helper
3053         https://bugs.webkit.org/show_bug.cgi?id=157117
3054
3055         Reviewed by Daniel Bates.
3056
3057         Patch factors out the duplicated painting logic in RenderListBox::paintObject()
3058         into a member function named paintItem.
3059
3060         This is in preparation for bug 156590.
3061         No new tests, since there is no behavior change.
3062
3063         * rendering/RenderListBox.cpp:
3064         (WebCore::RenderListBox::paintItem):
3065         (WebCore::RenderListBox::paintObject):
3066         * rendering/RenderListBox.h:
3067
3068 2016-04-28  Joanmarie Diggs  <jdiggs@igalia.com>
3069
3070         AX: [ATK] We need to be smarter about flattening and the accessible text implementation
3071         https://bugs.webkit.org/show_bug.cgi?id=144639
3072
3073         Reviewed by Chris Fleizach.
3074
3075         Defer to WebCore Accessibility more regarding when to include anonymous blocks in the
3076         accessibility tree. Explicitly flatten menu items, headings, list items, and paragraphs
3077         in order to preserve the expected platform behavior for backwards compatibility. Also
3078         map anonymous table parts to DivRole rather than GroupRole for GTK and EFL because ATK
3079         has separate roles for generic text block elements and other generic containers.
3080
3081         Tests: accessibility/gtk/nested-block-element-children.html
3082                accessibility/gtk/spans-paragraphs-and-divs-tree.html
3083
3084         * accessibility/AccessibilityRenderObject.cpp:
3085         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
3086         * accessibility/atk/AccessibilityObjectAtk.cpp:
3087         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
3088
3089 2016-04-28  Frederic Wang  <fred.wang@free.fr>
3090
3091         RenderMathMLOperator refactoring: introduce getBaseGlyph and remove parameter from getDisplayStyleLargeOperator
3092         https://bugs.webkit.org/show_bug.cgi?id=156910
3093
3094         Reviewed by Alejandro G. Castro.
3095
3096         No new tests, the behavior is not changed.
3097
3098         * rendering/mathml/RenderMathMLOperator.cpp:
3099         (WebCore::RenderMathMLOperator::italicCorrection): We do not need to pass m_textContent to
3100         getDisplayStyleLargeOperator.
3101         (WebCore::RenderMathMLOperator::computePreferredLogicalWidths): We use getBaseGlyph and do
3102         not pass m_textContent to getDisplayStyleLargeOperator or findStretchyData.
3103         (WebCore::RenderMathMLOperator::getBaseGlyph): Introduce a helper function to retrieve the
3104         base glyph and do some validity checks.
3105         (WebCore::RenderMathMLOperator::getDisplayStyleLargeOperator): We remove the character
3106         parameter as it is always m_textContent.
3107         We use getBaseGlyph and replace primaryFont with baseGlyph.font.
3108         (WebCore::RenderMathMLOperator::findStretchyData): Ditto.
3109         (WebCore::RenderMathMLOperator::updateStyle): We do not pass m_textContent to
3110         getDisplayStyleLargeOperator or findStretchyData.
3111         * rendering/mathml/RenderMathMLOperator.h: Declare getBaseGlyph and remove the parameter
3112         from getDisplayStyleLargeOperator and findStretchyData.
3113
3114 2016-04-28  Commit Queue  <commit-queue@webkit.org>
3115
3116         Unreviewed, rolling out r200185.
3117         https://bugs.webkit.org/show_bug.cgi?id=157131
3118
3119         Bad temporary file added unintentionally (Requested by fredw
3120         on #webkit).
3121
3122         Reverted changeset:
3123
3124         "RenderMathMLOperator refactoring: introduce getBaseGlyph and
3125         remove parameter from getDisplayStyleLargeOperator"
3126         https://bugs.webkit.org/show_bug.cgi?id=156910
3127         http://trac.webkit.org/changeset/200185
3128
3129 2016-04-28  Frederic Wang  <fred.wang@free.fr>
3130
3131         RenderMathMLOperator refactoring: introduce getBaseGlyph and remove parameter from getDisplayStyleLargeOperator
3132         https://bugs.webkit.org/show_bug.cgi?id=156910
3133
3134         Reviewed by Alejandro G. Castro.
3135
3136         No new tests, the behavior is not changed.
3137
3138         * rendering/mathml/RenderMathMLOperator.cpp:
3139         (WebCore::RenderMathMLOperator::italicCorrection): We do not need to pass m_textContent
3140         to getDisplayStyleLargeOperator.
3141         (WebCore::RenderMathMLOperator::computePreferredLogicalWidths): We use getBaseGlyph and do
3142         not pass m_textContent to getDisplayStyleLargeOperator or findStretchyData.
3143         (WebCore::RenderMathMLOperator::getBaseGlyph): Introduce a helper function to retrieve the
3144         base glyph and do some validity checks.
3145         (WebCore::RenderMathMLOperator::getDisplayStyleLargeOperator): We remove the character
3146         parameter as it is always m_textContent.
3147         We use getBaseGlyph and replace primaryFont with baseGlyph.font.
3148         (WebCore::RenderMathMLOperator::findStretchyData): Ditto.
3149         (WebCore::RenderMathMLOperator::updateStyle): We do not pass m_textContent to
3150         getDisplayStyleLargeOperator or findStretchyData.
3151         * rendering/mathml/RenderMathMLOperator.h: Declare getBaseGlyph and remove the parameter
3152         from getDisplayStyleLargeOperator and findStretchyData.
3153
3154 2016-04-28  Carlos Garcia Campos  <cgarcia@igalia.com>
3155
3156         REGRESSION(r199659): Web Process crash when RenderTheme::adjustMenuListStyle is called with a null element
3157         https://bugs.webkit.org/show_bug.cgi?id=157127
3158
3159         Reviewed by Sergio Villar Senin.
3160
3161         This happens for example with tests fast/css/appearance-with-pseudo-elements-in-quirks-mode.html and
3162         fast/css/appearance-with-pseudo-elements.html.
3163
3164         * rendering/RenderThemeGtk.cpp:
3165         (WebCore::RenderThemeGtk::adjustMenuListStyle): Do not change the style color if the given element is nullptr.
3166
3167 2016-04-28  Sergio Villar Senin  <svillar@igalia.com>
3168
3169         [css-grid] Store auto-repeat information in style
3170         https://bugs.webkit.org/show_bug.cgi?id=157097
3171
3172         Reviewed by Darin Adler.
3173
3174         This is the second step to implement auto-repeat. This patch provides the necessary
3175         machinery to store the auto-repeat data extracted by the parser in the RenderStyle class. We
3176         are not doing anything with that information yet, it will be used later to compute the
3177         number of auto-repeat tracks in a follow up patch.
3178
3179         No new tests required as there is no change in behavior yet (we're just storing the info we
3180         already get from the parser).
3181
3182         * css/CSSComputedStyleDeclaration.cpp:
3183         (WebCore::valueForGridTrackList): Check also that the auto-repeat list of tracks is empty.
3184         * css/StyleBuilderConverter.h:
3185         (WebCore::createGridLineNamesList): Refactored from createGridTrackList.
3186         (WebCore::StyleBuilderConverter::createGridTrackList): Extract auto-repeat data from the
3187         parser. Also gathered all the out arguments in a single new struct called TracksData.
3188         * css/StyleBuilderCustom.h: Added new macro SET_TRACKS_DATA which properly sets the info
3189         from TracksData struct into style.
3190         (WebCore::StyleBuilderCustom::applyValueWebkitGridTemplateColumns): Store auto-repeat data
3191         in RenderStyle.
3192         (WebCore::StyleBuilderCustom::applyValueWebkitGridTemplateRows): Ditto.
3193         * rendering/style/RenderStyle.h: Add methods and attributes for auto-repeat data.
3194         * rendering/style/RenderStyleConstants.h: New AutoRepeatType enumerated type.
3195         * rendering/style/StyleGridData.cpp:
3196         (WebCore::StyleGridData::StyleGridData): Add auto-repeat data.
3197         * rendering/style/StyleGridData.h:
3198         (WebCore::StyleGridData::operator==): Check also auto-repeat data.
3199
3200 2016-04-28  Manuel Rego Casasnovas  <rego@igalia.com>
3201
3202         [css-grid] Fix alignment with content distribution
3203         https://bugs.webkit.org/show_bug.cgi?id=156623
3204
3205         Reviewed by Sergio Villar Senin.
3206
3207         We were only subtracting the distribution offset for items spanning
3208         several tracks, but not for items in a single cell.
3209         We should actually subtract the offset in that situation too,
3210         the same that we do for the grid gaps.
3211
3212         Test: fast/css-grid-layout/grid-content-alignment-and-self-alignment-spanning.html
3213
3214         * rendering/RenderGrid.cpp:
3215         (WebCore::RenderGrid::columnAxisOffsetForChild): Subtract distribution
3216         offset like we do for gaps.
3217         (WebCore::RenderGrid::rowAxisOffsetForChild): Ditto.
3218
3219 2016-04-27  Carlos Garcia Campos  <cgarcia@igalia.com>
3220
3221         [GTK] Overlay scrollbars with steppers enabled render incorrectly
3222         https://bugs.webkit.org/show_bug.cgi?id=156988
3223
3224         Reviewed by Michael Catanzaro.
3225
3226         Fix rendering of scrollbars when using GTK+ themes having stepper buttons.
3227
3228         * platform/gtk/RenderThemeGadget.cpp:
3229         (WebCore::RenderThemeBoxGadget::RenderThemeBoxGadget): Receive the box orientation as constructor parameter.
3230         (WebCore::RenderThemeBoxGadget::preferredSize): Fix the preferred size calculation taking into account the box orientation.
3231         (WebCore::RenderThemeScrollbarGadget::renderStepper): New method to render scrollbar steppers.
3232         * platform/gtk/RenderThemeGadget.h:
3233         (WebCore::RenderThemeGadget::context): Make this public instead of protected.
3234         * platform/gtk/ScrollAnimatorGtk.cpp:
3235         (WebCore::ScrollAnimatorGtk::updateOverlayScrollbarsOpacity): Invalidate the whole scrollbars instead of just
3236         the thumb when opacity changes, because themes can actually render the trough or even stepper buttons when in
3237         indicator mode too.
3238         * platform/gtk/ScrollbarThemeGtk.cpp:
3239         (WebCore::ScrollbarThemeGtk::hasButtons): Properly implement this method instead of returning true unconditionally.
3240         (WebCore::contentsGadgetForLayout): Pass orientation to RenderThemeBoxGadget constructor.
3241         (WebCore::ScrollbarThemeGtk::trackRect): Fix the calculation of the track rect taking stepper buttons into account.
3242         (WebCore::ScrollbarThemeGtk::backButtonRect): Fix the calculation of the stepper button rectangle.
3243         (WebCore::ScrollbarThemeGtk::forwardButtonRect): Ditto.
3244         (WebCore::ScrollbarThemeGtk::paint): Use RenderThemeScrollbarGadget::renderStepper() to render the stepper
3245         buttons, and fix the calculation of the steppers button rectangle.
3246         (WebCore::ScrollbarThemeGtk::handleMousePressEvent): Handle clicks on stepper buttons.
3247         (WebCore::ScrollbarThemeGtk::scrollbarThickness): Fix the calculation of the scrollbar thickness.
3248         (WebCore::ScrollbarThemeGtk::minimumThumbLength): Pass orientation to RenderThemeBoxGadget constructor.
3249         * platform/gtk/ScrollbarThemeGtk.h:
3250         * rendering/RenderThemeGtk.cpp:
3251         (WebCore::menuListColor): Ditto.
3252         (WebCore::RenderThemeGtk::popupInternalPaddingBox): Ditto.
3253         (WebCore::RenderThemeGtk::paintMenuList): Ditto.
3254
3255 2016-04-27  Simon Fraser  <simon.fraser@apple.com>
3256
3257         SVG SMIL animations run at less than 60fps
3258         https://bugs.webkit.org/show_bug.cgi?id=157119
3259         rdar://problem/25971304
3260
3261         Reviewed by Tim Horton.
3262         
3263         If you re-fetch current time while doing animation computations you're gonna have
3264         a bad time.
3265         
3266         More specifically, SMILTimeContainer::startTimer() re-fetched elapsedTime() when
3267         computing the delay for the next timer fire, then clamped to 16.667ms, so the timer
3268         would actually be scheduled at intervals greater than desired, causing a ~54fps framerate.
3269         
3270         Fix by using the elapsedTime fetched at the start of animation processing.
3271
3272         Tested by iOS content-animation performance tests.
3273
3274         * svg/SVGSVGElement.cpp:
3275         (WebCore::SVGSVGElement::SVGSVGElement): Just cleanup.
3276         * svg/animation/SMILTimeContainer.cpp:
3277         (WebCore::SMILTimeContainer::notifyIntervalsChanged):
3278         (WebCore::SMILTimeContainer::resume):
3279         (WebCore::SMILTimeContainer::startTimer):
3280         (WebCore::SMILTimeContainer::updateAnimations):
3281         * svg/animation/SMILTimeContainer.h:
3282
3283 2016-04-27  Brady Eidson  <beidson@apple.com>
3284
3285         Build fix followup to r200163
3286         
3287         Unreviewed.
3288
3289         * platform/efl/FileSystemEfl.cpp:
3290         (WebCore::stringFromFileSystemRepresentation): At least stub this out for now until EFL folks can do better.
3291
3292 2016-04-27  Saam barati  <sbarati@apple.com>
3293
3294         Move the implementation of Settings::globalConstRedeclarationShouldThrow into the cpp file
3295         https://bugs.webkit.org/show_bug.cgi?id=157109
3296
3297         Rubber-stamped by Geoffrey Garen.
3298
3299         * page/Settings.cpp:
3300         (WebCore::Settings::networkInterfaceName):
3301         (WebCore::Settings::globalConstRedeclarationShouldThrow):
3302         * page/Settings.h:
3303         (WebCore::Settings::shouldUseHighResolutionTimers):
3304         (WebCore::Settings::backgroundShouldExtendBeyondPage):
3305         (WebCore::Settings::globalConstRedeclarationShouldThrow): Deleted.
3306
3307 2016-04-27  Dean Jackson  <dino@apple.com>
3308
3309         RTL non-native <select> buttons should have arrows on the left
3310         https://bugs.webkit.org/show_bug.cgi?id=157112
3311         <rdar://problem/25894441>
3312
3313         Reviewed by Simon Fraser.
3314
3315         The <select> elements that are completely rendered by WebCore
3316         (i.e. not the native controls) always assumed that they
3317         were left-to-right.
3318
3319         This change allows the button to handle both directions,
3320         swapping the side the little arrows are rendered on, as
3321         well as the padding of the text label.
3322
3323         Test: fast/forms/select-non-native-rendering-direction.html
3324
3325         * rendering/RenderMenuList.cpp:
3326         (RenderMenuList::clientPaddingLeft): This must take into account
3327         the direction of the element.
3328         (RenderMenuList::clientPaddingRight): Ditto.
3329         * rendering/RenderThemeMac.mm: Change the left and right constants
3330         to use the terms before and after.
3331         (WebCore::RenderThemeMac::paintMenuListButtonDecorations): The left
3332         and right positions must take the direction into account, which
3333         means different calculations.
3334         (WebCore::RenderThemeMac::popupInternalPaddingBox): Similarly for
3335         the padding that is used to position the text label.
3336
3337 2016-04-27  Simon Fraser  <simon.fraser@apple.com>
3338
3339         CSS and SVG animations should run at 60fps
3340         https://bugs.webkit.org/show_bug.cgi?id=157113
3341         rdar://problem/24337280
3342         rdar://problem/24337328
3343
3344         Reviewed by Dean Jackson.
3345
3346         For both CSS and SVG animations we used a 0.025s frame interval, which translates to
3347         40fps. That caused these animations to look extra janky compared with accelerated
3348         animations.
3349
3350         So use a 16.667ms frame interval for both.
3351
3352         Tested by content-animation benchmark tests.
3353
3354         * page/animation/AnimationController.cpp:
3355         * svg/animation/SMILTime.h:
3356         * svg/animation/SMILTimeContainer.cpp:
3357         (WebCore::SMILTimeContainer::updateAnimations):
3358         * svg/animation/SVGSMILElement.cpp:
3359         (WebCore::SVGSMILElement::calculateNextProgressTime):
3360
3361 2016-04-27  Brady Eidson  <beidson@apple.com>
3362
3363         Modern IDB: Implement&