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