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