5760c1625e860df2ea0243dfd82d7831ff1ef981
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-09-09  Dewei Zhu  <dewei_zhu@apple.com>
2
3         Document.characterSet should return "UTF-8" instead of null by default.
4         https://bugs.webkit.org/show_bug.cgi?id=148810
5         <rdar://problem/22548727>
6
7         Reviewed by Ryosuke Niwa.
8
9         Document encoding should default to "UTF-8" as is specified in
10         https://dom.spec.whatwg.org/#concept-document-encoding. This behavior
11         is consistent with Firefox and Chrome.
12
13         * dom/Document.cpp:
14         (WebCore::Document::encoding): Returns nullAtom according to declearation.
15         (WebCore::Document::characterSetForBindings): Returns "UTF-8" by default instead of null String.
16         * dom/Document.h:
17         (WebCore::Document::charset):
18         (WebCore::Document::inputEncoding): Deleted.
19         (WebCore::Document::characterSet): Deleted.
20         * dom/Document.idl:
21         * dom/InlineStyleSheetOwner.cpp:
22         (WebCore::InlineStyleSheetOwner::createSheet):
23         * inspector/InspectorPageAgent.cpp:
24         (WebCore::InspectorPageAgent::mainResourceContent):
25         * inspector/InspectorResourceAgent.cpp:
26         (WebCore::InspectorResourceAgent::didFinishLoading):
27         (WebCore::InspectorResourceAgent::didFailLoading):
28         * loader/DocumentWriter.cpp:
29         (WebCore::DocumentWriter::createDecoderIfNeeded):
30         * loader/FormSubmission.cpp:
31         (WebCore::encodingFromAcceptCharset):
32
33 2015-09-09  Benjamin Poulain  <bpoulain@apple.com>
34
35         CSS general sibling selectors does not work without CSS JIT
36         https://bugs.webkit.org/show_bug.cgi?id=148987
37         rdar://problem/22559860
38
39         Reviewed by Andreas Kling.
40
41         When traversing with the indirect adjacent combinator, SelectorChecker
42         was not setting the style invalidation flag on the right element.
43
44         Tests: fast/css/indirect-adjacent-style-invalidation-1.html
45                fast/css/indirect-adjacent-style-invalidation-2.html
46                fast/css/indirect-adjacent-style-invalidation-3.html
47
48         * css/SelectorChecker.cpp:
49         (WebCore::SelectorChecker::matchRecursively):
50
51 2015-09-09  Joseph Pecoraro  <pecoraro@apple.com>
52
53         Web Inspector: Remove unused InspectorFrontendHost methods
54         https://bugs.webkit.org/show_bug.cgi?id=149013
55
56         Reviewed by Brian Burg.
57
58         * inspector/InspectorFrontendHost.cpp:
59         (WebCore::InspectorFrontendHost::canSaveAs): Deleted.
60         (WebCore::InspectorFrontendHost::canInspectWorkers): Deleted.
61         * inspector/InspectorFrontendHost.h:
62         * inspector/InspectorFrontendHost.idl:
63
64 2015-09-09  Myles C. Maxfield  <mmaxfield@apple.com>
65
66         ASSERTION FAILED: typesettingFeatures & (Kerning | Ligatures) in WebCore::applyFontTransforms
67         https://bugs.webkit.org/show_bug.cgi?id=146194
68
69         Reviewed by Dean Jackson.
70
71         We might trigger shaping even if the author hasn't specified kerning or ligatures.
72
73         Test: fast/text/softbank-emoji-no-ligatures-nor-kerning.html
74
75         * platform/graphics/WidthIterator.cpp:
76         (WebCore::isSoftBankEmoji):
77         (WebCore::WidthIterator::applyFontTransforms):
78         (WebCore::WidthIterator::advanceInternal):
79         (WebCore::applyFontTransforms): Deleted.
80         * platform/graphics/WidthIterator.h:
81
82 2015-09-09  Chris Dumez  <cdumez@apple.com>
83
84         Setting document.title when there is no title and no head element should no nothing
85         https://bugs.webkit.org/show_bug.cgi?id=149005
86         <rdar://problem/22567524>
87
88         Reviewed by Ryosuke Niwa.
89
90         Setting document.title when there is no title element and no head
91         element should no nothing:
92         - https://html.spec.whatwg.org/multipage/dom.html#document.title
93
94         Firefox and Chrome comply with the specification. However, WebKit
95         was returning the updated title when querying document.title after
96         setting it.
97
98         No new tests, covered by existing tests.
99
100         * dom/Document.cpp:
101         (WebCore::Document::setTitle):
102
103 2015-09-09  Manuel Rego Casasnovas  <rego@igalia.com>
104
105         [css-grid] Percentage columns shouldn't include border and padding
106         https://bugs.webkit.org/show_bug.cgi?id=148978
107
108         Reviewed by Sergio Villar Senin.
109
110         Subtract border and padding when we're calculating the breadth of the
111         columns in LayoutGrid::computeUsedBreadthOfSpecifiedLength().
112
113         Added test to check the behavior for both columns and rows.
114
115         Test: fast/css-grid-layout/grid-percent-track-margin-border-padding.html
116
117         * rendering/RenderGrid.cpp:
118         (WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
119
120 2015-09-09  Commit Queue  <commit-queue@webkit.org>
121
122         Unreviewed, rolling out r189536 and r189538.
123         https://bugs.webkit.org/show_bug.cgi?id=149002
124
125         broke tests on mac (Requested by alexchristensen on #webkit).
126
127         Reverted changesets:
128
129         "min-width/height should default to auto for flexbox items"
130         https://bugs.webkit.org/show_bug.cgi?id=146020
131         http://trac.webkit.org/changeset/189536
132
133         "[css-grid] Percentage columns shouldn't include border and
134         padding"
135         https://bugs.webkit.org/show_bug.cgi?id=148978
136         http://trac.webkit.org/changeset/189538
137
138 2015-09-08  David Hyatt  <hyatt@apple.com>
139
140         REGRESSION: Inline-block baseline is wrong when zero-width replaced child is present
141         https://bugs.webkit.org/show_bug.cgi?id=147452
142         rdar://problem/21943074
143
144         Reviewed by Myles Maxfield.
145
146         Added new test in fast/inline-block
147
148         Treat zero width replaced elements the same as replaced elements with width. Instead of
149         clearing floats based off having no committed width, we instead track both committed
150         width and committed replaced objects. We do this with two new booleans in LineWidth
151         so that we know when we have uncomitted and committed replaced objects.
152
153         * rendering/line/BreakingContext.h:
154         (WebCore::BreakingContext::handleReplaced):
155         (WebCore::BreakingContext::handleText):
156         (WebCore::BreakingContext::canBreakAtThisPosition):
157         (WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):
158         * rendering/line/LineWidth.cpp:
159         (WebCore::LineWidth::LineWidth):
160         (WebCore::LineWidth::commit):
161         (WebCore::LineWidth::applyOverhang):
162         * rendering/line/LineWidth.h:
163         (WebCore::LineWidth::committedWidth):
164         (WebCore::LineWidth::availableWidth):
165         (WebCore::LineWidth::logicalLeftOffset):
166         (WebCore::LineWidth::hasCommitted):
167         (WebCore::LineWidth::addUncommittedWidth):
168         (WebCore::LineWidth::addUncommittedReplacedWidth):
169
170 2015-09-09  Antti Koivisto  <antti@apple.com>
171
172         Split mixed font GlyphPage functionality to separate class
173         https://bugs.webkit.org/show_bug.cgi?id=148965
174
175         Reviewed by Myles Maxfield.
176
177         Currently GlyphPage class is used for both immutable single font case (in Font) and
178         for caching mixed font mappings (in FontCascadeFonts). It is cleaner to use separate
179         classed for these cases. This will also make future improvements easier.
180
181         * platform/graphics/Font.cpp:
182         (WebCore::Font::~Font):
183         (WebCore::fillGlyphPage):
184         (WebCore::createAndFillGlyphPage):
185         (WebCore::Font::glyphPage):
186         (WebCore::Font::glyphForCharacter):
187         (WebCore::Font::glyphDataForCharacter):
188         * platform/graphics/Font.h:
189         * platform/graphics/FontCascadeFonts.cpp:
190         (WebCore::MixedFontGlyphPage::MixedFontGlyphPage):
191         (WebCore::MixedFontGlyphPage::glyphDataForCharacter):
192         (WebCore::MixedFontGlyphPage::setGlyphDataForCharacter):
193         (WebCore::MixedFontGlyphPage::setGlyphDataForIndex):
194
195             Mixed font pages are now an implementation detail of FontCascadeFonts.
196
197         (WebCore::FontCascadeFonts::GlyphPageCacheEntry::glyphDataForCharacter):
198         (WebCore::FontCascadeFonts::GlyphPageCacheEntry::setGlyphDataForCharacter):
199         (WebCore::FontCascadeFonts::GlyphPageCacheEntry::setSingleFontPage):
200
201             Cache entry is either shared single font GlyphPage or mutable MixedFontGlyphPage.
202
203         (WebCore::FontCascadeFonts::FontCascadeFonts):
204         (WebCore::FontCascadeFonts::glyphDataForCharacter):
205         (WebCore::FontCascadeFonts::pruneSystemFallbacks):
206         * platform/graphics/FontCascadeFonts.h:
207         (WebCore::FontCascadeFonts::GlyphPageCacheEntry::isNull):
208         (WebCore::FontCascadeFonts::GlyphPageCacheEntry::isMixedFont):
209         * platform/graphics/GlyphPage.h:
210
211             GlyphPage is now for single font mappings only.
212             Use regular allocation instead of variable size tricks.
213             It is always immutable after initialization (though currently a setter is still needed).
214
215         (WebCore::GlyphPage::create):
216         (WebCore::GlyphPage::~GlyphPage):
217         (WebCore::GlyphPage::count):
218         (WebCore::GlyphPage::indexForCharacter):
219         (WebCore::GlyphPage::glyphDataForCharacter):
220         (WebCore::GlyphPage::glyphForCharacter):
221         (WebCore::GlyphPage::glyphDataForIndex):
222         (WebCore::GlyphPage::glyphForIndex):
223         (WebCore::GlyphPage::setGlyphForIndex):
224         (WebCore::GlyphPage::font):
225         (WebCore::GlyphPage::GlyphPage):
226         (WebCore::GlyphPage::createForMixedFonts): Deleted.
227         (WebCore::GlyphPage::createCopyForMixedFonts): Deleted.
228         (WebCore::GlyphPage::createForSingleFont): Deleted.
229         (WebCore::GlyphPage::isImmutable): Deleted.
230         (WebCore::GlyphPage::setImmutable): Deleted.
231         (WebCore::GlyphPage::glyphAt): Deleted.
232         (WebCore::GlyphPage::fontForCharacter): Deleted.
233         (WebCore::GlyphPage::setGlyphDataForCharacter): Deleted.
234         (WebCore::GlyphPage::setGlyphDataForIndex): Deleted.
235         (WebCore::GlyphPage::hasPerGlyphFontData): Deleted.
236         * platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp:
237         (WebCore::GlyphPage::fill):
238         * platform/graphics/mac/GlyphPageMac.cpp:
239         (WebCore::GlyphPage::fill):
240         * platform/graphics/opentype/OpenTypeVerticalData.cpp:
241         (WebCore::OpenTypeVerticalData::substituteWithVerticalGlyphs):
242         * platform/graphics/win/GlyphPageTreeNodeCGWin.cpp:
243         (WebCore::GlyphPage::fill):
244         * platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp:
245         (WebCore::GlyphPage::fill):
246         * svg/SVGFontData.cpp:
247         (WebCore::SVGFontData::applySVGGlyphSelection):
248         (WebCore::SVGFontData::fillSVGGlyphPage):
249         (WebCore::SVGFontData::fillBMPGlyphs):
250         (WebCore::SVGFontData::fillNonBMPGlyphs):
251         * svg/SVGFontData.h:
252         (WebCore::SVGFontData::verticalAdvanceY):
253
254 2015-09-09  Manuel Rego Casasnovas  <rego@igalia.com>
255
256         [css-grid] Percentage columns shouldn't include border and padding
257         https://bugs.webkit.org/show_bug.cgi?id=148978
258
259         Reviewed by Sergio Villar Senin.
260
261         Subtract border and padding when we're calculating the breadth of the
262         columns in LayoutGrid::computeUsedBreadthOfSpecifiedLength().
263
264         Added test to check the behavior for both columns and rows.
265
266         Test: fast/css-grid-layout/grid-percent-track-margin-border-padding.html
267
268         * rendering/RenderGrid.cpp:
269         (WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
270
271 2015-09-09  Chris Dumez  <cdumez@apple.com>
272
273         HTMLTableElement.tHead / tFoot / caption should be nullable
274         https://bugs.webkit.org/show_bug.cgi?id=148991
275
276         Reviewed by Ryosuke Niwa.
277
278         According to the specification, HTMLTableElement.tHead / tFoot / caption
279         should be nullable:
280         https://html.spec.whatwg.org/multipage/tables.html#htmltableelement
281
282         Upon assigning null, we are supposed to remove the existing tHead / tFoot
283         / caption element. However, we had a bug causing us to throw an exception
284         after removing the element. This is because we would try to insert a null
285         element and ContainerNode::insertBefore() throws when doing so.
286
287         Also, as per the specification, setting tHead / tFoot to something else
288         than a thead / tfoot element should throw a HierarchyRequestError:
289         https://html.spec.whatwg.org/multipage/tables.html#dom-table-thead
290         https://html.spec.whatwg.org/multipage/tables.html#dom-table-tfoot
291
292         Previously, WebKit did not check the tag and was happy inserting the
293         element as long as it was an HTMLTableSectionElement. This means that
294         you could set a tfoot by assigning table.tHead.
295
296         This patch corrects both bugs and adds test coverage for it.
297
298         Test: fast/dom/HTMLTableElement/nullable-attributes.html
299
300         * html/HTMLTableElement.cpp:
301         (WebCore::HTMLTableElement::setCaption):
302         Only call insertBefore() if newCaption is not null as insertBefore()
303         will throw an exception otherwise.
304
305         (WebCore::HTMLTableElement::setTHead):
306         - Throw a HierarchyRequestError if the HTMLTableSectionElement is not
307           null or a <thead> element, as per the specification.
308         - Only call insertBefore() if newHead is not null as insertBefore()
309           will throw an exception otherwise.
310
311         (WebCore::HTMLTableElement::setTFoot):
312         - Throw a HierarchyRequestError if the HTMLTableSectionElement is not
313           null or a <tfoot> element, as per the specification.
314         - Only call insertBefore() if newFoot is not null as insertBefore()
315           will throw an exception otherwise.
316
317         * html/HTMLTableElement.idl:
318         Use [StrictTypeChecking] for these 3 attributes so that the bindings
319         will throw a TypeError if the JS tries to assign a value with the
320         wrong type. When the implementation is called with null, we now know
321         this is because the JS assigned null (and not an invalid value).
322         This is important as assigning null is valid since those attributes
323         are nullable.
324
325 2015-06-26  Sergio Villar Senin  <svillar@igalia.com>
326
327         min-width/height should default to auto for flexbox items
328         https://bugs.webkit.org/show_bug.cgi?id=146020
329
330         Reviewed by David Hyatt.
331
332         Based on Blink's r193665, r194062, r194887 and r195930 by <cbiesinger@chromium.org>.
333
334         As specified here
335         http://dev.w3.org/csswg/css-flexbox/#min-size-auto the default
336         value of min-{width|height} is auto for flex items.
337
338         In case this patch breaks any website (as it's changing the
339         default value of those properties) the fix is likely to add:
340
341         min-width: 0;
342         min-height: 0;
343
344         to any relevant flexitems.
345
346         Test: css3/flexbox/min-size-auto.html
347
348         * css/CSSComputedStyleDeclaration.cpp:
349         (WebCore::isFlexOrGrid): New helper method to identify grids and flexs.
350         (WebCore::ComputedStyleExtractor::propertyValue): Return auto
351         for flex items if min-width/height is auto.
352         * css/CSSParser.cpp:
353         (WebCore::CSSParser::parseValue):
354         * html/shadow/SliderThumbElement.cpp:
355         * rendering/RenderBox.cpp:
356         (WebCore::RenderBox::constrainLogicalHeightByMinMax):
357         (WebCore::RenderBox::constrainContentBoxLogicalHeightByMinMax):
358         (WebCore::RenderBox::computeLogicalWidthInRegionUsing):
359         (WebCore::RenderBox::computeLogicalHeight):
360         (WebCore::RenderBox::computeLogicalHeightUsing):
361         (WebCore::RenderBox::computeContentLogicalHeight):
362         (WebCore::RenderBox::computeContentAndScrollbarLogicalHeightUsing):
363         (WebCore::RenderBox::computeReplacedLogicalWidth):
364         (WebCore::RenderBox::computeReplacedLogicalWidthRespectingMinMaxWidth):
365         (WebCore::RenderBox::computeReplacedLogicalWidthUsing):
366         (WebCore::RenderBox::computeReplacedLogicalHeight):
367         (WebCore::RenderBox::computeReplacedLogicalHeightRespectingMinMaxHeight):
368         (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
369         (WebCore::RenderBox::availableLogicalHeightUsing):
370         (WebCore::RenderBox::computePositionedLogicalWidth):
371         (WebCore::RenderBox::computePositionedLogicalWidthUsing):
372         (WebCore::RenderBox::computePositionedLogicalHeight):
373         (WebCore::RenderBox::computePositionedLogicalHeightUsing):
374         * rendering/RenderBox.h:
375         * rendering/RenderButton.h:
376         * rendering/RenderFlexibleBox.cpp:
377         (WebCore::RenderFlexibleBox::computeMainAxisExtentForChild):
378         (WebCore::RenderFlexibleBox::mainAxisExtentIsDefinite):
379         (WebCore::RenderFlexibleBox::mainAxisLengthIsIndefinite):
380         (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
381         (WebCore::RenderFlexibleBox::mainAxisOverflowForChild):
382         * rendering/RenderFlexibleBox.h:
383         (WebCore::RenderFlexibleBox::isFlexibleBoxImpl):
384         * rendering/RenderFullScreen.h:
385         * rendering/RenderGrid.cpp:
386         (WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
387         * rendering/RenderMediaControlElements.h:
388         * rendering/RenderMenuList.cpp:
389         (WebCore::RenderMenuList::adjustInnerStyle): Do not longer set
390         the min-width explicitly.
391         * rendering/RenderMenuList.h:
392         * rendering/RenderMultiColumnSet.cpp:
393         (WebCore::RenderMultiColumnSet::calculateMaxColumnHeight):
394         * rendering/RenderNamedFlowFragment.cpp:
395         (WebCore::RenderNamedFlowFragment::maxPageLogicalHeight):
396         * rendering/RenderReplaced.cpp:
397         (WebCore::RenderReplaced::computeReplacedLogicalWidth):
398         (WebCore::RenderReplaced::computeReplacedLogicalHeight):
399         * rendering/RenderSlider.h:
400         * rendering/RenderTextControl.h:
401         * rendering/RenderTextControlSingleLine.cpp:
402         (WebCore::RenderTextControlSingleLine::createInnerBlockStyle): Do not longer set
403         the min-width explicitly.
404         * rendering/mathml/RenderMathMLBlock.h:
405         * rendering/style/RenderStyle.h:
406
407 2015-09-08  Joseph Pecoraro  <pecoraro@apple.com>
408
409         Web Inspector: No need for [Custom] Implementation of some InspectorFrontendHost methods
410         https://bugs.webkit.org/show_bug.cgi?id=148990
411
412         Reviewed by Timothy Hatcher.
413
414         * bindings/js/JSInspectorFrontendHostCustom.cpp:
415         (WebCore::JSInspectorFrontendHost::platform): Deleted.
416         (WebCore::JSInspectorFrontendHost::port): Deleted.
417         * inspector/InspectorFrontendHost.cpp:
418         (WebCore::InspectorFrontendHost::platform):
419         (WebCore::InspectorFrontendHost::port):
420         * inspector/InspectorFrontendHost.h:
421         * inspector/InspectorFrontendHost.idl:
422         Uncustomize a few basic functions.
423
424 2015-09-08  Michael Catanzaro  <mcatanzaro@igalia.com>
425
426         Crash when WebCore::SQLiteFileSystem::openDatabase is called from multiple threads
427         https://bugs.webkit.org/show_bug.cgi?id=143245
428
429         Reviewed by Darin Adler.
430
431         sqlite3_initialize is documented to be thread-safe, and to be called automatically by the
432         library when needed, so applications should never need to call it directly. The problem is,
433         it's not thread-safe: we have documented instances of GNOME Builder, Devhelp, Epiphany, and
434         cinnamon-screensaver crashing when sqlite3_initialize is called simultaneously in separate
435         threads (usually inside sqlite3_open). So call it manually, guarded using std::call_once, to
436         make sure that the library is fully initialized before the first call to sqlite3_open. It's
437         a good idea to do this regardless, because the documentation says it could be required in
438         a future release of SQLite. (Though the use of std::call_once should not be needed, and is
439         only used to attempt to work around the crashes.)
440
441         This is a workaround for an SQLite bug that might have been fixed upstream, but the SQLite
442         developers are not really confident in the thread-safety of this function, and have advised
443         that we carry the workaround. Seems like a good idea.
444
445         * platform/sql/SQLiteDatabase.cpp:
446         (WebCore::SQLiteDatabase::SQLiteDatabase):
447
448 2015-09-08  Yusuke Suzuki  <utatane.tea@gmail.com>
449
450         Unify symbolTablePut in JSLexicalEnvironment and JSSymbolTableObject
451         https://bugs.webkit.org/show_bug.cgi?id=148783
452
453         Reviewed by Geoffrey Garen.
454
455         No behavior change.
456
457         * bindings/js/JSDOMWindowBase.cpp:
458         (WebCore::JSDOMWindowBase::updateDocument):
459
460 2015-09-08  Brian Burg  <bburg@apple.com>
461
462         Several inspector-protocol tests are flaky with GuardMalloc
463         https://bugs.webkit.org/show_bug.cgi?id=136715
464
465         Reviewed by Joseph Pecoraro.
466
467         Sometimes, the async dispatch task can outlive its owning frontend client.
468         To avoid problems, make it refcounted instead and add a protector reference.
469
470         No new tests, covered by existing tests.
471
472         * inspector/InspectorFrontendClientLocal.cpp:
473         (WebCore::InspectorBackendDispatchTask::create):
474         (WebCore::InspectorBackendDispatchTask::dispatch):
475         (WebCore::InspectorBackendDispatchTask::reset):
476         (WebCore::InspectorBackendDispatchTask::timerFired):
477         (WebCore::InspectorBackendDispatchTask::InspectorBackendDispatchTask):
478         (WebCore::InspectorFrontendClientLocal::InspectorFrontendClientLocal):
479         (WebCore::InspectorFrontendClientLocal::~InspectorFrontendClientLocal):
480         * inspector/InspectorFrontendClientLocal.h:
481
482 2015-09-08  Chris Dumez  <cdumez@apple.com>
483
484         new Comment(undefined) / new Text(undefined) should use default's empty string
485         https://bugs.webkit.org/show_bug.cgi?id=148973
486         <rdar://problem/22548042>
487
488         Reviewed by Ryosuke Niwa.
489
490         new Comment(undefined) / new Text(undefined) should use default's empty string instead of converting
491         undefined to the "undefined" string:
492         - https://dom.spec.whatwg.org/#interface-comment (parameter is optional, default value is empty String)
493         - https://dom.spec.whatwg.org/#text (ditto)
494
495         undefined should be treated as if the parameter is missing, in the case the parameter is optional, as
496         per the Web IDL specification. This patch aligns WebKit's behavior with the specification and the
497         behavior of Firefox and Chrome.
498
499         No new tests, already covered by existing tests.
500
501         * bindings/scripts/CodeGeneratorJS.pm:
502         (GenerateParametersCheck):
503         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
504         (WebCore::JSTestNamedConstructorNamedConstructor::constructJSTestNamedConstructor):
505         * bindings/scripts/test/JS/JSTestObj.cpp:
506         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsNullString):
507
508 2015-09-08  Chris Dumez  <cdumez@apple.com>
509
510         document.importNode(node, deep): deep's default value should be false
511         https://bugs.webkit.org/show_bug.cgi?id=148959
512         <rdar://problem/22558915>
513
514         Reviewed by Alexey Proskuryakov.
515
516         Switch deep parameter's default value for document.importNode() to
517         false, as per the latest DOM specification:
518         - https://dom.spec.whatwg.org/#interface-document
519         - https://dom.spec.whatwg.org/#dom-document-importnode
520
521         Firefox and Chrome follow the specification. However, WebKit was using
522         "true" for deep's default value.
523
524         No new tests, already covered by:
525         imported/w3c/web-platform-tests/dom/nodes/Document-importNode.html
526
527         * dom/Document.h:
528         (WebCore::Document::importNode):
529
530 2015-09-08  Per Arne Vollan  <peavo@outlook.com>
531
532         [Win][HighDPI] Video window placement is incorrect.
533         https://bugs.webkit.org/show_bug.cgi?id=148954
534
535         Reviewed by Alex Christensen.
536
537         We need to scale window dimensions with device scale factor.
538
539         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
540         (WebCore::MediaPlayerPrivateMediaFoundation::setSize):
541
542 2015-09-08  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
543
544         Reduce uses of PassRefPtr in fileapi
545         https://bugs.webkit.org/show_bug.cgi?id=148952
546
547         Reviewed by Andreas Kling.
548
549         Remove all uses of PassRefPtr in return type. Argument uses of PassRefPtr will be
550         removed in near future.
551
552         * fileapi/FileError.h:
553         (WebCore::FileError::create):
554         * fileapi/FileReader.cpp:
555         (WebCore::FileReader::arrayBufferResult):
556         * fileapi/FileReader.h:
557         * fileapi/FileReaderLoader.cpp:
558         (WebCore::FileReaderLoader::arrayBufferResult):
559         * fileapi/FileReaderLoader.h:
560         * fileapi/FileReaderSync.cpp:
561         (WebCore::FileReaderSync::readAsArrayBuffer):
562         * fileapi/FileReaderSync.h:
563         * fileapi/ThreadableBlobRegistry.cpp:
564         (WebCore::ThreadableBlobRegistry::getCachedOrigin):
565         * fileapi/ThreadableBlobRegistry.h:
566
567 2015-09-07  Chris Fleizach  <cfleizach@apple.com>
568
569         AX: Mavericks: Text cursor does not move along with VoiceOver cursor for text fields
570         https://bugs.webkit.org/show_bug.cgi?id=148891
571
572         Reviewed by Mario Sanchez Prada.
573
574         Undo the asynchronous dispatch of accessibility setting values on pre El Capitan machines
575         because it causes focus to not sync correctly.
576
577         Test: accessibility/mac/focus-moves-cursor.html
578
579         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
580         (-[WebAccessibilityObjectWrapper accessibilitySetValue:forAttribute:]):
581         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
582
583 2015-09-07  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
584
585         [CoordinatedGraphics] Remove ScrollingStateScrollingNodeCoordinatedGraphics.cpp
586         https://bugs.webkit.org/show_bug.cgi?id=148931
587
588         Reviewed by Csaba Osztrogonác.
589
590         ScrollingStateScrollingNodeCoordinatedGraphics.cpp implements nothing. Removed it.
591
592         * PlatformEfl.cmake:
593         * PlatformGTK.cmake:
594         * WebCore.vcxproj/WebCore.vcxproj:
595         * WebCore.vcxproj/WebCore.vcxproj.filters:
596         * page/scrolling/coordinatedgraphics/ScrollingStateScrollingNodeCoordinatedGraphics.cpp: Removed.
597
598 2015-09-07  Daniel Bates  <dabates@apple.com>
599
600         ASSERT_WITH_SECURITY_IMPLICATION in WebCore::DocumentOrderedMap::get(); update form
601         association after subtree insertion
602         https://bugs.webkit.org/show_bug.cgi?id=148919
603         <rdar://problem/21868036>
604
605         Reviewed by Andy Estes.
606
607         Currently we update the form association of a form control upon insertion into
608         the document. Instead we should update the form association of a form control
609         after its containing subtree is inserted into the document to avoid an assertion
610         failure when the containing subtree has an element whose id is identical to both
611         the id of some other element in the document and the name of the form referenced
612         by the inserted form control.
613
614         Tests: fast/forms/update-form-owner-in-moved-subtree-assertion-failure-2.html
615                fast/forms/update-form-owner-in-moved-subtree-assertion-failure-3.html
616                fast/forms/update-form-owner-in-moved-subtree-assertion-failure-4.html
617                fast/forms/update-form-owner-in-moved-subtree-assertion-failure.html
618
619         * html/FormAssociatedElement.cpp:
620         (WebCore::FormAssociatedElement::insertedInto): Moved resetFormOwner() from here
621         to {HTMLFormControlElement, HTMLObjectElement}::finishedInsertingSubtree().
622         * html/HTMLFormControlElement.cpp:
623         (WebCore::HTMLFormControlElement::insertedInto): Return InsertionShouldCallFinishedInsertingSubtree
624         so that HTMLFormControlElement::finishedInsertingSubtree() is called.
625         (WebCore::HTMLFormControlElement::finishedInsertingSubtree): Added; turn around and
626         call FormAssociatedElement::resetFormOwner().
627         * html/HTMLFormControlElement.h:
628         * html/HTMLInputElement.cpp:
629         (WebCore::HTMLInputElement::insertedInto): Return InsertionShouldCallFinishedInsertingSubtree so
630         that HTMLInputElement::finishedInsertingSubtree() is called and move logic to update radio button
631         group from here...
632         (WebCore::HTMLInputElement::finishedInsertingSubtree): to here.
633         * html/HTMLInputElement.h:
634         * html/HTMLObjectElement.cpp:
635         (WebCore::HTMLObjectElement::insertedInto): Return InsertionShouldCallFinishedInsertingSubtree so
636         that HTMLObjectElement::finishedInsertingSubtree() is called.
637         (WebCore::HTMLObjectElement::finishedInsertingSubtree): Added; turn around and
638         call FormAssociatedElement::resetFormOwner().
639         * html/HTMLObjectElement.h:
640         * html/HTMLSelectElement.cpp:
641         (WebCore::HTMLSelectElement::insertedInto): Modified to return the result of
642         HTMLFormControlElementWithState::insertedInto(), which may schedule a callback after subtree
643         insertion.
644         * html/HTMLTextFormControlElement.cpp:
645         (WebCore::HTMLTextFormControlElement::insertedInto): Ditto.
646
647 2015-09-07  Antti Koivisto  <antti@apple.com>
648
649         Remove GlyphPage::mayUseMixedFontsWhenFilling
650         https://bugs.webkit.org/show_bug.cgi?id=148928
651
652         Reviewed by Dan Bernstein.
653
654         http://trac.webkit.org/188566 removed support for composite fonts. We never need to use mixed
655         glyph pages for fonts anymore.
656
657         * platform/graphics/Font.cpp:
658         (WebCore::createAndFillGlyphPage):
659         * platform/graphics/GlyphPage.h:
660         (WebCore::GlyphPage::GlyphPage):
661         (WebCore::GlyphPage::mayUseMixedFontsWhenFilling): Deleted.
662         * platform/graphics/mac/GlyphPageMac.cpp:
663         (WebCore::shouldUseCoreText):
664         (WebCore::GlyphPage::fill):
665         (WebCore::GlyphPage::mayUseMixedFontsWhenFilling): Deleted.
666
667 2015-09-07  Antti Koivisto  <antti@apple.com>
668
669         Remove unneeded offset and length arguments from glyph page filling functions
670         https://bugs.webkit.org/show_bug.cgi?id=148929
671
672         Reviewed by Andreas Kling.
673
674         They are always passed 0/GlyphPage::size.
675
676         * platform/graphics/Font.cpp:
677         (WebCore::Font::~Font):
678         (WebCore::fillGlyphPage):
679         (WebCore::createAndFillGlyphPage):
680         * platform/graphics/Font.h:
681         * platform/graphics/GlyphPage.h:
682         (WebCore::GlyphPage::setGlyphDataForIndex):
683         * platform/graphics/mac/GlyphPageMac.cpp:
684         (WebCore::GlyphPage::mayUseMixedFontsWhenFilling):
685         (WebCore::GlyphPage::fill):
686         * platform/graphics/win/GlyphPageTreeNodeCGWin.cpp:
687         (WebCore::GlyphPage::fill):
688         * platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp:
689         (WebCore::GlyphPage::fill):
690         * svg/SVGFontData.cpp:
691         (WebCore::SVGFontData::applySVGGlyphSelection):
692         (WebCore::SVGFontData::fillSVGGlyphPage):
693         (WebCore::SVGFontData::fillBMPGlyphs):
694         (WebCore::SVGFontData::fillNonBMPGlyphs):
695         * svg/SVGFontData.h:
696         (WebCore::SVGFontData::verticalAdvanceY):
697
698 2015-09-06  Chris Dumez  <cdumez@apple.com>
699
700         dispatchEvent() should throw an InvalidStateError if the event's initialized flag is not set
701         https://bugs.webkit.org/show_bug.cgi?id=148800
702         <rdar://problem/22565782>
703         <rdar://problem/22565485>
704
705         Reviewed by Geoffrey Garen.
706
707         dispatchEvent() should throw an InvalidStateError if the event's
708         initialized flag is not set or its dispatch flag is set, and should
709         allow dispatching events with an empty type as long as it is
710         initialized:
711         https://dom.spec.whatwg.org/#dom-eventtarget-dispatchevent (step 1)
712
713         Previously, WebKit relied on the event type being empty to throw a
714         UNSPECIFIED_EVENT_TYPE_ERR: DOM Events Exception 0. However, this
715         exception type is outdated and initializing Event.type to an empty
716         string is legal.
717
718         No new tests, already covered by existing tests that were rebaselined.
719
720         * dom/Event.cpp:
721         (WebCore::Event::Event):
722         (WebCore::Event::initEvent):
723         * dom/Event.h:
724         (WebCore::Event::isInitialized):
725         * dom/EventTarget.cpp:
726         (WebCore::EventTarget::dispatchEvent):
727
728 2015-09-06  Youenn Fablet  <youenn.fablet@crf.canon.fr>
729
730         XHR2 timeout property should allow late updates
731         https://bugs.webkit.org/show_bug.cgi?id=98156
732
733         Reviewed by Darin Adler.
734
735         Adding a timer within XMLHttpRequest to handle timeouts for asynchronous requests.
736         This allows easy update of the timeout even after request is sent.
737         Timeout is still handled by the network backend for synchronous requests (Web worker context).
738
739         Covered by updated tests.
740
741         * xml/XMLHttpRequest.cpp:
742         (WebCore::XMLHttpRequest::XMLHttpRequest): Adding timeout timer initialization.
743         (WebCore::XMLHttpRequest::setTimeout): Updating timeout timer state if request is sent.
744         (WebCore::XMLHttpRequest::createRequest): Starting timeout timer if needed.
745         (WebCore::XMLHttpRequest::internalAbort): Stopping timeout timer if needed.
746         (WebCore::XMLHttpRequest::didFail): Adding comment.
747         (WebCore::XMLHttpRequest::didFinishLoading): Stopping timeout timer if needed.
748         * xml/XMLHttpRequest.h:
749
750 2015-09-05  Jaehun Lim  <ljaehun.lim@samsung.com>
751
752         Remove unused macros from StyleResolver.cpp
753         https://bugs.webkit.org/show_bug.cgi?id=148163
754
755         Reviewed by Andreas Kling.
756
757         HANDLE_INHERIT and HANDLE_INHERIT_AND_INITIAL are not used after
758         StyleBuilder refactoring.
759
760         No new tests because there is no behavior change.
761
762         * css/StyleResolver.cpp:
763         Remove HANDLE_INHERIT and HANDLE_INHERIT_AND_INITIAL.
764
765 2015-09-05  Brian Burg  <bburg@apple.com>
766
767         Web Inspector: tighten up lifetimes for Agent-owned objects, and initialize agents using contexts
768         https://bugs.webkit.org/show_bug.cgi?id=148625
769
770         Reviewed by Joseph Pecoraro.
771
772         All agents own their domain-specific frontend and backend dispatchers. Change so that
773         they are initialized in constructors rather than when a frontend connects or disconnects.
774         This may cause additional memory use, but this can be counteracted by lazily creating
775         some agents that are not required for other agents to function (i.e., runtime and page agents).
776
777         To avoid adding frontend/backend dispatcher arguments to every single agent constructor,
778         change agent construction to take a AgentContext or a subclass of it. This provides agents with
779         references to objects in the owning InspectorEnvironment subclass that are guaranteed to
780         outlive all agents. AgentContext and its subclasses follow the existing Agent class hierarchy.
781
782         No new tests, no behavior changed.
783
784         * bindings/js/WorkerScriptDebugServer.cpp:
785         (WebCore::WorkerScriptDebugServer::WorkerScriptDebugServer):
786         (WebCore::WorkerScriptDebugServer::addListener):
787         (WebCore::WorkerScriptDebugServer::removeListener):
788         (WebCore::WorkerScriptDebugServer::runEventLoopWhilePaused):
789         * bindings/js/WorkerScriptDebugServer.h:
790         * inspector/InspectorApplicationCacheAgent.cpp:
791         (WebCore::InspectorApplicationCacheAgent::InspectorApplicationCacheAgent):
792         (WebCore::InspectorApplicationCacheAgent::didCreateFrontendAndBackend):
793         (WebCore::InspectorApplicationCacheAgent::getFramesWithManifests):
794         (WebCore::InspectorApplicationCacheAgent::willDestroyFrontendAndBackend):
795         * inspector/InspectorApplicationCacheAgent.h:
796         * inspector/InspectorCSSAgent.cpp:
797         (WebCore::InspectorCSSAgent::InspectorCSSAgent):
798         (WebCore::InspectorCSSAgent::didCreateFrontendAndBackend):
799         (WebCore::InspectorCSSAgent::willDestroyFrontendAndBackend):
800         * inspector/InspectorCSSAgent.h:
801         * inspector/InspectorController.cpp:
802         (WebCore::InspectorController::InspectorController):
803         * inspector/InspectorDOMAgent.cpp:
804         (WebCore::InspectorDOMAgent::InspectorDOMAgent):
805         (WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
806         (WebCore::InspectorDOMAgent::willDestroyFrontendAndBackend):
807         * inspector/InspectorDOMAgent.h:
808         * inspector/InspectorDOMDebuggerAgent.cpp:
809         (WebCore::InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent):
810         (WebCore::InspectorDOMDebuggerAgent::didCreateFrontendAndBackend):
811         (WebCore::InspectorDOMDebuggerAgent::willDestroyFrontendAndBackend):
812         * inspector/InspectorDOMDebuggerAgent.h:
813         * inspector/InspectorDOMStorageAgent.cpp:
814         (WebCore::InspectorDOMStorageAgent::InspectorDOMStorageAgent):
815         (WebCore::InspectorDOMStorageAgent::didCreateFrontendAndBackend):
816         (WebCore::InspectorDOMStorageAgent::findStorageArea):
817         (WebCore::InspectorDOMStorageAgent::willDestroyFrontendAndBackend):
818         * inspector/InspectorDOMStorageAgent.h:
819         * inspector/InspectorDatabaseAgent.cpp:
820         (WebCore::InspectorDatabaseAgent::InspectorDatabaseAgent):
821         (WebCore::InspectorDatabaseAgent::didCreateFrontendAndBackend):
822         (WebCore::InspectorDatabaseAgent::willDestroyFrontendAndBackend):
823         * inspector/InspectorDatabaseAgent.h:
824         * inspector/InspectorIndexedDBAgent.cpp:
825         (WebCore::InspectorIndexedDBAgent::InspectorIndexedDBAgent):
826         (WebCore::InspectorIndexedDBAgent::didCreateFrontendAndBackend):
827         (WebCore::InspectorIndexedDBAgent::willDestroyFrontendAndBackend):
828         * inspector/InspectorIndexedDBAgent.h:
829         * inspector/InspectorInstrumentation.cpp:
830         (WebCore::InspectorInstrumentation::didClearWindowObjectInWorldImpl):
831         * inspector/InspectorLayerTreeAgent.cpp:
832         (WebCore::InspectorLayerTreeAgent::InspectorLayerTreeAgent):
833         (WebCore::InspectorLayerTreeAgent::didCreateFrontendAndBackend):
834         (WebCore::InspectorLayerTreeAgent::willDestroyFrontendAndBackend):
835         * inspector/InspectorLayerTreeAgent.h:
836         * inspector/InspectorPageAgent.cpp:
837         (WebCore::InspectorPageAgent::InspectorPageAgent):
838         (WebCore::InspectorPageAgent::didCreateFrontendAndBackend):
839         (WebCore::InspectorPageAgent::enable):
840         (WebCore::InspectorPageAgent::reload):
841         (WebCore::InspectorPageAgent::navigate):
842         (WebCore::InspectorPageAgent::getCookies):
843         (WebCore::InspectorPageAgent::deleteCookie):
844         (WebCore::InspectorPageAgent::getResourceTree):
845         (WebCore::InspectorPageAgent::searchInResources):
846         (WebCore::InspectorPageAgent::getScriptExecutionStatus):
847         (WebCore::InspectorPageAgent::setScriptExecutionDisabled):
848         (WebCore::InspectorPageAgent::mainFrame):
849         (WebCore::InspectorPageAgent::findFrameWithSecurityOrigin):
850         (WebCore::InspectorPageAgent::buildObjectForFrame):
851         (WebCore::InspectorPageAgent::buildObjectForFrameTree):
852         (WebCore::InspectorPageAgent::setEmulatedMedia):
853         (WebCore::InspectorPageAgent::getCompositingBordersVisible):
854         (WebCore::InspectorPageAgent::setCompositingBordersVisible):
855         (WebCore::InspectorPageAgent::snapshotNode):
856         (WebCore::InspectorPageAgent::snapshotRect):
857         (WebCore::InspectorPageAgent::archive):
858         (WebCore::InspectorPageAgent::willDestroyFrontendAndBackend):
859         * inspector/InspectorPageAgent.h:
860         * inspector/InspectorReplayAgent.cpp:
861         (WebCore::InspectorReplayAgent::InspectorReplayAgent):
862         (WebCore::InspectorReplayAgent::didCreateFrontendAndBackend):
863         (WebCore::InspectorReplayAgent::willDestroyFrontendAndBackend):
864         * inspector/InspectorReplayAgent.h:
865         * inspector/InspectorResourceAgent.cpp:
866         (WebCore::InspectorResourceAgent::InspectorResourceAgent):
867         (WebCore::InspectorResourceAgent::didCreateFrontendAndBackend):
868         (WebCore::InspectorResourceAgent::willDestroyFrontendAndBackend):
869         * inspector/InspectorResourceAgent.h:
870         * inspector/InspectorTimelineAgent.cpp:
871         (WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend):
872         (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
873         (WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
874         (WebCore::InspectorTimelineAgent::page):
875         * inspector/InspectorTimelineAgent.h:
876         * inspector/InspectorWebAgentBase.h:
877         (WebCore::WebAgentContext::WebAgentContext):
878         (WebCore::PageAgentContext::PageAgentContext):
879         (WebCore::WorkerAgentContext::WorkerAgentContext):
880         (WebCore::InspectorAgentBase::InspectorAgentBase):
881         * inspector/InspectorWorkerAgent.cpp:
882         (WebCore::InspectorWorkerAgent::InspectorWorkerAgent):
883         (WebCore::InspectorWorkerAgent::didCreateFrontendAndBackend):
884         (WebCore::InspectorWorkerAgent::willDestroyFrontendAndBackend):
885         * inspector/InspectorWorkerAgent.h:
886         * inspector/PageConsoleAgent.cpp:
887         (WebCore::PageConsoleAgent::PageConsoleAgent):
888         * inspector/PageConsoleAgent.h:
889         * inspector/PageDebuggerAgent.cpp:
890         (WebCore::PageDebuggerAgent::PageDebuggerAgent):
891         (WebCore::PageDebuggerAgent::sourceMapURLForScript):
892         (WebCore::PageDebuggerAgent::breakpointActionLog):
893         (WebCore::PageDebuggerAgent::injectedScriptForEval):
894         * inspector/PageDebuggerAgent.h:
895         * inspector/PageRuntimeAgent.cpp:
896         (WebCore::PageRuntimeAgent::PageRuntimeAgent):
897         (WebCore::PageRuntimeAgent::didCreateFrontendAndBackend):
898         (WebCore::PageRuntimeAgent::injectedScriptForEval):
899         (WebCore::PageRuntimeAgent::reportExecutionContextCreation):
900         (WebCore::PageRuntimeAgent::willDestroyFrontendAndBackend):
901         * inspector/PageRuntimeAgent.h:
902         * inspector/WebConsoleAgent.cpp:
903         (WebCore::WebConsoleAgent::WebConsoleAgent):
904         * inspector/WebConsoleAgent.h:
905         * inspector/WebDebuggerAgent.cpp:
906         (WebCore::WebDebuggerAgent::WebDebuggerAgent):
907         * inspector/WebDebuggerAgent.h:
908         * inspector/WorkerConsoleAgent.cpp:
909         (WebCore::WorkerConsoleAgent::WorkerConsoleAgent):
910         * inspector/WorkerConsoleAgent.h:
911         * inspector/WorkerDebuggerAgent.cpp:
912         (WebCore::WorkerDebuggerAgent::WorkerDebuggerAgent):
913         (WebCore::WorkerDebuggerAgent::~WorkerDebuggerAgent):
914         (WebCore::WorkerDebuggerAgent::interruptAndDispatchInspectorCommands):
915         (WebCore::WorkerDebuggerAgent::breakpointActionLog):
916         (WebCore::WorkerDebuggerAgent::injectedScriptForEval):
917         * inspector/WorkerDebuggerAgent.h:
918         * inspector/WorkerInspectorController.cpp:
919         (WebCore::WorkerInspectorController::WorkerInspectorController):
920         * inspector/WorkerRuntimeAgent.cpp:
921         (WebCore::WorkerRuntimeAgent::WorkerRuntimeAgent):
922         (WebCore::WorkerRuntimeAgent::didCreateFrontendAndBackend):
923         (WebCore::WorkerRuntimeAgent::injectedScriptForEval):
924         (WebCore::WorkerRuntimeAgent::willDestroyFrontendAndBackend):
925         * inspector/WorkerRuntimeAgent.h:
926
927 2015-09-04  Brian Burg  <bburg@apple.com>
928
929         Web Inspector: agents should send messages through FrontendRouter instead of FrontendChannel
930         https://bugs.webkit.org/show_bug.cgi?id=148492
931
932         Reviewed by Joseph Pecoraro.
933
934         Replace uses of FrontendChannel with FrontendRouter. Minor code cleanup along the way.
935
936         No new tests, no behavior changed.
937
938         * WebCore.vcxproj/WebCore.vcxproj:
939         * WebCore.vcxproj/WebCore.vcxproj.filters:
940         * WebCore.xcodeproj/project.pbxproj:
941         * inspector/InspectorApplicationCacheAgent.cpp:
942         (WebCore::InspectorApplicationCacheAgent::didCreateFrontendAndBackend):
943         * inspector/InspectorApplicationCacheAgent.h:
944         * inspector/InspectorCSSAgent.cpp:
945         (WebCore::InspectorCSSAgent::didCreateFrontendAndBackend):
946         * inspector/InspectorCSSAgent.h:
947         * inspector/InspectorController.cpp:
948         (WebCore::InspectorController::connectFrontend):
949         (WebCore::InspectorController::~InspectorController): No need to call discardAgents().
950         * inspector/InspectorDOMAgent.cpp:
951         (WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
952         * inspector/InspectorDOMAgent.h:
953         * inspector/InspectorDOMDebuggerAgent.cpp:
954         (WebCore::InspectorDOMDebuggerAgent::didCreateFrontendAndBackend):
955         * inspector/InspectorDOMDebuggerAgent.h:
956         * inspector/InspectorDOMStorageAgent.cpp:
957         (WebCore::InspectorDOMStorageAgent::didCreateFrontendAndBackend):
958         * inspector/InspectorDOMStorageAgent.h:
959         * inspector/InspectorDatabaseAgent.cpp:
960         (WebCore::InspectorDatabaseAgent::didCreateFrontendAndBackend):
961         * inspector/InspectorDatabaseAgent.h:
962         * inspector/InspectorForwarding.h: Removed.
963         * inspector/InspectorIndexedDBAgent.cpp:
964         (WebCore::InspectorIndexedDBAgent::didCreateFrontendAndBackend):
965         * inspector/InspectorIndexedDBAgent.h:
966         * inspector/InspectorLayerTreeAgent.cpp:
967         (WebCore::InspectorLayerTreeAgent::didCreateFrontendAndBackend):
968         * inspector/InspectorLayerTreeAgent.h:
969         * inspector/InspectorPageAgent.cpp:
970         (WebCore::InspectorPageAgent::didCreateFrontendAndBackend):
971         * inspector/InspectorPageAgent.h:
972         * inspector/InspectorReplayAgent.cpp:
973         (WebCore::InspectorReplayAgent::didCreateFrontendAndBackend):
974         * inspector/InspectorReplayAgent.h:
975         * inspector/InspectorResourceAgent.cpp:
976         (WebCore::InspectorResourceAgent::didCreateFrontendAndBackend):
977         * inspector/InspectorResourceAgent.h:
978         * inspector/InspectorTimelineAgent.cpp:
979         (WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend):
980         * inspector/InspectorTimelineAgent.h:
981         * inspector/InspectorWebAgentBase.h:
982         * inspector/InspectorWorkerAgent.cpp:
983         (WebCore::InspectorWorkerAgent::didCreateFrontendAndBackend):
984         * inspector/InspectorWorkerAgent.h:
985         * inspector/PageRuntimeAgent.cpp:
986         (WebCore::PageRuntimeAgent::didCreateFrontendAndBackend):
987         * inspector/PageRuntimeAgent.h:
988         * inspector/WorkerInspectorController.cpp:
989         (WebCore::WorkerInspectorController::connectFrontend):
990         * inspector/WorkerInspectorController.h:
991         * inspector/WorkerRuntimeAgent.cpp:
992         (WebCore::WorkerRuntimeAgent::didCreateFrontendAndBackend):
993         * inspector/WorkerRuntimeAgent.h:
994         * page/PageDebuggable.cpp:
995         * testing/Internals.cpp:
996
997 2015-09-05  Joseph Pecoraro  <pecoraro@apple.com>
998
999         Add a new ResourceLoaderOption to avoid page defers loading mechanisms for inspector
1000         https://bugs.webkit.org/show_bug.cgi?id=148727
1001
1002         Reviewed by Antti Koivisto.
1003
1004         This will be tested shortly by inspector tests.
1005
1006         * loader/ResourceLoaderOptions.h:
1007         (WebCore::ResourceLoaderOptions::ResourceLoaderOptions):
1008         (WebCore::ResourceLoaderOptions::defersLoadingPolicy):
1009         (WebCore::ResourceLoaderOptions::setDefersLoadingPolicy):
1010         Add a new policy for defers loading. The default is to allow defers loading.
1011
1012         * loader/ResourceLoader.cpp:
1013         (WebCore::ResourceLoader::ResourceLoader):
1014         (WebCore::ResourceLoader::init):
1015         (WebCore::ResourceLoader::setDefersLoading):
1016         Respect the defers loading policy whenever we would set defers loading status.
1017
1018         * inspector/InspectorResourceAgent.cpp:
1019         (WebCore::InspectorResourceAgent::loadResource):
1020         Switch from incorrectly changing the defersLoading state of the loader
1021         to setting an option to disallow defers loading entirely for the loader.
1022
1023         * loader/DocumentLoader.cpp:
1024         (WebCore::DocumentLoader::startLoadingMainResource):
1025         * loader/MediaResourceLoader.cpp:
1026         (WebCore::MediaResourceLoader::start):
1027         * loader/NetscapePlugInStreamLoader.cpp:
1028         (WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader):
1029         * loader/cache/CachedResourceLoader.cpp:
1030         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
1031         (WebCore::CachedResourceLoader::defaultCachedResourceOptions):
1032         * loader/icon/IconLoader.cpp:
1033         (WebCore::IconLoader::startLoading):
1034         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
1035         (WebCore::WebCoreAVCFResourceLoader::startLoading):
1036         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
1037         (WebCore::WebCoreAVFResourceLoader::startLoading):
1038         Add the new value to instance of the longhand ResourceLoaderOptions constructor.
1039
1040 2015-09-04  Myles C. Maxfield  <mmaxfield@apple.com>
1041
1042         Rename members of CanvasRenderingContext2D::State
1043         https://bugs.webkit.org/show_bug.cgi?id=148889
1044
1045         Reviewed by Tim Horton.
1046
1047         CanvasRenderingContext2D::State is a struct, so its members should not start with m_.
1048
1049         No new tests because there is no behavior change.
1050
1051         * html/canvas/CanvasRenderingContext2D.cpp:
1052         (WebCore::CanvasRenderingContext2D::State::State):
1053         (WebCore::CanvasRenderingContext2D::State::operator=):
1054         (WebCore::CanvasRenderingContext2D::restore):
1055         (WebCore::CanvasRenderingContext2D::setStrokeStyle):
1056         (WebCore::CanvasRenderingContext2D::setFillStyle):
1057         (WebCore::CanvasRenderingContext2D::lineWidth):
1058         (WebCore::CanvasRenderingContext2D::setLineWidth):
1059         (WebCore::CanvasRenderingContext2D::lineCap):
1060         (WebCore::CanvasRenderingContext2D::setLineCap):
1061         (WebCore::CanvasRenderingContext2D::lineJoin):
1062         (WebCore::CanvasRenderingContext2D::setLineJoin):
1063         (WebCore::CanvasRenderingContext2D::miterLimit):
1064         (WebCore::CanvasRenderingContext2D::setMiterLimit):
1065         (WebCore::CanvasRenderingContext2D::shadowOffsetX):
1066         (WebCore::CanvasRenderingContext2D::setShadowOffsetX):
1067         (WebCore::CanvasRenderingContext2D::shadowOffsetY):
1068         (WebCore::CanvasRenderingContext2D::setShadowOffsetY):
1069         (WebCore::CanvasRenderingContext2D::shadowBlur):
1070         (WebCore::CanvasRenderingContext2D::setShadowBlur):
1071         (WebCore::CanvasRenderingContext2D::shadowColor):
1072         (WebCore::CanvasRenderingContext2D::setShadowColor):
1073         (WebCore::CanvasRenderingContext2D::getLineDash):
1074         (WebCore::CanvasRenderingContext2D::setLineDash):
1075         (WebCore::CanvasRenderingContext2D::setWebkitLineDash):
1076         (WebCore::CanvasRenderingContext2D::lineDashOffset):
1077         (WebCore::CanvasRenderingContext2D::setLineDashOffset):
1078         (WebCore::CanvasRenderingContext2D::applyLineDash):
1079         (WebCore::CanvasRenderingContext2D::globalAlpha):
1080         (WebCore::CanvasRenderingContext2D::setGlobalAlpha):
1081         (WebCore::CanvasRenderingContext2D::globalCompositeOperation):
1082         (WebCore::CanvasRenderingContext2D::setGlobalCompositeOperation):
1083         (WebCore::CanvasRenderingContext2D::scale):
1084         (WebCore::CanvasRenderingContext2D::rotate):
1085         (WebCore::CanvasRenderingContext2D::translate):
1086         (WebCore::CanvasRenderingContext2D::transform):
1087         (WebCore::CanvasRenderingContext2D::setTransform):
1088         (WebCore::CanvasRenderingContext2D::setStrokeColor):
1089         (WebCore::CanvasRenderingContext2D::setFillColor):
1090         (WebCore::CanvasRenderingContext2D::fillInternal):
1091         (WebCore::CanvasRenderingContext2D::strokeInternal):
1092         (WebCore::CanvasRenderingContext2D::clipInternal):
1093         (WebCore::CanvasRenderingContext2D::isPointInPathInternal):
1094         (WebCore::CanvasRenderingContext2D::isPointInStrokeInternal):
1095         (WebCore::CanvasRenderingContext2D::clearRect):
1096         (WebCore::CanvasRenderingContext2D::fillRect):
1097         (WebCore::CanvasRenderingContext2D::strokeRect):
1098         (WebCore::CanvasRenderingContext2D::setShadow):
1099         (WebCore::CanvasRenderingContext2D::applyShadow):
1100         (WebCore::CanvasRenderingContext2D::shouldDrawShadows):
1101         (WebCore::CanvasRenderingContext2D::drawImage):
1102         (WebCore::CanvasRenderingContext2D::transformAreaToDevice):
1103         (WebCore::CanvasRenderingContext2D::rectContainsCanvas):
1104         (WebCore::CanvasRenderingContext2D::compositeBuffer):
1105         (WebCore::CanvasRenderingContext2D::didDraw):
1106         (WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal):
1107         (WebCore::CanvasRenderingContext2D::font):
1108         (WebCore::CanvasRenderingContext2D::setFont):
1109         (WebCore::CanvasRenderingContext2D::textAlign):
1110         (WebCore::CanvasRenderingContext2D::setTextAlign):
1111         (WebCore::CanvasRenderingContext2D::textBaseline):
1112         (WebCore::CanvasRenderingContext2D::setTextBaseline):
1113         (WebCore::CanvasRenderingContext2D::direction):
1114         (WebCore::CanvasRenderingContext2D::setDirection):
1115         (WebCore::CanvasRenderingContext2D::drawTextInternal):
1116         (WebCore::CanvasRenderingContext2D::inflateStrokeRect):
1117         (WebCore::CanvasRenderingContext2D::imageSmoothingEnabled):
1118         (WebCore::CanvasRenderingContext2D::setImageSmoothingEnabled):
1119         * html/canvas/CanvasRenderingContext2D.h:
1120
1121 2015-09-04  Myles C. Maxfield  <mmaxfield@apple.com>
1122
1123         Crash when font completes downloading after calling 2D canvas setText() multiple times
1124         https://bugs.webkit.org/show_bug.cgi?id=148789
1125
1126         Reviewed by Darin Adler.
1127
1128         The CSSFontSelector has a list of clients, and when fonts complete downloading, these
1129         clients get a call back. CanvasRenderingContext2D::State is one such of these clients. However,
1130         the CSSFontSelector may be destroyed and recreated at any time. We were getting into a case
1131         where multiple CSSFontSelectors were thinking that the same CanvasRenderingContext2D::State were
1132         their client. When the CanvasRenderingContext2D::State was destroyed, it only unregistered
1133         itself from one of the CSSFontSelectors, which means the CSSFontSelector left over has a dangling
1134         pointer to it.
1135
1136         The solution is to implement a new helper class, FontProxy, to hold the
1137         CanvasRenderingContext2D::State's font, and maintain the invariant that this object is always
1138         registered to exactly one CSSFontSelector, and this CSSFontSelector is the one which is associated
1139         with the FontProxy's FontCascade object. This patch maintains this invariant, as well as protecting
1140         all access to the State's FontCascade object so no one can reach in and change it without going
1141         through functions which maintain the invariant.
1142
1143         Test: fast/canvas/font-selector-crash.html
1144
1145         * css/CSSFontSelector.cpp:
1146         (WebCore::CSSFontSelector::registerForInvalidationCallbacks):
1147         (WebCore::CSSFontSelector::unregisterForInvalidationCallbacks):
1148         (WebCore::CSSFontSelector::dispatchInvalidationCallbacks):
1149         * css/CSSFontSelector.h:
1150         * dom/Document.cpp:
1151         (WebCore::Document::fontsNeedUpdate):
1152         (WebCore::Document::fontSelector):
1153         (WebCore::Document::clearStyleResolver):
1154         * dom/Document.h:
1155         * html/canvas/CanvasRenderingContext2D.cpp:
1156         (WebCore::CanvasRenderingContext2D::State::State):
1157         (WebCore::CanvasRenderingContext2D::State::operator=):
1158         (WebCore::CanvasRenderingContext2D::FontProxy::~FontProxy):
1159         (WebCore::CanvasRenderingContext2D::FontProxy::FontProxy):
1160         (WebCore::CanvasRenderingContext2D::FontProxy::update):
1161         (WebCore::CanvasRenderingContext2D::FontProxy::fontsNeedUpdate):
1162         (WebCore::CanvasRenderingContext2D::FontProxy::initialize):
1163         (WebCore::CanvasRenderingContext2D::FontProxy::fontMetrics):
1164         (WebCore::CanvasRenderingContext2D::FontProxy::fontDescription):
1165         (WebCore::CanvasRenderingContext2D::FontProxy::width):
1166         (WebCore::CanvasRenderingContext2D::FontProxy::drawBidiText):
1167         (WebCore::CanvasRenderingContext2D::font):
1168         (WebCore::CanvasRenderingContext2D::setFont):
1169         (WebCore::CanvasRenderingContext2D::measureText):
1170         (WebCore::CanvasRenderingContext2D::drawTextInternal):
1171         (WebCore::CanvasRenderingContext2D::State::~State): Deleted.
1172         (WebCore::CanvasRenderingContext2D::State::fontsNeedUpdate): Deleted.
1173         (WebCore::CanvasRenderingContext2D::accessFont): Deleted.
1174         * html/canvas/CanvasRenderingContext2D.h:
1175         * platform/graphics/FontSelector.h:
1176
1177 2015-09-04  Commit Queue  <commit-queue@webkit.org>
1178
1179         Unreviewed, rolling out r189386.
1180         https://bugs.webkit.org/show_bug.cgi?id=148883
1181
1182         Made several event dispatch tests assert (Requested by ap on
1183         #webkit).
1184
1185         Reverted changeset:
1186
1187         "dispatchEvent() should throw an InvalidStateError if the
1188         event's initialized flag is not set"
1189         https://bugs.webkit.org/show_bug.cgi?id=148800
1190         http://trac.webkit.org/changeset/189386
1191
1192 2015-09-04  Joseph Pecoraro  <pecoraro@apple.com>
1193
1194         Web Inspector: Add tests for DOM highlight commands
1195         https://bugs.webkit.org/show_bug.cgi?id=148786
1196
1197         Reviewed by Timothy Hatcher.
1198
1199         Tests: inspector/dom/hideHighlight.html
1200                inspector/dom/highlightFrame.html
1201                inspector/dom/highlightNode.html
1202                inspector/dom/highlightQuad.html
1203                inspector/dom/highlightRect.html
1204
1205         * inspector/InspectorDOMAgent.cpp:
1206         (WebCore::InspectorDOMAgent::highlightNode):
1207         (WebCore::InspectorDOMAgent::highlightFrame):
1208         Include an error if a frame is not found.
1209
1210         * inspector/InspectorOverlay.cpp:
1211         (WebCore::InspectorOverlay::highlightQuad):
1212         Should have been checking the usePageCoordinates state of the incoming
1213         highlight configuration, not the one that will be replaced.
1214
1215 2015-09-04  Csaba Osztrogonác  <ossy@webkit.org>
1216
1217         Remove unnecessary compiler guards from mm files
1218         https://bugs.webkit.org/show_bug.cgi?id=148797
1219
1220         Reviewed by Dan Bernstein.
1221
1222         * bindings/objc/DOMInternal.mm:
1223         * bridge/objc/objc_instance.mm:
1224
1225 2015-09-04  Eric Carlson  <eric.carlson@apple.com>
1226
1227         [mediacontrols] Test AirPlay picker button
1228         https://bugs.webkit.org/show_bug.cgi?id=148836
1229
1230         Reviewed by Dean Jackson.
1231
1232         Test: media/controls/airplay-picker.html
1233
1234         * Modules/mediacontrols/mediaControlsApple.js:
1235         (Controller.prototype.getCurrentControlsStatus.elements.forEach.):
1236         (Controller.prototype.getCurrentControlsStatus):
1237
1238 2015-09-04  Chris Dumez  <cdumez@apple.com>
1239
1240         dispatchEvent() should throw an InvalidStateError if the event's initialized flag is not set
1241         https://bugs.webkit.org/show_bug.cgi?id=148800
1242         <rdar://problem/22565782>
1243         <rdar://problem/22565485>
1244
1245         Reviewed by Geoffrey Garen.
1246
1247         dispatchEvent() should throw an InvalidStateError if the event's
1248         initialized flag is not set or its dispatch flag is set, and should
1249         allow dispatching events with an empty type as long as it is
1250         initialized:
1251         https://dom.spec.whatwg.org/#dom-eventtarget-dispatchevent (step 1)
1252
1253         Previously, WebKit relied on the event type being empty to throw a
1254         UNSPECIFIED_EVENT_TYPE_ERR: DOM Events Exception 0. However, this
1255         exception type is outdated and initializing Event.type to an empty
1256         string is legal.
1257
1258         No new tests, already covered by existing tests that were rebaselined.
1259
1260         * dom/Event.cpp:
1261         (WebCore::Event::Event):
1262         (WebCore::Event::initEvent):
1263         * dom/Event.h:
1264         (WebCore::Event::isInitialized):
1265         * dom/EventTarget.cpp:
1266         (WebCore::EventTarget::dispatchEvent):
1267
1268 2015-09-04  Beth Dakin  <bdakin@apple.com>
1269
1270         Speculative build fix.
1271
1272         * platform/spi/mac/NSEventSPI.h:
1273
1274 2015-09-04  Brian Burg  <bburg@apple.com>
1275
1276         Web Inspector: InspectorController should support multiple frontend channels
1277         https://bugs.webkit.org/show_bug.cgi?id=148538
1278
1279         Reviewed by Joseph Pecoraro.
1280
1281         No new tests, no behavior change from this patch. Teardown scenarios are
1282         covered by existing protocol and inspector tests running under DRT and WKTR.
1283
1284         * ForwardingHeaders/inspector/InspectorFrontendRouter.h: Added.
1285         * WebCore.vcxproj/WebCore.vcxproj:
1286         * inspector/InspectorClient.h: Stop using forwarded types.
1287         * inspector/InspectorController.cpp:
1288         (WebCore::InspectorController::InspectorController):
1289         (WebCore::InspectorController::inspectedPageDestroyed):
1290         (WebCore::InspectorController::hasLocalFrontend):
1291         (WebCore::InspectorController::hasRemoteFrontend):
1292         (WebCore::InspectorController::connectFrontend):
1293         (WebCore::InspectorController::disconnectFrontend):
1294         (WebCore::InspectorController::disconnectAllFrontends): Added. Disconnects all
1295         frontends and signals DisconnectReason::InspectedTargetDestroyed.
1296
1297         (WebCore::InspectorController::show):
1298         (WebCore::InspectorController::close):
1299         (WebCore::InspectorController::dispatchMessageFromFrontend):
1300         * inspector/InspectorController.h: Add default value for isAutomaticInspection.
1301         * inspector/InspectorDatabaseAgent.cpp:
1302         * inspector/InspectorIndexedDBAgent.cpp:
1303         * inspector/InspectorResourceAgent.cpp:
1304         * inspector/WorkerInspectorController.cpp: Use a router with a singleton channel
1305         that forwards messages over to the main page.
1306
1307         (WebCore::WorkerInspectorController::WorkerInspectorController):
1308         (WebCore::WorkerInspectorController::connectFrontend):
1309         (WebCore::WorkerInspectorController::disconnectFrontend):
1310         (WebCore::WorkerInspectorController::dispatchMessageFromFrontend):
1311         * inspector/WorkerInspectorController.h:
1312         * page/PageDebuggable.cpp:
1313         (WebCore::PageDebuggable::disconnect):
1314         * page/PageDebuggable.h:
1315         * testing/Internals.cpp: Clear the frontend client before disconnecting frontend channel.
1316         (WebCore::Internals::openDummyInspectorFrontend):
1317         (WebCore::Internals::closeDummyInspectorFrontend):
1318
1319 2015-09-04  Jer Noble  <jer.noble@apple.com>
1320
1321         [iOS] Enable media layout tests to run simultaneously by ignoring system-level interruptions
1322         https://bugs.webkit.org/show_bug.cgi?id=148807
1323
1324         Reviewed by Eric Carlson.
1325
1326         Add an internal property that, when set, will cause system-level interruption notifications
1327         (e.g., due to simultaneous media playback in separate processes) to be ignored by the
1328         PlatformMediaSessionManager, and cause the media playback sessions to continue normally, if
1329         inaudibly.
1330
1331         * platform/audio/PlatformMediaSessionManager.h:
1332         (WebCore::PlatformMediaSessionManager::willIgnoreSystemInterruptions):
1333         (WebCore::PlatformMediaSessionManager::setWillIgnoreSystemInterruptions):
1334         * platform/audio/ios/MediaSessionManagerIOS.mm:
1335         (-[WebMediaSessionHelper interruption:]):
1336         (-[WebMediaSessionHelper applicationWillEnterForeground:]):
1337         (-[WebMediaSessionHelper applicationDidBecomeActive:]):
1338         (-[WebMediaSessionHelper applicationWillResignActive:]):
1339         (-[WebMediaSessionHelper applicationDidEnterBackground:]):
1340         * testing/Internals.cpp:
1341         (WebCore::Internals::resetToConsistentState):
1342
1343 2015-09-04  Beth Dakin  <bdakin@apple.com>
1344
1345         Need to be able to test default behaviors on force click
1346         https://bugs.webkit.org/show_bug.cgi?id=148758
1347
1348         Reviewed by Tim Horton.
1349
1350         WKTR needs access to this.
1351         * platform/spi/mac/NSEventSPI.h:
1352
1353 2015-09-04  Dean Jackson  <dino@apple.com>
1354
1355         [mediacontrols] Test the ordering of elements in the controls panel
1356         https://bugs.webkit.org/show_bug.cgi?id=148804
1357         <rdar://problem/22579232>
1358
1359         Reviewed by Eric Carlson.
1360
1361         Add information about various controls elements to the status object.
1362
1363         Test: media/controls/elementOrder.html
1364
1365         * Modules/mediacontrols/mediaControlsApple.js:
1366
1367 2015-09-03  Dean Jackson  <dino@apple.com>
1368
1369         [mediacontrols] Expose bounding rectangles and computed style to testing
1370         https://bugs.webkit.org/show_bug.cgi?id=148755
1371         <rdar://problems/22567757>
1372
1373         Reviewed by Eric Carlson.
1374
1375         Expose more information on the internal objects to the testing
1376         framework, in particular the bounding client rectangle for an
1377         element as well as its computed style.
1378
1379         These new features are tested by media/controls/statusDisplay*.
1380
1381         * Modules/mediacontrols/mediaControlsApple.js:
1382         (Controller.prototype.getCurrentControlsStatus): Rearrage things so
1383         that it iterates over a list of objects, adding the common things
1384         as well as any extra property values.
1385
1386 2015-09-04  Chris Dumez  <cdumez@apple.com>
1387
1388         Document.body should return the first body / frameset child of the html element
1389         https://bugs.webkit.org/show_bug.cgi?id=148787
1390         <rdar://problem/22566850>
1391
1392         Reviewed by Ryosuke Niwa.
1393
1394         Document.body should return the *first* body / frameset child of the html
1395         element as per the specification:
1396         https://html.spec.whatwg.org/multipage/dom.html#the-body-element-2
1397
1398         Chrome and Firefox both behave correctly. However, WebKit was prioritizing
1399         frameset over body. This patch fixes this.
1400
1401         No new tests, already covered by existing test.
1402
1403         * dom/Document.cpp:
1404         (WebCore::Document::bodyOrFrameset):
1405
1406 2015-09-04  Csaba Osztrogonác  <ossy@webkit.org>
1407
1408         Fix the !ENABLE(VIDEO) build after r189023
1409         https://bugs.webkit.org/show_bug.cgi?id=148796
1410
1411         Reviewed by Eric Carlson.
1412
1413         * testing/Internals.idl:
1414
1415 2015-09-04  Ryosuke Niwa  <rniwa@webkit.org>
1416
1417         Range.isPointInRange check root node before verifying offset
1418         https://bugs.webkit.org/show_bug.cgi?id=148776
1419
1420         isPointInRange should never throw WrongDocumentError
1421         https://bugs.webkit.org/show_bug.cgi?id=148779
1422
1423         Reviewed by Darin Adler.
1424
1425         Fixed two bugs since they were inter-dependent on each other.
1426
1427         We use the same trick we used for comparePoint in r189327 to avoid O(n) operation in common cases
1428         and return false when either calls to compareBoundaryPoints yields a WrongDocumentError.
1429
1430         No new tests since this is covered by an existing W3C test.
1431
1432         * dom/Range.cpp:
1433         (WebCore::Range::isPointInRange):
1434         (WebCore::Range::comparePoint):
1435
1436 2015-09-03  Commit Queue  <commit-queue@webkit.org>
1437
1438         Unreviewed, rolling out r189338.
1439         https://bugs.webkit.org/show_bug.cgi?id=148785
1440
1441         Caused tons of crashes (Requested by cdumez on #webkit).
1442
1443         Reverted changeset:
1444
1445         "Web Inspector: InspectorController should support multiple
1446         frontend channels"
1447         https://bugs.webkit.org/show_bug.cgi?id=148538
1448         http://trac.webkit.org/changeset/189338
1449
1450 2015-09-03  Brian Burg  <bburg@apple.com>
1451
1452         Web Inspector: InspectorController should support multiple frontend channels
1453         https://bugs.webkit.org/show_bug.cgi?id=148538
1454
1455         Reviewed by Joseph Pecoraro.
1456
1457         No new tests, no behavior change from this patch. Teardown scenarios are
1458         covered by existing protocol and inspector tests running under DRT and WKTR.
1459
1460         * ForwardingHeaders/inspector/InspectorFrontendRouter.h: Added.
1461         * WebCore.vcxproj/WebCore.vcxproj:
1462         * inspector/InspectorClient.h: Stop using forwarded types.
1463         * inspector/InspectorController.cpp:
1464         (WebCore::InspectorController::InspectorController):
1465         (WebCore::InspectorController::inspectedPageDestroyed):
1466         (WebCore::InspectorController::hasLocalFrontend):
1467         (WebCore::InspectorController::hasRemoteFrontend):
1468         (WebCore::InspectorController::connectFrontend):
1469         (WebCore::InspectorController::disconnectFrontend):
1470         (WebCore::InspectorController::disconnectAllFrontends): Added. Disconnects all
1471         frontends and signals DisconnectReason::InspectedTargetDestroyed.
1472
1473         (WebCore::InspectorController::show):
1474         (WebCore::InspectorController::close):
1475         (WebCore::InspectorController::dispatchMessageFromFrontend):
1476         * inspector/InspectorController.h: Add default value for isAutomaticInspection.
1477         * inspector/InspectorDatabaseAgent.cpp:
1478         * inspector/InspectorIndexedDBAgent.cpp:
1479         * inspector/InspectorResourceAgent.cpp:
1480         * inspector/WorkerInspectorController.cpp: Use a router with a singleton channel
1481         that forwards messages over to the main page.
1482
1483         (WebCore::WorkerInspectorController::WorkerInspectorController):
1484         (WebCore::WorkerInspectorController::connectFrontend):
1485         (WebCore::WorkerInspectorController::disconnectFrontend):
1486         (WebCore::WorkerInspectorController::dispatchMessageFromFrontend):
1487         * inspector/WorkerInspectorController.h:
1488         * page/PageDebuggable.cpp:
1489         (WebCore::PageDebuggable::disconnect):
1490         * page/PageDebuggable.h:
1491         * testing/Internals.cpp: Clear the frontend client before disconnecting frontend channel.
1492         (WebCore::Internals::openDummyInspectorFrontend):
1493         (WebCore::Internals::closeDummyInspectorFrontend):
1494
1495 2015-09-03  Jinyoung Hur  <hur.ims@navercorp.com>
1496
1497         [Texmap] highp precision should be used conditionally for fragment shaders on OpenGL ES
1498         https://bugs.webkit.org/show_bug.cgi?id=143993
1499
1500         Reviewed by Martin Robinson.
1501
1502         There are some GPUs that do not support the GL_OES_fragment_precision_high extension. (e.g., Mali-T624)
1503         Therefore, highp precision should be used in shader fragments conditionally using a proper preprocessor,
1504         GL_FRAGMENT_PRECISION_HIGH.
1505         Without this patch, nothing will be displayed on the screen if the running platform doesn't support the
1506         GL_OES_fragment_precision_high extension.
1507
1508         No new tests, covered by existing tests.
1509
1510         * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
1511
1512 2015-09-03  Ryosuke Niwa  <rniwa@webkit.org>
1513
1514         Range.comparePoint shouldn't throw an exception if the range and the node are in the same detached tree
1515         https://bugs.webkit.org/show_bug.cgi?id=148733
1516
1517         Reviewed by Chris Dumez.
1518
1519         Don't throw WRONG_DOCUMENT_ERR when refNode is not in the document. The new behavior matches DOM4 as well
1520         as the behavior of Firefox. See https://dom.spec.whatwg.org/#dom-range-comparepoint
1521
1522         WRONG_DOCUMENT_ERR is still thrown by compareBoundaryPoints later in the function when the root nodes of
1523         refNode and boundary points are different.
1524
1525         There is one subtlety here that we need to throw WRONG_DOCUMENT_ERR instead of INDEX_SIZE_ERR when refNode
1526         and the boundary points don't share the same root node even if (refNode, offset) pair is invalid since
1527         DOM4 spec checks the former condition first. We implement this behavior by first validating the offset
1528         and then explicitly checking for the root node difference if the former check failed to avoid the latter
1529         O(n) check in common cases.
1530
1531         Test: fast/dom/Range/range-comparePoint-detached-nodes.html
1532
1533         * dom/Range.cpp:
1534         (WebCore::Range::comparePoint):
1535
1536 2015-09-03  Jer Noble  <jer.noble@apple.com>
1537
1538         [iOS] Playback does not pause when deselecting route and locking screen.
1539         https://bugs.webkit.org/show_bug.cgi?id=148724
1540
1541         Reviewed by Eric Carlson.
1542
1543         When deselecting a route, the route change notification can be delayed for some amount
1544         of time. If the screen is locked before the notification is fired, the PlatformMediaSessionManager
1545         can refuse to pause the video when entering the background due to a wireless playback route
1546         still being active.
1547
1548         When the media element transitions from having an active route to not having one (or vice versa),
1549         re-run the interruption check. In order to correctly determine, when that occurs, whether
1550         we are in an 'application background' state, cache that value to an ivar when handling
1551         application{Will,Did}Enter{Background,Foreground}.
1552
1553         Because we only want to run this step during an actual transition between playing to a route ->
1554         playing locally, cache the value of isPlayingToWirelessPlayback to another ivar, and only
1555         inform the PlatformMediaSessionManager when that value actually changes.
1556
1557         * html/HTMLMediaElement.cpp:
1558         (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged):
1559         * platform/audio/PlatformMediaSession.cpp:
1560         (WebCore::PlatformMediaSession::isPlayingToWirelessPlaybackTargetChanged): Set or clear m_isPlayingToWirelessPlaybackTarget.
1561         * platform/audio/PlatformMediaSession.h:
1562         (WebCore::PlatformMediaSession::isPlayingToWirelessPlaybackTarget): Simple getter.
1563         * platform/audio/PlatformMediaSessionManager.cpp:
1564         (WebCore::PlatformMediaSessionManager::applicationWillEnterBackground): Set m_isApplicationInBackground.
1565         (WebCore::PlatformMediaSessionManager::applicationDidEnterBackground): Ditto.
1566         (WebCore::PlatformMediaSessionManager::applicationWillEnterForeground): Clear m_isApplicationInBackground.
1567         (WebCore::PlatformMediaSessionManager::sessionIsPlayingToWirelessPlaybackTargetChanged): Run interruption
1568             if application is in background.
1569
1570 2015-09-03  Brady Eidson  <beidson@apple.com>
1571
1572         Move SecurityOriginData from WK2 to WebCore.
1573         https://bugs.webkit.org/show_bug.cgi?id=148739
1574
1575         Reviewed by Tim Horton.
1576
1577         This will be needed for upcoming IndexedDB work.
1578
1579         No new tests (No behavior change.)
1580
1581         * CMakeLists.txt:
1582         * WebCore.xcodeproj/project.pbxproj:
1583         
1584         * page/SecurityOriginData.cpp: Renamed from Source/WebKit2/Shared/SecurityOriginData.cpp.
1585         (WebCore::SecurityOriginData::fromSecurityOrigin):
1586         (WebCore::SecurityOriginData::fromFrame):
1587         (WebCore::SecurityOriginData::securityOrigin):
1588         (WebCore::SecurityOriginData::isolatedCopy):
1589         (WebCore::operator==):
1590         * page/SecurityOriginData.h: Renamed from Source/WebKit2/Shared/SecurityOriginData.h.
1591         (WebCore::SecurityOriginData::encode):
1592         (WebCore::SecurityOriginData::decode):
1593
1594 2015-09-03  Zalan Bujtas  <zalan@apple.com>
1595
1596         New clang warns about boolean checks for |this| pointer in RenderObject debug methods
1597         https://bugs.webkit.org/show_bug.cgi?id=136599
1598
1599         Remove unnecessary null checking.
1600
1601         Reviewed by David Kilzer.
1602
1603         Not testable.
1604
1605         * rendering/RenderObject.cpp:
1606         (WebCore::RenderObject::showRenderObject): Deleted.
1607         (WebCore::RenderObject::showRenderSubTreeAndMark): Deleted.
1608
1609 2015-09-03  Adenilson Cavalcanti  <cavalcantii@gmail.com>
1610
1611         Improve access specifier use in RenderObject
1612         https://bugs.webkit.org/show_bug.cgi?id=148745
1613
1614         Reviewed by Myles C. Maxfield.
1615
1616         No new tests, no change in behavior.
1617
1618         * rendering/RenderObject.h:
1619         (WebCore::RenderObject::setPreviousSibling):
1620         (WebCore::RenderObject::setNextSibling):
1621         (WebCore::RenderObject::isSetNeedsLayoutForbidden):
1622         (WebCore::RenderObject::setNeedsLayoutIsForbidden):
1623
1624 2015-09-03  Alexey Proskuryakov  <ap@apple.com>
1625
1626         Test Russian ".рф" domain support
1627         https://bugs.webkit.org/show_bug.cgi?id=148721
1628
1629         Reviewed by Darin Adler.
1630
1631         Test: fast/url/user-visible/rf.html
1632
1633         * html/URLUtils.h: Made this header file work with Objective-C.
1634
1635         * WebCore.xcodeproj/project.pbxproj:
1636         * bindings/scripts/CodeGeneratorJS.pm:
1637         * testing/Internals.cpp:
1638         (WebCore::Internals::getCurrentMediaControlsStatusForElement):
1639         (WebCore::Internals::userVisibleString):
1640         * testing/Internals.h:
1641         * testing/Internals.idl:
1642         * testing/Internals.mm: Added.
1643         (WebCore::Internals::userVisibleString):
1644
1645 2015-09-03  Chris Dumez  <cdumez@apple.com>
1646
1647         document.createEvent("eventname") should do a case-insensitive match on the event name
1648         https://bugs.webkit.org/show_bug.cgi?id=148738
1649         <rdar://problem/22558709>
1650
1651         Reviewed by Andreas Kling.
1652
1653         document.createEvent("eventname") should do a case-insensitive match on the event name:
1654         https://dom.spec.whatwg.org/#dom-document-createevent
1655
1656         WebKit was doing a case-sensitive match. Firefox and Chrome match the specification.
1657
1658         No new tests, already covered by:
1659         http/tests/w3c/dom/nodes/Document-createEvent.html (rebaselined)
1660
1661         * dom/make_event_factory.pl:
1662         (generateImplementation):
1663
1664 2015-09-02  Ryosuke Niwa  <rniwa@webkit.org>
1665
1666         MutationObserver should accept attributeFilter, attributeOldValue, and characterDataOldValue on their own
1667         https://bugs.webkit.org/show_bug.cgi?id=148716
1668
1669         Reviewed by Chris Dumez.
1670
1671         According to DOM4 [1], MutationObserver accepts characterDataOldValue, attributeOldValue and attributeFilter options
1672         on their own when characterData and attributes options are omitted. It throws only when characterData and attributes
1673         options are explicitly set to false.
1674
1675         Fixed our implementation accordingly. Existing tests as well as ones imported from W3C covers this.
1676
1677         [1] http://www.w3.org/TR/2015/WD-dom-20150618/#interface-mutationobserver
1678
1679         * dom/MutationObserver.cpp:
1680         (WebCore::MutationObserver::observe):
1681
1682 2015-09-02  Andreas Kling  <akling@apple.com>
1683
1684         ScrollbarThemes should be returned by reference.
1685         <https://webkit.org/b/147551>
1686
1687         Reviewed by Zalan Bujtas.
1688
1689         There's always a ScrollbarTheme of some type, so have ScrollbarTheme getters
1690         return references all around.
1691
1692         * css/SelectorCheckerTestFunctions.h:
1693         (WebCore::scrollbarMatchesDoubleButtonPseudoClass):
1694         (WebCore::scrollbarMatchesSingleButtonPseudoClass):
1695         (WebCore::scrollbarMatchesNoButtonPseudoClass):
1696         * html/shadow/SpinButtonElement.cpp:
1697         (WebCore::SpinButtonElement::startRepeatingTimer):
1698         * page/PageOverlay.cpp:
1699         (WebCore::PageOverlay::bounds):
1700         * page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm:
1701         (WebCore::ScrollingStateFrameScrollingNode::setScrollbarPaintersFromScrollbars):
1702         * platform/ScrollView.cpp:
1703         (WebCore::ScrollView::paintScrollCorner):
1704         (WebCore::ScrollView::paintOverhangAreas):
1705         * platform/ScrollableArea.cpp:
1706         (WebCore::ScrollableArea::setScrollbarOverlayStyle):
1707         * platform/Scrollbar.cpp:
1708         (WebCore::Scrollbar::maxOverlapBetweenPages):
1709         (WebCore::Scrollbar::Scrollbar):
1710         (WebCore::Scrollbar::~Scrollbar):
1711         (WebCore::Scrollbar::offsetDidChange):
1712         (WebCore::Scrollbar::updateThumb):
1713         (WebCore::Scrollbar::paint):
1714         (WebCore::Scrollbar::autoscrollTimerFired):
1715         (WebCore::thumbUnderMouse):
1716         (WebCore::Scrollbar::autoscrollPressedPart):
1717         (WebCore::Scrollbar::startTimerIfNeeded):
1718         (WebCore::Scrollbar::moveThumb):
1719         (WebCore::Scrollbar::setHoveredPart):
1720         (WebCore::Scrollbar::setPressedPart):
1721         (WebCore::Scrollbar::mouseMoved):
1722         (WebCore::Scrollbar::mouseUp):
1723         (WebCore::Scrollbar::mouseDown):
1724         (WebCore::Scrollbar::setEnabled):
1725         (WebCore::Scrollbar::isOverlayScrollbar):
1726         * platform/Scrollbar.h:
1727         (WebCore::Scrollbar::theme):
1728         * platform/ScrollbarTheme.cpp:
1729         (WebCore::ScrollbarTheme::theme):
1730         * platform/ScrollbarTheme.h:
1731         * platform/efl/ScrollbarThemeEfl.cpp:
1732         (WebCore::ScrollbarTheme::nativeTheme):
1733         * platform/gtk/ScrollbarThemeGtk.cpp:
1734         (WebCore::ScrollbarTheme::nativeTheme):
1735         * platform/ios/ScrollbarThemeIOS.mm:
1736         (WebCore::ScrollbarTheme::nativeTheme):
1737         * platform/mac/ScrollAnimatorMac.mm:
1738         (macScrollbarTheme):
1739         * platform/mac/ScrollbarThemeMac.mm:
1740         (+[WebScrollbarPrefsObserver appearancePrefsChanged:]):
1741         (+[WebScrollbarPrefsObserver behaviorPrefsChanged:]):
1742         (WebCore::ScrollbarTheme::nativeTheme):
1743         * platform/win/PopupMenuWin.cpp:
1744         (WebCore::PopupMenuWin::calculatePositionAndSize):
1745         (WebCore::AccessiblePopupMenu::accLocation):
1746         (WebCore::AccessiblePopupMenu::accHitTest):
1747         * platform/win/ScrollbarThemeSafari.cpp:
1748         (WebCore::ScrollbarTheme::nativeTheme):
1749         * platform/win/ScrollbarThemeWin.cpp:
1750         (WebCore::ScrollbarTheme::nativeTheme):
1751         * rendering/RenderBox.cpp:
1752         (WebCore::RenderBox::hasVerticalScrollbarWithAutoBehavior):
1753         (WebCore::RenderBox::hasHorizontalScrollbarWithAutoBehavior):
1754         * rendering/RenderLayer.cpp:
1755         (WebCore::cornerRect):
1756         (WebCore::styleRequiresScrollbar):
1757         (WebCore::styleDefinesAutomaticScrollbar):
1758         * rendering/RenderScrollbar.cpp:
1759         (WebCore::RenderScrollbar::updateScrollbarPart):
1760         * rendering/RenderScrollbarPart.cpp:
1761         (WebCore::calcScrollbarThicknessUsing):
1762         (WebCore::RenderScrollbarPart::styleDidChange):
1763         (WebCore::RenderScrollbarPart::imageChanged):
1764         * rendering/RenderScrollbarTheme.cpp:
1765         (WebCore::RenderScrollbarTheme::paintTickmarks):
1766         * rendering/RenderScrollbarTheme.h:
1767         * rendering/RenderTextControl.cpp:
1768         (WebCore::RenderTextControl::scrollbarThickness):
1769
1770 2015-09-02  Ryosuke Niwa  <rniwa@webkit.org>
1771
1772         Node.textContent = undefined should be equivalent to textContent = ""
1773         https://bugs.webkit.org/show_bug.cgi?id=148729
1774
1775         Reviewed by Darin Adler.
1776
1777         Assigning undefined to textContent should be equivalent to assigning an empty string to it like innerHTML.
1778         This is because textContent is defined as an DOMString? attribute in DOM4 [1] and WebIDL defines ECMAScript
1779         undefined to be treated as null for nullable types [2].
1780
1781         The new behavior matches that of Firefox and Chrome.
1782
1783         [1] https://dom.spec.whatwg.org/#node
1784         [2] https://heycam.github.io/webidl/#es-nullable-type
1785         
1786         * dom/Node.idl:
1787
1788 2015-09-02  Alex Christensen  <achristensen@webkit.org>
1789
1790         Make bison grammar compatible with bison 2.1
1791         https://bugs.webkit.org/show_bug.cgi?id=148731
1792
1793         Reviewed by Tim Horton.
1794
1795         * css/CSSGrammar.y.in:
1796         * xml/XPathGrammar.y:
1797         Move all union fields to one union so bison 2.1 generates equivalent output.
1798
1799 2015-09-02  Dean Jackson  <dino@apple.com>
1800
1801         Add some Houdini specs to the features list
1802         https://bugs.webkit.org/show_bug.cgi?id=148722
1803         <rdar://problem/22545319>
1804
1805         Reviewed by Eric Carlson.
1806
1807         Add the two CSS Houdini specs that have some actual
1808         content to the features list: custom painting and
1809         custom property registration.
1810
1811         * features.json:
1812
1813 2015-09-02  Brady Eidson  <beidson@apple.com>
1814
1815         Import W3C IndexedDB tests.
1816         https://bugs.webkit.org/show_bug.cgi?id=148713
1817
1818         Reviewed by Tim Horton' rubber stamp.
1819
1820         Tests: imported/w3c/indexeddb/*
1821
1822         * Modules/indexeddb/IDBDatabase.cpp:
1823         (WebCore::IDBDatabase::onVersionChange): Remove invalid assert - version goes back to 0 when initial
1824           versionChange transaction is aborted.
1825
1826 2015-09-02  Dean Jackson  <dino@apple.com>
1827
1828         Separate WebGL 1 and WebGL 2 in the features file.
1829
1830         Unreviewed.
1831
1832         * features.json:
1833
1834 2015-09-02  Dean Jackson  <dino@apple.com>
1835
1836         Reset the status label when the media is playable
1837         https://bugs.webkit.org/show_bug.cgi?id=148704
1838         <rdar://problem/22541939>
1839
1840         Reviewed by Eric Carlson.
1841
1842         Flakiness on the bots uncovered a situation where we
1843         hide the status label but left it with incorrect content.
1844
1845         Covered by the existing statusDisplay test.
1846
1847         * Modules/mediacontrols/mediaControlsApple.js:
1848         (Controller.prototype.updateStatusDisplay): Only set to loading if we're not yet playable.
1849
1850 2015-09-02  Chris Fleizach  <cfleizach@apple.com>
1851
1852         AX: WebKit does not expose max/min value of <progress> element
1853         https://bugs.webkit.org/show_bug.cgi?id=148707
1854
1855         Reviewed by Mario Sanchez Prada.
1856
1857         Allow native progress indicator elements to report min/max values by rewriting special
1858         case code for ARIA progress bars.
1859
1860         Test: accessibility/mac/progress-element-min-max.html
1861
1862         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1863         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1864
1865 2015-09-02  Hyemi Shin  <hyemi.sin@samsung.com>
1866
1867         [GStreamer] Simplify linking pads in AudioDestination and correct old comment.
1868         https://bugs.webkit.org/show_bug.cgi?id=148702
1869
1870         Reviewed by Philippe Normand.
1871
1872         Simplify linking src pad of webkitAudioSrc and sink pad of audioConvert
1873         to one line because implementation changed not to use seperate function
1874         to complete building rest of pipelines.
1875         Correct old comment also there is no more wavparse element.
1876
1877         No new tests, no behavior change.
1878
1879         * platform/audio/gstreamer/AudioDestinationGStreamer.cpp:
1880         (WebCore::AudioDestinationGStreamer::AudioDestinationGStreamer):
1881
1882 2015-09-02  Chris Dumez  <cdumez@apple.com>
1883
1884         document.createProcessingInstruction() does not behave according to specification
1885         https://bugs.webkit.org/show_bug.cgi?id=148710
1886
1887         Reviewed by Ryosuke Niwa.
1888
1889         document.createProcessingInstruction() does not behave according to
1890         specification:
1891         https://dom.spec.whatwg.org/#dom-document-createprocessinginstruction
1892
1893         The following changes were made in this patch to match the specification
1894         and the behavior of Firefox / Chrome:
1895         1. document.createProcessingInstruction() now works for HTML documents.
1896         2. Throw an InvalidCharacterError if the data contains "?>" (step 2 of spec)
1897
1898         No new tests, already covered by existing tests that are rebaselined in
1899         this patch.
1900
1901         * dom/Document.cpp:
1902         (WebCore::Document::createProcessingInstruction):
1903
1904 2015-09-02  Chris Dumez  <cdumez@apple.com>
1905
1906         http/tests/w3c/dom/nodes/Element-matches.html is flaky
1907         https://bugs.webkit.org/show_bug.cgi?id=148615
1908
1909         Reviewed by Ryosuke Niwa.
1910
1911         Several newly-imported w3c tests were flaky due to the :target
1912         pseudo-class selectors sometimes giving different results. The
1913         issue seems to be that this type of selector relies on the
1914         Document::cssTarget() element to do the matching. We update
1915         this cssTarget Element in FrameView's scrollToFragment() /
1916         scrollToAnchor(). This is called from
1917         scrollToFragmentWithParentBoundary() which is called by
1918         FrameLoader's finishedParsing() and loadInSameDocument().
1919
1920         In the first one, it is called *after* calling checkComplete()
1921         which fires the onload event. However, in the second method,
1922         it is called *before*. This patch updates finishedParsing()
1923         so that scrollToFragmentWithParentBoundary() is called *before*
1924         firing the onload event, consistently with loadInSameDocument().
1925         This makes sure that JavaScript executed in an onload event
1926         handler will get accurate results for :target pseudo-class
1927         selectors.
1928
1929         No new tests, covered by:
1930         http/tests/w3c/dom/nodes/Element-matches.html
1931         http/tests/w3c/dom/nodes/ParentNode-querySelector-All-xhtml.xhtml
1932
1933         * loader/FrameLoader.cpp:
1934         (WebCore::FrameLoader::finishedParsing):
1935
1936 2015-09-02  Zan Dobersek  <zdobersek@igalia.com>
1937
1938         Construct default winding string arguments in CanvasRenderingContext2D from ASCIILiteral objects
1939         https://bugs.webkit.org/show_bug.cgi?id=148441
1940
1941         Reviewed by Darin Adler.
1942
1943         * html/canvas/CanvasRenderingContext2D.h: Use ASCIILiteral objects to construct
1944         the default values for the winding arguments. This will avoid copying the string
1945         data every time the methods are invoked with the default argument value.
1946
1947 2015-09-02  Carlos Garcia Campos  <cgarcia@igalia.com>
1948
1949         Unreviewed. Fix GObject DOM bindings API breaks after r189182.
1950
1951         Several methods are no longer raising exceptions after
1952         r189182. Add them to the list, but also handle the case where the
1953         methods are called inside the class, to add the nullptr parameter
1954         for the GError.
1955
1956         * bindings/scripts/CodeGeneratorGObject.pm:
1957         (GenerateProperty):
1958         (FunctionUsedToRaiseException):
1959
1960 2015-09-01  Ryosuke Niwa  <rniwa@webkit.org>
1961
1962         Rename ShadowRoot::hostElement to shadowRoot::host to match the latest spec
1963         https://bugs.webkit.org/show_bug.cgi?id=148694
1964
1965         Address the review comments by Chris.
1966
1967         * dom/Element.cpp:
1968         (WebCore::Element::removeShadowRoot):
1969         * dom/Node.cpp:
1970         (WebCore::Node::shadowHost):
1971         * dom/ShadowRoot.cpp:
1972         (WebCore::ShadowRoot::ShadowRoot):
1973         * dom/ShadowRoot.h:
1974
1975 2015-09-01  Zalan Bujtas  <zalan@apple.com>
1976
1977         Recompute maximum outline size only when outline changes.
1978         https://bugs.webkit.org/show_bug.cgi?id=148576
1979
1980         Reviewed by Andreas Kling.
1981
1982         We should only recompute the cached maximum outline size when
1983         either the outline size (offset/width) or the style (from or to
1984         auto) changes.
1985         Setting 'outline-style: auto' can change the final outline width as 'auto' triggers
1986         the focus ring mode. In this mode, we ignore outline-width and use the platform default value instead.  
1987
1988         Covered by existing test cases.
1989
1990         * rendering/RenderElement.cpp:
1991         (WebCore::RenderElement::computeMaxOutlineSize):
1992         (WebCore::RenderElement::styleWillChange):
1993         (WebCore::RenderElement::initializeStyle): Deleted.
1994         (WebCore::RenderElement::setStyle): Deleted.
1995         * rendering/RenderElement.h:
1996
1997 2015-09-01  Chris Dumez  <cdumez@apple.com>
1998
1999         Range API should throw a TypeError for null Node parameters
2000         https://bugs.webkit.org/show_bug.cgi?id=148692
2001
2002         Reviewed by Ryosuke Niwa.
2003
2004         Range API should throw a TypeError for null Node parameters. We currently
2005         throw a NotFoundError.
2006
2007         As per the DOM specification, the Node arguments are not optional nor
2008         nullable [1]:
2009         https://dom.spec.whatwg.org/#range
2010
2011         Therefore, as per the Web IDL specification, we should throw a TypeError
2012         if the Node parameter is null or missing:
2013         https://heycam.github.io/webidl/#es-interface (step 1).
2014
2015         [1] https://heycam.github.io/webidl/#es-nullable-type
2016
2017         No new tests, covered by existing tests which have been
2018         rebaselined.
2019
2020         * dom/Range.cpp:
2021         (WebCore::Range::setStart):
2022         (WebCore::Range::setEnd):
2023         (WebCore::Range::isPointInRange):
2024         (WebCore::Range::comparePoint):
2025         (WebCore::Range::compareNode):
2026         (WebCore::Range::compareBoundaryPoints):
2027         (WebCore::Range::intersectsNode):
2028         (WebCore::Range::insertNode):
2029         (WebCore::Range::setStartAfter):
2030         (WebCore::Range::setEndBefore):
2031         (WebCore::Range::setEndAfter):
2032         (WebCore::Range::selectNode):
2033         (WebCore::Range::selectNodeContents):
2034         (WebCore::Range::surroundContents):
2035         (WebCore::Range::setStartBefore):
2036         Set the Exception code to TypeError instead of NOT_FOUND_ERR if
2037         the Node parameter is null.
2038
2039         * dom/Range.idl:
2040         Stop marking the Node parameters as optional. They are not optional in
2041         the specification and they are not really optional in our implementation.
2042         Previously, if the Node parameter was missing, we would call the
2043         implementation with a null pointer and the implementation would throw a
2044         NotFoundError. Now that they are mandatory, the bindings will directly
2045         throw a TypeError (as per the Web IDL spec) if the Node parameter is
2046         missing. However, if the JavaScript explicitely passes null or undefined,
2047         the implementation will still be called with a null pointer (because
2048         our bindings generator does not distinguish nullable / non-nullable
2049         parameters). For this reason, we still need to handle null pointers on
2050         the implementation side.
2051
2052 2015-09-01  Ryosuke Niwa  <rniwa@webkit.org>
2053
2054         Rename ShadowRoot::hostElement to shadowRoot::host to match the latest spec
2055         https://bugs.webkit.org/show_bug.cgi?id=148694
2056
2057         Reviewed by Chris Dumez.
2058
2059         Renamed ShadowRoot::hostElement to ShadowRoot::host to match the latest shadow DOM spec.
2060         This will help us implementing shadow DOM in near future.
2061
2062         * dom/ContainerNodeAlgorithms.cpp:
2063         (WebCore::ChildNodeInsertionNotifier::notifyDescendantInsertedIntoDocument):
2064         (WebCore::ChildNodeRemovalNotifier::notifyDescendantRemovedFromDocument):
2065         * dom/Element.cpp:
2066         (WebCore::Element::addShadowRoot):
2067         (WebCore::Element::removeShadowRoot):
2068         * dom/EventDispatcher.cpp:
2069         (WebCore::EventRelatedNodeResolver::moveToParentOrShadowHost):
2070         (WebCore::EventRelatedNodeResolver::findHostOfTreeScopeInTargetTreeScope):
2071         (WebCore::shouldEventCrossShadowBoundary):
2072         (WebCore::EventPath::EventPath):
2073         * dom/Node.cpp:
2074         (WebCore::Node::shadowHost):
2075         (WebCore::Node::deprecatedShadowAncestorNode):
2076         (WebCore::Node::parentOrShadowHostElement):
2077         * dom/NodeRenderingTraversal.cpp:
2078         (WebCore::NodeRenderingTraversal::traverseParent):
2079         * dom/ShadowRoot.cpp:
2080         (WebCore::ShadowRoot::setInnerHTML):
2081         (WebCore::ShadowRoot::setResetStyleInheritance):
2082         * dom/ShadowRoot.h:
2083         (WebCore::Node::parentOrShadowHostNode):
2084         * dom/Text.cpp:
2085         (WebCore::isSVGShadowText):
2086         * dom/TreeScope.cpp:
2087         (WebCore::TreeScope::focusedElement):
2088         * html/shadow/ContentDistributor.cpp:
2089         (WebCore::ContentDistributor::ensureDistribution):
2090         * html/shadow/InsertionPoint.cpp:
2091         (WebCore::InsertionPoint::insertedInto):
2092         (WebCore::InsertionPoint::removedFrom):
2093         * page/DragController.cpp:
2094         (WebCore::asFileInput):
2095         * page/EventHandler.cpp:
2096         (WebCore::EventHandler::handleMousePressEvent):
2097         * page/FocusController.cpp:
2098         (WebCore::FocusNavigationScope::owner):
2099         * rendering/RenderLayer.cpp:
2100         (WebCore::rendererForScrollbar):
2101         * style/StyleResolveTree.cpp:
2102         (WebCore::Style::attachShadowRoot):
2103         (WebCore::Style::resolveShadowTree):
2104         * svg/SVGElement.cpp:
2105         (WebCore::SVGElement::correspondingUseElement):
2106
2107 2015-09-01  Chris Dumez  <cdumez@apple.com>
2108
2109         NodeFilter should be a callback interface
2110         https://bugs.webkit.org/show_bug.cgi?id=148415
2111
2112         Reviewed by Geoffrey Garen.
2113
2114         NodeFilter is now a callback interface, instead of a regular interface,
2115         as per the DOM specification:
2116         https://dom.spec.whatwg.org/#interface-nodefilter
2117
2118         One major difference is that TreeWalker.filter / NodeIterator is
2119         supposed to be a Function / Object (passed by JavaScript), but it was a
2120         JSNodeFilter wrapper in WebKit. Also, window.NodeFilter is not supposed
2121         to have a prototype property.
2122
2123         This behavior is consistent with Firefox. However, Chrome still has its
2124         own NodeFilter wrapper.
2125
2126         Tests:
2127         http/tests/w3c/dom/traversal/NodeIterator-expected.html (rebaselined)
2128         http/tests/w3c/dom/traversal/TreeWalker.html (rebaselined)
2129
2130         * CMakeLists.txt:
2131         * WebCore.vcxproj/WebCore.vcxproj:
2132         * WebCore.vcxproj/WebCore.vcxproj.filters:
2133         * WebCore.xcodeproj/project.pbxproj:
2134         Add / Remove files to the project files.
2135
2136         * dom/NodeFilterCondition.cpp:
2137         (WebCore::NodeFilterCondition::acceptNode):
2138         * dom/NodeFilterCondition.h:
2139         * bindings/gobject/GObjectNodeFilterCondition.cpp:
2140         (WebCore::GObjectNodeFilterCondition::acceptNode):
2141         * bindings/gobject/GObjectNodeFilterCondition.h:
2142         * bindings/objc/ObjCNodeFilterCondition.h:
2143         * bindings/objc/ObjCNodeFilterCondition.mm:
2144         (WebCore::ObjCNodeFilterCondition::acceptNode):
2145         Drop ExecState parameter as it is not used.
2146
2147         * bindings/gobject/WebKitDOMNodeFilter.cpp:
2148         (WebKit::core):
2149         Use NativeNodeFilter type instead of NodeFilter. NodeFilter is now
2150         a pure interface with 2 subclasses: NativeNodeFilter for the native
2151         bindings and JSNodeFilter for the JS bindings.
2152
2153         * bindings/js/JSBindingsAllInOne.cpp:
2154         Drop JSNodeFilterCondition.cpp as it was removed.
2155
2156         * bindings/js/JSCallbackData.cpp:
2157         (WebCore::JSCallbackData::invokeCallback):
2158         Throw a TypeError if the callback object being invoked is not callable
2159         and does not have a callable property with the expected name. There
2160         are several layout tests covering this (including w3c ones). Previously,
2161         NodeFilter was not using the generic JSCallbackData and the exception
2162         throwing was in JSNodeFilterCondition::acceptNode() instead.
2163
2164         * bindings/js/JSNodeFilterCondition.cpp: Removed.
2165         * bindings/js/JSNodeFilterCondition.h: Removed.
2166         Drop this class. JSNodeFilter / JSNodeFilterCustom now basically take
2167         care of all this.
2168
2169         * bindings/js/JSNodeFilterCustom.cpp:
2170         (WebCore::JSNodeFilter::acceptNode):
2171         Complete rewrite. This file is now only used to provide a custom
2172         implementation for JSNodeFilter::acceptNode(). The code is similar to
2173         what was previously done in JSNodeFilterCondition::acceptNode().
2174         There are several reasons we need custom bindings here:
2175         - The bindings generator does not handle yet callback functions
2176           returning anything else than a boolean.
2177         - The specification clearly states that we need to rethrow exceptions
2178           thrown by the callback function. However, the default behavior of
2179           our bindings is to simply report the exception.
2180
2181         * bindings/scripts/CodeGeneratorGObject.pm:
2182         Only skip functions that have parameters that are callback *functions*,
2183         not callback *interfaces*. Callback interfaces are very similar to
2184         interfaces and the generator is able to handle them. This change was
2185         needed for the GTK bindings generator would no longer generate bindings
2186         for Document.createNodeIterator() / Document.createTreeWalker(), now
2187         that NodeFilter is a callback interface instead of a regular interface.
2188
2189         * bindings/scripts/CodeGeneratorJS.pm:
2190         (GenerateCallbackHeader):
2191         (GenerateCallbackImplementation):
2192         Generate a toJS() function for callback interfaces as well. Previously,
2193         we would only generate those for regular interfaces. This is needed
2194         because NodeFilter is now a callback interface and it is exposed to
2195         JS via NodeIterator.filter / TreeWalker.filter. The implementation
2196         merely returns the callback object / function inside the JSCalbackData
2197         so the JS gets back the object / function it passed in.
2198
2199         * bindings/scripts/CodeGeneratorObjC.pm:
2200         Tweak the ObjC bindings generator to use NativeNodeFilter class instead
2201         of NodeFilter as NodeFilter is now a pure interfaces. Native bindings
2202         are now expected to use the NativeNodeFilter subclass instead.
2203
2204         * bindings/scripts/test/JS/JSTestCallback.cpp:
2205         * bindings/scripts/test/JS/JSTestCallback.h:
2206         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
2207         * bindings/scripts/test/JS/JSTestCallbackFunction.h:
2208         Rebaseline bindings tests now that we generate toJS() functions for
2209         callback functions / interfaces.
2210
2211         * dom/DOMAllInOne.cpp:
2212         Drop NodeFilter.cpp as it was removed.
2213
2214         * dom/NativeNodeFilter.cpp: Added.
2215         * dom/NativeNodeFilter.h: Added.
2216         Introduce new NativeNodeFilter class which subclasses the NodeFilter
2217         interface and is used by native bindings. Its accept() implementation
2218         uses NodeFilterCondition object internally to filter the nodes instead
2219         of a JS callback.
2220
2221         * dom/NodeFilter.cpp: Removed.
2222         * dom/NodeFilter.h:
2223         Make NodeFilter a pure interface. Its previous code is now either in
2224         NativeNodeFilter of JSNodeFilter.
2225
2226         * dom/NodeFilter.idl:
2227         Make NodeFilter a callback interface instead of a regular interface,
2228         as per the DOM specification. Also have its accept() operation return
2229         an unsigned short instead of a short to match the specification.
2230         The ObjC version still returns a short though for backward
2231         compatibility.
2232
2233         * dom/NodeFilterCondition.cpp:
2234         (WebCore::NodeFilterCondition::acceptNode):
2235         * dom/NodeFilterCondition.h:
2236
2237         * dom/NodeIterator.cpp:
2238         * dom/NodeIterator.h:
2239         * dom/NodeIterator.idl:
2240         * dom/Traversal.cpp:
2241         * dom/Traversal.h:
2242         * dom/TreeWalker.cpp:
2243         * dom/TreeWalker.h:
2244         * dom/TreeWalker.idl:
2245         Stop passing ExecState to TreeWalker / NodeIterator functions. It no
2246         longer seems to be needed as we now use the JSCallbackData abstraction
2247         for invoking JS.
2248
2249 2015-09-01  Chris Dumez  <cdumez@apple.com>
2250
2251         Range.insersectsNode(node) is supposed to return true if node.parent is null
2252         https://bugs.webkit.org/show_bug.cgi?id=148687
2253
2254         Reviewed by Ryosuke Niwa.
2255
2256         Range.insersectsNode(node) is supposed to return true if node.parent is
2257         null:
2258         https://dom.spec.whatwg.org/#dom-range-intersectsnode (step 3)
2259
2260         Previously, WebKit would throw a NotFoundError, apparently to match
2261         Firefox's behavior. However, these days, Firefox complies with the
2262         specification and returns true here.
2263
2264         No new tests, already covered by:
2265         http/tests/w3c/dom/ranges/Range-intersectsNode.html (rebaselined)
2266
2267         * dom/Range.cpp:
2268         (WebCore::Range::intersectsNode):
2269
2270 2015-09-01  Brian Burg  <bburg@apple.com>
2271
2272         Web Inspector: tighten up lifetimes for InspectorController-owned objects; add brace initializers to agents
2273         https://bugs.webkit.org/show_bug.cgi?id=148612
2274
2275         Reviewed by Joseph Pecoraro.
2276
2277         Both InjectedScriptManager and AgentRegistry (thus all agents) are
2278         owned by [Worker]InspectorController. So, use references.
2279
2280         InstrumentingAgents is morally owned by InspectorController as well, but
2281         must be a Ref for now since instrumentation cookies take a strong reference.
2282
2283         Add brace initalizers for scalar and pointer members in agent classes.
2284
2285         No new tests, no behavior change.
2286
2287         * inspector/InspectorApplicationCacheAgent.cpp:
2288         (WebCore::InspectorApplicationCacheAgent::InspectorApplicationCacheAgent):
2289         (WebCore::InspectorApplicationCacheAgent::willDestroyFrontendAndBackend):
2290         (WebCore::InspectorApplicationCacheAgent::enable):
2291         * inspector/InspectorApplicationCacheAgent.h:
2292         * inspector/InspectorCSSAgent.cpp:
2293         (WebCore::InspectorCSSAgent::InspectorCSSAgent):
2294         (WebCore::InspectorCSSAgent::enable):
2295         (WebCore::InspectorCSSAgent::disable):
2296         * inspector/InspectorCSSAgent.h:
2297         * inspector/InspectorConsoleInstrumentation.h:
2298         (WebCore::InspectorInstrumentation::addMessageToConsole):
2299         (WebCore::InspectorInstrumentation::consoleCount):
2300         (WebCore::InspectorInstrumentation::startProfiling):
2301         (WebCore::InspectorInstrumentation::stopProfiling):
2302         * inspector/InspectorController.cpp:
2303         (WebCore::InspectorController::InspectorController):
2304         (WebCore::InspectorController::connectFrontend):
2305         (WebCore::InspectorController::disconnectFrontend):
2306         (WebCore::InspectorController::disconnectAllFrontends):
2307         * inspector/InspectorController.h:
2308         * inspector/InspectorDOMAgent.cpp:
2309         (WebCore::InspectorDOMAgent::InspectorDOMAgent):
2310         (WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
2311         (WebCore::InspectorDOMAgent::willDestroyFrontendAndBackend):
2312         (WebCore::InspectorDOMAgent::focusNode):
2313         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
2314         (WebCore::InspectorDOMAgent::nodeForObjectId):
2315         (WebCore::InspectorDOMAgent::resolveNode):
2316         * inspector/InspectorDOMAgent.h:
2317         * inspector/InspectorDOMDebuggerAgent.cpp:
2318         (WebCore::InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent):
2319         (WebCore::InspectorDOMDebuggerAgent::~InspectorDOMDebuggerAgent):
2320         (WebCore::InspectorDOMDebuggerAgent::debuggerWasEnabled):
2321         (WebCore::InspectorDOMDebuggerAgent::disable):
2322         * inspector/InspectorDOMDebuggerAgent.h:
2323         * inspector/InspectorDOMStorageAgent.cpp:
2324         (WebCore::InspectorDOMStorageAgent::InspectorDOMStorageAgent):
2325         (WebCore::InspectorDOMStorageAgent::~InspectorDOMStorageAgent):
2326         * inspector/InspectorDOMStorageAgent.h:
2327         * inspector/InspectorDatabaseAgent.cpp:
2328         (WebCore::InspectorDatabaseAgent::InspectorDatabaseAgent):
2329         (WebCore::InspectorDatabaseAgent::~InspectorDatabaseAgent):
2330         * inspector/InspectorDatabaseAgent.h:
2331         * inspector/InspectorIndexedDBAgent.cpp:
2332         (WebCore::InspectorIndexedDBAgent::InspectorIndexedDBAgent):
2333         (WebCore::InspectorIndexedDBAgent::requestData):
2334         * inspector/InspectorIndexedDBAgent.h:
2335         * inspector/InspectorInstrumentation.cpp:
2336         (WebCore::InspectorInstrumentation::instrumentingAgentsForPage):
2337         (WebCore::InspectorInstrumentation::instrumentingAgentsForWorkerGlobalScope):
2338         * inspector/InspectorInstrumentation.h:
2339         (WebCore::InspectorInstrumentation::mouseDidMoveOverElement):
2340         (WebCore::InspectorInstrumentation::scriptsEnabled):
2341         (WebCore::InspectorInstrumentation::didScroll):
2342         (WebCore::InspectorInstrumentation::markResourceAsCached):
2343         (WebCore::InspectorInstrumentation::didLoadResourceFromMemoryCache):
2344         (WebCore::InspectorInstrumentation::willRunJavaScriptDialog):
2345         (WebCore::InspectorInstrumentation::sessionCreated):
2346         (WebCore::InspectorInstrumentation::sessionLoaded):
2347         (WebCore::InspectorInstrumentation::sessionModified):
2348         (WebCore::InspectorInstrumentation::segmentCreated):
2349         (WebCore::InspectorInstrumentation::segmentCompleted):
2350         (WebCore::InspectorInstrumentation::segmentLoaded):
2351         (WebCore::InspectorInstrumentation::segmentUnloaded):
2352         (WebCore::InspectorInstrumentation::captureStarted):
2353         (WebCore::InspectorInstrumentation::captureStopped):
2354         (WebCore::InspectorInstrumentation::playbackStarted):
2355         (WebCore::InspectorInstrumentation::playbackPaused):
2356         (WebCore::InspectorInstrumentation::playbackFinished):
2357         (WebCore::InspectorInstrumentation::playbackHitPosition):
2358         * inspector/InspectorLayerTreeAgent.cpp:
2359         (WebCore::InspectorLayerTreeAgent::InspectorLayerTreeAgent):
2360         (WebCore::InspectorLayerTreeAgent::enable):
2361         (WebCore::InspectorLayerTreeAgent::disable):
2362         (WebCore::InspectorLayerTreeAgent::layersForNode):
2363         (WebCore::InspectorLayerTreeAgent::idForNode):
2364         * inspector/InspectorLayerTreeAgent.h:
2365         * inspector/InspectorPageAgent.cpp:
2366         (WebCore::InspectorPageAgent::InspectorPageAgent):
2367         (WebCore::InspectorPageAgent::timestamp):
2368         (WebCore::InspectorPageAgent::enable):
2369         (WebCore::InspectorPageAgent::disable):
2370         (WebCore::InspectorPageAgent::frameStartedLoading):
2371         (WebCore::InspectorPageAgent::snapshotNode):
2372         * inspector/InspectorPageAgent.h:
2373         * inspector/InspectorReplayAgent.cpp:
2374         (WebCore::InspectorReplayAgent::InspectorReplayAgent):
2375         (WebCore::InspectorReplayAgent::didCreateFrontendAndBackend):
2376         (WebCore::InspectorReplayAgent::willDestroyFrontendAndBackend):
2377         * inspector/InspectorReplayAgent.h:
2378         * inspector/InspectorResourceAgent.cpp:
2379         (WebCore::InspectorResourceAgent::InspectorResourceAgent):
2380         (WebCore::InspectorResourceAgent::~InspectorResourceAgent):
2381         (WebCore::InspectorResourceAgent::timestamp):
2382         (WebCore::InspectorResourceAgent::enable):
2383         (WebCore::InspectorResourceAgent::disable):
2384         * inspector/InspectorResourceAgent.h:
2385         * inspector/InspectorTimelineAgent.cpp:
2386         (WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend):
2387         (WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
2388         (WebCore::InspectorTimelineAgent::internalStart):
2389         (WebCore::InspectorTimelineAgent::internalStop):
2390         (WebCore::InspectorTimelineAgent::timestamp):
2391         (WebCore::InspectorTimelineAgent::startFromConsole):
2392         (WebCore::InspectorTimelineAgent::willCallFunction):
2393         (WebCore::InspectorTimelineAgent::willEvaluateScript):
2394         (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
2395         * inspector/InspectorTimelineAgent.h:
2396         * inspector/InspectorWebAgentBase.h:
2397         (WebCore::InspectorAgentBase::InspectorAgentBase):
2398         * inspector/InspectorWorkerAgent.cpp:
2399         (WebCore::InspectorWorkerAgent::InspectorWorkerAgent):
2400         (WebCore::InspectorWorkerAgent::~InspectorWorkerAgent):
2401         * inspector/InspectorWorkerAgent.h:
2402         * inspector/InstrumentingAgents.cpp:
2403         (WebCore::InstrumentingAgents::InstrumentingAgents): Deleted.
2404         * inspector/InstrumentingAgents.h:
2405         (WebCore::InstrumentingAgents::create):
2406         * inspector/PageConsoleAgent.cpp:
2407         (WebCore::PageConsoleAgent::PageConsoleAgent):
2408         (WebCore::PageConsoleAgent::addInspectedNode):
2409         * inspector/PageConsoleAgent.h:
2410         * inspector/PageDebuggerAgent.cpp:
2411         (WebCore::PageDebuggerAgent::PageDebuggerAgent):
2412         (WebCore::PageDebuggerAgent::enable):
2413         (WebCore::PageDebuggerAgent::disable):
2414         (WebCore::PageDebuggerAgent::injectedScriptForEval):
2415         * inspector/PageDebuggerAgent.h:
2416         * inspector/PageRuntimeAgent.cpp:
2417         (WebCore::PageRuntimeAgent::PageRuntimeAgent):
2418         (WebCore::PageRuntimeAgent::injectedScriptForEval):
2419         (WebCore::PageRuntimeAgent::notifyContextCreated):
2420         * inspector/PageRuntimeAgent.h:
2421         * inspector/WebConsoleAgent.cpp:
2422         (WebCore::WebConsoleAgent::WebConsoleAgent):
2423         (WebCore::WebConsoleAgent::frameWindowDiscarded):
2424         (WebCore::WebConsoleAgent::didFinishXHRLoading):
2425         (WebCore::WebConsoleAgent::didReceiveResponse):
2426         (WebCore::WebConsoleAgent::didFailLoading):
2427         * inspector/WebConsoleAgent.h:
2428         * inspector/WebDebuggerAgent.cpp:
2429         (WebCore::WebDebuggerAgent::WebDebuggerAgent):
2430         (WebCore::WebDebuggerAgent::enable):
2431         (WebCore::WebDebuggerAgent::disable):
2432         * inspector/WebDebuggerAgent.h:
2433         * inspector/WorkerConsoleAgent.cpp:
2434         (WebCore::WorkerConsoleAgent::WorkerConsoleAgent):
2435         * inspector/WorkerConsoleAgent.h:
2436         * inspector/WorkerDebuggerAgent.cpp:
2437         (WebCore::WorkerDebuggerAgent::WorkerDebuggerAgent):
2438         (WebCore::WorkerDebuggerAgent::injectedScriptForEval):
2439         * inspector/WorkerDebuggerAgent.h:
2440         * inspector/WorkerInspectorController.cpp:
2441         (WebCore::WorkerInspectorController::WorkerInspectorController):
2442         * inspector/WorkerInspectorController.h:
2443         * inspector/WorkerRuntimeAgent.cpp:
2444         (WebCore::WorkerRuntimeAgent::WorkerRuntimeAgent):
2445         (WebCore::WorkerRuntimeAgent::injectedScriptForEval):
2446         * inspector/WorkerRuntimeAgent.h:
2447
2448 2015-09-01  Jinyoung Hur  <hur.ims@navercorp.com>
2449
2450         [Cairo][WebGL] Upload the accelerated canvas as a texture by copying via GPU directly
2451         https://bugs.webkit.org/show_bug.cgi?id=148631
2452
2453         Reviewed by Dean Jackson.
2454
2455         When an accelerated canvas needs to be uploaded as a gl texture, it would be better to copy it to 
2456         texture directly via GPU using glCopyTexImage2D. 
2457         Note that GPU copy can not always be enabled because, with premultiplyAlpha and flipY unpack option,
2458         it seems hard to be implemented in a way of direct GPU copy.
2459
2460         No new tests because there is no behavior change.
2461
2462         * html/canvas/WebGLRenderingContextBase.cpp:
2463         (WebCore::WebGLRenderingContextBase::texImage2D):
2464         * platform/graphics/ImageBuffer.cpp:
2465         (WebCore::ImageBuffer::copyToPlatformTexture):
2466         * platform/graphics/ImageBuffer.h:
2467         * platform/graphics/cairo/ImageBufferCairo.cpp:
2468         (WebCore::ImageBuffer::copyToPlatformTexture):
2469
2470 2015-08-31  Dean Jackson  <dino@apple.com>
2471
2472         [mediacontrols] Add tests for the status display label
2473         https://bugs.webkit.org/show_bug.cgi?id=148656
2474         <rdar://problem/22509779>
2475
2476         Reviewed by Eric Carlson.
2477
2478         Export the StatusDisplay element and its current content.
2479
2480         Tests: media/controls/statusDisplay.html
2481                media/controls/statusDisplayBad.html
2482
2483         * Modules/mediacontrols/mediaControlsApple.js:
2484         (Controller.prototype.getCurrentControlsStatus):
2485
2486 2015-08-31  Dean Jackson  <dino@apple.com>
2487
2488         [mediacontrols] Add a test for the show controls button
2489         https://bugs.webkit.org/show_bug.cgi?id=148655
2490         <rdar://problem/22509688>
2491
2492         Reviewed by Eric Carlson.
2493
2494         We'll add a list of control elements to the status object,
2495         so we can query the state of buttons, etc. Begin with the
2496         Show Controls button (used for accessibility).
2497
2498         There are also some drive-by whitespace changes.
2499
2500         Test: media/controls/showControlsButton.html
2501
2502         * Modules/mediacontrols/mediaControlsApple.js:
2503         (Controller.prototype.get idiom): Differentiate between iOS and
2504         OS X. This isn't necessary at the moment, but will come in
2505         handy later.
2506         (Controller.prototype.createControls): Whitespace.
2507         (Controller.prototype.getCurrentControlsStatus): Add the information
2508         on the Show Controls button.
2509         * Modules/mediacontrols/mediaControlsiOS.js:
2510         (ControllerIOS.prototype.get idiom):
2511
2512 2015-09-01  Joseph Pecoraro  <pecoraro@apple.com>
2513
2514         Possible CFArray leak in MediaPlayerPrivateAVFoundationCF.cpp
2515         https://bugs.webkit.org/show_bug.cgi?id=148668
2516
2517         Reviewed by Eric Carlson.
2518
2519         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2520         (WebCore::mimeTypeCache): Deleted.
2521         (WebCore::avfMIMETypes):
2522         Fix the leak in avfMIMETypes. Consolidate on the single implementation.
2523         Note that avfMIMETypes lowercased the inputs and mimeTypeCache did not,
2524         but we now match MediaPlayerPrivateAVFoundationObjC which has one version
2525         that lowercased inputs as well.
2526
2527         (WebCore::MediaPlayerPrivateAVFoundationCF::getSupportedTypes):
2528         (WebCore::MediaPlayerPrivateAVFoundationCF::supportsType):
2529         (WebCore::MediaPlayerPrivateAVFoundationCF::supportsKeySystem):
2530         Convert to th enew verison.
2531
2532 2015-09-01  Javier Fernandez  <jfernandez@igalia.com>
2533
2534         [CSS Grid Layout] Layout is wrong for flex factor sum between 0 and 1
2535         https://bugs.webkit.org/show_bug.cgi?id=148645
2536
2537         Reviewed by Darin Adler.
2538
2539         This patch ensures that we don't normalize the individual tracks
2540         to fill the space. More precisely, when we sum up the flexes, that
2541         tells us how many "units" of flex need to fit into the free
2542         space. We then figure out what size to assign to the flex unit
2543         based on that, and send that back to the individual items, sizing
2544         them appropriately to their flex value.
2545
2546         This way we get flex fraction values applied correctly so they fill
2547         the available space in the indicated proportion. This approach has
2548         an additional advantage of dealing with division by 0 when reducing
2549         automatically the flex value.
2550
2551         Test: fast/css-grid-layout/flex-factor-sum-less-than-1.html
2552
2553         * rendering/RenderGrid.cpp:
2554         (WebCore::RenderGrid::computeNormalizedFractionBreadth):
2555
2556 2015-08-31  Commit Queue  <commit-queue@webkit.org>
2557
2558         Unreviewed, rolling out r189198.
2559         https://bugs.webkit.org/show_bug.cgi?id=148670
2560
2561         "Caused http/tests/navigation/anchor-frames-same-origin.html
2562         to fail on WebKit1" (Requested by cdumez on #webkit).
2563
2564         Reverted changeset:
2565
2566         "http/tests/w3c/dom/nodes/Element-matches.html is flaky"
2567         https://bugs.webkit.org/show_bug.cgi?id=148615
2568         http://trac.webkit.org/changeset/189198
2569
2570 2015-08-31  Joseph Pecoraro  <pecoraro@apple.com>
2571
2572         Remove unused #define
2573         https://bugs.webkit.org/show_bug.cgi?id=148667
2574
2575         Reviewed by Benjamin Poulain.
2576
2577         * platform/network/cf/ResourceResponseCFNet.cpp:
2578
2579 2015-08-31  Chris Dumez  <cdumez@apple.com>
2580
2581         Range API is throwing wrong exception type
2582         https://bugs.webkit.org/show_bug.cgi?id=148648
2583
2584         Reviewed by Ryosuke Niwa.
2585
2586         The RangeException type does not exist in the latest DOM specification.
2587         Instead, the Range API is throwing regular DOMExceptions [1]:
2588         https://dom.spec.whatwg.org/#range
2589
2590         The error codes also differ. RangeException.INVALID_NODE_TYPE_ERR (2)
2591         is replaced with DOMException.INVALID_NODE_TYPE_ERR (24).
2592         RangeException.BAD_BOUNDARYPOINTS_ERR (1) is replaced by
2593         DOMException.INVALID_STATE_ERR (11), as per:
2594         https://dom.spec.whatwg.org/#dom-range-surroundcontents (step 1).
2595
2596         This patch aligns WebKit's behavior with the specification and with
2597         other browsers (tested Firefox and Chrome).
2598
2599         [1] https://heycam.github.io/webidl/#dfn-DOMException
2600
2601         No new tests, covered by existing tests (rebaselined):
2602         http/tests/w3c/dom/ranges/Range-comparePoint.html
2603         http/tests/w3c/dom/ranges/Range-isPointInRange.html
2604         http/tests/w3c/dom/ranges/Range-selectNode.html
2605         http/tests/w3c/dom/ranges/Range-set.html
2606         http/tests/w3c/dom/ranges/Range-surroundContents.html
2607
2608         * CMakeLists.txt:
2609         * DerivedSources.cpp:
2610         * DerivedSources.make:
2611         * WebCore.vcxproj/WebCore.vcxproj:
2612         * WebCore.vcxproj/WebCore.vcxproj.filters:
2613         * WebCore.xcodeproj/project.pbxproj:
2614         * bindings/js/JSExceptionBase.cpp:
2615         (WebCore::toExceptionBase): Deleted.
2616         * dom/DOMAllInOne.cpp:
2617         * dom/DOMExceptions.in:
2618         * dom/Range.cpp:
2619         (WebCore::Range::insertNode):
2620         (WebCore::Range::checkNodeWOffset):
2621         (WebCore::Range::checkNodeBA):
2622         (WebCore::Range::selectNode):
2623         (WebCore::Range::selectNodeContents):
2624         (WebCore::Range::surroundContents):
2625         * dom/RangeException.cpp: Removed.
2626         * dom/RangeException.h: Removed.
2627         * dom/RangeException.idl: Removed.
2628
2629 2015-08-31  Yusuke Suzuki  <utatane.tea@gmail.com>
2630
2631         [ES6] Introduce ModuleProgramExecutable families and compile Module code to bytecode
2632         https://bugs.webkit.org/show_bug.cgi?id=148581
2633
2634         Reviewed by Saam Barati.
2635
2636         Add the ModuleProgramExecutable case.
2637
2638         * testing/Internals.cpp:
2639         (WebCore::Internals::parserMetaData):
2640
2641 2015-08-31  Brent Fulgham  <bfulgham@apple.com>
2642
2643         [Win] WebKit cannot load pages based on "file://" URLs
2644         https://bugs.webkit.org/show_bug.cgi?id=148596
2645         <rdar://problem/22432585>
2646
2647         Reviewed by Dean Jackson.
2648
2649         * platform/URL.cpp:
2650         (WebCore::URL::URL): Work around bug that causes this assertion to fire on
2651         the Apple Windows build.
2652         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
2653         (WebCore::adjustMIMETypeIfNecessary): Added. If the URL is for a local file,
2654         determine the MIME type based on extension. Otherwise use the default MIME type.
2655         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse): If
2656         the CFURLResponse has no MIME type, call 'adjustMIMETypeIfNecessary'.
2657
2658 2015-08-31  Chris Dumez  <cdumez@apple.com>
2659
2660         http/tests/w3c/dom/nodes/Element-matches.html is flaky
2661         https://bugs.webkit.org/show_bug.cgi?id=148615
2662
2663         Reviewed by Ryosuke Niwa.
2664
2665         Several newly-imported w3c tests were flaky due to the :target
2666         pseudo-class selectors sometimes giving different results. The
2667         issue seems to be that this type of selector relies on the
2668         Document::cssTarget() element to do the matching. We update
2669         this cssTarget Element in FrameView's scrollToFragment() /
2670         scrollToAnchor(). This is called from
2671         scrollToFragmentWithParentBoundary() which is called by
2672         FrameLoader's finishedParsing() and loadInSameDocument().
2673
2674         In the first one, it is called *after* calling checkComplete()
2675         which fires the onload event. However, in the second method,
2676         it is called *before*. This patch updates finishedParsing()
2677         so that scrollToFragmentWithParentBoundary() is called *before*
2678         firing the onload event, consistently with loadInSameDocument().
2679         This makes sure that JavaScript executed in an onload event
2680         handler will get accurate results for :target pseudo-class
2681         selectors.
2682
2683         No new tests, covered by:
2684         http/tests/w3c/dom/nodes/Element-matches.html
2685         http/tests/w3c/dom/nodes/ParentNode-querySelector-All-xhtml.xhtml
2686
2687         * loader/FrameLoader.cpp:
2688         (WebCore::FrameLoader::finishedParsing):
2689
2690 2015-08-31  Yusuke Suzuki  <utatane.tea@gmail.com>
2691
2692         The error handler of ReadableJSStream should own stream object
2693         https://bugs.webkit.org/show_bug.cgi?id=148653
2694
2695         Reviewed by Sam Weinig.
2696
2697         ReadableJSStream's m_errorFunction does not own the readable stream.
2698         So when this error callback is executed asynchronously through Promises,
2699         the stream could be already destroyed.
2700         The fulfill callback which is jointly configured with this error callback
2701         owns the stream. However, when the promise is rejected, the following things
2702         occur.
2703
2704         1. Promise clears the fulfill handlers immediately.
2705         2. queue the reject handlers to the microtask queue.
2706         3. When draining the microtasks, the rejected handler will be executed.
2707
2708         At the time of 2 or 3, the references to the fulfill handlers are already discarded.
2709         So when GC occurs at the time of 2 or 3, it will collect the fulfill handlers and the
2710         stream object owned by the fulfill handlers even if the error callback will touch the
2711         stream object later.
2712
2713         Before r189124, this fault does not occur. This is because the std::function in the
2714         fulfill handler is not destroyed before that patch. Since the std::function owns the
2715         stream object, the std::function and the stream object were leaked and never destroyed.
2716         After that patch, the std::function in the fulfill handler becomes destroyed. And it
2717         makes this fault happen.
2718
2719         In this patch, we separate the error callback from the stream object. Previously, the
2720         error callback resides in the stream object as the member. To avoid the cyclic references,
2721         this error callback did not own the stream object. But this causes this fault.
2722         Instead of caching the error callback in the stream object, we always create the error
2723         callback, when it is needed. The created error callback owns the stream object as well as
2724         the fulfill callbacks owns the stream object.
2725
2726         No behavior change.
2727
2728         * bindings/js/ReadableJSStream.cpp:
2729         (WebCore::createGenericErrorRejectedFunction):
2730         (WebCore::ReadableJSStream::doStart):
2731         (WebCore::ReadableJSStream::doPull):
2732         (WebCore::ReadableJSStream::ReadableJSStream): Deleted.
2733         * bindings/js/ReadableJSStream.h:
2734
2735 2015-08-26  Andy Estes  <aestes@apple.com>
2736
2737         [Content Filtering] Determine navigation and content policy before continuing to filter a load
2738         https://bugs.webkit.org/show_bug.cgi?id=148506
2739
2740         Reviewed by Brady Eidson.
2741
2742         Prior to this change, ContentFilter would hide from DocumentLoader all CachedRawResourceClient callbacks until
2743         a decision was made, then replay the missed callbacks. This approach interacted poorly with some features of
2744         the loader, notably appcache and downloads. In the case of appcache, DocumentLoader might not have a chance to
2745         check for substitute data until the original load has finished, wasting bandwidth, and might receive duplicate
2746         or out-of-order callbacks. In the case of downloads, it would often be too late to convert the existing
2747         connection to a download, leading to restarted downloads or outright failures.
2748
2749         Bandaids were put in place for these issues in r188150, r188486, and r188851 to fix crashes or serious
2750         regressions in behavior, but these weren't complete fixes. They did not solve any of the duplicate data loading
2751         problems, and they did not make downloads work reliably in all cases.
2752
2753         This patch rolls out the bandaids (but keeps their tests) and replaces them with a more robust fix. Instead of
2754         hiding callbacks from DocumentLoader, ContentFilter now delivers willSendRequest(), redirectReceived(), and
2755         responseReceived() to DocumentLoader immediately, and cancels filtering if DocumentLoader decides to ignore the
2756         load, download it, or load substitute data. ContentFilter continues to buffer incoming data to prevent partial
2757         rendering of blocked content.
2758
2759         The existing tests for r188150 and r188851 were kept, the test for r188486 was rewritten to be specific to
2760         content filtering, and new tests were added to cover the case where ContentFilter is still undecided after a
2761         load finishes.
2762
2763         Tests: contentfiltering/allow-never.html
2764                contentfiltering/block-never.html
2765                ContentFiltering.AllowDownloadAfterAddData
2766                ContentFiltering.AllowDownloadAfterFinishedAddingData
2767                ContentFiltering.AllowDownloadAfterRedirect
2768                ContentFiltering.AllowDownloadAfterResponse
2769                ContentFiltering.AllowDownloadAfterWillSendRequest
2770                ContentFiltering.AllowDownloadNever
2771                ContentFiltering.BlockDownloadAfterAddData
2772                ContentFiltering.BlockDownloadAfterFinishedAddingData
2773                ContentFiltering.BlockDownloadAfterRedirect
2774                ContentFiltering.BlockDownloadAfterResponse
2775                ContentFiltering.BlockDownloadAfterWillSendRequest
2776                ContentFiltering.BlockDownloadNever
2777
2778         * bindings/js/JSMockContentFilterSettingsCustom.cpp:
2779         (WebCore::JSMockContentFilterSettings::decisionPoint): Taught to handle DecisionPoint::Never, and rewrote to
2780         not need a set of const uint8_ts that mirror the DecisionPoint enum.
2781         (WebCore::JSMockContentFilterSettings::setDecisionPoint): Ditto.
2782         (WebCore::toJSValue): Rewrote to not need a set of const uint8_ts that mirror the Decision enum.
2783         (WebCore::toDecision): Ditto.
2784         * loader/ContentFilter.cpp:
2785         (WebCore::ContentFilter::createIfEnabled): Renamed from createIfNeeded, and changed to take a DocumentLoader&
2786         instead of a DecisionFunction.
2787         (WebCore::ContentFilter::ContentFilter):
2788         (WebCore::ContentFilter::responseReceived): If m_state != Blocked after filtering, call DocumentLoader::responseReceived().
2789         (WebCore::ContentFilter::dataReceived): If m_state == Allowed after filtering, deliver buffered data to DocumentLoader.
2790         If no filtering was necessary, call DocumentLoader::dataReceived() directly.
2791         (WebCore::ContentFilter::redirectReceived): If m_state != Blocked after filtering, call DocumentLoader::redirectReceived().
2792         (WebCore::ContentFilter::notifyFinished): If an error occured, call DocumentLoader::notifyFinished() immediately and return.
2793         If m_state != Blocked after filtering, deliver buffered data to DocumentLoader and call DocumentLoader::notifyFinished().
2794         If no filtering was necessary and m_state != Blocked, call DocumentLoader::notifyFinished() directly.
2795         (WebCore::ContentFilter::didDecide): Called DocumentLoader::contentFilterDidDecide() instead of m_decisionFunction().
2796         (WebCore::ContentFilter::deliverResourceData): Added a helper function to deliver buffered data to DocumentLoader.
2797         (WebCore::ContentFilter::createIfNeeded): Renamed to createIfEnabled().
2798         * loader/ContentFilter.h:
2799         * loader/DocumentLoader.cpp:
2800         (WebCore::DocumentLoader::DocumentLoader):
2801         (WebCore::DocumentLoader::willSendRequest): Stopped asserting that redirectResponse is null and made it part of
2802         the if condition instead, since willSendRequest() will now be called on redirects when there is an active ContentFilter.
2803         (WebCore::DocumentLoader::startLoadingMainResource): Called becomeMainResourceClient() instead of becomeMainResourceClientIfFilterAllows().
2804         (WebCore::DocumentLoader::becomeMainResourceClient): Renamed from becomeMainResourceClientIfFilterAllows().
2805         Only called ContentFilter::startFilteringMainResource() if the filter state is Initialized, since ContentFilter
2806         might have already made a decision in willSendRequest().
2807         (WebCore::DocumentLoader::contentFilterDidDecide): Stopped deleting m_contentFilter, since it will continue to deliver callbacks
2808         even after making a decision. Fixed a bug where we were creating two copies of ContentFilter's replacement data.
2809         (WebCore::DocumentLoader::syntheticRedirectReceived): Deleted.
2810         (WebCore::DocumentLoader::becomeMainResourceClientIfFilterAllows): Renamed to becomeMainResourceClient().
2811         * loader/DocumentLoader.h:
2812         * loader/EmptyClients.h:
2813         * loader/FrameLoaderClient.h:
2814         * loader/ResourceLoader.cpp:
2815         (WebCore::ResourceLoader::willSendRequestInternal): Removed part of r188851.
2816         * loader/SubresourceLoader.cpp:
2817         (WebCore::SubresourceLoader::didReceiveResponse): Removed part of r188486.
2818         * loader/SubresourceLoader.h:
2819         * loader/cache/CachedRawResource.cpp:
2820         (WebCore::CachedRawResource::didAddClient): Removed part of r188150.
2821         * loader/cache/CachedRawResourceClient.h:
2822         (WebCore::CachedRawResourceClient::syntheticRedirectReceived): Removed part of r188150.
2823         * testing/MockContentFilterSettings.h: Defined DecisionPoint::Never.
2824         * testing/MockContentFilterSettings.idl: Defined DECISION_POINT_NEVER.
2825
2826 2015-08-31  Chris Dumez  <cdumez@apple.com>
2827
2828         Unreviewed, rebaseline bindings tests after r189184.
2829
2830 2015-08-31  Chris Dumez  <cdumez@apple.com>
2831
2832         NodeFilter.SHOW_ALL has wrong value on 32-bit
2833         https://bugs.webkit.org/show_bug.cgi?id=148602
2834
2835         Reviewed by Geoffrey Garen.
2836
2837         NodeFilter.SHOW_ALL has wrong value on 32-bit. This is because
2838         NodeFilter.SHOW_ALL is an unsigned long whose value is 0xFFFFFFFF but
2839         our bindings code is casting it to an intptr_t type which is not wide
2840         enough on 32-bit.
2841
2842         No new tests, already covered by fast/dom/node-filter-interface.html
2843         which is now unskipped on Windows / 32bit.
2844
2845         * bindings/scripts/CodeGeneratorJS.pm:
2846         (GenerateHashTableValueArray):
2847         Generate extra curly brackets to initialize the new union member.
2848         Also cast to long long the constant instead of intptr_t.
2849
2850         * dom/NodeFilter.h:
2851         Explicitly mark the enum underlying type to be an unsigned long
2852         to make sure it can hold the value for SHOW_ALL on all platforms.
2853         On Windows, it seems the default underlying type is an int for
2854         e.g.
2855
2856 2015-08-31  Chris Dumez  <cdumez@apple.com>
2857
2858         Range.detach() / NodeIterator.detach() should be no-ops as per the latest DOM specification
2859         https://bugs.webkit.org/show_bug.cgi?id=148454
2860
2861         Reviewed by Ryosuke Niwa.
2862
2863         Range.detach() / NodeIterator.detach() should be no-ops as per the
2864         latest DOM specification:
2865         - https://dom.spec.whatwg.org/#dom-range-detach
2866         - https://dom.spec.whatwg.org/#dom-nodeiterator-detach
2867
2868         These are already no-ops in Firefox:
2869         - https://bugzilla.mozilla.org/show_bug.cgi?id=702948
2870         - https://bugzilla.mozilla.org/show_bug.cgi?id=823549
2871
2872         and Chrome:
2873         - https://src.chromium.org/viewvc/blink?revision=173010&view=revision
2874         - https://src.chromium.org/viewvc/blink?revision=172768&view=revision
2875
2876         Tests: fast/dom/Range/range-detach-noop.html
2877                fast/dom/node-iterator-detach-noop.html
2878
2879         * accessibility/AccessibilityObject.cpp:
2880         (WebCore::AccessibilityObject::selectText):
2881         (WebCore::AccessibilityObject::stringForVisiblePositionRange):
2882         (WebCore::AccessibilityObject::lengthForVisiblePositionRange):
2883         * accessibility/atk/WebKitAccessibleUtil.cpp:
2884         (selectionBelongsToObject):
2885         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2886         (-[WebAccessibilityObjectWrapper arrayOfTextForTextMarkers:attributed:]):
2887         (-[WebAccessibilityObjectWrapper _convertToNSRange:]):
2888         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2889         (-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:]):
2890         (-[WebAccessibilityObjectWrapper _convertToNSRange:]):
2891         * bindings/scripts/CodeGeneratorGObject.pm:
2892         (FunctionUsedToRaiseException):
2893         * dom/DocumentMarkerController.cpp:
2894         (WebCore::DocumentMarkerController::addMarker):
2895         (WebCore::DocumentMarkerController::addTextMatchMarker):
2896         (WebCore::DocumentMarkerController::addDictationPhraseWithAlternativesMarker):
2897         (WebCore::DocumentMarkerController::addDictationResultMarker):
2898         (WebCore::DocumentMarkerController::removeMarkers):
2899         (WebCore::DocumentMarkerController::markersInRange):
2900         (DocumentMarkerController::setMarkersActive):
2901         (DocumentMarkerController::hasMarkers):
2902         (DocumentMarkerController::clearDescriptionOnMarkersIntersectingRange):
2903         * dom/NodeIterator.cpp:
2904         (WebCore::NodeIterator::nextNode):
2905         (WebCore::NodeIterator::previousNode):
2906         (WebCore::NodeIterator::detach):
2907         (WebCore::NodeIterator::NodeIterator): Deleted.
2908         (WebCore::NodeIterator::nodeWillBeRemoved): Deleted.
2909         (WebCore::NodeIterator::updateForNodeRemoval): Deleted.
2910         * dom/NodeIterator.h:
2911         (WebCore::NodeIterator::nextNode):
2912         (WebCore::NodeIterator::previousNode):
2913         * dom/NodeIterator.idl:
2914         * dom/Range.cpp:
2915         (WebCore::Range::commonAncestorContainer):
2916         (WebCore::Range::setStart):
2917         (WebCore::Range::setEnd):
2918         (WebCore::Range::collapse):
2919         (WebCore::Range::isPointInRange):
2920         (WebCore::Range::comparePoint):
2921         (WebCore::Range::compareNode):
2922         (WebCore::Range::compareBoundaryPoints):
2923         (WebCore::Range::boundaryPointsValid):
2924         (WebCore::Range::deleteContents):
2925         (WebCore::Range::processContents):
2926         (WebCore::Range::processContentsBetweenOffsets):
2927         (WebCore::Range::processAncestorsAndTheirSiblings):
2928         (WebCore::Range::extractContents):
2929         (WebCore::Range::cloneContents):
2930         (WebCore::Range::insertNode):
2931         (WebCore::Range::toString):
2932         (WebCore::Range::text):
2933         (WebCore::Range::createContextualFragment):
2934         (WebCore::Range::detach):
2935         (WebCore::Range::cloneRange):
2936         (WebCore::Range::surroundContents):
2937         (WebCore::Range::checkDeleteExtract):
2938         (WebCore::Range::containedByReadOnly):
2939         (WebCore::Range::firstNode):
2940         (WebCore::Range::shadowRoot):
2941         (WebCore::Range::pastLastNode):
2942         (WebCore::Range::absoluteTextRects):
2943         (WebCore::Range::absoluteTextQuads):
2944         (WebCore::Range::collectSelectionRects):
2945         (WebCore::Range::formatForDebugger):
2946         (WebCore::Range::contains):
2947         (WebCore::rangesOverlap):
2948         (WebCore::Range::getBorderAndTextQuads):
2949         (WebCore::Range::boundingRectInternal):
2950         (showTree):
2951         (WebCore::checkForDifferentRootContainer): Deleted.
2952         (WebCore::lengthOfContentsInNode): Deleted.
2953         (WebCore::Range::processNodes): Deleted.
2954         (WebCore::Range::checkNodeWOffset): Deleted.
2955         (WebCore::Range::checkNodeBA): Deleted.
2956         (WebCore::Range::setStartAfter): Deleted.
2957         (WebCore::Range::setEndBefore): Deleted.
2958         (WebCore::Range::setEndAfter): Deleted.
2959         (WebCore::Range::selectNode): Deleted.
2960         (WebCore::intervalsSufficientlyOverlap): Deleted.
2961         (WebCore::coalesceSelectionRects): Deleted.
2962         (WebCore::areRangesEqual): Deleted.
2963         (WebCore::boundaryTextNodesSplit): Deleted.
2964         (WebCore::Range::textNodeSplit): Deleted.
2965         (WebCore::Range::expand): Deleted.
2966         * dom/Range.h:
2967         (WebCore::Range::startContainer):
2968         (WebCore::Range::endContainer):
2969         (WebCore::Range::collapsed):
2970         (WebCore::Range::commonAncestorContainer):
2971         * dom/Range.idl:
2972         * editing/AlternativeTextController.cpp:
2973         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
2974         (WebCore::AlternativeTextController::handleAlternativeTextUIResult):
2975         (WebCore::AlternativeTextController::markReversed):
2976         (WebCore::AlternativeTextController::markCorrection):
2977         (WebCore::AlternativeTextController::recordSpellcheckerResponseForModifiedCorrection):
2978         (WebCore::AlternativeTextController::applyDictationAlternative):
2979         * editing/EditingStyle.cpp:
2980         (WebCore::EditingStyle::styleAtSelectionStart):
2981         * editing/Editor.cpp:
2982         (WebCore::Editor::canDeleteRange):
2983         (WebCore::Editor::shouldDeleteRange):
2984         (WebCore::Editor::advanceToNextMisspelling):
2985         (WebCore::Editor::markMisspellingsOrBadGrammar):
2986         (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
2987         (WebCore::correctSpellcheckingPreservingTextCheckingParagraph):
2988         (WebCore::Editor::markAndReplaceFor):
2989         (WebCore::Editor::changeBackToReplacedString):
2990         (WebCore::Editor::firstRectForRange):
2991         (WebCore::Editor::rangeOfString):
2992         (WebCore::Editor::countMatchesForText):
2993         (WebCore::Editor::scanRangeForTelephoneNumbers):
2994         (WebCore::isFrameInRange): Deleted.
2995         * editing/EditorCommand.cpp:
2996         (WebCore::expandSelectionToGranularity):
2997         (WebCore::unionDOMRanges):
2998         * editing/FormatBlockCommand.cpp:
2999         (WebCore::FormatBlockCommand::elementForFormatBlockCommand):
3000         * editing/FrameSelection.cpp:
3001         (WebCore::FrameSelection::setSelectedRange):
3002         (WebCore::FrameSelection::wordOffsetInRange):
3003         (WebCore::FrameSelection::spaceFollowsWordInRange):
3004         (WebCore::FrameSelection::selectionAtDocumentStart): Deleted.
3005         * editing/MarkupAccumulator.cpp:
3006         (WebCore::MarkupAccumulator::appendText):
3007         * editing/SpellChecker.cpp:
3008         (WebCore::SpellCheckRequest::SpellCheckRequest):
3009         (WebCore::SpellChecker::isCheckable):
3010         * editing/SpellingCorrectionCommand.cpp:
3011         (WebCore::SpellingCorrectionCommand::SpellingCorrectionCommand):
3012         * editing/TextCheckingHelper.cpp:
3013         (WebCore::expandToParagraphBoundary):
3014         (WebCore::TextCheckingParagraph::offsetTo):
3015         (WebCore::TextCheckingParagraph::offsetAsRange):
3016         (WebCore::TextCheckingHelper::findFirstMisspelling):
3017         (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
3018         (WebCore::TextCheckingHelper::findFirstGrammarDetail):
3019         (WebCore::TextCheckingHelper::isUngrammatical):
3020         (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange):
3021         * editing/TextIterator.cpp:
3022         (WebCore::TextIterator::TextIterator):
3023         (WebCore::TextIterator::node):
3024         (WebCore::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
3025         (WebCore::CharacterIterator::range):
3026         (WebCore::characterSubrange):
3027         (WebCore::BackwardsCharacterIterator::range):
3028         (WebCore::TextIterator::rangeFromLocationAndLength):
3029         (WebCore::TextIterator::getLocationAndLengthFromRange):
3030         (WebCore::collapsedToBoundary):
3031         (WebCore::findPlainText):
3032         (WebCore::BackwardsCharacterIterator::BackwardsCharacterIterator): Deleted.
3033         (WebCore::BackwardsCharacterIterator::advance): Deleted.
3034         (WebCore::plainText): Deleted.
3035         * editing/VisibleUnits.cpp:
3036         (WebCore::previousBoundary):
3037         * editing/cocoa/HTMLConverter.mm:
3038         (HTMLConverter::_processText):
3039         (HTMLConverter::_traverseNode):
3040         (HTMLConverter::_traverseFooterNode):
3041         (HTMLConverterCaches::cacheAncestorsOfStartToBeConverted):
3042         (WebCore::editingAttributedStringFromRange):
3043         * editing/mac/EditorMac.mm:
3044         (WebCore::Editor::adjustedSelectionRange):
3045         * editing/markup.cpp:
3046         (WebCore::StyledMarkupAccumulator::renderedText):
3047         (WebCore::StyledMarkupAccumulator::stringValueForRange):
3048         (WebCore::highestAncestorToWrapMarkup):
3049         (WebCore::createMarkupInternal):
3050         (WebCore::createFullMarkup):
3051         (WebCore::urlToMarkup): Deleted.
3052         * loader/archive/cf/LegacyWebArchive.cpp:
3053         (WebCore::LegacyWebArchive::create):
3054         * page/ContextMenuController.cpp:
3055         (WebCore::ContextMenuController::contextMenuItemSelected):
3056         * page/DOMSelection.cpp:
3057         (WebCore::DOMSelection::deleteFromDocument):
3058         (WebCore::DOMSelection::containsNode):
3059         * page/TextIndicator.cpp:
3060         (WebCore::TextIndicator::createWithRange):
3061         * page/ios/FrameIOS.mm:
3062         (WebCore::Frame::indexCountOfWordPrecedingSelection):
3063         (WebCore::Frame::wordsInCurrentParagraph):
3064         * platform/win/PasteboardWin.cpp:
3065         (WebCore::Pasteboard::writeRangeToDataObject):
3066         (WebCore::Pasteboard::writeSelection):
3067         * rendering/RenderNamedFlowThread.cpp:
3068         (WebCore::RenderNamedFlowThread::getRanges):
3069         * rendering/RenderObject.cpp:
3070         (WebCore::RenderObject::absoluteBoundingBoxRectForRange):
3071
3072 2015-08-31  Myles C. Maxfield  <mmaxfield@apple.com>
3073
3074         [Cocoa] Unify showGlyphsWithAdvances
3075         https://bugs.webkit.org/show_bug.cgi?id=148565
3076
3077         Reviewed by Dean Jackson.
3078
3079         None of the fonts created for WebKit have the renderingMode of
3080         NSFontAntialiasedIntegerAdvancementsRenderingMode and are already printer fonts.
3081
3082         No new tests because there is no behavior change.
3083
3084         * platform/graphics/cocoa/FontCascadeCocoa.mm:
3085         (WebCore::setCGFontRenderingMode):
3086         (WebCore::FontCascade::drawGlyphs):
3087
3088 2015-08-31  Tim Horton  <timothy_horton@apple.com>
3089
3090         iOS WebKit2 find-in-page doesn't support multi-line results, is often blank
3091         https://bugs.webkit.org/show_bug.cgi?id=148599
3092         <rdar://problem/17914031>
3093
3094         Reviewed by Beth Dakin.
3095
3096         * editing/FrameSelection.cpp:
3097         (WebCore::FrameSelection::getClippedVisibleTextRectangles):
3098         (WebCore::FrameSelection::getTextRectangles):
3099         * editing/FrameSelection.h:
3100         * page/TextIndicator.cpp:
3101         (WebCore::initializeIndicator):
3102         * page/TextIndicator.h:
3103         Make it possible to create a TextIndicator that isn't clipped to the visible rect,
3104         because iOS find-in-page TextIndicators persist while scrolling the page,
3105         and are already constrained to the document rect anyway.
3106
3107 2015-08-31  Michael Catanzaro  <mcatanzaro@igalia.com>
3108
3109         [Freetype] FontCache::strengthOfFirstAlias leaks an FcPattern
3110         https://bugs.webkit.org/show_bug.cgi?id=148624
3111
3112         Reviewed by Martin Robinson.
3113
3114         Using the normal RefPtr constructor causes the FcPattern to be reffed one extra time. Even
3115         though the FcPattern is intentionally leaked to FcFontSetAdd down below, the FcPattern has
3116         its own refcount and now it's screwed up. Just completely stop using RefPtr for these
3117         FcPatterns, since the potential for confusion regarding leakRef combined with Fontconfig
3118         refcounting far outweighs the benefit of using a smart pointer.
3119
3120         * platform/graphics/freetype/FontCacheFreeType.cpp:
3121         (WebCore::strengthOfFirstAlias):
3122
3123 2015-08-31  Javier Fernandez  <jfernandez@igalia.com>
3124
3125         [CSS Grid Layout] auto-margins alignment does not work for heights
3126         https://bugs.webkit.org/show_bug.cgi?id=148071
3127
3128         Reviewed by Sergio Villar Senin.
3129
3130         We still had pending to align grid items horizontally via auto-margins
3131         alignment. We already landed a patch in r188582 to implement the
3132         column-axis alignment and this patch implements the expected behavior in
3133         the row-axis.
3134
3135         This patch also removes the logic in RenderBox, so we reduce grid related
3136         code dependencies in the general layout logic. We can do that because this
3137         patch manages that in the layoutGridItems function by resetting grid item's
3138         margin and logicalTop (if it does not need to perform a layout, which it
3139         would do the job anyway).
3140
3141         No new tests, we just need to adapt some cases of the ones we already have.
3142
3143         * rendering/RenderBox.cpp:
3144         (WebCore::RenderBox::styleDidChange): Deleted.
3145         (WebCore::RenderBox::willBeRemovedFromTree): Deleted.
3146         (WebCore::RenderBox::updateFromStyle): Deleted.
3147         * rendering/RenderGrid.cpp:
3148         (WebCore::RenderGrid::layoutGridItems):
3149         (WebCore::RenderGrid::resetAutoMarginsAndLogicalTopInColumnAxis):
3150         (WebCore::RenderGrid::updateAutoMarginsInRowAxisIfNeeded):
3151         (WebCore::RenderGrid::updateAutoMarginsInColumnAxisIfNeeded):
3152         (WebCore::RenderGrid::hasAutoMarginsInRowAxis): Deleted.
3153         * rendering/RenderGrid.h:
3154
3155 2015-08-31  Alexey Proskuryakov  <ap@apple.com>
3156
3157         Build fix.
3158
3159         * page/EventHandler.h:
3160         (WebCore::EventHandler::immediateActionStage): Don't export an inline function,
3161         to avoid "weak external symbol" errors.
3162
3163 2015-08-31  Enrica Casucci  <enrica@apple.com>
3164
3165         Incorrect cursor movement for U+26F9, U+1F3CB with variations.
3166         https://bugs.webkit.org/show_bug.cgi?id=148629
3167         rdar://problem/22492366
3168
3169         Reviewed by Ryosuke Niwa.
3170
3171         Updating text break iterator rules to correctly handle those two emoji with variations.
3172
3173         * platform/text/TextBreakIterator.cpp:
3174         (WebCore::cursorMovementIterator):
3175
3176 2015-07-31  Sergio Villar Senin  <svillar@igalia.com>
3177
3178         [css-grid] Grid containers reporting wrong preferred widths
3179         https://bugs.webkit.org/show_bug.cgi?id=147486
3180
3181         Reviewed by Darin Adler.
3182
3183         RenderGrid used to have its own overwritten version of
3184         computePreferredLogicalWidths() because we didn't have an
3185         implementation of computeIntrinsicLogicalWidths(). That
3186         implementation was not as complete as RenderBlock's because it
3187         was not taking into account min/max-width restrictions.
3188
3189         Provided that computeIntrinsicLogicalWidths() has been there
3190         for some time we can safelly kill our overwrite and use
3191         RenderBlock's version which addresses all the FIXMEs we had in
3192         our code.
3193
3194         * rendering/RenderGrid.cpp:
3195         * rendering/RenderGrid.h:
3196
3197 2015-08-31  Sungmann Cho  <sungmann.cho@navercorp.com>
3198
3199         Fix the WinCairo build after landing of webkit.org/b/148561.
3200         https://bugs.webkit.org/show_bug.cgi?id=148627
3201
3202         Reviewed by Myles C. Maxfield.
3203
3204         No new tests, no behavior change.
3205
3206         * platform/graphics/win/ImageCairoWin.cpp:
3207         (WebCore::BitmapImage::getHBITMAPOfSize):
3208         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
3209         (WebCore::MediaPlayerPrivateMediaFoundation::paint):
3210         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
3211
3212 2015-08-31  Antti Koivisto  <antti@apple.com>
3213
3214         REGRESSION (r188820): fast/dom/HTMLObjectElement/object-as-frame.html is flaky
3215         https://bugs.webkit.org/show_bug.cgi?id=148533
3216
3217         Reviewed by Chris Dumez.
3218
3219         <object> element may cause document load event fire too early. By making data URL
3220         loading faster r188820 made this condition more likely to trigger in this test.
3221
3222         * loader/SubframeLoader.cpp:
3223         (WebCore::SubframeLoader::loadSubframe):
3224
3225             Post-parsing style recalc may trigger loads for <object> elements. If all other loads have already
3226             completed this may cause load event to fire synchronously from the initial empty document construction.
3227
3228             Fix by preventing load events during subframe initialization. They will be fired if needed by the
3229             subsequent explicit call to FrameLoader::checkCompleted.
3230
3231 2015-08-30  Ryuan Choi  <ryuan.choi@navercorp.com>
3232
3233         [CoordinatedGraphics] Remove unnecessary two virtual methods from TiledBackingStoreClient
3234         https://bugs.webkit.org/show_bug.cgi?id=147137
3235
3236         Reviewed by Gyuyoung Kim.
3237
3238         tiledBackingStoreContentsRect() and tiledBackingStoreVisibleRect() are not
3239         necessary because CoordinatedGraphicsLayer can pass them directly if needed.
3240         This patch removes them in order to simplify code flow between TiledBackingStore
3241         and CoordinatedGraphicsLayer.
3242
3243         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3244         (WebCore::CoordinatedGraphicsLayer::imageBackingVisible):
3245         (WebCore::CoordinatedGraphicsLayer::adjustContentsScale):
3246         (WebCore::clampToContentsRectIfRectIsInfinite):
3247         (WebCore::CoordinatedGraphicsLayer::transformedVisibleRect):
3248         (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
3249         (WebCore::CoordinatedGraphicsLayer::tiledBackingStoreContentsRect): Deleted.
3250         (WebCore::CoordinatedGraphicsLayer::tiledBackingStoreVisibleRect): Deleted.
3251         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
3252         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
3253         (WebCore::TiledBackingStore::createTilesIfNeeded):
3254         (WebCore::TiledBackingStore::coverageRatio):
3255         (WebCore::TiledBackingStore::visibleAreaIsCovered):
3256         Used TiledBackingStore's m_visibleRect and m_rect, cached and scaled values for
3257         visibleRect, contentsRect.
3258         (WebCore::TiledBackingStore::createTiles):
3259         (WebCore::TiledBackingStore::removeAllNonVisibleTiles):
3260         (WebCore::TiledBackingStore::coverWithTilesIfNeeded): Renamed to createTilesIfNeeded.
3261         (WebCore::TiledBackingStore::visibleRect): Deleted. nobody used.
3262         * platform/graphics/texmap/coordinated/TiledBackingStore.h:
3263         * platform/graphics/texmap/coordinated/TiledBackingStoreClient.h:
3264         (WebCore::TiledBackingStoreClient::tiledBackingStoreHasPendingTileCreation):
3265         Removed default implementation.
3266
3267 2015-08-29  Jessie Berlin  <berlin@apple.com>
3268
3269         El Capitan build fix.
3270
3271         * platform/graphics/cocoa/FontCascadeCocoa.mm:
3272         (WebCore::FontCascade::drawGlyphs):
3273
3274 2015-08-29  Chris Fleizach  <cfleizach@apple.com>
3275
3276         AX: When navigating the elements of a scrollable element with VoiceOver, the scrollTop() position of the element does not permanently change
3277         https://bugs.webkit.org/show_bug.cgi?id=125720
3278
3279         Reviewed by Daniel Bates.
3280
3281         The scrollToVisible code did not account for scrollable elements that are larger than their viewports.
3282         First, we need to pass the sub-focus up the scroll chain (otherwise we'll scroll some parent to y=0).
3283         Second, we should try to center the focus within the viewport, rather than positioning at the bottom for a 
3284         better experience.
3285
3286         This change was adapted from Blink r183926:
3287         https://src.chromium.org/viewvc/blink?view=rev&revision=183926
3288
3289         Tests: accessibility/scroll-to-global-point-iframe-nested.html
3290                accessibility/scroll-to-global-point-iframe.html
3291                accessibility/scroll-to-global-point-main-window.html
3292                accessibility/scroll-to-global-point-nested.html
3293                accessibility/scroll-to-make-visible-div-overflow.html
3294                accessibility/scroll-to-make-visible-iframe.html
3295                accessibility/scroll-to-make-visible-nested-2.html
3296                accessibility/scroll-to-make-visible-nested.html
3297                accessibility/scroll-to-make-visible-with-subfocus.html
3298
3299         * accessibility/AccessibilityObject.cpp:
3300         (WebCore::computeBestScrollOffset):
3301         (WebCore::AccessibilityObject::isOnscreen):
3302         (WebCore::AccessibilityObject::scrollToMakeVisibleWithSubFocus):
3303         (WebCore::AccessibilityObject::scrollToGlobalPoint):
3304         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3305         (-[WebAccessibilityObjectWrapper accessibilityScrollToVisible]):
3306         (-[WebAccessibilityObjectWrapper _accessibilityScrollToMakeVisibleWithSubFocus:]):
3307         (-[WebAccessibilityObjectWrapper _accessibilityScrollToGlobalPoint:]):
3308         (-[WebAccessibilityObjectWrapper accessibilityPerformAction:]):
3309
3310 2015-08-28  Myles C. Maxfield  <mmaxfield@apple.com>
3311
3312         Migrate GraphicsContexts from pointers to references
3313         https://bugs.webkit.org/show_bug.cgi?id=148561
3314
3315         Reviewed by Tim Horton.
3316
3317         We were using GraphicsContext*s throughout our rendering code. However,
3318         these contexts can't be nullptr. This patch migrates users to
3319         GraphicsContext&s.
3320
3321         This is a purely mechanical change.
3322
3323         No new tests because there is no behavior change.
3324
3325         * css/CSSFilterImageValue.cpp:
3326         (WebCore::CSSFilterImageValue::image):
3327         * editing/Editor.cpp:
3328         (WebCore::Editor::countMatchesForText):
3329         * editing/FrameSelection.cpp:
3330         (WebCore::FrameSelection::paintCaret):
3331         (WebCore::CaretBase::paintCaret):
3332         (WebCore::DragCaretController::paintDragCaret):
3333         * editing/FrameSelection.h:
3334         * html/HTMLCanvasElement.cpp:
3335         (WebCore::HTMLCanvasElement::paint):
3336         (WebCore::HTMLCanvasElement::createImageBuffer):
3337         (WebCore::HTMLCanvasElement::drawingContext):
3338         * html/HTMLCanvasElement.h:
3339         * html/HTMLVideoElement.cpp:
3340         (WebCore::HTMLVideoElement::paintCurrentFrameInContext):
3341         * html/HTMLVideoElement.h:
3342         * html/canvas/CanvasRenderingContext2D.cpp:
3343         (WebCore::CanvasRenderingContext2D::drawImage):
3344         (WebCore::drawImageToContext):
3345         (WebCore::CanvasRenderingContext2D::fullCanvasCompositedDrawImage):
3346         (WebCore::CanvasRenderingContext2D::drawTextInternal):
3347         * html/canvas/WebGLRenderingContextBase.cpp:
3348         (WebCore::WebGLRenderingContextBase::drawImageIntoBuffer):
3349         * inspector/InspectorOverlay.cpp:
3350         (WebCore::InspectorOverlay::paint):
3351         * page/FrameSnapshotting.cpp:
3352         (WebCore::snapshotFrameRect):
3353         * page/FrameView.cpp:
3354         (WebCore::FrameView::paintScrollCorner):
3355         (WebCore::FrameView::paintScrollbar):
3356         (WebCore::FrameView::paintControlTints):
3357         (WebCore::FrameView::willPaintContents):
3358         (WebCore::FrameView::didPaintContents):
3359         (WebCore::FrameView::paintContents):
3360         (WebCore::FrameView::paintContentsForSnapshot):
3361         (WebCore::FrameView::paintOverhangAreas):
3362         (WebCore::FrameView::adjustPageHeightDeprecated):
3363         * page/FrameView.h:
3364         * page/PrintContext.cpp:
3365         (WebCore::PrintContext::spoolPage):
3366         (WebCore::PrintContext::spoolRect):
3367         * page/win/FrameCGWin.cpp:
3368         (WebCore::drawRectIntoContext):
3369         (WebCore::imageFromRect):
3370         * platform/ScrollView.cpp:
3371         (WebCore::ScrollView::paintScrollCorner):
3372         (WebCore::ScrollView::paintScrollbar):
3373         (WebCore::ScrollView::paintScrollbars):
3374         (WebCore::ScrollView::paintPanScrollIcon):
3375         (WebCore::ScrollView::paint):
3376         (WebCore::ScrollView::paintOverhangAreas):
3377         (WebCore::ScrollView::calculateAndPaintOverhangAreas):
3378         * platform/ScrollView.h:
3379         * platform/Scrollbar.cpp:
3380         (WebCore::Scrollbar::paint):
3381         * platform/Scrollbar.h:
3382         * platform/ScrollbarTheme.h:
3383         (WebCore::ScrollbarTheme::paintScrollCorner):
3384         (WebCore::ScrollbarTheme::defaultPaintScrollCorner):
3385         (WebCore::ScrollbarTheme::paintOverhangAreas):
3386         * platform/ScrollbarThemeComposite.cpp:
3387         (WebCore::ScrollbarThemeComposite::paintScrollCorner):
3388         (WebCore::ScrollbarThemeComposite::paintOverhangAreas):
3389         * platform/ScrollbarThemeComposite.h:
3390         * platform/Theme.cpp:
3391         (WebCore::Theme::drawNamedImage):
3392         * platform/Theme.h:
3393         (WebCore::Theme::paint):
3394         * platform/Widget.h:
3395         * platform/cocoa/ThemeCocoa.cpp:
3396         (WebCore::fitContextToBox):
3397         (WebCore::ThemeCocoa::drawNamedImage):
3398         * platform/cocoa/ThemeCocoa.h:
3399         * platform/efl/WidgetEfl.cpp:
3400         (WebCore::Widget::paint):
3401         * platform/graphics/BitmapImage.cpp:
3402         (WebCore::BitmapImage::drawPattern):
3403         * platform/graphics/BitmapImage.h:
3404         * platform/graphics/CrossfadeGeneratedImage.cpp:
3405         (WebCore::drawCrossfadeSubimage):
3406         (WebCore::CrossfadeGeneratedImage::drawCrossfade):
3407         (WebCore::CrossfadeGeneratedImage::draw):
3408         (WebCore::CrossfadeGeneratedImage::drawPattern):
3409         * platform/graphics/CrossfadeGeneratedImage.h:
3410         * platform/graphics/FontCascade.cpp:
3411         (WebCore::FontCascade::drawText):
3412         (WebCore::FontCascade::drawEmphasisMarks):
3413         (WebCore::FontCascade::drawSimpleText):
3414         (WebCore::FontCascade::drawEmphasisMarksForSimpleText):
3415         (WebCore::FontCascade::drawGlyphBuffer):
3416         * platform/graphics/FontCascade.h:
3417         * platform/graphics/GeneratedImage.h:
3418         * platform/graphics/GradientImage.cpp:
3419         (WebCore::GradientImage::draw):
3420         (WebCore::GradientImage::drawPattern):
3421         * platform/graphics/GradientImage.h:
3422         * platform/graphics/GraphicsContext.cpp:
3423         (WebCore::GraphicsContext::drawText):
3424         (WebCore::GraphicsContext::drawGlyphs):
3425         (WebCore::GraphicsContext::drawEmphasisMarks):
3426         (WebCore::GraphicsContext::drawBidiText):
3427         (WebCore::GraphicsContext::drawImage):
3428         (WebCore::GraphicsContext::drawTiledImage):
3429         (WebCore::GraphicsContext::drawImageBuffer):
3430         (WebCore::GraphicsContext::clipToImageBuffer):
3431         (WebCore::GraphicsContext::createCompatibleBuffer):
3432         (WebCore::GraphicsContext::isCompatibleWithBuffer):
3433         * platform/graphics/GraphicsContext.h:
3434         * platform/graphics/GraphicsContext3D.h:
3435         * platform/graphics/Image.cpp:
3436         (WebCore::Image::fillWithSolidColor):
3437         (WebCore::Image::draw):
3438         (WebCore::Image::drawTiled):
3439         * platform/graphics/Image.h:
3440         (WebCore::Image::drawFrameMatchingSourceSize):
3441         * platform/graphics/ImageBuffer.cpp:
3442         (WebCore::ImageBuffer::createCompatibleBuffer):
3443         * platform/graphics/ImageBuffer.h:
3444         * platform/graphics/MediaPlayer.cpp:
3445         (WebCore::MediaPlayer::paint):
3446         (WebCore::MediaPlayer::paintCurrentFrameInContext):
3447         * platform/graphics/MediaPlayer.h:
3448         * platform/graphics/MediaPlayerPrivate.h:
3449         (WebCore::MediaPlayerPrivateInterface::paintCurrentFrameInContext):
3450         * platform/graphics/NamedImageGeneratedImage.cpp:
3451         (WebCore::NamedImageGeneratedImage::draw):
3452         (WebCore::NamedImageGeneratedImage::drawPattern):
3453         * platform/graphics/NamedImageGeneratedImage.h:
3454         * platform/graphics/ShadowBlur.cpp:
3455         (WebCore::ShadowBlur::adjustBlurRadius):
3456         (WebCore::ShadowBlur::calculateLayerBoundingRect):
3457         (WebCore::ShadowBlur::drawShadowBuffer):
3458         (WebCore::ShadowBlur::drawRectShadow):
3459         (WebCore::ShadowBlur::drawInsetShadow):
3460         (WebCore::ShadowBlur::drawRectShadowWithoutTiling):
3461         (WebCore::ShadowBlur::drawInsetShadowWithoutTiling):
3462         (WebCore::ShadowBlur::drawInsetShadowWithTiling):
3463         (WebCore::ShadowBlur::drawRectShadowWithTiling):
3464         (WebCore::ShadowBlur::drawLayerPieces):
3465         (WebCore::ShadowBlur::blurAndColorShadowBuffer):
3466         (WebCore::ShadowBlur::beginShadowLayer):
3467         (WebCore::ShadowBlur::endShadowLayer):
3468         * platform/graphics/ShadowBlur.h:
3469         * platform/graphics/TextRun.h:
3470         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
3471         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
3472         (WebCore::MediaPlayerPrivateAVFoundationCF::paintCurrentFrameInContext):
3473         (WebCore::MediaPlayerPrivateAVFoundationCF::paint):
3474         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
3475         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3476         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3477         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintCurrentFrameInContext):
3478         (WebCore::MediaPlayerPrivateAVFoundationObjC::paint):
3479         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithImageGenerator):
3480         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
3481         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
3482         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3483         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paint):
3484         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paintCurrentFrameInContext):
3485         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
3486         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
3487         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paint):
3488         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext):
3489         * platform/graphics/cairo/BitmapImageCairo.cpp:
3490         (WebCore::BitmapImage::draw):
3491         * platform/graphics/cairo/FontCairo.cpp:
3492         (WebCore::drawGlyphsToContext):
3493         (WebCore::drawGlyphsShadow):
3494         (WebCore::FontCascade::drawGlyphs):
3495         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
3496         (WebCore::FontCascade::drawComplexText):
3497         (WebCore::FontCascade::drawEmphasisMarksForComplexText):
3498         * platform/graphics/cairo/GraphicsContextCairo.cpp:
3499         (WebCore::drawPathShadow):
3500         (WebCore::fillCurrentCairoPath):
3501         (WebCore::shadowAndFillCurrentCairoPath):
3502         (WebCore::shadowAndStrokeCurrentCairoPath):
3503         (WebCore::GraphicsContext::fillPath):
3504         (WebCore::GraphicsContext::strokePath):
3505         (WebCore::GraphicsContext::fillRect):
3506         (WebCore::GraphicsContext::strokeRect):
3507         (WebCore::GraphicsContext::platformFillRoundedRect):
3508         (WebCore::GraphicsContext::fillRectWithRoundedHole):
3509         * platform/graphics/cairo/ImageBufferCairo.cpp:
3510         (WebCore::ImageBuffer::context):
3511         (WebCore::ImageBuffer::clip):
3512         (WebCore::ImageBuffer::draw):
3513         (WebCore::ImageBuffer::drawPattern):
3514         (WebCore::ImageBuffer::toDataURL):
3515         * platform/graphics/cairo/ImageCairo.cpp:
3516         (WebCore::Image::drawPattern):
3517         * platform/graphics/cairo/PlatformContextCairo.cpp:
3518         (WebCore::PlatformContextCairo::drawSurfaceToContext):
3519         * platform/graphics/cairo/PlatformContextCairo.h:
3520         * platform/graphics/cg/BitmapImageCG.cpp:
3521         (WebCore::BitmapImage::draw):
3522         * platform/graphics/cg/GraphicsContext3DCG.cpp:
3523         (WebCore::GraphicsContext3D::paintToCanvas):
3524         * platform/graphics/cg/GraphicsContextCG.cpp:
3525         (WebCore::GraphicsContext::fillRect):
3526         (WebCore::GraphicsContext::platformFillRoundedRect):
3527         (WebCore::GraphicsContext::fillRectWithRoundedHole):
3528         * platform/graphics/cg/ImageBufferCG.cpp:
3529         (WebCore::ImageBuffer::ImageBuffer):
3530         (WebCore::ImageBuffer::context):
3531         (WebCore::ImageBuffer::flushContext):
3532         (WebCore::ImageBuffer::copyNativeImage):
3533         (WebCore::ImageBuffer::draw):
3534         (WebCore::ImageBuffer::drawPattern):
3535         (WebCore::ImageBuffer::clip):
3536         (WebCore::ImageBuffer::getUnmultipliedImageData):
3537         (WebCore::ImageBuffer::getPremultipliedImageData):
3538         (WebCore::ImageBuffer::putByteArray):
3539         (WebCore::ImageBuffer::toDataURL):
3540         * platform/graphics/cg/ImageCG.cpp:
3541         (WebCore::Image::drawPattern):
3542         * platform/graphics/cg/PDFDocumentImage.cpp:
3543         (WebCore::PDFDocumentImage::cacheParametersMatch):
3544         (WebCore::transformContextForPainting):
3545         (WebCore::PDFDocumentImage::updateCachedImageIfNeeded):
3546         (WebCore::PDFDocumentImage::draw):
3547         (WebCore::applyRotationForPainting):
3548         (WebCore::PDFDocumentImage::drawPDFPage):
3549         * platform/graphics/cg/PDFDocumentImage.h:
3550         * platform/graphics/cocoa/FontCascadeCocoa.mm:
3551         (WebCore::showLetterpressedGlyphsWithAdvances):
3552         (WebCore::showGlyphsWithAdvances):
3553         (WebCore::FontCascade::drawGlyphs):
3554         (WebCore::FontCascade::drawComplexText):
3555         (WebCore::FontCascade::drawEmphasisMarksForComplexText):
3556         * platform/graphics/efl/ImageBufferEfl.cpp:
3557         (WebCore::ImageBuffer::toDataURL):
3558         * platform/graphics/filters/FEBlend.cpp:
3559         (WebCore::FEBlend::platformApplySoftware):
3560         * platform/graphics/filters/FEColorMatrix.cpp:
3561         (WebCore::FEColorMatrix::platformApplySoftware):
3562         * platform/graphics/filters/FEComposite.cpp:
3563         (WebCore::FEComposite::platformApplySoftware):
3564         * platform/graphics/filters/FEDropShadow.cpp:
3565         (WebCore::FEDropShadow::platformApplySoftware):
3566         * platform/graphics/filters/FEFlood.cpp:
3567         (WebCore::FEFlood::platformApplySoftware):
3568         * platform/graphics/filters/FEMerge.cpp:
3569         (WebCore::FEMerge::platformApplySoftware):
3570         * platform/graphics/filters/FEOffset.cpp:
3571         (WebCore::FEOffset::platformApplySoftware):
3572         * platform/graphics/filters/FETile.cpp:
3573         (WebCore::FETile::platformApplySoftware):
3574         * platform/graphics/filters/FilterEffect.cpp:
3575         (WebCore::FilterEffect::createImageBufferResult): Deleted.
3576         * platform/graphics/filters/SourceAlpha.cpp:
3577         (WebCore::SourceAlpha::platformApplySoftware):
3578         * platform/graphics/filters/SourceGraphic.cpp:
3579         (WebCore::SourceGraphic::platformApplySoftware):
3580         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3581         (WebCore::MediaPlayerPrivateGStreamerBase::paint):
3582         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
3583         * platform/graphics/mac/GraphicsContextMac.mm:
3584         (WebCore::GraphicsContext::drawLineForDocumentMarker):
3585         * platform/graphics/mac/IconMac.mm:
3586         (WebCore::Icon::paint):
3587         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
3588         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3589         (WebCore::MediaPlayerPrivateQTKit::paintCurrentFrameInContext):
3590         (WebCore::MediaPlayerPrivateQTKit::paint):
3591         * platform/graphics/mac/PDFDocumentImageMac.mm:
3592         (WebCore::PDFDocumentImage::drawPDFPage):
3593         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
3594         (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
3595         * platform/graphics/texmap/BitmapTexture.cpp:
3596         (WebCore::BitmapTexture::updateContents):
3597         * platform/graphics/win/FontCGWin.cpp:
3598         (WebCore::FontCascade::drawGlyphs):
3599         * platform/graphics/win/FontWin.cpp:
3600         (WebCore::FontCascade::drawComplexText):
3601         (WebCore::FontCascade::drawEmphasisMarksForComplexText):
3602         * platform/graphics/win/IconWin.cpp:
3603         (WebCore::Icon::paint):
3604         * platform/graphics/win/ImageCGWin.cpp:
3605         (WebCore::BitmapImage::getHBITMAPOfSize):
3606         (WebCore::BitmapImage::drawFrameMatchingSourceSize):
3607         * platform/graphics/win/ImageCairoWin.cpp:
3608         (WebCore::BitmapImage::getHBITMAPOfSize):
3609         (WebCore::BitmapImage::drawFrameMatchingSourceSize):
3610         * platform/graphics/win/LocalWindowsContext.h:
3611         (WebCore::LocalWindowsContext::LocalWindowsContext):
3612         (WebCore::LocalWindowsContext::~LocalWindowsContext):
3613         * platform/gtk/WidgetGtk.cpp:
3614         (WebCore::Widget::paint):
3615         * platform/ios/WidgetIOS.mm:
3616         (WebCore::Widget::paint):
3617         * platform/mac/DragImageMac.mm:
3618         (WebCore::drawAtPoint):
3619         * platform/mac/LocalCurrentGraphicsContext.h:
3620         (WebCore::ContextContainer::ContextContainer):
3621         * platform/mac/LocalCurrentGraphicsContext.mm:
3622         (WebCore::LocalCurrentGraphicsContext::LocalCurrentGraphicsContext):
3623         (WebCore::LocalCurrentGraphicsContext::~LocalCurrentGraphicsContext):
3624         (WebCore::LocalCurrentGraphicsContext::cgContext):
3625         * platform/mac/ScrollbarThemeMac.mm:
3626         (WebCore::ScrollbarThemeMac::paint):
3627         * platform/mac/ThemeMac.h:
3628         * platform/mac/ThemeMac.mm:
3629         (WebCore::paintToggleButton):
3630         (WebCore::paintButton):
3631         (WebCore::paintStepper):
3632         (WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext):
3633         (WebCore::ThemeMac::paint):
3634         * platform/mac/WidgetMac.mm:
3635         (WebCore::Widget::paint):
3636         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
3637         (WebCore::MockMediaPlayerMediaSource::paint):
3638         * platform/mock/mediasource/MockMediaPlayerMediaSource.h:
3639         * platform/win/PopupMenuWin.cpp:
3640         (WebCore::PopupMenuWin::paint):
3641         * platform/win/ScrollbarThemeWin.cpp:
3642         (WebCore::ScrollbarThemeWin::paintTrackPiece):
3643         (WebCore::ScrollbarThemeWin::paintButton):
3644         (WebCore::ScrollbarThemeWin::paintThumb):
3645         * platform/win/WebCoreTextRenderer.cpp:
3646         (WebCore::doDrawTextAtPoint):
3647         * platform/win/WidgetWin.cpp:
3648         (WebCore::Widget::paint):
3649         * rendering/EllipsisBox.cpp:
3650         (WebCore::EllipsisBox::paint):
3651         (WebCore::EllipsisBox::paintSelection):
3652         * rendering/EllipsisBox.h:
3653         * rendering/FilterEffectRenderer.cpp:
3654         (WebCore::FilterEffectRenderer::inputContext):
3655         (WebCore::FilterEffectRendererHelper::applyFilterEffect):
3656         * rendering/FilterEffectRenderer.h:
3657         * rendering/ImageQualityController.cpp:
3658         (WebCore::ImageQualityController::shouldPaintAtLowQuality):
3659         * rendering/ImageQualityController.h:
3660         * rendering/InlineFlowBox.cpp:
3661         (WebCore::InlineFlowBox::paintFillLayer):
3662         (WebCore::InlineFlowBox::paintBoxDecorations):
3663         (WebCore::InlineFlowBox::paintMask):
3664         * rendering/InlineTextBox.cpp:
3665         (WebCore::InlineTextBox::paint):
3666         * rendering/PaintInfo.h:
3667         (WebCore::PaintInfo::PaintInfo):
3668         (WebCore::PaintInfo::context):
3669         (WebCore::PaintInfo::setContext):
3670         (WebCore::PaintInfo::applyTransform):
3671         * rendering/RenderBlock.cpp:
3672         (WebCore::RenderBlock::paint):
3673         (WebCore::RenderBlock::paintCaret):
3674         (WebCore::RenderBlock::paintObject):
3675         (WebCore::RenderBlock::paintSelection):
3676         (WebCore::clipOutPositionedObjects):
3677         (WebCore::RenderBlock::blockSelectionGap):
3678         (WebCore::RenderBlock::logicalLeftSelectionGap):
3679         (WebCore::RenderBlock::logicalRightSelectionGap):
3680         * rendering/RenderBlockFlow.cpp:
3681         (WebCore::RenderBlockFlow::paintColumnRules):
3682         (WebCore::RenderBlockFlow::clipOutFloatingObjects):
3683         * rendering/RenderBox.cpp:
3684         (WebCore::RenderBox::determineBackgroundBleedAvoidance):
3685         (WebCore::RenderBox::paintBoxDecorations):
3686         (WebCore::RenderBox::paintMask):
3687         (WebCore::RenderBox::paintClippingMask):
3688         (WebCore::RenderBox::paintMaskImages):
3689         (WebCore::RenderBox::paintFillLayers):
3690         (WebCore::RenderBox::pushContentsClip):
3691         (WebCore::RenderBox::popContentsClip):
3692         * rendering/RenderBox.h:
3693         * rendering/RenderBoxModelObject.cpp:
3694         (WebCore::RenderBoxModelObject::shouldPaintAtLowQuality):
3695         (WebCore::RenderBoxModelObject::clipRoundedInnerRect):
3696         (WebCore::applyBoxShadowForBackground):
3697         (WebCore::RenderBoxModelObject::paintMaskForTextFillBox):
3698         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
3699         (WebCore::RenderBoxModelObject::paintNinePieceImage):
3700         (WebCore::RenderBoxModelObject::paintOneBorderSide):
3701         (WebCore::RenderBoxModelObject::paintBorderSides):
3702         (WebCore::RenderBoxModelObject::paintTranslucentBorderSides):
3703         (WebCore::RenderBoxModelObject::paintBorder):
3704         (WebCore::RenderBoxModelObject::drawBoxSideFromPath):
3705         (WebCore::RenderBoxModelObject::clipBorderSidePolygon):
3706         (WebCore::RenderBoxModelObject::clipBorderSideForComplexInnerPath):
3707         (WebCore::RenderBoxModelObject::paintBoxShadow):
3708         (WebCore::RenderBoxModelObject::shouldAntialiasLines):
3709         * rendering/RenderBoxModelObject.h:
3710         * rendering/RenderDetailsMarker.cpp:
3711         (WebCore::RenderDetailsMarker::paint):
3712         * rendering/RenderElement.cpp:
3713         (WebCore::RenderElement::paintFocusRing):
3714         (WebCore::RenderElement::paintOutline):
3715         * rendering/RenderEmbeddedObject.cpp:
3716         (WebCore::RenderEmbeddedObject::paintSnapshotImage):
3717         (WebCore::drawReplacementArrow):
3718         (WebCore::RenderEmbeddedObject::paintReplaced):
3719         * rendering/RenderFieldset.cpp:
3720         (WebCore::RenderFieldset::paintBoxDecorations):
3721         * rendering/RenderFileUploadControl.cpp:
3722         (WebCore::RenderFileUploadControl::paintObject):
3723         * rendering/RenderFrameSet.cpp:
3724         (WebCore::RenderFrameSet::paintColumnBorder):
3725         (WebCore::RenderFrameSet::paintRowBorder):
3726         * rendering/RenderHTMLCanvas.cpp:
3727         (WebCore::RenderHTMLCanvas::paintReplaced):
3728         * rendering/RenderImage.cpp:
3729         (WebCore::RenderImage::paintReplaced):
3730         (WebCore::RenderImage::paintAreaElementFocusRing):
3731         (WebCore::RenderImage::paintIntoRect):
3732         * rendering/RenderImage.h:
3733         * rendering/RenderInline.cpp:
3734         (WebCore::RenderInline::paintOutline):
3735         (WebCore::RenderInline::paintOutlineForLine):
3736         * rendering/RenderInline.h:
3737         * rendering/RenderLayer.cpp:
3738         (WebCore::RenderLayer::beginTransparencyLayers):
3739         (WebCore::RenderLayer::paintOverflowControls):
3740         (WebCore::RenderLayer::paintScrollCorner):
3741         (WebCore::RenderLayer::drawPlatformResizerImage):
3742         (WebCore::RenderLayer::paintResizer):
3743         (WebCore::RenderLayer::paint):
3744         (WebCore::RenderLayer::paintOverlayScrollbars):
3745         (WebCore::RenderLayer::clipToRect):
3746         (WebCore::RenderLayer::restoreClip):
3747         (WebCore::RenderLayer::paintLayer):
3748         (WebCore::RenderLayer::paintLayerContentsAndReflection):
3749         (WebCore::RenderLayer::setupFontSubpixelQuantization):
3750         (WebCore::RenderLayer::setupClipPath):
3751         (WebCore::RenderLayer::hasFilterThatIsPainting):
3752         (WebCore::RenderLayer::setupFilters):
3753         (WebCore::RenderLayer::applyFilters):
3754         (WebCore::RenderLayer::paintFixedLayersInNamedFlows):
3755         (WebCore::RenderLayer::paintLayerContents):
3756         (WebCore::RenderLayer::paintLayerByApplyingTransform):
3757         (WebCore::RenderLayer::paintList):
3758         (WebCore::RenderLayer::paintTransformedLayerIntoFragments):
3759         (WebCore::RenderLayer::paintBackgroundForFragments):
3760         (WebCore::RenderLayer::paintForegroundForFragments):
3761         (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
3762         (WebCore::RenderLayer::paintOutlineForFragments):
3763         (WebCore::RenderLayer::paintMaskForFragments):
3764         (WebCore::RenderLayer::paintChildClippingMaskForFragments):
3765         (WebCore::RenderLayer::paintOverflowControlsForFragments):
3766         (WebCore::RenderLayer::calculateClipRects):
3767         * rendering/RenderLayer.h:
3768         * rendering/RenderLayerBacking.cpp:
3769         (WebCore::RenderLayerBacking::paintIntoLayer):
3770         (WebCore::RenderLayerBacking::paintContents):
3771         * rendering/RenderLayerBacking.h:
3772         * rendering/RenderLayerCompositor.cpp:
3773         (WebCore::paintScrollbar):
3774         (WebCore::RenderLayerCompositor::paintContents):
3775         * rendering/RenderListBox.cpp:
3776         (WebCore::RenderListBox::paintScrollbar):
3777         (WebCore::RenderListBox::paintItemForeground):
3778         (WebCore::RenderListBox::paintItemBackground):
3779         * rendering/RenderListMarker.cpp:
3780         (WebCore::RenderListMarker::paint):
3781         * rendering/RenderMediaControls.cpp:
3782         (WebCore::getUnzoomedRectAndAdjustCurrentContext):
3783         (WebCore::RenderMediaControls::paintMediaControlsPart):
3784         * rendering/RenderMultiColumnSet.cpp:
3785         (WebCore::RenderMultiColumnSet::paintColumnRules):
3786         * rendering/RenderObject.cpp:
3787         (WebCore::RenderObject::addPDFURLRect):
3788         * rendering/RenderReplaced.cpp:
3789         (WebCore::RenderReplaced::paint):
3790         * rendering/RenderReplica.cpp:
3791         (WebCore::RenderReplica::paint):
3792         * rendering/RenderScrollbar.cpp:
3793         (WebCore::RenderScrollbar::paint):
3794         (WebCore::RenderScrollbar::paintPart):
3795         * rendering/RenderScrollbar.h:
3796         * rendering/RenderScrollbarPart.cpp:
3797         (WebCore::RenderScrollbarPart::paintIntoRect):
3798         * rendering/RenderScrollbarPart.h:
3799         * rendering/RenderScrollbarTheme.cpp:
3800         (WebCore::RenderScrollbarTheme::paintScrollCorner):
3801         (WebCore::RenderScrollbarTheme::paintScrollbarBackground):
3802         (WebCore::RenderScrollbarTheme::paintTrackBackground):
3803         (WebCore::RenderScrollbarTheme::paintTrackPiece):
3804         (WebCore::RenderScrollbarTheme::paintButton):
3805         (WebCore::RenderScrollbarTheme::paintThumb):
3806         * rendering/RenderScrollbarTheme.h:
3807         * rendering/RenderSnapshottedPlugIn.cpp:
3808         (WebCore::RenderSnapshottedPlugIn::paintSnapshot):
3809         * rendering/RenderTable.cpp:
3810         (WebCore::RenderTable::paintBoxDecorations):
3811         * rendering/RenderTableCell.cpp:
3812         (WebCore::RenderTableCell::paintCollapsedBorders):
3813         (WebCore::RenderTableCell::paintBackgroundsBehindCell):
3814         * rendering/RenderTableSection.cpp:
3815         (WebCore::RenderTableSection::paintRowGroupBorder):
3816         (WebCore::RenderTableSection::paintRowGroupBorderIfRequired):
3817         * rendering/RenderTheme.cpp:
3818         (WebCore::RenderTheme::paint):
3819         (WebCore::RenderTheme::paintBorderOnly):
3820         (WebCore::RenderTheme::paintDecorations):
3821         (WebCore::RenderTheme::paintSliderTicks):
3822         * rendering/RenderThemeEfl.cpp:
3823         (WebCore::RenderThemeEfl::paintThemePart):
3824         * rendering/RenderThemeGtk.cpp:
3825         (WebCore::paintToggle):
3826         (WebCore::renderButton):
3827         (WebCore::RenderThemeGtk::paintMenuList):
3828         (WebCore::RenderThemeGtk::paintTextField):
3829         (WebCore::paintGdkPixbuf):
3830         (WebCore::RenderThemeGtk::paintSearchFieldResultsDecorationPart):
3831         (WebCore::RenderThemeGtk::paintSearchFieldCancelButton):
3832         (WebCore::RenderThemeGtk::paintCapsLockIndicator):
3833         (WebCore::RenderThemeGtk::paintSliderTrack):
3834         (WebCore::RenderThemeGtk::paintSliderThumb):
3835         (WebCore::RenderThemeGtk::paintProgressBar):
3836         (WebCore::paintSpinArrowButton):
3837         (WebCore::RenderThemeGtk::paintMediaButton):
3838         (WebCore::RenderThemeGtk::paintMediaFullscreenButton):
3839         (WebCore::RenderThemeGtk::paintMediaMuteButton):
3840         (WebCore::RenderThemeGtk::paintMediaPlayButton):
3841         (WebCore::RenderThemeGtk::paintMediaSeekBackButton):
3842         (WebCore::RenderThemeGtk::paintMediaSeekForwardButton):
3843         (WebCore::RenderThemeGtk::paintMediaToggleClosedCaptionsButton):
3844         (WebCore::RenderThemeGtk::paintMediaSliderTrack):
3845         (WebCore::RenderThemeGtk::paintMediaSliderThumb):
3846         (WebCore::RenderThemeGtk::paintMediaVolumeSliderTrack):
3847         * rendering/RenderThemeGtk.h:
3848         * rendering/RenderThemeIOS.h:
3849         * rendering/RenderThemeIOS.mm:
3850         (WebCore::RenderThemeIOS::addRoundedBorderClip):
3851         (WebCore::RenderThemeIOS::paintCheckboxDecorations):
3852         (WebCore::RenderThemeIOS::paintRadioDecorations):
3853         (WebCore::RenderThemeIOS::paintTextFieldDecorations):
3854         (WebCore::RenderThemeIOS::paintMenuListButtonDecorations):
3855         (WebCore::RenderThemeIOS::paintSliderTrack):
3856         (WebCore::RenderThemeIOS::paintSliderThumbDecorations):
3857         (WebCore::RenderThemeIOS::paintProgressBar):
3858         (WebCore::RenderThemeIOS::paintPushButtonDecorations):
3859         (WebCore::RenderThemeIOS::paintFileUploadIconDecorations):
3860         * rendering/RenderThemeMac.mm:
3861         (WebCore::RenderThemeMac::paintTextField):
3862         (WebCore::RenderThemeMac::paintTextArea):
3863         (WebCore::RenderThemeMac::paintMenuList):
3864         (WebCore::RenderThemeMac::paintMeter):
3865         (WebCore::RenderThemeMac::paintProgressBar):
3866         (WebCore::RenderThemeMac::paintMenuListButtonGradients):
3867         (WebCore::RenderThemeMac::paintMenuListButtonDecorations):
3868         (WebCore::RenderThemeMac::paintCellAndSetFocusedElementNeedsRepaintIfNecessary):
3869         (WebCore::RenderThemeMac::paintSliderTrack):
3870         (WebCore::RenderThemeMac::paintSliderThumb):
3871         (WebCore::RenderThemeMac::paintSearchField):
3872         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
3873         (WebCore::RenderThemeMac::paintSearchFieldResultsDecorationPart):
3874         (WebCore::RenderThemeMac::paintSearchFieldResultsButton):
3875         (WebCore::RenderThemeMac::paintSnapshottedPluginOverlay):
3876         (WebCore::RenderThemeMac::paintImageControlsButton):
3877         (WebCore::RenderThemeMac::paintAttachment):
3878         * rendering/RenderThemeSafari.cpp:
3879         (WebCore::RenderThemeSafari::paintCheckbox):
3880         (WebCore::RenderThemeSafari::paintRadio):
3881         (WebCore::RenderThemeSafari::paintButton):
3882         (WebCore::RenderThemeSafari::paintTextField):
3883         (WebCore::RenderThemeSafari::paintCapsLockIndicator):
3884         (WebCore::RenderThemeSafari::paintTextArea):
3885         (WebCore::RenderThemeSafari::paintMenuList):
3886         (WebCore::RenderThemeSafari::paintMenuListButtonGradients):
3887         (WebCore::RenderThemeSafari::paintMenuListButtonDecorations):
3888         (WebCore::RenderThemeSafari::paintSliderTrack):
3889         (WebCore::RenderThemeSafari::paintSliderThumb):
3890         (WebCore::RenderThemeSafari::paintSearchField):
3891         (WebCore::RenderThemeSafari::paintSearchFieldCancelButton):
3892         (WebCore::RenderThemeSafari::paintSearchFieldResultsDecorationPart):
3893         (WebCore::RenderThemeSafari::paintSearchFieldResultsButton):
3894         * rendering/RenderThemeWin.cpp:
3895         (WebCore::drawControl):
3896         (WebCore::RenderThemeWin::paintButton):
3897         (WebCore::RenderThemeWin::paintInnerSpinButton):
3898         (WebCore::RenderThemeWin::paintTextField):
3899         (WebCore::RenderThemeWin::paintMenuList):
3900         (WebCore::RenderThemeWin::paintMenuListButtonDecorations):
3901         (WebCore::RenderThemeWin::paintSliderTrack):
3902         (WebCore::RenderThemeWin::paintSliderThumb):
3903         (WebCore::RenderThemeWin::paintSearchFieldCancelButton):
3904         (WebCore::RenderThemeWin::paintSearchFieldResultsDecorationPart):
3905         (WebCore::RenderThemeWin::paintSearchFieldResultsButton):
3906         (WebCore::RenderThemeWin::paintMeter):
3907         * rendering/RenderVideo.cpp:
3908         (WebCore::RenderVideo::paintReplaced):
3909         * rendering/RenderView.cpp:
3910         (WebCore::RenderView::paint):
3911         (WebCore::RenderView::paintBoxDecorations):
3912         * rendering/RenderWidget.cpp:
3913         (WebCore::RenderWidget::paintContents):
3914         (WebCore::RenderWidget::paint):
3915         * rendering/RootInlineBox.cpp:
3916         (WebCore::RootInlineBox::lineSelectionGap):
3917         * rendering/SimpleLineLayoutFunctions.cpp:
3918         (WebCore::SimpleLineLayout::paintFlow):
3919         * rendering/mathml/RenderMathMLBlock.cpp:
3920         (WebCore::RenderMathMLBlock::paint):
3921         * rendering/mathml/RenderMathMLFraction.cpp:
3922         (WebCore::RenderMathMLFraction::paint):
3923         * rendering/mathml/RenderMathMLMenclose.cpp:
3924         (WebCore::RenderMathMLMenclose::paint):
3925         * rendering/mathml/RenderMathMLOperator.cpp:
3926         (WebCore::RenderMathMLOperator::paintGlyph):
3927         (WebCore::RenderMathMLOperator::fillWithVerticalExtensionGlyph):
3928         (WebCore::RenderMathMLOperator::fillWithHorizontalExtensionGlyph):
3929         (WebCore::RenderMathMLOperator::paint):
3930         * rendering/mathml/RenderMathMLRadicalOperator.cpp:
3931         (WebCore::RenderMathMLRadicalOperator::paint):
3932         * rendering/mathml/RenderMathMLRoot.cpp:
3933         (WebCore::RenderMathMLRoot::paint):
3934         * rendering/shapes/Shape.cpp:
3935         (WebCore::Shape::createRasterShape):
3936         * rendering/style/NinePieceImage.cpp:
3937         (WebCore::NinePieceImage::paint):
3938         * rendering/style/NinePieceImage.h:
3939         * rendering/svg/RenderSVGContainer.cpp:
3940         (WebCore::RenderSVGContainer::paint):
3941         * rendering/svg/RenderSVGEllipse.cpp:
3942         (WebCore::RenderSVGEllipse::fillShape):
3943         (WebCore::RenderSVGEllipse::strokeShape):
3944         * rendering/svg/RenderSVGEllipse.h:
3945         * rendering/svg/RenderSVGForeignObject.cpp:
3946         (WebCore::RenderSVGForeignObject::paint):
3947         * rendering/svg/RenderSVGImage.cpp:
3948         (WebCore::RenderSVGImage::paint):
3949         (WebCore::RenderSVGImage::paintForeground):
3950         * rendering/svg/RenderSVGPath.cpp:
3951         (WebCore::useStrokeStyleToFill):
3952         (WebCore::RenderSVGPath::strokeShape):
3953         * rendering/svg/RenderSVGPath.h:
3954         * rendering/svg/RenderSVGRect.cpp:
3955         (WebCore::RenderSVGRect::fillShape):
3956         (WebCore::RenderSVGRect::strokeShape):
3957         * rendering/svg/RenderSVGRect.h:
3958         * rendering/svg/RenderSVGResourceClipper.cpp:
3959         (WebCore::RenderSVGResourceClipper::applyResource):
3960         (WebCore::RenderSVGResourceClipper::pathOnlyClipping):
3961         (WebCore::RenderSVGResourceClipper::applyClippingToContext):
3962         (WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage):
3963         * rendering/svg/RenderSVGResourceClipper.h:
3964         * rendering/svg/RenderSVGResourceFilter.cpp:
3965         (WebCore::RenderSVGResourceFilter::applyResource):
3966         * rendering/svg/RenderSVGResourceGradient.cpp:
3967         (WebCore::createMaskAndSwapContextForTextGradient):
3968         (WebCore::clipToTextMask):
3969         (WebCore::RenderSVGResourceGradient::applyResource):
3970         * rendering/svg/RenderSVGResourceMarker.cpp:
3971         (WebCore::RenderSVGResourceMarker::applyViewportClip):
3972         (WebCore::RenderSVGResourceMarker::draw):
3973         * rendering/svg/RenderSVGResourceMasker.cpp:
3974         (WebCore::RenderSVGResourceMasker::applyResource):
3975         (WebCore::RenderSVGResourceMasker::drawContentIntoMaskImage):
3976         * rendering/svg/RenderSVGResourcePattern.cpp:
3977         (WebCore::RenderSVGResourcePattern::postApplyResource):
3978         (WebCore::RenderSVGResourcePattern::createTileImage):
3979         * rendering/svg/RenderSVGResourceSolidColor.cpp:
3980         (WebCore::RenderSVGResourceSolidColor::postApplyResource):
3981         * rendering/svg/RenderSVGRoot.cpp:
3982         (WebCore::RenderSVGRoot::paintReplaced):
3983         * rendering/svg/RenderSVGShape.cpp:
3984         (WebCore::RenderSVGShape::fillShape):
3985         (WebCore::RenderSVGShape::strokeShape):
3986         (WebCore::RenderSVGShape::fillStrokeMarkers):
3987         (WebCore::RenderSVGShape::paint):
3988         * rendering/svg/RenderSVGShape.h:
3989         * rendering/svg/RenderSVGText.cpp:
3990         (WebCore::RenderSVGText::paint):
3991         * rendering/svg/RenderSVGViewportContainer.cpp:
3992         (WebCore::RenderSVGViewportContainer::applyViewportClip):
3993         * rendering/svg/SVGInlineFlowBox.cpp:
3994         (WebCore::SVGInlineFlowBox::paintSelectionBackground):
3995         (WebCore::SVGInlineFlowBox::paint):
3996         * rendering/svg/SVGInlineTextBox.cpp:
3997         (WebCore::SVGInlineTextBox::paintSelectionBackground):
3998         (WebCore::SVGInlineTextBox::paint):