9a13b1926ef4998bf67ae0b47a337113efdad833
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2014-09-24  Christophe Dumez  <cdumez@apple.com>
2
3         Use is<SVG*Element>() instead of isSVG*Element()
4         https://bugs.webkit.org/show_bug.cgi?id=137058
5
6         Reviewed by Dirk Schulze.
7
8         Use is<SVG*Element>() instead of isSVG*Element() and drop support for
9         generated isSVG*Element().
10
11         No new tests, no behavior change.
12
13         * css/CSSCursorImageValue.cpp:
14         (WebCore::resourceReferencedByCursorElement):
15         * css/StyleResolver.cpp:
16         (WebCore::StyleResolver::useSVGZoomRulesForLength):
17         * dom/DocumentStyleSheetCollection.cpp:
18         (WebCore::DocumentStyleSheetCollection::collectActiveStyleSheets):
19         * dom/ScriptElement.cpp:
20         (WebCore::toScriptElementIfPossible):
21         * dom/make_names.pl:
22         (printTypeHelpers):
23         * editing/gtk/EditorGtk.cpp:
24         (WebCore::elementURL):
25         * rendering/HitTestResult.cpp:
26         (WebCore::HitTestResult::absoluteImageURL):
27         (WebCore::HitTestResult::isLiveLink):
28         * rendering/svg/RenderSVGEllipse.cpp:
29         (WebCore::RenderSVGEllipse::calculateRadiiAndCenter):
30         * rendering/svg/RenderSVGTransformableContainer.cpp:
31         (WebCore::RenderSVGTransformableContainer::calculateLocalTransform):
32         * rendering/svg/SVGPathData.cpp:
33         (WebCore::updatePathFromCircleElement):
34         * rendering/svg/SVGRenderTreeAsText.cpp:
35         (WebCore::operator<<):
36         * rendering/svg/SVGResources.cpp:
37         (WebCore::targetReferenceFromResource):
38         * svg/SVGAltGlyphDefElement.cpp:
39         (WebCore::SVGAltGlyphDefElement::hasValidGlyphElements):
40         * svg/SVGAltGlyphElement.cpp:
41         (WebCore::SVGAltGlyphElement::hasValidGlyphElements):
42         * svg/SVGAnimateMotionElement.cpp:
43         (WebCore::SVGAnimateMotionElement::hasValidAttributeType):
44         * svg/SVGDocument.cpp:
45         (WebCore::SVGDocument::rootElement):
46         * svg/SVGElement.cpp:
47         (WebCore::SVGElement::isOutermostSVGSVGElement):
48         (WebCore::SVGElement::ownerSVGElement):
49         (WebCore::SVGElement::viewportElement):
50         * svg/SVGFEComponentTransferElement.cpp:
51         (WebCore::SVGFEComponentTransferElement::build):
52         * svg/SVGFELightElement.cpp:
53         (WebCore::SVGFELightElement::findLightElement):
54         * svg/SVGFontData.cpp:
55         (WebCore::SVGFontData::applySVGGlyphSelection):
56         * svg/SVGFontElement.cpp:
57         (WebCore::SVGFontElement::ensureGlyphCache):
58         * svg/SVGFontFaceElement.cpp:
59         (WebCore::SVGFontFaceElement::associatedFontElement):
60         (WebCore::SVGFontFaceElement::rebuildFontFace):
61         * svg/SVGFontFaceSrcElement.cpp:
62         (WebCore::SVGFontFaceSrcElement::srcValue):
63         (WebCore::SVGFontFaceSrcElement::childrenChanged):
64         * svg/SVGGlyphElement.cpp:
65         (WebCore::SVGGlyphElement::invalidateGlyphCache):
66         * svg/SVGHKernElement.cpp:
67         (WebCore::SVGHKernElement::insertedInto):
68         (WebCore::SVGHKernElement::removedFrom):
69         * svg/SVGLengthContext.cpp:
70         (WebCore::SVGLengthContext::determineViewport):
71         * svg/SVGLocatable.cpp:
72         (WebCore::isViewportElement):
73         * svg/SVGMPathElement.cpp:
74         (WebCore::SVGMPathElement::pathElement):
75         (WebCore::SVGMPathElement::notifyParentOfPathChange):
76         * svg/SVGPathElement.cpp:
77         (WebCore::SVGPathElement::invalidateMPathDependencies):
78         * svg/SVGPatternElement.cpp:
79         (WebCore::SVGPatternElement::collectPatternAttributes):
80         * svg/SVGSVGElement.cpp:
81         (WebCore::SVGSVGElement::setupInitialView):
82         * svg/SVGUseElement.cpp:
83         (WebCore::dumpInstanceTree):
84         (WebCore::SVGUseElement::expandUseElementsInShadowTree):
85         * svg/SVGVKernElement.cpp:
86         (WebCore::SVGVKernElement::insertedInto):
87         (WebCore::SVGVKernElement::removedFrom):
88
89 2014-09-24  Benjamin Poulain  <bpoulain@apple.com>
90
91         Remove the style marking from :nth-child()
92         https://bugs.webkit.org/show_bug.cgi?id=137055
93
94         Reviewed by Andreas Kling.
95
96         Previously, :nth-child() had to mark the RenderStyle as unique in order
97         to prevent it from being used for style sharing.
98
99         After r173229, :nth-child() use the more generic element marking
100         "StyleIsAffectedByPreviousSibling".
101
102         In StyleResolver::canShareStyleWithElement(), StyleIsAffectedByPreviousSibling
103         is already used to prevent style sharing of those elements, making the "Unique"
104         flag redundant.
105
106         Since it is now useless, remove the style marking from SelectorChecker and the CSS JIT.
107
108         Tests: fast/css/nth-child-style-sharing-even.html
109                fast/css/nth-child-style-sharing-fixed-integer.html
110                fast/css/nth-child-style-sharing-odd.html
111
112         * css/SelectorChecker.cpp:
113         (WebCore::SelectorChecker::checkOne):
114         * cssjit/SelectorCompiler.cpp:
115         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChild):
116         (WebCore::SelectorCompiler::setElementChildIndexAndUpdateStyle): Deleted.
117         * rendering/style/RenderStyle.h:
118
119 2014-09-23  Chris Dumez  <cdumez@apple.com>
120
121         Add support for is<HTML*Element>() for type checking
122         https://bugs.webkit.org/show_bug.cgi?id=137015
123
124         Reviewed by Benjamin Poulain.
125
126         Add support for is<HTML*Element>() for type checking while keeping
127         support for the legacy toHTML*Element() form until the code base is
128         ported.
129
130         toHTML*Element() helpers are now macros to the new is<HTML*Element>()
131         type checking helpers.
132
133         No new tests, no behavior change.
134
135         * dom/Document.cpp:
136         (WebCore::Document::setTitle):
137         * dom/Element.cpp:
138         (WebCore::Element::childShouldCreateRenderer):
139         * dom/Element.h:
140         (WebCore::is):
141         (WebCore::downcast):
142         (WebCore::isElementOfType): Deleted.
143         * dom/ElementAncestorIterator.h:
144         (WebCore::lineageOfType):
145         * dom/ElementIterator.h:
146         (WebCore::findElementAncestorOfType):
147         * dom/ElementTraversal.h:
148         (WebCore::Traversal<ElementType>::firstChildTemplate):
149         (WebCore::Traversal<ElementType>::lastChildTemplate):
150         (WebCore::Traversal<ElementType>::firstWithinTemplate):
151         (WebCore::Traversal<ElementType>::lastWithinTemplate):
152         (WebCore::Traversal<ElementType>::nextTemplate):
153         (WebCore::Traversal<ElementType>::previous):
154         (WebCore::Traversal<ElementType>::nextSibling):
155         (WebCore::Traversal<ElementType>::previousSibling):
156         (WebCore::Traversal<ElementType>::nextSkippingChildren):
157         * dom/TypedElementDescendantIterator.h:
158         (WebCore::TypedElementDescendantIteratorAdapter<ElementType>::from):
159         (WebCore::TypedElementDescendantConstIteratorAdapter<ElementType>::from):
160         * dom/make_names.pl:
161         (printTypeHelpers):
162
163 2014-09-23  Benjamin Poulain  <bpoulain@apple.com>
164
165         The style resolution cache applies properties incorrectly whenever direction != ltr
166         https://bugs.webkit.org/show_bug.cgi?id=137052
167
168         Reviewed by Andreas Kling.
169
170         The optimization r135021 introduced a bug whenever the direction of subtree is not
171         uniform in the whole page.
172
173         When StyleResolver::applyMatchedProperties() resolves the style, some properties are
174         resolved differently based on the writing-mode and the direction.
175
176         In isCacheableInMatchedPropertiesCache(), the cases for writing-mode are already handled
177         by not caching any style with anything else than the default.
178         The direction was ignored, causing the bugs solved here.
179
180         Tests: css3/flexbox/flex-flow-2.html
181                fast/css/style-resolver-cache-direction-1.html
182                fast/css/style-resolver-cache-direction-2.html
183                fast/css/style-resolver-cache-direction-3.html
184
185         * css/StyleResolver.cpp:
186         (WebCore::isCacheableInMatchedPropertiesCache):
187
188 2014-09-23  Chris Dumez  <cdumez@apple.com>
189
190         Have CSS classes' methods return more references
191         https://bugs.webkit.org/show_bug.cgi?id=137036
192
193         Reviewed by Ryosuke Niwa.
194
195         Have CSS classes' methods return more references instead of pointers
196         when possible.
197
198         No new tests, no behavior change.
199
200         * css/CSSFontFaceRule.cpp:
201         (WebCore::CSSFontFaceRule::style):
202         * css/CSSFontFaceRule.h:
203         * css/CSSGroupingRule.cpp:
204         (WebCore::CSSGroupingRule::cssRules):
205         * css/CSSGroupingRule.h:
206         * css/CSSImportRule.cpp:
207         (WebCore::CSSImportRule::media):
208         * css/CSSImportRule.h:
209         * css/CSSPageRule.cpp:
210         (WebCore::CSSPageRule::style):
211         * css/CSSPageRule.h:
212         * css/CSSStyleRule.cpp:
213         (WebCore::CSSStyleRule::style):
214         * css/CSSStyleRule.h:
215         * css/WebKitCSSKeyframeRule.cpp:
216         (WebCore::WebKitCSSKeyframeRule::style):
217         * css/WebKitCSSKeyframeRule.h:
218         * css/WebKitCSSKeyframesRule.cpp:
219         (WebCore::WebKitCSSKeyframesRule::cssRules):
220         * css/WebKitCSSKeyframesRule.h:
221         * css/WebKitCSSViewportRule.cpp:
222         (WebCore::WebKitCSSViewportRule::style):
223         * css/WebKitCSSViewportRule.h:
224         * inspector/InspectorStyleSheet.cpp:
225         (WebCore::asCSSRuleList):
226         (WebCore::fillMediaListChain):
227         (WebCore::InspectorStyleSheet::setRuleSelector):
228         (WebCore::InspectorStyleSheet::deleteRule):
229         (WebCore::InspectorStyleSheet::buildObjectForSelectorList):
230         (WebCore::InspectorStyleSheet::buildObjectForRule):
231         (WebCore::InspectorStyleSheet::styleForId):
232         (WebCore::InspectorStyleSheet::ruleIndexByStyle):
233         (WebCore::InspectorStyleSheet::ruleId):
234         (WebCore::InspectorStyleSheet::revalidateStyle):
235
236 2014-09-23  Roger Fong  <roger_fong@apple.com>
237
238         [Windows] Enable CSS Supports Rule on Windows.
239
240         * css/CSSAllInOne.cpp:
241
242 2014-09-23  Christophe Dumez  <cdumez@apple.com>
243
244         Unreviewed build fix after r173893.
245
246         Partial revert of r173893 to fix debug builds.
247
248         * accessibility/AccessibilityNodeObject.cpp:
249         (WebCore::AccessibilityNodeObject::text):
250         * bindings/js/JSDOMWindowCustom.cpp:
251         (WebCore::namedItemGetter):
252         (WebCore::JSDOMWindow::getOwnPropertySlot):
253         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
254         * css/SelectorChecker.cpp:
255         (WebCore::SelectorChecker::checkOne):
256         * cssjit/SelectorCompiler.cpp:
257         (WebCore::SelectorCompiler::makeContextStyleUniqueIfNecessaryAndTestIsPlaceholderShown):
258         (WebCore::SelectorCompiler::makeElementStyleUniqueIfNecessaryAndTestIsPlaceholderShown):
259         (WebCore::SelectorCompiler::isPlaceholderShown):
260         * dom/Document.cpp:
261         (WebCore::Document::processHttpEquiv):
262         * dom/Element.cpp:
263         (WebCore::Element::insertedInto):
264         (WebCore::Element::removedFrom):
265         (WebCore::Element::updateName):
266         (WebCore::Element::updateId):
267         * editing/Editor.cpp:
268         (WebCore::Editor::selectionForCommand):
269         (WebCore::findFirstMarkable):
270         * editing/FrameSelection.cpp:
271         (WebCore::FrameSelection::selectAll):
272         * html/HTMLElement.cpp:
273         (WebCore::HTMLElement::matchesReadWritePseudoClass):
274         (WebCore::HTMLElement::directionality):
275         * html/HTMLImageElement.cpp:
276         (WebCore::HTMLImageElement::parseAttribute):
277         * html/HTMLObjectElement.cpp:
278         (WebCore::HTMLObjectElement::updateDocNamedItem):
279         * html/HTMLPlugInImageElement.cpp:
280         (WebCore::addPlugInsFromNodeListMatchingPlugInOrigin):
281         * html/HTMLTextFormControlElement.cpp:
282         (WebCore::enclosingTextFormControl):
283         * page/FrameView.cpp:
284         (WebCore::FrameView::addEmbeddedObjectToUpdate):
285         (WebCore::FrameView::updateEmbeddedObject):
286         * rendering/HitTestResult.cpp:
287         (WebCore::HitTestResult::absolutePDFURL):
288         * rendering/RenderEmbeddedObject.cpp:
289         (WebCore::RenderEmbeddedObject::paintContents):
290         (WebCore::RenderEmbeddedObject::layout):
291         * rendering/RenderSnapshottedPlugIn.cpp:
292         (WebCore::RenderSnapshottedPlugIn::plugInImageElement):
293         * rendering/RenderTextControl.cpp:
294         (WebCore::RenderTextControl::textFormControlElement):
295         * rendering/RenderThemeMac.mm:
296         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
297         (WebCore::RenderThemeMac::paintSnapshottedPluginOverlay):
298         * testing/Internals.cpp:
299         (WebCore::Internals::visiblePlaceholder):
300
301 2014-09-22  Wenson Hsieh  <wenson_hsieh@apple.com>
302
303         Implement snapping behavior for Mac overflow scrolling
304         https://bugs.webkit.org/show_bug.cgi?id=135774
305
306         Reviewed by Beth Dakin.
307
308         Hooks into AxisScrollSnapAnimator to implement overflow scroll snapping on Mac.
309
310         We need to find a way to test this!
311
312         * dom/Element.cpp:
313         (WebCore::Element::dispatchWheelEvent):
314         * page/EventHandler.cpp:
315         (WebCore::handleWheelEventInAppropriateEnclosingBoxForSingleAxis):
316         * platform/ScrollAnimator.cpp:
317         (WebCore::ScrollAnimator::handleWheelEvent):
318         (WebCore::ScrollAnimator::updateScrollAnimatorsAndTimers):
319         (WebCore::ScrollAnimator::scrollOffsetInAxis):
320         (WebCore::ScrollAnimator::immediateScrollInAxis):
321         (WebCore::ScrollAnimator::startScrollSnapTimer):
322         (WebCore::ScrollAnimator::stopScrollSnapTimer):
323         (WebCore::ScrollAnimator::horizontalScrollSnapTimerFired):
324         (WebCore::ScrollAnimator::verticalScrollSnapTimerFired):
325         * platform/ScrollAnimator.h:
326         * platform/mac/AxisScrollSnapAnimator.h:
327         * platform/mac/AxisScrollSnapAnimator.mm:
328         (WebCore::AxisScrollSnapAnimator::AxisScrollSnapAnimator):
329         (WebCore::AxisScrollSnapAnimator::beginScrollSnapAnimation):
330         (WebCore::AxisScrollSnapAnimator::endScrollSnapAnimation):
331         (WebCore::AxisScrollSnapAnimator::initializeGlideParameters):
332         * rendering/RenderLayer.cpp:
333         (WebCore::RenderLayer::updateScrollInfoAfterLayout):
334
335 2014-09-23  Chris Dumez  <cdumez@apple.com>
336
337         Use downcast<HTML*Element>() instead of toHTML*Element()
338         https://bugs.webkit.org/show_bug.cgi?id=137007
339
340         Reviewed by Benjamin Poulain.
341
342         Use downcast<HTML*Element>() instead of toHTML*Element() and drop
343         transition macros for toHTML*Element().
344
345         This patch also cleans up the surrounding code.
346
347         No new tests, no behavior change.
348
349         * accessibility/AXObjectCache.cpp:
350         (WebCore::AXObjectCache::focusedUIElementForPage):
351         (WebCore::AXObjectCache::labelChanged):
352         * accessibility/AccessibilityListBox.cpp:
353         (WebCore::AccessibilityListBox::canSetSelectedChildrenAttribute):
354         (WebCore::AccessibilityListBox::addChildren):
355         * accessibility/AccessibilityListBoxOption.cpp:
356         (WebCore::AccessibilityListBoxOption::isSelected):
357         (WebCore::AccessibilityListBoxOption::stringValue):
358         (WebCore::AccessibilityListBoxOption::listBoxOptionParentNode):
359         * accessibility/AccessibilityMediaControls.cpp:
360         (WebCore::AccessibilityMediaTimeline::valueDescription):
361         * accessibility/AccessibilityMenuListOption.cpp:
362         (WebCore::AccessibilityMenuListOption::isEnabled):
363         (WebCore::AccessibilityMenuListOption::isSelected):
364         (WebCore::AccessibilityMenuListOption::setSelected):
365         (WebCore::AccessibilityMenuListOption::stringValue):
366         * accessibility/AccessibilityMenuListPopup.cpp:
367         (WebCore::AccessibilityMenuListPopup::addChildren):
368         * accessibility/AccessibilityNodeObject.cpp:
369         (WebCore::AccessibilityNodeObject::determineAccessibilityRole):
370         (WebCore::AccessibilityNodeObject::isNativeTextControl):
371         (WebCore::AccessibilityNodeObject::isNativeImage):
372         (WebCore::AccessibilityNodeObject::isInputImage):
373         (WebCore::AccessibilityNodeObject::isMultiSelectable):
374         (WebCore::AccessibilityNodeObject::isReadOnly):
375         (WebCore::AccessibilityNodeObject::valueForRange):
376         (WebCore::AccessibilityNodeObject::maxValueForRange):
377         (WebCore::AccessibilityNodeObject::minValueForRange):
378         (WebCore::isNodeActionElement):
379         (WebCore::AccessibilityNodeObject::alternativeText):
380         (WebCore::AccessibilityNodeObject::visibleText):
381         (WebCore::AccessibilityNodeObject::title):
382         (WebCore::AccessibilityNodeObject::text):
383         (WebCore::AccessibilityNodeObject::stringValue):
384         (WebCore::AccessibilityNodeObject::colorValue):
385         (WebCore::accessibleNameForNode):
386         * accessibility/AccessibilityRenderObject.cpp:
387         (WebCore::AccessibilityRenderObject::isFileUploadButton):
388         (WebCore::AccessibilityRenderObject::stringValue):
389         (WebCore::AccessibilityRenderObject::labelElementContainer):
390         (WebCore::AccessibilityRenderObject::internalLinkElement):
391         (WebCore::AccessibilityRenderObject::addRadioButtonGroupMembers):
392         (WebCore::AccessibilityRenderObject::url):
393         (WebCore::AccessibilityRenderObject::setValue):
394         (WebCore::AccessibilityRenderObject::getDocumentLinks):
395         (WebCore::AccessibilityRenderObject::accessibilityImageMapHitTest):
396         (WebCore::AccessibilityRenderObject::accessibilityHitTest):
397         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
398         (WebCore::AccessibilityRenderObject::addTextFieldChildren):
399         (WebCore::AccessibilityRenderObject::stringValueForMSAA):
400         (WebCore::AccessibilityRenderObject::isLinked):
401         * accessibility/AccessibilitySlider.cpp:
402         (WebCore::AccessibilitySlider::inputElement):
403         (WebCore::AccessibilitySliderThumb::elementRect):
404         * accessibility/AccessibilityTable.cpp:
405         (WebCore::AccessibilityTable::tableElement):
406         (WebCore::AccessibilityTable::title):
407         * accessibility/atk/AXObjectCacheAtk.cpp:
408         (WebCore::notifyChildrenSelectionChange):
409         * accessibility/atk/WebKitAccessibleInterfaceSelection.cpp:
410         (optionFromSelection):
411         (webkitAccessibleSelectionGetSelectionCount):
412         * accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
413         (webkitAccessibleTableGetCaption):
414         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
415         (webkitAccessibleGetDescription):
416         * accessibility/ios/AccessibilityObjectIOS.mm:
417         (WebCore::AccessibilityObject::accessibilityPasswordFieldLength):
418         * bindings/js/JSDOMWindowCustom.cpp:
419         (WebCore::namedItemGetter):
420         (WebCore::JSDOMWindow::getOwnPropertySlot):
421         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
422         * bindings/js/JSHTMLDocumentCustom.cpp:
423         (WebCore::JSHTMLDocument::nameGetter):
424         * bindings/js/JSHTMLFrameSetElementCustom.cpp:
425         (WebCore::JSHTMLFrameSetElement::nameGetter):
426         * bindings/js/JSNodeCustom.cpp:
427         (WebCore::isReachableFromDOM):
428         * css/SelectorChecker.cpp:
429         (WebCore::SelectorChecker::checkOne):
430         * css/SelectorCheckerTestFunctions.h:
431         (WebCore::isChecked):
432         * css/StyleResolver.cpp:
433         (WebCore::StyleResolver::adjustRenderStyle):
434         * css/StyleSheetList.cpp:
435         (WebCore::StyleSheetList::getNamedItem):
436         * cssjit/SelectorCompiler.cpp:
437         (WebCore::SelectorCompiler::makeContextStyleUniqueIfNecessaryAndTestIsPlaceholderShown):
438         (WebCore::SelectorCompiler::makeElementStyleUniqueIfNecessaryAndTestIsPlaceholderShown):
439         (WebCore::SelectorCompiler::isPlaceholderShown):
440         * dom/CurrentScriptIncrementer.h:
441         (WebCore::CurrentScriptIncrementer::CurrentScriptIncrementer):
442         * dom/DataTransfer.cpp:
443         (WebCore::DataTransfer::setDragImage):
444         * dom/Document.cpp:
445         (WebCore::Document::setTitle):
446         (WebCore::Document::processHttpEquiv):
447         (WebCore::Document::iconURLs):
448         * dom/DocumentOrderedMap.cpp:
449         (WebCore::keyMatchesMapName):
450         (WebCore::keyMatchesLowercasedMapName):
451         (WebCore::keyMatchesLowercasedUsemap):
452         (WebCore::DocumentOrderedMap::getElementByMapName):
453         (WebCore::DocumentOrderedMap::getElementByLowercasedMapName):
454         (WebCore::DocumentOrderedMap::getElementByLowercasedUsemap):
455         (WebCore::DocumentOrderedMap::getElementByLabelForAttribute):
456         * dom/DocumentStyleSheetCollection.cpp:
457         (WebCore::DocumentStyleSheetCollection::collectActiveStyleSheets):
458         * dom/Element.cpp:
459         (WebCore::Element::insertedInto):
460         (WebCore::Element::removedFrom):
461         (WebCore::Element::updateName):
462         (WebCore::Element::updateId):
463         (WebCore::Element::updateLabel):
464         (WebCore::Element::ensureCachedHTMLCollection):
465         * dom/EventDispatcher.cpp:
466         (WebCore::EventDispatcher::dispatchEvent):
467         * dom/ScriptElement.cpp:
468         (WebCore::toScriptElementIfPossible):
469         * dom/VisitedLinkState.cpp:
470         (WebCore::linkHashForElement):
471         (WebCore::VisitedLinkState::determineLinkStateSlowCase):
472         * dom/make_names.pl:
473         (printTypeHelpers):
474         * editing/Editor.cpp:
475         (WebCore::Editor::selectionForCommand):
476         (WebCore::imageElementFromImageDocument):
477         (WebCore::findFirstMarkable):
478         * editing/FrameSelection.cpp:
479         (WebCore::FrameSelection::selectAll):
480         (WebCore::scanForForm):
481         * editing/MarkupAccumulator.cpp:
482         (WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
483         * editing/ReplaceSelectionCommand.cpp:
484         (WebCore::ReplaceSelectionCommand::shouldPerformSmartReplace):
485         * editing/VisibleSelection.cpp:
486         (WebCore::VisibleSelection::nonBoundaryShadowTreeRootNode):
487         (WebCore::VisibleSelection::isInPasswordField):
488         * editing/cocoa/HTMLConverter.mm:
489         (HTMLConverter::_processElement):
490         * editing/ios/EditorIOS.mm:
491         (WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection):
492         * editing/markup.cpp:
493         (WebCore::isPlainTextMarkup):
494         * html/ColorInputType.cpp:
495         (WebCore::ColorInputType::suggestions):
496         * html/FTPDirectoryDocument.cpp:
497         (WebCore::FTPDirectoryDocumentParser::loadDocumentTemplate):
498         (WebCore::FTPDirectoryDocumentParser::createBasicDocument):
499         * html/FormAssociatedElement.cpp:
500         (WebCore::FormAssociatedElement::findAssociatedForm):
501         * html/HTMLAnchorElement.cpp:
502         (WebCore::appendServerMapMousePosition):
503         * html/HTMLAreaElement.cpp:
504         (WebCore::HTMLAreaElement::imageElement):
505         * html/HTMLCollection.cpp:
506         (WebCore::isMatchingElement):
507         * html/HTMLElement.cpp:
508         (WebCore::HTMLElement::matchesReadWritePseudoClass):
509         (WebCore::HTMLElement::setInnerHTML):
510         (WebCore::HTMLElement::directionality):
511         * html/HTMLEmbedElement.cpp:
512         (WebCore::HTMLEmbedElement::rendererIsNeeded):
513         * html/HTMLFieldSetElement.cpp:
514         (WebCore::HTMLFieldSetElement::refreshElementsIfNeeded):
515         * html/HTMLFormControlElement.cpp:
516         (WebCore::HTMLFormControlElement::computeIsDisabledByFieldsetAncestor):
517         (WebCore::shouldAutofocus):
518         * html/HTMLFormControlsCollection.cpp:
519         (WebCore::HTMLFormControlsCollection::formControlElements):
520         (WebCore::HTMLFormControlsCollection::formImageElements):
521         * html/HTMLFormElement.cpp:
522         (WebCore::HTMLFormElement::getTextFieldValues):
523         (WebCore::HTMLFormElement::assertItemCanBeInPastNamesMap):
524         * html/HTMLImageElement.cpp:
525         (WebCore::HTMLImageElement::parseAttribute):
526         * html/HTMLImageLoader.cpp:
527         (WebCore::HTMLImageLoader::notifyFinished):
528         * html/HTMLInputElement.cpp:
529         (WebCore::HTMLInputElement::dataList):
530         (WebCore::HTMLInputElement::setupDateTimeChooserParameters):
531         * html/HTMLKeygenElement.cpp:
532         (WebCore::HTMLKeygenElement::shadowSelect):
533         * html/HTMLLegendElement.cpp:
534         (WebCore::HTMLLegendElement::virtualForm):
535         * html/HTMLMediaElement.cpp:
536         (WebCore::HTMLMediaElement::parseAttribute):
537         * html/HTMLNameCollection.cpp:
538         (WebCore::DocumentNameCollection::elementMatchesIfIdAttributeMatch):
539         (WebCore::DocumentNameCollection::elementMatchesIfNameAttributeMatch):
540         (WebCore::DocumentNameCollection::elementMatches):
541         * html/HTMLObjectElement.cpp:
542         (WebCore::HTMLObjectElement::updateDocNamedItem):
543         (WebCore::HTMLObjectElement::containsJavaApplet):
544         * html/HTMLOptGroupElement.cpp:
545         (WebCore::HTMLOptGroupElement::recalcSelectOptions):
546         (WebCore::HTMLOptGroupElement::ownerSelectElement):
547         * html/HTMLOptionElement.cpp:
548         (WebCore::HTMLOptionElement::ownerDataListElement):
549         (WebCore::HTMLOptionElement::ownerSelectElement):
550         * html/HTMLOptionsCollection.cpp:
551         (WebCore::HTMLOptionsCollection::add):
552         * html/HTMLOptionsCollection.h:
553         * html/HTMLPlugInImageElement.cpp:
554         (WebCore::addPlugInsFromNodeListMatchingPlugInOrigin):
555         * html/HTMLSelectElement.cpp:
556         (WebCore::HTMLSelectElement::hasPlaceholderLabelOption):
557         (WebCore::HTMLSelectElement::value):
558         (WebCore::HTMLSelectElement::setValue):
559         (WebCore::HTMLSelectElement::saveLastSelection):
560         (WebCore::HTMLSelectElement::setActiveSelectionAnchorIndex):
561         (WebCore::HTMLSelectElement::updateListBoxSelection):
562         (WebCore::HTMLSelectElement::listBoxOnChange):
563         (WebCore::HTMLSelectElement::recalcListItems):
564         (WebCore::HTMLSelectElement::selectedIndex):
565         (WebCore::HTMLSelectElement::selectOption):
566         (WebCore::HTMLSelectElement::deselectItemsWithoutValidation):
567         (WebCore::HTMLSelectElement::saveFormControlState):
568         (WebCore::HTMLSelectElement::searchOptionsForValue):
569         (WebCore::HTMLSelectElement::restoreFormControlState):
570         (WebCore::HTMLSelectElement::appendFormData):
571         (WebCore::HTMLSelectElement::reset):
572         (WebCore::HTMLSelectElement::updateSelectedState):
573         (WebCore::HTMLSelectElement::lastSelectedListIndex):
574         (WebCore::HTMLSelectElement::optionAtIndex):
575         (WebCore::HTMLSelectElement::accessKeySetSelectedIndex):
576         * html/HTMLSummaryElement.cpp:
577         (WebCore::HTMLSummaryElement::detailsElement):
578         * html/HTMLTableElement.cpp:
579         (WebCore::HTMLTableElement::caption):
580         * html/HTMLTablePartElement.cpp:
581         (WebCore::HTMLTablePartElement::findParentTable):
582         * html/HTMLTableRowElement.cpp:
583         (WebCore::HTMLTableRowElement::rowIndex):
584         * html/HTMLTableRowsCollection.cpp:
585         (WebCore::HTMLTableRowsCollection::rowAfter):
586         (WebCore::HTMLTableRowsCollection::lastRow):
587         (WebCore::HTMLTableRowsCollection::customElementAfter):
588         * html/HTMLTableRowsCollection.h:
589         * html/HTMLTemplateElement.cpp:
590         (WebCore::HTMLTemplateElement::cloneNode):
591         * html/HTMLTextFormControlElement.cpp:
592         (WebCore::enclosingTextFormControl):
593         * html/ImageDocument.cpp:
594         (WebCore::ImageDocument::createDocumentStructure):
595         * html/LabelsNodeList.cpp:
596         (WebCore::LabelsNodeList::elementMatches):
597         * html/MediaDocument.cpp:
598         (WebCore::MediaDocumentParser::createDocumentStructure):
599         (WebCore::descendentVideoElement):
600         (WebCore::ancestorVideoElement):
601         (WebCore::MediaDocument::replaceMediaElementTimerFired):
602         * html/PluginDocument.cpp:
603         (WebCore::PluginDocumentParser::createDocumentStructure):
604         * html/RadioInputType.cpp:
605         (WebCore::RadioInputType::handleKeydownEvent):
606         (WebCore::RadioInputType::isKeyboardFocusable):
607         * html/RadioNodeList.cpp:
608         (WebCore::RadioNodeList::checkElementMatchesRadioNodeListFilter):
609         * html/RangeInputType.cpp:
610         (WebCore::RangeInputType::updateTickMarkValues):
611         * html/parser/HTMLConstructionSite.cpp:
612         (WebCore::insert):
613         (WebCore::HTMLConstructionSite::insertTextNode):
614         (WebCore::HTMLConstructionSite::ownerDocumentForCurrentNode):
615         * html/parser/HTMLTreeBuilder.cpp:
616         (WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
617         * html/shadow/DetailsMarkerControl.cpp:
618         (WebCore::DetailsMarkerControl::rendererIsNeeded):
619         * html/shadow/MediaControlElements.cpp:
620         (WebCore::MediaControlTextTrackContainerElement::updateDisplay):
621         * html/shadow/MeterShadowElement.cpp:
622         (WebCore::MeterShadowElement::meterElement):
623         * html/shadow/ProgressShadowElement.cpp:
624         (WebCore::ProgressShadowElement::progressElement):
625         * html/shadow/TextControlInnerElements.cpp:
626         (WebCore::SearchFieldResultsButtonElement::defaultEventHandler):
627         (WebCore::SearchFieldCancelButtonElement::defaultEventHandler):
628         (WebCore::SearchFieldCancelButtonElement::willRespondToMouseClickEvents):
629         * inspector/InspectorCSSAgent.cpp:
630         (WebCore::InspectorCSSAgent::viaInspectorStyleSheet):
631         * inspector/InspectorDOMAgent.cpp:
632         (WebCore::InspectorDOMAgent::buildObjectForNode):
633         * loader/FormSubmission.cpp:
634         (WebCore::FormSubmission::create):
635         * loader/FrameLoader.cpp:
636         (WebCore::FrameLoader::handleFallbackContent):
637         * loader/ImageLoader.cpp:
638         (WebCore::ImageLoader::dispatchPendingBeforeLoadEvent):
639         * loader/SubframeLoader.cpp:
640         (WebCore::SubframeLoader::requestObject):
641         * page/Chrome.cpp:
642         (WebCore::Chrome::setToolTip):
643         * page/DragController.cpp:
644         (WebCore::DragController::draggableElement):
645         * page/EventHandler.cpp:
646         (WebCore::isSubmitImage):
647         * page/FocusController.cpp:
648         (WebCore::FocusController::advanceFocusDirectionally):
649         * page/FrameView.cpp:
650         (WebCore::FrameView::addEmbeddedObjectToUpdate):
651         (WebCore::FrameView::updateEmbeddedObject):
652         * page/PageSerializer.cpp:
653         (WebCore::PageSerializer::serializeFrame):
654         * page/SpatialNavigation.cpp:
655         (WebCore::FocusCandidate::FocusCandidate):
656         * page/ios/FrameIOS.mm:
657         (WebCore::ancestorRespondingToClickEvents):
658         * rendering/HitTestResult.cpp:
659         (WebCore::HitTestResult::altDisplayString):
660         (WebCore::HitTestResult::absolutePDFURL):
661         (WebCore::HitTestResult::enterFullscreenForVideo):
662         (WebCore::HitTestResult::mediaControlsEnabled):
663         (WebCore::HitTestResult::isLiveLink):
664         (WebCore::HitTestResult::isContentEditable):
665         * rendering/RenderButton.cpp:
666         (WebCore::RenderButton::updateFromElement):
667         * rendering/RenderCounter.cpp:
668         (WebCore::planCounter):
669         * rendering/RenderEmbeddedObject.cpp:
670         (WebCore::RenderEmbeddedObject::paintContents):
671         (WebCore::RenderEmbeddedObject::layout):
672         * rendering/RenderFieldset.h:
673         * rendering/RenderFileUploadControl.cpp:
674         (WebCore::RenderFileUploadControl::inputElement):
675         (WebCore::RenderFileUploadControl::uploadButton):
676         * rendering/RenderFrame.cpp:
677         (WebCore::RenderFrame::frameElement):
678         * rendering/RenderFrameSet.cpp:
679         (WebCore::RenderFrameSet::frameSetElement):
680         * rendering/RenderHTMLCanvas.cpp:
681         (WebCore::RenderHTMLCanvas::canvasElement):
682         * rendering/RenderIFrame.cpp:
683         (WebCore::RenderIFrame::iframeElement):
684         * rendering/RenderImage.cpp:
685         (WebCore::RenderImage::RenderImage):
686         (WebCore::RenderImage::paintAreaElementFocusRing):
687         (WebCore::RenderImage::paintIntoRect):
688         (WebCore::RenderImage::imageMap):
689         (WebCore::RenderImage::updateAltText):
690         * rendering/RenderLayerBacking.cpp:
691         (WebCore::canvasCompositingStrategy):
692         (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
693         (WebCore::RenderLayerBacking::updateConfiguration):
694         * rendering/RenderLayerCompositor.cpp:
695         (WebCore::RenderLayerCompositor::requiresCompositingForCanvas):
696         * rendering/RenderListBox.cpp:
697         (WebCore::RenderListBox::selectElement):
698         (WebCore::RenderListBox::updateFromElement):
699         (WebCore::RenderListBox::paintItemForeground):
700         (WebCore::RenderListBox::paintItemBackground):
701         * rendering/RenderListItem.cpp:
702         (WebCore::RenderListItem::calcValue):
703         (WebCore::RenderListItem::updateListMarkerNumbers):
704         * rendering/RenderMarquee.cpp:
705         (WebCore::RenderMarquee::marqueeSpeed):
706         * rendering/RenderMenuList.cpp:
707         (WebCore::selectedOptionCount):
708         (RenderMenuList::selectElement):
709         (RenderMenuList::updateOptionsWidth):
710         (RenderMenuList::setTextFromOption):
711         (RenderMenuList::itemText):
712         (RenderMenuList::itemIsSelected):
713         * rendering/RenderMeter.cpp:
714         (WebCore::RenderMeter::meterElement):
715         * rendering/RenderProgress.cpp:
716         (WebCore::RenderProgress::progressElement):
717         * rendering/RenderSlider.cpp:
718         (WebCore::RenderSlider::element):
719         * rendering/RenderSnapshottedPlugIn.cpp:
720         (WebCore::RenderSnapshottedPlugIn::plugInImageElement):
721         * rendering/RenderTextControl.cpp:
722         (WebCore::RenderTextControl::textFormControlElement):
723         * rendering/RenderTextControlMultiLine.cpp:
724         (WebCore::RenderTextControlMultiLine::textAreaElement):
725         * rendering/RenderTextControlSingleLine.cpp:
726         (WebCore::RenderTextControlSingleLine::inputElement):
727         * rendering/RenderTheme.cpp:
728         (WebCore::RenderTheme::paintSliderTicks):
729         * rendering/RenderThemeIOS.mm:
730         (WebCore::RenderThemeIOS::paintMenuListButtonDecorations):
731         * rendering/RenderThemeMac.mm:
732         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
733         (WebCore::RenderThemeMac::paintSnapshottedPluginOverlay):
734         * rendering/RenderVideo.cpp:
735         (WebCore::RenderVideo::videoElement):
736         * svg/graphics/SVGImageCache.cpp:
737         (WebCore::SVGImageCache::imageForRenderer):
738         * svg/svgtags.in:
739         Generate helpers to SVGAElement so that isSVGAElement() can be used
740         instead of hasTagName(SVGNames::aTag). I did such update in this
741         patch.
742
743         * testing/Internals.cpp:
744         (WebCore::Internals::visiblePlaceholder):
745         (WebCore::Internals::wasLastChangeUserEdit):
746         (WebCore::Internals::updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks):
747         (WebCore::Internals::isSelectPopupVisible):
748         * xml/parser/XMLDocumentParserLibxml2.cpp:
749         (WebCore::XMLDocumentParser::startElementNs):
750
751 2014-09-23  Chris Dumez  <cdumez@apple.com>
752
753         Have DataTransfer::files() return a reference
754         https://bugs.webkit.org/show_bug.cgi?id=137039
755
756         Reviewed by Ryosuke Niwa.
757
758         Have DataTransfer::files() return a reference instead of a pointer as
759         it can never return null.
760
761         No new tests, no behavior change.
762
763         * dom/DataTransfer.cpp:
764         (WebCore::DataTransfer::files):
765         * dom/DataTransfer.h:
766
767 2014-09-23  Chris Dumez  <cdumez@apple.com>
768
769         Have NamedNodeMap::element() and DOMStringMap::element() return a reference
770         https://bugs.webkit.org/show_bug.cgi?id=137040
771
772         Reviewed by Ryosuke Niwa.
773
774         Have NamedNodeMap::element() and DOMStringMap::element() return a
775         reference instead of a pointer as they can never return null.
776
777         No new tests, no behavior change.
778
779         * dom/DatasetDOMStringMap.h:
780         * dom/NamedNodeMap.h:
781         (WebCore::NamedNodeMap::element):
782
783 2014-09-23  Chris Dumez  <cdumez@apple.com>
784
785         Have DOMImplementation::document() and Element::attributes() return references
786         https://bugs.webkit.org/show_bug.cgi?id=137035
787
788         Reviewed by Andreas Kling.
789
790         Have DOMImplementation::document() and Element::attributes() return
791         references instead of pointers as they can never return null.
792
793         No new tests, no behavior change.
794
795         * bindings/scripts/CodeGeneratorJS.pm:
796         (GenerateImplementation):
797         Update the JS Bindings code generator to use WTF::getPtr() in a couple
798         more places so that the implementation can return references instead
799         of pointers even when [GenerateIsReachable=xxx] IDL extended attribute
800         is used.
801
802         * dom/DOMImplementation.h:
803         (WebCore::DOMImplementation::document):
804         * dom/Element.cpp:
805         (WebCore::Element::attributes):
806         * dom/Element.h:
807         (WebCore::Node::attributes):
808
809 2014-09-23  Chris Dumez  <cdumez@apple.com>
810
811         Have Document::ensureTemplateDocument() return a reference
812         https://bugs.webkit.org/show_bug.cgi?id=137033
813
814         Reviewed by Ryosuke Niwa.
815
816         Have Document::ensureTemplateDocument() return a reference instead of
817         a pointer as it can never return null.
818
819         No new tests, no behavior change.
820
821         * dom/Document.cpp:
822         (WebCore::Document::ensureTemplateDocument):
823         * dom/Document.h:
824         * editing/markup.cpp:
825         (WebCore::createFragmentForInnerOuterHTML):
826         * html/HTMLTemplateElement.cpp:
827         (WebCore::HTMLTemplateElement::content):
828         (WebCore::HTMLTemplateElement::didMoveToNewDocument):
829
830 2014-09-23  Chris Dumez  <cdumez@apple.com>
831
832         Have Document::accessSVGExtensions() return a reference
833         https://bugs.webkit.org/show_bug.cgi?id=137030
834
835         Reviewed by Ryosuke Niwa.
836
837         Have Document::accessSVGExtensions() return a reference instead of a
838         pointer as it can never return null.
839
840         No new tests, no behavior change.
841
842         * dom/ContainerNode.cpp:
843         (WebCore::ContainerNode::removeChild):
844         (WebCore::ContainerNode::removeChildren):
845         * dom/Document.cpp:
846         (WebCore::Document::commonTeardown):
847         (WebCore::Document::implicitClose):
848         (WebCore::Document::accessSVGExtensions):
849         * dom/Document.h:
850         * dom/Element.cpp:
851         (WebCore::Element::~Element):
852         (WebCore::Element::removedFrom):
853         * editing/markup.cpp:
854         (WebCore::isPlainTextMarkup):
855         * history/CachedFrame.cpp:
856         (WebCore::CachedFrameBase::restore):
857         * rendering/FilterEffectRenderer.cpp:
858         (WebCore::FilterEffectRenderer::buildReferenceFilter):
859         * rendering/svg/RenderSVGResource.cpp:
860         (WebCore::removeFromCacheAndInvalidateDependencies):
861         * rendering/svg/RenderSVGResourceContainer.cpp:
862         (WebCore::svgExtensionsFromElement):
863         * rendering/svg/RenderSVGResourceContainer.h:
864         (WebCore::getRenderSVGResourceContainerById):
865         (WebCore::getRenderSVGResourceById):
866         * rendering/svg/SVGResources.cpp:
867         (WebCore::registerPendingResource):
868         (WebCore::SVGResources::buildCachedResources):
869         * rendering/svg/SVGResourcesCache.cpp:
870         (WebCore::resourcesCacheFromRenderer):
871         (WebCore::SVGResourcesCache::resourceDestroyed):
872         * svg/SVGElement.cpp:
873         (WebCore::SVGElement::~SVGElement):
874         (WebCore::SVGElement::reportAttributeParsingError):
875         (WebCore::SVGElement::removedFrom):
876         (WebCore::SVGElement::viewportElement):
877         (WebCore::SVGElement::attributeChanged):
878         (WebCore::SVGElement::buildPendingResourcesIfNeeded):
879         (WebCore::SVGElement::accessDocumentSVGExtensions): Deleted.
880         * svg/SVGElement.h:
881         * svg/SVGFEConvolveMatrixElement.cpp:
882         (WebCore::SVGFEConvolveMatrixElement::parseAttribute):
883         * svg/SVGFEGaussianBlurElement.cpp:
884         (WebCore::SVGFEGaussianBlurElement::parseAttribute):
885         * svg/SVGFEImageElement.cpp:
886         (WebCore::SVGFEImageElement::clearResourceReferences):
887         (WebCore::SVGFEImageElement::buildPendingResource):
888         * svg/SVGFitToViewBox.cpp:
889         (WebCore::SVGFitToViewBox::parseViewBox):
890         * svg/SVGFontFaceElement.cpp:
891         (WebCore::SVGFontFaceElement::insertedInto):
892         (WebCore::SVGFontFaceElement::removedFrom):
893         * svg/SVGMPathElement.cpp:
894         (WebCore::SVGMPathElement::buildPendingResource):
895         (WebCore::SVGMPathElement::clearResourceReferences):
896         * svg/SVGPathElement.cpp:
897         (WebCore::SVGPathElement::parseAttribute):
898         (WebCore::SVGPathElement::invalidateMPathDependencies):
899         * svg/SVGPolyElement.cpp:
900         (WebCore::SVGPolyElement::parseAttribute):
901         * svg/SVGSVGElement.cpp:
902         (WebCore::SVGSVGElement::~SVGSVGElement):
903         (WebCore::SVGSVGElement::insertedInto):
904         (WebCore::SVGSVGElement::removedFrom):
905         * svg/SVGTRefElement.cpp:
906         (WebCore::SVGTRefElement::detachTarget):
907         (WebCore::SVGTRefElement::buildPendingResource):
908         * svg/SVGTextPathElement.cpp:
909         (WebCore::SVGTextPathElement::clearResourceReferences):
910         (WebCore::SVGTextPathElement::buildPendingResource):
911         * svg/SVGUseElement.cpp:
912         (WebCore::SVGUseElement::clearResourceReferences):
913         (WebCore::SVGUseElement::buildPendingResource):
914         (WebCore::SVGUseElement::toClipPath):
915         (WebCore::SVGUseElement::buildInstanceTree):
916         * svg/animation/SVGSMILElement.cpp:
917         (WebCore::SVGSMILElement::clearResourceReferences):
918         (WebCore::SVGSMILElement::buildPendingResource):
919
920 2014-09-23  Joseph Pecoraro  <pecoraro@apple.com>
921
922         Web Inspector: Should be able to attach a debugger to a JSContext before anything is executed
923         https://bugs.webkit.org/show_bug.cgi?id=136893
924
925         Reviewed by Timothy Hatcher.
926
927         Automatic inspection is currently disabled for web pages.
928         This just updates the interfaces that changed.
929
930         * WebCore.exp.in:
931         * inspector/InspectorController.cpp:
932         (WebCore::InspectorController::connectFrontend):
933         (WebCore::InspectorController::show):
934         * inspector/InspectorController.h:
935         * page/PageDebuggable.cpp:
936         (WebCore::PageDebuggable::connect):
937         * page/PageDebuggable.h:
938         * testing/Internals.cpp:
939         (WebCore::Internals::openDummyInspectorFrontend):
940
941 2014-09-23  Eduardo Lima Mitev  <elima@igalia.com>
942
943         [GTK] Adds implementation of subtle crypto HMAC algorithm
944         https://bugs.webkit.org/show_bug.cgi?id=133320
945
946         Reviewed by Philippe Normand.
947
948         Tests are already in place under crypto/subtle/hmac-*.html
949
950         * crypto/gtk/CryptoAlgorithmHMACGtk.cpp:
951         (WebCore::getGnutlsDigestAlgorithm):
952         (WebCore::calculateSignature):
953         (WebCore::CryptoAlgorithmHMAC::platformSign):
954         (WebCore::CryptoAlgorithmHMAC::platformVerify):
955
956 2014-09-23  Eduardo Lima Mitev  <elima@igalia.com>
957
958         [GTK] Adds implementation of Subtle Crypto digest algorithms
959         https://bugs.webkit.org/show_bug.cgi?id=133319
960
961         Reviewed by Philippe Normand.
962
963         Tests are already in place under crypto/subtle/sha-*.html
964
965         * crypto/gtk/CryptoDigestGtk.cpp:
966         (WebCore::CryptoDigest::CryptoDigest):
967         (WebCore::CryptoDigest::~CryptoDigest):
968         (WebCore::CryptoDigest::create):
969         (WebCore::CryptoDigest::addBytes):
970         (WebCore::CryptoDigest::computeHash):
971
972 2014-09-15  Sergio Villar Senin  <svillar@igalia.com>
973
974         [CSS Grid Layout] Do not grow tracks when the growth factor is 0
975         https://bugs.webkit.org/show_bug.cgi?id=136575
976
977         Reviewed by Darin Adler.
978
979         A couple of performance optimizations for the track sizing
980         algorithm. On the one hand we avoid the computation of the
981         available logical space share if the track has no growth potential
982         (the current breadth is the maximum breadth) and on the other
983         hand, we avoid calling RenderGrid::distributeSpaceToTracks() if
984         the available logical space is not greater than 0.
985
986         The combined effect of these two changes is an impressive +16%
987         improvement in auto-grid-lots-of-data.html performance test.
988
989         No new tests as there is no change in the functionality.
990
991         * rendering/RenderGrid.cpp:
992         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
993         (WebCore::RenderGrid::distributeSpaceToTracks):
994
995 2014-09-23  Ion Rosca  <rosca@adobe.com>
996
997         [CSS Blending] The composited layers isolated by the page group should blend with the default white background color.
998         https://bugs.webkit.org/show_bug.cgi?id=136563
999
1000         Reviewed by Simon Fraser.
1001
1002         If a blending layer is not isolated, then it should blend with a white backdrop:
1003         http://dev.w3.org/fxtf/compositing-1/#pagebackdrop
1004
1005         Tests: css3/blending/blend-mode-body-composited-child-background-color.html
1006                css3/blending/blend-mode-body-composited-child.html
1007
1008         * rendering/RenderLayerBacking.cpp:
1009         (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
1010         If the isolating composited layer is the root renderer, then it should have a backing store
1011         into which the initial white backdrop will be painted.
1012
1013 2014-09-22  Christophe Dumez  <cdumez@apple.com>
1014
1015         Unreviewed build fix after r173859.
1016
1017         Partial revert to fix debug build after r173859.
1018
1019         * accessibility/AccessibilityRenderObject.cpp:
1020         (WebCore::AccessibilityRenderObject::remoteSVGRootElement):
1021         * html/HTMLFrameOwnerElement.cpp:
1022         (WebCore::HTMLFrameOwnerElement::getSVGDocument):
1023         * page/EventHandler.cpp:
1024         (WebCore::EventHandler::handleMousePressEvent):
1025         (WebCore::EventHandler::handleMouseMoveEvent):
1026         (WebCore::EventHandler::handleMouseReleaseEvent):
1027         * page/Frame.cpp:
1028         (WebCore::Frame::setPageAndTextZoomFactors):
1029         * page/FrameView.cpp:
1030         (WebCore::FrameView::scrollToAnchor):
1031         * rendering/svg/RenderSVGBlock.h:
1032         (WebCore::RenderSVGBlock::graphicsElement):
1033         * rendering/svg/RenderSVGGradientStop.cpp:
1034         (WebCore::RenderSVGGradientStop::gradientElement):
1035         * rendering/svg/RenderSVGInline.h:
1036         (WebCore::RenderSVGInline::graphicsElement):
1037         * rendering/svg/RenderSVGResourceClipper.cpp:
1038         (WebCore::RenderSVGResourceClipper::pathOnlyClipping):
1039         * rendering/svg/RenderSVGResourceContainer.cpp:
1040         (WebCore::RenderSVGResourceContainer::transformOnNonScalingStroke):
1041         * rendering/svg/RenderSVGShape.h:
1042         (WebCore::RenderSVGShape::graphicsElement):
1043         * rendering/svg/RenderSVGTransformableContainer.h:
1044         * rendering/svg/SVGRenderSupport.cpp:
1045         (WebCore::SVGRenderSupport::updateMaskedAncestorShouldIsolateBlending):
1046         * rendering/svg/SVGRenderTreeAsText.cpp:
1047         (WebCore::operator<<):
1048         * rendering/svg/SVGRenderingContext.cpp:
1049         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
1050         * rendering/svg/SVGResources.cpp:
1051         (WebCore::targetReferenceFromResource):
1052         * svg/SVGAElement.cpp:
1053         (WebCore::SVGAElement::defaultEventHandler):
1054         * svg/SVGAnimateElement.cpp:
1055         (WebCore::SVGAnimateElement::calculateAnimatedValue):
1056         * svg/SVGAnimationElement.cpp:
1057         (WebCore::SVGAnimationElement::currentValuesForValuesAnimation):
1058         * svg/SVGElement.cpp:
1059         (WebCore::SVGElement::getBoundingBox):
1060         * svg/SVGLinearGradientElement.cpp:
1061         (WebCore::SVGLinearGradientElement::collectGradientAttributes):
1062         * svg/SVGLocatable.cpp:
1063         (WebCore::SVGLocatable::getTransformToElement):
1064         * svg/SVGPolyElement.cpp:
1065         (WebCore::SVGPolyElement::synchronizePoints):
1066         (WebCore::SVGPolyElement::lookupOrCreatePointsWrapper):
1067         * svg/SVGRadialGradientElement.cpp:
1068         (WebCore::SVGRadialGradientElement::collectGradientAttributes):
1069         * svg/SVGTextContentElement.cpp:
1070         (WebCore::SVGTextContentElement::synchronizeTextLength):
1071         (WebCore::SVGTextContentElement::lookupOrCreateTextLengthWrapper):
1072         (WebCore::SVGTextContentElement::elementFromRenderer):
1073         * svg/SVGUseElement.cpp:
1074         (WebCore::SVGUseElement::toClipPath):
1075         * svg/animation/SVGSMILElement.cpp:
1076         (WebCore::SVGSMILElement::connectConditions):
1077         (WebCore::SVGSMILElement::disconnectConditions):
1078         * svg/graphics/SVGImage.cpp:
1079         (WebCore::SVGImage::hasSingleSecurityOrigin):
1080         (WebCore::SVGImage::setContainerSize):
1081         (WebCore::SVGImage::containerSize):
1082         (WebCore::SVGImage::embeddedContentBox):
1083         (WebCore::SVGImage::hasRelativeWidth):
1084         (WebCore::SVGImage::hasRelativeHeight):
1085         (WebCore::SVGImage::computeIntrinsicDimensions):
1086         (WebCore::SVGImage::startAnimation):
1087         (WebCore::SVGImage::stopAnimation):
1088
1089 2014-09-22  Simon Fraser  <simon.fraser@apple.com>
1090
1091         Ensure that layout is up-to-date before hit-testing via RenderView
1092         https://bugs.webkit.org/show_bug.cgi?id=136651
1093
1094         Reviewed by David Hyatt.
1095
1096         Ensure that layout is up-to-date before we do hit-testing via the RenderView.
1097         Previously, RenderLayer::hitTest() called updateLayout(), but it's better
1098         to push that responsibility onto RenderView before entering the RenderLayer
1099         tree.
1100         
1101         Make callers a little more consistent in getting the RenderView via
1102         Frame::contentRenderer(), though perhaps we should remove that and just
1103         call Document::renderView() everywhere.
1104
1105         * accessibility/AccessibilityObject.cpp:
1106         (WebCore::AccessibilityObject::press): Hit test via the RenderView, rather
1107         than doing so on the RenderView's layer, to ensure that we updateLayout().
1108         * accessibility/AccessibilityRenderObject.cpp:
1109         (WebCore::AccessibilityRenderObject::accessibilityHitTest): This code calls
1110         hitTest() on arbitrary layers, so needs to explicitly update layout.
1111         * editing/FrameSelection.cpp:
1112         (WebCore::FrameSelection::contains):
1113         * page/EventHandler.cpp:
1114         (WebCore::EventHandler::eventMayStartDrag):
1115         (WebCore::EventHandler::updateSelectionForMouseDrag):
1116         (WebCore::EventHandler::hitTestResultAtPoint): The explicit updateLayout() is
1117         no longer needed.
1118         (WebCore::EventHandler::updateCursor):
1119         (WebCore::EventHandler::handleWheelEvent):
1120         (WebCore::EventHandler::hoverTimerFired):
1121         (WebCore::hitTestResultInFrame):
1122         * page/Frame.cpp:
1123         (WebCore::Frame::contentRenderer):
1124         * rendering/RenderLayer.cpp:
1125         (WebCore::RenderLayer::hitTest):
1126         * rendering/RenderView.cpp:
1127         (WebCore::RenderView::hitTest): Here's where we ensure that layout is up-to-date.
1128
1129 2014-09-22  Christophe Dumez  <cdumez@apple.com>
1130
1131         Use downcast<SVG*Element>() instead of toSVG*Element()
1132         https://bugs.webkit.org/show_bug.cgi?id=137004
1133
1134         Reviewed by Benjamin Poulain.
1135
1136         Use downcast<SVG*Element>() instead of toSVG*Element() for casting SVG
1137         Elements and get rid of the transition toSVG*Element() macros.
1138
1139         Also use downcast<MathML*Element>() instead of toMathML*Element() for
1140         casting MathML Elements.
1141
1142         The HTML Elements casting counterparts will be taken care of in a
1143         separate patch.
1144
1145         No new tests, no behavior change.
1146
1147         * accessibility/AccessibilityNodeObject.cpp:
1148         (WebCore::AccessibilityNodeObject::alternativeText):
1149         (WebCore::AccessibilityNodeObject::accessibilityDescription):
1150         * accessibility/AccessibilityRenderObject.cpp:
1151         (WebCore::AccessibilityRenderObject::remoteSVGRootElement):
1152         * bindings/js/JSElementCustom.cpp:
1153         (WebCore::toJSNewlyCreated):
1154         * bindings/js/JSNodeCustom.cpp:
1155         (WebCore::createWrapperInline):
1156         * css/CSSComputedStyleDeclaration.cpp:
1157         (WebCore::ComputedStyleExtractor::propertyValue):
1158         * css/CSSCursorImageValue.cpp:
1159         (WebCore::resourceReferencedByCursorElement):
1160         (WebCore::CSSCursorImageValue::updateIfSVGCursorIsUsed):
1161         * css/ElementRuleCollector.cpp:
1162         (WebCore::ElementRuleCollector::matchAllRules):
1163         * css/StyleResolver.cpp:
1164         (WebCore::StyleResolver::locateCousinList):
1165         (WebCore::StyleResolver::canShareStyleWithElement):
1166         (WebCore::StyleResolver::locateSharedStyle):
1167         * dom/DocumentStyleSheetCollection.cpp:
1168         (WebCore::DocumentStyleSheetCollection::collectActiveStyleSheets):
1169         * dom/Element.cpp:
1170         (WebCore::Element::synchronizeAllAttributes):
1171         (WebCore::Element::synchronizeAttribute):
1172         (WebCore::Element::boundsInRootViewSpace):
1173         (WebCore::Element::getBoundingClientRect):
1174         (WebCore::Element::childShouldCreateRenderer):
1175         (WebCore::Element::fastAttributeLookupAllowed):
1176         * dom/EventDispatcher.cpp:
1177         (WebCore::eventTargetRespectingTargetRules):
1178         * dom/ScriptElement.cpp:
1179         (WebCore::toScriptElementIfPossible):
1180         * dom/make_names.pl:
1181         (printTypeHelpers):
1182         * html/HTMLFrameOwnerElement.cpp:
1183         (WebCore::HTMLFrameOwnerElement::getSVGDocument):
1184         * inspector/InspectorCSSAgent.cpp:
1185         (WebCore::InspectorCSSAgent::viaInspectorStyleSheet):
1186         * mathml/MathMLElement.cpp:
1187         (WebCore::MathMLElement::isPhrasingContent):
1188         (WebCore::MathMLElement::childShouldCreateRenderer):
1189         (WebCore::MathMLElement::attributeChanged):
1190         * mathml/MathMLElement.h:
1191         (WebCore::Node::hasTagName):
1192         * mathml/MathMLSelectElement.cpp:
1193         (WebCore::MathMLSelectElement::getSelectedSemanticsChild):
1194         * page/EventHandler.cpp:
1195         (WebCore::EventHandler::handleMousePressEvent):
1196         (WebCore::EventHandler::handleMouseMoveEvent):
1197         (WebCore::EventHandler::handleMouseReleaseEvent):
1198         (WebCore::instanceAssociatedWithShadowTreeElement):
1199         * page/Frame.cpp:
1200         (WebCore::Frame::setPageAndTextZoomFactors):
1201         * page/FrameView.cpp:
1202         (WebCore::FrameView::scrollToAnchor):
1203         * rendering/RenderTableCell.cpp:
1204         (WebCore::RenderTableCell::parseColSpanFromDOM):
1205         (WebCore::RenderTableCell::parseRowSpanFromDOM):
1206         (WebCore::RenderTableCell::computePreferredLogicalWidths):
1207         * rendering/mathml/RenderMathMLMenclose.cpp:
1208         (WebCore::RenderMathMLMenclose::addChild):
1209         (WebCore::RenderMathMLMenclose::computePreferredLogicalWidths):
1210         (WebCore::RenderMathMLMenclose::updateLogicalHeight):
1211         (WebCore::RenderMathMLMenclose::paint):
1212         * rendering/svg/RenderSVGBlock.h:
1213         (WebCore::RenderSVGBlock::graphicsElement):
1214         * rendering/svg/RenderSVGForeignObject.cpp:
1215         (WebCore::RenderSVGForeignObject::foreignObjectElement):
1216         * rendering/svg/RenderSVGGradientStop.cpp:
1217         (WebCore::RenderSVGGradientStop::gradientElement):
1218         * rendering/svg/RenderSVGGradientStop.h:
1219         * rendering/svg/RenderSVGImage.cpp:
1220         (WebCore::RenderSVGImage::imageElement):
1221         * rendering/svg/RenderSVGInline.h:
1222         (WebCore::RenderSVGInline::graphicsElement):
1223         * rendering/svg/RenderSVGModelObject.cpp:
1224         (WebCore::getElementCTM):
1225         (WebCore::RenderSVGModelObject::checkIntersection):
1226         (WebCore::RenderSVGModelObject::checkEnclosure):
1227         * rendering/svg/RenderSVGModelObject.h:
1228         (WebCore::RenderSVGModelObject::element):
1229         * rendering/svg/RenderSVGRect.cpp:
1230         (WebCore::RenderSVGRect::rectElement):
1231         * rendering/svg/RenderSVGResource.cpp:
1232         (WebCore::removeFromCacheAndInvalidateDependencies):
1233         * rendering/svg/RenderSVGResourceClipper.cpp:
1234         (WebCore::RenderSVGResourceClipper::pathOnlyClipping):
1235         (WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage):
1236         * rendering/svg/RenderSVGResourceClipper.h:
1237         * rendering/svg/RenderSVGResourceContainer.cpp:
1238         (WebCore::RenderSVGResourceContainer::transformOnNonScalingStroke):
1239         * rendering/svg/RenderSVGResourceFilter.h:
1240         * rendering/svg/RenderSVGResourceLinearGradient.h:
1241         * rendering/svg/RenderSVGResourceMarker.h:
1242         * rendering/svg/RenderSVGResourceMasker.h:
1243         * rendering/svg/RenderSVGResourcePattern.cpp:
1244         (WebCore::RenderSVGResourcePattern::patternElement):
1245         * rendering/svg/RenderSVGResourceRadialGradient.h:
1246         * rendering/svg/RenderSVGRoot.cpp:
1247         (WebCore::RenderSVGRoot::svgSVGElement):
1248         * rendering/svg/RenderSVGShape.h:
1249         (WebCore::RenderSVGShape::graphicsElement):
1250         * rendering/svg/RenderSVGText.cpp:
1251         (WebCore::RenderSVGText::textElement):
1252         * rendering/svg/RenderSVGTextPath.cpp:
1253         (WebCore::RenderSVGTextPath::textPathElement):
1254         (WebCore::RenderSVGTextPath::layoutPath):
1255         * rendering/svg/RenderSVGTransformableContainer.cpp:
1256         (WebCore::RenderSVGTransformableContainer::calculateLocalTransform):
1257         * rendering/svg/RenderSVGTransformableContainer.h:
1258         * rendering/svg/RenderSVGViewportContainer.cpp:
1259         (WebCore::RenderSVGViewportContainer::svgSVGElement):
1260         * rendering/svg/SVGPathData.cpp:
1261         (WebCore::updatePathFromLineElement):
1262         (WebCore::updatePathFromPathElement):
1263         (WebCore::updatePathFromPolygonElement):
1264         (WebCore::updatePathFromPolylineElement):
1265         * rendering/svg/SVGRenderSupport.cpp:
1266         (WebCore::SVGRenderSupport::layoutChildren):
1267         (WebCore::SVGRenderSupport::applyStrokeStyleToContext):
1268         (WebCore::SVGRenderSupport::updateMaskedAncestorShouldIsolateBlending):
1269         * rendering/svg/SVGRenderTreeAsText.cpp:
1270         (WebCore::operator<<):
1271         * rendering/svg/SVGRenderingContext.cpp:
1272         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
1273         * rendering/svg/SVGResources.cpp:
1274         (WebCore::targetReferenceFromResource):
1275         (WebCore::SVGResources::buildCachedResources):
1276         * rendering/svg/SVGTextLayoutEngine.cpp:
1277         (WebCore::SVGTextLayoutEngine::layoutTextOnLineOrPath):
1278         * svg/SVGAElement.cpp:
1279         (WebCore::SVGAElement::createElementRenderer):
1280         (WebCore::SVGAElement::defaultEventHandler):
1281         * svg/SVGAltGlyphDefElement.cpp:
1282         (WebCore::SVGAltGlyphDefElement::hasValidGlyphElements):
1283         * svg/SVGAltGlyphElement.cpp:
1284         (WebCore::SVGAltGlyphElement::hasValidGlyphElements):
1285         * svg/SVGAnimateElement.cpp:
1286         (WebCore::SVGAnimateElement::calculateAnimatedValue):
1287         * svg/SVGAnimatedTransformList.cpp:
1288         (WebCore::SVGAnimatedTransformListAnimator::SVGAnimatedTransformListAnimator):
1289         * svg/SVGAnimationElement.cpp:
1290         (WebCore::SVGAnimationElement::currentValuesForValuesAnimation):
1291         (WebCore::SVGAnimationElement::adjustForInheritance):
1292         * svg/SVGDocument.cpp:
1293         (WebCore::SVGDocument::rootElement):
1294         * svg/SVGElement.cpp:
1295         (WebCore::SVGElement::ownerSVGElement):
1296         (WebCore::SVGElement::viewportElement):
1297         (WebCore::SVGElement::getBoundingBox):
1298         (WebCore::SVGElement::childShouldCreateRenderer):
1299         (WebCore::SVGElement::title):
1300         (WebCore::SVGElement::updateRelativeLengthsInformation):
1301         * svg/SVGElement.h:
1302         (WebCore::Node::hasTagName):
1303         * svg/SVGFEComponentTransferElement.cpp:
1304         (WebCore::SVGFEComponentTransferElement::build):
1305         * svg/SVGFEImageElement.cpp:
1306         (WebCore::SVGFEImageElement::buildPendingResource):
1307         * svg/SVGFilterElement.cpp:
1308         (WebCore::SVGFilterElement::childShouldCreateRenderer):
1309         * svg/SVGFilterPrimitiveStandardAttributes.h:
1310         (WebCore::isSVGFilterPrimitiveStandardAttributes):
1311         * svg/SVGFontData.cpp:
1312         (WebCore::SVGFontData::applySVGGlyphSelection):
1313         * svg/SVGFontElement.cpp:
1314         (WebCore::SVGFontElement::ensureGlyphCache):
1315         * svg/SVGFontFaceElement.cpp:
1316         (WebCore::SVGFontFaceElement::rebuildFontFace):
1317         * svg/SVGFontFaceFormatElement.cpp:
1318         (WebCore::SVGFontFaceFormatElement::childrenChanged):
1319         * svg/SVGFontFaceSrcElement.cpp:
1320         (WebCore::SVGFontFaceSrcElement::srcValue):
1321         (WebCore::SVGFontFaceSrcElement::childrenChanged):
1322         * svg/SVGFontFaceUriElement.cpp:
1323         (WebCore::SVGFontFaceUriElement::childrenChanged):
1324         * svg/SVGGlyphElement.cpp:
1325         (WebCore::SVGGlyphElement::invalidateGlyphCache):
1326         * svg/SVGGraphicsElement.h:
1327         (WebCore::isSVGGraphicsElement):
1328         * svg/SVGHKernElement.cpp:
1329         (WebCore::SVGHKernElement::insertedInto):
1330         (WebCore::SVGHKernElement::removedFrom):
1331         * svg/SVGImageLoader.cpp:
1332         (WebCore::SVGImageLoader::dispatchLoadEvent):
1333         * svg/SVGLengthContext.cpp:
1334         (WebCore::SVGLengthContext::determineViewport):
1335         * svg/SVGLinearGradientElement.cpp:
1336         (WebCore::setGradientAttributes):
1337         (WebCore::SVGLinearGradientElement::collectGradientAttributes):
1338         * svg/SVGLocatable.cpp:
1339         (WebCore::SVGLocatable::nearestViewportElement):
1340         (WebCore::SVGLocatable::farthestViewportElement):
1341         (WebCore::SVGLocatable::computeCTM):
1342         (WebCore::SVGLocatable::getTransformToElement):
1343         * svg/SVGMPathElement.cpp:
1344         (WebCore::SVGMPathElement::buildPendingResource):
1345         (WebCore::SVGMPathElement::pathElement):
1346         (WebCore::SVGMPathElement::notifyParentOfPathChange):
1347         * svg/SVGMarkerElement.cpp:
1348         (WebCore::SVGMarkerElement::synchronizeOrientType):
1349         (WebCore::SVGMarkerElement::lookupOrCreateOrientTypeWrapper):
1350         * svg/SVGPathElement.cpp:
1351         (WebCore::SVGPathElement::invalidateMPathDependencies):
1352         (WebCore::SVGPathElement::lookupOrCreateDWrapper):
1353         (WebCore::SVGPathElement::synchronizeD):
1354         * svg/SVGPathSegList.cpp:
1355         (WebCore::SVGPathSegList::commitChange):
1356         * svg/SVGPatternElement.cpp:
1357         (WebCore::SVGPatternElement::collectPatternAttributes):
1358         * svg/SVGPolyElement.cpp:
1359         (WebCore::SVGPolyElement::synchronizePoints):
1360         (WebCore::SVGPolyElement::lookupOrCreatePointsWrapper):
1361         * svg/SVGRadialGradientElement.cpp:
1362         (WebCore::setGradientAttributes):
1363         (WebCore::SVGRadialGradientElement::collectGradientAttributes):
1364         * svg/SVGSVGElement.cpp:
1365         (WebCore::SVGSVGElement::setupInitialView):
1366         * svg/SVGTextContentElement.cpp:
1367         (WebCore::SVGTextContentElement::synchronizeTextLength):
1368         (WebCore::SVGTextContentElement::lookupOrCreateTextLengthWrapper):
1369         (WebCore::SVGTextContentElement::elementFromRenderer):
1370         * svg/SVGTextContentElement.h:
1371         (WebCore::isSVGTextContentElement):
1372         * svg/SVGTextPathElement.cpp:
1373         (WebCore::SVGTextPathElement::buildPendingResource):
1374         * svg/SVGUseElement.cpp:
1375         (WebCore::dumpInstanceTree):
1376         (WebCore::SVGUseElement::buildPendingResource):
1377         (WebCore::SVGUseElement::toClipPath):
1378         (WebCore::SVGUseElement::buildInstanceTree):
1379         (WebCore::SVGUseElement::hasCycleUseReferencing):
1380         (WebCore::SVGUseElement::expandUseElementsInShadowTree):
1381         (WebCore::SVGUseElement::associateInstancesWithShadowTreeElements):
1382         * svg/SVGVKernElement.cpp:
1383         (WebCore::SVGVKernElement::insertedInto):
1384         (WebCore::SVGVKernElement::removedFrom):
1385         * svg/SVGViewSpec.cpp:
1386         (WebCore::SVGViewSpec::viewTarget):
1387         * svg/animation/SVGSMILElement.cpp:
1388         (WebCore::SVGSMILElement::buildPendingResource):
1389         (WebCore::SVGSMILElement::connectConditions):
1390         (WebCore::SVGSMILElement::disconnectConditions):
1391         * svg/animation/SVGSMILElement.h:
1392         (WebCore::isSVGSMILElement):
1393         * svg/graphics/SVGImage.cpp:
1394         (WebCore::SVGImage::hasSingleSecurityOrigin):
1395         (WebCore::SVGImage::setContainerSize):
1396         (WebCore::SVGImage::containerSize):
1397         (WebCore::SVGImage::embeddedContentBox):
1398         (WebCore::SVGImage::hasRelativeWidth):
1399         (WebCore::SVGImage::hasRelativeHeight):
1400         (WebCore::SVGImage::computeIntrinsicDimensions):
1401         (WebCore::SVGImage::startAnimation):
1402         (WebCore::SVGImage::stopAnimation):
1403         * svg/graphics/filters/SVGFEImage.cpp:
1404         (WebCore::FEImage::platformApplySoftware):
1405         * svg/properties/SVGAnimatedPathSegListPropertyTearOff.h:
1406         (WebCore::SVGAnimatedPathSegListPropertyTearOff::animValDidChange):
1407         * svg/properties/SVGPathSegListPropertyTearOff.cpp:
1408         (WebCore::SVGPathSegListPropertyTearOff::contextElement):
1409
1410 2014-09-22  Pratik Solanki  <psolanki@apple.com>
1411
1412         Follow on fix for [iOS] ASSERTION FAILED: WTF::isMainThread() in WebCore::memoryCache() when using WebKit1
1413         https://bugs.webkit.org/show_bug.cgi?id=136962
1414
1415         Rubber-stamped by Simon Fraser.
1416
1417         Remove the const per review comment. It is not needed.
1418
1419         * loader/cocoa/DiskCacheMonitorCocoa.mm:
1420         (WebCore::DiskCacheMonitor::DiskCacheMonitor):
1421
1422 2014-09-22  Simon Fraser  <simon.fraser@apple.com>
1423
1424         Move nodeFromPoint() back to Document where it belongs
1425         https://bugs.webkit.org/show_bug.cgi?id=137012
1426
1427         Reviewed by Zalan Bujtas.
1428
1429         nodeFromPoint() was moved into TreeScope for ShadowDOM work, but now we can move
1430         it back to its logical place.
1431         
1432         Make versions of elementFromPoint and caretRangeFromPoint that take LayoutPoints,
1433         and change the current scale/offset code to be in layout units (which results
1434         in a small behavior change).
1435         
1436         elementFromPoint(int, int) and caretRangeFromPoint(int, int) are still required
1437         for bindings code.
1438
1439         * dom/Document.cpp:
1440         (WebCore::Document::nodeFromPoint):
1441         (WebCore::Document::elementFromPoint):
1442         (WebCore::Document::caretRangeFromPoint):
1443         * dom/Document.h:
1444         (WebCore::Document::elementFromPoint): Move logic from TreeScope::elementFromPoint()
1445         here.
1446         * dom/TreeScope.cpp:
1447         (WebCore::nodeFromPoint): Deleted.
1448         (WebCore::TreeScope::elementFromPoint): Deleted.
1449         * dom/TreeScope.h:
1450
1451 2014-09-22  Benjamin Poulain  <bpoulain@apple.com>
1452
1453         Add the baseline implementation of :nth-child(An+B of selector-list)
1454         https://bugs.webkit.org/show_bug.cgi?id=136975
1455
1456         Reviewed by Darin Adler.
1457
1458         Tests: fast/css/nth-child-of-classname.html
1459                fast/css/nth-child-of-complex-selector.html
1460                fast/css/nth-child-of-compound-selector.html
1461                fast/css/nth-child-of-tagname.html
1462                fast/selectors/nth-child-of-basics.html
1463                fast/selectors/nth-child-of-class-style-update.html
1464                fast/selectors/nth-child-of-complex-selectors.html
1465                fast/selectors/nth-child-of-selector-list.html
1466
1467         * css/SelectorChecker.cpp:
1468         (WebCore::SelectorChecker::checkOne):
1469         Pretty basic:
1470         -Go over the previous siblings.
1471         -For each sibling, test the selector list. If it matches, increase the count.
1472
1473         * cssjit/SelectorCompiler.cpp:
1474         (WebCore::SelectorCompiler::addPseudoClassType):
1475         Skip any case of the new selector. This will be implemented separately.
1476
1477 2014-09-19  Myles C. Maxfield  <mmaxfield@apple.com>
1478
1479         Implement 'vhea', 'vmtx', and 'kern' tables in SVG -> OTF converter
1480         https://bugs.webkit.org/show_bug.cgi?id=136971
1481
1482         Reviewed by Darin Adler.
1483
1484         This patch fills in the tables related to vertical metrics and kerning. The vertical metrics tables are
1485         fairly straightforward. On the other hand, the 'kern' table has subtables which can be in a variety
1486         of formats; however, according to Microsoft, Windows only allows one particular format, which doesn't
1487         allow for ranges of glyphs to be described and therefore might lead to a large 'kern' table size. In
1488         the interest of platform agnosticism I have implemented this particular format, and have not actually
1489         witnessed any extremely large 'kern' tables in any of the fonts that I have looked at.
1490
1491         I also added basic support for the horiz-origin-x and horiz-origin-y SVG properties, though support
1492         might not be perfect based on my testing.
1493
1494         Regarding testing, after this patch, almost all of our SVG fonts tests pass (barring tiny rebaselining;
1495         the platform font system calculates slightly different advances than we did. These differences are tiny
1496         and expected from such a dramatic shift in text handling engines.) There are around two dozen failing
1497         tests left that look like they are actually indiciative of code problems.
1498
1499         * svg/SVGFontElement.cpp:
1500         (WebCore::SVGFontElement::ensureGlyphCache): Refactor to accept new signature of
1501         SVG*KernElement::build*KerningPair().
1502         * svg/SVGHKernElement.cpp:
1503         (WebCore::SVGHKernElement::buildHorizontalKerningPair): Refactor to allow for intermediate data to be
1504         returned, which the SVG -> OTF font converter can use.
1505         * svg/SVGHKernElement.h: New signature for buildHorizontalKerningPair().
1506         * svg/SVGToOTFFontConversion.cpp:
1507         (WebCore::SVGToOTFFontConverter::GlyphData::GlyphData): Save the glyph's vertical advance along with
1508         the glyph's horizontal advance.
1509         (WebCore::SVGToOTFFontConverter::KerningData::KerningData): This data represents a record in one of
1510         the two 'kern' subtables, and as such needs to be sorted.
1511         (WebCore::SVGToOTFFontConverter::KerningData::operator<): Sort comparator.
1512         (WebCore::SVGToOTFFontConverter::appendHEADTable): Save the unitsPerEm locally to save a conditional.
1513         (WebCore::SVGToOTFFontConverter::appendHHEATable): Ditto.
1514         (WebCore::SVGToOTFFontConverter::appendHMTXTable): Ditto. Also use the horizontal advance as opposed to
1515         the vertical advance.
1516         (WebCore::SVGToOTFFontConverter::appendOS2Table): Save the unitsPerEm locally to save a conditional.
1517         Also if the average advance isn't found in the font, use the missing glyph's advance. If there is no
1518         missing glyph, bail and use the unitsPerEm.
1519         (WebCore::SVGToOTFFontConverter::appendVORGTable): If the default vertical origin isn't found in the
1520         font, use the missing glyphs's vertical origin. If there is no missing glyph, bail and use 0.
1521         (WebCore::SVGToOTFFontConverter::appendVHEATable): Parallel of 'hhea' table, except for vertical info.
1522         (WebCore::SVGToOTFFontConverter::appendVMTXTable): Parallel of 'hmtx' table, except for vertical info.
1523         (WebCore::SVGToOTFFontConverter::appendKerningHelperFields): Computes and appends 4 fields that font
1524         parsers need in order to do a binary search on the kern records.
1525         (WebCore::SVGToOTFFontConverter::addCodepointRanges): For each codepoint in the ranges, look up its
1526         representative glyph and append it to a set.
1527         (WebCore::SVGToOTFFontConverter::addCodepoints): For each codepoint in the range, look up its
1528         representative glyph and append it to a set.
1529         (WebCore::SVGToOTFFontConverter::addGlyphNames): For each glyph name, look up its representative glyph
1530         and append it to a set.
1531         (WebCore::SVGToOTFFontConverter::computeKerningData): Call SVG*KernElement::build*KerningPair() and
1532         iterate through all the data it returned, building up records into a Vector.
1533         (WebCore::SVGToOTFFontConverter::appendKERNTable): Go through the vector that computeKerningData()
1534         returned and actually write out the two subtables. One is for horizontal kerning and the other is for
1535         vertical kerning.
1536         (WebCore::CFFBuilder::CFFBuilder): Use the position of the glyph origin to perform the initial moveto
1537         command.
1538         (WebCore::transcodeGlyphPaths): Get the glyph's origin and pass it to the CFFBuilder.
1539         (WebCore::SVGToOTFFontConverter::appendGlyphData): Templated overloading so that the missing glyph
1540         gets a null SVGGlyphElement pointer but the rest of the glyphs get a non-null one.
1541         (WebCore::SVGToOTFFontConverter::processGlyphElement): Called on both SVGGlyphElements and
1542         SVGMissingGlyphElements, this pulls out information from the element and computs its path information.
1543         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter): Use the new templated version of
1544         processGlyphElement so we can get the same glyph parsing behavior on SVGMissingGlyphElements. In
1545         addition, populate two maps for the kerning table creation function to use.
1546         (WebCore::SVGToOTFFontConverter::convertSVGToOTFFont): Append new tables.
1547         * svg/SVGVKernElement.cpp:
1548         (WebCore::SVGVKernElement::buildVerticalKerningPair): Refactor to allow for intermediate data to be
1549         returned, which the SVG -> OTF font converter can use.
1550         * svg/SVGVKernElement.h: New signature for buildVerticalKerningPair().
1551
1552 2014-09-22  Alexey Proskuryakov  <ap@apple.com>
1553
1554         WebSocket crash when a connection is closed from server side
1555         https://bugs.webkit.org/show_bug.cgi?id=137009
1556         rdar://problem/18333977
1557         rdar://problem/12708225
1558
1559         Reviewed by Brady Eidson.
1560
1561         I don't think that this can be tested with our test server.
1562
1563         * Modules/websockets/WebSocketChannel.cpp:
1564         (WebCore::WebSocketChannel::WebSocketChannel): Added logging.
1565         (WebCore::WebSocketChannel::~WebSocketChannel): Ditto.
1566         (WebCore::WebSocketChannel::close): Protect self, because startClosingHandshake
1567         can release the last reference.
1568         (WebCore::WebSocketChannel::fail): Added an assertion that the channel is always
1569         closed after this function.
1570         (WebCore::WebSocketChannel::startClosingHandshake): Protect self, and don't change
1571         the stack from closed back to closing if after failing to send closing handshake.
1572         (WebCore::WebSocketChannel::processOutgoingFrameQueue): Protect self.
1573
1574 2014-09-22  David Hyatt  <hyatt@apple.com>
1575
1576         Bad cast in isValidColumnSpanner.
1577         https://bugs.webkit.org/show_bug.cgi?id=133380.
1578
1579         Reviewed by Simon Fraser.
1580
1581         Added fast/multicol/multicol-crazy-nesting.html
1582
1583         * rendering/RenderMultiColumnFlowThread.cpp:
1584         (WebCore::isValidColumnSpanner):
1585         The crawl up the chain looking for unsplittable objects should use containing blocks
1586         and not be casting to parent boxes. You can have an inline in the parent chain, so
1587         this was not the right way to walk up the tree.
1588
1589 2014-09-22  David Hyatt  <hyatt@apple.com>
1590
1591         ASSERT in RenderMultiColumnSet::requiresBalancing.
1592         https://bugs.webkit.org/show_bug.cgi?id=136376.
1593
1594         Reviewed by David Kilzer.
1595
1596         Added fast/multicol/multicol-selection.html.
1597
1598         * rendering/RenderMultiColumnFlowThread.cpp:
1599         (WebCore::isValidColumnSpanner):
1600         Don't allow an object to become a spanner if it does not have the flow
1601         thread as its containing block. Otherwise the flow thread won't get notified
1602         of spanner placeholder insertions, and so the spanner ends up orphaned.
1603
1604 2014-09-19  Brent Fulgham  <bfulgham@apple.com>
1605
1606         [Win] Implement cap height in SimpleFontDataWin to enable initial-letter support for Windows.
1607         https://bugs.webkit.org/show_bug.cgi?id=136841
1608
1609         Reviewed by David Hyatt.
1610
1611         * platform/graphics/win/SimpleFontDataCGWin.cpp:
1612         (WebCore::SimpleFontData::platformInit): Add missing calls to set up our fonts.
1613
1614 2014-09-22  Eric Carlson  <eric.carlson@apple.com>
1615
1616         Update HTMLMediaElement logging
1617         https://bugs.webkit.org/show_bug.cgi?id=136991
1618
1619         Reviewed by Alexey Proskuryakov.
1620
1621         No new tests, only logging was changed.
1622
1623         * html/HTMLMediaElement.cpp:
1624         (WebCore::HTMLMediaElement::HTMLMediaElement):
1625         (WebCore::HTMLMediaElement::~HTMLMediaElement):
1626         (WebCore::HTMLMediaElement::parseAttribute):
1627
1628 2014-09-22  Eva Balazsfalvi  <evab.u-szeged@partner.samsung.com>
1629
1630         REGRESSION(r173631): It broke the !ENABLE(VIDEO) build
1631         https://bugs.webkit.org/show_bug.cgi?id=136946
1632
1633         Reviewed by Jer Noble.
1634
1635         No new tests required, no new functionality.
1636
1637         * page/DragController.cpp:
1638         (WebCore::DragController::startDrag):
1639
1640 2014-09-22  Mihnea Ovidenie  <mihnea@adobe.com>
1641
1642         [CSSRegions] Use nullptr in regions code
1643         https://bugs.webkit.org/show_bug.cgi?id=137001
1644
1645         Reviewed by Andrei Bucur.
1646
1647         No new tests as no new functionality is introduced.
1648
1649         * dom/DOMNamedFlowCollection.cpp:
1650         (WebCore::DOMNamedFlowCollection::item):
1651         (WebCore::DOMNamedFlowCollection::namedItem):
1652         * dom/NamedFlowCollection.cpp:
1653         (WebCore::NamedFlowCollection::flowByName):
1654         * dom/WebKitNamedFlow.cpp:
1655         (WebCore::WebKitNamedFlow::WebKitNamedFlow):
1656         * rendering/RenderFlowThread.cpp:
1657         (WebCore::RenderFlowThread::getLayerListForRegion):
1658         (WebCore::RenderFlowThread::regionForCompositedLayer):
1659         (WebCore::RenderFlowThread::regionAtBlockOffset):
1660         (WebCore::RenderFlowThread::mapFromFlowToRegion):
1661         (WebCore::RenderFlowThread::firstRegion):
1662         (WebCore::RenderFlowThread::lastRegion):
1663         (WebCore::RenderFlowThread::currentActiveRenderBox):
1664         * rendering/RenderNamedFlowThread.cpp:
1665         (WebCore::RenderNamedFlowThread::nextRendererForElement):
1666
1667 2014-09-17  Philippe Normand  <pnormand@igalia.com>
1668
1669         [GStreamer] Cannot play Vimeo video
1670         https://bugs.webkit.org/show_bug.cgi?id=134969
1671
1672         Reviewed by Sergio Villar Senin.
1673
1674         Ensure the GStreamer HTTP source element also sends cookies when
1675         it's sending its requests. Some streaming platforms such as Vimeo
1676         do server-side cookie checks on incoming requests before serving
1677         media data.
1678
1679         Test: http/tests/media/hls/video-cookie.html
1680
1681         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1682         (webKitWebSrcStart): Set first-party cookie URL to the request so
1683         the ResourceLoader properly sets cookies in the HTTP request.
1684
1685 2014-09-22  Mihnea Ovidenie  <mihnea@adobe.com>
1686
1687         Leverage RenderLayerBacking::renderer() instead of m_owningLayer.renderer()
1688         https://bugs.webkit.org/show_bug.cgi?id=136954
1689
1690         Reviewed by Darin Adler.
1691
1692         No new tests just refactoring.
1693
1694         * rendering/RenderLayerBacking.cpp:
1695         (WebCore::RenderLayerBacking::updateCompositedBounds):
1696         (WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundImage):
1697         (WebCore::RenderLayerBacking::paintIntoLayer):
1698
1699 2014-09-22  Mihnea Ovidenie  <mihnea@adobe.com>
1700
1701         [CSS Regions] Assertion failure and null dereference crash when using animations and regions
1702         https://bugs.webkit.org/show_bug.cgi?id=136918
1703
1704         Reviewed by Andrei Bucur.
1705
1706         In some situations, for instance when an image has an attached animation, the style change caused by the animation
1707         triggers a geometry update for the backing store associated with the image's layer. This may occur before
1708         the layout for the image has finished.
1709
1710         Moreover, if the image in such situation - having a composited layer - is displayed in a region,
1711         sicne the layout did not finish yet, the mappings between the layers of the elements collected in the named flow
1712         and the regions associated with the named flow are not updated and cannot be used.
1713
1714         Therefore in those situations, we have to bail out early and use these mappings only after the layout has finished.
1715
1716         This patch also changes RenderLayerBacking method updateAfterDescendents -> updateAfterDescendants.
1717
1718         Test: fast/regions/animated-image-in-region.html
1719
1720         * rendering/RenderFlowThread.cpp:
1721         (WebCore::RenderFlowThread::cachedRegionForCompositedLayer):
1722         * rendering/RenderLayer.cpp:
1723         (WebCore::RenderLayer::calculateClipRects):
1724         * rendering/RenderLayerBacking.cpp:
1725         (WebCore::RenderLayerBacking::updateAfterDescendants):
1726         * rendering/RenderLayerBacking.h:
1727         * rendering/RenderLayerCompositor.cpp:
1728         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
1729         (WebCore::RenderLayerCompositor::updateLayerTreeGeometry):
1730         (WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry):
1731
1732 2014-09-21  Chris Dumez  <cdumez@apple.com>
1733
1734         Generate Element casting helper functions
1735         https://bugs.webkit.org/show_bug.cgi?id=136839
1736
1737         Reviewed by Darin Adler.
1738
1739         Generate Element casting helper functions instead of requiring explicit
1740         use of NODE_TYPE_CASTS() macro. Casting is now done using the following
1741         form: downcast<HTMLDivElement>(), instead of toHTMLDivElement().
1742
1743         The previous form (i.e. toHTMLDivElement()) is still supported for now
1744         by generating macros that convert these calls into the new form, until
1745         the code base is ported to the new casting helpers.
1746
1747         The plan is also to use is<HTMLDivElement>() instead of
1748         isHTMLDivElement() for consistency but this was not changed in this
1749         patch to avoid blowing up the size.
1750
1751         This CL also updates the way we convert a JSValue into an
1752         implementation pointer. Instead of using toHTMLDivElement(), which
1753         looked like a cast, we now use JSHTMLDivElement::toWrapped(). This
1754         avoids conflicting with the toXXXElement() macros and makes it
1755         clearer this is not a simple cast.
1756
1757         No new tests, no behavior change.
1758
1759         * Modules/plugins/QuickTimePluginReplacement.mm:
1760         (WebCore::QuickTimePluginReplacement::installReplacement):
1761         * WebCore.exp.in:
1762         * bindings/js/JSAudioBufferSourceNodeCustom.cpp:
1763         (WebCore::JSAudioBufferSourceNode::setBuffer):
1764         * bindings/js/JSBlobCustom.cpp:
1765         (WebCore::constructJSBlob):
1766         * bindings/js/JSCommandLineAPIHostCustom.cpp:
1767         (WebCore::JSCommandLineAPIHost::getEventListeners):
1768         (WebCore::JSCommandLineAPIHost::databaseId):
1769         (WebCore::JSCommandLineAPIHost::storageId):
1770         * bindings/js/JSDOMFormDataCustom.cpp:
1771         (WebCore::toHTMLFormElementOrNull):
1772         (WebCore::constructJSDOMFormData):
1773         (WebCore::JSDOMFormData::append):
1774         (WebCore::toHTMLFormElement): Deleted.
1775         * bindings/js/JSDOMStringListCustom.cpp:
1776         (WebCore::JSDOMStringList::toWrapped):
1777         (WebCore::toDOMStringList): Deleted.
1778         * bindings/js/JSDOMWindowCustom.cpp:
1779         (WebCore::JSDOMWindow::toWrapped):
1780         (WebCore::toDOMWindow): Deleted.
1781         * bindings/js/JSDictionary.cpp:
1782         (WebCore::JSDictionary::convertValue):
1783         * bindings/js/JSDocumentCustom.cpp:
1784         (WebCore::JSDocument::createTouchList):
1785         * bindings/js/JSEventTargetCustom.cpp:
1786         (WebCore::JSEventTarget::toWrapped):
1787         (WebCore::toEventTarget): Deleted.
1788         * bindings/js/JSExceptionBase.cpp:
1789         (WebCore::toExceptionBase):
1790         * bindings/js/JSHTMLMediaElementCustom.cpp:
1791         (WebCore::JSHTMLMediaElement::setController):
1792         * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
1793         (WebCore::JSHTMLOptionsCollection::add):
1794         (WebCore::JSHTMLOptionsCollection::remove):
1795         * bindings/js/JSHTMLSelectElementCustom.cpp:
1796         (WebCore::JSHTMLSelectElement::remove):
1797         (WebCore::selectIndexSetter):
1798         * bindings/js/JSInspectorFrontendHostCustom.cpp:
1799         (WebCore::JSInspectorFrontendHost::showContextMenu):
1800         * bindings/js/JSMessageEventCustom.cpp:
1801         (WebCore::handleInitMessageEvent):
1802         * bindings/js/JSMessagePortCustom.cpp:
1803         (WebCore::fillMessagePortArray):
1804         * bindings/js/JSNodeCustom.cpp:
1805         (WebCore::JSNode::insertBefore):
1806         (WebCore::JSNode::replaceChild):
1807         (WebCore::JSNode::removeChild):
1808         (WebCore::JSNode::appendChild):
1809         * bindings/js/JSNodeFilterCustom.cpp:
1810         (WebCore::JSNodeFilter::toWrapped):
1811         (WebCore::toNodeFilter): Deleted.
1812         * bindings/js/JSSubtleCryptoCustom.cpp:
1813         (WebCore::JSSubtleCrypto::encrypt):
1814         (WebCore::JSSubtleCrypto::decrypt):
1815         (WebCore::JSSubtleCrypto::sign):
1816         (WebCore::JSSubtleCrypto::verify):
1817         (WebCore::JSSubtleCrypto::exportKey):
1818         (WebCore::JSSubtleCrypto::wrapKey):
1819         (WebCore::JSSubtleCrypto::unwrapKey):
1820         * bindings/js/JSWebGLRenderingContextCustom.cpp:
1821         (WebCore::JSWebGLRenderingContext::getAttachedShaders):
1822         (WebCore::JSWebGLRenderingContext::getProgramParameter):
1823         (WebCore::JSWebGLRenderingContext::getShaderParameter):
1824         (WebCore::JSWebGLRenderingContext::getUniform):
1825         (WebCore::dataFunctionf):
1826         (WebCore::dataFunctioni):
1827         (WebCore::dataFunctionMatrix):
1828         * bindings/js/JSXMLHttpRequestCustom.cpp:
1829         (WebCore::JSXMLHttpRequest::send):
1830         * bindings/js/SerializedScriptValue.cpp:
1831         (WebCore::CloneSerializer::dumpIfTerminal):
1832         * bindings/scripts/CodeGeneratorJS.pm:
1833         (GenerateHeader):
1834         (GenerateImplementation):
1835         (GenerateParametersCheck):
1836         (JSValueToNative):
1837         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1838         (WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunction):
1839         (WebCore::JSTestActiveDOMObject::toWrapped):
1840         (WebCore::toTestActiveDOMObject): Deleted.
1841         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
1842         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
1843         (WebCore::JSTestCustomNamedGetter::toWrapped):
1844         (WebCore::toTestCustomNamedGetter): Deleted.
1845         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
1846         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1847         (WebCore::JSTestEventConstructor::toWrapped):
1848         (WebCore::toTestEventConstructor): Deleted.
1849         * bindings/scripts/test/JS/JSTestEventConstructor.h:
1850         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1851         (WebCore::jsTestEventTargetPrototypeFunctionDispatchEvent):
1852         (WebCore::JSTestEventTarget::toWrapped):
1853         (WebCore::toTestEventTarget): Deleted.
1854         * bindings/scripts/test/JS/JSTestEventTarget.h:
1855         * bindings/scripts/test/JS/JSTestException.cpp:
1856         (WebCore::JSTestException::toWrapped):
1857         (WebCore::toTestException): Deleted.
1858         * bindings/scripts/test/JS/JSTestException.h:
1859         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1860         (WebCore::JSTestGenerateIsReachable::toWrapped):
1861         (WebCore::toTestGenerateIsReachable): Deleted.
1862         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
1863         * bindings/scripts/test/JS/JSTestInterface.cpp:
1864         (WebCore::setJSTestInterfaceImplementsNode):
1865         (WebCore::setJSTestInterfaceSupplementalNode):
1866         (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
1867         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
1868         (WebCore::JSTestInterface::toWrapped):
1869         (WebCore::toTestInterface): Deleted.
1870         * bindings/scripts/test/JS/JSTestInterface.h:
1871         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1872         (WebCore::JSTestMediaQueryListListener::toWrapped):
1873         (WebCore::toTestMediaQueryListListener): Deleted.
1874         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
1875         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1876         (WebCore::JSTestNamedConstructor::toWrapped):
1877         (WebCore::toTestNamedConstructor): Deleted.
1878         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
1879         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
1880         (WebCore::JSTestNondeterministic::toWrapped):
1881         (WebCore::toTestNondeterministic): Deleted.
1882         * bindings/scripts/test/JS/JSTestNondeterministic.h:
1883         * bindings/scripts/test/JS/JSTestObj.cpp:
1884         (WebCore::setJSTestObjTestObjAttr):
1885         (WebCore::setJSTestObjXMLObjAttr):
1886         (WebCore::setJSTestObjWithScriptExecutionContextAttribute):
1887         (WebCore::setJSTestObjWithScriptStateAttributeRaises):
1888         (WebCore::setJSTestObjWithScriptExecutionContextAttributeRaises):
1889         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute):
1890         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
1891         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
1892         (WebCore::setJSTestObjWithScriptArgumentsAndCallStackAttribute):
1893         (WebCore::setJSTestObjMutablePoint):
1894         (WebCore::setJSTestObjImmutablePoint):
1895         (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs):
1896         (WebCore::jsTestObjPrototypeFunctionByteMethodWithArgs):
1897         (WebCore::jsTestObjPrototypeFunctionOctetMethodWithArgs):
1898         (WebCore::jsTestObjPrototypeFunctionLongMethodWithArgs):
1899         (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
1900         (WebCore::jsTestObjPrototypeFunctionMethodWithSequenceArg):
1901         (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
1902         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod1):
1903         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod2):
1904         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod8):
1905         (WebCore::jsTestObjPrototypeFunctionConvert1):
1906         (WebCore::jsTestObjPrototypeFunctionConvert2):
1907         (WebCore::jsTestObjPrototypeFunctionConvert4):
1908         (WebCore::jsTestObjPrototypeFunctionConvert5):
1909         (WebCore::jsTestObjPrototypeFunctionStrictFunctionWithSequence):
1910         (WebCore::jsTestObjPrototypeFunctionStrictFunctionWithArray):
1911         (WebCore::jsTestObjPrototypeFunctionVariadicNodeMethod):
1912         (WebCore::JSTestObj::toWrapped):
1913         (WebCore::toTestObj): Deleted.
1914         * bindings/scripts/test/JS/JSTestObj.h:
1915         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1916         (WebCore::JSTestOverloadedConstructorsConstructor::constructJSTestOverloadedConstructors3):
1917         (WebCore::JSTestOverloadedConstructors::toWrapped):
1918         (WebCore::toTestOverloadedConstructors): Deleted.
1919         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
1920         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1921         (WebCore::JSTestSerializedScriptValueInterface::toWrapped):
1922         (WebCore::toTestSerializedScriptValueInterface): Deleted.
1923         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
1924         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1925         (WebCore::jsTestTypedefsPrototypeFunctionMethodWithSequenceArg):
1926         (WebCore::jsTestTypedefsPrototypeFunctionCallWithSequenceThatRequiresInclude):
1927         (WebCore::JSTestTypedefs::toWrapped):
1928         (WebCore::toTestTypedefs): Deleted.
1929         * bindings/scripts/test/JS/JSTestTypedefs.h:
1930         * bindings/scripts/test/JS/JSattribute.cpp:
1931         (WebCore::JSattribute::toWrapped):
1932         (WebCore::toattribute): Deleted.
1933         * bindings/scripts/test/JS/JSattribute.h:
1934         * bindings/scripts/test/JS/JSreadonly.cpp:
1935         (WebCore::JSreadonly::toWrapped):
1936         (WebCore::toreadonly): Deleted.
1937         * bindings/scripts/test/JS/JSreadonly.h:
1938         * dom/Element.h:
1939         (WebCore::downcast):
1940         * dom/make_names.pl:
1941         (printTypeHelpers):
1942         * html/HTMLAnchorElement.h:
1943         * html/HTMLAreaElement.h:
1944         * html/HTMLAudioElement.h:
1945         * html/HTMLBaseElement.h:
1946         * html/HTMLBodyElement.h:
1947         * html/HTMLCanvasElement.h:
1948         * html/HTMLDataListElement.h:
1949         * html/HTMLDetailsElement.h:
1950         * html/HTMLDivElement.h:
1951         * html/HTMLEmbedElement.h:
1952         * html/HTMLFieldSetElement.h:
1953         * html/HTMLFormElement.h:
1954         * html/HTMLFrameElement.h:
1955         * html/HTMLFrameSetElement.h:
1956         * html/HTMLHtmlElement.h:
1957         * html/HTMLIFrameElement.h:
1958         * html/HTMLImageElement.h:
1959         * html/HTMLInputElement.h:
1960         * html/HTMLLabelElement.h:
1961         * html/HTMLLegendElement.h:
1962         * html/HTMLLinkElement.h:
1963         * html/HTMLMapElement.h:
1964         * html/HTMLMarqueeElement.h:
1965         * html/HTMLMetaElement.h:
1966         * html/HTMLMeterElement.h:
1967         * html/HTMLOListElement.h:
1968         * html/HTMLObjectElement.h:
1969         * html/HTMLOptGroupElement.h:
1970         * html/HTMLOptionElement.h:
1971         * html/HTMLParamElement.h:
1972         * html/HTMLProgressElement.h:
1973         * html/HTMLScriptElement.h:
1974         * html/HTMLSelectElement.h:
1975         * html/HTMLSourceElement.h:
1976         * html/HTMLStyleElement.h:
1977         * html/HTMLSummaryElement.h:
1978         * html/HTMLTableCaptionElement.h:
1979         * html/HTMLTableElement.h:
1980         * html/HTMLTableRowElement.h:
1981         * html/HTMLTemplateElement.h:
1982         * html/HTMLTextAreaElement.h:
1983         * html/HTMLTitleElement.h:
1984         * html/HTMLTrackElement.h:
1985         * html/HTMLVideoElement.h:
1986         * inspector/InspectorDOMAgent.cpp:
1987         (WebCore::InspectorDOMAgent::scriptValueAsNode):
1988         * mathml/MathMLMencloseElement.h:
1989         * svg/SVGAltGlyphDefElement.h:
1990         * svg/SVGAltGlyphElement.h:
1991         * svg/SVGAltGlyphItemElement.h:
1992         * svg/SVGAnimateMotionElement.h:
1993         * svg/SVGAnimateTransformElement.h:
1994         * svg/SVGCircleElement.h:
1995         * svg/SVGClipPathElement.h:
1996         * svg/SVGCursorElement.h:
1997         * svg/SVGEllipseElement.h:
1998         * svg/SVGFEDistantLightElement.h:
1999         * svg/SVGFEFuncAElement.h:
2000         * svg/SVGFEFuncBElement.h:
2001         * svg/SVGFEFuncGElement.h:
2002         * svg/SVGFEFuncRElement.h:
2003         * svg/SVGFEMergeNodeElement.h:
2004         * svg/SVGFEPointLightElement.h:
2005         * svg/SVGFESpotLightElement.h:
2006         * svg/SVGFilterElement.h:
2007         * svg/SVGFontElement.h:
2008         * svg/SVGFontFaceElement.h:
2009         * svg/SVGFontFaceNameElement.h:
2010         * svg/SVGFontFaceSrcElement.h:
2011         * svg/SVGFontFaceUriElement.h:
2012         * svg/SVGForeignObjectElement.h:
2013         * svg/SVGGlyphElement.h:
2014         * svg/SVGGlyphRefElement.h:
2015         * svg/SVGHKernElement.h:
2016         * svg/SVGImageElement.h:
2017         * svg/SVGLineElement.h:
2018         * svg/SVGLinearGradientElement.h:
2019         * svg/SVGMPathElement.h:
2020         * svg/SVGMarkerElement.h:
2021         * svg/SVGMaskElement.h:
2022         * svg/SVGMissingGlyphElement.h:
2023         * svg/SVGPathElement.h:
2024         * svg/SVGPatternElement.h:
2025         * svg/SVGPolygonElement.h:
2026         * svg/SVGPolylineElement.h:
2027         * svg/SVGRadialGradientElement.h:
2028         * svg/SVGRectElement.h:
2029         * svg/SVGSVGElement.h:
2030         * svg/SVGScriptElement.h:
2031         * svg/SVGStopElement.h:
2032         * svg/SVGStyleElement.h:
2033         * svg/SVGTextElement.h:
2034         * svg/SVGTextPathElement.h:
2035         * svg/SVGTitleElement.h:
2036         * svg/SVGUseElement.h:
2037         * svg/SVGVKernElement.h:
2038         * svg/SVGViewElement.h:
2039
2040 2014-09-21  Christophe Dumez  <cdumez@apple.com>
2041
2042         Fix post-mortem nits for r173724
2043         https://bugs.webkit.org/show_bug.cgi?id=136986
2044
2045         Reviewed by Darin Adler.
2046
2047         Fix post-mortem nits for r173724.
2048
2049         No new tests, no behavior change.
2050
2051         * editing/EditingStyle.cpp:
2052         (WebCore::HTMLAttributeEquivalent::attributeValueAsCSSValue):
2053         (WebCore::HTMLFontSizeEquivalent::attributeValueAsCSSValue):
2054         Use nullptr instead of 0.
2055
2056         * editing/SplitElementCommand.cpp:
2057         (WebCore::SplitElementCommand::doUnapply):
2058         Use getIdAttribute() / setIdAttribute().
2059
2060         * rendering/RenderTableCell.cpp:
2061         (WebCore::RenderTableCell::computePreferredLogicalWidths):
2062         Use fastHasAttribute() for nowrap and do an early return to avoid
2063         calling styleOrColLogicalWidth() if the nowrap attribute is missing.
2064
2065 2014-09-21  Filip Pizlo  <fpizlo@apple.com>
2066
2067         Unreviewed, speculative build fix.
2068         
2069         If you use typed arrays, you gotta include runtime/TypedArrayInlines.h.
2070
2071         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
2072
2073 2014-09-19  Jer Noble  <jer.noble@apple.com>
2074
2075         [EME][Mac] Support secure proof of key release in the com.apple.fps.2_0 keysystem.
2076         https://bugs.webkit.org/show_bug.cgi?id=136898
2077
2078         Reviewed by Eric Carlson.
2079
2080         Add support for proof of key release to the CDM by supporting a new "mime" type called
2081         "keyrelease". When a session of type "keyrelease" is created, the initData is the server
2082         certificate, the keyMessage contains the first stored proof of key release if present,
2083         and closing the session will remove that proof from storage.
2084
2085         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
2086         (WebCore::CDMPrivateMediaSourceAVFObjC::supportsKeySystemAndMimeType):
2087         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
2088         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
2089         (WebCore::CDMSessionMediaSourceAVFObjC::CDMSessionMediaSourceAVFObjC):
2090         (WebCore::CDMSessionMediaSourceAVFObjC::generateKeyRequest):
2091         (WebCore::CDMSessionMediaSourceAVFObjC::releaseKeys):
2092         (WebCore::sessionStorageDirectory):
2093         (WebCore::CDMSessionMediaSourceAVFObjC::update):
2094         (WebCore::CDMSessionMediaSourceAVFObjC::generateKeyReleaseMessage):
2095
2096 2014-09-19  Jer Noble  <jer.noble@apple.com>
2097
2098         [Media][Mac] Buffered range slides around as you resize a window
2099         https://bugs.webkit.org/show_bug.cgi?id=136960
2100
2101         Reviewed by Dean Jackson.
2102
2103         Rather than using a canvas as the background image for the timeline slider, use a generated SVG image
2104         to represent the buffered ranges.
2105
2106         * Modules/mediacontrols/mediaControlsApple.css:
2107         (audio::-webkit-media-controls-timeline):
2108         * Modules/mediacontrols/mediaControlsApple.js:
2109         (Controller.prototype.createControls):
2110         (Controller.prototype.updateProgress):
2111
2112 2014-09-19  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2113
2114         [CoordinatedGraphics][EFL] window.scrollTo(x, y) doesn't work when fixed layout is enabled
2115         https://bugs.webkit.org/show_bug.cgi?id=136917
2116
2117         Reviewed by Darin Adler.
2118
2119         When fixed layout is enabled, scrollTo doesn't work on EFL port with coordinated graphics.
2120         Since updateScrollbars() doesn't update scroll position when delegatesScrolling() is enabled. 
2121         To fix this issue, EFL port should update scroll position based on WK2 port. This patch
2122         update scroll position in FrameView::requestScrollPositionUpdate() as Mac port.
2123
2124         TestWebKitAPI: Tools/TestWebKitAPI/Tests/WebKit2/efl/WKViewScrollTo
2125
2126         * page/FrameView.cpp:
2127         (WebCore::FrameView::requestScrollPositionUpdate):
2128
2129 2014-09-19  Brent Fulgham  <bfulgham@apple.com>
2130
2131         Latching in iframes is not working as expected
2132         https://bugs.webkit.org/show_bug.cgi?id=136729
2133         <rdar://problem/18370549>
2134
2135         Reviewed by Simon Fraser.
2136
2137         Test: platform/mac/fast/scrolling/scrolling-iframe-100pct.html
2138
2139         Correct latching behavior by moving the concept of latching from the event handler to the main frame.
2140         The event handlers are per-document, and can improperly latch to the iframe element (rather than the
2141         scrollable content of the iframe) resulting in incorrect behavior.
2142
2143         Also move the wheel event delta tracking to the main frame, as this is similarly "top-level" in nature.
2144
2145         * WebCore.vcxproj/WebCore.vcxproj: Add new LatchedState class.
2146         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
2147         * WebCore.xcodeproj/project.pbxproj: Ditto.
2148         * page/EventHandler.cpp:
2149         (WebCore::EventHandler::EventHandler): Update constructor after moving some members to the new
2150         LatchedState object.
2151         (WebCore::EventHandler::clear): Call 'clear' on the LatchedState class.
2152         (WebCore::EventHandler::platformRecordWheelEvent):  Update for new LatchedState class.
2153         (WebCore::EventHandler::handleWheelEvent): Ditto.
2154         (WebCore::EventHandler::clearLatchedState): Ditto.
2155         (WebCore::EventHandler::defaultWheelEventHandler): Ditto.
2156         * page/EventHandler.h:
2157         * page/LatchedState.cpp: Added.
2158         (WebCore::LatchedState::LatchedState):
2159         (WebCore::LatchedState::~LatchedState):
2160         (WebCore::LatchedState::clear):
2161         (WebCore::LatchedState::setWheelEventElement):
2162         (WebCore::LatchedState::setWidgetIsLatched):
2163         (WebCore::LatchedState::setPreviousWheelScrolledElement):
2164         (WebCore::LatchedState::setScrollableContainer):
2165         * page/LatchedState.h: Added.
2166         (WebCore::LatchedState::wheelEventElement):
2167         (WebCore::LatchedState::frame):
2168         (WebCore::LatchedState::setFrame):
2169         (WebCore::LatchedState::widgetIsLatched):
2170         (WebCore::LatchedState::previousWheelScrolledElement):
2171         (WebCore::LatchedState::scrollableContainer):
2172         (WebCore::LatchedState::startedGestureAtScrollLimit):
2173         (WebCore::LatchedState::setStartedGestureAtScrollLimit):
2174         * page/MainFrame.cpp:
2175         (WebCore::MainFrame::MainFrame): Update for new members (LatchedState and WheelEventDeltaTracker)
2176         * page/MainFrame.h:
2177         * page/mac/EventHandlerMac.mm:
2178         (WebCore::EventHandler::platformPrepareForWheelEvents): Use mainFrame-located latching information.
2179         (WebCore::EventHandler::platformRecordWheelEvent): Use mainFrame-located wheel event delta tracking.
2180         (WebCore::EventHandler::platformCompleteWheelEvent): Make sure to use the latched frame as well as
2181         the latched element so that events get routed properly.
2182         (WebCore::EventHandler::platformCompletePlatformWidgetWheelEvent): Update for new mainFrame
2183         location for latched state information.
2184
2185 2014-09-19  Chris Dumez  <cdumez@apple.com>
2186
2187         Minimize virtual function calls in MarkupAccumulator
2188         https://bugs.webkit.org/show_bug.cgi?id=136957
2189
2190         Reviewed by Benjamin Poulain.
2191
2192         This patch minimizes the number of virtual function calls in
2193         MarkupAccumulator by:
2194         - De-virtualizing MarkupAccumulator::appendString(), which is never
2195           overridden
2196         - Having MarkupAccumulator::appendEndTag() virtual function take an
2197           Element in argument instead of a Node, as it only applies to Element.
2198           Also add a non-virtual overload that takes a Node in argument and
2199           that does the isElementNode() check so that we don't need to explicitly
2200           do the check at each call site.
2201
2202         No new tests, no behavior change.
2203
2204         * editing/MarkupAccumulator.cpp:
2205         (WebCore::MarkupAccumulator::appendEndTag):
2206         (WebCore::MarkupAccumulator::shouldSelfClose):
2207         (WebCore::MarkupAccumulator::appendEndMarkup):
2208         * editing/MarkupAccumulator.h:
2209         (WebCore::MarkupAccumulator::appendEndTag):
2210         * page/PageSerializer.cpp:
2211         (WebCore::SerializerMarkupAccumulator::appendEndTag):
2212
2213 2014-09-19  Pratik Solanki  <psolanki@apple.com>
2214
2215         [iOS] ASSERTION FAILED: WTF::isMainThread() in WebCore::memoryCache() when using WebKit1
2216         https://bugs.webkit.org/show_bug.cgi?id=136962
2217         <rdar://problem/18342344>
2218
2219         Reviewed by Geoffrey Garen.
2220
2221         The disk cache monitor callback code was being executed on the main thread. This is wrong
2222         when the web thread is being used in WebKit1 on iOS. The code needs to run on the web
2223         thread. Use WebThreadRun to dispatch the block to the web thread. This works for WebKit2 as
2224         well since when web thread is not being used, WebThreadRun invokes the block directly.
2225
2226         * loader/cocoa/DiskCacheMonitorCocoa.mm:
2227         (WebCore::DiskCacheMonitor::DiskCacheMonitor):
2228
2229 2014-09-19  Jer Noble  <jer.noble@apple.com>
2230
2231         Unreviewed build fix; pass duration into the lambda.
2232
2233         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2234         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationChanged):
2235
2236 2014-09-19  Dean Jackson  <dino@apple.com>
2237
2238         Multithreaded WebGL is a bad idea - remove it
2239         https://bugs.webkit.org/show_bug.cgi?id=136964
2240         <rdar://problem/18399858>
2241
2242         Reviewed by Brent Fulgham.
2243
2244         We should not allow multithreaded GL access. Remove the
2245         feature.
2246
2247         * html/canvas/WebGLRenderingContext.cpp:
2248         (WebCore::WebGLRenderingContext::create):
2249         * page/Settings.in:
2250         * platform/graphics/GraphicsContext3D.h:
2251         (WebCore::GraphicsContext3D::Attributes::Attributes):
2252         * platform/graphics/mac/GraphicsContext3DMac.mm:
2253         (WebCore::GraphicsContext3D::GraphicsContext3D):
2254
2255 2014-09-19  Eric Carlson  <eric.carlson@apple.com>
2256
2257         [MSE][Mac] work around AVSampleBufferRenderSynchronizer early callbacks
2258         https://bugs.webkit.org/show_bug.cgi?id=136958
2259
2260         Reviewed by Jer Noble.
2261
2262         No new tests, we have been unable to come up with a test case that reproduces
2263         this issue reliably.
2264
2265         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2266         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationChanged): Set the synchronizer
2267             time to duration when the duration time observer is called early. Add more logging.
2268
2269 2014-09-19  Benjamin Poulain  <bpoulain@apple.com>
2270
2271         CSS JIT: allocate the minimum required register count in debug
2272         https://bugs.webkit.org/show_bug.cgi?id=136933
2273
2274         Reviewed by Andreas Kling.
2275
2276         It is hard to catch bugs of minimumRegisterRequirements() because every CPU has a different
2277         number of registers available by default.
2278
2279         This patch aims at improving testing by creating artificial register pressure when running
2280         in debug. When running in debug, we no longer allocate all the available registers right away.
2281         Instead, we allocate just enough to satisfy minimumRegisterRequirements().
2282
2283         The expectation with this is that under-allocation would be detected quicker since they would
2284         crash debug builds.
2285
2286         * cssjit/RegisterAllocator.h:
2287         (WebCore::RegisterAllocator::RegisterAllocator):
2288         (WebCore::RegisterAllocator::reserveCallerSavedRegisters):
2289         (WebCore::RegisterAllocator::availableRegisterCount): Deleted.
2290         * cssjit/SelectorCompiler.cpp:
2291         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
2292
2293 2014-09-19  Benjamin Poulain  <bpoulain@apple.com>
2294
2295         Add a size check for CSSSelector
2296         https://bugs.webkit.org/show_bug.cgi?id=136882
2297
2298         Reviewed by Christophe Dumez.
2299
2300         * css/CSSSelector.cpp:
2301
2302 2014-09-19  Eva Balazsfalvi  <evab.u-szeged@partner.samsung.com>
2303
2304         REGRESSION(r173464): It broke the !ENABLE(PICTURE_SIZES) build
2305         https://bugs.webkit.org/show_bug.cgi?id=136942
2306
2307         Reviewed by Simon Fraser.
2308
2309         * html/HTMLImageElement.cpp:
2310         (WebCore::HTMLImageElement::parseAttribute):
2311
2312 2014-09-19  Simon Fraser  <simon.fraser@apple.com>
2313
2314         Provide a default argument for the most commonly used HitTestRequest variant
2315         https://bugs.webkit.org/show_bug.cgi?id=136653
2316
2317         Reviewed by Darin Adler.
2318
2319         Make the default HitTestRequest flags be ReadOnly | Active | DisallowShadowContent
2320         and change call sites using the default flags to use a HitTestRequest temporary.
2321
2322         * dom/TreeScope.cpp:
2323         (WebCore::nodeFromPoint):
2324         * editing/FrameSelection.cpp:
2325         (WebCore::FrameSelection::contains):
2326         * page/DragController.cpp:
2327         (WebCore::elementUnderMouse):
2328         * page/EventHandler.cpp:
2329         (WebCore::EventHandler::handleMouseDraggedEvent):
2330         (WebCore::EventHandler::handleMousePressEvent):
2331         * rendering/HitTestRequest.h:
2332         (WebCore::HitTestRequest::HitTestRequest):
2333
2334 2014-09-19  Chris Dumez  <cdumez@apple.com>
2335
2336         Allow DOM methods to return references instead of pointers
2337         https://bugs.webkit.org/show_bug.cgi?id=136931
2338
2339         Reviewed by Sam Weinig.
2340
2341         It is common practice in WebKit to have methods return a reference
2342         instead of a pointer if the pointer can never be null. However, this
2343         unfortunately did not work for DOM methods (functions called by JS
2344         bindings). This prevented further refactoring.
2345
2346         This patch brings support for having DOM methods to return references
2347         instead of pointers when the pointer cannot be null. The generated
2348         bindings were calling WTF::getPtr() on the pointer type returned by
2349         the implementation already (in case it was a smart pointer type).
2350         This patch leverages this by having WTF::getPtr() convert reference
2351         arguments into raw pointers.
2352
2353         This patch also updates a few DOM methods on Document and Element
2354         classes to return a reference instead of a pointer, to test the change.
2355         There are likely more DOM methods that can be updated though.
2356
2357         No new tests, no behavior change.
2358
2359         * accessibility/AccessibilityObject.cpp:
2360         (WebCore::AccessibilityObject::classList):
2361         * bindings/js/JSDOMBinding.h:
2362         (WTF::getPtr): Deleted.
2363         * dom/Document.cpp:
2364         (WebCore::Document::implementation):
2365         (WebCore::Document::webkitGetNamedFlows):
2366         (WebCore::Document::namedFlows):
2367         (WebCore::Document::setXMLVersion):
2368         (WebCore::Document::setXMLStandalone):
2369         (WebCore::Document::securityPolicy):
2370         (WebCore::Document::styleSheets):
2371         * dom/Document.h:
2372         (WebCore::Document::timing):
2373         * dom/Element.cpp:
2374         (WebCore::Element::classList):
2375         (WebCore::Element::dataset):
2376         * dom/Element.h:
2377         * html/shadow/MediaControlElements.cpp:
2378         (WebCore::MediaControlPanelElement::setPosition):
2379         (WebCore::MediaControlPanelElement::resetPosition):
2380         (WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay):
2381         * html/track/VTTRegion.cpp:
2382         (WebCore::VTTRegion::displayLastTextTrackCueBox):
2383         (WebCore::VTTRegion::willRemoveTextTrackCueBox):
2384         * inspector/InspectorCSSAgent.cpp:
2385         (WebCore::InspectorCSSAgent::getAllStyleSheets):
2386         (WebCore::InspectorCSSAgent::getNamedFlowCollection):
2387         * page/PerformanceTiming.cpp:
2388         (WebCore::PerformanceTiming::documentTiming):
2389         * rendering/FlowThreadController.cpp:
2390         (WebCore::FlowThreadController::ensureRenderFlowThreadWithName):
2391
2392 2014-09-19  Daniel Bates  <dabates@apple.com>
2393
2394         Always assume internal SDK when building configuration Production
2395         https://bugs.webkit.org/show_bug.cgi?id=136925
2396         <rdar://problem/18362399>
2397
2398         Reviewed by Dan Bernstein.
2399
2400         As a side effect of this change we will always enable ENABLE_TOUCH_EVENTS, ENABLE_IOS_{GESTURE, TOUCH}_EVENTS,
2401         and ENABLE_XSLT when either building configuration Production or building with the Internal SDK.
2402
2403         * Configurations/Base.xcconfig:
2404
2405 2014-09-19  Chris Dumez  <cdumez@apple.com>
2406
2407         Optimize MarkupAccumulator::appendText()
2408         https://bugs.webkit.org/show_bug.cgi?id=136935
2409
2410         Reviewed by Benjamin Poulain.
2411
2412         MarkupAccumulator::appendText() was calling the generic appendNodeValue()
2413         method to append the text. appendNodeValue() supports any kind of Node and
2414         thus calls the Node::nodeValue() virtual function.
2415
2416         Since appendText() is the only caller to appendNodeValue(), this patch
2417         inlines the code in appendText() and makes it specific to Text Node, and
2418         thus more efficient. The code now calls CharacterData::data() instead of
2419         the Node::nodeValue() virtual function. This patch also updates
2420         CharacterData::data() to return a const reference to avoid copying the
2421         return value.
2422
2423         No new tests, no behavior change.
2424
2425         * dom/CharacterData.h:
2426         (WebCore::CharacterData::data):
2427         * editing/MarkupAccumulator.cpp:
2428         (WebCore::MarkupAccumulator::appendText):
2429         (WebCore::MarkupAccumulator::appendNodeValue): Deleted.
2430         * editing/MarkupAccumulator.h:
2431
2432 2014-09-18  Carlos Garcia Campos  <cgarcia@igalia.com>
2433
2434         [GTK] Dot not allow to create delete-on-destroy GMainLoopSources
2435         https://bugs.webkit.org/show_bug.cgi?id=136923
2436
2437         Reviewed by Gustavo Noronha Silva.
2438
2439         * platform/gtk/GtkDragAndDropHelper.cpp:
2440         (WebCore::GtkDragAndDropHelper::handleDragLeave): Use GMainLoopSource::scheduleAndDeleteOnDestroy().
2441
2442 2014-09-18  Roger Fong  <roger_fong@apple.com>
2443
2444         Add a move operator and constructor override to HashSet.
2445         https://bugs.webkit.org/show_bug.cgi?id=136934.
2446
2447         * dom/Node.cpp:
2448         (WebCore::Document::invalidateNodeListAndCollectionCaches): Remove the now unneeded call to clear the HashSet.
2449
2450 2014-09-18  Roger Fong  <roger_fong@apple.com>
2451
2452         [Windows] Media tests all fail because they cannot find localized strings.
2453         
2454         * rendering/RenderThemeSafari.cpp:
2455         (WebCore::RenderThemeSafari::mediaControlsScript):
2456         Make sure to use localized strings files in RenderThemeSafari.
2457
2458 2014-09-18  Simon Fraser  <simon.fraser@apple.com>
2459
2460         Remove generator/yield terminology in RenderInline's GeneratorContext
2461         https://bugs.webkit.org/show_bug.cgi?id=119278
2462
2463         Reviewed by Sam Weinig.
2464         
2465         Get rid of the icky Generator/yield syntax used for collecting rects in RenderInline.
2466         Just replace the operator() with an explicit addRect().
2467         
2468         Also some drive-by nullptr cleanup, and removing default arguments from
2469         addChildIgnoringContinuation() calls.
2470
2471         * rendering/RenderInline.cpp:
2472         (WebCore::RenderInline::willBeDestroyed):
2473         (WebCore::RenderInline::styleDidChange):
2474         (WebCore::RenderInline::splitInlines):
2475         (WebCore::RenderInline::addChildToContinuation):
2476         (WebCore::RenderInline::generateLineBoxRects):
2477         (WebCore::RenderInline::generateCulledLineBoxRects):
2478         * rendering/RenderInline.h:
2479
2480 2014-09-18  Jeremy Jones  <jeremyj@apple.com>
2481
2482         Improve fullscreen video rotation animation.
2483         https://bugs.webkit.org/show_bug.cgi?id=136870
2484
2485         Reviewed by Simon Fraser.
2486
2487         Instead of setting the frame on the video layer, set position and bounds separately. This allows the position to be synchronized with the rest of the animation.
2488         When using a fencePort to synchronize animations, if the fence times out, pivoting around the center provides a better fallback.
2489
2490         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2491         (-[WebAVVideoLayer setVideoSublayer:]): added
2492         (-[WebAVVideoLayer videoSublayer]): added
2493         (-[WebAVVideoLayer setBounds:]):  set position and bounds insted of frame.
2494         (WebVideoFullscreenInterfaceAVKit::setupFullscreen): use setVideoSublayer
2495         * platform/ios/WebVideoFullscreenModelVideoElement.mm:
2496         (WebVideoFullscreenModelVideoElement::setVideoFullscreenLayer): set bounds and anchorPoint instead of frame
2497         (WebVideoFullscreenModelVideoElement::setVideoLayerFrame): set bounds instead of frame.
2498
2499 2014-09-17  Myles C. Maxfield  <mmaxfield@apple.com>
2500
2501         Text laid out with the SVG -> OTF font converter does not have the same metrics as with the SVG font code path
2502         https://bugs.webkit.org/show_bug.cgi?id=136907
2503
2504         Reviewed by Darin Adler.
2505
2506         There are three things that are causing text laid out with the SVG -> OTF font converter to not have metrics that
2507         measure our existing SVG codepath. They are:
2508
2509         1. Creating a font with a 0 ascent or descent makes OS X think that something is wrong with the font, and take
2510         a different codepath when trying to parse ascent and descent information. This patch checks for this condition
2511         and sets the ascent/descent to 1 FUnit instead (which is generally much smaller than a pixel).
2512         2. Our SVG font codepath hardcodes a line gap of 1/10th of the font size for every font. This patch makes the
2513         font converter obey this.
2514         3. The converter was not allowing for default glyph advances as per the SVG font specification. This patch
2515         does so.
2516
2517         No new tests yet, but they will come soon! I promise!
2518
2519         * svg/SVGToOTFFontConversion.cpp:
2520         (WebCore::SVGToOTFFontConverter::appendHHEATable):
2521         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):
2522
2523 2014-09-18  Daniel Bates  <dabates@apple.com>
2524
2525         REGRESSION (r168921): SVG elements may be unnecessarily rebuilt
2526         https://bugs.webkit.org/show_bug.cgi?id=136373
2527
2528         Reviewed by David Kilzer.
2529
2530         Fixes an issue where a SVG element may be unnecessarily rebuilt. In particular,
2531         it is unnecessary to rebuild a SVG element that will be removed from the document.
2532
2533         Test: svg/custom/remove-subtree-including-use-with-child-textpath-that-references-earlier-path.html
2534
2535         * svg/SVGDocumentExtensions.cpp:
2536         (WebCore::SVGDocumentExtensions::removeAllElementReferencesForTarget): Modified to remove a SVG element
2537         from the list of elements to be rebuilt.
2538
2539 2014-09-18  Joseph Pecoraro  <pecoraro@apple.com>
2540
2541         Unreviewed rollout r173731. Broke multiple builds.
2542
2543         * WebCore.exp.in:
2544         * inspector/InspectorController.cpp:
2545         (WebCore::InspectorController::connectFrontend):
2546         (WebCore::InspectorController::show):
2547         * inspector/InspectorController.h:
2548         * page/PageDebuggable.cpp:
2549         (WebCore::PageDebuggable::connect):
2550         * page/PageDebuggable.h:
2551         * testing/Internals.cpp:
2552         (WebCore::Internals::openDummyInspectorFrontend):
2553
2554 2014-09-18  Beth Dakin  <bdakin@apple.com>
2555
2556         ASSERT in RenderBox::instrinsicScrollbarLogicalWidth opening the inspector
2557         https://bugs.webkit.org/show_bug.cgi?id=136929
2558
2559         Reviewed by Simon Fraser.
2560
2561         This is a regression from http://trac.webkit.org/changeset/173668 
2562         This code is wrong after that change because it assumes that overflow:scroll will 
2563         always have a scrollbar. That is no longer the case. We need to check to make sure 
2564         it’s an overflow:scroll that does NOT have overflow:auto behavior.
2565
2566         * rendering/RenderBox.cpp:
2567         (WebCore::RenderBox::instrinsicScrollbarLogicalWidth):
2568
2569 2014-09-18  Joseph Pecoraro  <pecoraro@apple.com>
2570
2571         Web Inspector: Should be able to attach a debugger to a JSContext before anything is executed
2572         https://bugs.webkit.org/show_bug.cgi?id=136893
2573
2574         Reviewed by Timothy Hatcher.
2575
2576         Automatic inspection is currently disabled for web pages.
2577         This just updates the interfaces that changed.
2578
2579         * WebCore.exp.in:
2580         * inspector/InspectorController.cpp:
2581         (WebCore::InspectorController::connectFrontend):
2582         (WebCore::InspectorController::show):
2583         * inspector/InspectorController.h:
2584         * page/PageDebuggable.cpp:
2585         (WebCore::PageDebuggable::connect):
2586         * page/PageDebuggable.h:
2587         * testing/Internals.cpp:
2588         (WebCore::Internals::openDummyInspectorFrontend):
2589
2590 2014-09-18  Chris Dumez  <cdumez@apple.com>
2591
2592         Use fastHasAttribute() / fastGetAttribute() when possible
2593         https://bugs.webkit.org/show_bug.cgi?id=136900
2594
2595         Reviewed by Benjamin Poulain.
2596
2597         Use fastHasAttribute() / fastGetAttribute() when possible, that is when
2598         the attribute is not SVG-animated or the |style| attribute, to avoid
2599         synchronizing attributes unnecessarily.
2600
2601         Also avoid calling hasAttribute(xxxAttr) then getAttribute(xxxAttr) as
2602         it causes 2 linear searches. It is best to call getAttribute(xxxAttr)
2603         directly and check if it returns the nullAtom.
2604
2605         No new tests, no behavior change. Element::fastAttributeLookupAllowed()
2606         is there as a safety set for debug builds.
2607
2608         * accessibility/AccessibilityListBoxOption.cpp:
2609         (WebCore::AccessibilityListBoxOption::isEnabled):
2610         * accessibility/AccessibilityNodeObject.cpp:
2611         (WebCore::AccessibilityNodeObject::alternativeTextForWebArea):
2612         (WebCore::AccessibilityNodeObject::hierarchicalLevel):
2613         * accessibility/AccessibilityObject.cpp:
2614         (WebCore::AccessibilityObject::contentEditableAttributeIsEnabled):
2615         * dom/Document.cpp:
2616         (WebCore::Document::hasManifest):
2617         * dom/DocumentOrderedMap.cpp:
2618         (WebCore::keyMatchesLabelForAttribute):
2619         * dom/DocumentStyleSheetCollection.cpp:
2620         (WebCore::DocumentStyleSheetCollection::collectActiveStyleSheets):
2621         * dom/Element.cpp:
2622         (WebCore::Element::imageSourceURL):
2623         (WebCore::Element::pseudo):
2624         (WebCore::Element::spellcheckAttributeState):
2625         * editing/ApplyStyleCommand.cpp:
2626         (WebCore::ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock):
2627         * editing/EditingStyle.cpp:
2628         (WebCore::HTMLAttributeEquivalent::attributeValueAsCSSValue):
2629         (WebCore::HTMLFontSizeEquivalent::attributeValueAsCSSValue):
2630         * editing/SplitElementCommand.cpp:
2631         (WebCore::SplitElementCommand::doUnapply):
2632         * html/HTMLAnchorElement.cpp:
2633         (WebCore::HTMLAnchorElement::draggable):
2634         (WebCore::HTMLAnchorElement::sendPings):
2635         * html/HTMLAppletElement.cpp:
2636         (WebCore::HTMLAppletElement::updateWidget):
2637         * html/HTMLBodyElement.cpp:
2638         (WebCore::HTMLBodyElement::addSubresourceAttributeURLs):
2639         * html/HTMLButtonElement.cpp:
2640         (WebCore::HTMLButtonElement::value):
2641         * html/HTMLDocument.cpp:
2642         (WebCore::HTMLDocument::dir):
2643         * html/HTMLEmbedElement.cpp:
2644         (WebCore::HTMLEmbedElement::imageSourceURL):
2645         (WebCore::HTMLEmbedElement::addSubresourceAttributeURLs):
2646         * html/HTMLFieldSetElement.cpp:
2647         (WebCore::HTMLFieldSetElement::~HTMLFieldSetElement):
2648         (WebCore::updateFromControlElementsAncestorDisabledStateUnder):
2649         (WebCore::HTMLFieldSetElement::disabledAttributeChanged):
2650         (WebCore::HTMLFieldSetElement::disabledStateChanged):
2651         (WebCore::HTMLFieldSetElement::childrenChanged):
2652         (WebCore::HTMLFieldSetElement::didMoveToNewDocument):
2653         * html/HTMLFormControlElement.cpp:
2654         (WebCore::HTMLFormControlElement::computeIsDisabledByFieldsetAncestor):
2655         * html/HTMLFormElement.cpp:
2656         (WebCore::HTMLFormElement::action):
2657         * html/HTMLFrameElement.cpp:
2658         (WebCore::HTMLFrameElement::noResize):
2659         * html/HTMLFrameElementBase.cpp:
2660         (WebCore::HTMLFrameElementBase::location):
2661         * html/HTMLHRElement.cpp:
2662         (WebCore::HTMLHRElement::collectStyleForPresentationAttribute):
2663         * html/HTMLHtmlElement.cpp:
2664         (WebCore::HTMLHtmlElement::insertedByParser):
2665         * html/HTMLImageElement.cpp:
2666         (WebCore::HTMLImageElement::altText):
2667         (WebCore::HTMLImageElement::alt):
2668         (WebCore::HTMLImageElement::draggable):
2669         (WebCore::HTMLImageElement::src):
2670         (WebCore::HTMLImageElement::addSubresourceAttributeURLs):
2671         * html/HTMLInputElement.cpp:
2672         (WebCore::HTMLInputElement::finishParsingChildren):
2673         (WebCore::HTMLInputElement::altText):
2674         (WebCore::HTMLInputElement::reset):
2675         * html/HTMLLabelElement.cpp:
2676         (WebCore::HTMLLabelElement::control):
2677         * html/HTMLLinkElement.cpp:
2678         (WebCore::HTMLLinkElement::process):
2679         (WebCore::HTMLLinkElement::rel):
2680         * html/HTMLMetaElement.cpp:
2681         (WebCore::HTMLMetaElement::content):
2682         (WebCore::HTMLMetaElement::httpEquiv):
2683         * html/HTMLObjectElement.cpp:
2684         (WebCore::HTMLObjectElement::imageSourceURL):
2685         (WebCore::HTMLObjectElement::addSubresourceAttributeURLs):
2686         * html/HTMLOptGroupElement.cpp:
2687         (WebCore::HTMLOptGroupElement::groupLabelText):
2688         * html/HTMLProgressElement.cpp:
2689         (WebCore::HTMLProgressElement::max):
2690         * html/HTMLScriptElement.cpp:
2691         (WebCore::HTMLScriptElement::sourceAttributeValue):
2692         (WebCore::HTMLScriptElement::charsetAttributeValue):
2693         (WebCore::HTMLScriptElement::languageAttributeValue):
2694         (WebCore::HTMLScriptElement::forAttributeValue):
2695         (WebCore::HTMLScriptElement::eventAttributeValue):
2696         * html/HTMLTableCellElement.cpp:
2697         (WebCore::HTMLTableCellElement::addSubresourceAttributeURLs):
2698         * html/HTMLTableElement.cpp:
2699         (WebCore::HTMLTableElement::rules):
2700         (WebCore::HTMLTableElement::summary):
2701         (WebCore::HTMLTableElement::addSubresourceAttributeURLs):
2702         * html/HTMLTableSectionElement.cpp:
2703         (WebCore::HTMLTableSectionElement::align):
2704         (WebCore::HTMLTableSectionElement::ch):
2705         (WebCore::HTMLTableSectionElement::vAlign):
2706         * html/HTMLTextAreaElement.cpp:
2707         (WebCore::HTMLTextAreaElement::maxLength):
2708         * html/SearchInputType.cpp:
2709         (WebCore::SearchInputType::searchEventsShouldBeDispatched):
2710         * loader/FormSubmission.cpp:
2711         (WebCore::FormSubmission::create):
2712         * page/Frame.cpp:
2713         (WebCore::Frame::matchLabelsAgainstElement):
2714         * page/PageSerializer.cpp:
2715         (WebCore::PageSerializer::serializeFrame):
2716         * platform/win/PasteboardWin.cpp:
2717         (WebCore::Pasteboard::writeImageToDataObject):
2718         * rendering/HitTestResult.cpp:
2719         (WebCore::HitTestResult::altDisplayString):
2720         * rendering/RenderSearchField.cpp:
2721         (WebCore::RenderSearchField::autosaveName):
2722         * rendering/RenderTableCell.cpp:
2723         (WebCore::RenderTableCell::computePreferredLogicalWidths):
2724         * rendering/svg/RenderSVGResourceClipper.cpp:
2725         (WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage):
2726
2727 2014-09-18  Chris Dumez  <cdumez@apple.com>
2728
2729         Have LiveNodeLists / HTMLCollections's elementMatches() take a reference
2730         https://bugs.webkit.org/show_bug.cgi?id=136902
2731
2732         Reviewed by Darin Adler.
2733
2734         Have LiveNodeLists / HTMLCollections's elementMatches() take a reference
2735         in argument instead of a pointer as the Element can never be null.
2736
2737         No new tests, no behavior change.
2738
2739         * dom/ClassNodeList.h:
2740         (WebCore::ClassNodeList::elementMatches):
2741         * dom/DocumentOrderedMap.cpp:
2742         (WebCore::keyMatchesWindowNamedItem):
2743         (WebCore::keyMatchesDocumentNamedItem):
2744         * dom/Element.cpp:
2745         (WebCore::Element::updateNameForDocument):
2746         (WebCore::Element::updateIdForDocument):
2747         * dom/LiveNodeList.cpp:
2748         (WebCore::LiveNodeList::namedItem):
2749         * dom/LiveNodeList.h:
2750         (WebCore::CachedLiveNodeList<NodeListType>::collectionBegin):
2751         (WebCore::CachedLiveNodeList<NodeListType>::collectionLast):
2752         (WebCore::CachedLiveNodeList<NodeListType>::collectionTraverseForward):
2753         (WebCore::CachedLiveNodeList<NodeListType>::collectionTraverseBackward):
2754         * dom/NameNodeList.h:
2755         (WebCore::NameNodeList::elementMatches):
2756         * dom/TagNodeList.h:
2757         (WebCore::TagNodeList::elementMatches):
2758         (WebCore::HTMLTagNodeList::elementMatches):
2759         * html/HTMLCollection.cpp:
2760         (WebCore::isMatchingElement):
2761         * html/HTMLNameCollection.cpp:
2762         (WebCore::WindowNameCollection::elementMatchesIfNameAttributeMatch):
2763         (WebCore::WindowNameCollection::elementMatches):
2764         (WebCore::DocumentNameCollection::elementMatchesIfIdAttributeMatch):
2765         (WebCore::DocumentNameCollection::elementMatchesIfNameAttributeMatch):
2766         (WebCore::DocumentNameCollection::elementMatches):
2767         * html/HTMLNameCollection.h:
2768         * html/LabelsNodeList.cpp:
2769         (WebCore::LabelsNodeList::elementMatches):
2770         * html/LabelsNodeList.h:
2771         * html/RadioNodeList.cpp:
2772         (WebCore::RadioNodeList::checkElementMatchesRadioNodeListFilter):
2773         (WebCore::RadioNodeList::elementMatches):
2774         * html/RadioNodeList.h:
2775
2776 2014-09-18  Carlos Garcia Campos  <cgarcia@igalia.com>
2777
2778         Remove unused methods from MediaPlayerClient
2779         https://bugs.webkit.org/show_bug.cgi?id=136884
2780
2781         Reviewed by Eric Carlson.
2782
2783         Remove unused methods from MediaPlayerClient that introduce
2784         dependencies on WebCore types.
2785
2786         * html/HTMLMediaElement.cpp:
2787         * html/HTMLMediaElement.h:
2788         * platform/graphics/MediaPlayer.h:
2789         (WebCore::MediaPlayerClient::mediaPlayerOwningDocument): Deleted.
2790         (WebCore::MediaPlayerClient::mediaPlayerHostWindow): Deleted.
2791         (WebCore::MediaPlayerClient::mediaPlayerWindowClipRect): Deleted.
2792
2793 2014-09-17  Iago Toral  <itoral@igalia.com> and Zan Dobersek  <zdobersek@igalia.com>
2794
2795         [GTK] Add Wayland support to GLContextEGL
2796         https://bugs.webkit.org/show_bug.cgi?id=136829
2797
2798         Reviewed by Martin Robinson.
2799
2800         * platform/graphics/egl/GLContextEGL.cpp:
2801         (WebCore::sharedEGLDisplay): Special-case the shared EGL display initialization
2802         for the GTK port when running under Wayland. In that case the pointer to the
2803         native wl_display object should be passed to eglGetDisplay(). If not running
2804         under Wayland we should fall back to using the shared X11 display (if support
2805         for that display system is enabled) or the EGL_DEFAULT_DISPLAY.
2806
2807 2014-09-17  Daniel Bates  <dabates@apple.com>
2808
2809         Unreviewed, rolling out r173695.
2810
2811         Broke building third-party Legacy WebKit apps; will
2812         investigate offline
2813
2814         Reverted changeset:
2815
2816         "[iOS] Make WebCore build with public iOS SDK"
2817         https://bugs.webkit.org/show_bug.cgi?id=136487
2818         http://trac.webkit.org/changeset/173695
2819
2820 2014-09-17  Roger Fong  <roger_fong@apple.com>
2821
2822         Speculative fix for a fast\dom\html-collections-named-getter failing only in Debug builds.
2823
2824         * dom/Node.cpp:
2825         (WebCore::Document::invalidateNodeListAndCollectionCaches):
2826
2827 2014-09-17  Benjamin Poulain  <bpoulain@apple.com>
2828
2829         Add parsing for :nth-child(An+B of selector)
2830         https://bugs.webkit.org/show_bug.cgi?id=136845
2831
2832         Reviewed by Antti Koivisto.
2833
2834         Add support for parsing :nth-child(of). The implementation of selector matching
2835         will be in a follow up, there are enough edge cases here already.
2836
2837         Spec here: http://dev.w3.org/csswg/selectors4/#the-nth-child-pseudo
2838
2839         Test: fast/css/parsing-css-nth-child-of.html
2840
2841         * css/CSSParser.cpp:
2842         (WebCore::CSSParser::detectFunctionTypeToken):
2843         (WebCore::CSSParser::realLex):
2844         The parser generate two new kinds of tokens:
2845         -NTHCHILDFUNCTION, matching the "nth-child" identifier.
2846         -NTHCHILDSELECTORSEPARATOR, matching the "of" keyword separating An+B from the selector list.
2847
2848         NTHCHILDFUNCTION is used to extend the new syntax only for :nth-child() and not all the "nth" functions
2849         (e.g. :nth-of-type()).
2850
2851         NTHCHILDSELECTORSEPARATOR exists for two reasons:
2852         -We must clear the "parsingMode" before parsing selectorList. If we failed to do that, the complex selectors
2853          would be parsed in NthChildMode, which has all kind of bad side effects.
2854         -The second reason is differentiacting "of" for all the other identifiers. Arguably, this could have been done
2855          in the grammar, but it is clearer this way since we already need the branches for the parsingMode.
2856
2857         * css/CSSGrammar.y.in:
2858         Those are pretty much duplicates of the existing FUNCTION rules but supporting the new syntax.
2859
2860         * css/CSSParserValues.cpp:
2861         (WebCore::selectorListMatchesPseudoElement):
2862         (WebCore::CSSParserSelector::matchesPseudoElement):
2863         Matching pseudo elements does not make much sense for those selectorList (e.g. :nth-child(2n of ::before)).
2864         Add helper function to fail parsing of those cases.
2865
2866         * css/CSSParserValues.h:
2867         * css/CSSSelector.cpp:
2868         (WebCore::CSSSelector::selectorText):
2869         * css/CSSSelector.h:
2870         (WebCore::CSSSelector::selectorList):
2871         Updated serialization code for CSS OM.
2872
2873 2014-09-17  Benjamin Poulain  <bpoulain@apple.com>
2874
2875         CSS value in whitespace-separated list attribute selector (~=) mishandles tab/newline/etc.
2876         https://bugs.webkit.org/show_bug.cgi?id=136807
2877
2878         Reviewed by Antti Koivisto.
2879
2880         The spec defines selector lists as token separated by white space.
2881
2882         The definition of white space for CSS Selectors is:
2883         "White space in Selectors consists of the code points SPACE (U+0020),
2884         TAB (U+0009), LINE FEED (U+000A), CARRIAGE RETURN (U+000D), and FORM FEED (U+000C)
2885         can occur in whitespace. Other space-like code points, such as EM SPACE (U+2003)
2886         and IDEOGRAPHIC SPACE (U+3000), are never part of white space."
2887
2888         The old code was only matching SPACE (U+0020) which is buggy. This patch
2889         adds support for the other caracters.
2890
2891         Tests: fast/selectors/attr-list-01.html
2892                fast/selectors/attribute-list-with-whitespace-in-selector.html
2893                fast/selectors/attribute-list-with-whitespace-in-value.html
2894
2895         * css/SelectorChecker.cpp:
2896         (WebCore::attributeValueMatches):
2897         * cssjit/SelectorCompiler.cpp:
2898         (WebCore::SelectorCompiler::constructFragments):
2899         (WebCore::SelectorCompiler::attributeValueSpaceSeparetedListContains):
2900         Add the missing checks.
2901
2902         * html/track/VTTRegion.cpp:
2903         (WebCore::VTTRegion::setRegionSettings):
2904         (WebCore::VTTRegion::parseSettingValue):
2905         * html/track/WebVTTParser.cpp:
2906         (WebCore::WebVTTParser::hasRequiredFileIdentifier):
2907         (WebCore::WebVTTParser::collectTimingsAndSettings):
2908         * html/track/WebVTTParser.h:
2909         While looking for affected code, I discovered WebVTT redefines isHTMLSpace().
2910         I cleaned that code.
2911
2912 2014-09-17  Gavin Barraclough  <baraclough@apple.com>
2913
2914         Aways have a PageThrottler (sometimes have a UserActivity::Impl)
2915         https://bugs.webkit.org/show_bug.cgi?id=136892
2916
2917         Reviewed by Geoffrey Garen.
2918
2919         Some instances of Page have a PageThrottler to track activity on the Page, and some do not.
2920         (Specifically, those created from WebPage in WK2 do, those related to WK1, SVG & inspector do not).
2921
2922         We do this for three reasons:
2923             * We do not need to take AppNap assertions on WK1.
2924             * Some Pages do not track their visibility correctly, and would always claim to be visible.
2925             * Page VisibilityState is not set until after construction, so if we instantiate
2926
2927         Creating the entire PageThrottler lazily has the drawback that we have to check for its existence at
2928         numerous points throughout the code, and we'll miss activity that occurs between the Page being created
2929         & the PageThrottler added to it (really a theoretical problem right now, since they're currently always
2930         created pretty much back to back).
2931
2932         Instead, Page should always have a PageThrottler, & instead make the UserActivity::Impl on the
2933         PageThrottler be added later.
2934
2935         * WebCore.exp.in:
2936             - createPageThrottler -> enablePageThrottler
2937         * html/HTMLMediaElement.cpp:
2938         (WebCore::HTMLMediaElement::parseAttribute):
2939             - Page::pageThrottler now returns a reference rather than a pointer
2940         * loader/FrameLoader.cpp:
2941         (WebCore::FrameLoader::started):
2942             - Page::pageThrottler now returns a reference rather than a pointer
2943         * page/Page.cpp:
2944         (WebCore::Page::Page):
2945             - instantiate PageThrottler in constructor
2946         (WebCore::Page::enablePageThrottler):
2947             - renamed from createPageThrottler, instead of creating the PageThrottler this method now
2948               instruct PageThrottler to create a UserActivity::Impl
2949         (WebCore::Page::setViewState):
2950             - m_pageThrottler is not a pointer
2951         (WebCore::Page::createPageThrottler): Deleted.
2952             - renamed to enablePageThrottler
2953         * page/Page.h:
2954         (WebCore::Page::pageThrottler):
2955             - now returns a reference
2956         * page/PageThrottler.cpp:
2957         (WebCore::PageThrottler::PageThrottler):
2958             - no longer instantiate m_activity
2959         (WebCore::PageThrottler::createUserActivity):
2960             - lazily instantiate m_activity, call updateUserActivity
2961         (WebCore::PageThrottler::updateUserActivity):
2962             - m_activity may not yet be instantiated; added early return
2963         * page/PageThrottler.h:
2964             - m_activity becomes a std::unique_ptr, added createUserActivity
2965
2966 2014-09-17  Daniel Bates  <dabates@apple.com>
2967
2968         [iOS] Make WebCore build with public iOS SDK
2969         https://bugs.webkit.org/show_bug.cgi?id=136487
2970
2971         Reviewed by David Kilzer.
2972
2973         Add headers that wrap Mac and iOS SPIs and update WebCore source files to include these
2974         headers instead of the corresponding actual SPI header(s).
2975
2976         * WebCore.vcxproj/WebCore.vcxproj:
2977         * WebCore.vcxproj/WebCore.vcxproj.filters:
2978         * WebCore.vcxproj/WebCoreCG.props:
2979         * WebCore.vcxproj/copyForwardingHeaders.cmd:
2980         * WebCore.xcodeproj/project.pbxproj:
2981         * bindings/objc/DOMInternal.mm:
2982         * bridge/objc/objc_instance.mm:
2983         * platform/audio/ios/MediaSessionManagerIOS.mm:
2984         * platform/cocoa/DisplaySleepDisablerCocoa.cpp:
2985         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
2986         * platform/graphics/SimpleFontData.h:
2987         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2988         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
2989         * platform/graphics/cg/BitmapImageCG.cpp:
2990         * platform/graphics/cg/ColorCG.cpp:
2991         * platform/graphics/cg/GraphicsContextCG.cpp:
2992         * platform/graphics/cg/ImageSourceCG.cpp:
2993         * platform/graphics/cg/PDFDocumentImage.cpp:
2994         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
2995         * platform/graphics/ios/FontCacheIOS.mm:
2996         * platform/graphics/ios/FontServicesIOS.mm:
2997         * platform/graphics/ios/SimpleFontDataIOS.mm:
2998         * platform/graphics/mac/FontMac.mm:
2999         * platform/graphics/mac/GlyphPageTreeNodeMac.cpp:
3000         * platform/graphics/mac/MediaPlayerProxy.h:
3001         * platform/graphics/mac/SimpleFontDataMac.mm:
3002         * platform/ios/LegacyTileCache.mm:
3003         * platform/ios/LegacyTileGrid.mm:
3004         * platform/ios/LegacyTileGridTile.mm:
3005         * platform/ios/PlatformEventFactoryIOS.mm:
3006         * platform/ios/PlatformScreenIOS.mm:
3007         * platform/ios/WebEvent.mm:
3008         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3009         * platform/ios/wak/WAKAppKitStubs.h:
3010         * platform/ios/wak/WAKView.h:
3011         * platform/ios/wak/WKGraphics.h:
3012         * platform/ios/wak/WKGraphics.mm:
3013         * platform/ios/wak/WebCoreThread.mm:
3014         * platform/network/ios/QuickLook.mm:
3015         * platform/spi/ca/CALayerSPI.h: Added.
3016         * platform/spi/ca/CATiledLayerSPI.h: Added.
3017         * platform/spi/cf/CFLocaleSPI.h: Modified to use EXTERN_C.
3018         * platform/spi/cf/CFNetworkConnectionCacheSPI.h: Ditto. Also changed header visibility from private to project.
3019         * platform/spi/cf/CFURLRequestSPI.h: Ditto. Also modified to unconditionally include header <CoreFoundation/CFBase.h>.
3020         * platform/spi/cg/CGColorTransformSPI.h: Added.
3021         * platform/spi/cg/CGContextSPI.h: Added.
3022         * platform/spi/cg/CGFloatSPI.h: Added.
3023         * platform/spi/cg/CGFontGlyphSupportSPI.h: Added.
3024         * platform/spi/cg/CGFontInfoSPI.h: Added.
3025         * platform/spi/cg/CGFontRenderingSPI.h: Added.
3026         * platform/spi/cg/CGFontUnicodeSupportSPI.h: Added.
3027         * platform/spi/cg/CGImageSPI.h: Added.
3028         * platform/spi/cg/CGSRegionSPI.h: Added.
3029         * platform/spi/cocoa/DispatchSPI.h: Added.
3030         * platform/spi/cocoa/IOPMLibSPI.h: Added.
3031         * platform/spi/cocoa/MachVMSPI.h: Added.
3032         * platform/spi/cocoa/NSFileManagerSPI.h: Added.
3033         * platform/spi/cocoa/NSGeometrySPI.h: Added.
3034         * platform/spi/cocoa/NSPointerFunctionsSPI.h: Added.
3035         * platform/spi/cocoa/dyldSPI.h: Added.
3036         * platform/spi/ios/AVPlayerControllerSPI.h: Added.
3037         * platform/spi/ios/AVPlayerViewControllerSPI.h: Added.
3038         * platform/spi/ios/AVValueTimingSPI.h: Added.
3039         * platform/spi/ios/AVVideoLayerSPI.h: Added.
3040         * platform/spi/ios/CTFontDescriptorSPI.h: Added.
3041         * platform/spi/ios/CTFontSPI.h: Added.
3042         * platform/spi/ios/CUICatalogSPI.h: Added.
3043         * platform/spi/ios/CUIStyleEffectConfigurationSPI.h: Added.
3044         * platform/spi/ios/MPAVRoutingControllerSPI.h: Added.
3045         * platform/spi/ios/MobileGestaltSPI.h: Added.
3046         * platform/spi/ios/QLPreviewConverterSPI.h: Added.
3047         * platform/spi/ios/QuickLookSPI.h: Added.
3048         * rendering/RenderThemeIOS.mm:
3049
3050 2014-09-17  Gavin Barraclough  <barraclough@apple.com>
3051
3052         DOM timer throttling for hidden plugins
3053         https://bugs.webkit.org/show_bug.cgi?id=136197
3054
3055         Reviewed by Geoff Garen & Andreas Kling.
3056
3057         For non-visible web pages we slow timers (since they can't be driving animations, etc).
3058         We should do the same for plugins.
3059
3060         There are a few steps to this:
3061             - JSPluginElementFunctions notifies DOMTimer when script interacts with a plugin.
3062             - DOMTimerFireState keeps a record of events that occur while a timer is firing.
3063             - DOMTimer::fired detects timers that interact with invisible/inaudible plugins, and flags itself for throtting.
3064             - DOMTimer::intervalClampedToMinimum sets timer intervals appropriately.
3065
3066         * bindings/js/JSPluginElementFunctions.cpp:
3067         (WebCore::pluginScriptObject):
3068             - notify DOMTimer when script interacts with a plugin.
3069         * html/HTMLPlugInElement.cpp:
3070         (WebCore::HTMLPlugInElement::isDetectable):
3071         * html/HTMLPlugInElement.h:
3072             - added isDetectable, to check for visible / audible plugins.
3073         * page/DOMTimer.cpp:
3074         (WebCore::DOMTimerFireState::DOMTimerFireState):
3075         (WebCore::DOMTimerFireState::~DOMTimerFireState):
3076             - track current DOMTimerFireState.
3077         (WebCore::DOMTimer::DOMTimer):
3078             - initialize m_throttleState.
3079         (WebCore::DOMTimer::scriptDidInteractWithPlugin):
3080             - if interaction with a plugin occurs while a timer is firing, record on the DOMTimerFireState.
3081         (WebCore::DOMTimer::fired):
3082             - set DOMTimerFireState, and update m_throttleState accordingly.
3083         (WebCore::DOMTimer::updateTimerIntervalIfNecessary):
3084             - remove redundant check of maxTimerNestingLevel (covered by intervalClampedToMinimum).
3085         (WebCore::DOMTimer::intervalClampedToMinimum):
3086             - Also take m_throttleState into account when throttling.
3087         * page/DOMTimer.h:
3088             - added scriptDidInteractWithPlugin, m_throttleState.
3089         * platform/audio/AudioHardwareListener.h:
3090             - enum -> enum class.
3091         * plugins/PluginViewBase.h:
3092         (WebCore::PluginViewBase::audioHardwareActivity):
3093             - expose audioHardwareActivity on PluginViewBase (previously available in subclass).
3094
3095 2014-09-16  Gavin Barraclough  <baraclough@apple.com>
3096
3097         Exclude page visibility from PageThrottler's hysteresis
3098         https://bugs.webkit.org/show_bug.cgi?id=136866
3099
3100         Reviewed by Geoff Garen.
3101
3102         Including visibility in the hysteresis mechanism has the effect of prolonging the visually
3103         idle timeout, and causing the page hide event to be run at foreground priority. Neither of
3104         these are particularly desirable. Instead separate visibility from the rest of the page
3105         activities we track (and apply hysteresis to), and feed this directly into determination
3106         of the UserActivity state.
3107
3108         * page/PageThrottler.cpp:
3109         (WebCore::PageThrottler::PageThrottler):
3110             - when the PageThrottler is instantiated call updateUserActivity to set initial UserActivity.
3111         (WebCore::PageThrottler::incrementActivityCount):
3112             - simplified - when m_activityCount becomes non-zero, start m_hysteresis.
3113         (WebCore::PageThrottler::decrementActivityCount):
3114             - simplified - when m_activityCount becomes zero, stop m_hysteresis.
3115         (WebCore::PageThrottler::updateUserActivity):
3116             - end the UserActivity (allow AppNap) if visually idle and no page activity is taking place.
3117         (WebCore::PageThrottler::setViewState):
3118             - when the visually idle state changed call updateUserActivity to update the UserActivity.
3119         (WebCore::PageThrottler::started):
3120         (WebCore::PageThrottler::stopped):
3121             - when the hysteresis state changed call updateUserActivity to update the UserActivity.
3122         (WebCore::PageThrottler::updateHysteresis): Deleted.
3123             - removed: simplified the hysteresis trigger, we now incorporate visually idle state in updateUserActivity.
3124         * page/PageThrottler.h:
3125             - removed updateHysteresis, added updateUserActivity.
3126         * platform/HysteresisActivity.h:
3127         (WebCore::HysteresisActivity::state):
3128             - determine the curent state of the HysteresisActivity - started, waiting, or stopped.
3129
3130 2014-09-17  Carlos Garcia Campos  <cgarcia@igalia.com>
3131
3132         [GTK] Fix runtime critical warnings when writing to the clipboard after r173687
3133         https://bugs.webkit.org/show_bug.cgi?id=136891
3134
3135         Reviewed by Philippe Normand.
3136
3137         * platform/gtk/PasteboardHelper.cpp:
3138         (WebCore::PasteboardHelper::writeClipboardContents): Check passed
3139         callback is not null before trying to ref/unref it since
3140         g_closure_ref/unref are not null safe.
3141
3142 2014-09-17  Zan Dobersek  <zdobersek@igalia.com>
3143
3144         [GTK] Add a helper function for display system deduction
3145         https://bugs.webkit.org/show_bug.cgi?id=136849
3146
3147         Reviewed by Martin Robinson.
3148
3149         getDisplaySystemType() is a helper function that checks the type of the
3150         default GdkDisplay object and initializes a static variable to the
3151         corresponding value. It then returns the value of that variable.
3152
3153         When building with the GTK+2 API (still the case with the GTK+2 plugin
3154         process) we default to X11.
3155
3156         The function is declared and implemented in GtkUtilities files.
3157
3158         * platform/gtk/GtkUtilities.cpp:
3159         (WebCore::widgetIsOnscreenToplevelWindow):
3160         (WebCore::getDisplaySystemType):
3161         * platform/gtk/GtkUtilities.h:
3162
3163 2014-09-16  Yusuke Suzuki  <utatane.tea@gmail.com>
3164
3165         filterRootById accidentally clears inAdjacentChain flag
3166         https://bugs.webkit.org/show_bug.cgi?id=136851
3167
3168         Reviewed by Benjamin Poulain.
3169
3170         Test: fast/selectors/filter-root-node-with-selector-contains-adjacents.html
3171
3172         * dom/SelectorQuery.cpp:
3173         (WebCore::filterRootById):
3174
3175 2014-09-16  Carlos Garcia Campos  <cgarcia@igalia.com>
3176
3177         [GTK] Fix layering violations in PasteboardGtk
3178         https://bugs.webkit.org/show_bug.cgi?id=136802
3179
3180         Reviewed by Darin Adler.
3181
3182         Refactor the Pasteboard code moving the WebCore parts to the Editor.
3183
3184         * PlatformGTK.cmake: Add new file to compilation.
3185         * editing/Editor.cpp:
3186         (WebCore::Editor::performCutOrCopy):
3187         (WebCore::Editor::copyImage):
3188         * editing/Editor.h:
3189         * editing/gtk/EditorGtk.cpp: Added.
3190         (WebCore::createFragmentFromPasteBoardData):
3191         (WebCore::Editor::pasteWithPasteboard):
3192         (WebCore::getImageAndURLForElement):
3193         (WebCore::Editor::writeImageToPasteboard):
3194         (WebCore::Editor::writeSelectionToPasteboard):
3195         * page/DragController.cpp:
3196         (WebCore::DragController::startDrag):
3197         * page/gtk/DragControllerGtk.cpp:
3198         (WebCore::DragController::declareAndWriteDragImage):
3199         * platform/Pasteboard.h:
3200         * platform/gtk/DataObjectGtk.cpp: Remove range member, the caller
3201         should call setText() + setMarkup() intead.
3202         (WebCore::DataObjectGtk::setText):
3203         (WebCore::DataObjectGtk::setMarkup):
3204         (WebCore::DataObjectGtk::clearText):
3205         (WebCore::DataObjectGtk::clearMarkup):
3206         (WebCore::DataObjectGtk::clearAllExceptFilenames):
3207         * platform/gtk/DataObjectGtk.h:
3208         (WebCore::DataObjectGtk::hasText):
3209         (WebCore::DataObjectGtk::hasMarkup):
3210         (WebCore::DataObjectGtk::clearImage):
3211         (WebCore::DataObjectGtk::text):
3212         (WebCore::DataObjectGtk::markup):
3213         (WebCore::DataObjectGtk::setRange): Deleted.
3214         * platform/gtk/GtkDragAndDropHelper.h:
3215         * platform/gtk/PasteboardGtk.cpp:
3216         (WebCore::PasteboardImage::PasteboardImage):
3217         (WebCore::PasteboardImage::~PasteboardImage):
3218         (WebCore::Pasteboard::write):
3219         (WebCore::Pasteboard::writeSelection): Deleted.
3220         (WebCore::getURLForImageElement): Deleted.
3221         (WebCore::Pasteboard::writeImage): Deleted.
3222         (WebCore::Pasteboard::documentFragment): Deleted.
3223         * platform/gtk/PasteboardHelper.cpp:
3224         (WebCore::displayFromFrame): Deleted.
3225         (WebCore::PasteboardHelper::getPrimarySelectionClipboard): Deleted.
3226         * platform/gtk/PasteboardHelper.h:
3227
3228 2014-09-16  Carlos Garcia Campos  <cgarcia@igalia.com>
3229
3230         DragData should not depend on Clipboard, DocumentFragment, and Document
3231         https://bugs.webkit.org/show_bug.cgi?id=21358
3232
3233         Reviewed by Darin Adler.
3234
3235         Refactor DragData to not depend on Frame, DocumentFragment,
3236         Document and Range. DragData::asFragment() has been moved to
3237         DragController and implemented in the platform specific file.
3238         DragData methods using Frame has been reworked in Mac to not use
3239         Frame, since all other ports were ignoreing the frame parameter.
3240
3241         * page/DragController.cpp:
3242         (WebCore::DragController::documentFragmentFromDragData): Make it
3243         a static member to be able to use createFragmentFromDragData().
3244         (WebCore::DragController::performDragOperation): Update to
3245         DragData API changes.
3246         (WebCore::DragController::dispatchTextInputEventFor): Ditto.
3247         (WebCore::DragController::concludeEditDrag): Ditto.
3248         (WebCore::documentFragmentFromDragData): Deleted.
3249         * page/DragController.h:
3250         * page/efl/DragControllerEfl.cpp:
3251         (WebCore::DragController::createFragmentFromDragData): Move
3252         DragData::asFragment() implementation here.
3253         * page/gtk/DragControllerGtk.cpp:
3254         (WebCore::DragController::dragOperation):
3255         (WebCore::DragController::createFragmentFromDragData): Ditto.
3256         * page/mac/DragControllerMac.mm:
3257         (WebCore::DragController::dragOperation):
3258         (WebCore::DragController::createFragmentFromDragData): Ditto.
3259         * page/win/DragControllerWin.cpp:
3260         (WebCore::DragController::createFragmentFromDragData): Ditto.
3261         * platform/DragData.h:
3262         * platform/efl/DragDataEfl.cpp:
3263         (WebCore::DragData::asPlainText): Remove Frame parameter.
3264         (WebCore::DragData::containsURL): Ditto.
3265         (WebCore::DragData::asURL): Ditto.
3266         (WebCore::DragData::asFragment): Deleted.
3267         * platform/gtk/DragDataGtk.cpp:
3268         (WebCore::DragData::asPlainText): Remove Frame parameter.
3269         (WebCore::DragData::containsCompatibleContent):
3270         (WebCore::DragData::containsURL): Ditto.
3271         (WebCore::DragData::asURL): Ditto.
3272         (WebCore::DragData::asFragment): Deleted.
3273         * platform/mac/DragDataMac.mm:
3274         (WebCore::DragData::asPlainText): Same implementation as the
3275         Editor.
3276         (WebCore::DragData::containsURL): Remove Frame parameter.
3277         (WebCore::DragData::asURL): Use URLByCanonicalizingURL() instead
3278         of using the Editor client.
3279         (WebCore::DragData::asFragment): Deleted.
3280         * platform/win/DragDataWin.cpp:
3281         (WebCore::DragData::containsURL): Remove Frame parameter.
3282         (WebCore::DragData::asURL): Ditto.
3283         (WebCore::DragData::asPlainText): Ditto.
3284         (WebCore::DragData::containsCompatibleContent):
3285         (WebCore::DragData::asFragment): Deleted.
3286
3287 2014-09-16  Chris Dumez  <cdumez@apple.com>
3288
3289         Rename Node::childNode(index) to traverseToChildAt(index) for clarity
3290         https://bugs.webkit.org/show_bug.cgi?id=136825
3291
3292         Reviewed by Benjamin Poulain.
3293
3294         Rename Node::childNode(index) to traverseToChildAt(index) to make it
3295         clearer that the method is actually traversing the children and thus
3296         potentially expensive.
3297
3298         This patch also avoids calling traverseToChildAt() in a couple of
3299         easily avoidable cases.
3300
3301         No new tests, no behavior change.
3302
3303         * WebCore.exp.in:
3304         * WebCore.order:
3305         Remove symbol for ContainerNode::childNode() as it was renamed. It does
3306         not seem we need to expose ContainerNode::traverseToChildAt().
3307
3308         * accessibility/AccessibilityObject.cpp:
3309         (WebCore::AccessibilityObject::stringForVisiblePositionRange):
3310         (WebCore::AccessibilityObject::lengthForVisiblePositionRange):
3311         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3312         (-[WebAccessibilityObjectWrapper arrayOfTextForTextMarkers:attributed:]):
3313         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3314         (-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:]):
3315         Mechanical renaming.
3316
3317         * dom/ContainerNode.cpp:
3318         (WebCore::ContainerNode::traverseToChildAt):
3319         (WebCore::ContainerNode::childNode): Deleted.
3320         * dom/ContainerNode.h:
3321         (WebCore::Node::traverseToChildAt):
3322         (WebCore::Node::childNode): Deleted.
3323         * dom/Node.h:
3324         - Rename Node / ContainerNode's childNode(index) to
3325           traverseToChildAt(index) to make it clear that it is actually
3326           traversing the children and thus potentially expensive.
3327         - Clean up the implementation of ContainerNode::traverseToChildAt()
3328           to avoid the use of an extra |i| variable.
3329
3330         * dom/Position.cpp:
3331         (WebCore::Position::computeNodeBeforePosition):
3332         Avoid calling traverseToChildAt(-1). Relying on the unsigned argument
3333         wrapping and the method returning null in this case is a bit obscure
3334         and causes unnecessary traversal of all children.
3335
3336         (WebCore::Position::computeNodeAfterPosition):
3337         (WebCore::Position::previous):
3338         (WebCore::Position::next):
3339         Mechanical renaming and update variable names to stop using
3340         abbreviations as per coding style.
3341
3342         * dom/PositionIterator.h:
3343         (WebCore::PositionIterator::PositionIterator):
3344         * dom/Range.cpp:
3345         (WebCore::Range::insertNode):
3346         (WebCore::Range::checkNodeWOffset):
3347         (WebCore::Range::firstNode):
3348         (WebCore::Range::pastLastNode):
3349         * dom/RangeBoundaryPoint.h:
3350         (WebCore::RangeBoundaryPoint::set):
3351         * editing/BreakBlockquoteCommand.cpp:
3352         (WebCore::BreakBlockquoteCommand::doApply):
3353         * editing/CompositeEditCommand.cpp:
3354         (WebCore::CompositeEditCommand::removeChildrenInRange):
3355         * editing/DeleteSelectionCommand.cpp:
3356         (WebCore::DeleteSelectionCommand::handleGeneralDelete):
3357         * editing/InsertParagraphSeparatorCommand.cpp:
3358         (WebCore::InsertParagraphSeparatorCommand::doApply):
3359         * editing/TextIterator.cpp:
3360         (WebCore::nextInPreOrderCrossingShadowBoundaries):
3361         (WebCore::TextIterator::node):
3362         (WebCore::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
3363         * editing/VisibleUnits.cpp:
3364         (WebCore::nextLinePosition):
3365         * editing/cocoa/HTMLConverter.mm:
3366         (WebCore::editingAttributedStringFromRange):
3367         Mechanical renaming.
3368
3369         * inspector/DOMPatchSupport.cpp:
3370         (WebCore::DOMPatchSupport::innerPatchChildren):
3371         Iterate over children while incrementing the |i| variable to avoid
3372         calling traverseToChildAt(index) repeatedly and thus traversing the
3373         children from the beginning every time.
3374
3375 2014-09-16  Joseph Pecoraro  <pecoraro@apple.com>
3376
3377         Web Inspector: Reduce a bit of churn setting initial remote inspection state
3378         https://bugs.webkit.org/show_bug.cgi?id=136875
3379
3380         Reviewed by Timothy Hatcher.
3381
3382         * bindings/js/JSDOMGlobalObject.cpp:
3383         (WebCore::JSDOMGlobalObject::finishCreation):
3384         We no longer need to toggle this state.
3385
3386 2014-09-16  Enrica Casucci  <enrica@apple.com>
3387
3388         Should have an editing behavior specific for IOS.
3389         https://bugs.webkit.org/show_bug.cgi?id=136876
3390
3391         Reviewed by Sam Weinig.
3392
3393         This patch introduces a new editing behavior type to be able
3394         to perform editing tasks that are specific to iOS.
3395         All the existing EditingBehavior methods return the same boolean
3396         value for for Mac and iOS. A new one has been introduced to support
3397         a specific behavior in the DeleteSelectionCommand.
3398
3399         * editing/DeleteSelectionCommand.cpp:
3400         (WebCore::DeleteSelectionCommand::doApply):
3401         * editing/EditingBehavior.h:
3402         (WebCore::EditingBehavior::shouldConsiderSelectionAsDirectional):
3403         (WebCore::EditingBehavior::shouldCenterAlignWhenSelectionIsRevealed):
3404         (WebCore::EditingBehavior::shouldToggleStyleBasedOnStartOfSelection):
3405         (WebCore::EditingBehavior::shouldAlwaysGrowSelectionWhenExtendingToBoundary):
3406         (WebCore::EditingBehavior::shouldSelectOnContextualMenuClick):
3407         (WebCore::EditingBehavior::shouldExtendSelectionByWordOrLineAcrossCaret):
3408         (WebCore::EditingBehavior::shouldRebalanceWhiteSpacesInSecureField):
3409         * editing/EditingBehaviorTypes.h:
3410         * editing/FrameSelection.cpp:
3411         (WebCore::FrameSelection::positionForPlatform):
3412         * page/Settings.cpp:
3413         (WebCore::editingBehaviorTypeForPlatform):
3414         * testing/InternalSettings.cpp:
3415         (WebCore::InternalSettings::setEditingBehavior):
3416
3417 2014-09-16  Commit Queue  <commit-queue@webkit.org>
3418
3419         Unreviewed, rolling out r173670.
3420         https://bugs.webkit.org/show_bug.cgi?id=136871
3421
3422         Creates layering violation (Requested by enrica on #webkit).
3423
3424         Reverted changeset:
3425
3426         "Move HTMLConverter from editing/cocoa to platform/cocoa."
3427         https://bugs.webkit.org/show_bug.cgi?id=136474
3428         http://trac.webkit.org/changeset/173670
3429
3430 2014-09-16  Eric Carlson  <eric.carlson@apple.com>
3431
3432         [Mac] MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput doesn't work with rotated movies
3433         https://bugs.webkit.org/show_bug.cgi?id=136872
3434
3435         Reviewed by Tim Horton.
3436
3437         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3438         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithImageGenerator): Add logging.
3439         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput): Apply the video track
3440             preferred transform.
3441
3442 2014-09-16  Enrica Casucci  <enrica@apple.com>
3443
3444         Move HTMLConverter from editing/cocoa to platform/cocoa.
3445         https://bugs.webkit.org/show_bug.cgi?id=136474
3446
3447         Reviewed by Benjamin Poulain.
3448
3449         This is a platform specific class and it belongs to the platform folder.
3450
3451         * WebCore.xcodeproj/project.pbxproj:
3452         * editing/cocoa: Removed.
3453         * editing/cocoa/HTMLConverter.h: Removed.
3454         * editing/cocoa/HTMLConverter.mm: Removed.
3455         * platform/cocoa/HTMLConverter.h: Copied from editing/cocoa/HTMLConverter.h.
3456         * platform/cocoa/HTMLConverter.mm: Copied from editing/cocoa/HTMLConverter.mm.
3457
3458 2014-09-16  Enrica Casucci  <enrica@apple.com>
3459
3460         Remove PLATFORM(IOS) from WebCore/editing (Part 3).
3461         https://bugs.webkit.org/show_bug.cgi?id=136474
3462
3463         Reviewed by Benjamin Poulain.
3464
3465         This is the updated version of the patch that was landed in r173340.
3466         This patch removes the use of PLATFORM(IOS) from TextAffinity.h
3467         and removes the assumption that EAffinity values match NSSelectionAffinity
3468         values. It also removes the includes in TextAffinity.h, creating the need to
3469         include explicitly the files when necessary.
3470
3471         * editing/TextAffinity.h:
3472         (kit): Deleted.
3473         (core): Deleted.
3474         * editing/cocoa/HTMLConverter.mm:
3475         * page/mac/WebCoreFrameView.h:
3476
3477 2014-09-16  Beth Dakin  <bdakin@apple.com>
3478
3479         overflow:scroll should not leave space for a scroll corner with overlay scrollbars
3480         https://bugs.webkit.org/show_bug.cgi?id=136861
3481
3482         Reviewed by Sam Weinig.
3483
3484         overflow:scroll should behave like overflow:auto when the scrollbar will render as 
3485         an overlay scrollbar.
3486
3487         Re-name hasAutoVerticalScrollbar()/Horizontal to 
3488         hasVerticalScrollbarWithAutoBehavior()/Horizontal, and return true for 
3489         overflow:scroll scrollbars that will render as overlay scrollbars.
3490         * rendering/RenderBox.cpp:
3491         (WebCore::RenderBox::hasVerticalScrollbarWithAutoBehavior):
3492         (WebCore::RenderBox::hasHorizontalScrollbarWithAutoBehavior):
3493         * rendering/RenderBox.h:
3494         (WebCore::RenderBox::scrollsOverflowX):
3495         (WebCore::RenderBox::scrollsOverflowY):
3496         (WebCore::RenderBox::hasAutoVerticalScrollbar): Deleted.
3497         (WebCore::RenderBox::hasAutoHorizontalScrollbar): Deleted.
3498
3499         Re-name overflowRequiresScrollbar() to styleRequiresScrollbar() and also re-name 
3500         overflowDefinesAutomaticScrollbar() to styleDefinesAutomaticScrollbar(), and make         
3501         these functions take into account the fact that overflow:scroll should act like 
3502         overflow:auto when the scrollbar will render as an overlay scrollbar.
3503         * rendering/RenderLayer.cpp:
3504         (WebCore::styleRequiresScrollbar):
3505         (WebCore::styleDefinesAutomaticScrollbar):
3506         (WebCore::RenderLayer::updateScrollbarsAfterLayout):
3507         (WebCore::RenderLayer::calculateClipRects):
3508
3509 2014-09-16  peavo@outlook.com  <peavo@outlook.com>
3510
3511         [Curl] Sometimes incomplete or empty content can be loaded from cache.
3512         https://bugs.webkit.org/show_bug.cgi?id=136855
3513
3514         Reviewed by Alex Christensen.
3515
3516         Sometimes, when two requests with the same url are started at the same time,
3517         there is a possibility of loading incomplete or empty content from the cache.
3518         This happens because the method CurlCacheEntry::isLoading() is returning the wrong status
3519         in the time period between the headers are received, and the content data is received.
3520         This can be fixed by using a flag for the load status, instead of checking whether
3521         the content file is open. 
3522
3523         * platform/network/curl/CurlCacheEntry.cpp:
3524         (WebCore::CurlCacheEntry::CurlCacheEntry): Initialize loading flag.
3525         (WebCore::CurlCacheEntry::isLoading): Return loading flag.
3526         (WebCore::CurlCacheEntry::didFail): Call new method to set loading flag.
3527         (WebCore::CurlCacheEntry::didFinishLoading): Ditto.
3528         (WebCore::CurlCacheEntry::setIsLoading): Added new method to set loading flag.
3529         * platform/network/curl/CurlCacheEntry.h: Added loading flag and new method to set it.
3530         * platform/network/curl/CurlCacheManager.cpp:
3531         (WebCore::CurlCacheManager::didReceiveResponse): Call new method to set loading flag.
3532
3533 2014-09-16  Chris Dumez  <cdumez@apple.com>
3534
3535         Rename Node::nodeIndex() to computeNodeIndex() for clarity
3536         https://bugs.webkit.org/show_bug.cgi?id=136826
3537
3538         Reviewed by Benjamin Poulain.
3539
3540         Rename Node::nodeIndex() to computeNodeIndex() to make it clear that
3541         index is being computed and that calling this method is potentially
3542         expensive.
3543
3544         No new tests, no behavior change.
3545
3546         * WebCore.exp.in:
3547         * WebCore.order:
3548         Rename exported symbol for Node::nodeIndex() as well.
3549
3550         * dom/Document.cpp:
3551         (WebCore::Document::caretRangeFromPoint):
3552         * dom/Node.cpp:
3553         (WebCore::Node::computeNodeIndex):
3554         (WebCore::Node::nodeIndex): Deleted.
3555         * dom/Node.h:
3556         * dom/NodeWithIndex.h:
3557         (WebCore::NodeWithIndex::index):
3558         Clean up implementation to reduce the scope of the Node variable and
3559         to follow coding style (variable naming, spacing, star placement).
3560
3561         * dom/Position.cpp:
3562         (WebCore::Position::computeOffsetInContainerNode):
3563         (WebCore::Position::previous):
3564         (WebCore::Position::next):
3565         (WebCore::Position::upstream):
3566         (WebCore::Position::downstream):
3567         * dom/Position.h:
3568         (WebCore::positionInParentBeforeNode):
3569         (WebCore::positionInParentAfterNode):
3570         * dom/Range.cpp:
3571         (WebCore::Range::compareNode):
3572         (WebCore::Range::intersectsNode):
3573         (WebCore::Range::processContents):
3574         (WebCore::Range::insertNode):
3575         (WebCore::Range::setStartAfter):
3576         (WebCore::Range::setEndBefore):
3577         (WebCore::Range::setEndAfter):
3578         (WebCore::Range::setStartBefore):
3579         * dom/RangeBoundaryPoint.h:
3580         (WebCore::RangeBoundaryPoint::ensureOffsetIsValid):
3581         * editing/ApplyStyleCommand.cpp:
3582         (WebCore::ApplyStyleCommand::mergeStartWithPreviousIfIdentical):
3583         (WebCore::ApplyStyleCommand::mergeEndWithNextIfIdentical):
3584         * editing/DeleteSelectionCommand.cpp:
3585         (WebCore::DeleteSelectionCommand::handleGeneralDelete):
3586         * editing/Editor.cpp:
3587         (WebCore::Editor::avoidIntersectionWithDeleteButtonController):
3588         * editing/FrameSelection.cpp:
3589         (WebCore::FrameSelection::selectFrameElementInParentIfFullySelected):
3590         * editing/ReplaceSelectionCommand.cpp:
3591         (WebCore::ReplaceSelectionCommand::doApply):
3592         * editing/TextIterator.cpp:
3593         (WebCore::TextIterator::range):
3594         (WebCore::SimplifiedBackwardsTextIterator::handleReplacedElement):
3595         (WebCore::SimplifiedBackwardsTextIterator::handleNonTextNode):
3596         * editing/htmlediting.cpp:
3597         (WebCore::updatePositionForNodeRemoval):
3598         * html/HTMLTextFormControlElement.cpp:
3599         (WebCore::setContainerAndOffsetForRange):
3600         * page/DOMSelection.cpp:
3601         (WebCore::DOMSelection::getRangeAt):
3602         (WebCore::DOMSelection::containsNode):
3603         (WebCore::DOMSelection::shadowAdjustedOffset):
3604         * rendering/RenderBlock.cpp:
3605         (WebCore::positionForPointRespectingEditingBoundaries):
3606         * rendering/RenderTreeAsText.cpp:
3607         (WebCore::nodePosition):
3608
3609 2014-09-16  Jer Noble  <jer.noble@apple.com>
3610
3611         Videos with controls enabled never receive 'dragstart' events.
3612         https://bugs.webkit.org/show_bug.cgi?id=136837
3613
3614         Reviewed by Eric Carlson.
3615
3616         Fixes a crash regression introduced by r173631. Node::contains() has an interesting property of returning false
3617         if `this` is NULL. Rather than depending on this behavior, explicitly NULL-check state.source and bail early.
3618
3619         * page/DragController.cpp:
3620         (WebCore::DragController::startDrag):
3621
3622 2014-09-16  Csaba Osztrogonác  <ossy@webkit.org>
3623
3624         URTBF after r173659.
3625
3626         After r173659 convertToIntLength() is used only inside ENABLE(DASHBOARD_SUPPORT), so it
3627         became unused function and caused build failure if ENABLE(DASHBOARD_SUPPORT) is false.
3628
3629         Source/WebCore/css/StyleResolver.cpp:1471:15: error: 'WebCore::Length WebCore::convertToIntLength(const WebCore::CSSPrimitiveValue*, const WebCore::CSSToLengthConversionData&)'
3630         defined but not used [-Werror=unused-function] cc1plus: all warnings being treated as errors
3631
3632         * css/StyleResolver.cpp: Missing ENABLE(DASHBOARD_SUPPORT) guard added.
3633
3634 2014-09-14  Darin Adler  <darin@apple.com>
3635
3636         Scroll snap properties don't handle inherit and initial propertly.
3637         https://bugs.webkit.org/show_bug.cgi?id=136643
3638
3639         Reviewed by Beth Dakin.
3640
3641         Restructured scroll snap code both to handle inherit and initial, and to reduce the
3642         total code size a bit, fixing a few minor bugs along the way. Updated the regression
3643         tests to cover the new parts.
3644
3645         * css/CSSComputedStyleDeclaration.cpp:
3646         (WebCore::addValuesForNamedGridLinesAtIndex): Use a modern for loop.
3647         (WebCore::scrollSnapDestination): Changed to take a LengthSize. Also streamlined.
3648         (WebCore::scrollSnapPoints): Changed to to take a ScrollSnapPoints. Also streamlined and
3649         added code to handle the "uses elements" case; serialize that as an identifier, not the
3650         string "elements", fixing a minor bug.
3651         (WebCore::scrollSnapCoordinates): Changed to take a Vector<LengthSize>. Also streamlined
3652         and added code to handle the empty vector case; serialize that as an identifier, not the
3653         string "none", fixing a minor bug.
3654         (WebCore::ComputedStyleExtractor::getFontSizeCSSValuePreferringKeyword): Use nullptr.
3655         (WebCore::counterToCSSValue): Use nullptr.
3656         (WebCore::ComputedStyleExtractor::styledNode): Use nullptr.
3657         (WebCore::ComputedStyleExtractor::propertyValue): Use nullptr. Moved CSS_SCROLL_SNAP
3658         to a more appropriate section of the switch statement. Made it just call through to
3659         the functions above in a more straightforward way.
3660         (WebCore::CSSComputedStyleDeclaration::getPropertyValue): Reversed logic to use early
3661         return and to call emptyString.
3662         (WebCore::CSSComputedStyleDeclaration::item): Use emptyString.
3663         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForSidesShorthand): Use nullptr.
3664         (WebCore::CSSComputedStyleDeclaration::parentRule): Use nullptr.
3665         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Use nullptr.
3666         (WebCore::CSSComputedStyleDeclaration::getPropertyPriority): Use emptyString.
3667         (WebCore::CSSComputedStyleDeclaration::getPropertyShorthand): Use emptyString.
3668
3669         * css/DeprecatedStyleBuilder.cpp:
3670         (WebCore::ApplyPropertyMarqueeIncrement::applyValue): Use the switch statement for the
3671         invalid value as well as for the valid values, rather than a separate if statement.
3672         Call convertToLength directly rather than through a StyleResolver static member function.
3673
3674         * css/PropertySetCSSStyleDeclaration.cpp:
3675         (WebCore::PropertySetCSSStyleDeclaration::getPropertyValue): Fixed a formatting mistake.
3676
3677         * css/StyleResolver.cpp:
3678         (WebCore::convertToIntLength): Made this function local to this file instead of a
3679         static member function.
3680         (WebCore::convertToFloatLength): Ditto.
3681         (WebCore::StyleResolver::parseSnapCoordinate): Added. Used to keep snap point parsing
3682         code small.
3683         (WebCore::StyleResolver::parseSnapCoordinatePair): Ditto.
3684         (WebCore::StyleResolver::parseSnapPoints): Added. Parses an entire snap points property.
3685         (WebCore::StyleResolver::applyProperty): Removed various bits of redundant code that
3686         were not using the primitiveValue value already in a local variable. Added the
3687         HANDLE_INHERIT_AND_INITIAL to all the scroll snap properties and updated since the
3688         RenderStyle structure now more closely matches the CSS properties.
3689
3690         * css/StyleResolver.h: Updated for above changes, and removed a redundant "private:".
3691
3692         * page/scrolling/AxisScrollSnapOffsets.cpp:
3693         (WebCore::appendChildSnapOffsets): Use auto& instead of SnapCoordinate since that type
3694         is now gone. Updated since coordinates are now LengthSize.
3695         (WebCore::updateFromStyle): Changed to take a reference instead of a pointer and
3696         also to fetch the data from RenderStyle in a new way that more closely matches the
3697         CSS properties.
3698         (WebCore::updateSnapOffsetsForScrollableArea): Ditto. Also moved some memory allocation
3699         inside if statements so we don't wastefully allocate and destroy.
3700
3701         * rendering/style/RenderStyle.cpp: Added an include of StyleScrollSnapPoints.h now
3702         that the header doesn't include them. Moved the conditional includes out of the main
3703         include paragraph (even though I don't think conditional includes are usually a good
3704         idea).
3705         (WebCore::RenderStyle::initialScrollSnapPointsX): Added.
3706         (WebCore::RenderStyle::initialScrollSnapPointsY): Added.
3707         (WebCore::RenderStyle::initialScrollSnapDestination): Added.
3708         (WebCore::RenderStyle::initialScrollSnapCoordinates): Added.
3709         (WebCore::RenderStyle::scrollSnapPointsX): Added.
3710         (WebCore::RenderStyle::scrollSnapPointsY): Added.
3711         (WebCore::RenderStyle::scrollSnapDestination): Added.
3712         (WebCore::RenderStyle::scrollSnapCoordinates): Added.
3713         (WebCore::RenderStyle::setScrollSnapPointsX): Added.
3714         (WebCore::RenderStyle::setScrollSnapPointsY): Added.
3715         (WebCore::RenderStyle::setScrollSnapDestination): Added.
3716         (WebCore::RenderStyle::setScrollSnapCoordinates): Added.
3717
3718         * rendering/style/RenderStyle.h: Replaced the include of StyleScrollSnapPoints.h with
3719         a forward declaration of ScrollSnapPoints. Removed getters and setters for the old
3720         style properties and replaced them with new ones that match the CSS properties more
3721         closely. Tweaked formatting a bit. Added initial value functions for the the scroll snap
3722         properties.
3723
3724         * rendering/style/StyleRareNonInheritedData.cpp: Added include of StyleScrollSnapPoints.h
3725         now that RenderStyle.h doesn't include it.
3726         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): Updated since
3727         m_scrollSnapType is now unsigned instead of ScrollSnapType.
3728
3729         * rendering/style/StyleRareNonInheritedData.h: Fixed type of m_scrollSnapType to be
3730         unsigned instead of ScrollSnapType. This should have been causing problems on Windows,
3731         but I think we got lucky and had no detectable problems.
3732
3733         * rendering/style/StyleScrollSnapPoints.cpp:
3734         (WebCore::ScrollSnapPoints::ScrollSnapPoints): Added.
3735         (WebCore::operator==): Added overloads for both ScrollSnapPoints and also for
3736         StyleScrollSnapPoints; using a free function for both since both have public data.
3737         (WebCore::defaultScrollSnapDestination): Added, replaces a static member function.
3738         (WebCore::StyleScrollSnapPoints::StyleScrollSnapPoints): Updated both the default
3739         constructor and the copy constructor for the new design.
3740
3741         * rendering/style/StyleScrollSnapPoints.h: Added a ScrollSnapPoints struct for the
3742         type of the snap-points-x and snap-points-y CSS properties. Changed the data members
3743         of StyleScrollSnapPoints to match the various CSS properties rather than breaking
3744         out all the data into separate data members.
3745         (WebCore::StyleScrollSnapPoints::defaultRepeatOffset): Deleted. Replaced by the
3746         default constructor for ScrollSnapPoints.
3747         (WebCore::StyleScrollSnapPoints::defaultDestinationOffset): Deleted. Replaced by
3748         a function inside the .cpp file.
3749
3750 2014-09-16  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3751
3752         [GStreamer] http/tests/media/video-auth.html is failing
3753         https://bugs.webkit.org/show_bug.cgi?id=126619
3754
3755         Reviewed by Philippe Normand.
3756
3757         Test: http/tests/media/video-auth-cors.html
3758
3759         Use stored credentials when retrieving videos following image loading behavior
3760         (i.e. stored credentials are always used except when in cors anonymous mode),
3761         except that requesting credentials from user remains disabled for cross-origin requests.
3762
3763         Patch is covered by http/tests/media/video-auth.html.
3764
3765         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
3766         (CachedResourceStreamingClient::CachedResourceStreamingClient): Enable using stored credentials except when using cors anonymous mode.
3767
3768 2014-09-16  Jinho Bang  <jinho.bang@samsung.com>
3769
3770         Add version of drawFocusIfNeeded that take a Path2D parameter.
3771         https://bugs.webkit.org/show_bug.cgi?id=136846
3772
3773         Reviewed by Dirk Schulze.
3774
3775         Tests: fast/canvas/draw-focus-if-needed-with-path.html
3776
3777         * html/canvas/CanvasRenderingContext2D.cpp:
3778         (WebCore::CanvasRenderingContext2D::drawFocusIfNeeded):
3779         (WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal):
3780         * html/canvas/CanvasRenderingContext2D.h:
3781         * html/canvas/CanvasRenderingContext2D.idl:
3782
3783 2014-09-15  Iago Toral  <itoral@igalia.com> and Zan Dobersek  <zdobersek@igalia.com>
3784
3785         [GTK] Add WaylandDisplay
3786         https://bugs.webkit.org/show_bug.cgi?id=136216
3787
3788         Reviewed by Martin Robinson.
3789
3790         Add the WaylandDisplay class. This class is used in the LayerTreeHostGtk,
3791         in the WebProcess, and controls the connection to the nested Wayland
3792         compositor in the UIProcess. Only one instance of the class is used in the
3793         WebProcess, accessible via the static WaylandDisplay::instance() method.
3794
3795         The WaylandDisplay constructor performs the EGL initialization while also
3796         querying the Wayland register, resulting in initializing client-side objects
3797         that can interact with the wl_compositor and wl_webkitgtk interfaces
3798         implemented in the nested Wayland compositor. The single class instance is
3799         only deemed properly initialized if it picked up the Wayland interface objects
3800         and has properly acquired the EGL display and config.
3801
3802         WaylandDisplay::createSurface() is called by the LayerTreeHostGtk during
3803         its own initialization. The method creates a new wl_surface object via the
3804         wl_compositor interface and a new wl_egl_window object that's based on that
3805         surface. For the wl_egl_window object, we fall back to a width or height of 1
3806         in case the passed-in value for either is 0. This avoids problems in Mesa
3807         where widths or heights of 0 are not supported.
3808
3809         We associate the created surface with the passed-in widget ID, as provided
3810         by LayerTreeHostGtk, via the wl_webkitgtk interface. This enables proper
3811         mapping of Wayland surfaces and the GtkWidgets in the UIProcess and makes
3812         it possible for the nested Wayland compositor to correctly determine which
3813         GtkWidget has to be redrawn after some surface has been committed.
3814
3815         WaylandDisplay::createSharingGLContext() creates a new GLContextEGL object
3816         that's to be used as a sharing context. The method creates a new surface
3817         via the wl_compositor interface and uses it to create a dummy native EGL
3818         window that's 1x1px in size. The GLContextEGL object is then created
3819         through the static GLContextEGL::createWindowContext() method.
3820
3821         * PlatformGTK.cmake:
3822         * platform/graphics/wayland/WaylandDisplay.cpp: Added.
3823         (WebCore::WaylandDisplay::globalCallback):
3824         (WebCore::WaylandDisplay::globalRemoveCallback):
3825         (WebCore::WaylandDisplay::instance):
3826         (WebCore::WaylandDisplay::WaylandDisplay):
3827         (WebCore::WaylandDisplay::createSurface):
3828         (WebCore::WaylandDisplay::createSharingGLContext):
3829         * platform/graphics/wayland/WaylandDisplay.h: Added.
3830         (WebCore::WaylandDisplay::nativeDisplay):
3831         (WebCore::WaylandDisplay::eglDisplay):
3832         * platform/graphics/wayland/WaylandSurface.cpp:
3833         (WebCore::WaylandSurface::~WaylandSurface): Assert that the WaylandDisplay
3834         instance is present before going on to destroy the surface resources.
3835
3836 2014-09-15  Chris Dumez  <cdumez@apple.com>
3837
3838         Rename LiveNodeLists / HTMLCollections's nodeMatches() to elementMatches()
3839         https://bugs.webkit.org/show_bug.cgi?id=136844
3840
3841         Reviewed by Sam Weinig.
3842
3843         Rename LiveNodeLists / HTMLCollections's nodeMatches() to elementMatches()
3844         for clarity as the argument is an Element.
3845
3846         No new tests, no behavior change.
3847
3848         * dom/ClassNodeList.h:
3849         (WebCore::ClassNodeList::elementMatches):
3850         (WebCore::ClassNodeList::nodeMatches): Deleted.
3851         * dom/DocumentOrderedMap.cpp:
3852         (WebCore::keyMatchesWindowNamedItem):
3853         (WebCore::keyMatchesDocumentNamedItem):
3854         * dom/Element.cpp:
3855         (WebCore::Element::updateNameForDocument):
3856         (WebCore::Element::updateIdForDocument):
3857         * dom/LiveNodeList.cpp:
3858         (WebCore::LiveNodeList::namedItem):
3859         * dom/LiveNodeList.h:
3860         (WebCore::CachedLiveNodeList<NodeListType>::collectionBegin):
3861         (WebCore::CachedLiveNodeList<NodeListType>::collectionLast):
3862         (WebCore::CachedLiveNodeList<NodeListType>::collectionTraverseForward):
3863         (WebCore::CachedLiveNodeList<NodeListType>::collectionTraverseBackward):
3864         * dom/NameNodeList.h:
3865         (WebCore::NameNodeList::elementMatches):
3866         (WebCore::NameNodeList::nodeMatches): Deleted.
3867         * dom/TagNodeList.h:
3868         (WebCore::TagNodeList::elementMatches):
3869         (WebCore::HTMLTagNodeList::elementMatches):
3870         (WebCore::TagNodeList::nodeMatches): Deleted.
3871         (WebCore::HTMLTagNodeList::nodeMatches): Deleted.
3872         * html/HTMLCollection.cpp:
3873         (WebCore::isMatchingElement):
3874         * html/HTMLNameCollection.cpp:
3875         (WebCore::WindowNameCollection::elementMatchesIfNameAttributeMatch):
3876         (WebCore::WindowNameCollection::elementMatches):
3877         (WebCore::DocumentNameCollection::elementMatchesIfIdAttributeMatch):
3878         (WebCore::DocumentNameCollection::elementMatchesIfNameAttributeMatch):
3879         (WebCore::DocumentNameCollection::elementMatches):
3880         (WebCore::WindowNameCollection::nodeMatchesIfNameAttributeMatch): Deleted.
3881         (WebCore::WindowNameCollection::nodeMatches): Deleted.
3882         (WebCore::DocumentNameCollection::nodeMatchesIfIdAttributeMatch): Deleted.
3883         (WebCore::DocumentNameCollection::nodeMatchesIfNameAttributeMatch): Deleted.
3884         (WebCore::DocumentNameCollection::nodeMatches): Deleted.
3885         * html/HTMLNameCollection.h:
3886         * html/LabelsNodeList.cpp:
3887         (WebCore::LabelsNodeList::elementMatches):
3888         (WebCore::LabelsNodeList::nodeMatches): Deleted.
3889         * html/LabelsNodeList.h:
3890         * html/RadioNodeList.cpp:
3891         (WebCore::RadioNodeList::elementMatches):
3892         (WebCore::RadioNodeList::nodeMatches): Deleted.
3893         * html/RadioNodeList.h:
3894
3895 2014-09-15  Chris Dumez  <cdumez@apple.com>
3896
3897         Use an AtomicString as key for caching ClassNodeList objects
3898         https://bugs.webkit.org/show_bug.cgi?id=136830
3899
3900         Reviewed by Benjamin Poulain.
3901
3902         Use an AtomicString as key for caching ClassNodeList objects instead of
3903         a String. ClassNodeList is the only type using a String instead of an
3904         AtomicString as key in the cache HashTable. This brings some
3905         complexity.
3906
3907         I believe this was done to avoid unnecessarily atomizing the String,
3908         for performance reasons. However, at the moment, the String gets
3909         atomized anyway when constructing the ClassNodeList object. This is
3910         because the ClassNodeList::m_classNames member is of SpaceSplitString
3911         type and the SpaceSplitString constructor takes an AtomicString in
3912         argument.
3913
3914         Using an AtomicString to cache ClassNodeLists simplifies the code quite
3915         a bit and decreases the size of NodeListsNodeData as well.
3916
3917         Test: fast/dom/getElementsByClassName/conflict-tag-name.html
3918
3919         * WebCore.order:
3920         Remove symbol corresponding to addCacheWithName() as it was removed.
3921
3922         * dom/ClassNodeList.cpp:
3923         (WebCore::ClassNodeList::~ClassNodeList):
3924         Update the constructor to take an AtomicString in argument instead of
3925         a String, for clarity. The String gets atomized when initializing
3926         m_classNames anyway.
3927
3928         (WebCore::ClassNodeList::ClassNodeList):
3929         Call removeCacheWithAtomicName() instead of removeCacheWithName() now
3930         that m_originalClassNames is an AtomicString.
3931
3932         * dom/ClassNodeList.h:
3933         Use AtomicString instead of String type for classNames, in both the
3934         constructor argument and the m_originalClassNames data member.
3935
3936         * dom/ContainerNode.cpp:
3937         (WebCore::ContainerNode::getElementsByClassName):
3938         Call addCacheWithAtomicName() instead of addCacheWithName() now that
3939         addCacheWithName() has been removed.
3940
3941         * dom/Node.cpp:
3942         (WebCore::NodeListsNodeData::invalidateCaches):
3943         Stop invalidating m_nameCaches as this HashMap no longer exists.
3944
3945         * dom/NodeRareData.h:
3946         (WebCore::NodeListsNodeData::NodeListCacheMapEntryHash::hash):
3947         (WebCore::NodeListsNodeData::NodeListCacheMapEntryHash::equal):
3948         (WebCore::NodeListsNodeData::isEmpty):
3949         (WebCore::NodeListsNodeData::adoptDocument):
3950         (WebCore::NodeListsNodeData::namedNodeListKey):
3951         (WebCore::NodeListsNodeData::deleteThisAndUpdateNodeRareDataIfAboutToRemoveLastList):
3952         (WebCore::NodeListsNodeData::addCacheWithName): Deleted.
3953         (WebCore::NodeListsNodeData::removeCacheWithName): Deleted.
3954         - Drop addCacheWithName() / removeCacheWithName() now that no NodeList
3955           uses a String as HashMap key.
3956         - Drop m_nameCaches now that ClassNodeLists are cached in
3957           m_atomicNameCaches instead.
3958         - Remove StringType template parameter and hardcode AtomicString
3959           instead.
3960
3961 2014-09-15  Chris Dumez  <cdumez@apple.com>
3962
3963         Return early in SelectorChecker::checkOne() if selector.isAttributeSelector() is true
3964         https://bugs.webkit.org/show_bug.cgi?id=136838
3965
3966         Reviewed by Benjamin Poulain.
3967
3968         Return early in SelectorChecker::checkOne() if selector.isAttributeSelector()
3969         is true and the selector matched. Previously, we were only returning early if
3970         the selector did not match and we were falling through if it did. This means
3971         that we ended up doing the 2 if() checks below in the method unnecessarily:
3972         - selector.m_match == CSSSelector::PseudoClass
3973         - selector.m_match == CSSSelector::PseudoElement
3974
3975         No new tests, no behavior change.
3976
3977         * css/SelectorChecker.cpp:
3978         (WebCore::SelectorChecker::checkOne):
3979
3980 2014-09-15  Chris Dumez  <cdumez@apple.com>
3981
3982         Un-inline the Node constructor
3983         https://bugs.webkit.org/show_bug.cgi?id=136842
3984
3985         Reviewed by Benjamin Poulain.
3986
3987         Un-inline the Node constructor as it does not seem to impact
3988         performance, based on my testing:
3989      &nb