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