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