Scroll snapping on Mac should use AppKit animations
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-11-29  Wenson Hsieh  <wenson_hsieh@apple.com>
2
3         Scroll snapping on Mac should use AppKit animations
4         https://bugs.webkit.org/show_bug.cgi?id=147261
5         <rdar://problem/29395293>
6
7         Reviewed by Brent Fulgham.
8
9         Refactors the scroll snapping animation logic to support arbitrary scrolling momentum calculators and
10         introduces ScrollingMomentumCalculatorMac, which wraps AppKit's _NSScrollingMomentumCalculator. On macOS El
11         Capitan and later, we use the platform scrolling momentum calculator and for all other cases, we fall back to
12         the preexissting platform-invariant momentum calculator.
13
14         Previously, the scroll snapping animation logic was shared between the ScrollSnapAnimatorState and
15         ScrollController -- namely, the ScrollController would update various parameters of the ScrollSnapAnimatorState
16         and then tell it to compute animation-specific constants and coefficients. After this patch, ScrollController
17         will no longer directly set the ScrollSnapAnimatorState's member variables. Instead, it will tell the animator
18         state to transition to a new ScrollSnapState with the necessary parameters, and the ScrollSnapAnimatorState is
19         responsible for modifying itself accordingly. Furthermore, logic pertaining to computing animated scroll offsets
20         is now split out into a new ScrollingMomentumCalculator, which may have different platform-dependent
21         implementations. The correct calculator is initialized via ScrollingMomentumCalculator::create, which currently
22         returns a ScrollingMomentumCalculatorMac on El Capitan and later, and a BasicScrollingMomentumCalculator
23         otherwise.
24
25         The new abstracted ScrollingMomentumCalculator is initialized with various parameters describing the scrolled
26         content and viewport, as well as the initial and target scrolling offsets. The momentum calculator is then able
27         to compute the animated scroll offset at any given elapsed time, as well as the total duration of the snapping
28         animation. The ScrollController's scroll snap timer uses this information (via the ScrollSnapAnimatorState) to
29         animate its client's scroll offset during a snap or glide.
30
31         Also reenables 8 failing and/or flaky scroll snapping tests and adds a new layout test. This patch addresses
32         two causes for failures and flakiness in these scroll snapping tests:
33
34         1.  When starting or stopping the scroll snap animation timer, we call deferTestsForReason and
35             removeTestDeferralForReason, respectively. These were actually noops for the first simulated scroll gesture
36             on each of the failing mainframe scrolling tests due to m_expectsWheelEventTestTrigger being false. This
37             member variable is updated when AsyncScrollingCoordinator::frameViewLayoutUpdated is invoked, wherein we
38             call ScrollingStateFrameScrollingNode::setExpectsWheelEventTestTrigger(true) when the test has started
39             monitoring wheel events. However, if this does not happen before scrolling begins in the test (which is the
40             case here), then the mainframe scrolling node will not expect a wheel event test trigger even though
41             eventSender.monitorWheelEvents() has been called. To fix this, we simply make the Page trigger a layout of
42             the main FrameView when first ensuring the wheel event test trigger on the Page.
43
44         2.  The second reason for flakiness affects both overflow and mainframe scrolling. Previously, due to the way
45             we would wait for multiple momentum scroll events before starting to glide, we would end up starting the
46             scroll snap timer for a snapping animation, stopping it, and then starting it again for the glide animation.
47             Thus, if the wheel event test trigger's timer fires right after the scroll snap timer stops and before it
48             starts again due to a glide animation, it will erroneously think that scroll snapping is complete, even
49             though it's only just about to begin! Now that we know scrolling velocity when we receive the initial
50             "momentum begin", we now directly transition the scroll snap state from a snapping state to a gliding state
51             and no longer stop and start the timer during this transition, which means that the test trigger will be
52             deferred for at least the entire duration of the scroll snapping animation (starting right after the first
53             "drag end" wheel event).
54
55         Test: tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-vertical-then-horizontal.html
56
57         * WebCore.xcodeproj/project.pbxproj:
58         * page/EventHandler.cpp:
59         (WebCore::handleWheelEventInAppropriateEnclosingBox):
60         (WebCore::EventHandler::defaultWheelEventHandler):
61         * page/Page.cpp:
62         (WebCore::Page::ensureTestTrigger):
63
64         Addresses test failures by forcing the mainframe scrolling node to expect wheel event test triggers.
65
66         * page/WheelEventDeltaFilter.cpp:
67         (WebCore::WheelEventDeltaFilter::create):
68         (WebCore::WheelEventDeltaFilter::filteredVelocity):
69         * page/WheelEventDeltaFilter.h:
70         * page/mac/WheelEventDeltaFilterMac.mm:
71         (WebCore::WheelEventDeltaFilterMac::updateFromDelta):
72
73         Add support for plumbing filtered scrolling velocity over to the ScrollController.
74
75         * page/scrolling/ScrollingMomentumCalculator.cpp: Copied from Source/WebCore/platform/cocoa/ScrollSnapAnimatorState.mm.
76         (WebCore::ScrollingMomentumCalculator::ScrollingMomentumCalculator):
77         (WebCore::ScrollingMomentumCalculator::create):
78
79         Creates a platform-independent BasicScrollingMomentumCalculator.
80
81         (WebCore::BasicScrollingMomentumCalculator::BasicScrollingMomentumCalculator):
82         (WebCore::BasicScrollingMomentumCalculator::linearlyInterpolatedOffsetAtProgress):
83         (WebCore::BasicScrollingMomentumCalculator::cubicallyInterpolatedOffsetAtProgress):
84         (WebCore::BasicScrollingMomentumCalculator::scrollOffsetAfterElapsedTime):
85         (WebCore::BasicScrollingMomentumCalculator::animationDuration):
86         (WebCore::BasicScrollingMomentumCalculator::initializeInterpolationCoefficientsIfNecessary):
87         (WebCore::BasicScrollingMomentumCalculator::initializeSnapProgressCurve):
88         (WebCore::BasicScrollingMomentumCalculator::animationProgressAfterElapsedTime):
89
90         Interpolation logic ported over from ScrollSnapAnimatorState.
91
92         * page/scrolling/ScrollingMomentumCalculator.h: Added.
93         (WebCore::ScrollingMomentumCalculator::~ScrollingMomentumCalculator):
94         * page/scrolling/mac/ScrollingMomentumCalculatorMac.h: Copied from Source/WebCore/page/WheelEventDeltaFilter.h.
95         * page/scrolling/mac/ScrollingMomentumCalculatorMac.mm: Added.
96         (WebCore::ScrollingMomentumCalculator::create):
97
98         Creates a ScrollingMomentumCalculatorMac.
99
100         (WebCore::ScrollingMomentumCalculatorMac::ScrollingMomentumCalculatorMac):
101         (WebCore::ScrollingMomentumCalculatorMac::scrollOffsetAfterElapsedTime):
102         (WebCore::ScrollingMomentumCalculatorMac::animationDuration):
103         (WebCore::ScrollingMomentumCalculatorMac::ensurePlatformMomentumCalculator):
104         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
105         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
106         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollOffset):
107         (WebCore::ScrollingTreeFrameScrollingNodeMac::viewportSize):
108         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollOffsetOnAxis): Deleted.
109         * platform/PlatformWheelEvent.h:
110         (WebCore::PlatformWheelEvent::copyWithDeltasAndVelocity):
111         (WebCore::PlatformWheelEvent::scrollingVelocity):
112         (WebCore::PlatformWheelEvent::copyWithDeltas): Deleted.
113         * platform/ScrollAnimator.cpp:
114         (WebCore::ScrollAnimator::scrollOffset):
115         (WebCore::ScrollAnimator::viewportSize):
116         (WebCore::ScrollAnimator::scrollOffsetOnAxis): Deleted.
117         * platform/ScrollAnimator.h:
118         * platform/cocoa/ScrollController.h:
119         * platform/cocoa/ScrollController.mm:
120         (WebCore::otherScrollEventAxis):
121         (WebCore::ScrollController::ScrollController):
122         (WebCore::ScrollController::shouldOverrideInertialScrolling):
123         (WebCore::ScrollController::scheduleStatelessScrollSnap):
124         (WebCore::ScrollController::statelessSnapTransitionTimerFired):
125         (WebCore::ScrollController::startDeferringTestsDueToScrollSnapping):
126         (WebCore::ScrollController::stopDeferringTestsDueToScrollSnapping):
127         (WebCore::ScrollController::processWheelEventForScrollSnap):
128         (WebCore::ScrollController::updateScrollSnapState):
129         (WebCore::ScrollController::updateScrollSnapPoints):
130
131         Update the ScrollController's ScrollSnapAnimationState for both vertical and horizontal axes. If both axes lack
132         any snap points, the pointer to the animation state will be nulled out; otherwise, the animation state will
133         exist.
134
135         (WebCore::ScrollController::startScrollSnapTimer):
136         (WebCore::ScrollController::stopScrollSnapTimer):
137         (WebCore::ScrollController::scrollSnapTimerFired):
138         (WebCore::ScrollController::activeScrollSnapIndexForAxis):
139         (WebCore::ScrollController::setActiveScrollSnapIndexForAxis):
140         (WebCore::ScrollController::setNearestScrollSnapIndexForAxisAndOffset):
141         (WebCore::ScrollController::setActiveScrollSnapIndicesForOffset):
142         (WebCore::ScrollController::scrollSnapPointState): Deleted.
143         (WebCore::ScrollController::processWheelEventForScrollSnapOnAxis): Deleted.
144         (WebCore::ScrollController::shouldOverrideWheelEvent): Deleted.
145         (WebCore::projectedInertialScrollDistance): Deleted.
146         (WebCore::ScrollController::beginScrollSnapAnimation): Deleted.
147         (WebCore::ScrollController::endScrollSnapAnimation): Deleted.
148         (WebCore::ScrollController::initializeScrollSnapAnimationParameters): Deleted.
149         (WebCore::ScrollController::isSnappingOnAxis): Deleted.
150         * platform/cocoa/ScrollSnapAnimatorState.h:
151         (WebCore::ScrollSnapAnimatorState::snapOffsetsForAxis):
152         (WebCore::ScrollSnapAnimatorState::setSnapOffsetsForAxis):
153         (WebCore::ScrollSnapAnimatorState::currentState):
154         (WebCore::ScrollSnapAnimatorState::activeSnapIndexForAxis):
155         (WebCore::ScrollSnapAnimatorState::setActiveSnapIndexForAxis):
156         * platform/cocoa/ScrollSnapAnimatorState.mm:
157         (WebCore::projectedInertialScrollDistance):
158         (WebCore::ScrollSnapAnimatorState::transitionToSnapAnimationState):
159         (WebCore::ScrollSnapAnimatorState::transitionToGlideAnimationState):
160         (WebCore::ScrollSnapAnimatorState::transitionToUserInteractionState):
161         (WebCore::ScrollSnapAnimatorState::transitionToDestinationReachedState):
162
163         These methods are used to update the ScrollSnapAnimationState. These state transitions should (and do)
164         encapsulate all changes that need to be made to the animation state; in other words, the ScrollController should
165         no longer be reaching directly into the ScrollSnapAnimatorState to change member variables.
166
167         (WebCore::ScrollSnapAnimatorState::setupAnimationForState):
168         (WebCore::ScrollSnapAnimatorState::teardownAnimationForState):
169         (WebCore::ScrollSnapAnimatorState::currentAnimatedScrollOffset):
170         (WebCore::ScrollSnapAnimatorState::targetOffsetForStartOffset):
171         (WebCore::ScrollSnapAnimatorState::ScrollSnapAnimatorState): Deleted.
172         (WebCore::ScrollSnapAnimatorState::pushInitialWheelDelta): Deleted.
173         (WebCore::ScrollSnapAnimatorState::averageInitialWheelDelta): Deleted.
174         (WebCore::ScrollSnapAnimatorState::clearInitialWheelDeltaWindow): Deleted.
175         (WebCore::ScrollSnapAnimatorState::isSnapping): Deleted.
176         (WebCore::ScrollSnapAnimatorState::canReachTargetWithCurrentInitialScrollDelta): Deleted.
177         (WebCore::ScrollSnapAnimatorState::wheelDeltaTrackingIsInProgress): Deleted.
178         (WebCore::ScrollSnapAnimatorState::hasFinishedTrackingWheelDeltas): Deleted.
179         (WebCore::ScrollSnapAnimatorState::interpolatedOffsetAtProgress): Deleted.
180         (WebCore::ScrollSnapAnimationCurveState::initializeSnapProgressCurve): Deleted.
181         (WebCore::ScrollSnapAnimationCurveState::initializeInterpolationCoefficientsIfNecessary): Deleted.
182         (WebCore::ScrollSnapAnimationCurveState::interpolatedPositionAtProgress): Deleted.
183         (WebCore::ScrollSnapAnimationCurveState::shouldCompleteSnapAnimationImmediatelyAtTime): Deleted.
184         (WebCore::ScrollSnapAnimationCurveState::animationProgressAtTime): Deleted.
185
186         The ScrollSnapAnimatorState now tracks state across both axes. This simplifies coordinating scroll snapping in
187         both horizontal and vertical axes and fixes the issue of the scroll offset not snapping when performing a scroll
188         in one direction without momentum, then scrolling with momentum in the other direction in a single gesture.
189
190         * platform/spi/mac/NSScrollingMomentumCalculatorSPI.h: Added.
191
192 2016-11-29  Brady Eidson  <beidson@apple.com>
193
194         IndexedDB 2.0: Queue up completed requests in the client, handle them one by one.
195         https://bugs.webkit.org/show_bug.cgi?id=165000
196
197         Reviewed by Alex Christensen.
198
199         No new tests (Covered extensively by every existing test).
200
201         Currently when a TransactionOperation completes on the server, it immediately completes
202         itself on the client side, including scheduling an event dispatch if necessary.
203         
204         This patch changes it so that "server completed operations" instead queue up in the 
205         IDBTransaction and are "client-side completed" asynchronously, 1-by-1.
206         
207         Currently this is a "no behavior change" because only one operation is ever sent to
208         the server at a time.
209         
210         But that will change with https://webkit.org/b/164932
211         And this patch is a pre-requisite for that.
212         
213         * Modules/indexeddb/IDBRequest.cpp:
214         (WebCore::IDBRequest::dispatchEvent):
215         (WebCore::IDBRequest::didOpenOrIterateCursor):
216         (WebCore::IDBRequest::completeRequestAndDispatchEvent):
217         (WebCore::IDBRequest::requestCompleted): Deleted.
218         * Modules/indexeddb/IDBRequest.h:
219         
220         * Modules/indexeddb/IDBTransaction.cpp:
221         (WebCore::IDBTransaction::IDBTransaction):
222         (WebCore::IDBTransaction::internalAbort):
223         (WebCore::IDBTransaction::abortOnServerAndCancelRequests):
224         (WebCore::IDBTransaction::scheduleOperation):
225         (WebCore::IDBTransaction::schedulePendingOperationTimer):
226         (WebCore::IDBTransaction::pendingOperationTimerFired):
227         (WebCore::IDBTransaction::operationCompletedOnServer):
228         (WebCore::IDBTransaction::scheduleCompletedOperationTimer):
229         (WebCore::IDBTransaction::completedOperationTimerFired):
230         (WebCore::IDBTransaction::completeNoncursorRequest):
231         (WebCore::IDBTransaction::completeCursorRequest):
232         (WebCore::IDBTransaction::finishedDispatchEventForRequest):
233         (WebCore::IDBTransaction::didStart):
234         (WebCore::IDBTransaction::didOpenCursorOnServer):
235         (WebCore::IDBTransaction::didIterateCursorOnServer):
236         (WebCore::IDBTransaction::didGetAllRecordsOnServer):
237         (WebCore::IDBTransaction::didGetRecordOnServer):
238         (WebCore::IDBTransaction::didGetCountOnServer):
239         (WebCore::IDBTransaction::didDeleteRecordOnServer):
240         (WebCore::IDBTransaction::didClearObjectStoreOnServer):
241         (WebCore::IDBTransaction::putOrAddOnServer):
242         (WebCore::IDBTransaction::didPutOrAddOnServer):
243         (WebCore::IDBTransaction::operationCompletedOnClient):
244         (WebCore::IDBTransaction::deactivate):
245         (WebCore::IDBTransaction::connectionClosedFromServer):
246         (WebCore::IDBTransaction::scheduleOperationTimer): Deleted.
247         (WebCore::IDBTransaction::operationTimerFired): Deleted.
248         (WebCore::IDBTransaction::operationDidComplete): Deleted.
249         * Modules/indexeddb/IDBTransaction.h:
250         
251         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
252         (WebCore::IDBClient::IDBConnectionProxy::completeOperation):
253         
254         * Modules/indexeddb/client/TransactionOperation.cpp:
255         (WebCore::IDBClient::TransactionOperation::TransactionOperation):
256         * Modules/indexeddb/client/TransactionOperation.h:
257         (WebCore::IDBClient::TransactionOperation::transitionToCompleteOnThisThread):
258         (WebCore::IDBClient::TransactionOperation::transitionToComplete):
259         (WebCore::IDBClient::TransactionOperation::doComplete):
260         (WebCore::IDBClient::TransactionOperation::idbRequest):
261         (WebCore::IDBClient::TransactionOperation::performCompleteOnOriginThread): Deleted.
262         (WebCore::IDBClient::TransactionOperation::completed): Deleted.
263
264 2016-11-29  Zalan Bujtas  <zalan@apple.com>
265
266         Safari (WebKit) doesn't wrap element within flex when width comes below min-width
267         https://bugs.webkit.org/show_bug.cgi?id=136041
268         <rdar://problem/25569370>
269
270         Reviewed by Darin Adler.
271
272         While figuring out whether a particular flex item fits the current line, we need to take
273         the min-width into account too. This matches both FF and Chrome behaviour.
274
275         Tests: fast/flexbox/flex-wrap-when-min-widht-is-set-1.html
276                fast/flexbox/flex-wrap-when-min-widht-is-set-2.html
277
278         * rendering/RenderFlexibleBox.cpp:
279         (WebCore::RenderFlexibleBox::computeNextFlexLine):
280
281 2016-11-29  Antti Koivisto  <antti@apple.com>
282
283         Try to fix win/gtk build.
284
285         * style/StyleUpdate.h:
286         (WebCore::Style::ElementUpdate::ElementUpdate):
287
288             Add explicit constructor for compilers that don't support C++14 list initialization correctly.
289
290 2016-11-28  Antti Koivisto  <antti@apple.com>
291
292         Slotted nodes ignore transition
293         https://bugs.webkit.org/show_bug.cgi?id=160866
294         <rdar://problem/29231901>
295
296         Reviewed by Sam Weinig.
297
298         The problem is that slot (display:contents) always triggers full render tree rebuild when something
299         changes in the slotted subtree. This causes animation to jump to end (may be another bug).
300
301         Test: fast/shadow-dom/shadow-host-transition.html
302
303         * style/RenderTreeUpdater.cpp:
304         (WebCore::RenderTreeUpdater::updateElementRenderer):
305         (WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement):
306         * style/StyleChange.h:
307
308             Rearrange so the strongest ('Detach') is the highest.
309
310         * style/StyleTreeResolver.cpp:
311         (WebCore::Style::TreeResolver::resolveElement):
312         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
313
314             If style was display:contents and stays that way, use 'Inherit' StyleChange which doesn't force render tree rebuild.
315             Refactor more of the functionality to createAnimatedElementUpdate.
316
317         * style/StyleTreeResolver.h:
318
319 2016-11-28  Carlos Garcia Campos  <cgarcia@igalia.com>
320
321         [GTK] Crash in WebCore::PlatformDisplayX11::supportsXComposite when running under Wayland
322         https://bugs.webkit.org/show_bug.cgi?id=164917
323
324         Reviewed by Michael Catanzaro.
325
326         WebKitGTK+ appplications are expected to call gtk_init(), because WebKitGTK+, like GTK+ itself, requires a
327         display to work. We currently fallback to create a X11 display when X11 is enabled in cases where GTK+ doesn't
328         have a default display (gtk_init() wasn't called or failed). That's why we end up creating an X11 display under
329         Wayland when both Wayland and X11 option are enabled. The code assumes X11 display creation will always work if
330         X11 is enabled, but that's not true now that we support also Wayland at runtime. So, we should try to get a
331         native display before creating the PlatformDisplay. Rendering will not work in any case when gtk_init() is not
332         called, but in most of the cases those applications are not actually going to render anything, so this way at
333         least we will not crash.
334
335         * platform/graphics/PlatformDisplay.cpp:
336         (WebCore::PlatformDisplay::createPlatformDisplay): Use create() method for X11 and Wayland if we couldn't get a
337         native display from GTK+. If everything fails create a display with no native.
338         (WebCore::PlatformDisplay::PlatformDisplay): Add NativeDisplayOwned parameter.
339         * platform/graphics/PlatformDisplay.h:
340         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
341         (WebCore::PlatformDisplayWayland::create): Try to create a native Wayland display or return nullptr.
342         (WebCore::PlatformDisplayWayland::PlatformDisplayWayland): Initialize NativeDisplayOwned parameter.
343         (WebCore::PlatformDisplayWayland::~PlatformDisplayWayland): Destroy the display if owned.
344         (WebCore::PlatformDisplayWayland::initialize): Return early if native display is nullptr.
345         * platform/graphics/wayland/PlatformDisplayWayland.h:
346         * platform/graphics/x11/PlatformDisplayX11.cpp:
347         (WebCore::PlatformDisplayX11::create): Try to create a native X11 display or return nullptr.
348         (WebCore::PlatformDisplayX11::PlatformDisplayX11): Use NativeDisplayOwned now.
349         (WebCore::PlatformDisplayX11::~PlatformDisplayX11): Ditto.
350         * platform/graphics/x11/PlatformDisplayX11.h:
351
352 2016-11-28  Matt Baker  <mattbaker@apple.com>
353
354         Web Inspector: Debugger should have an option for showing asynchronous call stacks
355         https://bugs.webkit.org/show_bug.cgi?id=163230
356         <rdar://problem/28698683>
357
358         Reviewed by Joseph Pecoraro.
359
360         Test: inspector/debugger/async-stack-trace.html
361
362         * inspector/InspectorInstrumentation.cpp:
363         (WebCore::didScheduleAsyncCall):
364         Helper function used by by instrumentation hooks. Informs the debugger
365         agent that an asynchronous call was scheduled for the current script
366         execution state.
367
368         (WebCore::InspectorInstrumentation::didInstallTimerImpl):
369         (WebCore::InspectorInstrumentation::didRemoveTimerImpl):
370         (WebCore::InspectorInstrumentation::willFireTimerImpl):
371         (WebCore::InspectorInstrumentation::didFireTimerImpl):
372         Asynchronous stack trace plumbing for timers (setTimeout, setInterval).
373         (WebCore::InspectorInstrumentation::didRequestAnimationFrameImpl):
374         (WebCore::InspectorInstrumentation::didCancelAnimationFrameImpl):
375         (WebCore::InspectorInstrumentation::willFireAnimationFrameImpl):
376         (WebCore::InspectorInstrumentation::didFireAnimationFrameImpl):
377         Asynchronous stack trace plumbing for requestAnimationFrame.
378
379 2016-11-28  Jiewen Tan  <jiewen_tan@apple.com>
380
381         Unreviewed, followup patch after r209059.
382
383         * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
384         (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
385         (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
386         * crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp:
387         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
388         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt):
389         * crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
390         (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
391         (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
392
393 2016-11-28  Jiewen Tan  <jiewen_tan@apple.com>
394
395         ASSERTION FAILED: m_scriptExecutionContext->isContextThread() seen with LayoutTest crypto/subtle/rsa-oaep-generate-key-encrypt-decrypt.html
396         https://bugs.webkit.org/show_bug.cgi?id=165124
397         <rdar://problem/29413805>
398
399         Reviewed by Daniel Bates.
400
401         We should only dereference callbacks after being back to the Document/Worker threads as
402         it might destroy promises in the work queue which will then trigger the assertion.
403
404         Covered by existing tests.
405
406         * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
407         (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
408         (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
409         * crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp:
410         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
411         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt):
412         * crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
413         (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
414         (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
415
416 2016-11-28  Darin Adler  <darin@apple.com>
417
418         Streamline and speed up tokenizer and segmented string classes
419         https://bugs.webkit.org/show_bug.cgi?id=165003
420
421         Reviewed by Sam Weinig.
422
423         Profiling Speedometer on my iMac showed the tokenizer as one of the
424         hottest functions. This patch streamlines the segmented string class,
425         removing various unused features, and also improves some other functions
426         seen on the Speedometer profile. On my iMac I measured a speedup of
427         about 3%. Changes include:
428
429         - Removed m_pushedChar1, m_pushedChar2, and m_empty data members from the
430           SegmentedString class and all the code that used to handle them.
431
432         - Simplified the SegmentedString advance functions so they are small
433           enough to get inlined in the HTML tokenizer.
434
435         - Updated callers to call the simpler SegmentedString advance functions
436           that don't handle newlines in as many cases as possible.
437
438         - Cut down on allocations of SegmentedString and made code move the
439           segmented string and the strings that are moved into it rather than
440           copying them whenever possible.
441
442         - Simplified segmented string functions, removing some branches, mostly
443           from the non-fast paths.
444
445         - Removed small unused functions and small functions used in only one
446           or two places, made more functions private and renamed for clarity.
447
448         * bindings/js/JSHTMLDocumentCustom.cpp:
449         (WebCore::documentWrite): Moved a little more of the common code in here
450         from the two functions belwo. Removed obsolete comment saying this was not
451         following the DOM specification because it is. Removed unneeded special
452         cases for 1 argument and no arguments. Take a reference instead of a pointer.
453         (WebCore::JSHTMLDocument::write): Updated for above.
454         (WebCore::JSHTMLDocument::writeln): Ditto.
455
456         * css/parser/CSSTokenizer.cpp: Added now-needed include.
457         * css/parser/CSSTokenizer.h: Removed unneeded include.
458
459         * css/parser/CSSTokenizerInputStream.h: Added definition of kEndOfFileMarker
460         here; this is now separate from the use in the HTMLParser. In the long run,
461         unclear to me whether it is really needed in either.
462
463         * dom/Document.cpp:
464         (WebCore::Document::prepareToWrite): Added. Helper function used by the three
465         different variants of write. Using this may prevent us from having to construct
466         a SegmentedString just to append one string after future refactoring.
467         (WebCore::Document::write): Updated to take an rvalue reference and move the
468         value through.
469         (WebCore::Document::writeln): Use a single write call instead of two.
470
471         * dom/Document.h: Changed write to take an rvalue reference to SegmentedString
472         rather than a const reference.
473
474         * dom/DocumentParser.h: Changed insert to take an rvalue reference to
475         SegmentedString. In the future, should probably overload to take a single
476         string since that is the normal case.
477
478         * dom/RawDataDocumentParser.h: Updated for change to DocumentParser.
479
480         * html/FTPDirectoryDocument.cpp:
481         (WebCore::FTPDirectoryDocumentParser::append): Refactored a bit, just enough
482         so that we don't need an assignment operator for SegmentedString that can
483         copy a String.
484
485         * html/parser/HTMLDocumentParser.cpp:
486         (WebCore::HTMLDocumentParser::insert): Updated to take an rvalue reference,
487         and move the value through.
488         * html/parser/HTMLDocumentParser.h: Updated for the above.
489
490         * html/parser/HTMLEntityParser.cpp:
491         (WebCore::HTMLEntityParser::consumeNamedEntity): Updated for name changes.
492         Changed the twao calls to advance here to call advancePastNonNewline; no
493         change in behavior, but asserts what the code was assuming before, that the
494         character was not a newline.
495
496         * html/parser/HTMLInputStream.h:
497         (WebCore::HTMLInputStream::appendToEnd): Updated to take an rvalue reference,
498         and move the value through.
499         (WebCore::HTMLInputStream::insertAtCurrentInsertionPoint): Ditto.
500         (WebCore::HTMLInputStream::markEndOfFile): Removed the code to construct a
501         SegmentedString, overkill since we can just append an individual string.
502         (WebCore::HTMLInputStream::splitInto): Rewrote the move idiom here to actually
503         use move, which will reduce reference count churn and other unneeded work.
504
505         * html/parser/HTMLMetaCharsetParser.cpp:
506         (WebCore::HTMLMetaCharsetParser::checkForMetaCharset): Removed unneeded
507         construction of a SegmentedString, just to append a string.
508
509         * html/parser/HTMLSourceTracker.cpp:
510         (WebCore::HTMLSourceTracker::HTMLSourceTracker): Moved to the class definition.
511         (WebCore::HTMLSourceTracker::source): Updated for function name change.
512         * html/parser/HTMLSourceTracker.h: Updated for above.
513
514         * html/parser/HTMLTokenizer.cpp: Added now-needed include.
515         (WebCore::HTMLTokenizer::emitAndResumeInDataState): Use advancePastNonNewline,
516         since this function is never called in response to a newline character.
517         (WebCore::HTMLTokenizer::commitToPartialEndTag): Ditto.
518         (WebCore::HTMLTokenizer::commitToCompleteEndTag): Ditto.
519         (WebCore::HTMLTokenizer::processToken): Use ADVANCE_PAST_NON_NEWLINE_TO macro
520         instead of ADVANCE_TO in cases where the character we are advancing past is
521         known not to be a newline, so we can use the more efficient advance function
522         that doesn't check for the newline character.
523
524         * html/parser/InputStreamPreprocessor.h: Moved kEndOfFileMarker to
525         SegmentedString.h; not sure that's a good place for it either. In the long run,
526         unclear to me whether this is really needed.
527         (WebCore::InputStreamPreprocessor::peek): Added UNLIKELY for the empty check.
528         Added LIKELY for the not-special character check.
529         (WebCore::InputStreamPreprocessor::advance): Updated for the new name of the
530         advanceAndUpdateLineNumber function.
531         (WebCore::InputStreamPreprocessor::advancePastNonNewline): Added. More
532         efficient than advance for cases where the last characer is known not to be
533         a newline character.
534         (WebCore::InputStreamPreprocessor::skipNextNewLine): Deleted. Was unused.
535         (WebCore::InputStreamPreprocessor::reset): Deleted. Was unused except in the
536         constructor; added initial values for the data members to replace.
537         (WebCore::InputStreamPreprocessor::processNextInputCharacter): Removed long
538         FIXME comment that didn't really need to be here. Reorganized a bit.
539         (WebCore::InputStreamPreprocessor::isAtEndOfFile): Renamed and made static.
540
541         * html/track/BufferedLineReader.cpp:
542         (WebCore::BufferedLineReader::nextLine): Updated to not use the poorly named
543         scanCharacter function to advance past a newline. Also renamed from getLine
544         and changed to return Optional<String> instead of using a boolean to indicate
545         failure and an out argument.
546
547         * html/track/BufferedLineReader.h:
548         (WebCore::BufferedLineReader::BufferedLineReader): Use the default, putting
549         initial values on each data member below.
550         (WebCore::BufferedLineReader::append): Updated to take an rvalue reference,
551         and move the value through.
552         (WebCore::BufferedLineReader::scanCharacter): Deleted. Was poorly named,
553         and easy to replace with two lines of code at its two call sites.
554         (WebCore::BufferedLineReader::reset): Rewrote to correctly clear all the
555         data members of the class, not just the segmented string.
556
557         * html/track/InbandGenericTextTrack.cpp:
558         (WebCore::InbandGenericTextTrack::parseWebVTTFileHeader): Updated to take
559         an rvalue reference and move the value through.
560         * html/track/InbandGenericTextTrack.h: Updated for the above.
561
562         * html/track/InbandTextTrack.h: Updated since parseWebVTTFileHeader now
563         takes an rvalue reference.
564
565         * html/track/WebVTTParser.cpp:
566         (WebCore::WebVTTParser::parseFileHeader): Updated to take an rvalue reference
567         and move the value through.
568         (WebCore::WebVTTParser::parseBytes): Updated to pass ownership of the string
569         in to the line reader append function.
570         (WebCore::WebVTTParser::parseCueData): Use auto and WTFMove for WebVTTCueData.
571         (WebCore::WebVTTParser::flush): More of the same.
572         (WebCore::WebVTTParser::parse): Changed to use nextLine instead of getLine.
573         * html/track/WebVTTParser.h: Updated for the above.
574
575         * html/track/WebVTTTokenizer.cpp:
576         (WebCore::advanceAndEmitToken): Use advanceAndUpdateLineNumber by its new
577         name, just advance. No change in behavior.
578         (WebCore::WebVTTTokenizer::WebVTTTokenizer): Pass a String, not a
579         SegmentedString, to add the end of file marker.
580
581         * platform/graphics/InbandTextTrackPrivateClient.h: Updated since
582         parseWebVTTFileHeader takes an rvalue reference.
583
584         * platform/text/SegmentedString.cpp:
585         (WebCore::SegmentedString::Substring::appendTo): Moved here from the header.
586         The only caller is SegmentedString::toString, inside this file.
587         (WebCore::SegmentedString::SegmentedString): Deleted the copy constructor.
588         No longer needed.
589         (WebCore::SegmentedString::operator=): Defined a move assignment operator
590         rather than an ordinary assignment operator, since that's what the call
591         sites really need.
592         (WebCore::SegmentedString::length): Simplified since we no longer need to
593         support pushed characters.
594         (WebCore::SegmentedString::setExcludeLineNumbers): Simplified, since we
595         can just iterate m_otherSubstrings without an extra check. Also changed to
596         write directly to the data member of Substring instead of using a function.
597         (WebCore::SegmentedString::updateAdvanceFunctionPointersForEmptyString):
598         Added. Used when we run out of characters.
599         (WebCore::SegmentedString::clear): Removed code to clear now-deleted members.
600         Updated for changes to other member names.
601         (WebCore::SegmentedString::appendSubstring): Renamed from just append to
602         avoid ambiguity with the public append function. Changed to take an rvalue
603         reference, and move in, and added code to set m_currentCharacter properly,
604         so the caller doesn't have to deal with that.
605         (WebCore::SegmentedString::close): Updated to use m_isClosed by its new name.
606         Also removed unneeded comment about assertion that fires when trying to close
607         an already closed string.
608         (WebCore::SegmentedString::append): Added overloads for rvalue references of
609         both entire SegmentedString objects and of String. Streamlined to just call
610         appendSubstring and append to the deque.
611         (WebCore::SegmentedString::pushBack): Tightened up since we don't allow empty
612         strings and changed to take just a string, not an entire segmented string.
613         (WebCore::SegmentedString::advanceSubstring): Moved logic into the
614         advancePastSingleCharacterSubstringWithoutUpdatingLineNumber function.
615         (WebCore::SegmentedString::toString): Simplified now that we don't need to
616         support pushed characters.
617         (WebCore::SegmentedString::advancePastNonNewlines): Deleted.
618         (WebCore::SegmentedString::advance8): Deleted.
619         (WebCore::SegmentedString::advanceWithoutUpdatingLineNumber16): Renamed from
620         advance16. Simplified now that there are no pushed characters. Also changed to
621         access data members of m_currentSubstring directly instead of calling a function.
622         (WebCore::SegmentedString::advanceAndUpdateLineNumber8): Deleted.
623         (WebCore::SegmentedString::advanceAndUpdateLineNumber16): Ditto.
624         (WebCore::SegmentedString::advancePastSingleCharacterSubstringWithoutUpdatingLineNumber):
625         Renamed from advanceSlowCase. Removed uneeded logic to handle pushed characters.
626         Moved code in here from advanceSubstring.
627         (WebCore::SegmentedString::advancePastSingleCharacterSubstring): Renamed from
628         advanceAndUpdateLineNumberSlowCase. Simplified by calling the function above.
629         (WebCore::SegmentedString::advanceEmpty): Broke assertion up into two.
630         (WebCore::SegmentedString::updateSlowCaseFunctionPointers): Updated for name changes.
631         (WebCore::SegmentedString::advancePastSlowCase): Changed name and meaning of
632         boolean argument. Rewrote to use the String class less; it's now used only when
633         we fail to match after the first character rather than being used for the actual
634         comparison with the literal.
635
636         * platform/text/SegmentedString.h: Moved all non-trivial function bodies out of
637         the class definition to make things easier to read. Moved the SegmentedSubstring
638         class inside the SegmentedString class, making it a private struct named Substring.
639         Removed the m_ prefix from data members of the struct, removed many functions from
640         the struct and made its union be anonymous instead of naming it m_data. Removed
641         unneeded StringBuilder.h include.
642         (WebCore::SegmentedString::isEmpty): Changed to use the length of the substring
643         instead of a separate boolean. We never create an empty substring, nor leave one
644         in place as the current substring unless the entire segmented string is empty.
645         (WebCore::SegmentedString::advancePast): Updated to use the new member function
646         template instead of a non-template member function. The new member function is
647         entirely rewritten and does the matching directly rather than allocating a string
648         just to do prefix matching.
649         (WebCore::SegmentedString::advancePastLettersIgnoringASCIICase): Renamed to make
650         it clear that the literal must be all non-letters or lowercase letters as with
651         the other "letters ignoring ASCII case" functions. The three call sites all fit
652         the bill. Implement by calling the new function template.
653         (WebCore::SegmentedString::currentCharacter): Renamed from currentChar.
654         (WebCore::SegmentedString::Substring::Substring): Use an rvalue reference and
655         move the string in.
656         (WebCore::SegmentedString::Substring::currentCharacter): Simplified since this
657         is never used on an empty substring.
658         (WebCore::SegmentedString::Substring::incrementAndGetCurrentCharacter): Ditto.
659         (WebCore::SegmentedString::SegmentedString): Overload to take an rvalue reference.
660         Simplified since there are now fewer data members.
661         (WebCore::SegmentedString::advanceWithoutUpdatingLineNumber): Renamed from
662         advance, since this is only safe to use if there is some reason it is OK to skip
663         updating the line number.
664         (WebCore::SegmentedString::advance): Renamed from advanceAndUpdateLineNumber,
665         since doing that is the normal desired behavior and not worth mentioning in the
666         public function name.
667         (WebCore::SegmentedString::advancePastNewline): Renamed from
668         advancePastNewlineAndUpdateLineNumber.
669         (WebCore::SegmentedString::numberOfCharactersConsumed): Greatly simplified since
670         pushed characters are no longer supported.
671         (WebCore::SegmentedString::characterMismatch): Added. Used by advancePast.
672
673         * xml/parser/CharacterReferenceParserInlines.h:
674         (WebCore::unconsumeCharacters): Use toString rather than toStringPreserveCapacity
675         because the SegmentedString is going to take ownership of the string.
676         (WebCore::consumeCharacterReference): Updated to use the pushBack that takes just
677         a String, not a SegmentedString. Also use advancePastNonNewline.
678
679         * xml/parser/MarkupTokenizerInlines.h: Added ADVANCE_PAST_NON_NEWLINE_TO.
680
681         * xml/parser/XMLDocumentParser.cpp:
682         (WebCore::XMLDocumentParser::insert): Updated since this takes an rvalue reference.
683         (WebCore::XMLDocumentParser::append): Removed unnecessary code to create a
684         SegmentedString.
685         * xml/parser/XMLDocumentParser.h: Updated for above. Also fixed indentation
686         and initialized most data members.
687         * xml/parser/XMLDocumentParserLibxml2.cpp:
688         (WebCore::XMLDocumentParser::XMLDocumentParser): Moved most data member
689         initialization into the class definition.
690         (WebCore::XMLDocumentParser::resumeParsing): Removed code that copied a
691         segmented string, but converted the whole thing into a string before using it.
692         Now we convert to a string right away.
693
694 2016-11-28  Chris Dumez  <cdumez@apple.com>
695
696         [iOS] Use UIKit SPI to force popover presentation style on iPhone for html validation popovers
697         https://bugs.webkit.org/show_bug.cgi?id=165107
698
699         Reviewed by Simon Fraser.
700
701         Use UIKit SPI to force popover presentation style on iPhone for html validation
702         popovers as this results in simpler code and achieves the same behavior.
703
704         * platform/ValidationBubble.h:
705         * platform/ios/ValidationBubbleIOS.mm:
706         (WebCore::ValidationBubble::setAnchorRect):
707         (-[WebValidationBubbleDelegate adaptivePresentationStyleForPresentationController:traitCollection:]): Deleted.
708         * platform/spi/ios/UIKitSPI.h:
709
710 2016-11-28  Chris Dumez  <cdumez@apple.com>
711
712         [Mac] Clicking on an HTML validation bubble should dismiss it
713         https://bugs.webkit.org/show_bug.cgi?id=165117
714         <rdar://problem/29409837>
715
716         Reviewed by Simon Fraser.
717
718         Clicking on an HTML validation bubble should dismiss it. It previously
719         did nothing.
720
721         No new tests, this is not easily testable as EventSender.keyDown() sends
722         the event to the view, not to a particular screen location.
723
724         * platform/mac/ValidationBubbleMac.mm:
725         (-[WebValidationPopover mouseDown:]):
726         (WebCore::ValidationBubble::ValidationBubble):
727
728 2016-11-27  Sam Weinig  <sam@webkit.org>
729
730         Make CanvasRenderingContext2D use WebIDL unions / Variants for createPattern and drawImage
731         https://bugs.webkit.org/show_bug.cgi?id=165086
732
733         Reviewed by Darin Adler.
734
735         * html/canvas/CanvasRenderingContext2D.cpp:
736         (WebCore::size):
737         Add overloads of size for each type of CanvasSource.
738         (WebCore::CanvasRenderingContext2D::drawImage):
739         (WebCore::CanvasRenderingContext2D::createPattern):
740         * html/canvas/CanvasRenderingContext2D.h:
741         * html/canvas/CanvasRenderingContext2D.idl:
742         Use variants to reduce code duplication and match spec language in drawImage and createPattern.
743
744 2016-11-28  Beth Dakin  <bdakin@apple.com>
745
746         Blacklist Netflix for TouchBar support
747         https://bugs.webkit.org/show_bug.cgi?id=165104
748         -and corresponding-
749         rdar://problem/29404778
750
751         Reviewed by Tim Horton.
752
753         This patch moves the algorithm to 
754         bestMediaElementForShowingPlaybackControlsManager() so that Now Playing can also 
755         use it.
756         * html/HTMLMediaElement.cpp:
757         (WebCore::needsPlaybackControlsManagerQuirk):
758         (WebCore::HTMLMediaElement::bestMediaElementForShowingPlaybackControlsManager):
759         (WebCore::HTMLMediaElement::updatePlaybackControlsManager):
760
761 2016-11-28  Mark Lam  <mark.lam@apple.com>
762
763         Fix exception scope verification failures in more miscellaneous files.
764         https://bugs.webkit.org/show_bug.cgi?id=165102
765
766         Reviewed by Saam Barati.
767
768         No new tests because these are fixes to failures detected by existing tests when
769         exception check verification is enabled.
770
771         * bindings/js/IDBBindingUtilities.cpp:
772         (WebCore::toJS):
773         * bindings/js/JSCommandLineAPIHostCustom.cpp:
774         (WebCore::getJSListenerFunctions):
775         * bindings/js/JSCryptoKeySerializationJWK.cpp:
776         (WebCore::buildJSONForRSAComponents):
777         (WebCore::addUsagesToJSON):
778         * bindings/js/JSDOMBinding.h:
779         (WebCore::toJS):
780         * bridge/runtime_array.cpp:
781         (JSC::RuntimeArray::put):
782
783 2016-11-28  Dave Hyatt  <hyatt@apple.com>
784
785         [CSS Parser] Fix bugs in the @supports parser
786         https://bugs.webkit.org/show_bug.cgi?id=165115
787
788         Reviewed by Zalan Bujtas.
789
790         * css/parser/CSSParserFastPaths.cpp:
791         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
792         Clean up the display property to match the old parser to ensure
793         that @supports conditions on display are the same.
794
795         * css/parser/CSSSupportsParser.cpp:
796         (WebCore::CSSSupportsParser::consumeCondition):
797         (WebCore::CSSSupportsParser::consumeNegation):
798         (WebCore::CSSSupportsParser::consumeConditionInParenthesis):
799         * css/parser/CSSSupportsParser.h:
800         What follows are all bugs in Blink that need to be fixed to pass our
801         tests.
802
803         Fix the supports parser to allow the whitespace after not/or/and to
804         be optional. Allow the whitespace following parenthetical conditions
805         to be optional.
806
807         With whitespace being optional, this means that "not(" will parse
808         as a FunctionToken type, as will "or(" and "and(". Handle this situation
809         by checking for FunctionToken along with IdentToken and parameterizing
810         consumeConditionInParenthesis to do the right thing when it starts with
811         a FunctionToken instead of an IdentToken.
812
813         Fix the general enclosure FunctionToken for forward compatibility to require that
814         the function still be enclosed within parentheses.
815
816 2016-11-28  Mark Lam  <mark.lam@apple.com>
817
818         Fix exception scope verification failures in ObjectConstructor.cpp and ObjectPrototype.cpp.
819         https://bugs.webkit.org/show_bug.cgi?id=165051
820
821         Reviewed by Saam Barati.
822
823         No new tests because this is covered by the existing test
824         http/tests/security/cross-frame-access-object-prototype.html with the help of a
825         new ASSERT in ObjectPrototype.cpp.
826
827         Fixed jsDOMWindowGetOwnPropertySlotRestrictedAccess() to return false when it
828         throws an exception.
829
830         * bindings/js/JSDOMWindowCustom.cpp:
831         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
832
833 2016-11-28  Tim Horton  <timothy_horton@apple.com>
834
835         Obvious change in saturation/color when swiping to a previously visited page
836         https://bugs.webkit.org/show_bug.cgi?id=165112
837         <rdar://problem/29257229>
838
839         Reviewed by Simon Fraser.
840
841         * platform/graphics/cocoa/IOSurface.mm:
842         (WebCore::IOSurface::createFromImage):
843         IOSurface::createFromImage should take into account the colorspace of the
844         originating image, instead of just hardcoding sRGB.
845
846         Otherwise, on a non-sRGB display, the display-space snapshot that we take
847         for back-forward swipe is converted to sRGB, then the colorspace information
848         is lost (without a way to maintain it inside the IOSurface), and displayed
849         as layer contents interpreted as display space (instead of sRGB).
850
851 2016-11-28  Chris Dumez  <cdumez@apple.com>
852
853         Unreviewed, fix crashes on Yosemite after r209009
854
855         NSTextField's maximumNumberOfLines was introduced in ElCapitan so
856         disable it at compile-time on previous OSes for now.
857
858         * platform/mac/ValidationBubbleMac.mm:
859         (WebCore::ValidationBubble::ValidationBubble):
860
861 2016-11-28  Keith Rollin  <krollin@apple.com>
862
863         Unreviewed, rolling out r208607.
864
865         The actual changes aren't inline with what was requested.
866
867         Reverted changeset:
868
869         "Reduce number of platformMemoryUsage calls"
870         https://bugs.webkit.org/show_bug.cgi?id=164375
871         http://trac.webkit.org/changeset/208607
872
873 2016-11-28  Beth Dakin  <bdakin@apple.com>
874
875         Blacklist Netflix for TouchBar support
876         https://bugs.webkit.org/show_bug.cgi?id=165104
877         -and corresponding-
878         rdar://problem/29404778
879
880         Reviewed by Darin Adler.
881
882         * html/HTMLMediaElement.cpp:
883         (WebCore::needsPlaybackControlsManagerQuirk):
884         (WebCore::HTMLMediaElement::updatePlaybackControlsManager):
885
886 2016-11-28  Chris Dumez  <cdumez@apple.com>
887
888         Limit HTML Form validation popovers to 4 lines
889         https://bugs.webkit.org/show_bug.cgi?id=165098
890         <rdar://problem/29403286>
891
892         Reviewed by Darin Adler.
893
894         Limit HTML Form validation popovers to 4 lines as per recent feedback.
895
896         * platform/ios/ValidationBubbleIOS.mm:
897         (WebCore::ValidationBubble::ValidationBubble):
898         * platform/mac/ValidationBubbleMac.mm:
899         (WebCore::ValidationBubble::ValidationBubble):
900
901 2016-11-28  Dave Hyatt  <hyatt@apple.com>
902
903         [CSS Parser] Filters and Reflections Fixes
904         https://bugs.webkit.org/show_bug.cgi?id=165103
905
906         Reviewed by Zalan Bujtas.
907
908         * css/parser/CSSPropertyParser.cpp:
909         (WebCore::consumeReflect):
910         Support the "none" keyword for box-reflect.
911
912         * css/parser/CSSPropertyParserHelpers.cpp:
913         (WebCore::CSSPropertyParserHelpers::isValidPrimitiveFilterFunction):
914         (WebCore::CSSPropertyParserHelpers::consumeFilterFunction):
915         Don't rely on range checking, since invert isn't grouped with the other
916         function values. Actually check every keyword.
917
918 2016-11-28  Brent Fulgham  <bfulgham@apple.com>
919
920         ImageData does not match specification
921         https://bugs.webkit.org/show_bug.cgi?id=164663
922
923         Reviewed by Simon Fraser.
924
925         The W3C specification https://www.w3.org/TR/2dcontext/ clearly states that
926         the width and height attributes of the ImageData type should be unsigned.
927         Our current implementation has signed integer values.
928
929         In practice, we have enforced the unsigned requirement by throwing a TypeError
930         if you attempt to construct an ImageData with negative width or height.
931
932         This change simply updates the IDL and impelemntation to match the spec.
933
934         Test coverage is already provided by fast/canvas/canvas-imageData.html
935
936         * bindings/js/SerializedScriptValue.cpp:
937         (WebCore::CloneDeserializer::readTerminal): Serialize as uint32_t values.
938         * html/ImageData.idl: Revise width and height to be unsigned long.
939
940 2016-11-28  Dave Hyatt  <hyatt@apple.com>
941
942         [CSS Parser] flex-basis should be pixel units not percentages.
943         https://bugs.webkit.org/show_bug.cgi?id=165100
944
945         Reviewed by Zalan Bujtas.
946
947         * css/parser/CSSPropertyParser.cpp:
948         (WebCore::CSSPropertyParser::consumeFlex):
949
950 2016-11-28  Daniel Bates  <dabates@apple.com>
951
952         Replace CSSPropertyNames.in with a JSON file
953         https://bugs.webkit.org/show_bug.cgi?id=164691
954
955         Reviewed by Simon Fraser.
956
957         Convert CSSPropertyNames.in to a structured JSON file. This is the first step towards
958         exposing a CSS feature status dashboard and generating more of the boilerplate code
959         for a CSS property.
960
961         A side effect of this change is that makeprop.pl no longer detects duplicate CSS property
962         definitions. We will look to bring such duplication detection back in a subsequent
963         commit.
964
965         * CMakeLists.txt: Substitute CSSProperties.json for CSSPropertyNames.in and update the
966         invocation of makeprop.pl as we no longer need to pass the bindings/scripts/preprocessor.pm
967         Perl module. Makeprop.pl supports conditional CSS properties and values without the need
968         to preprocess CSSProperties.json using the C preprocessor.
969         * DerivedSources.make: Ditto. Pass WTF_PLATFORM_IOS to makeprop.pl when building for iOS
970         as we no longer make use of bindings/scripts/preprocessor.pm.
971         * css/CSSProperties.json: Added.
972         * css/CSSPropertyNames.in: Removed.
973         * css/StyleResolver.cpp: Remove variable lastHighPriorityProperty as we now generate it.
974         * css/makeprop.pl: Extracted the input file name, now CSSProperties.json, into a global variable
975         and referenced this variable throughout this script instead of hardcoding the input file name at
976         each call site. Updated code to handle CSS longhand names being encoded in a JSON array as opposed
977         to a string of '|'-separated values. I added a FIXME comment to do the same for the codegen property
978         "custom". Fixed Perl uninitialized variable warnings when die()-ing with error "Unknown CSS property
979         used in all shorthand ..." or "Unknown CSS property used in longhands ...".
980         (isPropertyEnabled): Added. Determine whether code should be generated for a property.
981         (addProperty): Added.
982         (sortByDescendingPriorityAndName): Added.
983         (getScopeForFunction): Lowercase option names so that we can use a consistent case throughout
984         the JSON file.
985         (getNameForMethods): Ditto.
986         (generateColorValueSetter):
987         (generateAnimationPropertyInitialValueSetter): Ditto.
988         (generateAnimationPropertyInheritValueSetter): Ditto.
989         (generateFillLayerPropertyInitialValueSetter): Ditto.
990         (generateFillLayerPropertyInheritValueSetter): Ditto.
991         (generateSetValueStatement): Ditto.
992         (generateInitialValueSetter): Ditto.
993         (generateInheritValueSetter): Ditto.
994         (generateValueSetter): Ditto.
995
996 2016-11-28  Dave Hyatt  <hyatt@apple.com>
997
998         [CSS Parser] Support -webkit-animation-trigger
999         https://bugs.webkit.org/show_bug.cgi?id=165095
1000
1001         Reviewed by Zalan Bujtas.
1002
1003         * css/CSSValueKeywords.in:
1004         * css/parser/CSSPropertyParser.cpp:
1005         (WebCore::consumeWebkitAnimationTrigger):
1006         (WebCore::consumeAnimationValue):
1007         (WebCore::CSSPropertyParser::parseSingleValue):
1008
1009 2016-11-28  Antti Koivisto  <antti@apple.com>
1010
1011         Remove FIRST_LINE_INHERITED fake pseudo style
1012         https://bugs.webkit.org/show_bug.cgi?id=165071
1013
1014         Reviewed by Andreas Kling.
1015
1016         These are create during layout an then cached to the RenderStyle. Cache computed first line style to
1017         RenderObject rare data instead, avoiding style mutation an other confusing messiness.
1018
1019         * rendering/RenderElement.cpp:
1020         (WebCore::RenderElement::RenderElement):
1021         (WebCore::RenderElement::computeFirstLineStyle):
1022         (WebCore::RenderElement::firstLineStyle):
1023
1024             Cache the first line style.
1025
1026         (WebCore::RenderElement::invalidateCachedFirstLineStyle):
1027         (WebCore::RenderElement::styleWillChange):
1028
1029             Invalidate subtree if we have cached first line style.
1030
1031         (WebCore::RenderElement::getUncachedPseudoStyle):
1032         (WebCore::RenderElement::uncachedFirstLineStyle): Deleted.
1033         (WebCore::RenderElement::cachedFirstLineStyle): Deleted.
1034         * rendering/RenderElement.h:
1035         * rendering/RenderObject.cpp:
1036         (WebCore::RenderObject::rareDataMap):
1037         (WebCore::RenderObject::rareData):
1038         (WebCore::RenderObject::ensureRareData):
1039         * rendering/RenderObject.h:
1040
1041             Stop copying rare data objects.
1042
1043         * rendering/style/RenderStyle.cpp:
1044         (WebCore::RenderStyle::changeRequiresLayout):
1045
1046             Use the normal mechanism for invalidating layout for first-line instead of a hack in pseudoStyleCacheIsInvalid.
1047
1048         * rendering/style/RenderStyleConstants.h:
1049         * style/RenderTreeUpdater.cpp:
1050         (WebCore::pseudoStyleCacheIsInvalid):
1051
1052             Simplify.
1053
1054 2016-11-28  Miguel Gomez  <magomez@igalia.com>
1055
1056         [GTK] Dramatic increase on memory usage since 2.14.x
1057         https://bugs.webkit.org/show_bug.cgi?id=164049
1058
1059         Reviewed by Žan Doberšek.
1060
1061         Use OpenGL version 3.2 Core for rendering when available.
1062         Update some operations that have changed when using 3.2 Core:
1063         - Use glGetStringi to get the extensions list.
1064         - Do not use GL_POINT_SPRITE.
1065         - Always use a VAO when rendering.
1066         - Use a GLSL 1.50 compatible shader.
1067
1068         No new tests needed.
1069
1070         * platform/graphics/GLContext.cpp:
1071         (WebCore::GLContext::version):
1072         Add a method to get OpenGL version we are using.
1073         * platform/graphics/GLContext.h:
1074         Ditto.
1075         * platform/graphics/GraphicsContext3D.h:
1076         Add an attribute to store the VAO used for rendering.
1077         * platform/graphics/OpenGLShims.cpp:
1078         (WebCore::initializeOpenGLShims):
1079         Add glGetStringi to the list of functions.
1080         * platform/graphics/OpenGLShims.h:
1081         Ditto.
1082         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
1083         (WebCore::GraphicsContext3D::GraphicsContext3D):
1084         Set appropriate output to the shader compiler and initalize the VAO if needed.
1085         (WebCore::GraphicsContext3D::~GraphicsContext3D):
1086         Delete the VAO if needed.
1087         (WebCore::GraphicsContext3D::getExtensions):
1088         Use glGetExtensionsi for OpenGL versions >= 3.2.
1089         * platform/graphics/glx/GLContextGLX.cpp:
1090         (WebCore::hasGLXARBCreateContextExtension):
1091         Check whether the GLX_ARB_create_context extension is available.
1092         (WebCore::GLContextGLX::createWindowContext):
1093         Use glXCreateContextAttribsARB() if possible to request an OpenGL 3.2 context.
1094         (WebCore::GLContextGLX::createPbufferContext):
1095         Ditto.
1096         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
1097         (WebCore::Extensions3DOpenGLCommon::initializeAvailableExtensions):
1098         Enable glGetStringi for GTK.
1099         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
1100         Do not use default getExtensions() method for GTK.
1101         * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
1102         Ditto.
1103
1104 2016-11-24  Sergio Villar Senin  <svillar@igalia.com>
1105
1106         [css-grid] Move attributes from RenderGrid to the new Grid class
1107         https://bugs.webkit.org/show_bug.cgi?id=165065
1108
1109         Reviewed by Darin Adler.
1110
1111         A new class called Grid was added in 208973. This is the first of a couple of patches moving
1112         private attributes from RenderGrid to Grid.
1113
1114         Apart from that this is adding a couple of new helper functions that will decouple the
1115         existence of in-flow items from the actual data structures storing that information.
1116
1117         Last but not least, the Grid::insert() method does not only insert the item in the m_grid
1118         data structure, but also stores the GridArea associated to that item, so there is no need to
1119         do it in two different calls.
1120
1121         No new tests required as this is a refactoring.
1122
1123         * rendering/RenderGrid.cpp:
1124         (WebCore::RenderGrid::Grid::insert): Added a new parameter.
1125         (WebCore::RenderGrid::Grid::setSmallestTracksStart):
1126         (WebCore::RenderGrid::Grid::smallestTrackStart):
1127         (WebCore::RenderGrid::Grid::gridItemArea):
1128         (WebCore::RenderGrid::Grid::setGridItemArea):
1129         (WebCore::RenderGrid::Grid::clear): Clear the newly added attributes.
1130         (WebCore::RenderGrid::repeatTracksSizingIfNeeded):
1131         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
1132         (WebCore::RenderGrid::rawGridTrackSize):
1133         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
1134         (WebCore::RenderGrid::computeEmptyTracksForAutoRepeat):
1135         (WebCore::RenderGrid::placeItemsOnGrid):
1136         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
1137         (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
1138         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
1139         (WebCore::RenderGrid::clearGrid):
1140         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
1141         (WebCore::RenderGrid::cachedGridSpan):
1142         (WebCore::RenderGrid::cachedGridArea): Deleted.
1143         * rendering/RenderGrid.h:
1144
1145 2016-11-27  Sam Weinig  <sam@webkit.org>
1146
1147         Remove unused DOMRequestState
1148         https://bugs.webkit.org/show_bug.cgi?id=165085
1149
1150         Reviewed by Simon Fraser.
1151
1152         Remove DOMRequestState. It was unused.
1153
1154         * Modules/fetch/FetchBody.cpp:
1155         * WebCore.xcodeproj/project.pbxproj:
1156         * bindings/js/DOMRequestState.h: Removed.
1157
1158 2016-11-27  Csaba Osztrogonác  <ossy@webkit.org>
1159
1160         Fix various --minimal build issues
1161         https://bugs.webkit.org/show_bug.cgi?id=165060
1162
1163         Reviewed by Darin Adler.
1164
1165         * css/parser/CSSPropertyParser.cpp:
1166         * dom/Document.cpp:
1167         * loader/EmptyClients.cpp:
1168
1169 2016-11-26  Yusuke Suzuki  <utatane.tea@gmail.com>
1170
1171         [WTF] Import std::optional reference implementation as WTF::Optional
1172         https://bugs.webkit.org/show_bug.cgi?id=164199
1173
1174         Reviewed by Saam Barati and Sam Weinig.
1175
1176         Rename valueOr to value_or. This is specified in C++17 proposal.
1177
1178         Use Optional::emplace. C++17 Optional::operator=(Optional&&) requires
1179         either copy assignment operator or move assignment operator. But
1180         DFG::JSValueOperand etc. only defines move constructors and drop
1181         implicit copy assignment operators.
1182
1183         It was OK in the previous WTF::Optional since it always uses move
1184         constructors. But it is not valid in C++17 Optional. We use Optional::emplace
1185         instead. This function has the same semantics to the previous WTF::Optional's
1186         operator=.
1187
1188         No behavior change.
1189
1190         * Modules/applepay/ApplePaySession.cpp:
1191         (WebCore::parseAmount):
1192         (WebCore::createContactFields):
1193         (WebCore::toLineItemType):
1194         (WebCore::createLineItem):
1195         (WebCore::createLineItems):
1196         (WebCore::createMerchantCapabilities):
1197         (WebCore::createSupportedNetworks):
1198         (WebCore::toShippingType):
1199         (WebCore::createShippingMethod):
1200         (WebCore::createShippingMethods):
1201         (WebCore::createPaymentRequest):
1202         (WebCore::toPaymentAuthorizationStatus):
1203         * Modules/applepay/PaymentContact.h:
1204         * Modules/applepay/PaymentCoordinator.cpp:
1205         (WebCore::PaymentCoordinator::completeShippingMethodSelection):
1206         (WebCore::PaymentCoordinator::completeShippingContactSelection):
1207         (WebCore::PaymentCoordinator::completePaymentMethodSelection):
1208         * Modules/applepay/PaymentCoordinator.h:
1209         * Modules/applepay/PaymentCoordinatorClient.h:
1210         * Modules/applepay/PaymentMerchantSession.h:
1211         * Modules/applepay/PaymentRequest.h:
1212         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
1213         (WebCore::PaymentContact::fromJS):
1214         * Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm:
1215         (WebCore::PaymentMerchantSession::fromJS):
1216         * Modules/encryptedmedia/MediaKeyStatusMap.cpp:
1217         (WebCore::MediaKeyStatusMap::Iterator::next):
1218         * Modules/encryptedmedia/MediaKeyStatusMap.h:
1219         * Modules/fetch/FetchBody.cpp:
1220         (WebCore::FetchBody::extract):
1221         * Modules/fetch/FetchBody.h:
1222         * Modules/fetch/FetchBodyOwner.cpp:
1223         (WebCore::FetchBodyOwner::FetchBodyOwner):
1224         (WebCore::FetchBodyOwner::loadBlob):
1225         (WebCore::FetchBodyOwner::finishBlobLoading):
1226         * Modules/fetch/FetchBodyOwner.h:
1227         * Modules/fetch/FetchHeaders.cpp:
1228         (WebCore::FetchHeaders::Iterator::next):
1229         * Modules/fetch/FetchHeaders.h:
1230         * Modules/fetch/FetchRequest.cpp:
1231         (WebCore::setReferrerPolicy):
1232         (WebCore::setMode):
1233         (WebCore::setCredentials):
1234         (WebCore::setCache):
1235         (WebCore::setRedirect):
1236         (WebCore::setMethod):
1237         (WebCore::setReferrer):
1238         (WebCore::buildOptions):
1239         (WebCore::FetchRequest::clone):
1240         * Modules/fetch/FetchRequest.h:
1241         (WebCore::FetchRequest::FetchRequest):
1242         * Modules/fetch/FetchResponse.cpp:
1243         (WebCore::FetchResponse::FetchResponse):
1244         (WebCore::FetchResponse::cloneForJS):
1245         (WebCore::FetchResponse::fetch):
1246         (WebCore::FetchResponse::BodyLoader::didSucceed):
1247         (WebCore::FetchResponse::BodyLoader::didFail):
1248         (WebCore::FetchResponse::BodyLoader::didReceiveResponse):
1249         (WebCore::FetchResponse::BodyLoader::stop):
1250         * Modules/fetch/FetchResponse.h:
1251         * Modules/geolocation/Coordinates.cpp:
1252         (WebCore::Coordinates::altitude):
1253         (WebCore::Coordinates::altitudeAccuracy):
1254         (WebCore::Coordinates::heading):
1255         (WebCore::Coordinates::speed):
1256         * Modules/geolocation/Coordinates.h:
1257         * Modules/indexeddb/IDBCursor.cpp:
1258         (WebCore::IDBCursor::stringToDirection):
1259         * Modules/indexeddb/IDBCursor.h:
1260         * Modules/indexeddb/IDBDatabase.h:
1261         * Modules/indexeddb/IDBDatabaseIdentifier.h:
1262         (WebCore::IDBDatabaseIdentifier::hash):
1263         * Modules/indexeddb/IDBFactory.cpp:
1264         (WebCore::IDBFactory::open):
1265         * Modules/indexeddb/IDBFactory.h:
1266         * Modules/indexeddb/IDBIndex.cpp:
1267         (WebCore::IDBIndex::getAll):
1268         (WebCore::IDBIndex::getAllKeys):
1269         * Modules/indexeddb/IDBIndex.h:
1270         * Modules/indexeddb/IDBKeyPath.h:
1271         (WebCore::isolatedCopy):
1272         * Modules/indexeddb/IDBObjectStore.cpp:
1273         (WebCore::IDBObjectStore::keyPath):
1274         (WebCore::IDBObjectStore::getAll):
1275         (WebCore::IDBObjectStore::getAllKeys):
1276         * Modules/indexeddb/IDBObjectStore.h:
1277         * Modules/indexeddb/IDBTransaction.cpp:
1278         (WebCore::IDBTransaction::requestGetAllObjectStoreRecords):
1279         (WebCore::IDBTransaction::requestGetAllIndexRecords):
1280         * Modules/indexeddb/IDBTransaction.h:
1281         * Modules/indexeddb/IDBVersionChangeEvent.cpp:
1282         (WebCore::IDBVersionChangeEvent::IDBVersionChangeEvent):
1283         * Modules/indexeddb/IDBVersionChangeEvent.h:
1284         * Modules/indexeddb/server/IDBSerialization.cpp:
1285         (WebCore::serializeIDBKeyPath):
1286         (WebCore::deserializeIDBKeyPath):
1287         * Modules/indexeddb/server/IDBSerialization.h:
1288         * Modules/indexeddb/server/MemoryIndex.cpp:
1289         (WebCore::IDBServer::MemoryIndex::getAllRecords):
1290         * Modules/indexeddb/server/MemoryIndex.h:
1291         * Modules/indexeddb/server/MemoryObjectStore.cpp:
1292         (WebCore::IDBServer::MemoryObjectStore::getAllRecords):
1293         * Modules/indexeddb/server/MemoryObjectStore.h:
1294         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
1295         (WebCore::IDBServer::MemoryObjectStoreCursor::objectStoreCleared):
1296         (WebCore::IDBServer::MemoryObjectStoreCursor::keyDeleted):
1297         (WebCore::IDBServer::MemoryObjectStoreCursor::setFirstInRemainingRange):
1298         (WebCore::IDBServer::MemoryObjectStoreCursor::setForwardIteratorFromRemainingRange):
1299         (WebCore::IDBServer::MemoryObjectStoreCursor::setReverseIteratorFromRemainingRange):
1300         (WebCore::IDBServer::MemoryObjectStoreCursor::incrementForwardIterator):
1301         (WebCore::IDBServer::MemoryObjectStoreCursor::incrementReverseIterator):
1302         * Modules/indexeddb/server/MemoryObjectStoreCursor.h:
1303         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1304         (WebCore::IDBServer::SQLiteIDBBackingStore::extractExistingDatabaseInfo):
1305         * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
1306         (WebCore::IDBDatabaseInfo::createNewObjectStore):
1307         * Modules/indexeddb/shared/IDBDatabaseInfo.h:
1308         * Modules/indexeddb/shared/IDBGetAllRecordsData.h:
1309         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
1310         (WebCore::IDBObjectStoreInfo::IDBObjectStoreInfo):
1311         * Modules/indexeddb/shared/IDBObjectStoreInfo.h:
1312         (WebCore::IDBObjectStoreInfo::keyPath):
1313         * Modules/mediacontrols/MediaControlsHost.cpp:
1314         (WebCore::MediaControlsHost::displayNameForTrack):
1315         * Modules/mediacontrols/MediaControlsHost.h:
1316         * Modules/mediasource/MediaSource.cpp:
1317         (WebCore::MediaSource::endOfStream):
1318         (WebCore::MediaSource::streamEndedWithError):
1319         * Modules/mediasource/MediaSource.h:
1320         * Modules/mediastream/MediaStreamTrack.h:
1321         * Modules/mediastream/PeerConnectionBackend.cpp:
1322         (WebCore::PeerConnectionBackend::createOfferSucceeded):
1323         (WebCore::PeerConnectionBackend::createOfferFailed):
1324         (WebCore::PeerConnectionBackend::createAnswerSucceeded):
1325         (WebCore::PeerConnectionBackend::createAnswerFailed):
1326         (WebCore::PeerConnectionBackend::setLocalDescriptionSucceeded):
1327         (WebCore::PeerConnectionBackend::setLocalDescriptionFailed):
1328         (WebCore::PeerConnectionBackend::setRemoteDescriptionSucceeded):
1329         (WebCore::PeerConnectionBackend::setRemoteDescriptionFailed):
1330         (WebCore::PeerConnectionBackend::addIceCandidateSucceeded):
1331         (WebCore::PeerConnectionBackend::addIceCandidateFailed):
1332         (WebCore::PeerConnectionBackend::stop):
1333         * Modules/mediastream/PeerConnectionBackend.h:
1334         * Modules/mediastream/RTCDTMFSender.cpp:
1335         (WebCore::RTCDTMFSender::insertDTMF):
1336         * Modules/mediastream/RTCDTMFSender.h:
1337         * Modules/mediastream/RTCIceCandidate.cpp:
1338         (WebCore::RTCIceCandidate::create):
1339         (WebCore::RTCIceCandidate::RTCIceCandidate):
1340         * Modules/mediastream/RTCIceCandidate.h:
1341         (WebCore::RTCIceCandidate::sdpMLineIndex):
1342         * Modules/mediastream/SDPProcessor.cpp:
1343         (WebCore::iceCandidateFromJSON):
1344         * Modules/proximity/DeviceProximityEvent.h:
1345         * Modules/streams/ReadableStreamSource.h:
1346         (WebCore::ReadableStreamSource::startFinished):
1347         (WebCore::ReadableStreamSource::pullFinished):
1348         (WebCore::ReadableStreamSource::clean):
1349         * Modules/webaudio/AudioBufferSourceNode.cpp:
1350         (WebCore::AudioBufferSourceNode::start):
1351         * Modules/webaudio/AudioBufferSourceNode.h:
1352         * Modules/webdatabase/SQLResultSet.h:
1353         * Modules/websockets/WebSocket.cpp:
1354         (WebCore::WebSocket::close):
1355         * Modules/websockets/WebSocket.h:
1356         * Modules/websockets/WebSocketChannel.cpp:
1357         (WebCore::WebSocketChannel::didReceiveSocketStreamData):
1358         * Modules/websockets/WebSocketChannel.h:
1359         * bindings/generic/IDLTypes.h:
1360         (WebCore::IDLType::nullValue):
1361         * bindings/js/CachedModuleScript.h:
1362         (WebCore::CachedModuleScript::error):
1363         * bindings/js/Dictionary.h:
1364         (WebCore::Dictionary::get):
1365         * bindings/js/IDBBindingUtilities.cpp:
1366         (WebCore::toJS):
1367         * bindings/js/IDBBindingUtilities.h:
1368         * bindings/js/JSCryptoKeySerializationJWK.cpp:
1369         (WebCore::JSCryptoKeySerializationJWK::reconcileAlgorithm):
1370         * bindings/js/JSCryptoKeySerializationJWK.h:
1371         * bindings/js/JSDOMConvert.h:
1372         (WebCore::Detail::VariadicConverterBase::convert):
1373         (WebCore::Detail::VariadicConverterBase<IDLInterface<T>>::convert):
1374         (WebCore::convertVariadicArguments):
1375         * bindings/js/JSDOMIterator.h:
1376         (WebCore::IteratorTraits>::next):
1377         * bindings/js/JSDOMPromise.h:
1378         (WebCore::DOMPromise::DOMPromise):
1379         (WebCore::DOMPromise::operator=):
1380         * bindings/js/JSDOMWindowCustom.cpp:
1381         (WebCore::JSDOMWindow::getOwnPropertySlot):
1382         * bindings/js/JSDictionary.h:
1383         (WebCore::JSDictionary::convertValue):
1384         * bindings/js/JSFileCustom.cpp:
1385         (WebCore::constructJSFile):
1386         * bindings/js/JSHTMLAllCollectionCustom.cpp:
1387         (WebCore::callHTMLAllCollection):
1388         (WebCore::JSHTMLAllCollection::item):
1389         * bindings/js/JSHTMLCanvasElementCustom.cpp:
1390         (WebCore::JSHTMLCanvasElement::toDataURL):
1391         * bindings/js/JSImageConstructor.cpp:
1392         (WebCore::JSImageConstructor::construct):
1393         * bindings/js/JSMediaDevicesCustom.cpp:
1394         (WebCore::createStringConstraint):
1395         (WebCore::createBooleanConstraint):
1396         (WebCore::createDoubleConstraint):
1397         (WebCore::createIntConstraint):
1398         * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
1399         (WebCore::importKey):
1400         * bindings/js/ScriptController.cpp:
1401         (WebCore::ScriptController::setupModuleScriptHandlers):
1402         (WebCore::ScriptController::executeScriptInWorld):
1403         (WebCore::ScriptController::executeScript):
1404         * bindings/scripts/CodeGeneratorJS.pm:
1405         (GenerateGetOwnPropertySlotBody):
1406         (GenerateEnumerationImplementationContent):
1407         (GenerateEnumerationHeaderContent):
1408         (GenerateDefaultValue):
1409         (GenerateImplementation):
1410         (GenerateParametersCheck):
1411         * bindings/scripts/test/JS/JSFloat64Array.cpp:
1412         (WebCore::JSFloat64Array::getOwnPropertySlot):
1413         (WebCore::JSFloat64Array::getOwnPropertyDescriptor):
1414         (WebCore::JSFloat64Array::put):
1415         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1416         (WebCore::JSTestEventTarget::getOwnPropertySlot):
1417         * bindings/scripts/test/JS/JSTestObj.cpp:
1418         (WebCore::parseEnumeration<TestObj::EnumType>):
1419         (WebCore::parseEnumeration<TestObj::Optional>):
1420         (WebCore::parseEnumeration<AlternateEnumName>):
1421         (WebCore::parseEnumeration<TestObj::EnumA>):
1422         (WebCore::parseEnumeration<TestObj::EnumB>):
1423         (WebCore::parseEnumeration<TestObj::EnumC>):
1424         (WebCore::parseEnumeration<TestObj::Kind>):
1425         (WebCore::parseEnumeration<TestObj::Size>):
1426         (WebCore::parseEnumeration<TestObj::Confidence>):
1427         (WebCore::convertDictionary<TestObj::Dictionary>):
1428         (WebCore::JSTestObj::getOwnPropertySlot):
1429         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalEnumArgCaller):
1430         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArgCaller):
1431         (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArgCaller):
1432         (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgsCaller):
1433         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalLongLongCaller):
1434         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUnsignedLongLongCaller):
1435         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequenceCaller):
1436         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBooleanCaller):
1437         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalRecordCaller):
1438         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod2Caller):
1439         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2Caller):
1440         (WebCore::jsTestObjConstructorFunctionClassMethodWithOptional):
1441         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentCaller):
1442         * bindings/scripts/test/JS/JSTestObj.h:
1443         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
1444         (WebCore::parseEnumeration<TestStandaloneDictionary::EnumInStandaloneDictionaryFile>):
1445         * bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
1446         * bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp:
1447         (WebCore::parseEnumeration<TestStandaloneEnumeration>):
1448         * bindings/scripts/test/JS/JSTestStandaloneEnumeration.h:
1449         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1450         (WebCore::jsTestTypedefsPrototypeFunctionSetShadowCaller):
1451         (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClampCaller):
1452         * bridge/runtime_array.cpp:
1453         (JSC::RuntimeArray::getOwnPropertySlot):
1454         (JSC::RuntimeArray::put):
1455         * crypto/CryptoAlgorithmRegistry.cpp:
1456         (WebCore::CryptoAlgorithmRegistry::identifier):
1457         * crypto/CryptoAlgorithmRegistry.h:
1458         * crypto/CryptoKeySerialization.h:
1459         * crypto/JsonWebKey.h:
1460         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
1461         (WebCore::CryptoAlgorithmAES_CBC::importKey):
1462         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
1463         (WebCore::CryptoAlgorithmAES_KW::importKey):
1464         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
1465         (WebCore::CryptoAlgorithmHMAC::generateKey):
1466         (WebCore::CryptoAlgorithmHMAC::importKey):
1467         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
1468         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
1469         * crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
1470         (WebCore::calculateSignature):
1471         * crypto/keys/CryptoKeyAES.h:
1472         * crypto/keys/CryptoKeyHMAC.h:
1473         * crypto/keys/CryptoKeyRSA.cpp:
1474         (WebCore::CryptoKeyRSA::importJwk):
1475         * crypto/keys/CryptoKeyRSA.h:
1476         * crypto/keys/CryptoKeySerializationRaw.cpp:
1477         (WebCore::CryptoKeySerializationRaw::reconcileAlgorithm):
1478         * crypto/keys/CryptoKeySerializationRaw.h:
1479         * crypto/mac/CryptoAlgorithmHMACMac.cpp:
1480         (WebCore::commonCryptoHMACAlgorithm):
1481         * crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
1482         (WebCore::cryptoDigestAlgorithm):
1483         * crypto/parameters/CryptoAlgorithmHmacKeyParams.h:
1484         * crypto/parameters/CryptoAlgorithmRsaOaepParams.h:
1485         * css/CSSFontFace.cpp:
1486         (WebCore::CSSFontFace::calculateStyleMask):
1487         (WebCore::CSSFontFace::calculateWeightMask):
1488         * css/CSSFontFace.h:
1489         * css/CSSFontFaceSet.cpp:
1490         (WebCore::computeFontTraitsMask):
1491         * css/CSSPrimitiveValue.cpp:
1492         (WebCore::CSSPrimitiveValue::doubleValue):
1493         (WebCore::CSSPrimitiveValue::doubleValueInternal):
1494         * css/CSSPrimitiveValue.h:
1495         * css/CSSPropertyNames.in:
1496         * css/CSSSegmentedFontFace.cpp:
1497         * css/CSSStyleSheet.cpp:
1498         (WebCore::CSSStyleSheet::create):
1499         (WebCore::CSSStyleSheet::CSSStyleSheet):
1500         (WebCore::CSSStyleSheet::addRule):
1501         * css/CSSStyleSheet.h:
1502         * css/FontFace.cpp:
1503         (WebCore::FontFace::fontStateChanged):
1504         * css/FontFace.h:
1505         * css/FontFaceSet.cpp:
1506         (WebCore::FontFaceSet::completedLoading):
1507         * css/FontFaceSet.h:
1508         * css/MediaQueryEvaluator.cpp:
1509         (WebCore::doubleValue):
1510         * css/StyleBuilderConverter.h:
1511         (WebCore::StyleBuilderConverter::convertGridPosition):
1512         (WebCore::StyleBuilderConverter::convertWordSpacing):
1513         (WebCore::StyleBuilderConverter::convertPerspective):
1514         (WebCore::StyleBuilderConverter::convertMarqueeIncrement):
1515         (WebCore::StyleBuilderConverter::convertFilterOperations):
1516         (WebCore::StyleBuilderConverter::convertLineHeight):
1517         * css/StyleBuilderCustom.h:
1518         (WebCore::StyleBuilderCustom::applyValueLineHeight):
1519         * css/StyleRuleImport.cpp:
1520         (WebCore::StyleRuleImport::requestStyleSheet):
1521         * css/parser/CSSParser.cpp:
1522         (WebCore::CSSParser::parseCubicBezierTimingFunctionValue):
1523         (WebCore::CSSParser::parseSpringTimingFunctionValue):
1524         (WebCore::CSSParser::parseColorFunctionParameters):
1525         (WebCore::CSSParser::parseColorFromValue):
1526         * css/parser/CSSParser.h:
1527         * cssjit/SelectorCompiler.cpp:
1528         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateAddStyleRelationIfResolvingStyle):
1529         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateAddStyleRelation):
1530         * dom/CustomElementReactionQueue.cpp:
1531         * dom/Document.cpp:
1532         (WebCore::Document::lastModified):
1533         * dom/Element.cpp:
1534         (WebCore::Element::scrollBy):
1535         (WebCore::Element::getIntegralAttribute):
1536         (WebCore::Element::getUnsignedIntegralAttribute):
1537         (WebCore::Element::resolveCustomStyle):
1538         * dom/Element.h:
1539         * dom/ElementIteratorAssertions.h:
1540         (WebCore::ElementIteratorAssertions::dropEventDispatchAssertion):
1541         (WebCore::ElementIteratorAssertions::clear):
1542         * dom/ExceptionOr.h:
1543         * dom/InlineStyleSheetOwner.cpp:
1544         (WebCore::makeInlineStyleSheetCacheKey):
1545         * dom/KeyboardEvent.h:
1546         * dom/LoadableClassicScript.cpp:
1547         (WebCore::LoadableClassicScript::error):
1548         * dom/LoadableClassicScript.h:
1549         * dom/LoadableModuleScript.cpp:
1550         (WebCore::LoadableModuleScript::error):
1551         * dom/LoadableModuleScript.h:
1552         * dom/LoadableScript.h:
1553         * dom/MessageEvent.cpp:
1554         (WebCore::MessageEvent::MessageEvent):
1555         (WebCore::MessageEvent::create):
1556         (WebCore::MessageEvent::initMessageEvent):
1557         * dom/MessageEvent.h:
1558         * dom/MutationObserver.cpp:
1559         (WebCore::MutationObserver::observe):
1560         * dom/MutationObserver.h:
1561         * dom/ProcessingInstruction.cpp:
1562         (WebCore::ProcessingInstruction::checkStyleSheet):
1563         * dom/PseudoElement.cpp:
1564         (WebCore::PseudoElement::resolveCustomStyle):
1565         * dom/PseudoElement.h:
1566         * dom/RangeBoundaryPoint.h:
1567         (WebCore::RangeBoundaryPoint::setToBeforeChild):
1568         (WebCore::RangeBoundaryPoint::setToAfterChild):
1569         (WebCore::RangeBoundaryPoint::setToEndOfNode):
1570         (WebCore::RangeBoundaryPoint::invalidateOffset):
1571         * dom/ScriptElement.cpp:
1572         (WebCore::ScriptElement::determineScriptType):
1573         (WebCore::ScriptElement::prepareScript):
1574         (WebCore::ScriptElement::executeScriptAndDispatchEvent):
1575         * dom/ScriptElement.h:
1576         * dom/TextDecoder.cpp:
1577         (WebCore::TextDecoder::decode):
1578         * dom/TextDecoder.h:
1579         * dom/UserGestureIndicator.cpp:
1580         (WebCore::UserGestureIndicator::UserGestureIndicator):
1581         * dom/UserGestureIndicator.h:
1582         * editing/CompositeEditCommand.cpp:
1583         (WebCore::CompositeEditCommand::moveParagraphs):
1584         * editing/CompositeEditCommand.h:
1585         * fileapi/File.h:
1586         * history/CachedFrame.h:
1587         (WebCore::CachedFrame::hasInsecureContent):
1588         * html/DOMTokenList.cpp:
1589         (WebCore::DOMTokenList::toggle):
1590         * html/DOMTokenList.h:
1591         * html/HTMLAnchorElement.cpp:
1592         (WebCore::HTMLAnchorElement::handleClick):
1593         * html/HTMLCanvasElement.cpp:
1594         (WebCore::HTMLCanvasElement::toDataURL):
1595         * html/HTMLCanvasElement.h:
1596         * html/HTMLElement.cpp:
1597         (WebCore::HTMLElement::parseBorderWidthAttribute):
1598         (WebCore::HTMLElement::parseAttribute):
1599         * html/HTMLImageElement.cpp:
1600         (WebCore::HTMLImageElement::createForJSConstructor):
1601         (WebCore::HTMLImageElement::width):
1602         (WebCore::HTMLImageElement::height):
1603         * html/HTMLImageElement.h:
1604         * html/HTMLInputElement.cpp:
1605         (WebCore::HTMLInputElement::findClosestTickMarkValue):
1606         (WebCore::HTMLInputElement::maxLengthAttributeChanged):
1607         (WebCore::HTMLInputElement::minLengthAttributeChanged):
1608         * html/HTMLInputElement.h:
1609         * html/HTMLLinkElement.cpp:
1610         (WebCore::HTMLLinkElement::process):
1611         (WebCore::HTMLLinkElement::initializeStyleSheet):
1612         (WebCore::HTMLLinkElement::iconType):
1613         * html/HTMLLinkElement.h:
1614         * html/HTMLOListElement.h:
1615         * html/HTMLOptionsCollection.cpp:
1616         (WebCore::HTMLOptionsCollection::add):
1617         * html/HTMLOptionsCollection.h:
1618         * html/HTMLSelectElement.cpp:
1619         (WebCore::HTMLSelectElement::add):
1620         (WebCore::HTMLSelectElement::setLength):
1621         * html/HTMLSelectElement.h:
1622         * html/HTMLTextAreaElement.cpp:
1623         (WebCore::HTMLTextAreaElement::maxLengthAttributeChanged):
1624         (WebCore::HTMLTextAreaElement::minLengthAttributeChanged):
1625         * html/ImageInputType.cpp:
1626         (WebCore::ImageInputType::height):
1627         (WebCore::ImageInputType::width):
1628         * html/InputType.cpp:
1629         (WebCore::InputType::findClosestTickMarkValue):
1630         * html/InputType.h:
1631         * html/LinkIconCollector.cpp:
1632         * html/LinkRelAttribute.h:
1633         * html/RangeInputType.cpp:
1634         (WebCore::RangeInputType::findClosestTickMarkValue):
1635         * html/RangeInputType.h:
1636         * html/canvas/CanvasRenderingContext2D.cpp:
1637         (WebCore::CanvasRenderingContext2D::restore):
1638         (WebCore::CanvasRenderingContext2D::setStrokeColor):
1639         (WebCore::CanvasRenderingContext2D::setFillColor):
1640         (WebCore::CanvasRenderingContext2D::isPointInPathInternal):
1641         (WebCore::CanvasRenderingContext2D::isPointInStrokeInternal):
1642         (WebCore::CanvasRenderingContext2D::setShadow):
1643         (WebCore::CanvasRenderingContext2D::fillText):
1644         (WebCore::CanvasRenderingContext2D::strokeText):
1645         (WebCore::CanvasRenderingContext2D::drawTextInternal):
1646         * html/canvas/CanvasRenderingContext2D.h:
1647         * html/canvas/WebGL2RenderingContext.cpp:
1648         (WebCore::arrayBufferViewElementSize):
1649         * html/canvas/WebGLRenderingContextBase.cpp:
1650         (WebCore::WebGLRenderingContextBase::bufferData):
1651         (WebCore::WebGLRenderingContextBase::bufferSubData):
1652         (WebCore::WebGLRenderingContextBase::texSubImage2D):
1653         (WebCore::WebGLRenderingContextBase::validateArrayBufferType):
1654         (WebCore::WebGLRenderingContextBase::validateTexFuncData):
1655         (WebCore::WebGLRenderingContextBase::texImage2D):
1656         * html/canvas/WebGLRenderingContextBase.h:
1657         * html/parser/HTMLConstructionSite.cpp:
1658         (WebCore::HTMLConstructionSite::indexOfFirstUnopenFormattingElement):
1659         (WebCore::HTMLConstructionSite::reconstructTheActiveFormattingElements):
1660         * html/parser/HTMLConstructionSite.h:
1661         * html/parser/HTMLParserIdioms.cpp:
1662         (WebCore::parseHTMLIntegerInternal):
1663         (WebCore::parseHTMLInteger):
1664         (WebCore::parseHTMLNonNegativeInteger):
1665         (WebCore::parseValidHTMLNonNegativeIntegerInternal):
1666         (WebCore::parseValidHTMLNonNegativeInteger):
1667         (WebCore::parseValidHTMLFloatingPointNumberInternal):
1668         (WebCore::parseValidHTMLFloatingPointNumber):
1669         (WebCore::parseHTTPRefreshInternal):
1670         * html/parser/HTMLParserIdioms.h:
1671         (WebCore::limitToOnlyHTMLNonNegative):
1672         * html/parser/HTMLSrcsetParser.cpp:
1673         (WebCore::parseDescriptors):
1674         * html/shadow/SliderThumbElement.cpp:
1675         (WebCore::SliderThumbElement::setPositionFromPoint):
1676         (WebCore::SliderThumbElement::resolveCustomStyle):
1677         (WebCore::SliderContainerElement::resolveCustomStyle):
1678         * html/shadow/SliderThumbElement.h:
1679         * html/shadow/TextControlInnerElements.cpp:
1680         (WebCore::TextControlInnerElement::resolveCustomStyle):
1681         (WebCore::TextControlInnerTextElement::resolveCustomStyle):
1682         (WebCore::TextControlPlaceholderElement::resolveCustomStyle):
1683         * html/shadow/TextControlInnerElements.h:
1684         * html/track/TrackEvent.h:
1685         * inspector/InspectorIndexedDBAgent.cpp:
1686         * inspector/InspectorInstrumentation.cpp:
1687         (WebCore::InspectorInstrumentation::didFinishXHRLoadingImpl):
1688         * inspector/InspectorInstrumentation.h:
1689         (WebCore::InspectorInstrumentation::didFinishXHRLoading):
1690         * inspector/InspectorStyleSheet.cpp:
1691         (WebCore::InspectorStyleSheet::addRule):
1692         * inspector/InspectorTimelineAgent.cpp:
1693         (WebCore::InspectorTimelineAgent::setInstruments):
1694         * loader/DocumentLoader.cpp:
1695         (WebCore::DocumentLoader::startIconLoading):
1696         * loader/DocumentThreadableLoader.cpp:
1697         (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequestWithPreflight):
1698         (WebCore::DocumentThreadableLoader::clearResource):
1699         (WebCore::DocumentThreadableLoader::preflightSuccess):
1700         (WebCore::DocumentThreadableLoader::preflightFailure):
1701         * loader/DocumentThreadableLoader.h:
1702         * loader/EmptyClients.cpp:
1703         * loader/EmptyClients.h:
1704         * loader/FrameLoader.cpp:
1705         (WebCore::FrameLoader::urlSelected):
1706         (WebCore::FrameLoader::receivedFirstData):
1707         (WebCore::FrameLoader::commitProvisionalLoad):
1708         (WebCore::FrameLoader::open):
1709         (WebCore::FrameLoader::dispatchDidCommitLoad):
1710         (WebCore::FrameLoader::clearTestingOverrides):
1711         * loader/FrameLoader.h:
1712         * loader/FrameLoaderClient.h:
1713         * loader/LinkLoader.cpp:
1714         (WebCore::LinkLoader::resourceTypeFromAsAttribute):
1715         (WebCore::LinkLoader::loadLink):
1716         * loader/LinkLoader.h:
1717         * loader/SubresourceLoader.cpp:
1718         (WebCore::SubresourceLoader::SubresourceLoader):
1719         (WebCore::SubresourceLoader::didReceiveResponse):
1720         (WebCore::SubresourceLoader::notifyDone):
1721         * loader/SubresourceLoader.h:
1722         * loader/cache/CachedResource.cpp:
1723         (WebCore::CachedResource::setLoadPriority):
1724         * loader/cache/CachedResource.h:
1725         * loader/cache/CachedResourceRequest.cpp:
1726         (WebCore::CachedResourceRequest::CachedResourceRequest):
1727         * loader/cache/CachedResourceRequest.h:
1728         (WebCore::CachedResourceRequest::priority):
1729         * mathml/MathMLElement.h:
1730         (WebCore::MathMLElement::specifiedDisplayStyle):
1731         (WebCore::MathMLElement::specifiedMathVariant):
1732         * mathml/MathMLFractionElement.cpp:
1733         (WebCore::MathMLFractionElement::cachedFractionAlignment):
1734         (WebCore::MathMLFractionElement::parseAttribute):
1735         * mathml/MathMLFractionElement.h:
1736         * mathml/MathMLMathElement.cpp:
1737         (WebCore::MathMLMathElement::specifiedDisplayStyle):
1738         (WebCore::MathMLMathElement::parseAttribute):
1739         * mathml/MathMLMathElement.h:
1740         * mathml/MathMLMencloseElement.cpp:
1741         (WebCore::MathMLMencloseElement::parseAttribute):
1742         * mathml/MathMLMencloseElement.h:
1743         * mathml/MathMLOperatorDictionary.cpp:
1744         (WebCore::MathMLOperatorDictionary::search):
1745         * mathml/MathMLOperatorDictionary.h:
1746         * mathml/MathMLOperatorElement.cpp:
1747         (WebCore::MathMLOperatorElement::computeOperatorFlag):
1748         (WebCore::MathMLOperatorElement::childrenChanged):
1749         (WebCore::attributeNameToPropertyFlag):
1750         (WebCore::MathMLOperatorElement::parseAttribute):
1751         * mathml/MathMLOperatorElement.h:
1752         * mathml/MathMLPaddedElement.cpp:
1753         (WebCore::MathMLPaddedElement::parseAttribute):
1754         * mathml/MathMLPaddedElement.h:
1755         * mathml/MathMLPresentationElement.cpp:
1756         (WebCore::MathMLPresentationElement::cachedBooleanAttribute):
1757         (WebCore::MathMLPresentationElement::cachedMathMLLength):
1758         (WebCore::MathMLPresentationElement::specifiedDisplayStyle):
1759         (WebCore::MathMLPresentationElement::specifiedMathVariant):
1760         (WebCore::MathMLPresentationElement::parseAttribute):
1761         * mathml/MathMLPresentationElement.h:
1762         (WebCore::MathMLPresentationElement::toOptionalBool):
1763         * mathml/MathMLScriptsElement.cpp:
1764         (WebCore::MathMLScriptsElement::parseAttribute):
1765         * mathml/MathMLScriptsElement.h:
1766         * mathml/MathMLSpaceElement.cpp:
1767         (WebCore::MathMLSpaceElement::parseAttribute):
1768         * mathml/MathMLSpaceElement.h:
1769         * mathml/MathMLTokenElement.cpp:
1770         (WebCore::MathMLTokenElement::convertToSingleCodePoint):
1771         * mathml/MathMLTokenElement.h:
1772         * mathml/MathMLUnderOverElement.cpp:
1773         (WebCore::MathMLUnderOverElement::parseAttribute):
1774         * mathml/MathMLUnderOverElement.h:
1775         * page/ChromeClient.h:
1776         * page/DOMTimer.cpp:
1777         (WebCore::DOMTimer::alignedFireTime):
1778         * page/DOMTimer.h:
1779         * page/DOMWindow.cpp:
1780         (WebCore::DOMWindow::scrollBy):
1781         * page/DOMWindow.h:
1782         * page/EventSource.cpp:
1783         (WebCore::EventSource::parseEventStream):
1784         (WebCore::EventSource::parseEventStreamLine):
1785         * page/EventSource.h:
1786         * page/FrameView.cpp:
1787         (WebCore::FrameView::recalculateScrollbarOverlayStyle):
1788         (WebCore::FrameView::setLayoutViewportOverrideRect):
1789         (WebCore::FrameView::setViewExposedRect):
1790         * page/FrameView.h:
1791         * page/Page.cpp:
1792         (WebCore::Page::takeAnyMediaCanStartListener):
1793         * page/Page.h:
1794         (WebCore::Page::eventThrottlingBehaviorOverride):
1795         (WebCore::Page::setEventThrottlingBehaviorOverride):
1796         * page/ScrollToOptions.h:
1797         * page/SecurityOrigin.cpp:
1798         (WebCore::SecurityOrigin::SecurityOrigin):
1799         (WebCore::SecurityOrigin::create):
1800         * page/SecurityOrigin.h:
1801         (WebCore::SecurityOrigin::port):
1802         * page/SecurityOriginData.cpp:
1803         (WebCore::SecurityOriginData::debugString):
1804         (WebCore::SecurityOriginData::databaseIdentifier):
1805         (WebCore::SecurityOriginData::fromDatabaseIdentifier):
1806         * page/SecurityOriginData.h:
1807         (WebCore::SecurityOriginData::SecurityOriginData):
1808         (WebCore::SecurityOriginData::isEmpty):
1809         (WebCore::SecurityOriginDataHash::hash):
1810         * page/SecurityOriginHash.h:
1811         (WebCore::SecurityOriginHash::hash):
1812         * page/WindowFeatures.cpp:
1813         (WebCore::parseDialogFeatures):
1814         (WebCore::boolFeature):
1815         (WebCore::floatFeature):
1816         * page/WindowFeatures.h:
1817         * page/csp/ContentSecurityPolicySource.cpp:
1818         (WebCore::ContentSecurityPolicySource::ContentSecurityPolicySource):
1819         (WebCore::ContentSecurityPolicySource::portMatches):
1820         * page/csp/ContentSecurityPolicySource.h:
1821         * page/csp/ContentSecurityPolicySourceList.cpp:
1822         (WebCore::ContentSecurityPolicySourceList::parse):
1823         (WebCore::ContentSecurityPolicySourceList::parseSource):
1824         (WebCore::ContentSecurityPolicySourceList::parsePort):
1825         * page/csp/ContentSecurityPolicySourceList.h:
1826         * page/scrolling/AsyncScrollingCoordinator.cpp:
1827         (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
1828         (WebCore::AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll):
1829         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
1830         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
1831         * page/scrolling/AsyncScrollingCoordinator.h:
1832         (WebCore::AsyncScrollingCoordinator::ScheduledScrollUpdate::ScheduledScrollUpdate):
1833         * page/scrolling/ScrollingCoordinator.h:
1834         * page/scrolling/ScrollingTree.cpp:
1835         (WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling):
1836         * page/scrolling/ScrollingTree.h:
1837         * page/scrolling/ScrollingTreeScrollingNode.cpp:
1838         (WebCore::ScrollingTreeScrollingNode::setScrollPositionWithoutContentEdgeConstraints):
1839         * page/scrolling/ThreadedScrollingTree.cpp:
1840         (WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
1841         * page/scrolling/ThreadedScrollingTree.h:
1842         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
1843         (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPositionWithoutContentEdgeConstraints):
1844         * page/scrolling/ios/ScrollingTreeIOS.cpp:
1845         (WebCore::ScrollingTreeIOS::scrollingTreeNodeDidScroll):
1846         * page/scrolling/ios/ScrollingTreeIOS.h:
1847         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1848         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints):
1849         * platform/DragImage.cpp:
1850         * platform/LinkIcon.h:
1851         * platform/MemoryPressureHandler.h:
1852         * platform/ScrollView.cpp:
1853         (WebCore::ScrollView::handleDeferredScrollUpdateAfterContentSizeChange):
1854         * platform/ScrollView.h:
1855         * platform/Theme.h:
1856         (WebCore::Theme::controlFont):
1857         * platform/Timer.h:
1858         (WebCore::TimerBase::alignedFireTime):
1859         * platform/URL.cpp:
1860         (WebCore::URL::port):
1861         (WebCore::defaultPortForProtocol):
1862         (WebCore::portAllowed):
1863         * platform/URL.h:
1864         * platform/URLParser.cpp:
1865         (WebCore::URLParser::defaultPortForProtocol):
1866         (WebCore::findLongestZeroSequence):
1867         (WebCore::URLParser::parseIPv4Piece):
1868         (WebCore::URLParser::parseIPv4Host):
1869         (WebCore::URLParser::parseIPv4PieceInsideIPv6):
1870         (WebCore::URLParser::parseIPv4AddressInsideIPv6):
1871         (WebCore::URLParser::parseIPv6Host):
1872         (WebCore::URLParser::domainToASCII):
1873         (WebCore::URLParser::formURLDecode):
1874         * platform/URLParser.h:
1875         * platform/graphics/BitmapImage.h:
1876         * platform/graphics/Color.h:
1877         (WebCore::colorWithOverrideAlpha):
1878         * platform/graphics/DisplayRefreshMonitorClient.h:
1879         * platform/graphics/Font.h:
1880         * platform/graphics/FontCascade.cpp:
1881         (WebCore::FontCascade::drawText):
1882         (WebCore::FontCascade::drawEmphasisMarks):
1883         (WebCore::FontCascade::adjustSelectionRectForText):
1884         (WebCore::FontCascade::getEmphasisMarkGlyphData):
1885         (WebCore::FontCascade::emphasisMarkAscent):
1886         (WebCore::FontCascade::emphasisMarkDescent):
1887         (WebCore::FontCascade::emphasisMarkHeight):
1888         * platform/graphics/FontCascade.h:
1889         * platform/graphics/GraphicsContext.cpp:
1890         (WebCore::GraphicsContext::drawText):
1891         (WebCore::GraphicsContext::drawEmphasisMarks):
1892         (WebCore::GraphicsContext::drawBidiText):
1893         * platform/graphics/GraphicsContext.h:
1894         (WebCore::InterpolationQualityMaintainer::InterpolationQualityMaintainer):
1895         * platform/graphics/GraphicsLayer.h:
1896         (WebCore::GraphicsLayer::setPosition):
1897         (WebCore::GraphicsLayer::setApproximatePosition):
1898         * platform/graphics/Image.h:
1899         (WebCore::Image::hotSpot):
1900         * platform/graphics/ImageBuffer.h:
1901         * platform/graphics/ImageFrameCache.cpp:
1902         (WebCore::ImageFrameCache::clearMetadata):
1903         (WebCore::ImageFrameCache::metadata):
1904         (WebCore::ImageFrameCache::frameMetadataAtIndex):
1905         (WebCore::ImageFrameCache::hotSpot):
1906         * platform/graphics/ImageFrameCache.h:
1907         * platform/graphics/ImageSource.h:
1908         (WebCore::ImageSource::hotSpot):
1909         * platform/graphics/PathUtilities.cpp:
1910         (WebCore::rectFromPolygon):
1911         (WebCore::PathUtilities::pathWithShrinkWrappedRectsForOutline):
1912         * platform/graphics/ShadowBlur.cpp:
1913         (WebCore::ShadowBlur::calculateLayerBoundingRect):
1914         * platform/graphics/TiledBacking.h:
1915         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1916         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
1917         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
1918         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1919         (WebCore::SourceBufferPrivateAVFObjC::flush):
1920         (WebCore::SourceBufferPrivateAVFObjC::naturalSize):
1921         * platform/graphics/ca/GraphicsLayerCA.cpp:
1922         (WebCore::GraphicsLayerCA::computeVisibleAndCoverageRect):
1923         * platform/graphics/ca/TileController.cpp:
1924         (WebCore::TileController::setLayoutViewportRect):
1925         * platform/graphics/ca/TileController.h:
1926         * platform/graphics/cairo/ImageBufferCairo.cpp:
1927         (WebCore::ImageBuffer::toDataURL):
1928         * platform/graphics/cg/ImageBufferCG.cpp:
1929         (WebCore::encodeImage):
1930         (WebCore::dataURL):
1931         (WebCore::ImageBuffer::toDataURL):
1932         * platform/graphics/cg/ImageDecoderCG.cpp:
1933         (WebCore::ImageDecoder::hotSpot):
1934         * platform/graphics/cg/ImageDecoderCG.h:
1935         * platform/graphics/cocoa/FontCocoa.mm:
1936         (WebCore::openTypeFeature):
1937         (WebCore::advanceForColorBitmapFont):
1938         * platform/graphics/displaylists/DisplayListItems.cpp:
1939         (WebCore::DisplayList::DrawGlyphs::localBounds):
1940         (WebCore::DisplayList::DrawLine::localBounds):
1941         (WebCore::DisplayList::DrawLinesForText::localBounds):
1942         (WebCore::DisplayList::DrawLineForDocumentMarker::localBounds):
1943         (WebCore::DisplayList::DrawFocusRingPath::localBounds):
1944         (WebCore::DisplayList::DrawFocusRingRects::localBounds):
1945         (WebCore::DisplayList::StrokeRect::localBounds):
1946         (WebCore::DisplayList::StrokePath::localBounds):
1947         (WebCore::DisplayList::StrokeEllipse::localBounds):
1948         * platform/graphics/displaylists/DisplayListItems.h:
1949         (WebCore::DisplayList::DrawingItem::localBounds):
1950         * platform/graphics/displaylists/DisplayListRecorder.cpp:
1951         (WebCore::DisplayList::Recorder::updateItemExtent):
1952         (WebCore::DisplayList::Recorder::ContextState::rotate):
1953         (WebCore::DisplayList::Recorder::ContextState::concatCTM):
1954         * platform/graphics/efl/ImageBufferEfl.cpp:
1955         (WebCore::encodeImageJPEG):
1956         (WebCore::ImageBuffer::toDataURL):
1957         * platform/graphics/filters/Filter.h:
1958         (WebCore::Filter::mapAbsolutePointToLocalPoint):
1959         * platform/graphics/gtk/ImageBufferGtk.cpp:
1960         (WebCore::encodeImage):
1961         (WebCore::ImageBuffer::toDataURL):
1962         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
1963         (WebCore::HarfBuzzShaper::selectionRect):
1964         * platform/graphics/mac/ComplexTextController.cpp:
1965         (WebCore::capitalized):
1966         (WebCore::shouldSynthesize):
1967         * platform/graphics/texmap/TextureMapperLayer.cpp:
1968         (WebCore::TextureMapperLayer::paintSelfAndChildrenWithReplica):
1969         (WebCore::TextureMapperLayer::replicaTransform):
1970         (WebCore::TextureMapperLayer::mapScrollOffset):
1971         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1972         (WebCore::CoordinatedGraphicsLayer::transformedVisibleRect):
1973         (WebCore::CoordinatedGraphicsLayer::computeTransformedVisibleRect):
1974         * platform/graphics/transforms/AffineTransform.cpp:
1975         (WebCore::AffineTransform::inverse):
1976         * platform/graphics/transforms/AffineTransform.h:
1977         * platform/graphics/transforms/TransformState.cpp:
1978         (WebCore::TransformState::mappedPoint):
1979         (WebCore::TransformState::mappedSecondaryQuad):
1980         (WebCore::TransformState::mapQuad):
1981         (WebCore::TransformState::flattenWithTransform):
1982         * platform/graphics/transforms/TransformState.h:
1983         * platform/graphics/transforms/TransformationMatrix.cpp:
1984         (WebCore::TransformationMatrix::inverse):
1985         * platform/graphics/transforms/TransformationMatrix.h:
1986         * platform/graphics/win/ImageBufferDirect2D.cpp:
1987         (WebCore::ImageBuffer::toDataURL):
1988         * platform/graphics/win/ImageDecoderDirect2D.cpp:
1989         (WebCore::ImageDecoder::hotSpot):
1990         * platform/graphics/win/ImageDecoderDirect2D.h:
1991         * platform/graphics/x11/PlatformDisplayX11.cpp:
1992         (WebCore::PlatformDisplayX11::supportsXDamage):
1993         * platform/graphics/x11/PlatformDisplayX11.h:
1994         * platform/image-decoders/ImageDecoder.h:
1995         (WebCore::ImageDecoder::hotSpot):
1996         * platform/image-decoders/ico/ICOImageDecoder.cpp:
1997         (WebCore::ICOImageDecoder::hotSpot):
1998         (WebCore::ICOImageDecoder::hotSpotAtIndex):
1999         * platform/image-decoders/ico/ICOImageDecoder.h:
2000         * platform/image-encoders/JPEGImageEncoder.cpp:
2001         (WebCore::compressRGBABigEndianToJPEG):
2002         * platform/image-encoders/JPEGImageEncoder.h:
2003         * platform/ios/LegacyTileCache.h:
2004         * platform/ios/LegacyTileCache.mm:
2005         (WebCore::LegacyTileCache::setOverrideVisibleRect):
2006         * platform/ios/LegacyTileLayer.mm:
2007         (-[LegacyTileHostLayer renderInContext:]):
2008         * platform/linux/MemoryPressureHandlerLinux.cpp:
2009         * platform/mac/ThemeMac.h:
2010         * platform/mac/ThemeMac.mm:
2011         (WebCore::ThemeMac::controlFont):
2012         * platform/mediastream/MediaConstraints.cpp:
2013         (WebCore::MediaTrackConstraintSetMap::set):
2014         * platform/mediastream/MediaConstraints.h:
2015         (WebCore::MediaTrackConstraintSetMap::width):
2016         (WebCore::MediaTrackConstraintSetMap::height):
2017         (WebCore::MediaTrackConstraintSetMap::sampleRate):
2018         (WebCore::MediaTrackConstraintSetMap::sampleSize):
2019         (WebCore::MediaTrackConstraintSetMap::aspectRatio):
2020         (WebCore::MediaTrackConstraintSetMap::frameRate):
2021         (WebCore::MediaTrackConstraintSetMap::volume):
2022         (WebCore::MediaTrackConstraintSetMap::echoCancellation):
2023         (WebCore::MediaTrackConstraintSetMap::facingMode):
2024         (WebCore::MediaTrackConstraintSetMap::deviceId):
2025         (WebCore::MediaTrackConstraintSetMap::groupId):
2026         * platform/mediastream/RealtimeMediaSource.cpp:
2027         (WebCore::RealtimeMediaSource::supportsSizeAndFrameRate):
2028         (WebCore::RealtimeMediaSource::applySizeAndFrameRate):
2029         (WebCore::RealtimeMediaSource::applyConstraints):
2030         * platform/mediastream/RealtimeMediaSource.h:
2031         * platform/mediastream/mac/AVVideoCaptureSource.h:
2032         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2033         (WebCore::AVVideoCaptureSource::applySizeAndFrameRate):
2034         (WebCore::AVVideoCaptureSource::bestSessionPresetForVideoDimensions):
2035         (WebCore::AVVideoCaptureSource::supportsSizeAndFrameRate):
2036         * platform/mediastream/openwebrtc/MediaEndpointOwr.h:
2037         * platform/network/CacheValidation.cpp:
2038         (WebCore::computeCurrentAge):
2039         (WebCore::computeFreshnessLifetimeForHTTPFamily):
2040         * platform/network/CacheValidation.h:
2041         * platform/network/DataURLDecoder.h:
2042         * platform/network/HTTPHeaderMap.h:
2043         (WebCore::HTTPHeaderMap::HTTPHeaderMapConstIterator::updateKeyValue):
2044         * platform/network/HTTPParsers.cpp:
2045         (WebCore::parseHTTPDate):
2046         * platform/network/HTTPParsers.h:
2047         * platform/network/ResourceHandle.cpp:
2048         (WebCore::ResourceHandle::didReceiveResponse):
2049         * platform/network/ResourceResponseBase.cpp:
2050         (WebCore::ResourceResponseBase::cacheControlMaxAge):
2051         (WebCore::parseDateValueInHeader):
2052         (WebCore::ResourceResponseBase::date):
2053         (WebCore::ResourceResponseBase::age):
2054         (WebCore::ResourceResponseBase::expires):
2055         (WebCore::ResourceResponseBase::lastModified):
2056         * platform/network/ResourceResponseBase.h:
2057         (WebCore::ResourceResponseBase::certificateInfo):
2058         * platform/network/SocketStreamHandle.h:
2059         * platform/network/SocketStreamHandleClient.h:
2060         * platform/network/cf/SocketStreamHandleImpl.h:
2061         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
2062         (WebCore::SocketStreamHandleImpl::readStreamCallback):
2063         (WebCore::SocketStreamHandleImpl::platformSend):
2064         * platform/network/curl/SocketStreamHandleImpl.h:
2065         * platform/network/curl/SocketStreamHandleImplCurl.cpp:
2066         (WebCore::SocketStreamHandleImpl::platformSend):
2067         * platform/network/mac/CookieJarMac.mm:
2068         (WebCore::cookiesInPartitionForURL):
2069         * platform/network/soup/SocketStreamHandleImpl.h:
2070         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
2071         (WebCore::SocketStreamHandleImpl::readBytes):
2072         (WebCore::SocketStreamHandleImpl::platformSend):
2073         * rendering/BreakLines.h:
2074         (WebCore::nextBreakablePositionNonLoosely):
2075         (WebCore::nextBreakablePositionLoosely):
2076         (WebCore::isBreakable):
2077         * rendering/HitTestingTransformState.cpp:
2078         (WebCore::HitTestingTransformState::flattenWithTransform):
2079         * rendering/ImageQualityController.cpp:
2080         (WebCore::ImageQualityController::interpolationQualityFromStyle):
2081         (WebCore::ImageQualityController::chooseInterpolationQuality):
2082         * rendering/ImageQualityController.h:
2083         * rendering/InlineIterator.h:
2084         (WebCore::InlineIterator::moveTo):
2085         (WebCore::InlineIterator::nextBreakablePosition):
2086         (WebCore::InlineIterator::setNextBreakablePosition):
2087         * rendering/InlineTextBox.cpp:
2088         (WebCore::InlineTextBox::paintSelection):
2089         (WebCore::InlineTextBox::substringToRender):
2090         (WebCore::InlineTextBox::hyphenatedStringForTextRun):
2091         (WebCore::InlineTextBox::constructTextRun):
2092         * rendering/InlineTextBox.h:
2093         (WebCore::InlineTextBox::substringToRender):
2094         (WebCore::InlineTextBox::hyphenatedStringForTextRun):
2095         (WebCore::InlineTextBox::constructTextRun):
2096         * rendering/OrderIterator.cpp:
2097         (WebCore::OrderIterator::reset):
2098         * rendering/OrderIterator.h:
2099         * rendering/PaintInfo.h:
2100         (WebCore::PaintInfo::applyTransform):
2101         * rendering/RenderBlock.cpp:
2102         (WebCore::RenderBlockRareData::RenderBlockRareData):
2103         (WebCore::RenderBlock::baselinePosition):
2104         (WebCore::RenderBlock::firstLineBaseline):
2105         (WebCore::RenderBlock::inlineBlockBaseline):
2106         (WebCore::RenderBlock::setCachedFlowThreadContainingBlockNeedsUpdate):
2107         * rendering/RenderBlock.h:
2108         * rendering/RenderBlockFlow.cpp:
2109         (WebCore::RenderBlockFlow::firstLineBaseline):
2110         (WebCore::RenderBlockFlow::inlineBlockBaseline):
2111         * rendering/RenderBlockFlow.h:
2112         * rendering/RenderBox.cpp:
2113         (WebCore::RenderBox::constrainLogicalHeightByMinMax):
2114         (WebCore::RenderBox::constrainContentBoxLogicalHeightByMinMax):
2115         (WebCore::RenderBox::overrideContainingBlockContentLogicalWidth):
2116         (WebCore::RenderBox::overrideContainingBlockContentLogicalHeight):
2117         (WebCore::RenderBox::setOverrideContainingBlockContentLogicalWidth):
2118         (WebCore::RenderBox::setOverrideContainingBlockContentLogicalHeight):
2119         (WebCore::RenderBox::adjustContentBoxLogicalHeightForBoxSizing):
2120         (WebCore::RenderBox::computeLogicalHeight):
2121         (WebCore::RenderBox::computeLogicalHeightUsing):
2122         (WebCore::RenderBox::computeContentLogicalHeight):
2123         (WebCore::RenderBox::computeIntrinsicLogicalContentHeightUsing):
2124         (WebCore::RenderBox::computeContentAndScrollbarLogicalHeightUsing):
2125         (WebCore::RenderBox::computePercentageLogicalHeight):
2126         (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
2127         (WebCore::RenderBox::availableLogicalHeight):
2128         (WebCore::RenderBox::availableLogicalHeightUsing):
2129         * rendering/RenderBox.h:
2130         (WebCore::RenderBox::firstLineBaseline):
2131         (WebCore::RenderBox::inlineBlockBaseline):
2132         * rendering/RenderCombineText.cpp:
2133         (WebCore::RenderCombineText::computeTextOrigin):
2134         * rendering/RenderCombineText.h:
2135         * rendering/RenderDeprecatedFlexibleBox.cpp:
2136         (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
2137         * rendering/RenderFlexibleBox.cpp:
2138         (WebCore::RenderFlexibleBox::baselinePosition):
2139         (WebCore::RenderFlexibleBox::firstLineBaseline):
2140         (WebCore::RenderFlexibleBox::inlineBlockBaseline):
2141         (WebCore::RenderFlexibleBox::computeMainAxisExtentForChild):
2142         (WebCore::RenderFlexibleBox::preferredMainAxisContentExtentForChild):
2143         (WebCore::RenderFlexibleBox::marginBoxAscentForChild):
2144         (WebCore::RenderFlexibleBox::computeMainSizeFromAspectRatioUsing):
2145         (WebCore::RenderFlexibleBox::adjustChildSizeForAspectRatioCrossAxisMinAndMax):
2146         (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
2147         * rendering/RenderFlexibleBox.h:
2148         * rendering/RenderFlowThread.cpp:
2149         (WebCore::RenderFlowThread::addForcedRegionBreak):
2150         * rendering/RenderGrid.cpp:
2151         (WebCore::GridTrack::setGrowthLimit):
2152         (WebCore::GridTrack::setGrowthLimitCap):
2153         (WebCore::GridTrack::growthLimitCap):
2154         (WebCore::RenderGrid::GridSizingData::freeSpace):
2155         (WebCore::RenderGrid::GridSizingData::availableSpace):
2156         (WebCore::RenderGrid::GridSizingData::setAvailableSpace):
2157         (WebCore::RenderGrid::GridSizingData::setFreeSpace):
2158         (WebCore::RenderGrid::layoutBlock):
2159         (WebCore::RenderGrid::computeIntrinsicLogicalWidths):
2160         (WebCore::RenderGrid::computeIntrinsicLogicalHeight):
2161         (WebCore::RenderGrid::computeIntrinsicLogicalContentHeightUsing):
2162         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
2163         (WebCore::overrideContainingBlockContentSizeForChild):
2164         (WebCore::setOverrideContainingBlockContentSizeForChild):
2165         (WebCore::RenderGrid::logicalHeightForChild):
2166         (WebCore::RenderGrid::minSizeForChild):
2167         (WebCore::RenderGrid::minContentForChild):
2168         (WebCore::RenderGrid::maxContentForChild):
2169         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems):
2170         (WebCore::sortByGridTrackGrowthPotential):
2171         (WebCore::RenderGrid::tracksAreWiderThanMinTrackBreadth):
2172         (WebCore::RenderGrid::computeAutoRepeatTracksCount):
2173         (WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded):
2174         (WebCore::RenderGrid::layoutGridItems):
2175         * rendering/RenderGrid.h:
2176         * rendering/RenderLayer.cpp:
2177         (WebCore::RenderLayer::paintLayerByApplyingTransform):
2178         (WebCore::RenderLayer::hitTestLayer):
2179         * rendering/RenderLayerBacking.cpp:
2180         * rendering/RenderListBox.cpp:
2181         (WebCore::RenderListBox::paintItem):
2182         (WebCore::RenderListBox::listIndexIsVisible):
2183         (WebCore::RenderListBox::computeFirstIndexesVisibleInPaddingTopBottomAreas):
2184         * rendering/RenderListBox.h:
2185         * rendering/RenderMenuList.h:
2186         * rendering/RenderMultiColumnSet.cpp:
2187         (WebCore::RenderMultiColumnSet::calculateMaxColumnHeight):
2188         * rendering/RenderTable.cpp:
2189         (WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight):
2190         (WebCore::RenderTable::baselinePosition):
2191         (WebCore::RenderTable::inlineBlockBaseline):
2192         (WebCore::RenderTable::firstLineBaseline):
2193         * rendering/RenderTable.h:
2194         * rendering/RenderTableCell.cpp:
2195         (WebCore::RenderTableCell::cellBaselinePosition):
2196         * rendering/RenderTableSection.cpp:
2197         (WebCore::RenderTableSection::firstLineBaseline):
2198         * rendering/RenderTableSection.h:
2199         * rendering/RenderText.cpp:
2200         (WebCore::RenderText::computePreferredLogicalWidths):
2201         (WebCore::RenderText::stringView):
2202         * rendering/RenderText.h:
2203         * rendering/RenderTextControl.h:
2204         * rendering/RenderView.cpp:
2205         (WebCore::RenderView::setSelection):
2206         (WebCore::RenderView::splitSelectionBetweenSubtrees):
2207         (WebCore::RenderView::getSelection):
2208         (WebCore::RenderView::clearSelection):
2209         * rendering/RenderView.h:
2210         * rendering/SelectionSubtreeRoot.h:
2211         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::SelectionSubtreeData):
2212         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionStartPos):
2213         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionEndPos):
2214         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::setSelectionStartPos):
2215         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::setSelectionEndPos):
2216         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::clearSelection):
2217         * rendering/SimpleLineLayout.cpp:
2218         (WebCore::SimpleLineLayout::LineState::lastFragment):
2219         (WebCore::SimpleLineLayout::closeLineEndingAndAdjustRuns):
2220         (WebCore::SimpleLineLayout::createTextRuns):
2221         * rendering/SimpleLineLayoutFunctions.cpp:
2222         (WebCore::SimpleLineLayout::paintFlow):
2223         * rendering/line/BreakingContext.h:
2224         (WebCore::WordTrailingSpace::width):
2225         (WebCore::BreakingContext::commitLineBreakAtCurrentWidth):
2226         (WebCore::BreakingContext::InlineIteratorHistory::nextBreakablePosition):
2227         (WebCore::BreakingContext::InlineIteratorHistory::moveTo):
2228         (WebCore::tryHyphenating):
2229         (WebCore::BreakingContext::computeAdditionalBetweenWordsWidth):
2230         (WebCore::BreakingContext::handleText):
2231         (WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord):
2232         * rendering/mathml/MathMLStyle.cpp:
2233         (WebCore::MathMLStyle::resolveMathMLStyle):
2234         * rendering/mathml/RenderMathMLBlock.cpp:
2235         (WebCore::RenderMathMLBlock::baselinePosition):
2236         (WebCore::RenderMathMLTable::firstLineBaseline):
2237         * rendering/mathml/RenderMathMLBlock.h:
2238         (WebCore::RenderMathMLBlock::ascentForChild):
2239         * rendering/mathml/RenderMathMLFraction.cpp:
2240         (WebCore::RenderMathMLFraction::firstLineBaseline):
2241         * rendering/mathml/RenderMathMLFraction.h:
2242         * rendering/mathml/RenderMathMLOperator.cpp:
2243         (WebCore::RenderMathMLOperator::firstLineBaseline):
2244         * rendering/mathml/RenderMathMLOperator.h:
2245         * rendering/mathml/RenderMathMLPadded.cpp:
2246         (WebCore::RenderMathMLPadded::firstLineBaseline):
2247         * rendering/mathml/RenderMathMLPadded.h:
2248         * rendering/mathml/RenderMathMLRow.cpp:
2249         (WebCore::RenderMathMLRow::firstLineBaseline):
2250         * rendering/mathml/RenderMathMLRow.h:
2251         * rendering/mathml/RenderMathMLScripts.cpp:
2252         (WebCore::RenderMathMLScripts::validateAndGetReferenceChildren):
2253         (WebCore::RenderMathMLScripts::firstLineBaseline):
2254         * rendering/mathml/RenderMathMLScripts.h:
2255         * rendering/mathml/RenderMathMLSpace.cpp:
2256         (WebCore::RenderMathMLSpace::firstLineBaseline):
2257         * rendering/mathml/RenderMathMLSpace.h:
2258         * rendering/mathml/RenderMathMLToken.cpp:
2259         (WebCore::RenderMathMLToken::updateMathVariantGlyph):
2260         (WebCore::RenderMathMLToken::firstLineBaseline):
2261         * rendering/mathml/RenderMathMLToken.h:
2262         * rendering/svg/RenderSVGContainer.cpp:
2263         (WebCore::RenderSVGContainer::nodeAtFloatPoint):
2264         * rendering/svg/RenderSVGForeignObject.cpp:
2265         (WebCore::RenderSVGForeignObject::nodeAtFloatPoint):
2266         * rendering/svg/RenderSVGImage.cpp:
2267         (WebCore::RenderSVGImage::nodeAtFloatPoint):
2268         * rendering/svg/RenderSVGResourceClipper.cpp:
2269         (WebCore::RenderSVGResourceClipper::hitTestClipContent):
2270         * rendering/svg/RenderSVGResourceFilter.cpp:
2271         (WebCore::RenderSVGResourceFilter::postApplyResource):
2272         * rendering/svg/RenderSVGRoot.cpp:
2273         (WebCore::RenderSVGRoot::nodeAtPoint):
2274         * rendering/svg/RenderSVGShape.cpp:
2275         (WebCore::RenderSVGShape::setupNonScalingStrokeContext):
2276         (WebCore::RenderSVGShape::nodeAtFloatPoint):
2277         (WebCore::RenderSVGShape::calculateStrokeBoundingBox):
2278         * rendering/svg/RenderSVGText.cpp:
2279         (WebCore::RenderSVGText::nodeAtFloatPoint):
2280         * rendering/svg/SVGRenderSupport.cpp:
2281         (WebCore::SVGRenderSupport::intersectRepaintRectWithShadows):
2282         * rendering/svg/SVGRenderingContext.cpp:
2283         (WebCore::SVGRenderingContext::clipToImageBuffer):
2284         * rendering/svg/SVGTextQuery.cpp:
2285         (WebCore::SVGTextQuery::modifyStartEndPositionsRespectingLigatures):
2286         * style/RenderTreeUpdater.cpp:
2287         (WebCore::RenderTreeUpdater::Parent::Parent):
2288         * style/RenderTreeUpdater.h:
2289         * style/StyleScope.h:
2290         * svg/SVGElement.cpp:
2291         (WebCore::SVGElement::parseAttribute):
2292         (WebCore::SVGElement::resolveCustomStyle):
2293         * svg/SVGElement.h:
2294         * svg/SVGToOTFFontConversion.cpp:
2295         (WebCore::SVGToOTFFontConverter::transcodeGlyphPaths):
2296         (WebCore::SVGToOTFFontConverter::processGlyphElement):
2297         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):
2298         (WebCore::convertSVGToOTFFont):
2299         * svg/SVGToOTFFontConversion.h:
2300         * testing/Internals.cpp:
2301         (WebCore::Internals::setEventThrottlingBehaviorOverride):
2302         (WebCore::Internals::eventThrottlingBehaviorOverride):
2303         * testing/Internals.h:
2304         * workers/Worker.h:
2305         * xml/XMLHttpRequest.cpp:
2306         (WebCore::XMLHttpRequest::prepareToSend):
2307         (WebCore::XMLHttpRequest::didFinishLoading):
2308         * xml/XMLHttpRequest.h:
2309
2310 2016-11-26  Csaba Osztrogonác  <ossy@webkit.org>
2311
2312         Fix build warnings in WebCore/Modules/indexeddb/server/IDBSerialization.cp
2313         https://bugs.webkit.org/show_bug.cgi?id=165070
2314
2315         Reviewed by Brady Eidson.
2316
2317         * Modules/indexeddb/server/IDBSerialization.cpp:
2318
2319 2016-11-26  Sam Weinig  <sam@webkit.org>
2320
2321         Convert IntersectionObserver over to using RuntimeEnabledFeatures so it can be properly excluded from script
2322         https://bugs.webkit.org/show_bug.cgi?id=164965
2323
2324         Reviewed by Simon Fraser.
2325
2326         * bindings/generic/RuntimeEnabledFeatures.cpp:
2327         (WebCore::RuntimeEnabledFeatures::reset):
2328         * bindings/generic/RuntimeEnabledFeatures.h:
2329         (WebCore::RuntimeEnabledFeatures::setIntersectionObserverEnabled):
2330         (WebCore::RuntimeEnabledFeatures::intersectionObserverEnabled):
2331         Add intersection observer setting.
2332
2333         * page/IntersectionObserver.idl:
2334         * page/IntersectionObserverEntry.idl:
2335         Convert to use EnabledAtRuntime extended attribute.
2336
2337         * page/Settings.in:
2338         Remove the old intersection observer setting.
2339
2340 2016-11-26  Simon Fraser  <simon.fraser@apple.com>
2341
2342         Migrate some layout timer-related code from std::chrono to Seconds and MonotonicTime
2343         https://bugs.webkit.org/show_bug.cgi?id=164992
2344
2345         Reviewed by Darin Adler.
2346
2347         std::chrono::milliseconds -> Seconds.
2348         
2349         Rename Document::elapsedTime() to timeSinceDocumentCreation() which is more explicit.
2350         
2351         Replace INSTRUMENT_LAYOUT_SCHEDULING with LOG(Layout...).
2352
2353         * dom/Document.cpp:
2354         (WebCore::Document::Document):
2355         (WebCore::Document::implicitClose):
2356         (WebCore::Document::isLayoutTimerActive):
2357         (WebCore::Document::minimumLayoutDelay):
2358         (WebCore::Document::timeSinceDocumentCreation):
2359         (WebCore::Document::elapsedTime): Deleted.
2360         * dom/Document.h:
2361         * page/ChromeClient.h:
2362         * page/FrameView.cpp:
2363         (WebCore::FrameView::layout):
2364         (WebCore::FrameView::scrollPositionChanged):
2365         (WebCore::FrameView::layoutTimerFired):
2366         (WebCore::FrameView::scheduleRelayout):
2367         (WebCore::FrameView::scheduleRelayoutOfSubtree):
2368         (WebCore::FrameView::unscheduleRelayout):
2369         * page/Settings.cpp:
2370         (WebCore::Settings::setLayoutInterval):
2371         * page/Settings.h:
2372         (WebCore::Settings::layoutInterval):
2373         * style/StyleScope.cpp:
2374         (WebCore::Style::Scope::removePendingSheet):
2375         * workers/WorkerRunLoop.cpp:
2376         (WebCore::WorkerRunLoop::runInMode):
2377
2378 2016-11-26  Simon Fraser  <simon.fraser@apple.com>
2379
2380         Composited negative z-index elements are hidden behind the body sometimes
2381         https://bugs.webkit.org/show_bug.cgi?id=165080
2382         rdar://problem/22260229
2383
2384         Reviewed by Zalan Bujtas.
2385
2386         If the <body> falls into the "directly composited background color" code path
2387         (say, because it's composited because of composited negative z-index children,
2388         and has content of its own), then we failed to take root background propagation
2389         into account, and put the opaque root background color on the body's layer.
2390
2391         Fix by sharing some code from RenderBox related to whether the body's renderer
2392         paints its background.
2393         
2394         Tests cover the buggy case, and the case where the <html> has its own background color.
2395
2396         Tests: compositing/backgrounds/negative-z-index-behind-body-non-propagated.html
2397                compositing/backgrounds/negative-z-index-behind-body.html
2398
2399         * rendering/RenderBox.cpp:
2400         (WebCore::RenderBox::paintsOwnBackground):
2401         (WebCore::RenderBox::paintBackground):
2402         (WebCore::RenderBox::backgroundIsKnownToBeOpaqueInRect):
2403         (WebCore::skipBodyBackground): Deleted.
2404         * rendering/RenderBox.h:
2405         * rendering/RenderLayerBacking.cpp:
2406         (WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundColor):
2407
2408 2016-11-25  Myles C. Maxfield  <mmaxfield@apple.com>
2409
2410         [CSS Font Loading] FontFace.load() promises don't always fire
2411         https://bugs.webkit.org/show_bug.cgi?id=165037
2412
2413         Reviewed by Simon Fraser.
2414
2415         We currently handle web fonts in two phases. The first phase is building up
2416         StyleRuleFontFace objects which reflect the style on the page. The second is creating
2417         CSSFontFace objects from those StyleRuleFontFace objects. When script modifies the
2418         style on the page, we can often update the CSSFontFace objects, but there are some
2419         modifications which we don't know how to model. For these operations, we destroy the
2420         CSSFontFace objects and rebuild them from the newly modified StyleRuleFontFace objects.
2421
2422         Normally, this is fine. However, with the CSS font loading API, the CSSFontFaces back
2423         Javascript objects which will persist across the rebuilding step mentioned above. This
2424         means that the FontFace objects need to adopt the new CSSFontFace objects and forget
2425         the old CSSFontFace objects.
2426
2427         This gets a little tricky because the operation which caused the rebuild may actually
2428         be a modification to the specific @font-face block which backs a Javascript FontFace
2429         object. Because the CSSOM can be used to change the src: attribute of the FontFace
2430         object, I decided in r201971 to clear the FontFace's promise in case an old load would
2431         cause the promise to resolve. However, this would never happen because the old
2432         CSSFontFace is unparented during the FontFace::adopt()ion of the new CSSFontFace.
2433         Therefore, old loads may still complete, but the signal would never make it to the
2434         FontFace and therefore would not cause the promise to resolve. In addition, clearing
2435         the promise during a rebuild is problematic because that rebuild may be caused by
2436         operations which have nothing to do with the specific FontFace object in question (so
2437         the FontFace object should be observably uneffected.)
2438
2439         Because of the above reasons, this patch simply stops clearing the promise during the
2440         rebuild phase.
2441
2442         Tests: fast/text/fontface-rebuild-during-loading.html
2443                fast/text/fontface-rebuild-during-loading-2.html
2444
2445         * css/FontFace.cpp:
2446         (WebCore::FontFace::adopt):
2447
2448 2016-11-25  Andreas Kling  <akling@apple.com>
2449
2450         MemoryPressureHandler should only trigger synchronous GC on iOS
2451         <https://webkit.org/b/165043>
2452         <rdar://problem/29312684>
2453
2454         Reviewed by Sam Weinig.
2455
2456         On iOS we know that there is really only one web process in play at a time,
2457         so it's okay to do a synchronous GC immediately in response to high memory pressure.
2458
2459         On other platforms, we may have tens or hundreds of web processes, and if they
2460         all start doing full GCs at the same time, it can easily bring a system to its knees
2461         if it's already under pressure.
2462
2463         Fix this by using garbageCollectSoon() on non-iOS platforms.
2464
2465         * page/MemoryRelease.cpp:
2466         (WebCore::releaseCriticalMemory):
2467
2468 2016-11-23  Sergio Villar Senin  <svillar@igalia.com>
2469
2470         [css-grid] Convert grid representation into a class
2471         https://bugs.webkit.org/show_bug.cgi?id=165042
2472
2473         Reviewed by Manuel Rego Casasnovas.
2474
2475         So far grids are represented as Vectors of Vectors. There are a couple of issues associated
2476         to that decision. First or all, the source code in RenderGrid assumes the existence of that
2477         data structure, meaning that we cannot eventually change it without changing a lot of
2478         code. Apart from the coupling there is another issue, RenderGrid is full of methods to
2479         access and manipulate that data structure.
2480
2481         Instead, it'd be much better to have a Grid class encapsulating both the data structures and
2482         the methods required to access/manipulate it. Note that follow-up patches will move even
2483         more data and procedures into this new class from the RenderGrid code.
2484
2485         No new tests required as this is a refactoring.
2486
2487         * rendering/RenderGrid.cpp:
2488         (WebCore::RenderGrid::Grid::ensureGridSize): Moved from RenderGrid.
2489         (WebCore::RenderGrid::Grid::insert): Ditto.
2490         (WebCore::RenderGrid::Grid::clear): Ditto.
2491         (WebCore::RenderGrid::GridIterator::GridIterator):
2492         (WebCore::RenderGrid::gridColumnCount): Use Grid's methods.
2493         (WebCore::RenderGrid::gridRowCount): Ditto.
2494         (WebCore::RenderGrid::placeItemsOnGrid): Use Grid's methods to insert children.
2495         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator): Ditto.
2496         (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid): Ditto.
2497         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid): Ditto.
2498         (WebCore::RenderGrid::numTracks): Use Grid's methods.
2499         (WebCore::RenderGrid::ensureGridSize): Deleted. Moved to Grid class.
2500         (WebCore::RenderGrid::insertItemIntoGrid): Deleted. Moved to Grid class.
2501         * rendering/RenderGrid.h:
2502
2503 2016-11-24  Antti Koivisto  <antti@apple.com>
2504
2505         Remove unused bool return from Element::willRecalcStyle
2506         https://bugs.webkit.org/show_bug.cgi?id=165059
2507
2508         Reviewed by Andreas Kling.
2509
2510         It is always true.
2511
2512         * dom/Element.cpp:
2513         (WebCore::Element::willRecalcStyle):
2514         * dom/Element.h:
2515         * html/HTMLFrameSetElement.cpp:
2516         (WebCore::HTMLFrameSetElement::willRecalcStyle):
2517         * html/HTMLFrameSetElement.h:
2518         * html/HTMLPlugInImageElement.cpp:
2519         (WebCore::HTMLPlugInImageElement::willRecalcStyle):
2520         * html/HTMLPlugInImageElement.h:
2521         * style/StyleTreeResolver.cpp:
2522         (WebCore::Style::TreeResolver::resolveComposedTree):
2523         * svg/SVGElement.cpp:
2524         (WebCore::SVGElement::willRecalcStyle):
2525         * svg/SVGElement.h:
2526         * svg/SVGUseElement.cpp:
2527         (WebCore::SVGUseElement::willRecalcStyle):
2528         * svg/SVGUseElement.h:
2529
2530 2016-11-22  Antti Koivisto  <antti@apple.com>
2531
2532         CrashTracer: [USER] com.apple.WebKit.WebContent at com.apple.WebCore: WebCore::ExtensionStyleSheets::pageUserSheet + 14
2533         https://bugs.webkit.org/show_bug.cgi?id=165030
2534
2535         Reviewed by Darin Adler.
2536
2537         We failed to reset the style scope when an element was moved to a different document. This could lead to having dangling
2538         document pointers in style scope and style resolver.
2539
2540         Test: fast/shadow-dom/shadow-host-move-to-different-document.html
2541
2542         * dom/ShadowRoot.cpp:
2543         (WebCore::ShadowRoot::didMoveToNewDocument):
2544
2545             Reset style scope.
2546
2547         * dom/ShadowRoot.h:
2548         * style/StyleScope.cpp:
2549         (WebCore::Style::Scope::resolver):
2550
2551             Some more assertions.
2552
2553         * style/StyleScope.h:
2554         (WebCore::Style::Scope::document):
2555
2556 2016-11-22  Darin Adler  <darin@apple.com>
2557
2558         Make normal case fast in the input element limitString function
2559         https://bugs.webkit.org/show_bug.cgi?id=165023
2560
2561         Reviewed by Dan Bernstein.
2562
2563         When running Speedometer, the limitLength function was showing up as hot.
2564         Fixed a couple obvious problems with that function's performance.
2565
2566         * html/TextFieldInputType.cpp:
2567         (WebCore::isASCIILineBreak): Deleted. The isHTMLLineBreak function does
2568         the same thing, but faster.
2569         (WebCore::limitLength): Added a FIXME comment explaining that the function
2570         isn't really a good idea. Don't call through to numCharactersInGraphemeClusters
2571         at all for 8-bit strings since we don't allow CR or LF characters in the string
2572         anyway, so there are no grapheme clusters more than a single code unit. Removed
2573         optimization when the length is the string's length that String::left already does.
2574         (WebCore::TextFieldInputType::sanitizeValue): Use isHTMLLineBreak instead of
2575         isASCIILineBreak.
2576         (WebCore::TextFieldInputType::handleBeforeTextInsertedEvent): Ditto.
2577
2578         * platform/LocalizedStrings.cpp: Use auto a lot more rather than writing out
2579         RetainPtr.
2580         (WebCore::truncatedStringForLookupMenuItem): Removed unneeded special case for
2581         empty strings. Removed unneeded string with the ellipsis character in it, since
2582         the makeString function already knows how to append a character to a string.
2583
2584         * rendering/RenderText.cpp:
2585         (WebCore::mapLineBreakToIteratorMode): Updated for change to LineBreakIteratorMode.
2586         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
2587         (WebCore::SimpleLineLayout::TextFragmentIterator::nextBreakablePosition): Ditto.
2588
2589 2016-11-21  Sergio Villar Senin  <svillar@igalia.com>
2590
2591         [css-grid] Isolate size of internal representation from actual grid size
2592         https://bugs.webkit.org/show_bug.cgi?id=165006
2593
2594         Reviewed by Manuel Rego Casasnovas.
2595
2596         RenderGrid has an internal representation of a grid used to place grid items, compute grid
2597         positions, run the track sizing algorithm etc. That data structure normally has exactly the
2598         same size as the actual grid specified using the grid-template-xxx properties (or any other
2599         shorthand). But in some cases, like for example when the grid is empty, the internal data
2600         structure does not really match the actual grid. In the particular case of empty grids no
2601         memory allocations are done to create a grid representation as it is not needed.
2602
2603         From now on both gridColumnCount() and gridRowCount() will always return the size of the
2604         data structure representing the grid whereas the newly added numTracks() will always return
2605         the actual size of the grid.
2606
2607         This is the first required step of the process of isolating the data used by the grid track
2608         sizing algorithm from the actual internal state of the LayoutGrid object.
2609
2610         No new tests as this is just a code refactoring.
2611
2612         * rendering/RenderGrid.cpp:
2613         (WebCore::RenderGrid::gridColumnCount): Always return the number of columns of the internal
2614         data structure to represent the grid.
2615         (WebCore::RenderGrid::layoutBlock):
2616         (WebCore::RenderGrid::computeIntrinsicLogicalWidths): Use the actual size of the grid to
2617         create the GridSizingData structure.
2618         (WebCore::RenderGrid::placeItemsOnGrid): Use the actual size of the grid to create the
2619         GridSizingData structure.
2620         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
2621         (WebCore::RenderGrid::numTracks): New method which returns the actual size of the grid.
2622         * rendering/RenderGrid.h:
2623
2624 2016-11-21  Konstantin Tokarev  <annulen@yandex.ru>
2625
2626         Disable #line markers in bison output on Windows
2627         https://bugs.webkit.org/show_bug.cgi?id=164973
2628
2629         Reviewed by Darin Adler.
2630
2631         New bison versions since 3.0 have bug that causes unescaped paths
2632         to be printed in #line directives. On Windows CMake passes absolute
2633         paths to bison that have backslashes in them, leading to compiler
2634         errors or warnings because of unrecognized escape sequences.
2635
2636         No new tests needed.
2637
2638         * css/makegrammar.pl:
2639
2640 2016-11-21  Olivier Blin  <olivier.blin@softathome.com>
2641
2642         [cmake][OpenWebRTC] Move SDPProcessorScriptResource rules to common WebCore
2643         https://bugs.webkit.org/show_bug.cgi?id=164937
2644
2645         Reviewed by Youenn Fablet.
2646
2647         SDPProcessorScriptResource has been moved in common mediastream directory (bug 163940).
2648
2649         Since it is not specific to the GTK port, the matching cmake rules should be
2650         moved out from PlatformGTK.cmake to the main WebCore CMakeLists.txt.
2651
2652         This is needed to build OpenWebRTC support in other ports, WPE in my case,
2653         probably Mac, EFL and Qt as well.
2654
2655         This also fixes the path in SDP scripts dependencies, the old openwebrtc subdir
2656         was still being used.
2657
2658         No new tests, build fix only
2659
2660         * CMakeLists.txt:
2661         * PlatformGTK.cmake:
2662
2663 2016-11-21  Carlos Garcia Campos  <cgarcia@igalia.com>
2664
2665         Add URL::hostAndPort()
2666         https://bugs.webkit.org/show_bug.cgi?id=164907
2667
2668         Reviewed by Alex Christensen.
2669
2670         As a convenient way of getting the host and port (if any) as a string.
2671
2672         * html/URLUtils.h:
2673         (WebCore::URLUtils<T>::host): Use URL::hostAndPort().
2674         * page/Location.cpp:
2675         (WebCore::Location::host): Ditto.
2676         * platform/URL.cpp:
2677         (WebCore::URL::hostAndPort): Return host:port or just host if there isn't a port.
2678         * platform/URL.h:
2679         * platform/network/CredentialStorage.cpp:
2680         (WebCore::originStringFromURL): Use URL::hostAndPort().
2681         * workers/WorkerLocation.cpp:
2682         (WebCore::WorkerLocation::host): Ditto.
2683
2684 2016-11-21  Philippe Normand  <pnormand@igalia.com>
2685
2686         [WebRTC][OpenWebRTC] parse turns urls
2687         https://bugs.webkit.org/show_bug.cgi?id=164587
2688
2689         Reviewed by Alejandro G. Castro.
2690
2691         * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
2692         (WebCore::MediaEndpointOwr::ensureTransportAgentAndTransceivers):
2693         Hook turns servers between the RTCConfiguration and the underlying
2694         OpenWebRTC layer.
2695
2696 2016-11-21  Philippe Normand  <pnormand@igalia.com>
2697
2698         [Gstreamer] Add volume and mute support to the WebRTC mediaplayer
2699         https://bugs.webkit.org/show_bug.cgi?id=153828
2700
2701         Reviewed by Darin Adler.
2702
2703         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
2704         (WebCore::MediaPlayerPrivateGStreamerOwr::setVolume): New implementation setting the OWR source volume property.
2705         (WebCore::MediaPlayerPrivateGStreamerOwr::setMuted): New implementation setting the OWR source mute property.
2706         (WebCore::MediaPlayerPrivateGStreamerOwr::maybeHandleChangeMutedState): Also set audio OWR source mute state depending on the track enabled state.
2707         (WebCore::MediaPlayerPrivateGStreamerOwr::trackEnabledChanged): chain to maybeHandleChangeMuteState.
2708         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h:
2709
2710 2016-11-21  Alejandro G. Castro  <alex@igalia.com> and Philippe Normand  <pnormand@igalia.com>
2711
2712         [WebRTC][OpenWebRTC] RTP bundling support
2713         https://bugs.webkit.org/show_bug.cgi?id=162333
2714
2715         Reviewed by Alejandro G. Castro.
2716
2717         Configure the OpenWebRTC transport agent bundle policy according
2718         to the RTCConfiguration and pass the receive SSRCs over to
2719         OpenWebRTC as well. Those are needed so the agent is aware of the
2720         bundle layout.
2721
2722         * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
2723         (WebCore::MediaEndpointOwr::updateReceiveConfiguration):
2724         (WebCore::MediaEndpointOwr::updateSendConfiguration):
2725         (WebCore::MediaEndpointOwr::ensureTransportAgentAndTransceivers):
2726
2727 2016-11-20  Zan Dobersek  <zdobersek@igalia.com>
2728
2729         [EncryptedMedia] Make EME API runtime-enabled
2730         https://bugs.webkit.org/show_bug.cgi?id=164927
2731
2732         Reviewed by Jer Noble.
2733
2734         Update the EME API IDL definitions to use the EnabledAtRuntime
2735         attribute on the relevant interfaces, attributes and operations.
2736         EncryptedMediaAPI is used as the attribute value.
2737
2738         The corresponding getter, setter and member boolean are added to
2739         the RuntimeEnabledFeatures class.
2740
2741         * Modules/encryptedmedia/MediaKeyMessageEvent.idl:
2742         * Modules/encryptedmedia/MediaKeySession.idl:
2743         * Modules/encryptedmedia/MediaKeyStatusMap.idl:
2744         * Modules/encryptedmedia/MediaKeySystemAccess.idl:
2745         * Modules/encryptedmedia/MediaKeys.idl:
2746         * Modules/encryptedmedia/NavigatorEME.idl:
2747         * bindings/generic/RuntimeEnabledFeatures.h:
2748         (WebCore::RuntimeEnabledFeatures::setEncryptedMediaAPIEnabled):
2749         (WebCore::RuntimeEnabledFeatures::encryptedMediaAPIEnabled):
2750         * html/HTMLMediaElement.idl:
2751         * html/MediaEncryptedEvent.idl:
2752
2753 2016-11-20  Eric Carlson  <eric.carlson@apple.com>
2754
2755         REGRESSION (r208606?): LayoutTest fast/mediastream/enumerating-crash.html is a flaky crash
2756         https://bugs.webkit.org/show_bug.cgi?id=164715
2757         <rdar://problem/29277180>
2758
2759         Reviewed by Alexey Proskuryakov.
2760
2761         No new tests, fixes an existing test crash.
2762
2763         * Modules/mediastream/UserMediaRequest.cpp:
2764         (WebCore::UserMediaRequest::contextDestroyed): Call base class method before clearing m_controller
2765           because it nullifies the security context.
2766
2767 2016-11-19  Chris Dumez  <cdumez@apple.com>
2768
2769         Update HTML form validation messages
2770         https://bugs.webkit.org/show_bug.cgi?id=164957
2771         <rdar://problem/29338669>
2772
2773         Reviewed by Darin Adler.
2774
2775         Update HTML form validation messages as per recent feedback:
2776         - Drop the "Please".
2777         - Drop the period at the end.
2778         - Drop the "if you want to proceed" that was used only for the checkbox.
2779
2780         No new tests, rebaselined existing tests.
2781
2782         * English.lproj/Localizable.strings:
2783         * platform/LocalizedStrings.cpp:
2784         (WebCore::validationMessageValueMissingText):
2785         (WebCore::validationMessageValueMissingForCheckboxText):
2786         (WebCore::validationMessageValueMissingForFileText):
2787         (WebCore::validationMessageValueMissingForRadioText):
2788         (WebCore::validationMessageValueMissingForSelectText):
2789         (WebCore::validationMessageTypeMismatchText):
2790         (WebCore::validationMessageTypeMismatchForEmailText):
2791         (WebCore::validationMessageTypeMismatchForURLText):
2792         (WebCore::validationMessagePatternMismatchText):
2793         (WebCore::validationMessageTooShortText):
2794         (WebCore::validationMessageTooLongText):
2795         (WebCore::validationMessageRangeUnderflowText):
2796         (WebCore::validationMessageRangeOverflowText):
2797         (WebCore::validationMessageStepMismatchText):
2798         (WebCore::validationMessageBadInputForNumberText):
2799
2800 2016-11-19  Joanmarie Diggs  <jdiggs@igalia.com>
2801
2802         AX: [ATK] Implement selection interface and states for elements supporting aria-selected and for menu roles
2803         https://bugs.webkit.org/show_bug.cgi?id=164865
2804
2805         Reviewed by Chris Fleizach.
2806
2807         Implement AtkSelection and support ATK_STATE_SELECTABLE and ATK_STATE_SELECTED
2808         for elements supporting aria-selected and for menu-related roles. Also enable the
2809         equivalent support for the Mac because NSAccessibilitySelectedChildrenAttribute is
2810         included as supported on the same roles.
2811
2812         In addition, fix several bugs discovered along the way: Call isSelected() on role
2813         tab, because tab supports aria-selected; not aria-checked. Correct ATK mapping
2814         of ListBoxRole and ListBoxOptionRole for combobox descendants. Always defer to
2815         WebCore for inclusion/exclusion decisions related to elements with an explicit
2816         ARIA role.
2817
2818         Tests: accessibility/aria-combobox-hierarchy.html
2819                accessibility/aria-selected-menu-items.html
2820                accessibility/aria-selected.html
2821
2822         * accessibility/AccessibilityNodeObject.cpp:
2823         (WebCore::AccessibilityNodeObject::selectedTabItem):
2824         (WebCore::AccessibilityNodeObject::canSetSelectedAttribute):
2825         * accessibility/AccessibilityObject.cpp:
2826         (WebCore::AccessibilityObject::isDescendantOfRole):
2827         * accessibility/AccessibilityObject.h:
2828         (WebCore::AccessibilityObject::canHaveSelectedChildren):
2829         * accessibility/AccessibilityRenderObject.cpp:
2830         (WebCore::AccessibilityRenderObject::isSelected):
2831         (WebCore::AccessibilityRenderObject::canHaveSelectedChildren):
2832         (WebCore::AccessibilityRenderObject::selectedChildren):
2833         * accessibility/AccessibilityRenderObject.h:
2834         * accessibility/atk/AccessibilityObjectAtk.cpp:
2835         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
2836         * accessibility/atk/WebKitAccessibleInterfaceSelection.cpp:
2837         (webkitAccessibleSelectionGetSelectionCount):
2838         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2839         (atkRole):
2840         (getInterfaceMaskFromObject):
2841         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2842         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2843
2844 2016-11-19  Simon Fraser  <simon.fraser@apple.com>
2845
2846         [iOS WK2] When zoomed in and panning on pages with fixed bars, parts of the bars are sometimes missing
2847         https://bugs.webkit.org/show_bug.cgi?id=164855
2848
2849         Reviewed by Sam Weinig.
2850
2851         During UI-process panning and zooming, we send visible rect updates to the web process
2852         with inStableState=false, and don't update GraphicsLayers until we get into a stable state.
2853
2854         This causes a problem where the web process has a stale notion of where the GraphicsLayers
2855         for position:fixed elements are, but is then told to update tiling coverage with an up-to-date
2856         visible rect. The existing "sync layer positions" path isn't useful to fix this, because it
2857         breaks the relationship between the GraphicsLayer positions and their FixedPositionViewportConstraints
2858         in the scrolling tree.
2859
2860         To address this, add the notion of an Optional<> approximatePosition on GraphicsLayers. This is used
2861         only by the coverageRect computation code path, and is cleared by a setPosition(). ApproximatePositions
2862         are pushed onto GraphicsLayers via the syncViewportConstrainedLayerPositions() code path (renamed to
2863         reconcileViewportConstrainedLayerPositions).
2864
2865         This allows us to remmove "viewportIsStable" from GraphicsLayer flushing, and FrameView.
2866
2867         SetOrSyncScrollingLayerPosition is made into an enum class.
2868
2869         Tested by scrollingcoordinator/ios/non-stable-viewport-scroll.html
2870
2871         * page/FrameView.cpp:
2872         (WebCore::FrameView::reset):
2873         * page/FrameView.h:
2874         * page/scrolling/AsyncScrollingCoordinator.cpp:
2875         (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
2876         (WebCore::AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll):
2877         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
2878         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
2879         (WebCore::AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions):
2880         (WebCore::AsyncScrollingCoordinator::syncViewportConstrainedLayerPositions): Deleted.
2881         * page/scrolling/AsyncScrollingCoordinator.h:
2882         (WebCore::AsyncScrollingCoordinator::ScheduledScrollUpdate::ScheduledScrollUpdate):
2883         * page/scrolling/ScrollingCoordinator.cpp:
2884         (WebCore::operator<<):
2885         * page/scrolling/ScrollingCoordinator.h:
2886         (WebCore::ScrollingCoordinator::reconcileScrollingState):
2887         (WebCore::ScrollingCoordinator::reconcileViewportConstrainedLayerPositions):
2888         (WebCore::ScrollingCoordinator::syncViewportConstrainedLayerPositions): Deleted.
2889         * page/scrolling/ScrollingStateFixedNode.cpp:
2890         (WebCore::ScrollingStateFixedNode::reconcileLayerPositionForViewportRect):
2891         (WebCore::ScrollingStateFixedNode::syncLayerPositionForViewportRect): Deleted.
2892         * page/scrolling/ScrollingStateFixedNode.h:
2893         * page/scrolling/ScrollingStateNode.h:
2894         (WebCore::ScrollingStateNode::reconcileLayerPositionForViewportRect):
2895         (WebCore::ScrollingStateNode::syncLayerPositionForViewportRect): Deleted.
2896         * page/scrolling/ScrollingStateStickyNode.cpp:
2897         (WebCore::ScrollingStateStickyNode::reconcileLayerPositionForViewportRect):
2898         (WebCore::ScrollingStateStickyNode::syncLayerPositionForViewportRect): Deleted.
2899         * page/scrolling/ScrollingStateStickyNode.h:
2900         * page/scrolling/ScrollingTree.cpp:
2901         (WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling):
2902         * page/scrolling/ScrollingTree.h:
2903         * page/scrolling/ThreadedScrollingTree.cpp:
2904         (WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
2905         * page/scrolling/ThreadedScrollingTree.h:
2906         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
2907         (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPositionWithoutContentEdgeConstraints):
2908         * page/scrolling/ios/ScrollingTreeIOS.cpp:
2909         (WebCore::ScrollingTreeIOS::scrollingTreeNodeDidScroll):
2910         * page/scrolling/ios/ScrollingTreeIOS.h:
2911         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
2912         (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):
2913         * platform/graphics/GraphicsLayer.cpp:
2914         (WebCore::GraphicsLayer::dumpProperties):
2915         * platform/graphics/GraphicsLayer.h:
2916         (WebCore::GraphicsLayer::setPosition):
2917         (WebCore::GraphicsLayer::approximatePosition):
2918         (WebCore::GraphicsLayer::setApproximatePosition):
2919         (WebCore::GraphicsLayer::flushCompositingState):
2920         (WebCore::GraphicsLayer::flushCompositingStateForThisLayerOnly):
2921         * platform/graphics/ca/GraphicsLayerCA.cpp:
2922         (WebCore::GraphicsLayerCA::flushCompositingState):
2923         (WebCore::GraphicsLayerCA::flushCompositingStateForThisLayerOnly):
2924         (WebCore::GraphicsLayerCA::computeVisibleAndCoverageRect):
2925         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects): No longer bail for viewportConstained layers when the viewport is unstable.
2926         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
2927         * platform/graphics/ca/GraphicsLayerCA.h:
2928         (WebCore::GraphicsLayerCA::CommitState::CommitState): Deleted.
2929         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
2930         (WebCore::GraphicsLayerTextureMapper::flushCompositingState):
2931         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2932         (WebCore::CoordinatedGraphicsLayer::flushCompositingState):
2933         * rendering/RenderLayerCompositor.cpp:
2934         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
2935
2936 2016-11-19  Joanmarie Diggs  <jdiggs@igalia.com>
2937
2938         AX: [ATK] Expose aria-busy via ATK_STATE_BUSY
2939         https://bugs.webkit.org/show_bug.cgi?id=164909
2940
2941         Reviewed by Chris Fleizach.
2942
2943         Expose aria-busy via ATK_STATE_BUSY. Also rename ariaLiveRegionBusy()
2944         to isBusy() because in ARIA 1.1 aria-busy is no longer limited to live
2945         regions.
2946
2947         Test: accessibility/aria-busy.html
2948
2949         * accessibility/AccessibilityObject.h:
2950         (WebCore::AccessibilityObject::isBusy):
2951         (WebCore::AccessibilityObject::ariaLiveRegionBusy): Deleted.
2952         * accessibility/AccessibilityRenderObject.cpp:
2953         (WebCore::AccessibilityRenderObject::isBusy):
2954         (WebCore::AccessibilityRenderObject::ariaLiveRegionBusy): Deleted.
2955         * accessibility/AccessibilityRenderObject.h:
2956         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2957         (setAtkStateSetFromCoreObject):
2958         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2959         (-[WebAccessibilityObjectWrapper accessibilityARIAIsBusy]):
2960         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2961         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2962         * inspector/InspectorDOMAgent.cpp:
2963         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
2964
2965 2016-11-19  Ryosuke Niwa  <rniwa@webkit.org>
2966
2967         REGRESSION(r200964): Tab focus navigation is broken on results.en.voyages-sncf.com
2968         https://bugs.webkit.org/show_bug.cgi?id=164888
2969
2970         Reviewed by Antti Koivisto.
2971
2972         The bug was caused by FocusNavigationScope::parentInScope incorrectly returning nullptr when moving out of
2973         a user agent shadow tree of a SVG use element. Fixed the bug by explicitly checking against the focus scope's
2974         root node or its slot element. Also removed a superfluous early return when the parent node is a focus scope.
2975
2976         Tests: fast/shadow-dom/focus-navigation-out-of-slot.html
2977                fast/shadow-dom/focus-navigation-passes-shadow-host.html
2978                fast/shadow-dom/focus-navigation-passes-svg-use-element.html
2979
2980         * page/FocusController.cpp:
2981         (WebCore::FocusNavigationScope::parentInScope):
2982
2983 2016-11-18  Simon Fraser  <simon.fraser@apple.com>
2984
2985         [iOS WK2] Eliminate a source of flakiness in layout tests by forcing WebPage into "responsive" mode for all tests, with an internals override
2986         https://bugs.webkit.org/show_bug.cgi?id=164980
2987
2988         Reviewed by Chris Dumez.
2989
2990         WebPage::eventThrottlingDelay() uses a latency estimate based on the round-trip time from the UI process
2991         to affect behavior, including whether scroll events are fired. This also affects the FrameView "scrolledByUser"
2992         flag that impacts tile coverage.
2993
2994         During testing, latency falling above or below the 16ms threshold could affect behavior. Fix by forcing
2995         WebPage into "responsive" mode while running tests, via InjectedBundlePage::prepare().
2996
2997         Add a nullable internals property so that a test can specify responsive, unresponsive or default behavior.
2998
2999         Tests: fast/scrolling/ios/scroll-events-default.html
3000                fast/scrolling/ios/scroll-events-responsive.html
3001                fast/scrolling/ios/scroll-events-unresponsive.html
3002
3003         * page/Page.h:
3004         (WebCore::Page::eventThrottlingBehaviorOverride):
3005         (WebCore::Page::setEventThrottlingBehaviorOverride):
3006         * testing/Internals.cpp:
3007         (WebCore::Internals::setEventThrottlingBehaviorOverride):
3008         (WebCore::Internals::eventThrottlingBehaviorOverride):
3009         * testing/Internals.h:
3010         * testing/Internals.idl:
3011
3012 2016-11-18  Chris Dumez  <cdumez@apple.com>
3013
3014         Unreviewed attempt to fix the build after r208917.
3015
3016         * dom/CustomElementReactionQueue.cpp:
3017         (WebCore::CustomElementReactionStack::ElementQueue::invokeAll):
3018
3019 2016-11-18  Chris Dumez  <cdumez@apple.com>
3020
3021         Unreviewed attempt to fix the build after r208917.
3022
3023         * dom/CustomElementReactionQueue.cpp:
3024
3025 2016-11-18  Jiewen Tan  <jiewen_tan@apple.com>
3026
3027         Update SubtleCrypto::decrypt to match the latest spec
3028         https://bugs.webkit.org/show_bug.cgi?id=164739
3029         <rdar://problem/29257848>
3030
3031         Reviewed by Brent Fulgham.
3032
3033         This patch does following few things:
3034         1. It updates the SubtleCrypto::decrypt method to match the latest spec:
3035            https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-decrypt.
3036            It also refers to the latest Editor's Draft to a certain degree:
3037            https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-decrypt.
3038         2. It implements decrypt operations of the following algorithms: AES-CBC,
3039            RSAES-PKCS1-V1_5, and RSA-OAEP.
3040
3041         Tests: crypto/subtle/aes-cbc-decrypt-malformed-parameters.html
3042                crypto/subtle/aes-cbc-generate-key-encrypt-decrypt.html
3043                crypto/subtle/aes-cbc-import-key-decrypt.html
3044                crypto/subtle/decrypt-malformed-parameters.html
3045                crypto/subtle/rsa-oaep-decrypt-malformed-parameters.html
3046                crypto/subtle/rsa-oaep-generate-key-encrypt-decrypt-label.html
3047                crypto/subtle/rsa-oaep-generate-key-encrypt-decrypt.html
3048                crypto/subtle/rsa-oaep-import-key-decrypt-label.html
3049                crypto/subtle/rsa-oaep-import-key-decrypt.html
3050                crypto/subtle/rsaes-pkcs1-v1_5-generate-key-encrypt-decrypt.html
3051                crypto/subtle/rsaes-pkcs1-v1_5-import-key-decrypt.html
3052                crypto/workers/subtle/aes-cbc-import-key-decrypt.html
3053                crypto/workers/subtle/rsa-oaep-import-key-decrypt.html
3054                crypto/workers/subtle/rsaes-pkcs1-v1_5-import-key-decrypt.html
3055
3056         * bindings/js/JSSubtleCryptoCustom.cpp:
3057         (WebCore::normalizeCryptoAlgorithmParameters):
3058         (WebCore::toCryptoKey):
3059         (WebCore::toVector):
3060         (WebCore::jsSubtleCryptoFunctionEncryptPromise):
3061         (WebCore::jsSubtleCryptoFunctionDecryptPromise):
3062         (WebCore::jsSubtleCryptoFunctionExportKeyPromise):
3063         (WebCore::JSSubtleCrypto::decrypt):
3064         * crypto/CryptoAlgorithm.cpp:
3065         (WebCore::CryptoAlgorithm::decrypt):
3066         * crypto/CryptoAlgorithm.h:
3067         * crypto/SubtleCrypto.idl:
3068         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
3069         (WebCore::CryptoAlgorithmAES_CBC::decrypt):
3070         * crypto/algorithms/CryptoAlgorithmAES_CBC.h:
3071         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
3072         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::decrypt):
3073         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
3074         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
3075         (WebCore::CryptoAlgorithmRSA_OAEP::decrypt):
3076         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
3077         * crypto/gnutls/CryptoAlgorithmAES_CBCGnuTLS.cpp:
3078         (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
3079         * crypto/gnutls/CryptoAlgorithmRSAES_PKCS1_v1_5GnuTLS.cpp:
3080         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt):
3081         * crypto/gnutls/CryptoAlgorithmRSA_OAEPGnuTLS.cpp:
3082         (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
3083         * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
3084         (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
3085         * crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp:
3086         (WebCore::decryptRSAES_PKCS1_v1_5):
3087         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt):
3088         * crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
3089         (WebCore::decryptRSA_OAEP):
3090         (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
3091
3092 2016-11-18  Chris Dumez  <cdumez@apple.com>
3093
3094         Unreviewed, rolling out r208837.
3095
3096         The bots did not show a progression
3097
3098         Reverted changeset:
3099
3100         "REGRESSION(r208082): 1% Speedometer regression on iOS"
3101         https://bugs.webkit.org/show_bug.cgi?id=164852
3102         http://trac.webkit.org/changeset/208837
3103
3104 2016-11-18  Simon Fraser  <simon.fraser@apple.com>
3105
3106         Remove use of std::chrono in WebPage and entrained code
3107         https://bugs.webkit.org/show_bug.cgi?id=164967
3108
3109         Reviewed by Tim Horton.
3110
3111         Replace std::chrono with Seconds and Monotonic Time.
3112
3113         Use more C++11 initialization for WebPage data members.
3114
3115         * page/ChromeClient.h:
3116         * page/FrameView.cpp:
3117         (WebCore::FrameView::scrollPositionChanged):
3118         (WebCore::FrameView::setScrollVelocity):
3119         * page/FrameView.h:
3120         * platform/Timer.h:
3121         (WebCore::TimerBase::startRepeating):
3122         (WebCore::TimerBase::startOneShot):
3123         (WebCore::TimerBase::augmentFireInterval):
3124         (WebCore::TimerBase::augmentRepeatInterval):
3125         * platform/graphics/TiledBacking.h:
3126         (WebCore::VelocityData::VelocityData):
3127         * platform/graphics/ca/TileController.cpp:
3128         (WebCore::TileController::adjustTileCoverageRect):
3129
3130 2016-11-18  Dean Jackson  <dino@apple.com>
3131
3132         AX: "(inverted-colors)" media query only matches on page reload; should match on change
3133         https://bugs.webkit.org/show_bug.cgi?id=163564
3134         <rdar://problem/28807350>
3135
3136         Reviewed by Simon Fraser.
3137
3138         Mark some media queries as responding to notifications that
3139         system accessibility settings have changed. When Page gets told
3140         that has happened, check if any of the results have changed.
3141
3142         Tests: fast/media/mq-inverted-colors-live-update.html
3143                fast/media/mq-monochrome-live-update.html
3144                fast/media/mq-prefers-reduced-motion-live-update.html
3145
3146         * css/MediaQueryEvaluator.cpp:
3147         (WebCore::isAccessibilitySettingsDependent):
3148         (WebCore::MediaQueryEvaluator::evaluate):
3149         * css/StyleResolver.cpp:
3150         (WebCore::StyleResolver::addAccessibilitySettingsDependentMediaQueryResult):
3151         (WebCore::StyleResolver::hasMediaQueriesAffectedByAccessibilitySettingsChange):
3152         * css/StyleResolver.h:
3153         (WebCore::StyleResolver::hasAccessibilitySettingsDependentMediaQueries):
3154         * page/Page.cpp:
3155         (WebCore::Page::accessibilitySettingsDidChange):
3156         * page/Page.h:
3157
3158 2016-11-18  Anders Carlsson  <andersca@apple.com>
3159
3160         Rename the 'other' Apple Pay Button type to 'donate'
3161         https://bugs.webkit.org/show_bug.cgi?id=164978
3162
3163         Reviewed by Dean Jackson.
3164
3165         * DerivedSources.make:
3166         * WebCorePrefix.h:
3167         * css/CSSPrimitiveValueMappings.h:
3168         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3169         (WebCore::CSSPrimitiveValue::operator ApplePayButtonType):
3170         * css/CSSValueKeywords.in:
3171         * css/parser/CSSParser.cpp:
3172         (WebCore::isValidKeywordPropertyAndValue):
3173         * css/parser/CSSParserFastPaths.cpp:
3174         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
3175         * rendering/RenderThemeCocoa.mm:
3176         (WebCore::toPKPaymentButtonType):
3177         * rendering/style/RenderStyleConstants.h:
3178
3179 2016-11-18  Myles C. Maxfield  <mmaxfield@apple.com>
3180
3181         [WebGL2] Implement texStorage2D()
3182         https://bugs.webkit.org/show_bug.cgi?id=164493
3183
3184         Reviewed by Dean Jackson.
3185
3186         Create a new validation function which only accepts sized internalFormats.
3187         After running texStorage2D(), we also texSubImage2D() to zero-fill it. This
3188         is to compensate for potentially buggy drivers.
3189
3190         Because glTexStorage2D() was only added to OpenGL in version 4.2, not all
3191         OpenGL 3.2+ contexts can implement this command. However, according to
3192         https://developer.apple.com/opengl/capabilities/ all Apple GPUs have the
3193         GL_ARB_texture_storage which implements this call. In the future, we could
3194         implement texStorage2D() on top of texImage2D() if there are any ports which
3195         want WebGL2 but don't have 4.2 and don't have the extension.
3196
3197         Also, when calling texStorage2D, callers specify an internalFormat but not a
3198         type/format pair. This means that storing the texture's type is only valid
3199         for WebGL 1 contexts. This patch surrounds all calls to reading the texture
3200         type with guards and adds an ASSERT() at the read site to make sure the
3201         right thing is happening.
3202
3203         Test: fast/canvas/webgl/webgl2-texStorage.html
3204
3205         * html/canvas/WebGL2RenderingContext.cpp:
3206         (WebCore::WebGL2RenderingContext::validateTexStorageFuncParameters):
3207         (WebCore::WebGL2RenderingContext::texStorage2D):
3208         * html/canvas/WebGL2RenderingContext.h:
3209         * html/canvas/WebGLRenderingContext.cpp:
3210         (WebCore::WebGLRenderingContext::validateIndexArrayConservative):
3211         * html/canvas/WebGLRenderingContextBase.cpp:
3212         (WebCore::WebGLRenderingContextBase::create):
3213         (WebCore::WebGLRenderingContextBase::copyTexSubImage2D):
3214         (WebCore::WebGLRenderingContextBase::validateTexFunc):
3215         (WebCore::WebGLRenderingContextBase::validateTexFuncData):
3216         (WebCore::WebGLRenderingContextBase::texImage2D):
3217         * html/canvas/WebGLTexture.cpp:
3218         (WebCore::WebGLTexture::WebGLTexture):
3219         (WebCore::WebGLTexture::getType):
3220         (WebCore::WebGLTexture::needToUseBlackTexture):
3221         (WebCore::WebGLTexture::canGenerateMipmaps):
3222         (WebCore::internalFormatIsFloatType):
3223         (WebCore::internalFormatIsHalfFloatType):
3224         (WebCore::WebGLTexture::update):
3225         * html/canvas/WebGLTexture.h:
3226         * platform/graphics/GraphicsContext3D.cpp:
3227         (WebCore::GraphicsContext3D::texImage2DResourceSafe):
3228         (WebCore::GraphicsContext3D::packImageData):
3229         (WebCore::GraphicsContext3D::extractImageData):
3230         * platform/graphics/GraphicsContext3D.h:
3231         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
3232         (WebCore::Extensions3DOpenGLCommon::initializeAvailableExtensions):
3233         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
3234         (WebCore::GraphicsContext3D::texStorage2D):
3235         (WebCore::GraphicsContext3D::texStorage3D):
3236
3237 2016-11-18  Alex Christensen  <achristensen@webkit.org>
3238
3239         TextDecoder constructor should not accept replacement encodings
3240         https://bugs.webkit.org/show_bug.cgi?id=164903
3241
3242         Reviewed by Chris Dumez.
3243
3244         Covered by newly passing web platform tests.
3245
3246         * dom/TextDecoder.cpp:
3247         (WebCore::TextDecoder::create):
3248         https://encoding.spec.whatwg.org/#textdecoder says about the constructor:
3249         "If label is either not a label or is a label for replacement, throws a RangeError."
3250         See https://bugs.webkit.org/show_bug.cgi?id=159180 for the mapping of the replacement
3251         codec names to "replacement".
3252
3253 2016-11-18  Chris Dumez  <cdumez@apple.com>
3254
3255         Assertion failures in ActiveDOMObject::~ActiveDOMObject under Database destructor
3256         https://bugs.webkit.org/show_bug.cgi?id=164955
3257         <rdar://problem/29336715>
3258
3259         Reviewed by Brady Eidson.
3260
3261         Make sure the Database's DatabaseContext object is destroyed on the context
3262         thread given that DatabaseContext is an ActiveDOMObject and there is an
3263         assertion in the ActiveDOMObject destructor that it should be destroyed on
3264         on the context thread.
3265
3266         No new tests, already covered by existing tests.
3267
3268         * Modules/webdatabase/Database.cpp:
3269         (WebCore::Database::~Database):
3270
3271 2016-11-18  Enrica Casucci  <enrica@apple.com>
3272
3273         Refactor drag and drop for WebKit2 to encode DragData message exchange.
3274         https://bugs.webkit.org/show_bug.cgi?id=164945
3275
3276         Reviewed by Tim Horton.
3277
3278         No new tests. No change in functionality.
3279
3280         * loader/EmptyClients.h:
3281         * page/DragClient.h:
3282         * page/DragController.cpp:
3283         (WebCore::createMouseEvent):
3284         (WebCore::documentFragmentFromDragData):
3285         (WebCore::DragController::dragIsMove):
3286         (WebCore::DragController::dragEntered):
3287         (WebCore::DragController::dragExited):
3288         (WebCore::DragController::dragUpdated):
3289         (WebCore::DragController::performDragOperation):
3290         (WebCore::DragController::dragEnteredOrUpdated):
3291         (WebCore::DragController::tryDocumentDrag):
3292         (WebCore::DragController::operationForLoad):
3293         (WebCore::DragController::dispatchTextInputEventFor):
3294         (WebCore::DragController::concludeEditDrag):
3295         (WebCore::DragController::canProcessDrag):
3296         (WebCore::DragController::tryDHTMLDrag):
3297         * page/DragController.h:
3298         * page/efl/DragControllerEfl.cpp:
3299         (WebCore::DragController::isCopyKeyDown):
3300         (WebCore::DragController::dragOperation):
3301         * page/gtk/DragControllerGtk.cpp:
3302         (WebCore::DragController::isCopyKeyDown):
3303         (WebCore::DragController::dragOperation):
3304         * page/mac/DragControllerMac.mm:
3305         (WebCore::DragController::isCopyKeyDown):
3306         (WebCore::DragController::dragOperation):
3307         * page/win/DragControllerWin.cpp:
3308         (WebCore::DragController::dragOperation):
3309         (WebCore::DragController::isCopyKeyDown):
3310         * platform/DragData.h:
3311         (WebCore::DragData::DragData):
3312
3313 2016-11-18  Jeremy Jones  <jeremyj@apple.com>
3314
3315         Add runtime flag to enable pointer lock. Enable pointer lock feature for mac.
3316         https://bugs.webkit.org/show_bug.cgi?id=163801
3317
3318         Reviewed by Simon Fraser.
3319
3320         These tests now pass with DumpRenderTree.
3321         LayoutTests/pointer-lock/lock-already-locked.html
3322         LayoutTests/pointer-lock/lock-element-not-in-dom.html
3323         LayoutTests/pointer-lock/locked-element-iframe-removed-from-dom.html
3324         LayoutTests/pointer-lock/mouse-event-api.html
3325
3326         PointerLockController::requestPointerLock now protects against synchronous callback
3327         to allowPointerLock().
3328
3329         Add pointerLockEnabled setting.
3330
3331         * Configurations/FeatureDefines.xcconfig:
3332         * dom/Document.cpp:
3333         (WebCore::Document::exitPointerLock): Fix existing typo.
3334         (WebCore::Document::pointerLockElement):
3335         * features.json:
3336         * page/EventHandler.cpp:
3337         * page/PointerLockController.cpp:
3338         (WebCore::PointerLockController::requestPointerLock):
3339         (WebCore::PointerLockController::requestPointerUnlock):
3340         * page/Settings.in:
3341
3342 2016-11-17  Alex Christensen  <achristensen@webkit.org>
3343
3344         Support IDN2008 with UTS #46 instead of IDN2003
3345         https://bugs.webkit.org/show_bug.cgi?id=144194
3346
3347         Reviewed by Darin Adler.
3348
3349         Use uidna_nameToASCII instead of the deprecated uidna_IDNToASCII.
3350         It uses IDN2008 instead of IDN2003, and it uses UTF #46 when used with a UIDNA opened with uidna_openUTS46.
3351         This follows https://url.spec.whatwg.org/#concept-domain-to-ascii except we do not use Transitional_Processing
3352         to prevent homograph attacks on german domain names with "ß" and "ss" in them.  These are now treated as separate domains.
3353         Firefox also doesn't use Transitional_Processing. Chrome and the current specification use Transitional_processing,
3354         but https://github.com/whatwg/url/issues/110 might change the spec.
3355         
3356         In addition, http://unicode.org/reports/tr46/ says:
3357         "implementations are encouraged to apply the Bidi and ContextJ validity criteria"
3358         Bidi checks prevent domain names with bidirectional text, such as latin and hebrew characters in the same domain.  Chrome and Firefox do this.