[Win] Extend AVFoundationCF Media Implementation
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2014-10-06  Brent Fulgham  <bfulgham@apple.com>
2
3         [Win] Extend AVFoundationCF Media Implementation
4         https://bugs.webkit.org/show_bug.cgi?id=137409
5
6         Reviewed by Eric Carlson.
7
8         This code is not yet being built and tested by our system. Appropriate
9         tests will be activated when we enable the build.
10
11         Most of this patch involves correcting some misuse of the AVFoundationCF API.
12         1. It is never appropriate in AVCF to pass a null CFErrorRef; instead you must
13            pass a CFErrorRef with error type kCFURLErrorUnknown.
14         2. Because of the asynchronous way we handle the request/response, it is possible
15            for AVCF to make two AVCF requests while negotiating the key exchange.
16
17         * platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h: Add
18         missing declaration.
19         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
20         (WebCore::CDMSessionAVFoundationCF::generateKeyRequest): Tighten up scope
21         of 'underlyingError'.
22         (WebCore::CDMSessionAVFoundationCF::update): Add call to complete the
23         loading process.
24         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
25         (WebCore::InbandTextTrackPrivateAVCF::label): Handle null titles CFArray
26         found during testing.
27         (WebCore::InbandTextTrackPrivateAVCF::language): Ditto for a null locale.
28         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
29         (WebCore::MediaPlayerPrivateAVFoundationCF::registerMediaEngine): Add support
30         for the new 'supportsKeySystem' method.
31         (WebCore::MediaPlayerPrivateAVFoundationCF::createContextVideoRenderer): Add
32         assertion for mainThread.
33         (WebCore::MediaPlayerPrivateAVFoundationCF::destroyContextVideoRenderer): Ditto.
34         (WebCore::MediaPlayerPrivateAVFoundationCF::createVideoLayer): Ditto.
35         (WebCore::MediaPlayerPrivateAVFoundationCF::destroyVideoLayer): Ditto.
36         (WebCore::MediaPlayerPrivateAVFoundationCF::createAVPlayer): Ditto.
37         (WebCore::MediaPlayerPrivateAVFoundationCF::createAVPlayerItem): Ditto.
38         (WebCore::MediaPlayerPrivateAVFoundationCF::platformLayer): Ditto.
39         (WebCore::MediaPlayerPrivateAVFoundationCF::platformSetVisible): Ditto.
40         (WebCore::MediaPlayerPrivateAVFoundationCF::paintCurrentFrameInContext): Ditto.
41         (WebCore::MediaPlayerPrivateAVFoundationCF::paint): Ditto.
42         (WebCore::MediaPlayerPrivateAVFoundationCF::supportsKeySystem): Added.
43         (WebCore::MediaPlayerPrivateAVFoundationCF::sizeChanged): Add assertion that this
44         is being called on the main thread.
45         (WebCore::MediaPlayerPrivateAVFoundationCF::processMediaSelectionOptions): Handle
46         the allows empty media selection properly based on test behavior.
47         (WebCore::AVFWrapper::AVFWrapper): Initialize resource loader callback structure
48         when building with AVFOUNDATION_LOADER_DELEGATE.
49         (WebCore::AVFWrapper::createAssetForURL): Use AVFWrapper's loader callback struct,
50         rather than passing the address of a temporary value.
51         (WebCore::AVFWrapper::processNotification): Stop using the deprecated 
52         'dispatch_get_current_queue' function.
53         (WebCore::AVFWrapper::processCue): Ditto.
54         (WebCore::AVFWrapper::legibleOutputCallback): Ditto.
55         (WebCore::AVFWrapper::processShouldWaitForLoadingOfResource): Pass a valid CFError
56         object; nullptr is not allowed as an argument to the "...FinishedLoadingWithError"
57         method.
58         (WebCore::AVFWrapper::shouldWaitForLoadingOfResource): Add support for multiple
59         in-flight requests.
60         (WebCore::AVFWrapper::platformLayer): Assert we are on the main thread.
61         (WebCore::AVFWrapper::setRequestForKey): Add support for multiple in-flight requests.
62         (WebCore::AVFWrapper::takeRequestForKeyURI): Ditto.
63         (WebCore::LayerClient::platformCALayerLayoutSublayersOfLayer): Ditto.
64         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
65         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp: Make sure we pass
66         valid CFError objects, rather than nullptr.
67
68 2014-10-06  Chris Fleizach  <cfleizach@apple.com>
69
70         AX: Performance: Certain Web site causes Safari to hang completely while entering form data
71         https://bugs.webkit.org/show_bug.cgi?id=137420
72
73         Reviewed by Mario Sanchez Prada.
74
75         If a website has multiple nested tables that are not "accessibility" tables, the performance of accessibility slows to a crawl because:
76           1) We are re-computing accessibilityIsIgnored many times.
77                As a solution, we can enable the isIgnoredCache when updating children.
78           2) When asking if an object isTableCell, we'd go up the parent chain, asking each of those parents the same question, which exploded into calling this many times.
79               As a solution, I've changed our determination of isTableCell to instead check if the parent is an accessibiltyTable which should be much faster.
80
81         No new functionality. Existing tests cover changes.
82
83         * accessibility/AccessibilityObject.cpp:
84         (WebCore::AccessibilityObject::updateChildrenIfNecessary):
85         (WebCore::AccessibilityObject::accessibilityIsIgnored):
86         * accessibility/AccessibilityTableCell.cpp:
87         (WebCore::AccessibilityTableCell::parentTable):
88         (WebCore::AccessibilityTableCell::isTableCell):
89
90 2014-10-06  Csaba Osztrogonác  <ossy@webkit.org>
91
92         Unreviewed, touch testing/Internals.idl to try to fix Windows EWS after r174315.
93
94         * testing/Internals.idl: Remove unnecessary whitespaces.
95
96 2014-10-05  Christophe Dumez  <cdumez@apple.com>
97
98         Use is<>() / downcast<>() for ScrollingCoordinator / ScrollingStateNode subclasses
99         https://bugs.webkit.org/show_bug.cgi?id=137440
100
101         Reviewed by Ryosuke Niwa.
102
103         Use is<>() / downcast<>() for ScrollingCoordinator / ScrollingStateNode subclasses.
104
105         No new tests, no behavior change.
106
107         * page/scrolling/AsyncScrollingCoordinator.cpp:
108         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
109         (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
110         (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
111         (WebCore::AsyncScrollingCoordinator::updateFrameScrollingNode):
112         (WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode):
113         (WebCore::AsyncScrollingCoordinator::updateViewportConstrainedNode):
114         (WebCore::AsyncScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView):
115         * page/scrolling/AsyncScrollingCoordinator.h:
116         * page/scrolling/ScrollingCoordinator.h:
117         * page/scrolling/ScrollingStateFixedNode.h:
118         * page/scrolling/ScrollingStateFrameScrollingNode.h:
119         * page/scrolling/ScrollingStateNode.h:
120         * page/scrolling/ScrollingStateOverflowScrollingNode.h:
121         * page/scrolling/ScrollingStateScrollingNode.h:
122         * page/scrolling/ScrollingStateStickyNode.h:
123         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
124         (WebCore::ScrollingTreeFrameScrollingNode::updateBeforeChildren):
125         * page/scrolling/ScrollingTreeScrollingNode.cpp:
126         (WebCore::ScrollingTreeScrollingNode::updateBeforeChildren):
127         (WebCore::ScrollingTreeScrollingNode::updateAfterChildren):
128         * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
129         (WebCore::ScrollingCoordinatorCoordinatedGraphics::updateViewportConstrainedNode):
130         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
131         (WebCore::ScrollingTreeFrameScrollingNodeIOS::updateBeforeChildren):
132         (WebCore::ScrollingTreeFrameScrollingNodeIOS::updateAfterChildren):
133         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
134         (WebCore::ScrollingTreeFixedNode::updateBeforeChildren):
135         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
136         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
137         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateAfterChildren):
138         * page/scrolling/mac/ScrollingTreeStickyNode.mm:
139         (WebCore::ScrollingTreeStickyNode::updateBeforeChildren):
140
141 2014-10-05  Christophe Dumez  <cdumez@apple.com>
142
143         Use is<>() / downcast<>() for CachedRawResource
144         https://bugs.webkit.org/show_bug.cgi?id=137439
145
146         Reviewed by Ryosuke Niwa.
147
148         Use is<>() / downcast<>() for CachedRawResource.
149
150         No new tests, no behavior change.
151
152         * inspector/InspectorResourceAgent.cpp:
153         (WebCore::InspectorResourceAgent::didLoadResourceFromMemoryCache):
154         * loader/cache/CachedRawResource.cpp:
155         (WebCore::CachedRawResource::switchClientsToRevalidatedResource):
156         * loader/cache/CachedRawResource.h:
157         (isType):
158         * loader/cache/CachedResourceLoader.cpp:
159         (WebCore::CachedResourceLoader::requestRawResource):
160         (WebCore::CachedResourceLoader::requestMainResource):
161
162 2014-10-05  Christophe Dumez  <cdumez@apple.com>
163
164         Use is<>() / downcast<>() for TextTrack subclasses
165         https://bugs.webkit.org/show_bug.cgi?id=137438
166
167         Reviewed by Ryosuke Niwa.
168
169         Use is<>() / downcast<>() for TextTrack subclasses.
170
171         No new tests, no behavior change.
172
173         * Modules/mediasource/SourceBuffer.cpp:
174         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
175         * html/HTMLMediaElement.cpp:
176         (WebCore::HTMLMediaElement::parseAttribute):
177         * html/track/InbandTextTrack.h:
178         (isType):
179         * html/track/LoadableTextTrack.h:
180         (isType):
181         * html/track/TextTrackList.cpp:
182         (TextTrackList::getTrackIndex):
183         (TextTrackList::append): Deleted.
184
185 2014-10-05  Christophe Dumez  <cdumez@apple.com>
186
187         Use is<>() / downcast<>() for CryptoKeyData subclasses
188         https://bugs.webkit.org/show_bug.cgi?id=137437
189
190         Reviewed by Ryosuke Niwa.
191
192         Use is<>() / downcast<>() for CryptoKeyData subclasses.
193
194         No new tests, no behavior change.
195
196         * bindings/js/JSCryptoKeySerializationJWK.cpp:
197         (WebCore::JSCryptoKeySerializationJWK::serialize):
198         * bindings/js/SerializedScriptValue.cpp:
199         (WebCore::CloneSerializer::write):
200         * crypto/CryptoKeyData.h:
201         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
202         (WebCore::CryptoAlgorithmAES_CBC::importKey):
203         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
204         (WebCore::CryptoAlgorithmAES_KW::importKey):
205         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
206         (WebCore::CryptoAlgorithmHMAC::importKey):
207         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
208         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
209         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
210         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
211         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
212         (WebCore::CryptoAlgorithmRSA_OAEP::importKey):
213         * crypto/keys/CryptoKeyDataOctetSequence.h:
214         (WebCore::isCryptoKeyDataOctetSequence): Deleted.
215         * crypto/keys/CryptoKeyDataRSAComponents.h:
216         (WebCore::isCryptoKeyDataRSAComponents): Deleted.
217         * crypto/keys/CryptoKeySerializationRaw.cpp:
218         (WebCore::CryptoKeySerializationRaw::serialize):
219
220 2014-10-05  Benjamin Poulain  <bpoulain@apple.com>
221
222         Add a deprecation warning for Element.webkitMatchesSelector
223         https://bugs.webkit.org/show_bug.cgi?id=137417
224
225         Reviewed by Christophe Dumez.
226
227         Many scripts have assumed that the unprefixed version of ElementwebkitMatchesSelector
228         would be Element.matchesSelector. Feature detection scripts too often test
229         for Element.matchesSelector instead of Element.matches before calling Element.webkitMatchesSelector.
230
231         This patch add a deprecation warning for Element.webkitMatchesSelector with the hope
232         that it will push the adoption of the unprefixed version.
233
234         * dom/Element.cpp:
235         (WebCore::Element::webkitMatchesSelector):
236         * dom/Element.h:
237         * dom/Element.idl:
238
239 2014-10-05  Benjamin Poulain  <benjamin@webkit.org>
240
241         Element.matches()'s argument is not supposed to be optional
242         https://bugs.webkit.org/show_bug.cgi?id=137427
243
244         Reviewed by Christophe Dumez.
245
246         The argument was marked as optional, it is not supposed to:
247         https://dom.spec.whatwg.org/#interface-element
248
249         Also update the webkit-prefixed version: webkitMatchesSelector().
250
251         Tests: fast/dom/SelectorAPI/closest-definition.html
252                fast/dom/SelectorAPI/closest-null-undefined.html
253                fast/dom/SelectorAPI/matches-definition.html
254                fast/dom/SelectorAPI/matches-null-undefined.html
255
256         * dom/Element.idl:
257
258 2014-10-05  Christophe Dumez  <cdumez@apple.com>
259
260         Use is<>() / downcast<>() for CachedResource subclasses
261         https://bugs.webkit.org/show_bug.cgi?id=137431
262
263         Reviewed by Benjamin Poulain.
264
265         Use is<>() / downcast<>() for CachedResource subclasses.
266
267         No new tests, no behavior change.
268
269         * inspector/InspectorPageAgent.cpp:
270         (WebCore::InspectorPageAgent::cachedResourceContent):
271         * loader/cache/CachedCSSStyleSheet.h:
272         * loader/cache/CachedFont.h:
273         * loader/cache/CachedImage.cpp:
274         (WebCore::CachedImage::switchClientsToRevalidatedResource):
275         * loader/cache/CachedImage.h:
276         * loader/cache/CachedResource.h:
277         * loader/cache/CachedResourceLoader.cpp:
278         (WebCore::CachedResourceLoader::requestImage):
279         (WebCore::CachedResourceLoader::requestFont):
280         (WebCore::CachedResourceLoader::requestTextTrack):
281         (WebCore::CachedResourceLoader::requestCSSStyleSheet):
282         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
283         (WebCore::CachedResourceLoader::requestScript):
284         (WebCore::CachedResourceLoader::requestXSLStyleSheet):
285         (WebCore::CachedResourceLoader::requestSVGDocument):
286         (WebCore::CachedResourceLoader::reloadImagesIfNotDeferred):
287         * loader/cache/CachedSVGDocument.h:
288         * loader/cache/CachedScript.h:
289         * loader/cache/CachedTextTrack.h:
290         * loader/cache/CachedXSLStyleSheet.h:
291         * loader/cache/MemoryCache.cpp:
292         (WebCore::MemoryCache::removeImageFromCache):
293
294 2014-10-05  Christophe Dumez  <cdumez@apple.com>
295
296         Use is<>() / downcast<>() for StyleSheet subclasses
297         https://bugs.webkit.org/show_bug.cgi?id=137429
298
299         Reviewed by Benjamin Poulain.
300
301         Use is<>() / downcast<>() for StyleSheet subclasses.
302
303         No new tests, no behavior change.
304
305         * bindings/gobject/WebKitDOMPrivate.cpp:
306         (WebKit::wrap):
307         * css/CSSStyleSheet.h:
308         (isType):
309         * css/StyleSheet.h:
310         * dom/Document.cpp:
311         (WebCore::Document::applyXSLTransform):
312         * dom/DocumentStyleSheetCollection.cpp:
313         (WebCore::filterEnabledNonemptyCSSStyleSheets):
314         * dom/ProcessingInstruction.cpp:
315         (WebCore::ProcessingInstruction::parseStyleSheet):
316         * inspector/InspectorCSSAgent.cpp:
317         (WebCore::InspectorCSSAgent::getAllStyleSheets):
318         * xml/XSLStyleSheet.h:
319         (isType):
320
321 2014-10-05  Christophe Dumez  <cdumez@apple.com>
322
323         Use is<>() / downcast<>() for CryptoAlgorithmParameters subclasses
324         https://bugs.webkit.org/show_bug.cgi?id=137432
325
326         Reviewed by Benjamin Poulain.
327
328         Use is<>() / downcast<>() for CryptoAlgorithmParameters subclasses.
329
330         No new tests, no behavior change.
331
332         * bindings/js/JSCryptoKeySerializationJWK.cpp:
333         (WebCore::JSCryptoKeySerializationJWK::reconcileAlgorithm):
334         * crypto/CryptoAlgorithmParameters.h:
335         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
336         (WebCore::CryptoAlgorithmAES_CBC::encrypt):
337         (WebCore::CryptoAlgorithmAES_CBC::decrypt):
338         (WebCore::CryptoAlgorithmAES_CBC::generateKey):
339         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
340         (WebCore::CryptoAlgorithmAES_KW::generateKey):
341         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
342         (WebCore::CryptoAlgorithmHMAC::sign):
343         (WebCore::CryptoAlgorithmHMAC::verify):
344         (WebCore::CryptoAlgorithmHMAC::generateKey):
345         (WebCore::CryptoAlgorithmHMAC::importKey):
346         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
347         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::generateKey):
348         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
349         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::sign):
350         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::verify):
351         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::generateKey):
352         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
353         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
354         (WebCore::CryptoAlgorithmRSA_OAEP::encrypt):
355         (WebCore::CryptoAlgorithmRSA_OAEP::decrypt):
356         (WebCore::CryptoAlgorithmRSA_OAEP::generateKey):
357         (WebCore::CryptoAlgorithmRSA_OAEP::importKey):
358         * crypto/parameters/CryptoAlgorithmAesCbcParams.h:
359         * crypto/parameters/CryptoAlgorithmAesKeyGenParams.h:
360         * crypto/parameters/CryptoAlgorithmHmacKeyParams.h:
361         * crypto/parameters/CryptoAlgorithmHmacParams.h:
362         * crypto/parameters/CryptoAlgorithmRsaKeyGenParams.h:
363         * crypto/parameters/CryptoAlgorithmRsaKeyParamsWithHash.h:
364         * crypto/parameters/CryptoAlgorithmRsaOaepParams.h:
365         * crypto/parameters/CryptoAlgorithmRsaSsaParams.h:
366
367 2014-10-05  Chris Fleizach  <cfleizach@apple.com>
368
369         AX: iOS8: Crash at -[WebAccessibilityObjectWrapper accessibilityElementAtIndex:]
370         https://bugs.webkit.org/show_bug.cgi?id=137289
371
372         Reviewed by Mario Sanchez Prada.
373
374         Casting a NSInteger to an unsigned can bypass the check we were hoping to achieve, 
375         because size_t is not the same as unsigned.
376
377         Test: platform/ios-sim/accessibility/out-of-bounds-child-access.html
378
379         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
380         (-[WebAccessibilityObjectWrapper accessibilityElementAtIndex:]):
381
382 2014-10-05  Christophe Dumez  <cdumez@apple.com>
383
384         Use is<>() / downcast<>() for ElementData subclasses
385         https://bugs.webkit.org/show_bug.cgi?id=137430
386
387         Reviewed by Benjamin Poulain.
388
389         Use is<>() / downcast<>() for ElementData subclasses.
390
391         No new tests, no behavior change.
392
393         * dom/Element.cpp:
394         (WebCore::Element::cloneAttributesFromElement):
395         (WebCore::Element::createUniqueElementData):
396         * dom/ElementData.cpp:
397         (WebCore::ElementData::destroy):
398         * dom/ElementData.h:
399         (WebCore::ElementData::length):
400         (WebCore::ElementData::attributeBase):
401         (WebCore::ElementData::presentationAttributeStyle):
402         (WebCore::ElementData::attributesIterator):
403         (WebCore::ElementData::findAttributeByName):
404         (isType):
405
406 2014-10-05  Lorenzo Tilve  <ltilve@igalia.com>
407
408         [GTK] Fix build when DRAG_SUPPORT is disabled
409         https://bugs.webkit.org/show_bug.cgi?id=137361
410
411         Reviewed by Carlos Garcia Campos.
412
413         Flag out unbuildable code without DRAG_SUPPORT.
414
415         * platform/gtk/GtkDragAndDropHelper.cpp:
416         * platform/gtk/GtkDragAndDropHelper.h:
417
418 2014-10-05  Carlos Garcia Campos  <cgarcia@igalia.com>
419
420         [GTK] Do not generate a symlink in derived sources for every header in WebCore/bindings/gobject
421         https://bugs.webkit.org/show_bug.cgi?id=137389
422
423         Reviewed by Martin Robinson.
424
425         We only need a symlink for static sources that are included in
426         public generated headers, because they are added with as
427         <webkitdom/WebKitDOMFoo.h> so they need to be inside a webkitdom
428         directory. Also use proper targets and commands to create the
429         symlinks only when needed instead of for every build.
430
431         * PlatformGTK.cmake:
432
433 2014-10-04  Myles C. Maxfield  <mmaxfield@apple.com>
434
435         [SVG -> OTF Converter] Arabic forms are not substituted correctly
436         https://bugs.webkit.org/show_bug.cgi?id=137092
437
438         Reviewed by Darin Adler.
439
440         Tests: svg/W3C-SVG-1.1/fonts-glyph-02-t.svg
441                svg/custom/glyph-selection-arabic-forms.svg
442
443         * svg/SVGToOTFFontConversion.cpp:
444         (WebCore::SVGToOTFFontConverter::appendArabicReplacementSubtable): Invoked for each of the three
445         Arabic form substitutions.
446         (WebCore::SVGToOTFFontConverter::appendGSUBTable): OpenType "Advanced Typographic Table":
447         "Glyph substitution data"
448         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter): Re-order the m_codepointsToIndicesMap
449         to prefer isolated forms of glyphs.
450         (WebCore::SVGToOTFFontConverter::convertSVGToOTFFont): Append the GSUB table.
451         (WebCore::calculateChecksum): Deleted.
452
453 2014-10-04  Dhi Aurrahman  <diorahman@rockybars.com>
454
455         Implement Element.closest() API
456         https://bugs.webkit.org/show_bug.cgi?id=137418
457
458         Reviewed by Benjamin Poulain.
459
460         Implement Element.closest() API as specified in [1].
461
462         [1]: https://dom.spec.whatwg.org/#dom-element-closest
463
464         Tests: fast/selectors/closest-general.html
465                fast/selectors/closest-scope.html
466
467         * dom/Element.cpp:
468         (WebCore::Element::closest):
469         * dom/Element.h:
470         * dom/Element.idl:
471         * dom/SelectorQuery.cpp:
472         (WebCore::SelectorDataList::selectorClosest):
473         (WebCore::SelectorDataList::closest):
474         * dom/SelectorQuery.h:
475         (WebCore::SelectorQuery::closest):
476
477 2014-10-04  Brian J. Burg  <burg@cs.washington.edu>
478
479         Unreviewed, rolling out r174319.
480
481         Causes assertions in fast/profiler tests. Needs nontrivial
482         investigation, will take offline.
483
484         Reverted changeset:
485
486         "Web Inspector: timelines should not count time elapsed while
487         paused in the debugger"
488         https://bugs.webkit.org/show_bug.cgi?id=136351
489         http://trac.webkit.org/changeset/174319
490
491 2014-10-04  Brian J. Burg  <burg@cs.washington.edu>
492
493         Web Inspector: timelines should not count time elapsed while paused in the debugger
494         https://bugs.webkit.org/show_bug.cgi?id=136351
495
496         Reviewed by Timothy Hatcher.
497
498         To avoid counting time elapsed while the debugger is paused, timeline records should
499         keep track of time elapsed since the start of timeline capturing, rather than wall clock
500         timestamps. We can easily compute elapsed time by sharing Stopwatch instance among
501         all timeline record-generating code. The stopwatch is paused while the debugger is paused,
502         so subsequent time measurements will not include time elapsed while the debugger is paused.
503
504         Agents use the shared stopwatch to generate timestamps if the timeline agent is active
505         (i.e., a timeline recording is being captured). If not, use a zero timestamp since the timing data is only revealed through the Timeline interface.
506
507         This refactoring is safe because start and end times are only used to graph records; the
508         timestamp's actual value is irrelevant and is not displayed in the user interface. Date
509         timestamps are still included with network-related records as part of their header data.
510
511         No new tests, because we cannot reliably test timing changes induced by debugger pauses.
512         It is possible for records to accrue time before the debugger pauses or after it resumes.
513
514         * inspector/InspectorCSSAgent.cpp: Remove unused include.
515         * inspector/InspectorPageAgent.cpp: Use timestamps from the shared stopwatch.
516         (WebCore::InspectorPageAgent::timestamp):
517         (WebCore::InspectorPageAgent::domContentEventFired):
518         (WebCore::InspectorPageAgent::loadEventFired):
519         * inspector/InspectorPageAgent.h:
520         * inspector/InspectorResourceAgent.cpp: Use timestamps from the shared stopwatch.
521         (WebCore::InspectorResourceAgent::timestamp):
522         (WebCore::InspectorResourceAgent::willSendRequest):
523         (WebCore::InspectorResourceAgent::didReceiveResponse):
524         (WebCore::InspectorResourceAgent::didReceiveData):
525         (WebCore::InspectorResourceAgent::didFinishLoading):
526         (WebCore::InspectorResourceAgent::didFailLoading):
527         (WebCore::InspectorResourceAgent::didLoadResourceFromMemoryCache):
528         (WebCore::InspectorResourceAgent::willSendWebSocketHandshakeRequest):
529         (WebCore::InspectorResourceAgent::didReceiveWebSocketHandshakeResponse):
530         (WebCore::InspectorResourceAgent::didCloseWebSocket):
531         (WebCore::InspectorResourceAgent::didReceiveWebSocketFrame):
532         (WebCore::InspectorResourceAgent::didSendWebSocketFrame):
533         (WebCore::InspectorResourceAgent::didReceiveWebSocketFrameError):
534         * inspector/InspectorResourceAgent.h:
535         * inspector/InspectorTimelineAgent.cpp: Add calls to reset, start, and stop the stopwatch.
536         (WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend):
537         (WebCore::InspectorTimelineAgent::internalStart):
538         (WebCore::InspectorTimelineAgent::internalStop):
539         (WebCore::startProfiling):
540         (WebCore::InspectorTimelineAgent::startFromConsole):
541         (WebCore::InspectorTimelineAgent::willCallFunction):
542         (WebCore::InspectorTimelineAgent::willEvaluateScript):
543         (WebCore::InspectorTimelineAgent::didPause):
544         (WebCore::InspectorTimelineAgent::didContinue):
545         (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
546         (WebCore::InspectorTimelineAgent::timestamp):
547         (WebCore::TimelineTimeConverter::reset): Deleted.
548         * inspector/InspectorTimelineAgent.h: Make timestamp() public, and remove old timepieces.
549         (WebCore::TimelineTimeConverter::TimelineTimeConverter): Deleted.
550         (WebCore::TimelineTimeConverter::fromMonotonicallyIncreasingTime): Deleted.
551         (WebCore::InspectorTimelineAgent::timeConverter): Deleted.
552         * inspector/TimelineRecordFactory.cpp:
553
554 2014-10-04  Tim Horton  <timothy_horton@apple.com>
555
556         Make it possible to test page overlays
557         https://bugs.webkit.org/show_bug.cgi?id=137339
558
559         Reviewed by Dan Bernstein.
560
561         Tests: pageoverlay/overlay-installation.html
562                pageoverlay/overlay-large-document-scrolled.html
563                pageoverlay/overlay-large-document.html
564
565         Do some initial work to make page overlays testable.
566         There are many more tests to be written, but this lays the groundwork.
567
568         * WebCore.exp.in:
569         * WebCore.xcodeproj/project.pbxproj:
570         * WebCore.vcxproj/WebCoreTestSupport.vcxproj:
571         * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters:
572         * CMakeLists.txt:
573         Add MockPageOverlayClient.
574
575         * platform/graphics/GraphicsLayer.h:
576         * page/PageOverlayController.h:
577         * page/PageOverlayController.cpp:
578         (WebCore::PageOverlayController::shouldSkipLayerInDump):
579         Don't skip PageOverlayController-owned layers in the layer tree dump if the
580         layerTreeAsText behavior says that we should include them.
581
582         * platform/graphics/GraphicsLayer.cpp:
583         (WebCore::dumpChildren):
584         
585         * platform/graphics/GraphicsLayerClient.h:
586         (WebCore::GraphicsLayerClient::shouldSkipLayerInDump):
587         * rendering/RenderLayerBacking.cpp:
588         (WebCore::RenderLayerBacking::shouldSkipLayerInDump):
589         * rendering/RenderLayerBacking.h:
590         Pass the LayerTreeAsTextBehavior through shouldSkipLayerInDump.
591
592         * testing/Internals.cpp:
593         (WebCore::Internals::resetToConsistentState):
594         Uninstall all page overlays when resetting to a consistent state.
595
596         (WebCore::Internals::installMockPageOverlay):
597         (WebCore::Internals::pageOverlayLayerTreeAsText):
598         Expose two new internals functions.
599         installMockPageOverlay takes "view" or "document", allowing script
600         to choose the appropriate overlay type.
601         pageOverlayLayerTreeAsText dumps both view and document-relative
602         overlays, from each overlay container layer.
603
604         * testing/Internals.h:
605         * testing/Internals.idl:
606         Fix some typos.
607
608         * testing/MockPageOverlayClient.cpp: Added.
609         (WebCore::MockPageOverlayClient::shared):
610         (WebCore::MockPageOverlayClient::MockPageOverlayClient):
611         (WebCore::MockPageOverlayClient::installOverlay):
612         (WebCore::MockPageOverlayClient::uninstallAllOverlays):
613         (WebCore::MockPageOverlayClient::layerTreeAsText):
614         (WebCore::MockPageOverlayClient::pageOverlayDestroyed):
615         (WebCore::MockPageOverlayClient::willMoveToPage):
616         (WebCore::MockPageOverlayClient::didMoveToPage):
617         When the overlay is parented, mark it as needing repaint.
618         Future tests might want to test overlays without content,
619         but for now this is a reasonable default behavior.
620
621         (WebCore::MockPageOverlayClient::drawRect):
622         Paint the overlay rects as described in the LayoutTests ChangeLog.
623
624         (WebCore::MockPageOverlayClient::mouseEvent):
625         (WebCore::MockPageOverlayClient::didScrollFrame):
626         (WebCore::MockPageOverlayClient::copyAccessibilityAttributeStringValueForPoint):
627         (WebCore::MockPageOverlayClient::copyAccessibilityAttributeBoolValueForPoint):
628         (WebCore::MockPageOverlayClient::copyAccessibilityAttributeNames):
629
630         * testing/MockPageOverlayClient.h: Added.
631
632 2014-10-04  Carlos Garcia Campos  <cgarcia@igalia.com>
633
634         Move DragController::createFragmentFromDragData implementation to the editor
635         https://bugs.webkit.org/show_bug.cgi?id=136819
636
637         Reviewed by Darin Adler.
638
639         Make Editor::webContentFromPasteboard() common to all ports and
640         add a implementation for every port.
641
642         * PlatformWin.cmake: Add new files to compilation.
643         * WebCore.vcxproj/WebCore.vcxproj: Ditto.
644         * editing/Editor.cpp:
645         (WebCore::Editor::pasteWithPasteboard): Move to EditorWin.cpp
646         since this is only used by windows port.
647         * editing/Editor.h:
648         * editing/efl/EditorEfl.cpp:
649         (WebCore::Editor::webContentFromPasteboard):
650         * editing/gtk/EditorGtk.cpp:
651         (WebCore::Editor::webContentFromPasteboard):
652         * editing/win/EditorWin.cpp: Added.
653         (WebCore::Editor::pasteWithPasteboard):
654         (WebCore::Editor::webContentFromPasteboard):
655         * page/DragController.cpp:
656         (WebCore::documentFragmentFromDragData): Use the editor instead of
657         createFragmentFromDragData() that has been removed. Also made this
658         method a static funtion again.
659         * page/DragController.h:
660         * page/efl/DragControllerEfl.cpp: Remove createFragmentFromDragData().
661         * page/gtk/DragControllerGtk.cpp: Ditto.
662         * page/mac/DragControllerMac.mm: Ditto.
663         * page/win/DragControllerWin.cpp: Ditto.
664         * platform/Pasteboard.h:
665         (WebCore::Pasteboard::dragDataMap): Add a getter for m_dragDataMap
666         as required by Editor::webContentFromPasteboard for windows.
667
668 2014-10-04  Christophe Dumez  <cdumez@apple.com>
669
670         Use is<>() / downcast<>() for CSS StyleProperties
671         https://bugs.webkit.org/show_bug.cgi?id=137398
672
673         Reviewed by Benjamin Poulain.
674
675         Use is<>() / downcast<>() for CSS StyleProperties subclasses.
676
677         No new tests, no behavior change.
678
679         * css/StyleProperties.cpp:
680         (WebCore::StyleProperties::immutableCopyIfNeeded):
681         (WebCore::MutableStyleProperties::MutableStyleProperties):
682         (WebCore::StyleProperties::hasCSSOMWrapper):
683         * css/StyleProperties.h:
684         (WebCore::StyleProperties::PropertyReference::propertyMetadata):
685         (WebCore::StyleProperties::PropertyReference::propertyValue):
686         (WebCore::StyleProperties::propertyCount):
687         (WebCore::StyleProperties::deref):
688         (WebCore::StyleProperties::findPropertyIndex):
689         (isType):
690         (WebCore::toMutableStyleProperties): Deleted.
691         (WebCore::toImmutableStyleProperties): Deleted.
692         * css/StyleRule.cpp:
693         (WebCore::StyleRule::mutableProperties):
694         (WebCore::StyleRulePage::mutableProperties):
695         (WebCore::StyleRuleFontFace::mutableProperties):
696         * css/WebKitCSSKeyframeRule.cpp:
697         (WebCore::StyleKeyframe::mutableProperties):
698         * dom/StyledElement.cpp:
699         (WebCore::StyledElement::ensureMutableInlineStyle):
700         (WebCore::StyledElement::setInlineStyleFromString):
701
702 2014-10-04  Zan Dobersek  <zdobersek@igalia.com>
703
704         [TexMap] Clean up GraphicsLayerTextureMapper::prepareBackingStoreIfNeeded()
705         https://bugs.webkit.org/show_bug.cgi?id=137263
706
707         Reviewed by Darin Adler.
708
709         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
710         (WebCore::GraphicsLayerTextureMapper::prepareBackingStoreIfNeeded): Clean up
711         the method a bit. When the backing store will not be in use the change mask
712         should only get updated if there was a backing store present beforehand.
713
714 2014-10-04  Zan Dobersek  <zdobersek@igalia.com>
715
716         [TexMap] Remove QDoc comments in GraphicsLayerTextureMapper
717         https://bugs.webkit.org/show_bug.cgi?id=137264
718
719         Reviewed by Andreas Kling.
720
721         Remove all the QDoc comments in the class that were
722         left over by the Qt port.
723
724         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
725         (WebCore::GraphicsLayerTextureMapper::setNeedsDisplay):
726
727 2014-10-03  Christophe Dumez  <cdumez@apple.com>
728
729         Use is<>() / downcast<>() for CSSValue subclasses
730         https://bugs.webkit.org/show_bug.cgi?id=137381
731
732         Reviewed by Benjamin Poulain.
733
734         Use is<>() / downcast<>() for CSSValue subclasses.
735
736         No new tests, no behavior change.
737
738         * css/CSSAspectRatioValue.h:
739         * css/CSSBorderImageSliceValue.h:
740         * css/CSSCalculationValue.cpp:
741         (WebCore::CSSCalcExpressionNodeParser::parseValue):
742         * css/CSSCalculationValue.h:
743         * css/CSSCanvasValue.h:
744         * css/CSSComputedStyleDeclaration.cpp:
745         (WebCore::getBorderRadiusShorthandValue):
746         (WebCore::ComputedStyleExtractor::propertyMatches):
747         * css/CSSCrossfadeValue.cpp:
748         (WebCore::subimageKnownToBeOpaque):
749         * css/CSSCrossfadeValue.h:
750         * css/CSSCursorImageValue.cpp:
751         (WebCore::CSSCursorImageValue::~CSSCursorImageValue):
752         (WebCore::CSSCursorImageValue::updateIfSVGCursorIsUsed):
753         (WebCore::CSSCursorImageValue::cachedImage):
754         (WebCore::CSSCursorImageValue::cachedOrPendingImage):
755         (WebCore::CSSCursorImageValue::isSVGCursor):
756         * css/CSSCursorImageValue.h:
757         * css/CSSFilterImageValue.h:
758         * css/CSSFontFaceSrcValue.h:
759         * css/CSSFontFeatureValue.h:
760         * css/CSSFontSelector.cpp:
761         (WebCore::CSSFontSelector::addFontFaceRule):
762         * css/CSSFontValue.h:
763         * css/CSSFunctionValue.h:
764         * css/CSSGradientValue.cpp:
765         (WebCore::CSSGradientValue::image):
766         (WebCore::CSSGradientValue::gradientWithStylesResolved):
767         * css/CSSGradientValue.h:
768         * css/CSSGridLineNamesValue.h:
769         * css/CSSGridTemplateAreasValue.h:
770         * css/CSSImageGeneratorValue.cpp:
771         (WebCore::CSSImageGeneratorValue::image):
772         (WebCore::CSSImageGeneratorValue::isFixedSize):
773         (WebCore::CSSImageGeneratorValue::fixedSize):
774         (WebCore::CSSImageGeneratorValue::isPending):
775         (WebCore::CSSImageGeneratorValue::knownToBeOpaque):
776         (WebCore::CSSImageGeneratorValue::loadSubimages):
777         (WebCore::CSSImageGeneratorValue::subimageIsPending):
778         (WebCore::CSSImageGeneratorValue::cachedImageForCSSValue):
779         * css/CSSImageGeneratorValue.h:
780         * css/CSSImageSetValue.cpp:
781         (WebCore::CSSImageSetValue::fillImageSet):
782         * css/CSSImageSetValue.h:
783         * css/CSSImageValue.h:
784         * css/CSSInheritedValue.h:
785         * css/CSSInitialValue.h:
786         * css/CSSLineBoxContainValue.h:
787         * css/CSSParser.cpp:
788         (WebCore::CSSParser::parseColor):
789         (WebCore::CSSParser::addFillValue):
790         (WebCore::CSSParser::addAnimationValue):
791         (WebCore::CSSParser::parse3ValuesFillPosition):
792         (WebCore::CSSParser::parseFillPosition):
793         (WebCore::CSSParser::parseFillRepeat):
794         (WebCore::gridMissingGridPositionValue):
795         (WebCore::CSSParser::parseGridTemplateRowsAndAreas):
796         (WebCore::CSSParser::parseBasicShapeCircle):
797         (WebCore::CSSParser::parseBasicShapeEllipse):
798         (WebCore::CSSParser::parseDeprecatedGradient):
799         (WebCore::CSSParser::parseDeprecatedRadialGradient):
800         (WebCore::CSSParser::parseRadialGradient):
801         (WebCore::CSSParser::createFontFaceRule):
802         * css/CSSPrimitiveValue.h:
803         * css/CSSReflectValue.h:
804         * css/CSSShadowValue.h:
805         * css/CSSTimingFunctionValue.h:
806         * css/CSSToStyleMap.cpp:
807         (WebCore::CSSToStyleMap::mapFillAttachment):
808         (WebCore::CSSToStyleMap::mapFillClip):
809         (WebCore::CSSToStyleMap::mapFillComposite):
810         (WebCore::CSSToStyleMap::mapFillBlendMode):
811         (WebCore::CSSToStyleMap::mapFillOrigin):
812         (WebCore::CSSToStyleMap::mapFillRepeatX):
813         (WebCore::CSSToStyleMap::mapFillRepeatY):
814         (WebCore::CSSToStyleMap::mapFillSize):
815         (WebCore::CSSToStyleMap::mapFillXPosition):
816         (WebCore::CSSToStyleMap::mapFillYPosition):
817         (WebCore::CSSToStyleMap::mapFillMaskSourceType):
818         (WebCore::CSSToStyleMap::mapAnimationDelay):
819         (WebCore::CSSToStyleMap::mapAnimationDirection):
820         (WebCore::CSSToStyleMap::mapAnimationDuration):
821         (WebCore::CSSToStyleMap::mapAnimationFillMode):
822         (WebCore::CSSToStyleMap::mapAnimationIterationCount):
823         (WebCore::CSSToStyleMap::mapAnimationName):
824         (WebCore::CSSToStyleMap::mapAnimationPlayState):
825         (WebCore::CSSToStyleMap::mapAnimationProperty):
826         (WebCore::CSSToStyleMap::mapAnimationTimingFunction):
827         (WebCore::CSSToStyleMap::mapNinePieceImage):
828         (WebCore::CSSToStyleMap::mapNinePieceImageSlice):
829         (WebCore::CSSToStyleMap::mapNinePieceImageQuad):
830         (WebCore::CSSToStyleMap::mapNinePieceImageRepeat):
831         * css/CSSUnicodeRangeValue.h:
832         * css/CSSValue.cpp:
833         (WebCore::CSSValue::isImplicitInitialValue):
834         (WebCore::CSSValue::addSubresourceStyleURLs):
835         (WebCore::CSSValue::hasFailedOrCanceledSubresources):
836         (WebCore::CSSValue::equals):
837         (WebCore::CSSValue::cssText):
838         (WebCore::CSSValue::destroy):
839         (WebCore::CSSValue::cloneForCSSOM):
840         * css/CSSValue.h:
841         * css/CSSValueList.h:
842         (WebCore::CSSValueListInspector::CSSValueListInspector):
843         * css/DeprecatedStyleBuilder.cpp:
844         (WebCore::ApplyPropertyDefault::applyValue):
845         (WebCore::ApplyPropertyNumber::applyValue):
846         (WebCore::ApplyPropertyAuto::applyValue):
847         (WebCore::ApplyPropertyClip::applyValue):
848         (WebCore::ApplyPropertyColor::applyValue):
849         (WebCore::ApplyPropertyLength::applyValue):
850         (WebCore::ApplyPropertyString::applyValue):
851         (WebCore::ApplyPropertyBorderRadius::applyValue):
852         (WebCore::ApplyPropertyFillLayer::applyValue):
853         (WebCore::ApplyPropertyComputeLength::applyValue):
854         (WebCore::ApplyPropertyFont::applyValue):
855         (WebCore::ApplyPropertyFontFamily::applyValue):
856         (WebCore::ApplyPropertyFontSize::applyValue):
857         (WebCore::ApplyPropertyFontWeight::applyValue):
858         (WebCore::ApplyPropertyFontVariantLigatures::applyValue):
859         (WebCore::ApplyPropertyCounter::applyValue):
860         (WebCore::ApplyPropertyCursor::applyValue):
861         (WebCore::ApplyPropertyTextAlign::applyValue):
862         (WebCore::ApplyPropertyTextDecoration::applyValue):
863         (WebCore::ApplyPropertyTextDecorationSkip::applyValue):
864         (WebCore::ApplyPropertyMarqueeIncrement::applyValue):
865         (WebCore::ApplyPropertyMarqueeRepetition::applyValue):
866         (WebCore::ApplyPropertyMarqueeSpeed::applyValue):
867         (WebCore::ApplyPropertyTextUnderlinePosition::applyValue):
868         (WebCore::ApplyPropertyLineHeight::applyValue):
869         (WebCore::ApplyPropertyLineHeightForIOSTextAutosizing::applyValue):
870         (WebCore::ApplyPropertyWordSpacing::applyValue):
871         (WebCore::ApplyPropertyPageSize::applyValue):
872         (WebCore::ApplyPropertyTextEmphasisStyle::applyValue):
873         (WebCore::ApplyPropertyTextEmphasisPosition::applyValue):
874         (WebCore::ApplyPropertyResize::applyValue):
875         (WebCore::ApplyPropertyVerticalAlign::applyValue):
876         (WebCore::ApplyPropertyAspectRatio::applyValue):
877         (WebCore::ApplyPropertyZoom::applyValue):
878         (WebCore::ApplyPropertyDisplay::applyValue):
879         (WebCore::ApplyPropertyClipPath::applyValue):
880         (WebCore::ApplyPropertyShape::applyValue):
881         (WebCore::ApplyPropertyImageResolution::applyValue):
882         (WebCore::ApplyPropertyTextIndent::applyValue):
883         * css/MediaList.cpp:
884         (WebCore::reportMediaQueryWarningIfNeeded):
885         * css/MediaQueryEvaluator.cpp:
886         (WebCore::compareAspectRatioValue):
887         (WebCore::numberValue):
888         (WebCore::orientationMediaFeatureEval):
889         (WebCore::evalResolution):
890         (WebCore::device_pixel_ratioMediaFeatureEval):
891         (WebCore::resolutionMediaFeatureEval):
892         (WebCore::computeLength):
893         (WebCore::view_modeMediaFeatureEval):
894         (WebCore::pointerMediaFeatureEval):
895         * css/SVGCSSComputedStyleDeclaration.cpp:
896         (WebCore::strokeDashArrayToCSSValueList):
897         (WebCore::ComputedStyleExtractor::svgPropertyValue):
898         * css/SVGCSSStyleSelector.cpp:
899         (WebCore::StyleResolver::applySVGProperty):
900         * css/SourceSizeList.cpp:
901         (WebCore::computeLength):
902         * css/StyleProperties.cpp:
903         (WebCore::StyleProperties::getLayeredShorthandValue):
904         * css/StyleResolver.cpp:
905         (WebCore::extractDirectionAndWritingMode):
906         (WebCore::createGridTrackSize):
907         (WebCore::createGridTrackList):
908         (WebCore::createGridPosition):
909         (WebCore::StyleResolver::parseSnapCoordinate):
910         (WebCore::StyleResolver::parseSnapPoints):
911         (WebCore::StyleResolver::applyProperty):
912         (WebCore::StyleResolver::styleImage):
913         (WebCore::StyleResolver::generatedOrPendingFromValue):
914         (WebCore::StyleResolver::createFilterOperations):
915         * css/TransformFunctions.cpp:
916         (WebCore::transformsForValue):
917         * css/ViewportStyleResolver.cpp:
918         (WebCore::ViewportStyleResolver::getViewportArgumentValue):
919         * css/WebKitCSSFilterValue.h:
920         * css/WebKitCSSMatrix.cpp:
921         (WebCore::WebKitCSSMatrix::setMatrixValue):
922         * css/WebKitCSSTransformValue.h:
923         (WebCore::toWebKitCSSTransformValue): Deleted.
924         * editing/ApplyStyleCommand.cpp:
925         (WebCore::ApplyStyleCommand::computedFontSize):
926         * editing/EditingStyle.cpp:
927         (WebCore::identifierForStyleProperty):
928         (WebCore::HTMLElementEquivalent::valueIsPresentInStyle):
929         (WebCore::HTMLTextDecorationEquivalent::valueIsPresentInStyle):
930         (WebCore::cssValueToRGBA):
931         (WebCore::EditingStyle::extractFontSizeDelta):
932         (WebCore::EditingStyle::textDirection):
933         (WebCore::EditingStyle::prepareToApplyAt):
934         (WebCore::EditingStyle::mergeStyle):
935         (WebCore::EditingStyle::mergeStyleFromRulesForSerialization):
936         (WebCore::EditingStyle::legacyFontSize):
937         (WebCore::EditingStyle::textDirectionForSelection):
938         (WebCore::StyleChange::extractTextStyles):
939         (WebCore::diffTextDecorations):
940         (WebCore::fontWeightIsBold):
941         (WebCore::isTransparentColorValue):
942         * editing/EditorCommand.cpp:
943         (WebCore::executeToggleStyleInList):
944         * editing/cocoa/HTMLConverter.mm:
945         (stringFromCSSValue):
946         (HTMLConverterCaches::floatPropertyValueForNode):
947         (HTMLConverterCaches::colorPropertyValueForNode):
948         * editing/markup.cpp:
949         (WebCore::propertyMissingOrEqualToNone):
950         * page/PageSerializer.cpp:
951         (WebCore::PageSerializer::retrieveResourcesForProperties):
952         * page/animation/CSSPropertyAnimation.cpp:
953         (WebCore::blendFunc):
954         * rendering/RenderTextControl.cpp:
955         (WebCore::RenderTextControl::adjustInnerTextStyle):
956         * rendering/style/StylePendingImage.h:
957         (WebCore::StylePendingImage::cssImageValue):
958         (WebCore::StylePendingImage::cssCursorImageValue):
959         (WebCore::StylePendingImage::cssImageSetValue):
960         * svg/SVGColor.h:
961         * svg/SVGFontFaceElement.cpp:
962         (WebCore::SVGFontFaceElement::rebuildFontFace):
963         * svg/SVGPaint.h:
964
965 2014-10-03  Myles C. Maxfield  <mmaxfield@apple.com>
966
967         Clean up interface to Font::expansionOpportunityCount()
968         https://bugs.webkit.org/show_bug.cgi?id=137355
969
970         Reviewed by Dean Jackson.
971
972         There are two overloads of Font::expansionOpportunityCount() which perform the same
973         operation. One overload takes a UChar*, the other takes an LChar*, and they both
974         take a length. This is the abstraction that StringView was designed to be. Instead
975         of forcing each caller to take a different overload based on if their data is
976         8 bit or not, allow the caller to construct a StringView and pass that into
977         Font::expansionOpportunityCount() instead of a raw pointer/length.
978
979         No new tests because there is no behavior change.
980
981         * platform/graphics/Font.cpp:
982         (WebCore::Font::expansionOpportunityCountInternal): Original two functions,
983         renamed.
984         (WebCore::Font::expansionOpportunityCount): Takes a StringView, calls 
985         expansionOpportunityCountInternal().
986         * platform/graphics/Font.h: Update signatures.
987         * platform/graphics/WidthIterator.cpp:
988         (WebCore::WidthIterator::WidthIterator): Use new signature to
989         Font::expansionOpportunityCount().
990         * platform/graphics/mac/ComplexTextController.cpp:
991         (WebCore::ComplexTextController::ComplexTextController): Ditto.
992         * rendering/RenderBlockLineLayout.cpp:
993         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment): Ditto.
994         * rendering/RenderText.cpp:
995         (WebCore::RenderText::stringView): Accessor to encapsulate character pointer
996         and length.
997         * rendering/RenderText.h: Signature of new accessor.
998
999 2014-10-03  Brent Fulgham  <bfulgham@apple.com>
1000
1001         [Win] Unreviewed build fix for MSVC 2013 SP 3.
1002
1003         The std::array initializer is not fully implemented in SP3 and causes a
1004         build error.
1005
1006         * platform/graphics/transforms/AffineTransform.cpp: Use old style assignment
1007         initialization for MSVC builds until this bug is fixed.
1008
1009 2014-10-03  Tim Horton  <timothy_horton@apple.com>
1010
1011         WKWebView snapshot of Daring Fireball has the wrong color in the obscured inset
1012         https://bugs.webkit.org/show_bug.cgi?id=137383
1013         <rdar://problem/18535439>
1014
1015         Reviewed by Sam Weinig.
1016
1017         * rendering/RenderView.cpp:
1018         (WebCore::RenderView::paintBoxDecorations):
1019         Use documentBackgroundColor instead of baseBackgroundColor if backgroundShouldExtendBeyondPage is set.
1020
1021 2014-10-03  Dean Jackson  <dino@apple.com>
1022
1023         webkit-appearance: default-button styling does not set the button font color to white
1024         https://bugs.webkit.org/show_bug.cgi?id=137399
1025         rdar://problem/17788616
1026
1027         Reviewed by Dave Hyatt.
1028
1029         When a button is styled with -webkit-appearance: default-button, it should
1030         use the CSSValueActivebuttontext value for its text color when the window
1031         is active, and the normal value when the window is inactive.
1032
1033         Since activating (focus/blur) windows doesn't cause a style recalculation, this
1034         is applied as a paint-time operation. However, the render tree children that
1035         paint the text don't know that they are contained within a RenderButton
1036         and that the button is a default type. So I added an inherited flag, similar
1037         to what we use for visited links, to remember if we're in a button. And then
1038         computeTextPaintStyle chooses the correct value.
1039
1040         We can't test this because our LayoutTest system doesn't have
1041         an active window, and thus the default button renders like a normal
1042         button. This should cause no regressions though. Also, the appearance is
1043         protected behind an SPI (or Setting), so this is not exposed to the Web.
1044
1045         * rendering/RenderTheme.cpp:
1046         (WebCore::RenderTheme::adjustStyle): Set the flag if we're inside a default button.
1047         * rendering/TextPaintStyle.cpp:
1048         (WebCore::computeTextPaintStyle): If we're in a default button inside an active window,
1049         use the CSSValueActivebuttontext color.
1050         * rendering/style/RenderStyle.cpp:
1051         (WebCore::RenderStyle::RenderStyle): Add and expose the new inherited flag: ._insideDefaultButton.
1052         (WebCore::RenderStyle::changeRequiresRepaint): Ditto.
1053         * rendering/style/RenderStyle.h: Ditto.
1054
1055 2014-09-28  Myles C. Maxfield  <mmaxfield@apple.com>
1056
1057         [SVG -> OTF Converter] Support non-BMP codepoints
1058         https://bugs.webkit.org/show_bug.cgi?id=137097
1059
1060         Reviewed by Darin Adler.
1061
1062         This patch has two pieces:
1063
1064         1) Moves write16(), overwrite32() and overwrite16() inside SVGToOTFFontConverter. This
1065         is so that we don't have to keep passing around references to m_result everywhere. Instead,
1066         put the output vector inside the class as an instance member variable. In addition, rename
1067         write32() and write16() to append32() and append16(), and provide a copy of append32 inside
1068         SVGToOTFFontConverter.
1069
1070         2) Change the "Codepoint" typedef to be a String, and rename it to Codepoints. This is so that
1071         we can implement ligatures later on. Update all the places that use this variable to work with
1072         a String of multiple codepoints.
1073
1074         This patch updates the CMAP table to use format 12 instead of format 4. It currently only maps
1075         single codepoints to glyph IDs and skips all multi-codepoint glyphs. We will implement
1076         ligatures in another patch.
1077
1078         Test: svg/custom/glyph-selection-non-bmp.svg
1079
1080         * svg/SVGToOTFFontConversion.cpp:
1081         (WebCore::append32): Append a result to a given vector. This is for the path transcoder.
1082         (WebCore::SVGToOTFFontConverter::releaseResult): WTF::move()'s the result.
1083         (WebCore::SVGToOTFFontConverter::GlyphData::GlyphData): Update to take Codepoints instead of Codepoint.
1084         (WebCore::SVGToOTFFontConverter::append32): Piece 1 above.
1085         (WebCore::SVGToOTFFontConverter::append16): Ditto.
1086         (WebCore::SVGToOTFFontConverter::append4ByteCode): Convenience function.
1087         (WebCore::SVGToOTFFontConverter::overwrite32): Piece 1 above.
1088         (WebCore::SVGToOTFFontConverter::overwrite16): Ditto.
1089         (WebCore::SVGToOTFFontConverter::appendCMAPTable): Update to format 12.
1090         (WebCore::SVGToOTFFontConverter::appendHEADTable): Passing in a result vector is no longer necessary.
1091         (WebCore::SVGToOTFFontConverter::appendHHEATable): Ditto.
1092         (WebCore::SVGToOTFFontConverter::appendHMTXTable): Ditto.
1093         (WebCore::SVGToOTFFontConverter::appendMAXPTable): Ditto.
1094         (WebCore::SVGToOTFFontConverter::appendNAMETable): Ditto.
1095         (WebCore::SVGToOTFFontConverter::appendOS2Table): Ditto.
1096         (WebCore::SVGToOTFFontConverter::appendPOSTTable): Ditto.
1097         (WebCore::isValidStringForCFF): Ditto.
1098         (WebCore::SVGToOTFFontConverter::appendCFFValidString): Ditto.
1099         (WebCore::SVGToOTFFontConverter::appendCFFTable): Ditto.
1100         (WebCore::SVGToOTFFontConverter::appendVORGTable): Ditto.
1101         (WebCore::SVGToOTFFontConverter::appendVHEATable): Ditto.
1102         (WebCore::SVGToOTFFontConverter::appendVMTXTable): Ditto.
1103         (WebCore::SVGToOTFFontConverter::addCodepointRanges): Update for Codepoints.
1104         (WebCore::SVGToOTFFontConverter::addCodepoints): Ditto.
1105         (WebCore::SVGToOTFFontConverter::addGlyphNames): Ditto.
1106         (WebCore::SVGToOTFFontConverter::appendKERNSubtable): Ditto.
1107         (WebCore::SVGToOTFFontConverter::appendKERNTable): Ditto.
1108         (WebCore::writeCFFEncodedNumber): Passing in a result vector is no longer necessary.
1109         (WebCore::SVGToOTFFontConverter::appendGlyphData): Update for Codepoints.
1110         (WebCore::SVGToOTFFontConverter::processGlyphElement): Update for Codepoints.
1111         (WebCore::SVGToOTFFontConverter::compareCodepointsLexicographically): Comparing Codepoints
1112         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter): Update for Codepoints.
1113         (WebCore::SVGToOTFFontConverter::calculateChecksum): Passing in a result vector is no longer necessary.
1114         (WebCore::SVGToOTFFontConverter::appendTable): Ditto.
1115         (WebCore::SVGToOTFFontConverter::convertSVGToOTFFont): Ditto.
1116         (WebCore::convertSVGToOTFFont): Move out of the result vector.
1117         (WebCore::write32): Deleted.
1118         (WebCore::write16): Deleted.
1119         (WebCore::overwrite32): Deleted.
1120         (WebCore::appendCFFValidString): Deleted.
1121         (WebCore::transcodeGlyphPaths): Deleted.
1122         (WebCore::calculateChecksum): Deleted.
1123
1124 2014-10-03  Commit Queue  <commit-queue@webkit.org>
1125
1126         Unreviewed, rolling out r174270.
1127         https://bugs.webkit.org/show_bug.cgi?id=137397
1128
1129         crashes on the bots (Requested by dethbakin on #webkit).
1130
1131         Reverted changeset:
1132
1133         "EventSender dispatches should be per-Document"
1134         https://bugs.webkit.org/show_bug.cgi?id=136051
1135         http://trac.webkit.org/changeset/174270
1136
1137 2014-10-03  Jer Noble  <jer.noble@apple.com>
1138
1139         [iOS] Back-to-back fullscreen videos result in incorrectly sized videos
1140         https://bugs.webkit.org/show_bug.cgi?id=137380
1141
1142         Reviewed by Eric Carlson.
1143
1144         During a normal workflow, a <video> element will create an AVPlayerLayer, then it will get a
1145         fullscreen (hosted) parent layer, then it will be told an explicit fullscreen size. But when
1146         a <video> element creates an AVPlayerLayer after the <video> element is already in
1147         fullscreen mode, it sets that AVPlayerLayer's frame using the size of the hosted parent
1148         layer, rather than the explicit fullscreen size. Instead, use the (already set) explicit
1149         fullscreen size after creating the AVPlayerLayer.
1150
1151         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1152         (WebCore::MediaPlayerPrivateAVFoundationObjC::ensureAVPlayerLayer):
1153         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformLayer):
1154
1155 2014-10-03 Bear Travis <betravis@adobe.com>
1156
1157         REGRESSION (r173531): Use after free in WebCore::RenderStyle::fontMetrics /
1158         WebCore::CSSPrimitiveValue::computeLengthDouble
1159         https://bugs.webkit.org/show_bug.cgi?id=136864
1160
1161         Reviewed by Andreas Kling.
1162
1163         FontLoader previously called updateDocumentStyleIfNeeded,
1164         which would reset styles currently in use as part of
1165         the tabIndex calculation. The FontLoader should instead
1166         wait for pending stylesheets to load.
1167
1168         Tests: fast/css/fontloader-tab-index.html
1169
1170         * css/FontLoader.cpp:
1171         (WebCore::FontLoader::notifyWhenFontsReady): Do not immediately
1172         call loadingDone().
1173         (WebCore::FontLoader::loadingDone): Wait for stylesheets to
1174         finish loading rather than updating document styles.
1175         * css/FontLoader.h:
1176         (WebCore::FontLoader::loading): Include JS font loads when testing
1177         for the loading state.
1178
1179 2014-10-03  Myles C. Maxfield  <mmaxfield@apple.com>
1180
1181         Unreviewed build fix.
1182
1183         Fixing the Windows build after r174269.
1184
1185         * platform/graphics/win/UniscribeController.cpp:
1186         (WebCore::UniscribeController::shapeAndPlaceItem):
1187
1188 2014-10-01  Brian J. Burg  <burg@cs.washington.edu>
1189
1190         EventSender dispatches should be per-Document
1191         https://bugs.webkit.org/show_bug.cgi?id=136051
1192
1193         Reviewed by Andreas Kling.
1194
1195         EventSender uses a Timer to asynchronously dispatch the same event to multiple
1196         elements of the same type on a future run loop. However, we previously dispatched events
1197         to elements from any Document rather than the one that requested the event send.
1198
1199         This patch changes EventSender to be associated with a single Document. EventSenders
1200         for each Document are lazily allocated. Further per-Document or global optimizations
1201         are possible.
1202
1203         This change also lays the groundwork for making EventSender-related DOM events
1204         deterministic during web replay, tracked at <https://webkit.org/b/137090>.
1205
1206         No new tests, covered by fast/text/svg-font-trigger-load-event.html.
1207
1208         * CMakeLists.txt:
1209         * WebCore.vcxproj/WebCore.vcxproj:
1210         * WebCore.vcxproj/WebCore.vcxproj.filters:
1211         * WebCore.xcodeproj/project.pbxproj:
1212         * dom/DOMAllInOne.cpp:
1213         * dom/Document.cpp:
1214         (WebCore::Document::Document):
1215         (WebCore::Document::implicitClose):
1216         Dispatch pending events for this document only. Rename local variable f to frame.
1217
1218         * dom/Document.h:
1219         (WebCore::Document::sharedEventSenders):
1220         * dom/EventSender.h:
1221         (WebCore::EventSender::EventSender):
1222         (WebCore::EventSender::hasPendingEvents):
1223         (WebCore::EventSender<T>::dispatchEventSoon):
1224         (WebCore::EventSender<T>::cancelEvent):
1225         (WebCore::EventSender<T>::dispatchPendingEvents):
1226         (WebCore::EventSender<T>::EventSender): Deleted. The type argument was not necessary.
1227         * dom/SharedEventSenders.cpp: Added. Lazily creates event senders as they are requested.
1228         (WebCore::SharedEventSenders::linkLoadEventSender):
1229         (WebCore::SharedEventSenders::styleLoadEventSender):
1230         (WebCore::SharedEventSenders::imageBeforeloadEventSender):
1231         (WebCore::SharedEventSenders::imageLoadEventSender):
1232         (WebCore::SharedEventSenders::imageErrorEventSender):
1233         * dom/SharedEventSenders.h: Added.
1234         (WebCore::SharedEventSenders::SharedEventSenders):
1235         * html/HTMLLinkElement.cpp:
1236         (WebCore::HTMLLinkElement::~HTMLLinkElement):
1237         (WebCore::HTMLLinkElement::dispatchPendingEvent):
1238         (WebCore::HTMLLinkElement::notifyLoadedSheetAndAllCriticalSubresources):
1239         (WebCore::linkLoadEventSender): Deleted.
1240         (WebCore::HTMLLinkElement::dispatchPendingLoadEvents): Deleted.
1241         * html/HTMLLinkElement.h:
1242         * html/HTMLStyleElement.cpp:
1243         (WebCore::HTMLStyleElement::~HTMLStyleElement):
1244         (WebCore::HTMLStyleElement::dispatchPendingEvent):
1245         (WebCore::HTMLStyleElement::notifyLoadedSheetAndAllCriticalSubresources):
1246         (WebCore::styleLoadEventSender): Deleted.
1247         (WebCore::HTMLStyleElement::dispatchPendingLoadEvents): Deleted.
1248         * html/HTMLStyleElement.h:
1249         * loader/ImageLoader.cpp:
1250         (WebCore::ImageLoader::beforeLoadEventSender):
1251         (WebCore::ImageLoader::loadEventSender):
1252         (WebCore::ImageLoader::errorEventSender):
1253         (WebCore::ImageLoader::dispatchPendingEvent):
1254         (WebCore::beforeLoadEventSender): Deleted.
1255         (WebCore::loadEventSender): Deleted.
1256         (WebCore::errorEventSender): Deleted.
1257         (WebCore::ImageLoader::dispatchPendingBeforeLoadEvents): Deleted.
1258         (WebCore::ImageLoader::dispatchPendingLoadEvents): Deleted.
1259         (WebCore::ImageLoader::dispatchPendingErrorEvents): Deleted.
1260         * loader/ImageLoader.h:
1261         * xml/parser/XMLDocumentParser.cpp:
1262         (WebCore::XMLDocumentParser::append): Remove an early call to the EventSender for image
1263         beforeload events. This was a performance optimization, but is no longer safe since the
1264         document (and thus the event sender) may not be available in a synchronous document write.
1265
1266 2014-10-03  Myles C. Maxfield  <mmaxfield@apple.com>
1267
1268         TextRun::length() should return an unsigned
1269         https://bugs.webkit.org/show_bug.cgi?id=137354
1270
1271         Reviewed by Antti Koivisto.
1272
1273         Currently, the m_len instance variable that backs the TextRun::length() function is
1274         an unsigned, but the length() function implicitly casts that to an int when
1275         returning it. This patch makes the function return an unsigned, and makes the
1276         do any casting if necessary.
1277
1278         No new tests because there is no behavior change.
1279
1280         * platform/graphics/Font.cpp:
1281         (WebCore::Font::drawText): Cast result to int.
1282         (WebCore::Font::drawEmphasisMarks): Ditto.
1283         (WebCore::Font::adjustSelectionRectForText): Ditto.
1284         (WebCore::computeUnderlineType): Update internal type to be unsigned.
1285         * platform/graphics/GlyphBuffer.h:
1286         (WebCore::GlyphBuffer::add): Update sentinel value to be unsigned.
1287         (WebCore::GlyphBuffer::saveOffsetsInString): Ditto.
1288         * platform/graphics/GraphicsContext.cpp: Update internal type to be unsigned.
1289         * platform/graphics/TextRun.h:
1290         (WebCore::TextRun::length): Update return type.
1291         (WebCore::TextRun::charactersLength): Ditto.
1292         * platform/graphics/WidthIterator.cpp:
1293         (WebCore::WidthIterator::advanceInternal): Cast result to int.
1294         * rendering/svg/SVGTextMetricsBuilder.cpp:
1295         (WebCore::SVGTextMetricsBuilder::currentCharacterStartsSurrogatePair): Remove
1296         unnecessary casts.
1297         (WebCore::SVGTextMetricsBuilder::advance): Ditto.
1298         * svg/SVGFontData.cpp:
1299         (WebCore::SVGFontData::applySVGGlyphSelection): Cast result to int.
1300
1301 2014-10-03  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1302
1303         [EFL] Fix build break since r174231 and r174256
1304         https://bugs.webkit.org/show_bug.cgi?id=137384
1305
1306         Unreviewed, EFL build fix.
1307
1308         r174231 and r174256 didn't consider EFL port and CoordinatedGraphics area.
1309
1310         * css/WebKitCSSViewportRule.cpp:
1311         (WebCore::WebKitCSSViewportRule::WebKitCSSViewportRule):
1312         * css/WebKitCSSViewportRule.h:
1313
1314 2014-10-03  Yusuke Suzuki  <utatane.tea@gmail.com>
1315
1316         CSS Selectors Level 4: Add parsing for :matches
1317         https://bugs.webkit.org/show_bug.cgi?id=137348
1318
1319         Reviewed by Benjamin Poulain.
1320
1321         Add initial parsing functionality of :matches pseudo class in Selectors Level 4.
1322         It accepts selector list as a parameter. It can contain pseudo elements.
1323         And now at the parsing phase, multiple pseudo elements are allowed.
1324         Currently :not doesn't accept any functional pseudo classes, :not(:matches(...)) is rejected.
1325         And currently, :matches(:visited, :link) is allowed in the parsing phase.
1326
1327         * css/CSSGrammar.y.in:
1328         * css/CSSParser.cpp:
1329         (WebCore::CSSParser::detectFunctionTypeToken):
1330         * css/CSSSelector.cpp:
1331         (WebCore::appendSelectorList):
1332         (WebCore::CSSSelector::selectorText):
1333         * css/CSSSelector.h:
1334         * css/SelectorChecker.cpp:
1335         (WebCore::SelectorChecker::checkOne):
1336         * css/SelectorPseudoClassAndCompatibilityElementMap.in:
1337         * cssjit/SelectorCompiler.cpp:
1338         (WebCore::SelectorCompiler::addPseudoClassType):
1339
1340 2014-10-02  Andreas Kling  <akling@apple.com>
1341
1342         CSSOM rule wrappers always have a corresponding internal style object.
1343         <https://webkit.org/b/137379>
1344
1345         Make the CSSOM rule wrapper classes use references & Ref instead of
1346         raw pointers and RefPtr for pointing to the internal style rule.
1347
1348         Also changed the signature of reattach() to take a StyleRuleBase&
1349         since it's never called with a null pointer.
1350
1351         Finally marked the rule classes final.
1352
1353         Reviewed by Geoffrey Garen.
1354
1355         * css/CSSCharsetRule.h:
1356         * css/CSSFontFaceRule.cpp:
1357         (WebCore::CSSFontFaceRule::CSSFontFaceRule):
1358         (WebCore::CSSFontFaceRule::reattach):
1359         * css/CSSFontFaceRule.h:
1360         (WebCore::CSSFontFaceRule::create): Deleted.
1361         * css/CSSGroupingRule.cpp:
1362         (WebCore::CSSGroupingRule::CSSGroupingRule):
1363         (WebCore::CSSGroupingRule::reattach):
1364         * css/CSSGroupingRule.h:
1365         * css/CSSImportRule.cpp:
1366         (WebCore::CSSImportRule::CSSImportRule):
1367         (WebCore::CSSImportRule::href):
1368         (WebCore::CSSImportRule::media):
1369         (WebCore::CSSImportRule::cssText):
1370         (WebCore::CSSImportRule::styleSheet):
1371         (WebCore::CSSImportRule::reattach):
1372         * css/CSSImportRule.h:
1373         (WebCore::CSSImportRule::create): Deleted.
1374         * css/CSSMediaRule.cpp:
1375         (WebCore::CSSMediaRule::CSSMediaRule):
1376         (WebCore::CSSMediaRule::mediaQueries):
1377         (WebCore::CSSMediaRule::reattach):
1378         * css/CSSMediaRule.h:
1379         (WebCore::CSSMediaRule::create): Deleted.
1380         * css/CSSPageRule.cpp:
1381         (WebCore::CSSPageRule::CSSPageRule):
1382         (WebCore::CSSPageRule::reattach):
1383         * css/CSSPageRule.h:
1384         (WebCore::CSSPageRule::create): Deleted.
1385         * css/CSSRule.h:
1386         * css/CSSStyleRule.cpp:
1387         (WebCore::CSSStyleRule::CSSStyleRule):
1388         (WebCore::CSSStyleRule::reattach):
1389         * css/CSSStyleRule.h:
1390         (WebCore::CSSStyleRule::create): Deleted.
1391         (WebCore::CSSStyleRule::styleRule): Deleted.
1392         * css/CSSStyleSheet.cpp:
1393         (WebCore::CSSStyleSheet::reattachChildRuleCSSOMWrappers):
1394         * css/CSSSupportsRule.cpp:
1395         (WebCore::CSSSupportsRule::CSSSupportsRule):
1396         (WebCore::CSSSupportsRule::conditionText):
1397         * css/CSSSupportsRule.h:
1398         (WebCore::CSSSupportsRule::create):
1399         * css/CSSUnknownRule.h:
1400         * css/StyleRule.cpp:
1401         (WebCore::StyleRuleBase::createCSSOMWrapper):
1402         * css/StyleRuleImport.h:
1403         (WebCore::StyleRuleImport::mediaQueries):
1404         * css/WebKitCSSKeyframeRule.cpp:
1405         (WebCore::WebKitCSSKeyframeRule::WebKitCSSKeyframeRule):
1406         (WebCore::WebKitCSSKeyframeRule::reattach):
1407         * css/WebKitCSSKeyframeRule.h:
1408         * css/WebKitCSSKeyframesRule.cpp:
1409         (WebCore::WebKitCSSKeyframesRule::WebKitCSSKeyframesRule):
1410         (WebCore::WebKitCSSKeyframesRule::item):
1411         (WebCore::WebKitCSSKeyframesRule::reattach):
1412         * css/WebKitCSSKeyframesRule.h:
1413         (WebCore::WebKitCSSKeyframesRule::create):
1414         * css/WebKitCSSRegionRule.cpp:
1415         (WebCore::WebKitCSSRegionRule::WebKitCSSRegionRule):
1416         (WebCore::WebKitCSSRegionRule::cssText):
1417         * css/WebKitCSSRegionRule.h:
1418         (WebCore::WebKitCSSRegionRule::create):
1419         * css/WebKitCSSViewportRule.cpp:
1420         (WebCore::WebKitCSSViewportRule::reattach):
1421         * css/WebKitCSSViewportRule.h:
1422
1423 2014-10-02  Christophe Dumez  <cdumez@apple.com>
1424
1425         Use is<>() / downcast<>() for CSSRule subclasses
1426         https://bugs.webkit.org/show_bug.cgi?id=137364
1427
1428         Reviewed by Benjamin Poulain.
1429
1430         Use is<>() / downcast<>() functions for CSSRule subclasses.
1431
1432         No new tests, no behavior change.
1433
1434         * css/CSSFontFaceRule.h:
1435         * css/CSSImportRule.h:
1436         * css/CSSMediaRule.h:
1437         * css/CSSRule.h:
1438         * css/CSSStyleRule.h:
1439         * css/CSSSupportsRule.h:
1440         * css/InspectorCSSOMWrappers.cpp:
1441         (WebCore::InspectorCSSOMWrappers::collect):
1442         * css/WebKitCSSKeyframesRule.h:
1443         * css/WebKitCSSRegionRule.h:
1444         * inspector/InspectorCSSAgent.cpp:
1445         (WebCore::InspectorCSSAgent::asCSSStyleRule):
1446         (WebCore::InspectorCSSAgent::collectStyleSheets):
1447         (WebCore::InspectorCSSAgent::buildArrayForRuleList):
1448         * inspector/InspectorStyleSheet.cpp:
1449         (WebCore::asCSSRuleList):
1450         (WebCore::fillMediaListChain):
1451         (WebCore::InspectorStyleSheet::addRule):
1452         (WebCore::InspectorStyleSheet::collectFlatRules):
1453         * page/PageSerializer.cpp:
1454         (WebCore::PageSerializer::serializeCSSStyleSheet):
1455
1456 2014-10-02  Dan Bernstein  <mitz@apple.com>
1457
1458         <rdar://problem/18531395> REGRESSION (r173272): Crash in ResourceResponse::platformSuggestedFilename() when called on the null response
1459         https://bugs.webkit.org/show_bug.cgi?id=137239
1460
1461         Reviewed by Pratik Solanki.
1462
1463         * platform/network/cf/ResourceResponseCFNet.cpp:
1464         (WebCore::ResourceResponse::platformSuggestedFilename): Return the null String if
1465         m_cfResponse is null.
1466
1467 2014-10-02  Andy Estes  <aestes@apple.com>
1468
1469         [iOS] Create an SPI wrapper for _UIHighlightView and use it in WKContentView
1470         https://bugs.webkit.org/show_bug.cgi?id=137370
1471
1472         Reviewed by Tim Horton.
1473
1474         Added _UIHighlightViewSPI.h. When building against the internal SDK it imports <UIKit/_UIHighlightView.h>. Otherwise, it redeclares the SPI we use in WebKit2.
1475
1476         * WebCore.xcodeproj/project.pbxproj:
1477         * platform/spi/ios/_UIHighlightViewSPI.h: Added.
1478
1479 2014-10-02  Benjamin Poulain  <benjamin@webkit.org>
1480
1481         CSS JIT: add the initial implementation of :nth-child(An+B of selector)
1482         https://bugs.webkit.org/show_bug.cgi?id=137285
1483
1484         Reviewed by Andreas Kling.
1485
1486         This patch adds the baseline support for JIT compiling :nth-child(An+B of selector).
1487
1488         The simple optimizations from the classic :nth-child() are carried over to :nth-child(An+B of selector),
1489         but the new code generation is pretty much left completely unoptimized.
1490
1491         The main challenge introduced with the new functional pseudo classes is the possibility of backtracking
1492         while already inside a backtracking chain.
1493
1494         For example:
1495             :nth-child(odd of a+a+a~a)+b+b~b
1496         has to backtrack the chain a+a+a while already in the backtracking chain b+b+b.
1497
1498         The easiest way to solve this would have been to have each subselector generate a new function.
1499         The generator for :nth-child() would simply call the function call for each sibling.
1500
1501         In the example, we would have:
1502             functionA(): a+a+a~a
1503             selectorChecker(): :nth-child(odd of functionA())+b+b~b
1504
1505         I decided against explicit functions because I believe the would be counterproductive for the common cases.
1506         I expect most use of :nth-child(of) to be done with a light filter without combinators, things like:
1507             :nth-child(odd of .class)
1508             :nth-child(odd of type.class)
1509             :nth-child(odd of type[attribute=value])
1510             etc.
1511
1512         For simple cases, inlining the internal filter will greatly simplify the generated code.
1513
1514         In this particular patch, the selector checkers are inlined, but we do not attempt to have good code generation.
1515         The optimizations will come later.
1516
1517         To implement backtracking in the subselectors, the backtracking implementation was abstracted into the structure
1518         BacktrackingLevel. Every time the code generator starts a new subselector, a new BacktrackingLevel is pushed onto
1519         the multilevel backtracking stack. The code generation always use the latest BacktrackingLevel for code generation
1520         until the subselector is finished, and code generation can continue with the existing state.
1521
1522         Tests: fast/selectors/nth-child-of-backtracking-adjacent-2.html
1523                fast/selectors/nth-child-of-backtracking-adjacent-optimized.html
1524                fast/selectors/nth-child-of-backtracking-adjacent.html
1525                fast/selectors/nth-child-of-boundaries-1.html
1526                fast/selectors/nth-child-of-boundaries-2.html
1527                fast/selectors/nth-child-of-boundaries-3.html
1528                fast/selectors/nth-child-of-chained-2.html
1529                fast/selectors/nth-child-of-has-parent.html
1530                fast/selectors/nth-child-of-never-matching-selector.html
1531                fast/selectors/nth-child-of-with-invalid-An+B.html
1532
1533         * cssjit/SelectorCompiler.cpp:
1534         (WebCore::SelectorCompiler::addPseudoClassType):
1535         (WebCore::SelectorCompiler::SelectorCodeGenerator::SelectorCodeGenerator):
1536         (WebCore::SelectorCompiler::minimumRegisterRequirements):
1537         (WebCore::SelectorCompiler::computeBacktrackingMemoryRequirements):
1538         Previously, we only needed stack space for the adjacent backtracking entry.
1539
1540         Now we can have several backtracking level active at the same time. We compute how much stack we need
1541         initially and each backtracking level take stack references as needed.
1542
1543         (WebCore::SelectorCompiler::computeBacktrackingInformation):
1544         The entire backtracking infrastructure already works great for multilevel backtracking. It is actually
1545         amazing how everything fits nicely together :)
1546
1547         The only addition here is logging facility in case we run into a bug.
1548
1549         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
1550         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorCheckerExcludingPseudoElements):
1551         generateSelectorChecker() has handling for pseudo elements, which should not be used
1552         for :nth-child(of). The core generator was moved to generateSelectorCheckerExcludingPseudoElements()
1553         to be used for code generation of subselectors.
1554
1555         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateParentElementTreeWalker):
1556         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateAncestorTreeWalker):
1557         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateDirectAdjacentTreeWalker):
1558         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateIndirectAdjacentTreeWalker):
1559         (WebCore::SelectorCompiler::SelectorCodeGenerator::linkFailures):
1560         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateAdjacentBacktrackingTail):
1561         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateDescendantBacktrackingTail):
1562         The two main changes are:
1563         1) Adopt the BacktrackingLevel to handle multilevel generation.
1564         2) Descendant backtracking can use the stack if we have multi level descendant backtracking.
1565            In that case, we just use the stack like for adjacent backtracking.
1566
1567         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChildOf):
1568         This is very similar to generateElementIsNthChild(). The main difference is we cannot use
1569         the cache in this case.
1570
1571         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
1572         (WebCore::SelectorCompiler::nthFilterIsAlwaysSatisified):
1573         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChild):
1574         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateNthFilterTest):
1575
1576 2014-10-02  Pratik Solanki  <psolanki@apple.com>
1577
1578         [iOS] Networking process stops loading web pages while running Alexa test with random URL list
1579         https://bugs.webkit.org/show_bug.cgi?id=137362
1580         <rdar://problem/18507382>
1581
1582         Reviewed by Alexey Proskuryakov.
1583
1584         ResourceHandleCFURLConnectionDelegateWithOperationQueue needs to signal threads waiting on
1585         its semaphore when the handle is being destroyed. Otherwise, we can leave dispatch threads
1586         hanging around waiting for a response. This can happen when the Web Content process dies.
1587         Any thread/queue waiting on a response from that web process will leak and stay around
1588         forever. If we reach the dispatch queue limit of 64, then all networking will cease to
1589         happen in the Networking process. Fix this by signalling waiting threads and clearing out
1590         our state in much the same way that -[WebCoreResourceHandleAsOperationQueueDelegate
1591         detachHandle] does for Mac.
1592
1593         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
1594         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
1595         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::releaseHandle):
1596         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
1597
1598 2014-10-02  Christophe Dumez  <cdumez@apple.com>
1599
1600         Use is<>() / downcast<>() for CSSBasicShape objects
1601         https://bugs.webkit.org/show_bug.cgi?id=137331
1602
1603         Reviewed by Andreas Kling.
1604
1605         Use is<>() / downcast<>() for CSSBasicShape objects.
1606
1607         No new tests, no behavior change.
1608
1609         * css/BasicShapeFunctions.cpp:
1610         (WebCore::basicShapeForValue):
1611         * css/CSSBasicShapes.cpp:
1612         (WebCore::CSSBasicShapeCircle::equals):
1613         (WebCore::CSSBasicShapeEllipse::equals):
1614         (WebCore::CSSBasicShapePolygon::equals):
1615         (WebCore::CSSBasicShapeInset::equals):
1616         * css/CSSBasicShapes.h:
1617
1618 2014-10-02  Chris Dumez  <cdumez@apple.com>
1619
1620         XMLHttpRequestProgressEventThrottle shouldn't throttle / defer progress events if there are no listeners
1621         https://bugs.webkit.org/show_bug.cgi?id=137346
1622
1623         Reviewed by Alexey Proskuryakov.
1624
1625         Previously XMLHttpRequestProgressEventThrottle would throttle / defer
1626         progress events, which involves queueing events and starting timers,
1627         even if there were no listeners for those events (which is fairly
1628         common case).
1629
1630         This patch updates XMLHttpRequestProgressEventThrottle to make sure
1631         there are actual progress event listeners *before* attempting to
1632         throttle and do extra processing, to avoid doing unnecessary work.
1633
1634         This patch also makes XMLHttpRequestProgressEventThrottle::dispatchEvent()
1635         private as this method is only called from other dispatch methods of
1636         the class and never from the outside.
1637
1638         No new tests, no behavior change.
1639
1640         * xml/XMLHttpRequestProgressEventThrottle.cpp:
1641         (WebCore::XMLHttpRequestProgressEventThrottle::dispatchThrottledProgressEvent):
1642         (WebCore::XMLHttpRequestProgressEventThrottle::dispatchProgressEvent):
1643
1644 2014-10-01  Myles C. Maxfield  <mmaxfield@apple.com>
1645
1646         [Subpixel] Use floats instead of ints for text justification expansion
1647         https://bugs.webkit.org/show_bug.cgi?id=137327
1648
1649         Reviewed by Zalan Bujtas.
1650
1651         Use a float instead of an int for the expansion variable in InlineBox. The int was inside an inner class
1652         that held a collection of bitfields, and this patch removes that inner-inner variable.
1653
1654         No new tests because there is plenty of existing coverage and existing tests are rebaselined.
1655
1656         * rendering/InlineBox.cpp: Update static_assert for the size of InlineBox.
1657         * rendering/InlineBox.h: Use a float for the justification expansion amount instead of an int bitfield.
1658         (WebCore::InlineBox::InlineBoxBitfields::InlineBoxBitfields): Remove int bitfield.
1659         (WebCore::InlineBox::InlineBox): Initialize float expansion.
1660         (WebCore::InlineBox::expansion): Return a float.
1661         (WebCore::InlineBox::setExpansion): Take a float.
1662         (WebCore::InlineBox::InlineBoxBitfields::expansion): Deleted. Moved to InlineBox.
1663         (WebCore::InlineBox::InlineBoxBitfields::setExpansion): Deleted. Ditto.
1664         * rendering/InlineTextBox.h:
1665         (WebCore::InlineTextBox::setExpansion): Take a float.
1666
1667 2014-10-02  Tim Horton  <timothy_horton@apple.com>
1668
1669         Move PageOverlay[Controller] to WebCore
1670         https://bugs.webkit.org/show_bug.cgi?id=137164
1671         <rdar://problem/18508258>
1672
1673         Reviewed by Anders Carlsson.
1674
1675         * CMakeLists.txt:
1676         * WebCore.vcxproj/WebCore.vcxproj:
1677         * WebCore.vcxproj/WebCore.vcxproj.filters:
1678         * WebCore.xcodeproj/project.pbxproj:
1679         Make the appropriate build system changes.
1680
1681         * WebCore.exp.in:
1682         Export the new PageOverlay[Controller] symbols from WebCore.
1683
1684         * loader/EmptyClients.h:
1685         * page/ChromeClient.h:
1686         (WebCore::ChromeClient::documentOverlayLayerForFrame): Deleted.
1687         Add attachViewOverlayGraphicsLayer, which allows PageOverlayController
1688         to push view-relative page overlay root layers down to WebKit to be
1689         installed just inside the view.
1690
1691         Remove documentOverlayLayerForFrame because RenderLayerCompositor can now
1692         talk directly to PageOverlayController.
1693
1694         * page/EventHandler.cpp:
1695         (WebCore::EventHandler::handleMousePressEvent):
1696         (WebCore::EventHandler::mouseMoved):
1697         (WebCore::EventHandler::handleMouseReleaseEvent):
1698         When the mouse is moved, pressed, or released, give PageOverlayController
1699         the first shot at handling the event.
1700
1701         * page/FrameView.cpp:
1702         (WebCore::FrameView::setFrameRect):
1703         Inform PageOverlayController that the main FrameView's size changed,
1704         so it can update the size of view-relative overlays.
1705
1706         (WebCore::FrameView::setContentsSize):
1707         Inform PageOverlayController that the main FrameView's contents size changed,
1708         so it can update the size of document-relative overlays.
1709
1710         (WebCore::FrameView::setFixedVisibleContentRect):
1711         (WebCore::FrameView::didChangeScrollOffset):
1712         (WebCore::FrameView::scrollTo):
1713         (WebCore::FrameView::wheelEvent):
1714         Inform PageOverlayController that something scrolled.
1715
1716         (WebCore::FrameView::setExposedRect):
1717         Inform PageOverlayController that the exposed rect changed, so it can push
1718         the new exposed rect down to the overlays.
1719
1720         * page/FrameView.h:
1721         Add didChangeScrollOffset.
1722
1723         * page/MainFrame.cpp:
1724         (WebCore::MainFrame::MainFrame):
1725         * page/MainFrame.h:
1726         Keep one PageOverlayController per MainFrame.
1727
1728         * page/Page.cpp:
1729         (WebCore::Page::setDeviceScaleFactor):
1730         Inform PageOverlayController that the device scale factor changed.
1731
1732         (WebCore::Page::setSessionID):
1733         Remove a blank line.
1734
1735         * page/PageOverlay.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp.
1736         Move PageOverlay from WebKit2 to WebCore.
1737         A few overarching changes that I won't detail in each place:
1738             - references instead of pointers in many places
1739             - WebCore types instead of WebKit2 types everywhere
1740
1741         (WebCore::PageOverlay::bounds):
1742         It is possible to install an overlay before we have a FrameView.
1743         We will eventually get a view/contents size changed notification and try again.
1744
1745         (WebCore::PageOverlay::copyAccessibilityAttributeStringValueForPoint):
1746         (WebCore::PageOverlay::copyAccessibilityAttributeBoolValueForPoint):
1747         (WebCore::PageOverlay::copyAccessibilityAttributeNames):
1748         Split copyAccessibilityAttribute into "StringValueForPoint" and "BoolValueForPoint"
1749         variants, because we don't have anything like WKTypeRef here.
1750
1751         * page/PageOverlay.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.h.
1752         Make PageOverlay a normal RefCounted object instead of a WebKit2 API object.
1753         Leave a comment noting that we should move the PageOverlay's GraphicsLayer
1754         to PageOverlay instead of a map on PageOverlayController.
1755
1756         * page/PageOverlayController.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.cpp.
1757         Move PageOverlayController from WebKit2 to WebCore.
1758         A few overarching changes that I won't detail in each place:
1759             - references instead of pointers in many places
1760             - WebCore types instead of WebKit2 types everywhere
1761
1762         Leave a FIXME that didChangeSettings is not currently called when settings change.
1763         This is not a problem for normal use of overlays, only for dynamically changing
1764         layer border/repaint counter settings.
1765
1766         (WebCore::PageOverlayController::PageOverlayController):
1767         (WebCore::PageOverlayController::createRootLayersIfNeeded):
1768         We will now lazily initialize the root layers when we first try to use them,
1769         because otherwise we try to create them before the ChromeClient's GraphicsLayerFactory
1770         is hooked up, in some cases, and that can cause us to create the wrong kind of GraphicsLayers.
1771
1772         (WebCore::PageOverlayController::installPageOverlay):
1773         Enter compositing mode when installing a PageOverlay.
1774         Avoid pushing the Page to the PageOverlay until after we've set up
1775         its root layer, so that the installation process can make use of that layer;
1776         clients may, for example, expect to be able to setNeedsDisplay() in the
1777         didMoveToPage callback.
1778         Avoid updateOverlayGeometry until the layer is created and we've pushed
1779         the Page down, so that e.g. bounds() will use the right Page.
1780
1781         (WebCore::PageOverlayController::didChangeSettings):
1782         Leave a FIXME about a future improvement to didChangeSettings.
1783
1784         (WebCore::PageOverlayController::deviceScaleFactor):
1785         (WebCore::PageOverlayController::notifyFlushRequired):
1786         Null-check Page; these can get called when tearing down the Frame.
1787
1788         * page/PageOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.h.
1789
1790         * platform/graphics/GraphicsLayerClient.h:
1791         Add wtf/Forward.h, because GraphicsLayerClient.h uses String.
1792
1793         * rendering/RenderLayer.cpp:
1794         (WebCore::RenderLayer::scrollTo):
1795         Inform PageOverlayController that something scrolled.
1796
1797         * rendering/RenderLayerCompositor.cpp:
1798         (WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers):
1799         Make hasAnyAdditionalCompositedLayers return true if there are any page overlays,
1800         because we need to avoid falling out of compositing mode if we still have
1801         page overlays.
1802
1803         (WebCore::RenderLayerCompositor::updateCompositingLayers):
1804         Enter compositing mode if we have page overlays.
1805
1806         (WebCore::RenderLayerCompositor::appendOverlayLayers): Deleted.
1807         (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
1808         Rename appendOverlayLayers -> appendDocumentOverlayLayers.
1809
1810         (WebCore::RenderLayerCompositor::attachRootLayer):
1811         (WebCore::RenderLayerCompositor::detachRootLayer):
1812         Attach/detach the view overlay root layer when attaching/detaching the
1813         normal compositing root layer.
1814
1815         (WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
1816         * rendering/RenderLayerCompositor.h:
1817
1818 2014-10-02  Myles C. Maxfield  <mmaxfield@apple.com>
1819
1820         Back TextRun with a StringView
1821         https://bugs.webkit.org/show_bug.cgi?id=137352
1822
1823         Reviewed by Antti Koivisto.
1824
1825         TextRun contains a union of a UChar* and an LChar* as well as a length, which is the abstraction
1826         that StringView is intended to be. This patch cleans up TextRun by replacing the union and length
1827         with a StringView instance member.
1828
1829         No new tests because there is no behavior change.
1830
1831         * platform/graphics/TextRun.h:
1832         (WebCore::TextRun::TextRun):
1833         (WebCore::TextRun::subRun):
1834         (WebCore::TextRun::operator[]):
1835         (WebCore::TextRun::data8):
1836         (WebCore::TextRun::data16):
1837         (WebCore::TextRun::characters8):
1838         (WebCore::TextRun::characters16):
1839         (WebCore::TextRun::is8Bit):
1840         (WebCore::TextRun::length):
1841         (WebCore::TextRun::string):
1842         (WebCore::TextRun::setText):
1843         (WebCore::TextRun::stringView):
1844
1845 2014-10-01  Christophe Dumez  <cdumez@apple.com>
1846
1847         Have is<>(T*) function do a null check on the pointer argument
1848         https://bugs.webkit.org/show_bug.cgi?id=137333
1849
1850         Reviewed by Gavin Barraclough.
1851
1852         Have is<>(T*) function do a null check on the argument instead of a
1853         simple assertion. This makes sense for 2 reasons:
1854         1. It is more consistent with downcast<>(T*), which will succeed even
1855            if the argument is a nullptr.
1856         2. It simplifies the code a bit as it gets rid of a lot of explicit
1857            null checks.
1858
1859         No new tests, no behavior change.
1860
1861         * Modules/indexeddb/IDBFactory.cpp:
1862         * Modules/webaudio/OfflineAudioContext.cpp:
1863         (WebCore::OfflineAudioContext::create):
1864         * Modules/websockets/ThreadableWebSocketChannel.cpp:
1865         (WebCore::ThreadableWebSocketChannel::create):
1866         * Modules/websockets/WebSocket.cpp:
1867         (WebCore::WebSocket::connect):
1868         * Modules/websockets/WebSocketHandshake.cpp:
1869         (WebCore::WebSocketHandshake::clientHandshakeMessage):
1870         * accessibility/AXObjectCache.cpp:
1871         (WebCore::AXObjectCache::focusedUIElementForPage):
1872         (WebCore::createFromRenderer):
1873         (WebCore::AXObjectCache::getOrCreate):
1874         (WebCore::AXObjectCache::handleLiveRegionCreated):
1875         (WebCore::AXObjectCache::handleAttributeChanged):
1876         (WebCore::AXObjectCache::labelChanged):
1877         (WebCore::AXObjectCache::rootAXEditableElement):
1878         (WebCore::isNodeAriaVisible):
1879         * accessibility/AccessibilityListBoxOption.cpp:
1880         (WebCore::AccessibilityListBoxOption::isEnabled):
1881         (WebCore::AccessibilityListBoxOption::isSelected):
1882         (WebCore::AccessibilityListBoxOption::canSetSelectedAttribute):
1883         (WebCore::AccessibilityListBoxOption::stringValue):
1884         (WebCore::AccessibilityListBoxOption::listBoxOptionParentNode):
1885         * accessibility/AccessibilityMediaControls.cpp:
1886         (WebCore::AccessibilityMediaTimeline::valueDescription):
1887         * accessibility/AccessibilityMenuListPopup.cpp:
1888         (WebCore::AccessibilityMenuListPopup::menuListOptionAccessibilityObject):
1889         * accessibility/AccessibilityNodeObject.cpp:
1890         (WebCore::AccessibilityNodeObject::determineAccessibilityRole):
1891         (WebCore::AccessibilityNodeObject::canvasHasFallbackContent):
1892         (WebCore::AccessibilityNodeObject::isNativeTextControl):
1893         (WebCore::AccessibilityNodeObject::isNativeImage):
1894         (WebCore::AccessibilityNodeObject::isInputImage):
1895         (WebCore::AccessibilityNodeObject::isEnabled):
1896         (WebCore::AccessibilityNodeObject::isPressed):
1897         (WebCore::AccessibilityNodeObject::isHovered):
1898         (WebCore::AccessibilityNodeObject::isReadOnly):
1899         (WebCore::AccessibilityNodeObject::isRequired):
1900         (WebCore::AccessibilityNodeObject::valueForRange):
1901         (WebCore::AccessibilityNodeObject::maxValueForRange):
1902         (WebCore::AccessibilityNodeObject::minValueForRange):
1903         (WebCore::AccessibilityNodeObject::isControl):
1904         (WebCore::AccessibilityNodeObject::anchorElement):
1905         (WebCore::isNodeActionElement):
1906         (WebCore::AccessibilityNodeObject::mouseButtonListener):
1907         (WebCore::AccessibilityNodeObject::labelForElement):
1908         (WebCore::AccessibilityNodeObject::titleElementText):
1909         (WebCore::AccessibilityNodeObject::alternativeText):
1910         (WebCore::AccessibilityNodeObject::visibleText):
1911         (WebCore::AccessibilityNodeObject::accessibilityDescription):
1912         (WebCore::AccessibilityNodeObject::helpText):
1913         (WebCore::AccessibilityNodeObject::hierarchicalLevel):
1914         (WebCore::AccessibilityNodeObject::textUnderElement):
1915         (WebCore::AccessibilityNodeObject::title):
1916         (WebCore::AccessibilityNodeObject::colorValue):
1917         (WebCore::accessibleNameForNode):
1918         (WebCore::AccessibilityNodeObject::canSetFocusAttribute):
1919         * accessibility/AccessibilityObject.cpp:
1920         (WebCore::AccessibilityObject::press):
1921         (WebCore::AccessibilityObject::hasTagName):
1922         (WebCore::AccessibilityObject::hasAttribute):
1923         (WebCore::AccessibilityObject::element):
1924         (WebCore::AccessibilityObject::classList):
1925         * accessibility/AccessibilityRenderObject.cpp:
1926         (WebCore::AccessibilityRenderObject::isFileUploadButton):
1927         (WebCore::AccessibilityRenderObject::anchorElement):
1928         (WebCore::AccessibilityRenderObject::helpText):
1929         (WebCore::AccessibilityRenderObject::labelElementContainer):
1930         (WebCore::AccessibilityRenderObject::internalLinkElement):
1931         (WebCore::AccessibilityRenderObject::addRadioButtonGroupMembers):
1932         (WebCore::AccessibilityRenderObject::titleUIElement):
1933         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
1934         (WebCore::AccessibilityRenderObject::accessKey):
1935         (WebCore::AccessibilityRenderObject::url):
1936         (WebCore::AccessibilityRenderObject::setElementAttributeValue):
1937         (WebCore::AccessibilityRenderObject::setFocused):
1938         (WebCore::AccessibilityRenderObject::setValue):
1939         (WebCore::AccessibilityRenderObject::getDocumentLinks):
1940         (WebCore::AccessibilityRenderObject::accessibilityImageMapHitTest):
1941         (WebCore::AccessibilityRenderObject::accessibilityHitTest):
1942         (WebCore::AccessibilityRenderObject::correspondingLabelForControlElement):
1943         (WebCore::AccessibilityRenderObject::renderObjectIsObservable):
1944         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
1945         (WebCore::AccessibilityRenderObject::inheritsPresentationalRole):
1946         (WebCore::AccessibilityRenderObject::addTextFieldChildren):
1947         (WebCore::AccessibilityRenderObject::remoteSVGRootElement):
1948         (WebCore::AccessibilityRenderObject::setAccessibleName):
1949         (WebCore::AccessibilityRenderObject::stringValueForMSAA):
1950         (WebCore::AccessibilityRenderObject::isLinked):
1951         (WebCore::AccessibilityRenderObject::stringRoleForMSAA):
1952         (WebCore::AccessibilityRenderObject::isMathElement):
1953         * accessibility/AccessibilitySearchFieldButtons.cpp:
1954         (WebCore::AccessibilitySearchFieldCancelButton::press):
1955         * accessibility/AccessibilityTable.cpp:
1956         (WebCore::AccessibilityTable::tableElement):
1957         (WebCore::AccessibilityTable::isDataTable):
1958         (WebCore::AccessibilityTable::isTableExposableThroughAccessibility):
1959         (WebCore::AccessibilityTable::title):
1960         * accessibility/atk/AXObjectCacheAtk.cpp:
1961         (WebCore::notifyChildrenSelectionChange):
1962         * accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
1963         (webkitAccessibleTableGetCaption):
1964         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1965         (webkitAccessibleGetName):
1966         (webkitAccessibleGetDescription):
1967         (webkitAccessibleGetAttributes):
1968         * bindings/gobject/WebKitDOMPrivate.cpp:
1969         (WebKit::wrap):
1970         * bindings/js/JSAudioContextCustom.cpp:
1971         (WebCore::constructJSAudioContext):
1972         * bindings/js/JSDOMGlobalObject.cpp:
1973         (WebCore::toJSDOMGlobalObject):
1974         * bindings/js/JSDOMWindowCustom.cpp:
1975         (WebCore::namedItemGetter):
1976         (WebCore::JSDOMWindow::getOwnPropertySlot):
1977         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
1978         * bindings/js/JSElementCustom.cpp:
1979         (WebCore::toJSNewlyCreated):
1980         * bindings/js/JSErrorHandler.cpp:
1981         (WebCore::JSErrorHandler::handleEvent):
1982         * bindings/js/JSEventListener.cpp:
1983         (WebCore::JSEventListener::handleEvent):
1984         * bindings/js/JSHTMLDocumentCustom.cpp:
1985         (WebCore::JSHTMLDocument::nameGetter):
1986         * bindings/js/JSLazyEventListener.cpp:
1987         (WebCore::JSLazyEventListener::initializeJSFunction):
1988         * bindings/js/JSNodeCustom.cpp:
1989         (WebCore::isReachableFromDOM):
1990         (WebCore::createWrapperInline):
1991         * bindings/js/ScheduledAction.cpp:
1992         (WebCore::ScheduledAction::execute):
1993         * bindings/js/ScriptState.cpp:
1994         (WebCore::frameFromExecState):
1995         * bindings/objc/DOM.mm:
1996         (kitClass):
1997         * css/CSSCursorImageValue.cpp:
1998         (WebCore::resourceReferencedByCursorElement):
1999         * css/CSSStyleSheet.cpp:
2000         (WebCore::isAcceptableCSSStyleSheetParent):
2001         * css/SelectorChecker.cpp:
2002         (WebCore::SelectorChecker::checkOne):
2003         * css/SelectorCheckerTestFunctions.h:
2004         (WebCore::isAutofilled):
2005         (WebCore::isDisabled):
2006         (WebCore::isEnabled):
2007         (WebCore::isChecked):
2008         (WebCore::matchesLangPseudoClass):
2009         (WebCore::matchesFutureCuePseudoClass):
2010         (WebCore::matchesPastCuePseudoClass):
2011         * css/StyleResolver.cpp:
2012         (WebCore::StyleResolver::State::initElement):
2013         (WebCore::StyleResolver::locateCousinList):
2014         (WebCore::elementHasDirectionAuto):
2015         (WebCore::StyleResolver::canShareStyleWithElement):
2016         (WebCore::StyleResolver::findSiblingForStyleSharing):
2017         (WebCore::StyleResolver::adjustRenderStyle):
2018         (WebCore::StyleResolver::useSVGZoomRulesForLength):
2019         * css/StyleSheetList.cpp:
2020         (WebCore::StyleSheetList::getNamedItem):
2021         * dom/Attr.cpp:
2022         (WebCore::Attr::style):
2023         * dom/CharacterData.cpp:
2024         (WebCore::CharacterData::parserAppendData):
2025         (WebCore::CharacterData::setDataAndUpdate):
2026         * dom/ContainerNode.cpp:
2027         (WebCore::checkAcceptChild):
2028         (WebCore::ContainerNode::notifyChildRemoved):
2029         * dom/ContainerNodeAlgorithms.cpp:
2030         (WebCore::ChildNodeInsertionNotifier::notifyDescendantInsertedIntoTree):
2031         (WebCore::ChildNodeRemovalNotifier::notifyDescendantRemovedFromTree):
2032         * dom/CurrentScriptIncrementer.h:
2033         (WebCore::CurrentScriptIncrementer::CurrentScriptIncrementer):
2034         * dom/DataTransfer.cpp:
2035         (WebCore::DataTransfer::setDragImage):
2036         * dom/Document.cpp:
2037         (WebCore::Document::elementFromPoint):
2038         (WebCore::Document::setTitle):
2039         (WebCore::Document::iconURLs):
2040         (WebCore::eventTargetElementForDocument):
2041         (WebCore::Document::updateHoverActiveState):
2042         * dom/DocumentStyleSheetCollection.cpp:
2043         (WebCore::DocumentStyleSheetCollection::collectActiveStyleSheets):
2044         * dom/Element.cpp:
2045         (WebCore::Element::computeInheritedLanguage):
2046         * dom/Element.h:
2047         (WebCore::Node::parentElement):
2048         * dom/ElementTraversal.h:
2049         (WebCore::Traversal<Element>::nextTemplate):
2050         (WebCore::ElementTraversal::previousIncludingPseudo):
2051         (WebCore::ElementTraversal::nextIncludingPseudo):
2052         (WebCore::ElementTraversal::nextIncludingPseudoSkippingChildren):
2053         (WebCore::ElementTraversal::pseudoAwarePreviousSibling):
2054         * dom/EventDispatcher.cpp:
2055         (WebCore::WindowEventContext::WindowEventContext):
2056         (WebCore::EventDispatcher::dispatchEvent):
2057         (WebCore::nodeOrHostIfPseudoElement):
2058         (WebCore::EventPath::EventPath):
2059         * dom/EventTarget.cpp:
2060         (WebCore::EventTarget::fireEventListeners):
2061         * dom/KeyboardEvent.cpp:
2062         (WebCore::findKeyboardEvent):
2063         * dom/LiveNodeList.cpp:
2064         (WebCore::LiveNodeList::namedItem):
2065         * dom/MessagePort.cpp:
2066         (WebCore::MessagePort::dispatchMessages):
2067         * dom/MouseEvent.cpp:
2068         (WebCore::SimulatedMouseEvent::SimulatedMouseEvent):
2069         * dom/NamedNodeMap.cpp:
2070         (WebCore::NamedNodeMap::setNamedItem):
2071         * dom/Node.cpp:
2072         (WebCore::Node::dumpStatistics):
2073         (WebCore::Node::pseudoAwarePreviousSibling):
2074         (WebCore::Node::pseudoAwareNextSibling):
2075         (WebCore::Node::computedStyle):
2076         (WebCore::Node::parentOrShadowHostElement):
2077         (WebCore::Node::rootEditableElement):
2078         (WebCore::Node::ancestorElement):
2079         (WebCore::Node::compareDocumentPosition):
2080         (WebCore::appendAttributeDesc):
2081         (WebCore::Node::showNodePathForThis):
2082         (WebCore::Node::enclosingLinkEventParentOrSelf):
2083         (WebCore::Node::dispatchEvent):
2084         (WebCore::Node::defaultEventHandler):
2085         * dom/NodeRenderingTraversal.cpp:
2086         (WebCore::NodeRenderingTraversal::nodeCanBeDistributed):
2087         (WebCore::NodeRenderingTraversal::traverseParent):
2088         * dom/NodeTraversal.cpp:
2089         (WebCore::NodeTraversal::previousIncludingPseudo):
2090         (WebCore::NodeTraversal::nextIncludingPseudo):
2091         (WebCore::NodeTraversal::nextIncludingPseudoSkippingChildren):
2092         * dom/Position.cpp:
2093         (WebCore::Position::element):
2094         (WebCore::endsOfNodeAreVisuallyDistinctPositions):
2095         (WebCore::Position::isRenderedCharacter):
2096         (WebCore::Position::leadingWhitespacePosition):
2097         * dom/Range.cpp:
2098         (WebCore::Range::insertNode):
2099         (WebCore::Range::getBorderAndTextQuads):
2100         * dom/ScriptElement.cpp:
2101         (WebCore::toScriptElementIfPossible):
2102         * dom/ShadowRoot.h:
2103         (WebCore::Node::parentOrShadowHostNode):
2104         * dom/Text.cpp:
2105         (WebCore::earliestLogicallyAdjacentTextNode):
2106         (WebCore::latestLogicallyAdjacentTextNode):
2107         (WebCore::isSVGShadowText):
2108         * dom/TextNodeTraversal.cpp:
2109         (WebCore::TextNodeTraversal::contentsAsString):
2110         * dom/TextNodeTraversal.h:
2111         (WebCore::TextNodeTraversal::firstTextChildTemplate):
2112         (WebCore::TextNodeTraversal::firstTextWithinTemplate):
2113         (WebCore::TextNodeTraversal::traverseNextTextTemplate):
2114         (WebCore::TextNodeTraversal::nextSibling):
2115         * dom/TreeScopeAdopter.cpp:
2116         (WebCore::TreeScopeAdopter::moveTreeToNewScope):
2117         (WebCore::TreeScopeAdopter::moveNodeToNewDocument):
2118         * editing/ApplyBlockElementCommand.cpp:
2119         (WebCore::isNewLineAtPosition):
2120         (WebCore::ApplyBlockElementCommand::endOfNextParagrahSplittingTextNodesIfNeeded):
2121         * editing/ApplyStyleCommand.cpp:
2122         (WebCore::isLegacyAppleStyleSpan):
2123         (WebCore::isStyleSpanOrSpanWithOnlyStyleAttribute):
2124         (WebCore::isSpanWithoutAttributesOrUnstyledStyleSpan):
2125         (WebCore::isEmptyFontTag):
2126         (WebCore::ApplyStyleCommand::applyBlockStyle):
2127         (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
2128         (WebCore::dummySpanAncestorForNode):
2129         (WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
2130         (WebCore::ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock):
2131         (WebCore::ApplyStyleCommand::highestAncestorWithConflictingInlineStyle):
2132         (WebCore::ApplyStyleCommand::applyInlineStyleToPushDown):
2133         (WebCore::ApplyStyleCommand::splitTextAtEnd):
2134         (WebCore::ApplyStyleCommand::splitTextElementAtEnd):
2135         (WebCore::ApplyStyleCommand::shouldSplitTextElement):
2136         (WebCore::ApplyStyleCommand::surroundNodeRangeWithElement):
2137         (WebCore::ApplyStyleCommand::applyInlineStyleChange):
2138         (WebCore::ApplyStyleCommand::joinChildTextNodes):
2139         * editing/BreakBlockquoteCommand.cpp:
2140         (WebCore::BreakBlockquoteCommand::doApply):
2141         * editing/CompositeEditCommand.cpp:
2142         (WebCore::CompositeEditCommand::isRemovableBlock):
2143         (WebCore::CompositeEditCommand::insertNodeAt):
2144         (WebCore::CompositeEditCommand::canRebalance):
2145         (WebCore::CompositeEditCommand::prepareWhitespaceAtPositionForSplit):
2146         (WebCore::CompositeEditCommand::deleteInsignificantText):
2147         (WebCore::CompositeEditCommand::removePlaceholderAt):
2148         (WebCore::CompositeEditCommand::cleanupAfterDeletion):
2149         (WebCore::CompositeEditCommand::moveParagraphs):
2150         * editing/DeleteButtonController.cpp:
2151         (WebCore::enclosingDeletableElement):
2152         * editing/DeleteSelectionCommand.cpp:
2153         (WebCore::DeleteSelectionCommand::handleGeneralDelete):
2154         (WebCore::DeleteSelectionCommand::fixupWhitespace):
2155         (WebCore::DeleteSelectionCommand::doApply):
2156         * editing/EditingStyle.cpp:
2157         (WebCore::EditingStyle::wrappingStyleForSerialization):
2158         * editing/Editor.cpp:
2159         (WebCore::imageElementFromImageDocument):
2160         (WebCore::Editor::shouldInsertFragment):
2161         (WebCore::Editor::setBaseWritingDirection):
2162         (WebCore::Editor::setComposition):
2163         (WebCore::Editor::isSpellCheckingEnabledFor):
2164         (WebCore::Editor::applyEditingStyleToElement):
2165         * editing/FormatBlockCommand.cpp:
2166         (WebCore::isElementForFormatBlock):
2167         * editing/FrameSelection.cpp:
2168         (WebCore::removingNodeRemovesPosition):
2169         (WebCore::CaretBase::paintCaret):
2170         (WebCore::FrameSelection::debugRenderer):
2171         (WebCore::FrameSelection::selectAll):
2172         (WebCore::scanForForm):
2173         * editing/InsertLineBreakCommand.cpp:
2174         (WebCore::InsertLineBreakCommand::doApply):
2175         * editing/InsertListCommand.cpp:
2176         (WebCore::InsertListCommand::mergeWithNeighboringLists):
2177         * editing/InsertParagraphSeparatorCommand.cpp:
2178         (WebCore::InsertParagraphSeparatorCommand::doApply):
2179         * editing/InsertTextCommand.cpp:
2180         (WebCore::InsertTextCommand::insertTab):
2181         * editing/ReplaceSelectionCommand.cpp:
2182         (WebCore::haveSameTagName):
2183         (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
2184         (WebCore::ReplaceSelectionCommand::removeUnrenderedTextNodesAtEnds):
2185         (WebCore::ReplaceSelectionCommand::shouldPerformSmartReplace):
2186         (WebCore::ReplaceSelectionCommand::addSpacesForSmartReplace):
2187         (WebCore::ReplaceSelectionCommand::mergeTextNodesAroundPosition):
2188         (WebCore::ReplaceSelectionCommand::insertAsListItems):
2189         (WebCore::ReplaceSelectionCommand::performTrivialReplace):
2190         * editing/SpellChecker.cpp:
2191         (WebCore::SpellChecker::isCheckable):
2192         * editing/SplitTextNodeContainingElementCommand.cpp:
2193         (WebCore::SplitTextNodeContainingElementCommand::doApply):
2194         * editing/TextIterator.cpp:
2195         (WebCore::isRendererReplacedElement):
2196         * editing/VisibleSelection.cpp:
2197         (WebCore::VisibleSelection::isInPasswordField):
2198         * editing/VisibleUnits.cpp:
2199         (WebCore::startPositionForLine):
2200         (WebCore::endPositionForLine):
2201         (WebCore::startOfParagraph):
2202         (WebCore::endOfParagraph):
2203         * editing/cocoa/HTMLConverter.mm:
2204         (HTMLConverter::aggregatedAttributesForAncestors):
2205         (HTMLConverter::aggregatedAttributesForElementAndItsAncestors):
2206         (WebCore::editingAttributedStringFromRange):
2207         * editing/htmlediting.cpp:
2208         (WebCore::enclosingBlock):
2209         (WebCore::enclosingElementWithTag):
2210         (WebCore::enclosingAnchorElement):
2211         (WebCore::enclosingList):
2212         (WebCore::lineBreakExistsAtPosition):
2213         (WebCore::areIdenticalElements):
2214         (WebCore::isNonTableCellHTMLBlockElement):
2215         (WebCore::deprecatedEnclosingBlockFlowElement):
2216         * editing/ios/EditorIOS.mm:
2217         (WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection):
2218         * editing/markup.cpp:
2219         (WebCore::StyledMarkupAccumulator::appendText):
2220         (WebCore::ancestorToRetainStructureAndAppearanceForBlock):
2221         (WebCore::isPlainTextMarkup):
2222         * fileapi/FileReader.cpp:
2223         (WebCore::FileReader::readAsArrayBuffer):
2224         (WebCore::FileReader::readAsBinaryString):
2225         (WebCore::FileReader::readAsText):
2226         (WebCore::FileReader::readAsDataURL):
2227         * html/BaseChooserOnlyDateAndTimeInputType.cpp:
2228         (WebCore::BaseChooserOnlyDateAndTimeInputType::updateAppearance):
2229         * html/FTPDirectoryDocument.cpp:
2230         (WebCore::FTPDirectoryDocumentParser::loadDocumentTemplate):
2231         * html/FormAssociatedElement.cpp:
2232         (WebCore::FormAssociatedElement::findAssociatedForm):
2233         * html/HTMLAnchorElement.cpp:
2234         (WebCore::appendServerMapMousePosition):
2235         (WebCore::HTMLAnchorElement::defaultEventHandler):
2236         (WebCore::HTMLAnchorElement::eventType):
2237         (WebCore::isEnterKeyKeydownEvent):
2238         (WebCore::isLinkClick):
2239         * html/HTMLAreaElement.cpp:
2240         (WebCore::HTMLAreaElement::imageElement):
2241         * html/HTMLBodyElement.cpp:
2242         (WebCore::HTMLBodyElement::insertedInto):
2243         * html/HTMLButtonElement.cpp:
2244         (WebCore::HTMLButtonElement::defaultEventHandler):
2245         * html/HTMLCollection.cpp:
2246         (WebCore::HTMLCollection::namedItem):
2247         (WebCore::HTMLCollection::updateNamedElementCache):
2248         * html/HTMLDocument.cpp:
2249         (WebCore::HTMLDocument::bgColor):
2250         (WebCore::HTMLDocument::setBgColor):
2251         (WebCore::HTMLDocument::fgColor):
2252         (WebCore::HTMLDocument::setFgColor):
2253         (WebCore::HTMLDocument::alinkColor):
2254         (WebCore::HTMLDocument::setAlinkColor):
2255         (WebCore::HTMLDocument::linkColor):
2256         (WebCore::HTMLDocument::setLinkColor):
2257         (WebCore::HTMLDocument::vlinkColor):
2258         (WebCore::HTMLDocument::setVlinkColor):
2259         (WebCore::HTMLDocument::isFrameSet):
2260         * html/HTMLElement.cpp:
2261         (WebCore::HTMLElement::matchesReadWritePseudoClass):
2262         (WebCore::mergeWithNextTextNode):
2263         (WebCore::HTMLElement::setOuterHTML):
2264         (WebCore::HTMLElement::setOuterText):
2265         (WebCore::HTMLElement::insertAdjacentElement):
2266         (WebCore::contextElementForInsertion):
2267         (WebCore::HTMLElement::directionality):
2268         (WebCore::HTMLElement::dirAttributeChanged):
2269         * html/HTMLEmbedElement.cpp:
2270         (WebCore::HTMLEmbedElement::rendererIsNeeded):
2271         * html/HTMLFieldSetElement.cpp:
2272         (WebCore::updateFromControlElementsAncestorDisabledStateUnder):
2273         (WebCore::HTMLFieldSetElement::disabledStateChanged):
2274         * html/HTMLFormControlElement.cpp:
2275         (WebCore::HTMLFormControlElement::computeIsDisabledByFieldsetAncestor):
2276         (WebCore::shouldAutofocus):
2277         (WebCore::HTMLFormControlElement::enclosingFormControlElement):
2278         * html/HTMLFormElement.cpp:
2279         (WebCore::HTMLFormElement::rendererIsNeeded):
2280         (WebCore::HTMLFormElement::submitImplicitly):
2281         (WebCore::submitElementFromEvent):
2282         (WebCore::HTMLFormElement::validateInteractively):
2283         (WebCore::HTMLFormElement::submit):
2284         (WebCore::HTMLFormElement::reset):
2285         (WebCore::HTMLFormElement::defaultButton):
2286         (WebCore::HTMLFormElement::documentDidResumeFromPageCache):
2287         * html/HTMLFrameOwnerElement.cpp:
2288         (WebCore::HTMLFrameOwnerElement::getSVGDocument):
2289         * html/HTMLFrameSetElement.cpp:
2290         (WebCore::HTMLFrameSetElement::defaultEventHandler):
2291         * html/HTMLInputElement.cpp:
2292         (WebCore::HTMLInputElement::defaultEventHandler):
2293         (WebCore::HTMLInputElement::dataList):
2294         * html/HTMLLabelElement.cpp:
2295         (WebCore::nodeAsSupportedLabelableElement):
2296         * html/HTMLLegendElement.cpp:
2297         (WebCore::HTMLLegendElement::virtualForm):
2298         * html/HTMLMediaElement.cpp:
2299         (WebCore::HTMLMediaElement::parseAttribute):
2300         * html/HTMLObjectElement.cpp:
2301         (WebCore::HTMLObjectElement::hasFallbackContent):
2302         (WebCore::HTMLObjectElement::updateDocNamedItem):
2303         * html/HTMLOptGroupElement.cpp:
2304         (WebCore::HTMLOptGroupElement::recalcSelectOptions):
2305         (WebCore::HTMLOptGroupElement::ownerSelectElement):
2306         * html/HTMLOptionElement.cpp:
2307         (WebCore::HTMLOptionElement::setText):
2308         (WebCore::HTMLOptionElement::index):
2309         (WebCore::HTMLOptionElement::ownerDataListElement):
2310         (WebCore::HTMLOptionElement::ownerSelectElement):
2311         (WebCore::HTMLOptionElement::textIndentedToRespectGroupLabel):
2312         (WebCore::HTMLOptionElement::isDisabledFormControl):
2313         (WebCore::HTMLOptionElement::collectOptionInnerText):
2314         * html/HTMLPlugInImageElement.cpp:
2315         (WebCore::addPlugInsFromNodeListMatchingPlugInOrigin):
2316         (WebCore::HTMLPlugInImageElement::defaultEventHandler):
2317         * html/HTMLScriptElement.cpp:
2318         (WebCore::HTMLScriptElement::setText):
2319         * html/HTMLSelectElement.cpp:
2320         (WebCore::HTMLSelectElement::nextValidIndex):
2321         (WebCore::HTMLSelectElement::saveLastSelection):
2322         (WebCore::HTMLSelectElement::setActiveSelectionAnchorIndex):
2323         (WebCore::HTMLSelectElement::updateListBoxSelection):
2324         (WebCore::HTMLSelectElement::listBoxOnChange):
2325         (WebCore::HTMLSelectElement::recalcListItems):
2326         (WebCore::HTMLSelectElement::selectedIndex):
2327         (WebCore::HTMLSelectElement::selectOption):
2328         (WebCore::HTMLSelectElement::optionToListIndex):
2329         (WebCore::HTMLSelectElement::listToOptionIndex):
2330         (WebCore::HTMLSelectElement::deselectItemsWithoutValidation):
2331         (WebCore::HTMLSelectElement::saveFormControlState):
2332         (WebCore::HTMLSelectElement::searchOptionsForValue):
2333         (WebCore::HTMLSelectElement::restoreFormControlState):
2334         (WebCore::HTMLSelectElement::appendFormData):
2335         (WebCore::HTMLSelectElement::reset):
2336         (WebCore::HTMLSelectElement::menuListDefaultEventHandler):
2337         (WebCore::HTMLSelectElement::updateSelectedState):
2338         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
2339         (WebCore::HTMLSelectElement::defaultEventHandler):
2340         (WebCore::HTMLSelectElement::lastSelectedListIndex):
2341         (WebCore::HTMLSelectElement::optionAtIndex):
2342         (WebCore::HTMLSelectElement::accessKeySetSelectedIndex):
2343         (WebCore::HTMLSelectElement::length):
2344         * html/HTMLSourceElement.cpp:
2345         (WebCore::HTMLSourceElement::insertedInto):
2346         (WebCore::HTMLSourceElement::removedFrom):
2347         * html/HTMLSummaryElement.cpp:
2348         (WebCore::isClickableControl):
2349         (WebCore::HTMLSummaryElement::defaultEventHandler):
2350         * html/HTMLTableElement.cpp:
2351         (WebCore::HTMLTableElement::caption):
2352         * html/HTMLTablePartElement.cpp:
2353         (WebCore::HTMLTablePartElement::findParentTable):
2354         * html/HTMLTableRowElement.cpp:
2355         (WebCore::HTMLTableRowElement::rowIndex):
2356         * html/HTMLTableRowsCollection.cpp:
2357         (WebCore::HTMLTableRowsCollection::rowAfter):
2358         (WebCore::HTMLTableRowsCollection::lastRow):
2359         * html/HTMLTextAreaElement.cpp:
2360         (WebCore::HTMLTextAreaElement::defaultEventHandler):
2361         * html/HTMLTextFormControlElement.cpp:
2362         (WebCore::HTMLTextFormControlElement::innerTextValue):
2363         (WebCore::positionForIndex):
2364         (WebCore::HTMLTextFormControlElement::indexForPosition):
2365         (WebCore::HTMLTextFormControlElement::valueWithHardLineBreaks):
2366         * html/HTMLTitleElement.cpp:
2367         (WebCore::HTMLTitleElement::setText):
2368         * html/HTMLTrackElement.cpp:
2369         (WebCore::HTMLTrackElement::mediaElement):
2370         * html/ImageDocument.cpp:
2371         (WebCore::ImageEventListener::handleEvent):
2372         * html/InputType.cpp:
2373         (WebCore::InputType::shouldSubmitImplicitly):
2374         * html/MediaDocument.cpp:
2375         (WebCore::ancestorVideoElement):
2376         (WebCore::MediaDocument::defaultEventHandler):
2377         * html/RadioInputType.cpp:
2378         (WebCore::RadioInputType::handleKeydownEvent):
2379         (WebCore::RadioInputType::isKeyboardFocusable):
2380         * html/TextFieldInputType.cpp:
2381         (WebCore::TextFieldInputType::shouldSubmitImplicitly):
2382         * html/parser/HTMLConstructionSite.cpp:
2383         (WebCore::hasImpliedEndTag):
2384         (WebCore::HTMLConstructionSite::attachLater):
2385         (WebCore::HTMLConstructionSite::insertHTMLFormElement):
2386         (WebCore::HTMLConstructionSite::insertTextNode):
2387         (WebCore::HTMLConstructionSite::ownerDocumentForCurrentNode):
2388         (WebCore::HTMLConstructionSite::findFosterSite):
2389         * html/parser/HTMLElementStack.cpp:
2390         (WebCore::HTMLNames::isScopeMarker):
2391         (WebCore::HTMLNames::isTableScopeMarker):
2392         (WebCore::HTMLNames::isSelectScopeMarker):
2393         * html/parser/HTMLTreeBuilder.cpp:
2394         (WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
2395         (WebCore::HTMLTreeBuilder::processStartTagForInBody):
2396         (WebCore::HTMLTreeBuilder::processStartTag):
2397         (WebCore::HTMLTreeBuilder::resetInsertionModeAppropriately):
2398         (WebCore::HTMLTreeBuilder::processEndTag):
2399         (WebCore::HTMLTreeBuilder::processCharacterBuffer):
2400         * html/shadow/InsertionPoint.h:
2401         (WebCore::isActiveInsertionPoint):
2402         (WebCore::parentNodeForDistribution):
2403         (WebCore::parentElementForDistribution):
2404         * html/shadow/MediaControlElementTypes.cpp:
2405         (WebCore::parentMediaElement):
2406         (WebCore::mediaControlElementType):
2407         (WebCore::MediaControlVolumeSliderElement::defaultEventHandler):
2408         * html/shadow/MediaControlElements.cpp:
2409         (WebCore::MediaControlPanelElement::defaultEventHandler):
2410         (WebCore::MediaControlVolumeSliderContainerElement::defaultEventHandler):
2411         (WebCore::MediaControlClosedCaptionsTrackListElement::defaultEventHandler):
2412         (WebCore::MediaControlTimelineElement::defaultEventHandler):
2413         * html/shadow/MediaControls.cpp:
2414         (WebCore::MediaControls::containsRelatedTarget):
2415         * html/shadow/MediaControlsApple.cpp:
2416         (WebCore::MediaControlsAppleEventListener::handleEvent):
2417         * html/shadow/SliderThumbElement.cpp:
2418         (WebCore::SliderThumbElement::defaultEventHandler):
2419         * html/shadow/SpinButtonElement.cpp:
2420         (WebCore::SpinButtonElement::defaultEventHandler):
2421         (WebCore::SpinButtonElement::forwardEvent):
2422         * html/shadow/TextControlInnerElements.cpp:
2423         (WebCore::SearchFieldResultsButtonElement::defaultEventHandler):
2424         (WebCore::SearchFieldCancelButtonElement::defaultEventHandler):
2425         * html/track/VTTCue.cpp:
2426         (WebCore::VTTCue::copyWebVTTNodeToDOMTree):
2427         (WebCore::VTTCue::markFutureAndPastNodes):
2428         * inspector/InspectorCSSAgent.cpp:
2429         (WebCore::InspectorCSSAgent::elementForId):
2430         (WebCore::InspectorCSSAgent::buildObjectForAttributesStyle):
2431         * inspector/InspectorDOMAgent.cpp:
2432         (WebCore::InspectorDOMAgent::unbind):
2433         (WebCore::InspectorDOMAgent::assertDocument):
2434         (WebCore::InspectorDOMAgent::assertElement):
2435         (WebCore::InspectorDOMAgent::querySelector):
2436         (WebCore::InspectorDOMAgent::querySelectorAll):
2437         (WebCore::InspectorDOMAgent::setNodeName):
2438         (WebCore::InspectorDOMAgent::buildObjectForNode):
2439         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
2440         (WebCore::InspectorDOMAgent::innerParentNode):
2441         * inspector/InspectorFrontendHost.cpp:
2442         (WebCore::InspectorFrontendHost::dispatchEventAsContextMenuEvent):
2443         * inspector/InspectorInstrumentation.cpp:
2444         (WebCore::frameForScriptExecutionContext):
2445         (WebCore::InspectorInstrumentation::instrumentingAgentsForNonDocumentContext):
2446         * inspector/InspectorInstrumentation.h:
2447         (WebCore::InspectorInstrumentation::instrumentingAgentsForContext):
2448         * inspector/InspectorNodeFinder.cpp:
2449         (WebCore::InspectorNodeFinder::searchUsingDOMTreeTraversal):
2450         (WebCore::InspectorNodeFinder::searchUsingXPath):
2451         (WebCore::InspectorNodeFinder::searchUsingCSSSelectors):
2452         * inspector/InspectorOverlay.cpp:
2453         (WebCore::buildObjectForElementInfo):
2454         * inspector/InspectorStyleSheet.cpp:
2455         (WebCore::InspectorStyleSheet::inlineStyleSheetText):
2456         * loader/FormSubmission.cpp:
2457         (WebCore::FormSubmission::create):
2458         * loader/FrameLoader.cpp:
2459         (WebCore::FrameLoader::handleFallbackContent):
2460         * loader/SubframeLoader.cpp:
2461         (WebCore::SubframeLoader::loadPlugin):
2462         * loader/ThreadableLoader.cpp:
2463         (WebCore::ThreadableLoader::create):
2464         (WebCore::ThreadableLoader::loadResourceSynchronously):
2465         * loader/cache/MemoryCache.cpp:
2466         (WebCore::MemoryCache::removeRequestFromCache):
2467         (WebCore::MemoryCache::removeRequestFromSessionCaches):
2468         * mathml/MathMLElement.cpp:
2469         (WebCore::MathMLElement::attributeChanged):
2470         * mathml/MathMLSelectElement.cpp:
2471         (WebCore::MathMLSelectElement::getSelectedSemanticsChild):
2472         * page/Chrome.cpp:
2473         (WebCore::Chrome::setToolTip):
2474         * page/ContextMenuController.cpp:
2475         (WebCore::ContextMenuController::maybeCreateContextMenu):
2476         (WebCore::ContextMenuController::populate):
2477         * page/DOMTimer.cpp:
2478         (WebCore::DOMTimer::install):
2479         (WebCore::DOMTimer::fired):
2480         * page/DragController.cpp:
2481         (WebCore::elementUnderMouse):
2482         (WebCore::DragController::operationForLoad):
2483         (WebCore::DragController::canProcessDrag):
2484         (WebCore::DragController::draggableElement):
2485         * page/EventHandler.cpp:
2486         (WebCore::EventHandler::handleMousePressEvent):
2487         (WebCore::isSubmitImage):
2488         (WebCore::targetIsFrame):
2489         (WebCore::findDropZone):
2490         (WebCore::EventHandler::updateDragAndDrop):
2491         (WebCore::EventHandler::updateMouseEventTargetNode):
2492         (WebCore::EventHandler::handleTextInputEvent):
2493         * page/FocusController.cpp:
2494         (WebCore::FocusNavigationScope::owner):
2495         (WebCore::FocusController::findFocusableElementDescendingDownIntoFrameDocument):
2496         (WebCore::FocusController::findFocusableElementAcrossFocusScope):
2497         (WebCore::FocusController::findElementWithExactTabIndex):
2498         (WebCore::nextElementWithGreaterTabIndex):
2499         (WebCore::previousElementWithLowerTabIndex):
2500         (WebCore::FocusController::nextFocusableElement):
2501         (WebCore::FocusController::previousFocusableElement):
2502         (WebCore::clearSelectionIfNeeded):
2503         (WebCore::FocusController::advanceFocusDirectionally):
2504         * page/Frame.cpp:
2505         (WebCore::Frame::searchForLabelsBeforeElement):
2506         (WebCore::Frame::setPageAndTextZoomFactors):
2507         * page/FrameView.cpp:
2508         (WebCore::FrameView::init):
2509         (WebCore::FrameView::scrollToAnchor):
2510         * page/PageSerializer.cpp:
2511         (WebCore::PageSerializer::serializeFrame):
2512         * page/SpatialNavigation.cpp:
2513         (WebCore::FocusCandidate::FocusCandidate):
2514         (WebCore::scrollInDirection):
2515         (WebCore::scrollableEnclosingBoxOrParentFrameForNodeInDirection):
2516         (WebCore::canScrollInDirection):
2517         (WebCore::nodeRectInAbsoluteCoordinates):
2518         (WebCore::areElementsOnSameLine):
2519         * page/ios/FrameIOS.mm:
2520         (WebCore::ancestorRespondingToClickEvents):
2521         * platform/network/FormData.cpp:
2522         (WebCore::FormData::appendKeyValuePairItems):
2523         * rendering/HitTestResult.cpp:
2524         (WebCore::HitTestResult::setInnerNode):
2525         (WebCore::HitTestResult::setInnerNonSharedNode):
2526         (WebCore::HitTestResult::title):
2527         (WebCore::HitTestResult::innerTextIfTruncated):
2528         (WebCore::HitTestResult::mediaSupportsFullscreen):
2529         (WebCore::HitTestResult::enterFullscreenForVideo):
2530         (WebCore::HitTestResult::mediaIsVideo):
2531         (WebCore::HitTestResult::innerElement):
2532         (WebCore::HitTestResult::innerNonSharedElement):
2533         * rendering/RenderBlockFlow.cpp:
2534         (WebCore::resizeTextPermitted):
2535         * rendering/RenderBox.cpp:
2536         (WebCore::RenderBox::sizesLogicalWidthToFitContent):
2537         * rendering/RenderCounter.cpp:
2538         (WebCore::planCounter):
2539         * rendering/RenderDetailsMarker.cpp:
2540         (WebCore::RenderDetailsMarker::isOpen):
2541         * rendering/RenderEmbeddedObject.cpp:
2542         (WebCore::RenderEmbeddedObject::handleUnavailablePluginIndicatorEvent):
2543         * rendering/RenderFileUploadControl.cpp:
2544         (WebCore::RenderFileUploadControl::uploadButton):
2545         * rendering/RenderImage.cpp:
2546         (WebCore::RenderImage::paintAreaElementFocusRing):
2547         (WebCore::RenderImage::paintIntoRect):
2548         (WebCore::RenderImage::imageMap):
2549         * rendering/RenderLayer.cpp:
2550         (WebCore::RenderLayer::scrollRectToVisible):
2551         (WebCore::RenderLayer::resize):
2552         (WebCore::RenderLayer::updateSnapOffsets):
2553         * rendering/RenderLayerBacking.cpp:
2554         (WebCore::isRestartedPlugin):
2555         * rendering/RenderListBox.cpp:
2556         (WebCore::RenderListBox::updateFromElement):
2557         (WebCore::RenderListBox::addFocusRingRects):
2558         (WebCore::RenderListBox::paintItemForeground):
2559         (WebCore::RenderListBox::paintItemBackground):
2560         * rendering/RenderMarquee.cpp:
2561         (WebCore::RenderMarquee::marqueeSpeed):
2562         * rendering/RenderMenuList.cpp:
2563         (WebCore::selectedOptionCount):
2564         (RenderMenuList::updateOptionsWidth):
2565         (RenderMenuList::setTextFromOption):
2566         (RenderMenuList::itemText):
2567         (RenderMenuList::itemIsEnabled):
2568         (RenderMenuList::itemIsLabel):
2569         (RenderMenuList::itemIsSelected):
2570         * rendering/RenderMeter.cpp:
2571         (WebCore::RenderMeter::meterElement):
2572         * rendering/RenderNamedFlowThread.cpp:
2573         (WebCore::RenderNamedFlowThread::isChildAllowed):
2574         * rendering/RenderObject.cpp:
2575         (WebCore::RenderObject::addPDFURLRect):
2576         (WebCore::RenderObject::shouldRespectImageOrientation):
2577         (WebCore::RenderObject::updateDragState):
2578         (WebCore::RenderObject::getUncachedPseudoStyle):
2579         (WebCore::RenderObject::getTextDecorationColors):
2580         * rendering/RenderProgress.cpp:
2581         (WebCore::RenderProgress::progressElement):
2582         * rendering/RenderSnapshottedPlugIn.cpp:
2583         (WebCore::RenderSnapshottedPlugIn::handleEvent):
2584         * rendering/RenderTable.cpp:
2585         (WebCore::RenderTable::convertStyleLogicalWidthToComputedWidth):
2586         (WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight):
2587         * rendering/RenderTableCell.cpp:
2588         (WebCore::RenderTableCell::parseColSpanFromDOM):
2589         (WebCore::RenderTableCell::parseRowSpanFromDOM):
2590         * rendering/RenderTheme.cpp:
2591         (WebCore::RenderTheme::isEnabled):
2592         (WebCore::RenderTheme::isFocused):
2593         (WebCore::RenderTheme::isPressed):
2594         (WebCore::RenderTheme::isSpinUpButtonPartPressed):
2595         (WebCore::RenderTheme::isReadOnlyControl):
2596         (WebCore::RenderTheme::isHovered):
2597         (WebCore::RenderTheme::isSpinUpButtonPartHovered):
2598         (WebCore::RenderTheme::paintSliderTicks):
2599         * rendering/RenderThemeGtk.cpp:
2600         (WebCore::getMediaElementFromRenderObject):
2601         (WebCore::nodeHasClass):
2602         * rendering/RenderThemeMac.mm:
2603         (WebCore::RenderThemeMac::updatePressedState):
2604         (WebCore::RenderThemeMac::paintSliderThumb):
2605         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
2606         (WebCore::RenderThemeMac::paintSnapshottedPluginOverlay):
2607         * rendering/RenderTreeAsText.cpp:
2608         (WebCore::isEmptyOrUnstyledAppleStyleSpan):
2609         (WebCore::RenderTreeAsText::writeRenderObject):
2610         * rendering/TextAutosizer.cpp:
2611         (WebCore::TextAutosizer::isAutosizingContainer):
2612         (WebCore::TextAutosizer::containerContainsOneOfTags):
2613         * rendering/mathml/RenderMathMLBlock.cpp:
2614         (WebCore::RenderMathMLBlock::isChildAllowed):
2615         * rendering/svg/RenderSVGGradientStop.cpp:
2616         (WebCore::RenderSVGGradientStop::gradientElement):
2617         * rendering/svg/RenderSVGTransformableContainer.cpp:
2618         (WebCore::RenderSVGTransformableContainer::calculateLocalTransform):
2619         * rendering/svg/SVGRenderingContext.cpp:
2620         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
2621         * style/StyleResolveTree.cpp:
2622         (WebCore::Style::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded):
2623         (WebCore::Style::attachChildren):
2624         (WebCore::Style::attachDistributedChildren):
2625         (WebCore::Style::detachDistributedChildren):
2626         (WebCore::Style::detachChildren):
2627         (WebCore::Style::resolveShadowTree):
2628         (WebCore::Style::resolveTree):
2629         * svg/SVGAElement.cpp:
2630         (WebCore::SVGAElement::defaultEventHandler):
2631         * svg/SVGAltGlyphElement.cpp:
2632         (WebCore::SVGAltGlyphElement::hasValidGlyphElements):
2633         * svg/SVGAnimateMotionElement.cpp:
2634         (WebCore::SVGAnimateMotionElement::hasValidAttributeType):
2635         * svg/SVGDocument.cpp:
2636         (WebCore::SVGDocument::rootElement):
2637         * svg/SVGElement.cpp:
2638         (WebCore::SVGElement::isOutermostSVGSVGElement):
2639         (WebCore::SVGElement::ownerSVGElement):
2640         (WebCore::SVGElement::viewportElement):
2641         * svg/SVGFontData.cpp:
2642         (WebCore::SVGFontData::applySVGGlyphSelection):
2643         * svg/SVGFontFaceElement.cpp:
2644         (WebCore::SVGFontFaceElement::associatedFontElement):
2645         (WebCore::SVGFontFaceElement::rebuildFontFace):
2646         * svg/SVGFontFaceSrcElement.cpp:
2647         (WebCore::SVGFontFaceSrcElement::childrenChanged):
2648         * svg/SVGGlyphElement.cpp:
2649         (WebCore::SVGGlyphElement::invalidateGlyphCache):
2650         * svg/SVGHKernElement.cpp:
2651         (WebCore::SVGHKernElement::insertedInto):
2652         (WebCore::SVGHKernElement::removedFrom):
2653         * svg/SVGLengthContext.cpp:
2654         (WebCore::SVGLengthContext::determineViewport):
2655         * svg/SVGLinearGradientElement.cpp:
2656         (WebCore::SVGLinearGradientElement::collectGradientAttributes):
2657         * svg/SVGLocatable.cpp:
2658         (WebCore::isViewportElement):
2659         (WebCore::SVGLocatable::getTransformToElement):
2660         * svg/SVGMPathElement.cpp:
2661         (WebCore::SVGMPathElement::pathElement):
2662         (WebCore::SVGMPathElement::notifyParentOfPathChange):
2663         * svg/SVGPathElement.cpp:
2664         (WebCore::SVGPathElement::invalidateMPathDependencies):
2665         * svg/SVGPatternElement.cpp:
2666         (WebCore::SVGPatternElement::collectPatternAttributes):
2667         * svg/SVGRadialGradientElement.cpp:
2668         (WebCore::SVGRadialGradientElement::collectGradientAttributes):
2669         * svg/SVGSVGElement.cpp:
2670         (WebCore::SVGSVGElement::setupInitialView):
2671         * svg/SVGTextContentElement.cpp:
2672         (WebCore::SVGTextContentElement::elementFromRenderer):
2673         * svg/SVGUseElement.cpp:
2674         (WebCore::dumpInstanceTree):
2675         (WebCore::SVGUseElement::toClipPath):
2676         (WebCore::SVGUseElement::expandUseElementsInShadowTree):
2677         (WebCore::SVGUseElement::expandSymbolElementsInShadowTree):
2678         * svg/SVGVKernElement.cpp:
2679         (WebCore::SVGVKernElement::insertedInto):
2680         (WebCore::SVGVKernElement::removedFrom):
2681         * svg/animation/SVGSMILElement.cpp:
2682         (WebCore::SVGSMILElement::buildPendingResource):
2683         * svg/graphics/SVGImageCache.cpp:
2684         (WebCore::SVGImageCache::imageForRenderer):
2685         * testing/Internals.cpp:
2686         (WebCore::Internals::shadowRootType):
2687         (WebCore::Internals::visiblePlaceholder):
2688         (WebCore::Internals::selectColorInColorChooser):
2689         (WebCore::Internals::wasLastChangeUserEdit):
2690         (WebCore::Internals::updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks):
2691         (WebCore::Internals::isSelectPopupVisible):
2692         * testing/js/WebCoreTestSupport.cpp:
2693         (WebCoreTestSupport::injectInternalsObject):
2694         * xml/XMLHttpRequest.cpp:
2695         (WebCore::XMLHttpRequest::open):
2696         * xml/XPathFunctions.cpp:
2697         (WebCore::XPath::expandedNameLocalPart):
2698         (WebCore::XPath::FunLang::evaluate):
2699         * xml/XPathNodeSet.cpp:
2700         (WebCore::XPath::sortBlock):
2701         (WebCore::XPath::NodeSet::sort):
2702         (WebCore::XPath::findRootNode):
2703         (WebCore::XPath::NodeSet::traversalSort):
2704         * xml/parser/XMLDocumentParserLibxml2.cpp:
2705         (WebCore::XMLDocumentParser::XMLDocumentParser):
2706
2707 2014-10-02  Rik Cabanier  <cabanier@adobe.com>
2708
2709         Clean up loops in CSSGradientValue.cpp
2710         https://bugs.webkit.org/show_bug.cgi?id=137332
2711
2712         Reviewed by Andreas Kling.
2713
2714         This patch cleans up a couple of for loops by using C++11 syntax and
2715         fixes some grammar in a comment.
2716
2717         No new tests, no behavior change.
2718
2719         * css/CSSGradientValue.cpp:
2720         (WebCore::CSSGradientValue::gradientWithStylesResolved): Move for loops to C++11.
2721         (WebCore::CSSGradientValue::addStops): Update grammar in comment for gradient midpoints.
2722
2723 2014-10-02  Krzysztof Czech  <k.czech@samsung.com>
2724
2725         AX: Default orientation for aria scrollbars should be vertical
2726         https://bugs.webkit.org/show_bug.cgi?id=137341
2727
2728         Reviewed by Chris Fleizach.
2729
2730         Default orientation for aria scrollbars regarding w3c spec should be vertical
2731
2732         No new tests, covering by existing one.
2733
2734         * accessibility/AccessibilityRenderObject.cpp:
2735         (WebCore::AccessibilityRenderObject::orientation):
2736
2737 2014-10-02  Eva Balazsfalvi  <evab.u-szeged@partner.samsung.com>
2738
2739         Fix minimal build warnings
2740         https://bugs.webkit.org/show_bug.cgi?id=137066
2741
2742         Reviewed by Daniel Bates.
2743
2744         No new tests, no behavior change.
2745
2746         * css/CSSParser.cpp:
2747         (WebCore::isValidKeywordPropertyAndValue):
2748         * html/parser/HTMLPreloadScanner.cpp:
2749         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
2750         * page/Page.cpp:
2751         (WebCore::Page::setPageScaleFactor):
2752         * platform/graphics/WidthIterator.cpp:
2753         (WebCore::WidthIterator::glyphDataForCharacter):
2754         * rendering/svg/SVGInlineTextBox.cpp:
2755         (WebCore::SVGInlineTextBox::prepareGraphicsContextForTextPainting):
2756
2757 2014-10-01  Benjamin Poulain  <bpoulain@apple.com>
2758
2759         Click events offset in webkit-overflow-scrolling iframes
2760         https://bugs.webkit.org/show_bug.cgi?id=134596
2761
2762         Reviewed by Sam Weinig.
2763
2764         * platform/ScrollView.cpp:
2765         (WebCore::ScrollView::visibleContentRectInternal):
2766         When converting coordinates from the main frame to a subframe's document, the position
2767         is first converted to the subframe's FrameView coordinate system, then offset by the scroll
2768         offset of the subframe itself.
2769
2770         The bug in this case was that the scroll offset used was the global scroll offset of the frame
2771         in the view instead of the scroll offset of the document in its own frameview.
2772
2773         The regression was introduced by the refactoring r162663. On iOS WebKit1, the coordinate system
2774         is different depending on VisibleContentRectIncludesScrollbars. In r162663, the value was set
2775         such that the rect returned is always in absolute coordinate.
2776
2777         The ideal solution would be to refactor ScrollView::platformVisibleContentRect() to always return
2778         the offsets in scroll view coordinates and verify and update all the call sites to use explicit
2779         conversion to the top frame. In this patch I only reverted the coordinate change of r162663 to avoid
2780         large scale impact.
2781
2782 2014-10-01  Christophe Dumez  <cdumez@apple.com>
2783
2784         Use is<>() / downcast<>() for File
2785         https://bugs.webkit.org/show_bug.cgi?id=137318
2786
2787         Reviewed by Gyuyoung Kim.
2788
2789         Use is<>() / downcast<>() for File instead of isFile() / toFile().
2790
2791         No new tests, no behavior change.
2792
2793         * fileapi/Blob.h:
2794         * fileapi/File.h:
2795         (isType):
2796         * fileapi/FileReader.cpp:
2797         (WebCore::FileReader::readAsArrayBuffer):
2798         (WebCore::FileReader::readAsBinaryString):
2799         (WebCore::FileReader::readAsText):
2800         (WebCore::FileReader::readAsDataURL):
2801         * platform/network/FormData.cpp:
2802         (WebCore::FormData::appendKeyValuePairItems):
2803
2804 2014-10-01  Rik Cabanier  <cabanier@adobe.com>
2805
2806         Add support for midpoint to CSS gradients
2807         https://bugs.webkit.org/show_bug.cgi?id=137171
2808
2809         Reviewed by Darin Adler.
2810
2811         This patch adds support for gradient midpoints. It also updates the 
2812         gradient tests so they use the feature.
2813         Spec: http://dev.w3.org/csswg/css-images-4/#color-interpolation-hint
2814
2815         Tests: fast/gradients/unprefixed-color-stops2.html
2816                fast/gradients/unprefixed-gradient-parsing.html
2817                fast/gradients/unprefixed-linear-angle-gradients2.html
2818                fast/gradients/unprefixed-radial-gradients.html
2819                fast/gradients/unprefixed-radial-gradients2.html
2820                fast/gradients/unprefixed-repeating-linear-gradient.html
2821                fast/gradients/unprefixed-repeating-radial-gradients.html
2822
2823         * css/CSSGradientValue.cpp:
2824         (WebCore::GradientStop::GradientStop): constructor initializes the midpoint variable
2825         (WebCore::CSSGradientValue::gradientWithStylesResolved): this function checks for midpoint color stops
2826         (WebCore::CSSGradientValue::addStops): this function processes midpoints and converts them to regular color stops
2827         (WebCore::CSSLinearGradientValue::customCSSText): this routine was updated to do correct parsing for midpoints
2828         (WebCore::CSSRadialGradientValue::customCSSText):
2829         * css/CSSGradientValue.h:
2830         (WebCore::CSSGradientColorStop::CSSGradientColorStop): this function stores if a stop is a midpoint
2831         * css/CSSParser.cpp:
2832         (WebCore::CSSParser::parseGradientColorStops): this function now allows color stops with no color
2833
2834 2014-10-01  Chris Dumez  <cdumez@apple.com>
2835
2836         Add basic caching for Document.cookie API
2837         https://bugs.webkit.org/show_bug.cgi?id=137225
2838
2839         Reviewed by Alexey Proskuryakov.
2840
2841         While profiling the load of nytimes.com, I noticed that the site is
2842         accessing ~250 times document.cookie, just during page load. Accessing
2843         document.cookie is currently slow because we:
2844         - Call WebPlatformStrategies::cookiesForDOM() virtual function
2845         - Send a sync IPC message to the Network process to retrieve the
2846           cookies
2847             - The Network process gets the list of cookies from CFNetwork then
2848               serializes the result to send it back to the WebProcess
2849         - We unserialize the cookies into an NSList of cookies
2850         - We filter-out the cookies that are 'httpOnly' and construct a new
2851           NSList of cookies
2852         - We create a WTF String out of the cookies NSList
2853
2854         In the case of nytimes.com, it turns out that up to 100 calls to
2855         document.cookie() are made in the same event loop iteration. This patch
2856         thus caches / freezes the cookies until we return to the event
2857         loop so that consecutive calls to document.cookie() are extremely fast.
2858         Doing so seems to be sufficient to achieve a ~87% cache hit for
2859         nytimes.com page load.
2860
2861         The cookies cache is invalidated whenever:
2862         - document.cookie is set
2863         - we return to the event loop
2864         - a network resource is loaded synchronously as it may cause cookies to
2865           be set before we return to the event loop
2866
2867         Test: http/tests/cookies/sync-xhr-set-cookie-invalidates-cache.html
2868
2869         * dom/Document.cpp:
2870         (WebCore::Document::Document):
2871         (WebCore::Document::open):
2872         (WebCore::Document::cookie):
2873         (WebCore::Document::setCookie):
2874         (WebCore::Document::setCookieURL):
2875         (WebCore::Document::initSecurityContext):
2876         (WebCore::Document::setDOMCookieCache):
2877         (WebCore::Document::invalidateDOMCookieCache):
2878         (WebCore::Document::domCookieCacheExpiryTimerFired):
2879         (WebCore::Document::didLoadResourceSynchronously):
2880         * dom/Document.h:
2881         (WebCore::Document::domCookieCache):
2882         (WebCore::Document::isDOMCookieCacheValid):
2883         (WebCore::Document::setCookieURL): Deleted.
2884         * dom/ScriptExecutionContext.cpp:
2885         (WebCore::ScriptExecutionContext::didLoadResourceSynchronously):
2886         * dom/ScriptExecutionContext.h:
2887         * loader/ThreadableLoader.cpp:
2888         (WebCore::ThreadableLoader::loadResourceSynchronously):
2889
2890 2014-10-01  Christophe Dumez  <cdumez@apple.com>
2891
2892         Use is<>() / downcast<>() for Event classes
2893         https://bugs.webkit.org/show_bug.cgi?id=137284
2894
2895         Reviewed by Andreas Kling.
2896
2897         Use is<>() / downcast<>() for Event classes.
2898
2899         No new tests, no behavior change.
2900
2901         * bindings/js/JSErrorHandler.cpp:
2902         (WebCore::JSErrorHandler::handleEvent):
2903         * bindings/js/JSEventListener.cpp:
2904         (WebCore::JSEventListener::handleEvent):
2905         * dom/BeforeTextInsertedEvent.h:
2906         * dom/BeforeUnloadEvent.h:
2907         * dom/ErrorEvent.h:
2908         * dom/Event.h:
2909         * dom/EventContext.cpp:
2910         (WebCore::MouseOrFocusEventContext::handleLocalEvents):
2911         * dom/FocusEvent.h:
2912         * dom/KeyboardEvent.cpp:
2913         (WebCore::findKeyboardEvent):
2914         * dom/KeyboardEvent.h:
2915         * dom/MouseEvent.cpp:
2916         (WebCore::SimulatedMouseEvent::SimulatedMouseEvent):
2917         * dom/MouseEvent.h:
2918         * dom/Node.cpp:
2919         (WebCore::Node::defaultEventHandler):
2920         * dom/TextEvent.h:
2921         * dom/UIEvent.h:
2922         * dom/WheelEvent.h:
2923         * html/HTMLAnchorElement.cpp:
2924         (WebCore::appendServerMapMousePosition):
2925         (WebCore::HTMLAnchorElement::defaultEventHandler):
2926         (WebCore::HTMLAnchorElement::eventType):
2927         (WebCore::isEnterKeyKeydownEvent):
2928         (WebCore::isLinkClick):
2929         * html/HTMLButtonElement.cpp:
2930         (WebCore::HTMLButtonElement::defaultEventHandler):
2931         * html/HTMLFormElement.cpp:
2932         (WebCore::HTMLFormElement::submitImplicitly):
2933         * html/HTMLFormElement.h:
2934         * html/HTMLFrameSetElement.cpp:
2935         (WebCore::HTMLFrameSetElement::defaultEventHandler):
2936         * html/HTMLInputElement.cpp:
2937         (WebCore::HTMLInputElement::willDispatchEvent):
2938         (WebCore::HTMLInputElement::defaultEventHandler):
2939         * html/HTMLPlugInImageElement.cpp:
2940         (WebCore::HTMLPlugInImageElement::defaultEventHandler):
2941         * html/HTMLSelectElement.cpp:
2942         (WebCore::HTMLSelectElement::menuListDefaultEventHandler):
2943         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
2944         (WebCore::HTMLSelectElement::defaultEventHandler):
2945         * html/HTMLSummaryElement.cpp:
2946         (WebCore::HTMLSummaryElement::defaultEventHandler):
2947         * html/HTMLTextAreaElement.cpp:
2948         (WebCore::HTMLTextAreaElement::defaultEventHandler):
2949         * html/ImageDocument.cpp:
2950         (WebCore::ImageEventListener::handleEvent):
2951         * html/ImageInputType.cpp:
2952         (WebCore::ImageInputType::handleDOMActivateEvent):
2953         * html/InputType.cpp:
2954         (WebCore::InputType::shouldSubmitImplicitly):
2955         * html/InputType.h:
2956         * html/MediaDocument.cpp:
2957         (WebCore::MediaDocument::defaultEventHandler):
2958         * html/TextFieldInputType.cpp:
2959         (WebCore::TextFieldInputType::shouldSubmitImplicitly):
2960         * html/TextFieldInputType.h:
2961         * html/shadow/MediaControlElementTypes.cpp:
2962         (WebCore::MediaControlVolumeSliderElement::defaultEventHandler):
2963         * html/shadow/MediaControlElements.cpp:
2964         (WebCore::MediaControlPanelElement::defaultEventHandler):
2965         (WebCore::MediaControlVolumeSliderContainerElement::defaultEventHandler):
2966         (WebCore::MediaControlTimelineElement::defaultEventHandler):
2967         * html/shadow/MediaControls.cpp:
2968         (WebCore::MediaControls::containsRelatedTarget):
2969         * html/shadow/MediaControlsApple.cpp:
2970         (WebCore::MediaControlsAppleEventListener::handleEvent):
2971         * html/shadow/SliderThumbElement.cpp:
2972         (WebCore::SliderThumbElement::defaultEventHandler):
2973         * html/shadow/SpinButtonElement.cpp:
2974         (WebCore::SpinButtonElement::defaultEventHandler):
2975         (WebCore::SpinButtonElement::forwardEvent):
2976         * html/shadow/TextControlInnerElements.cpp:
2977         (WebCore::SearchFieldResultsButtonElement::defaultEventHandler):
2978         (WebCore::SearchFieldCancelButtonElement::defaultEventHandler):
2979         * inspector/InspectorFrontendHost.cpp:
2980         (WebCore::InspectorFrontendHost::dispatchEventAsContextMenuEvent):
2981         * page/ContextMenuController.cpp:
2982         (WebCore::ContextMenuController::maybeCreateContextMenu):
2983         * page/EventHandler.cpp:
2984         (WebCore::EventHandler::handleTextInputEvent):
2985         * rendering/RenderEmbeddedObject.cpp:
2986         (WebCore::RenderEmbeddedObject::isInUnavailablePluginIndicator):
2987         (WebCore::RenderEmbeddedObject::handleUnavailablePluginIndicatorEvent):
2988         * rendering/RenderEmbeddedObject.h:
2989         * rendering/RenderSnapshottedPlugIn.cpp:
2990         (WebCore::RenderSnapshottedPlugIn::handleEvent):
2991
2992 2014-10-01  Zan Dobersek  <zdobersek@igalia.com>
2993
2994         [TexMap] Sprinkle range-based for-loops in GraphicsLayerTextureMapper, TextureMapperLayer
2995         https://bugs.webkit.org/show_bug.cgi?id=137271
2996
2997         Reviewed by Sergio Villar Senin.
2998
2999         Switch to using C++11 range-based for-loops in the
3000         GraphicsLayerTextureMapper and TextureMapperLayer classes.
3001
3002         The for loops that remained unchanged either do further computation
3003         with the loop index or must iterate over the container in reverse.
3004
3005         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
3006         (WebCore::toTextureMapperLayerVector):
3007         (WebCore::GraphicsLayerTextureMapper::flushCompositingState):
3008         * platform/graphics/texmap/TextureMapperLayer.cpp:
3009         (WebCore::TextureMapperLayer::computeTransformsRecursive):
3010         (WebCore::TextureMapperLayer::paintSelfAndChildren):
3011         (WebCore::TextureMapperLayer::computeOverlapRegions):
3012         (WebCore::TextureMapperLayer::paintUsingOverlapRegions):
3013         (WebCore::TextureMapperLayer::~TextureMapperLayer):
3014         (WebCore::TextureMapperLayer::setChildren):
3015         (WebCore::TextureMapperLayer::descendantsOrSelfHaveRunningAnimations):
3016         (WebCore::TextureMapperLayer::applyAnimationsRecursively):
3017
3018 2014-10-01  Dan Bernstein  <mitz@apple.com>
3019
3020         Windows build fix.
3021
3022         * platform/network/cf/ResourceResponseCFNet.cpp:
3023
3024 2014-10-01  Dan Bernstein  <mitz@apple.com>
3025
3026         REGRESSION (r173423): [iOS] Sites with EV certificates appear as normal HTTPS sites
3027         https://bugs.webkit.org/show_bug.cgi?id=137262
3028
3029         Reviewed by Antti Koivisto.
3030
3031         No new tests, because the API test harness doesn’t run an HTTP server to test against.
3032
3033         * platform/network/cf/ResourceResponseCFNet.cpp:
3034         (WebCore::ResourceResponse::platformCertificateInfo): Return a CertificateInfo initialized
3035         with the certificate array from the response.
3036
3037 2014-09-30  Yusuke Suzuki  <utatane.tea@gmail.com>
3038
3039         CSS JIT: Enable multiple stack references allocation by allocateUninitialized
3040         https://bugs.webkit.org/show_bug.cgi?id=135293
3041
3042         Reviewed by Benjamin Poulain.
3043
3044         * cssjit/StackAllocator.h:
3045         (WebCore::StackAllocator::stackTop):
3046             Add stackTop method to check references are allocated easily.
3047         (WebCore::StackAllocator::allocateUninitialized):
3048
3049 2014-09-30  Chris Dumez  <cdumez@apple.com>
3050
3051         Drop getPtr() overload taking a Document reference in argument
3052         https://bugs.webkit.org/show_bug.cgi?id=137280
3053
3054         Reviewed by Daniel Bates.
3055
3056         Drop getPtr() overload taking a Document reference in argument. This is
3057         no longer needed as the generic getPtr() function converts references
3058         into pointers just fine after r173765.
3059
3060         No new tests, no behavior change.
3061
3062         * dom/Document.h:
3063         (WTF::getPtr): Deleted.
3064
3065 2014-09-30  Brian J. Burg  <burg@cs.washington.edu>
3066
3067         Web Inspector: ErrorString should be passed by reference
3068         https://bugs.webkit.org/show_bug.cgi?id=137257
3069
3070         Reviewed by Joseph Pecoraro.
3071
3072         Pass the leading ErrorString argument by reference, since it is always an out parameter.
3073         Clean up callsites where the error message is written.
3074
3075         No new tests, no behavior changed.
3076
3077         * inspector/CommandLineAPIHost.cpp:
3078         (WebCore::CommandLineAPIHost::clearConsoleMessages):
3079         * inspector/DOMEditor.cpp:
3080         (WebCore::populateErrorString):
3081         (WebCore::DOMEditor::insertBefore):
3082         (WebCore::DOMEditor::removeChild):
3083         (WebCore::DOMEditor::setAttribute):
3084         (WebCore::DOMEditor::removeAttribute):
3085         (WebCore::DOMEditor::setOuterHTML):
3086         (WebCore::DOMEditor::replaceWholeText):
3087         * inspector/DOMEditor.h:
3088         * inspector/InspectorApplicationCacheAgent.cpp:
3089         (WebCore::InspectorApplicationCacheAgent::enable):
3090         (WebCore::InspectorApplicationCacheAgent::getFramesWithManifests):
3091         (WebCore::InspectorApplicationCacheAgent::assertFrameWithDocumentLoader):
3092         (WebCore::InspectorApplicationCacheAgent::getManifestForFrame):
3093         (WebCore::InspectorApplicationCacheAgent::getApplicationCacheForFrame):
3094         * inspector/InspectorApplicationCacheAgent.h:
3095         * inspector/InspectorCSSAgent.cpp:
3096         (WebCore::InspectorCSSAgent::enable):
3097         (WebCore::InspectorCSSAgent::disable):
3098         (WebCore::InspectorCSSAgent::didCreateNamedFlow):
3099         (WebCore::InspectorCSSAgent::regionOversetChanged):
3100         (WebCore::InspectorCSSAgent::didRegisterNamedFlowContentElement):
3101         (WebCore::InspectorCSSAgent::didUnregisterNamedFlowContentElement):
3102         (WebCore::InspectorCSSAgent::getMatchedStylesForNode):
3103         (WebCore::InspectorCSSAgent::getInlineStylesForNode):
3104         (WebCore::InspectorCSSAgent::getComputedStyleForNode):
3105         (WebCore::InspectorCSSAgent::getAllStyleSheets):
3106         (WebCore::InspectorCSSAgent::getStyleSheet):
3107         (WebCore::InspectorCSSAgent::getStyleSheetText):
3108         (WebCore::InspectorCSSAgent::setStyleSheetText):
3109         (WebCore::InspectorCSSAgent::setStyleText):
3110         (WebCore::InspectorCSSAgent::setPropertyText):
3111         (WebCore::InspectorCSSAgent::toggleProperty):
3112         (WebCore::InspectorCSSAgent::setRuleSelector):
3113         (WebCore::InspectorCSSAgent::addRule):
3114         (WebCore::InspectorCSSAgent::getSupportedCSSProperties):
3115         (WebCore::InspectorCSSAgent::forcePseudoState):
3116         (WebCore::InspectorCSSAgent::getNamedFlowCollection):
3117         (WebCore::InspectorCSSAgent::elementForId):
3118         (WebCore::InspectorCSSAgent::assertStyleSheetForId):
3119         (WebCore::InspectorCSSAgent::buildArrayForRegions):
3120         (WebCore::InspectorCSSAgent::buildObjectForNamedFlow):
3121         * inspector/InspectorCSSAgent.h:
3122         * inspector/InspectorController.cpp:
3123         (WebCore::InspectorController::hideHighlight):
3124         (WebCore::InspectorController::setProfilerEnabled):
3125         (WebCore::InspectorController::resume):
3126         * inspector/InspectorDOMAgent.cpp:
3127         (WebCore::InspectorDOMAgent::willDestroyFrontendAndBackend):
3128         (WebCore::InspectorDOMAgent::assertNode):
3129         (WebCore::InspectorDOMAgent::assertDocument):
3130         (WebCore::InspectorDOMAgent::assertElement):
3131         (WebCore::InspectorDOMAgent::assertEditableNode):
3132         (WebCore::InspectorDOMAgent::assertEditableElement):
3133         (WebCore::InspectorDOMAgent::getDocument):
3134         (WebCore::InspectorDOMAgent::pushNodeToFrontend):
3135         (WebCore::InspectorDOMAgent::requestChildNodes):
3136         (WebCore::InspectorDOMAgent::querySelector):
3137         (WebCore::InspectorDOMAgent::querySelectorAll):
3138         (WebCore::InspectorDOMAgent::releaseBackendNodeIds):
3139         (WebCore::InspectorDOMAgent::setAttributeValue):
3140         (WebCore::InspectorDOMAgent::setAttributesAsText):
3141         (WebCore::InspectorDOMAgent::removeAttribute):
3142         (WebCore::InspectorDOMAgent::removeNode):
3143         (WebCore::InspectorDOMAgent::setNodeName):
3144         (WebCore::InspectorDOMAgent::getOuterHTML):
3145         (WebCore::InspectorDOMAgent::setOuterHTML):
3146         (WebCore::InspectorDOMAgent::setNodeValue):
3147         (WebCore::InspectorDOMAgent::getEventListenersForNode):
3148         (WebCore::InspectorDOMAgent::getAccessibilityPropertiesForNode):
3149         (WebCore::InspectorDOMAgent::performSearch):
3150         (WebCore::InspectorDOMAgent::getSearchResults):
3151         (WebCore::InspectorDOMAgent::discardSearchResults):
3152         (WebCore::InspectorDOMAgent::inspect):
3153         (WebCore::InspectorDOMAgent::setSearchingForNode):
3154         (WebCore::InspectorDOMAgent::highlightConfigFromInspectorObject):
3155         (WebCore::InspectorDOMAgent::setInspectModeEnabled):
3156         (WebCore::InspectorDOMAgent::highlightRect):
3157         (WebCore::InspectorDOMAgent::highlightQuad):
3158         (WebCore::InspectorDOMAgent::highlightNode):
3159         (WebCore::InspectorDOMAgent::highlightFrame):
3160         (WebCore::InspectorDOMAgent::hideHighlight):
3161         (WebCore::InspectorDOMAgent::moveTo):
3162         (WebCore::InspectorDOMAgent::undo):
3163         (WebCore::InspectorDOMAgent::redo):
3164         (WebCore::InspectorDOMAgent::markUndoableState):
3165         (WebCore::InspectorDOMAgent::focus):
3166         (WebCore::InspectorDOMAgent::resolveNode):
3167         (WebCore::InspectorDOMAgent::getAttributes):
3168         (WebCore::InspectorDOMAgent::requestNode):
3169         (WebCore::InspectorDOMAgent::pushNodeByPathToFrontend):
3170         (WebCore::InspectorDOMAgent::pushNodeByBackendIdToFrontend):
3171         * inspector/InspectorDOMAgent.h:
3172         * inspector/InspectorDOMDebuggerAgent.cpp:
3173         (WebCore::InspectorDOMDebuggerAgent::setEventListenerBreakpoint):
3174         (WebCore::InspectorDOMDebuggerAgent::setInstrumentationBreakpoint):
3175         (WebCore::InspectorDOMDebuggerAgent::setBreakpoint):
3176         (WebCore::InspectorDOMDebuggerAgent::removeEventListenerBreakpoint):
3177         (WebCore::InspectorDOMDebuggerAgent::removeInstrumentationBreakpoint):
3178         (WebCore::InspectorDOMDebuggerAgent::removeBreakpoint):
3179         (WebCore::domTypeForName):
3180         (WebCore::InspectorDOMDebuggerAgent::setDOMBreakpoint):
3181         (WebCore::InspectorDOMDebuggerAgent::removeDOMBreakpoint):
3182         (WebCore::InspectorDOMDebuggerAgent::setXHRBreakpoint):
3183         (WebCore::InspectorDOMDebuggerAgent::removeXHRBreakpoint):
3184         (WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest):
3185         * inspector/InspectorDOMDebuggerAgent.h:
3186         * inspector/InspectorDOMStorageAgent.cpp:
3187         (WebCore::InspectorDOMStorageAgent::willDestroyFrontendAndBackend):
3188         (WebCore::InspectorDOMStorageAgent::enable):
3189         (WebCore::InspectorDOMStorageAgent::disable):
3190         (WebCore::InspectorDOMStorageAgent::getDOMStorageItems):
3191         (WebCore::InspectorDOMStorageAgent::setDOMStorageItem):
3192         (WebCore::InspectorDOMStorageAgent::removeDOMStorageItem):
3193         (WebCore::InspectorDOMStorageAgent::findStorageArea):
3194         * inspector/InspectorDOMStorageAgent.h:
3195         * inspector/InspectorDatabaseAgent.cpp:
3196         (WebCore::InspectorDatabaseAgent::willDestroyFrontendAndBackend):
3197         (WebCore::InspectorDatabaseAgent::enable):
3198         (WebCore::InspectorDatabaseAgent::disable):
3199         (WebCore::InspectorDatabaseAgent::getDatabaseTableNames):
3200         (WebCore::InspectorDatabaseAgent::executeSQL):
3201         * inspector/InspectorDatabaseAgent.h:
3202         * inspector/InspectorIndexedDBAgent.cpp:
3203         (WebCore::InspectorIndexedDBAgent::willDestroyFrontendAndBackend):
3204         (WebCore::InspectorIndexedDBAgent::enable):
3205         (WebCore::InspectorIndexedDBAgent::disable):
3206         (WebCore::assertDocument):
3207         (WebCore::assertIDBFactory):
3208         (WebCore::InspectorIndexedDBAgent::requestDatabaseNames):
3209         (WebCore::InspectorIndexedDBAgent::requestDatabase):
3210         (WebCore::InspectorIndexedDBAgent::requestData):
3211         (WebCore::InspectorIndexedDBAgent::clearObjectStore):
3212         * inspector/InspectorIndexedDBAgent.h:
3213         * inspector/InspectorLayerTreeAgent.cpp:
3214         (WebCore::InspectorLayerTreeAgent::willDestroyFrontendAndBackend):
3215         (WebCore::InspectorLayerTreeAgent::enable):
3216         (WebCore::InspectorLayerTreeAgent::disable):
3217         (WebCore::InspectorLayerTreeAgent::layersForNode):
3218         (WebCore::InspectorLayerTreeAgent::gatherLayersUsingRenderObjectHierarchy):
3219         (WebCore::InspectorLayerTreeAgent::gatherLayersUsingRenderLayerHierarchy):
3220         (WebCore::InspectorLayerTreeAgent::buildObjectForLayer):
3221         (WebCore::InspectorLayerTreeAgent::idForNode):
3222         (WebCore::InspectorLayerTreeAgent::reasonsForCompositingLayer):
3223         * inspector/InspectorLayerTreeAgent.h:
3224         * inspector/InspectorPageAgent.cpp:
3225         (WebCore::InspectorPageAgent::cachedResourceContent):
3226         (WebCore::InspectorPageAgent::resourceContent):
3227         (WebCore::InspectorPageAgent::willDestroyFrontendAndBackend):
3228         (WebCore::InspectorPageAgent::enable):
3229         (WebCore::InspectorPageAgent::disable):
3230         (WebCore::InspectorPageAgent::addScriptToEvaluateOnLoad):
3231         (WebCore::InspectorPageAgent::removeScriptToEvaluateOnLoad):
3232         (WebCore::InspectorPageAgent::reload):
3233         (WebCore::InspectorPageAgent::navigate):
3234         (WebCore::InspectorPageAgent::getCookies):
3235         (WebCore::InspectorPageAgent::deleteCookie):
3236         (WebCore::InspectorPageAgent::getResourceTree):
3237         (WebCore::InspectorPageAgent::getResourceContent):
3238         (WebCore::InspectorPageAgent::searchInResource):
3239         (WebCore::InspectorPageAgent::searchInResources):
3240         (WebCore::InspectorPageAgent::setDocumentContent):
3241         (WebCore::InspectorPageAgent::setShowPaintRects):
3242         (WebCore::InspectorPageAgent::canShowDebugBorders):
3243         (WebCore::InspectorPageAgent::setShowDebugBorders):
3244         (WebCore::InspectorPageAgent::canShowFPSCounter):
3245         (WebCore::InspectorPageAgent::setShowFPSCounter):
3246         (WebCore::InspectorPageAgent::canContinuouslyPaint):
3247         (WebCore::InspectorPageAgent::setContinuousPaintingEnabled):
3248         (WebCore::InspectorPageAgent::getScriptExecutionStatus):
3249         (WebCore::InspectorPageAgent::setScriptExecutionDisabled):
3250         (WebCore::InspectorPageAgent::assertFrame):
3251         (WebCore::InspectorPageAgent::assertDocumentLoader):
3252         (WebCore::InspectorPageAgent::setTouchEmulationEnabled):
3253         (WebCore::InspectorPageAgent::setEmulatedMedia):
3254         (WebCore::InspectorPageAgent::getCompositingBordersVisible):
3255         (WebCore::InspectorPageAgent::setCompositingBordersVisible):
3256         (WebCore::InspectorPageAgent::snapshotNode):
3257         (WebCore::InspectorPageAgent::snapshotRect):
3258         (WebCore::InspectorPageAgent::handleJavaScriptDialog):
3259         (WebCore::InspectorPageAgent::archive):
3260         * inspector/InspectorPageAgent.h:
3261         * inspector/InspectorReplayAgent.cpp:
3262         (WebCore::InspectorReplayAgent::startCapturing):
3263         (WebCore::InspectorReplayAgent::stopCapturing):
3264         (WebCore::InspectorReplayAgent::replayToPosition):
3265         (WebCore::InspectorReplayAgent::replayToCompletion):
3266         (WebCore::InspectorReplayAgent::pausePlayback):
3267         (WebCore::InspectorReplayAgent::cancelPlayback):
3268         (WebCore::InspectorReplayAgent::switchSession):
3269         (WebCore::InspectorReplayAgent::insertSessionSegment):
3270         (WebCore::InspectorReplayAgent::removeSessionSegment):
3271         (WebCore::InspectorReplayAgent::findSession):
3272         (WebCore::InspectorReplayAgent::findSegment):
3273         (WebCore::InspectorReplayAgent::currentReplayState):
3274         (WebCore::InspectorReplayAgent::getAvailableSessions):
3275         (WebCore::InspectorReplayAgent::getSessionData):
3276         (WebCore::InspectorReplayAgent::getSegmentData):
3277         * inspector/InspectorReplayAgent.h:
3278         * inspector/InspectorResourceAgent.cpp:
3279         (WebCore::InspectorResourceAgent::willDestroyFrontendAndBackend):
3280         (WebCore::InspectorResourceAgent::~InspectorResourceAgent):
3281         (WebCore::InspectorResourceAgent::enable):
3282         (WebCore::InspectorResourceAgent::disable):
3283         (WebCore::InspectorResourceAgent::setExtraHTTPHeaders):
3284         (WebCore::InspectorResourceAgent::getResponseBody):
3285         (WebCore::InspectorResourceAgent::replayXHR):
3286         (WebCore::InspectorResourceAgent::canClearBrowserCache):
3287         (WebCore::InspectorResourceAgent::clearBrowserCache):
3288         (WebCore::InspectorResourceAgent::canClearBrowserCookies):
3289         (WebCore::InspectorResourceAgent::clearBrowserCookies):
3290         (WebCore::InspectorResourceAgent::setCacheDisabled):
3291         (WebCore::InspectorResourceAgent::loadResource):
3292         * inspector/InspectorResourceAgent.h:
3293         * inspector/InspectorStyleSheet.cpp:
3294         (WebCore::InspectorStyleSheet::resourceStyleSheetText):
3295         * inspector/InspectorTimelineAgent.cpp:
3296         (WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
3297         (WebCore::InspectorTimelineAgent::start):
3298         (WebCore::InspectorTimelineAgent::stop):
3299         * inspector/InspectorTimelineAgent.h:
3300         * inspector/InspectorWorkerAgent.cpp:
3301         (WebCore::InspectorWorkerAgent::willDestroyFrontendAndBackend):
3302         (WebCore::InspectorWorkerAgent::enable):
3303         (WebCore::InspectorWorkerAgent::disable):
3304         (WebCore::InspectorWorkerAgent::canInspectWorkers):
3305         (WebCore::InspectorWorkerAgent::connectToWorker):
3306         (WebCore::InspectorWorkerAgent::disconnectFromWorker):
3307         (WebCore::InspectorWorkerAgent::sendMessageToWorker):
3308         (WebCore::InspectorWorkerAgent::setAutoconnectToWorkers):
3309         * inspector/InspectorWorkerAgent.h:
3310         * inspector/PageConsoleAgent.cpp:
3311         (WebCore::PageConsoleAgent::clearMessages):
3312         (WebCore::PageConsoleAgent::addInspectedNode):
3313         * inspector/PageConsoleAgent.h:
3314         * inspector/PageDebuggerAgent.cpp:
3315         (WebCore::PageDebuggerAgent::injectedScriptForEval):
3316         (WebCore::PageDebuggerAgent::setOverlayMessage):
3317         * inspector/PageDebuggerAgent.h:
3318         * inspector/PageRuntimeAgent.cpp:
3319         (WebCore::PageRuntimeAgent::willDestroyFrontendAndBackend):
3320         (WebCore::PageRuntimeAgent::enable):
3321         (WebCore::PageRuntimeAgent::disable):
3322         (WebCore::PageRuntimeAgent::injectedScriptForEval):
3323         * inspector/PageRuntimeAgent.h:
3324         * inspector/WebConsoleAgent.cpp:
3325         (WebCore::WebConsoleAgent::setMonitoringXHREnabled):
3326         * inspector/WebConsoleAgent.h:
3327         * inspector/WorkerConsoleAgent.cpp:
3328         (WebCore::WorkerConsoleAgent::addInspectedNode):
3329         * inspector/WorkerConsoleAgent.h:
3330         * inspector/WorkerDebuggerAgent.cpp:
3331         (WebCore::WorkerDebuggerAgent::injectedScriptForEval):
3332         * inspector/WorkerDebuggerAgent.h:
3333         * inspector/WorkerInspectorController.cpp:
3334         (WebCore::WorkerInspectorController::resume):
3335         * inspector/WorkerRuntimeAgent.cpp:
3336         (WebCore::WorkerRuntimeAgent::injectedScriptForEval):
3337         (WebCore::WorkerRuntimeAgent::run):
3338         * inspector/WorkerRuntimeAgent.h:
3339
3340 2014-09-30  Said Abou-Hallawa  <sabouhallawa@apple.com>
3341
3342         Stack overflow with enormous SVG filter
3343         https://bugs.webkit.org/show_bug.cgi?id=63290
3344
3345         Prevent building an SVG filter if it has more than 200 FilterEffect nodes in its map 
3346         regardless whether they will be connected to its lastEffect or not. Also discard any
3347         filter which has more 100 contributing FilterEffect nodes in its tree.
3348
3349         Reviewed by Dean Jackson.
3350
3351         Tests: svg/filters/svg-deeply-nested-crash.html
3352
3353         * platform/graphics/filters/FilterEffect.cpp:
3354         (WebCore::collectEffects):
3355         (WebCore::FilterEffect::totalNumberOfEffectInputs):
3356         * platform/graphics/filters/FilterEffect.h:
3357         -- Add a method to return the total number of input FilterEffect's contributing to a FilterEffect.
3358         * rendering/svg/RenderSVGResourceFilter.cpp:
3359         (WebCore::RenderSVGResourceFilter::buildPrimitives):
3360         -- Do not build a filter if it has more than 200 FilterEffects in its map.
3361         (WebCore::RenderSVGResourceFilter::applyResource):
3362         -- Discard a filter after it was built if it has more than 100 FilterEffects in its tree.
3363
3364 2014-09-30  Christophe Dumez  <cdumez@apple.com>
3365
3366         Use is<>() / downcast<>() for ContainerNode
3367         https://bugs.webkit.org/show_bug.cgi?id=137270
3368
3369         Reviewed by Andreas Kling.
3370
3371         Use is<>() / downcast<>() for ContainerNode instead of isContainerNode()
3372         / toContainerNode(). Also kill the NODE_TYPE_CASTS() macro as this was
3373         its last user.
3374
3375         No new tests, no behavior change.
3376
3377         * dom/ContainerNode.cpp:
3378         (WebCore::collectChildrenAndRemoveFromOldParent):
3379         (WebCore::ContainerNode::willRemoveChild):
3380         (WebCore::cloneChildNodesAvoidingDeleteButton):
3381         * dom/ContainerNode.h:
3382         (WebCore::Node::countChildNodes):
3383         (WebCore::Node::traverseToChildAt):
3384         (WebCore::Node::firstChild):
3385         (WebCore::Node::lastChild):
3386         (isType):
3387         (WebCore::isContainerNode): Deleted.
3388         * dom/ContainerNodeAlgorithms.cpp:
3389         (WebCore::ChildNodeInsertionNotifier::notifyDescendantInsertedIntoTree):
3390         (WebCore::ChildNodeRemovalNotifier::notifyDescendantRemovedFromTree):
3391         * dom/ContainerNodeAlgorithms.h:
3392         (WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoDocument):
3393         (WebCore::ChildNodeInsertionNotifier::notify):
3394         (WebCore::ChildNodeRemovalNotifier::notifyNodeRemovedFromDocument):
3395         (WebCore::ChildNodeRemovalNotifier::notify):
3396         * dom/Node.cpp:
3397         (WebCore::Node::childNodes):
3398         (WebCore::Node::insertBefore):
3399         (WebCore::Node::replaceChild):
3400         (WebCore::Node::removeChild):
3401         (WebCore::Node::appendChild):
3402         (WebCore::Node::setTextContent):
3403         * dom/Node.h:
3404         * dom/Range.cpp:
3405         (WebCore::Range::surroundContents):