Web Replay: Playback position updates should be sent before the next event loop input...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2014-09-27  Brian J. Burg  <burg@cs.washington.edu>
2
3         Web Replay: Playback position updates should be sent before the next event loop input is dispatched
4         https://bugs.webkit.org/show_bug.cgi?id=137162
5
6         Reviewed by Timothy Hatcher.
7
8         To drive playback position updates in the Inspector UI, we send playbackHitPosition protocol
9         messages as the replay backend dispatches inputs. However, right now the semantics of that
10         message are muddy. The update is sent *after* the input at the offset is dispatched. This leads
11         to unexpected results if the debugger pauses while the input is being dispatched: the frontend
12         will only know about the previous (stale) playback position when the debugger pauses.
13
14         With this patch, the backend sends the playbackHitPosition(segmentOffset=n, inputOffset=m)
15         message when backend is about to dispatch input m, but has not yet begun to do so. Thus, any
16         subsequent page execution events (profiling, debugger pauses, etc) until the next
17         playbackHitPosition are caused by input m's being dispatched.
18
19         * inspector/protocol/Replay.json: Clarify the message's semantics.
20         * replay/ReplayController.cpp:
21         (WebCore::ReplayController::willDispatchInput):
22         (WebCore::ReplayController::didDispatchInput):
23
24 2014-09-27  Benjamin Poulain  <bpoulain@apple.com>
25
26         Chaining multiple :nth-child() does not work properly
27         https://bugs.webkit.org/show_bug.cgi?id=137032
28
29         Reviewed by Gavin Barraclough.
30
31         When multiple :nth-child() are chained, the evaluation of each "An+B" could depend on
32         the execution of the previous "An+B". The reason is that the register holding the position
33         of the current element could be modified by the evaluation of "An+B".
34
35         There are two cases in which the register was used as the destination of an operation:
36         1) When A and B are positive, the counter would be the destination of "counter - B".
37         2) When A is not 1 or 2, the modulo operation was not preserving the input register.
38
39         For (1), we a copy of the counter in that case of generateElementIsNthChild().
40
41         For (2), we also preserve a copy of the input if it is used by the operation. In this case,
42         if the input register is one of the argument we need for idiv, we preserve it on the stack
43         or in a register depending on what is available.
44
45         This increases the register requirements by 2 in the worst case on x86. The extra registers
46         can push generateElementIsNthChild() above the 4 available registers. To accomodate for that,
47         minimumRegisterRequirements() reserve more registers on x86.
48
49         The extra register pressure has strictly no effect on performance, x86_64 has 9 registers
50         available without pushing anything. The extra allocation is only necessary for debugging.
51
52         Tests: fast/selectors/nth-child-basics.html
53                fast/selectors/nth-child-chained.html
54                fast/selectors/nth-child-of-basics-2.html
55                fast/selectors/nth-child-of-chained.html
56
57         * cssjit/SelectorCompiler.cpp:
58         (WebCore::SelectorCompiler::minimumRegisterRequirements):
59         (WebCore::SelectorCompiler::SelectorCodeGenerator::modulo):
60         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChild):
61
62 2014-09-26  Christophe Dumez  <cdumez@apple.com>
63
64         Stop using legacy NODE_TYPE_CASTS() macro for HTML Elements
65         https://bugs.webkit.org/show_bug.cgi?id=137137
66
67         Reviewed by Benjamin Poulain.
68
69         Stop using legacy NODE_TYPE_CASTS() macro for HTML Elements and use the
70         new SPECIALIZE_TYPE_TRAITS_*() macro instead so that is<>() /
71         downcast<>() works for those types.
72
73         No new tests, no behavior change.
74
75         * accessibility/AccessibilityNodeObject.cpp:
76         (WebCore::AccessibilityNodeObject::labelForElement):
77         (WebCore::AccessibilityNodeObject::text):
78         * accessibility/AccessibilityTable.cpp:
79         (WebCore::AccessibilityTable::isDataTable):
80         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
81         (webkitAccessibleGetName):
82         (webkitAccessibleGetDescription):
83         * bindings/gobject/WebKitDOMPrivate.cpp:
84         (WebKit::wrap):
85         * bindings/js/JSElementCustom.cpp:
86         (WebCore::toJSNewlyCreated):
87         * bindings/js/JSNodeCustom.cpp:
88         (WebCore::createWrapperInline):
89         * bindings/js/JSPluginElementFunctions.cpp:
90         (WebCore::pluginInstance):
91         (WebCore::pluginScriptObjectFromPluginViewBase):
92         (WebCore::pluginScriptObject):
93         (WebCore::pluginElementCustomPut):
94         (WebCore::isPluginElement): Deleted.
95         * bindings/objc/DOM.mm:
96         (kitClass):
97         * css/ElementRuleCollector.cpp:
98         (WebCore::ElementRuleCollector::matchAllRules):
99         * css/SelectorChecker.cpp:
100         (WebCore::SelectorChecker::checkOne):
101         * css/StyleResolver.cpp:
102         (WebCore::StyleResolver::locateCousinList):
103         (WebCore::elementHasDirectionAuto):
104         * cssjit/SelectorCompiler.cpp:
105         (WebCore::SelectorCompiler::makeContextStyleUniqueIfNecessaryAndTestIsPlaceholderShown):
106         (WebCore::SelectorCompiler::makeElementStyleUniqueIfNecessaryAndTestIsPlaceholderShown):
107         (WebCore::SelectorCompiler::isPlaceholderShown):
108         * dom/ContainerNodeAlgorithms.cpp:
109         (WebCore::assertConnectedSubrameCountIsConsistent):
110         (WebCore::collectFrameOwners):
111         (WebCore::disconnectSubframes):
112         * dom/Document.cpp:
113         (WebCore::Document::adoptNode):
114         (WebCore::Document::setBody):
115         (WebCore::Document::iconURLs):
116         (WebCore::Document::dispatchFullScreenChangeOrErrorEvent):
117         (WebCore::Document::updateHoverActiveState):
118         * dom/DocumentStyleSheetCollection.cpp:
119         (WebCore::DocumentStyleSheetCollection::collectActiveStyleSheets):
120         * dom/Range.cpp:
121         (WebCore::Range::createContextualFragment):
122         * dom/make_names.pl:
123         (printTypeHelpers):
124         * editing/ApplyStyleCommand.cpp:
125         (WebCore::isLegacyAppleStyleSpan):
126         (WebCore::isStyleSpanOrSpanWithOnlyStyleAttribute):
127         (WebCore::isSpanWithoutAttributesOrUnstyledStyleSpan):
128         (WebCore::isEmptyFontTag):
129         (WebCore::ApplyStyleCommand::applyBlockStyle):
130         (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
131         (WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
132         (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
133         (WebCore::ApplyStyleCommand::removeConflictingInlineStyleFromRun):
134         (WebCore::ApplyStyleCommand::highestAncestorWithConflictingInlineStyle):
135         (WebCore::ApplyStyleCommand::applyInlineStyleToPushDown):
136         (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
137         (WebCore::ApplyStyleCommand::removeInlineStyle):
138         (WebCore::ApplyStyleCommand::shouldSplitTextElement):
139         (WebCore::ApplyStyleCommand::applyInlineStyleChange):
140         * editing/DeleteButtonController.cpp:
141         (WebCore::enclosingDeletableElement):
142         * editing/Editor.cpp:
143         (WebCore::Editor::selectionForCommand):
144         (WebCore::Editor::setBaseWritingDirection):
145         (WebCore::findFirstMarkable):
146         * editing/FrameSelection.cpp:
147         (WebCore::FrameSelection::selectAll):
148         (WebCore::scanForForm):
149         * editing/InsertListCommand.cpp:
150         (WebCore::InsertListCommand::mergeWithNeighboringLists):
151         * editing/MarkupAccumulator.cpp:
152         (WebCore::MarkupAccumulator::elementCannotHaveEndTag):
153         * editing/ReplaceSelectionCommand.cpp:
154         (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
155         (WebCore::ReplaceSelectionCommand::makeInsertedContentRoundTrippableWithHTMLTreeBuilder):
156         (WebCore::ReplaceSelectionCommand::handleStyleSpans):
157         (WebCore::ReplaceSelectionCommand::doApply):
158         (WebCore::ReplaceSelectionCommand::insertAsListItems):
159         * editing/TextIterator.cpp:
160         (WebCore::shouldEmitNewlinesBeforeAndAfterNode):
161         (WebCore::shouldEmitExtraNewlineForNode):
162         * editing/cocoa/HTMLConverter.mm:
163         (HTMLConverter::_addTableCellForElement):
164         (HTMLConverter::_processElement):
165         * editing/htmlediting.cpp:
166         (WebCore::enclosingList):
167         (WebCore::embeddedSublist):
168         (WebCore::appendedSublist):
169         * editing/ios/EditorIOS.mm:
170         (WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection):
171         * editing/mac/EditorMac.mm:
172         (WebCore::maybeCopyNodeAttributesToFragment):
173         * editing/markup.cpp:
174         (WebCore::StyledMarkupAccumulator::appendElement):
175         * html/BaseChooserOnlyDateAndTimeInputType.cpp:
176         (WebCore::BaseChooserOnlyDateAndTimeInputType::updateAppearance):
177         * html/ColorInputType.cpp:
178         (WebCore::ColorInputType::shadowColorSwatch):
179         * html/HTMLBodyElement.cpp:
180         (WebCore::HTMLBodyElement::insertedInto):
181         * html/HTMLCollection.cpp:
182         (WebCore::HTMLCollection::namedItem):
183         (WebCore::HTMLCollection::updateNamedElementCache):
184         * html/HTMLElement.cpp:
185         (WebCore::HTMLElement::matchesReadWritePseudoClass):
186         (WebCore::HTMLElement::setOuterHTML):
187         (WebCore::elementAffectsDirectionality):
188         (WebCore::HTMLElement::directionality):
189         (WebCore::HTMLElement::dirAttributeChanged):
190         * html/HTMLElement.h:
191         (WebCore::isHTMLElement):
192         (WebCore::Node::hasTagName):
193         * html/HTMLFormElement.cpp:
194         (WebCore::HTMLFormElement::getNamedElements):
195         * html/HTMLFrameElementBase.h:
196         (WebCore::isHTMLFrameElementBase):
197         * html/HTMLFrameOwnerElement.h:
198         (WebCore::isHTMLFrameOwnerElement):
199         * html/HTMLMediaElement.h:
200         (WebCore::isHTMLMediaElement):
201         * html/HTMLOptionElement.cpp:
202         (WebCore::HTMLOptionElement::isDisabledFormControl):
203         * html/HTMLPlugInElement.h:
204         (WebCore::isHTMLPlugInElement):
205         * html/HTMLPlugInImageElement.cpp:
206         (WebCore::addPlugInsFromNodeListMatchingPlugInOrigin):
207         * html/HTMLPlugInImageElement.h:
208         (WebCore::isHTMLPlugInImageElement):
209         * html/HTMLSelectElement.cpp:
210         (WebCore::HTMLSelectElement::setOption):
211         (WebCore::HTMLSelectElement::setLength):
212         (WebCore::HTMLSelectElement::recalcListItems):
213         * html/HTMLSourceElement.cpp:
214         (WebCore::HTMLSourceElement::insertedInto):
215         (WebCore::HTMLSourceElement::removedFrom):
216         * html/HTMLTableCellElement.cpp:
217         (WebCore::HTMLTableCellElement::cellAbove):
218         * html/HTMLTableCellElement.h:
219         (WebCore::isHTMLTableCellElement):
220         * html/HTMLTableElement.cpp:
221         (WebCore::HTMLTableElement::tHead):
222         (WebCore::HTMLTableElement::tFoot):
223         (WebCore::HTMLTableElement::lastBody):
224         * html/HTMLTableRowElement.cpp:
225         (WebCore::HTMLTableRowElement::rowIndex):
226         * html/HTMLTableRowsCollection.cpp:
227         (WebCore::isInSection):
228         * html/HTMLTableSectionElement.h:
229         (WebCore::isHTMLTableSectionElement):
230         * html/HTMLTagNames.in:
231         * html/HTMLTextFormControlElement.cpp:
232         (WebCore::enclosingTextFormControl):
233         * html/HTMLTextFormControlElement.h:
234         (WebCore::isHTMLTextFormControlElement):
235         * html/HTMLTrackElement.cpp:
236         (WebCore::HTMLTrackElement::removedFrom):
237         (WebCore::HTMLTrackElement::mediaElement):
238         * html/LabelableElement.h:
239         (WebCore::isLabelableElement):
240         * html/RangeInputType.cpp:
241         (WebCore::RangeInputType::sliderTrackElement):
242         * html/shadow/MediaControlElementTypes.cpp:
243         (WebCore::parentMediaElement):
244         (WebCore::mediaControlElementType):
245         * html/shadow/TextControlInnerElements.h:
246         (WebCore::isTextControlInnerTextElement):
247         * inspector/InspectorDOMAgent.cpp:
248         (WebCore::InspectorDOMAgent::buildObjectForNode):
249         * inspector/InspectorNodeFinder.cpp:
250         (WebCore::InspectorNodeFinder::searchUsingDOMTreeTraversal):
251         * loader/SubframeLoader.cpp:
252         (WebCore::SubframeLoader::loadSubframe):
253         * loader/archive/cf/LegacyWebArchive.cpp:
254         (WebCore::LegacyWebArchive::create):
255         * mathml/MathMLElement.cpp:
256         (WebCore::MathMLElement::isPhrasingContent):
257         (WebCore::MathMLElement::isFlowContent):
258         (WebCore::MathMLElement::childShouldCreateRenderer):
259         * mathml/mathtags.in:
260         * page/DragController.cpp:
261         (WebCore::DragController::canProcessDrag):
262         * page/EventHandler.cpp:
263         (WebCore::targetIsFrame):
264         * page/FocusController.cpp:
265         (WebCore::hasCustomFocusLogic):
266         (WebCore::FocusController::findFocusableElementDescendingDownIntoFrameDocument):
267         (WebCore::FocusController::advanceFocusInDocumentOrder):
268         * page/Frame.cpp:
269         (WebCore::Frame::searchForLabelsBeforeElement):
270         * page/FrameView.cpp:
271         (WebCore::FrameView::init):
272         (WebCore::FrameView::addEmbeddedObjectToUpdate):
273         (WebCore::FrameView::updateEmbeddedObject):
274         * page/PageSerializer.cpp:
275         (WebCore::isCharsetSpecifyingNode):
276         (WebCore::SerializerMarkupAccumulator::appendCustomAttributes):
277         * page/SpatialNavigation.cpp:
278         (WebCore::frameOwnerElement):
279         * rendering/HitTestResult.cpp:
280         (WebCore::HitTestResult::absolutePDFURL):
281         (WebCore::HitTestResult::mediaElement):
282         * rendering/RenderBlockFlow.cpp:
283         (WebCore::resizeTextPermitted):
284         * rendering/RenderEmbeddedObject.cpp:
285         (WebCore::RenderEmbeddedObject::paintContents):
286         (WebCore::RenderEmbeddedObject::layout):
287         (WebCore::RenderEmbeddedObject::handleUnavailablePluginIndicatorEvent):
288         * rendering/RenderLayer.cpp:
289         (WebCore::RenderLayer::scrollRectToVisible):
290         (WebCore::RenderLayer::updateSnapOffsets):
291         * rendering/RenderLayerBacking.cpp:
292         (WebCore::RenderLayerBacking::updateConfiguration):
293         (WebCore::isRestartedPlugin):
294         * rendering/RenderMedia.h:
295         (WebCore::RenderMedia::mediaElement):
296         * rendering/RenderObject.cpp:
297         (WebCore::RenderObject::offsetParent):
298         * rendering/RenderSnapshottedPlugIn.cpp:
299         (WebCore::RenderSnapshottedPlugIn::plugInImageElement):
300         * rendering/RenderTableCell.cpp:
301         (WebCore::RenderTableCell::parseColSpanFromDOM):
302         (WebCore::RenderTableCell::parseRowSpanFromDOM):
303         * rendering/RenderTextControl.cpp:
304         (WebCore::RenderTextControl::textFormControlElement):
305         * rendering/RenderThemeGtk.cpp:
306         (WebCore::getMediaElementFromRenderObject):
307         * rendering/RenderThemeMac.mm:
308         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
309         (WebCore::RenderThemeMac::paintSnapshottedPluginOverlay):
310         * rendering/RenderTreeAsText.cpp:
311         (WebCore::isEmptyOrUnstyledAppleStyleSpan):
312         * rendering/RenderWidget.h:
313         (WebCore::RenderWidget::frameOwnerElement):
314         * testing/Internals.cpp:
315         (WebCore::Internals::visiblePlaceholder):
316         (WebCore::Internals::simulateAudioInterruption):
317         (WebCore::Internals::isPluginSnapshotted):
318         * xml/XPathStep.cpp:
319         (WebCore::XPath::nodeMatchesBasicTest):
320
321 2014-09-26  Joseph Pecoraro  <pecoraro@apple.com>
322
323         Web Inspector: Automatic Inspection should continue once all breakpoints are loaded
324         https://bugs.webkit.org/show_bug.cgi?id=137038
325
326         Reviewed by Timothy Hatcher.
327
328         Handle frontend initialization messages even though pages cannot
329         be automatically inspected yet.
330
331         * inspector/InspectorController.cpp:
332         (WebCore::InspectorController::InspectorController):
333         (WebCore::InspectorController::connectFrontend):
334         (WebCore::InspectorController::disconnectFrontend):
335         (WebCore::InspectorController::frontendInitialized):
336         * inspector/InspectorController.h:
337         * inspector/WorkerInspectorController.h:
338         * page/Page.h:
339         (WebCore::Page::inspectorDebuggable):
340
341 2014-09-26  David Kilzer  <ddkilzer@apple.com>
342
343         REGRESSION (r173988): Fix unused variable warning in PDFDocumentImage.cpp
344
345         Fixes the following build failure in release builds:
346
347             WebCore/platform/graphics/cg/PDFDocumentImage.cpp:230:12: error: unused variable 'pageCount' [-Werror,-Wunused-variable]
348
349         * platform/graphics/cg/PDFDocumentImage.cpp:
350         (WebCore::PDFDocumentImage::computeBoundsForCurrentPage): Change
351         ASSERT() to call pageCount().
352
353 2014-09-26  Brian J. Burg  <burg@cs.washington.edu>
354
355         StorageTracker::deleteOrigin being called off the main thread (ASSERTs in inspector/test-harness-trivially-works.html test)
356         https://bugs.webkit.org/show_bug.cgi?id=129642
357
358         Apply post-review comments from Alexey Proskuryakov.
359
360         * storage/StorageAreaSync.cpp:
361         (WebCore::StorageAreaSync::deleteEmptyDatabase): Make a thread-safe isolated copy of the string.
362
363 2014-09-26  Myles C. Maxfield  <mmaxfield@apple.com>
364
365         SVG -> OTF converter bug gardening
366         https://bugs.webkit.org/show_bug.cgi?id=137088
367
368         Reviewed by Darin Adler.
369
370         This test fixes some (but not all) of the svg/ layout tests that never worked with the
371         SVG -> OTF font converter. The actual list of tests this fixes is shown below. I will be
372         filing bugs for the remaining issues along with the relevant tests that those issues
373         cause to fail.
374
375         Tests: svg/W3C-SVG-1.1/fonts-elem-05-t.svg
376                svg/W3C-SVG-1.1/fonts-kern-01-t.svg
377                svg/custom/glyph-setting-d-attribute.svg
378                svg/custom/scrolling-embedded-svg-file-image-repaint-problem.html
379                svg/custom/skip-underline-missing-glyph.html
380                svg/custom/svg-fonts-fallback.xhtml
381                svg/custom/svg-fonts-in-text-controls.html
382
383         * svg/SVGToOTFFontConversion.cpp:
384         (WebCore::SVGToOTFFontConverter::appendHEADTable): We use the font's minimum and maximum
385         bounding box information to size <textarea>s and <input>s.
386         (WebCore::SVGToOTFFontConverter::addCodepointRanges): Codepoint ranges are closed.
387         (WebCore::SVGToOTFFontConverter::computeKerningData): Typo in appending glyphs to the
388         wrong set.
389         (WebCore::SVGToOTFFontConverter::transcodeGlyphPaths): Use the font's horizontal
390         origin if the glyph doesn't have one.
391         (WebCore::SVGToOTFFontConverter::convertSVGToOTFFont): r173852 implemented vhea, vmtx,
392         and kern.
393         (WebCore::transcodeGlyphPaths): Moved inside SVGToOTFFontConverter.
394
395 2014-09-26  Dan Bernstein  <mitz@apple.com>
396
397         iOS build fix following r173989.
398
399         * page/ios/FrameIOS.mm:
400         (WebCore::ancestorRespondingToClickEvents):
401
402 2014-09-26  Javier Fernandez  <jfernandez@igalia.com>
403
404         [CSS Grid Layout] Empty string case already covered by containesOnlyWhiteSpace.
405         https://bugs.webkit.org/show_bug.cgi?id=137146
406
407         Reviewed by Sergio Villar Senin.
408
409         When checking out for white-space only strings in the grid-template-areas
410         property values, it's not neccessary to check out for empty strings as
411         such case is already covered.
412
413         No new tests, already covered by fast/css-grid-layout/grid-template-areas-empty-string-crash.html.
414
415         * css/CSSParser.cpp:
416         (WebCore::CSSParser::parseGridTemplateAreasRow):
417
418 2014-09-23  Sergio Villar Senin  <svillar@igalia.com>
419
420         [CSS Grid Layout] Fix the handling of infinity in track growth limits
421         https://bugs.webkit.org/show_bug.cgi?id=137019
422
423         Reviewed by Darin Adler.
424
425         The growth limit of content sized tracks is initialized to
426         infinity which is internally represented as -1. We were not
427         specialcasing this situation, and thus, -1 was used in the
428         computations as any other value. This change makes the code aware
429         of the existence of infinites (like when sorting tracks by growth
430         potential or when initializing the track growth limits).
431
432         There was another bug related to infinities. The code that was
433         replacing a infinite growth limit by a finite one was not using
434         the proper indexes so the tracks that were being updated were the
435         wrong ones.
436
437         Test: fast/css-grid-layout/grid-content-sized-columns-resolution.html
438
439         * rendering/RenderGrid.cpp:
440         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
441         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
442         (WebCore::sortByGridTrackGrowthPotential):
443         (WebCore::RenderGrid::distributeSpaceToTracks):
444
445 2014-09-26  Lorenzo Tilve  <ltilve@igalia.com>
446
447         [GTK] Fix support for the initial-letter CSS property to first-letter
448         https://bugs.webkit.org/show_bug.cgi?id=137108
449
450         Reviewed by Alejandro G. Castro.
451
452         Add support for cap-height to the font system.
453
454         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
455         (WebCore::SimpleFontData::platformInit):
456
457 2014-09-25  Brian J. Burg  <burg@cs.washington.edu>
458
459         Web Inspector: FunctionCall timeline records omit profile data if the debugger has paused
460         https://bugs.webkit.org/show_bug.cgi?id=136805
461
462         Reviewed by Timothy Hatcher.
463
464         TimelineAgent was mismanaging its call stack depth counter, which caused nested FunctionCall
465         records to steal the parent FunctionCall's captured profile in the child's didCallFunction().
466         Thus, the top FunctionCall node had no profile data and nested FunctionCall nodes each had
467         their own profiles. The frontend expected just one profile, so it didn't show anything when
468         it couldn't be found.
469
470         Test: inspector/timeline/debugger-paused-while-recording.html
471
472         * inspector/InspectorTimelineAgent.cpp: Rename m_recordingProfileDepth to m_callStackDepth.
473         (WebCore::InspectorTimelineAgent::willCallFunction): Fix the call stack depth management.
474         (WebCore::InspectorTimelineAgent::didCallFunction):
475         (WebCore::InspectorTimelineAgent::willEvaluateScript):
476         (WebCore::InspectorTimelineAgent::didEvaluateScript):
477         (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
478         * inspector/InspectorTimelineAgent.h:
479
480 2014-09-25  Brian J. Burg  <burg@cs.washington.edu>
481
482         StorageTracker::deleteOrigin being called off the main thread (ASSERTs in inspector/test-harness-trivially-works.html test)
483         https://bugs.webkit.org/show_bug.cgi?id=129642
484
485         Reviewed by Brady Eidson.
486
487         When tearing down the inspector frontend's page, we trigger a threading violation
488         in StorageAreaSync's final sync code underneath StorageAreaSync::deleteEmptyDatabase().
489
490         No new tests. Regression is covered by inspector/test-harness-trivially-works.html.
491
492         * storage/StorageAreaSync.cpp:
493         (WebCore::StorageAreaSync::deleteEmptyDatabase): add a missing callOnMainThread() when
494         calling StorageTracker::deleteOriginWithIdentifier().
495
496 2014-09-25  Sungmann Cho  <sungmann.cho@navercorp.com>
497
498         Unprefix CSS cursor values zoom-in and zoom-out.
499         https://bugs.webkit.org/show_bug.cgi?id=137061
500
501         Reviewed by Benjamin Poulain.
502
503         This patch unprefixes CSS cursor values zoom-in and zoom-out.
504         -webkit-zoom-in and -webkit-zoom-out are kept as aliases.
505         ECursor members use InterCaps with an initial capital letter for now.
506
507         * css/CSSParser.cpp:
508         (WebCore::CSSParser::parseValue):
509         * css/CSSPrimitiveValueMappings.h:
510         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
511         (WebCore::CSSPrimitiveValue::operator ECursor):
512         * css/CSSValueKeywords.in:
513         * css/DeprecatedStyleBuilder.cpp:
514         (WebCore::ApplyPropertyCursor::applyValue):
515         * html/ImageDocument.cpp:
516         (WebCore::ImageDocument::resizeImageToFit):
517         (WebCore::ImageDocument::restoreImageSize):
518         (WebCore::ImageDocument::windowSizeChanged):
519         * page/EventHandler.cpp:
520         (WebCore::EventHandler::selectCursor):
521         * rendering/style/RenderStyle.h:
522         * rendering/style/RenderStyleConstants.h:
523
524 2014-09-25  Brent Fulgham  <bfulgham@apple.com>
525
526         [Win] Debug builds of TestWebKitAPI are crashing.
527         https://bugs.webkit.org/show_bug.cgi?id=133553
528
529         Reviewed by Dean Jackson.
530
531         Avoid crash on shutdown due to invalid mutex state in the
532         HashMap debug implementation during a static destruction operation.
533
534         * dom/Node.cpp:
535         (WebCore::ignoreSet): Convert static value into a NeverDestroyed.
536         (WebCore::Node::trackForDebugging): Use new NeverDestroyed call.
537         (WebCore::Node::~Node): Ditto.
538
539 2014-09-25  Christophe Dumez  <cdumez@apple.com>
540
541         Add support for is<SVGDocument>() / downcast<SVGDocument>()
542         https://bugs.webkit.org/show_bug.cgi?id=137128
543
544         Reviewed by Ryosuke Niwa.
545
546         Add support for is<SVGDocument>() / downcast<SVGDocument>() by using
547         the SPECIALIZE_TYPE_TRAITS_*() macro, instead of the
548         DOCUMENT_TYPE_CASTS() one.
549
550         No new tests, no behavior change.
551
552         * accessibility/AccessibilityRenderObject.cpp:
553         (WebCore::AccessibilityRenderObject::remoteSVGRootElement):
554         * html/HTMLFrameOwnerElement.cpp:
555         (WebCore::HTMLFrameOwnerElement::getSVGDocument):
556         * page/EventHandler.cpp:
557         (WebCore::EventHandler::handleMousePressEvent):
558         (WebCore::EventHandler::handleMouseMoveEvent):
559         (WebCore::EventHandler::handleMouseReleaseEvent):
560         * page/Frame.cpp:
561         (WebCore::Frame::setPageAndTextZoomFactors):
562         * page/FrameView.cpp:
563         (WebCore::FrameView::scrollToAnchor):
564         * svg/SVGDocument.h:
565         (WebCore::isSVGDocument):
566         * svg/graphics/SVGImage.cpp:
567         (WebCore::SVGImage::hasSingleSecurityOrigin):
568         (WebCore::SVGImage::setContainerSize):
569         (WebCore::SVGImage::containerSize):
570         (WebCore::SVGImage::embeddedContentBox):
571         (WebCore::SVGImage::hasRelativeWidth):
572         (WebCore::SVGImage::hasRelativeHeight):
573         (WebCore::SVGImage::computeIntrinsicDimensions):
574         (WebCore::SVGImage::startAnimation):
575         (WebCore::SVGImage::stopAnimation):
576
577 2014-09-25  Said Abou-Hallawa  <sabouhallawa@apple.com>
578
579         Rename CSSKeyframesRule insertRule to appendRule (57910)
580         https://bugs.webkit.org/show_bug.cgi?id=57910
581
582         Reviewed by Dean Jackson.
583
584         Tests: animations/change-keyframes.html
585
586         * css/WebKitCSSKeyframesRule.h:
587         (WebCore::WebKitCSSKeyframesRule::appendRule):
588         -- Make WebKitCSSKeyframesRule::appendRule to be an alias of WebKitCSSKeyframesRule::insertRule()
589            to conform with CSS specs
590         * css/WebKitCSSKeyframesRule.idl:
591         -- Add the new method WebKitCSSKeyframesRule::appendRule() but keep the original method
592            WebKitCSSKeyframesRule::appendRule() to not break exiting customers' pages.
593
594 2014-09-25  Tim Horton  <timothy_horton@apple.com>
595
596         Null deref in setStateScrollingNodeSnapOffsetsAsFloat
597         https://bugs.webkit.org/show_bug.cgi?id=137133
598         <rdar://problem/18447820>
599
600         Reviewed by Beth Dakin.
601
602         * page/scrolling/AsyncScrollingCoordinator.cpp:
603         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
604         (WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode):
605         Get the deviceScaleFactor from m_page instead of various other places,
606         because scrolledContentsLayer can be null in the case of non-composited
607         overflow scroll.
608
609 2014-09-25  Christophe Dumez  <cdumez@apple.com>
610
611         Use is<HTML*Element>() instead of isHTML*Element() - Part 2
612         https://bugs.webkit.org/show_bug.cgi?id=137103
613
614         Reviewed by Benjamin Poulain.
615
616         Use is<HTML*Element>() instead of isHTML*Element() and drop support for
617         the generated isHTML*Element() macros.
618
619         No new tests, no behavior change.
620
621         * accessibility/AXObjectCache.cpp:
622         (WebCore::AXObjectCache::focusedUIElementForPage):
623         (WebCore::AXObjectCache::getOrCreate):
624         (WebCore::AXObjectCache::handleAttributeChanged):
625         (WebCore::AXObjectCache::labelChanged):
626         * accessibility/AccessibilityListBoxOption.cpp:
627         (WebCore::AccessibilityListBoxOption::isEnabled):
628         (WebCore::AccessibilityListBoxOption::stringValue):
629         (WebCore::AccessibilityListBoxOption::listBoxOptionParentNode):
630         * accessibility/AccessibilityNodeObject.cpp:
631         (WebCore::AccessibilityNodeObject::determineAccessibilityRole):
632         (WebCore::AccessibilityNodeObject::isNativeImage):
633         (WebCore::AccessibilityNodeObject::anchorElement):
634         (WebCore::AccessibilityNodeObject::alternativeText):
635         * accessibility/AccessibilityRenderObject.cpp:
636         (WebCore::AccessibilityRenderObject::anchorElement):
637         (WebCore::AccessibilityRenderObject::labelElementContainer):
638         (WebCore::AccessibilityRenderObject::internalLinkElement):
639         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
640         (WebCore::AccessibilityRenderObject::url):
641         (WebCore::AccessibilityRenderObject::getDocumentLinks):
642         (WebCore::AccessibilityRenderObject::accessibilityImageMapHitTest):
643         (WebCore::AccessibilityRenderObject::accessibilityHitTest):
644         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
645         (WebCore::AccessibilityRenderObject::stringValueForMSAA):
646         (WebCore::AccessibilityRenderObject::isLinked):
647         * accessibility/AccessibilityTable.cpp:
648         (WebCore::AccessibilityTable::tableElement):
649         (WebCore::AccessibilityTable::isTableExposableThroughAccessibility):
650         (WebCore::AccessibilityTable::title):
651         * accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
652         (webkitAccessibleTableGetCaption):
653         * bindings/js/JSHTMLDocumentCustom.cpp:
654         (WebCore::JSHTMLDocument::nameGetter):
655         * bindings/js/JSNodeCustom.cpp:
656         (WebCore::isReachableFromDOM):
657         * css/CSSDefaultStyleSheets.cpp:
658         (WebCore::elementCanUseSimpleDefaultStyle):
659         (WebCore::CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement):
660         * css/CSSStyleSheet.cpp:
661         (WebCore::isAcceptableCSSStyleSheetParent):
662         * css/StyleResolver.cpp:
663         (WebCore::StyleResolver::adjustRenderStyle):
664         * css/StyleSheetList.cpp:
665         (WebCore::StyleSheetList::getNamedItem):
666         * dom/CurrentScriptIncrementer.h:
667         (WebCore::CurrentScriptIncrementer::CurrentScriptIncrementer):
668         * dom/DataTransfer.cpp:
669         (WebCore::DataTransfer::setDragImage):
670         * dom/DocumentOrderedMap.cpp:
671         (WebCore::keyMatchesMapName):
672         (WebCore::keyMatchesLowercasedMapName):
673         (WebCore::keyMatchesLowercasedUsemap):
674         (WebCore::keyMatchesLabelForAttribute):
675         * dom/DocumentStyleSheetCollection.cpp:
676         (WebCore::DocumentStyleSheetCollection::collectActiveStyleSheets):
677         * dom/Node.cpp:
678         (WebCore::Node::enclosingLinkEventParentOrSelf):
679         * dom/Position.cpp:
680         (WebCore::endsOfNodeAreVisuallyDistinctPositions):
681         * dom/ScriptElement.cpp:
682         (WebCore::toScriptElementIfPossible):
683         * dom/VisitedLinkState.cpp:
684         (WebCore::linkHashForElement):
685         (WebCore::VisitedLinkState::determineLinkStateSlowCase):
686         * dom/make_names.pl:
687         (printTypeHelpers):
688         * editing/DeleteSelectionCommand.cpp:
689         (WebCore::DeleteSelectionCommand::handleGeneralDelete):
690         * editing/Editor.cpp:
691         (WebCore::imageElementFromImageDocument):
692         * editing/FrameSelection.cpp:
693         (WebCore::scanForForm):
694         * editing/InsertLineBreakCommand.cpp:
695         (WebCore::InsertLineBreakCommand::doApply):
696         * editing/InsertParagraphSeparatorCommand.cpp:
697         (WebCore::InsertParagraphSeparatorCommand::doApply):
698         * editing/ReplaceSelectionCommand.cpp:
699         (WebCore::removeHeadContents):
700         * editing/cocoa/HTMLConverter.mm:
701         (HTMLConverter::_processElement):
702         * editing/htmlediting.cpp:
703         (WebCore::isNonTableCellHTMLBlockElement):
704         * editing/markup.cpp:
705         (WebCore::ancestorToRetainStructureAndAppearanceForBlock):
706         (WebCore::collectElementsToRemoveFromFragment):
707         * html/FTPDirectoryDocument.cpp:
708         (WebCore::FTPDirectoryDocumentParser::loadDocumentTemplate):
709         * html/FormAssociatedElement.cpp:
710         (WebCore::FormAssociatedElement::findAssociatedForm):
711         * html/HTMLAnchorElement.cpp:
712         (WebCore::appendServerMapMousePosition):
713         * html/HTMLAreaElement.cpp:
714         (WebCore::HTMLAreaElement::imageElement):
715         * html/HTMLDocument.cpp:
716         (WebCore::HTMLDocument::bgColor):
717         (WebCore::HTMLDocument::setBgColor):
718         (WebCore::HTMLDocument::fgColor):
719         (WebCore::HTMLDocument::setFgColor):
720         (WebCore::HTMLDocument::alinkColor):
721         (WebCore::HTMLDocument::setAlinkColor):
722         (WebCore::HTMLDocument::linkColor):
723         (WebCore::HTMLDocument::setLinkColor):
724         (WebCore::HTMLDocument::vlinkColor):
725         (WebCore::HTMLDocument::setVlinkColor):
726         (WebCore::HTMLDocument::isFrameSet):
727         * html/HTMLElement.cpp:
728         (WebCore::HTMLElement::setInnerHTML):
729         * html/HTMLFieldSetElement.cpp:
730         (WebCore::updateFromControlElementsAncestorDisabledStateUnder):
731         (WebCore::HTMLFieldSetElement::disabledStateChanged):
732         * html/HTMLFormControlElement.cpp:
733         (WebCore::HTMLFormControlElement::computeIsDisabledByFieldsetAncestor):
734         * html/HTMLFormControlsCollection.cpp:
735         (WebCore::HTMLFormControlsCollection::HTMLFormControlsCollection):
736         (WebCore::HTMLFormControlsCollection::formControlElements):
737         (WebCore::HTMLFormControlsCollection::formImageElements):
738         (WebCore::HTMLFormControlsCollection::namedItem):
739         (WebCore::HTMLFormControlsCollection::updateNamedElementCache):
740         * html/HTMLFormElement.cpp:
741         (WebCore::HTMLFormElement::rendererIsNeeded):
742         * html/HTMLFrameElementBase.h:
743         (WebCore::isHTMLFrameElementBase):
744         * html/HTMLImageLoader.cpp:
745         (WebCore::HTMLImageLoader::dispatchLoadEvent):
746         * html/HTMLInputElement.cpp:
747         (WebCore::HTMLInputElement::dataList):
748         * html/HTMLLegendElement.cpp:
749         (WebCore::HTMLLegendElement::virtualForm):
750         * html/HTMLMediaElement.cpp:
751         (WebCore::HTMLMediaElement::parseAttribute):
752         * html/HTMLNameCollection.cpp:
753         (WebCore::WindowNameCollection::elementMatchesIfNameAttributeMatch):
754         (WebCore::DocumentNameCollection::elementMatches):
755         * html/HTMLOptionElement.cpp:
756         (WebCore::HTMLOptionElement::ownerDataListElement):
757         (WebCore::HTMLOptionElement::textIndentedToRespectGroupLabel):
758         (WebCore::HTMLOptionElement::isDisabledFormControl):
759         * html/HTMLSelectElement.cpp:
760         (WebCore::HTMLSelectElement::recalcListItems):
761         * html/HTMLTableElement.cpp:
762         (WebCore::HTMLTableElement::caption):
763         * html/HTMLTablePartElement.cpp:
764         (WebCore::HTMLTablePartElement::findParentTable):
765         * html/HTMLTableRowElement.cpp:
766         (WebCore::HTMLTableRowElement::rowIndex):
767         * html/HTMLTableRowsCollection.cpp:
768         (WebCore::HTMLTableRowsCollection::rowAfter):
769         (WebCore::HTMLTableRowsCollection::lastRow):
770         * html/HTMLTagNames.in:
771         * html/LabelsNodeList.cpp:
772         (WebCore::LabelsNodeList::elementMatches):
773         * html/MediaDocument.cpp:
774         (WebCore::descendentVideoElement):
775         (WebCore::ancestorVideoElement):
776         * html/RadioInputType.cpp:
777         (WebCore::RadioInputType::handleKeydownEvent):
778         * html/RadioNodeList.cpp:
779         (WebCore::RadioNodeList::RadioNodeList):
780         (WebCore::RadioNodeList::checkElementMatchesRadioNodeListFilter):
781         * html/parser/HTMLConstructionSite.cpp:
782         (WebCore::hasImpliedEndTag):
783         (WebCore::insert):
784         (WebCore::HTMLConstructionSite::insertHTMLFormElement):
785         (WebCore::HTMLConstructionSite::insertTextNode):
786         (WebCore::HTMLConstructionSite::ownerDocumentForCurrentNode):
787         * html/parser/HTMLElementStack.cpp:
788         (WebCore::HTMLNames::isScopeMarker):
789         (WebCore::HTMLNames::isTableScopeMarker):
790         * html/parser/HTMLTreeBuilder.cpp:
791         (WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
792         (WebCore::HTMLTreeBuilder::processStartTag):
793         (WebCore::HTMLTreeBuilder::resetInsertionModeAppropriately):
794         (WebCore::HTMLTreeBuilder::processEndTag):
795         (WebCore::HTMLTreeBuilder::processCharacterBuffer):
796         * inspector/InspectorDOMAgent.cpp:
797         (WebCore::InspectorDOMAgent::buildObjectForNode):
798         * inspector/InspectorStyleSheet.cpp:
799         (WebCore::InspectorStyleSheet::inlineStyleSheetText):
800         * page/DragController.cpp:
801         (WebCore::DragController::draggableElement):
802         * page/FocusController.cpp:
803         (WebCore::FocusController::advanceFocusDirectionally):
804         * page/PageSerializer.cpp:
805         (WebCore::PageSerializer::serializeFrame):
806         * page/SpatialNavigation.cpp:
807         (WebCore::FocusCandidate::FocusCandidate):
808         (WebCore::areElementsOnSameLine):
809         * page/ios/FrameIOS.mm:
810         (WebCore::ancestorRespondingToClickEvents):
811         * rendering/HitTestResult.cpp:
812         (WebCore::HitTestResult::altDisplayString):
813         (WebCore::HitTestResult::mediaSupportsFullscreen):
814         (WebCore::HitTestResult::mediaElement):
815         (WebCore::HitTestResult::enterFullscreenForVideo):
816         (WebCore::HitTestResult::mediaIsVideo):
817         (WebCore::HitTestResult::isLiveLink):
818         * rendering/RenderCounter.cpp:
819         (WebCore::planCounter):
820         * rendering/RenderImage.cpp:
821         (WebCore::RenderImage::RenderImage):
822         (WebCore::RenderImage::paintAreaElementFocusRing):
823         (WebCore::RenderImage::paintIntoRect):
824         (WebCore::RenderImage::imageMap):
825         (WebCore::RenderImage::updateAltText):
826         * rendering/RenderListBox.cpp:
827         (WebCore::RenderListBox::updateFromElement):
828         (WebCore::RenderListBox::paintItemForeground):
829         * rendering/RenderMarquee.cpp:
830         (WebCore::RenderMarquee::marqueeSpeed):
831         * rendering/RenderMenuList.cpp:
832         (RenderMenuList::itemText):
833         (RenderMenuList::itemIsEnabled):
834         (RenderMenuList::itemIsLabel):
835         * rendering/RenderMeter.cpp:
836         (WebCore::RenderMeter::meterElement):
837         * rendering/RenderObject.cpp:
838         (WebCore::RenderObject::shouldRespectImageOrientation):
839         (WebCore::RenderObject::getTextDecorationColors):
840         (WebCore::RenderObject::offsetParent):
841         * rendering/RenderProgress.cpp:
842         (WebCore::RenderProgress::progressElement):
843         * rendering/RenderTable.cpp:
844         (WebCore::RenderTable::convertStyleLogicalWidthToComputedWidth):
845         (WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight):
846         * svg/graphics/SVGImageCache.cpp:
847         (WebCore::SVGImageCache::imageForRenderer):
848         * testing/Internals.cpp:
849         (WebCore::Internals::updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks):
850         * xml/parser/XMLDocumentParserLibxml2.cpp:
851         (WebCore::XMLDocumentParser::startElementNs):
852
853 2014-09-25  Brian J. Burg  <burg@cs.washington.edu>
854
855         Web Replay: Check event loop input extents during replay too
856         https://bugs.webkit.org/show_bug.cgi?id=136316
857
858         Reviewed by Timothy Hatcher.
859
860         Sometimes we see different nondeterminism during capture and replay
861         executions, so we should support determinism checks during replay too.
862
863         Move the withinEventLoopInputExtent flag to the base class.
864
865         No new tests, no behavior changed.
866
867         * replay/CapturingInputCursor.cpp:
868         (WebCore::CapturingInputCursor::CapturingInputCursor):
869         (WebCore::CapturingInputCursor::setWithinEventLoopInputExtent): Deleted.
870         * replay/CapturingInputCursor.h:
871         * replay/EventLoopInput.cpp:
872         (WebCore::EventLoopInputExtent::EventLoopInputExtent):
873         (WebCore::EventLoopInputExtent::~EventLoopInputExtent):
874         Make m_cursor a pointer and add a new constructor so we can conditionally
875         enter event loop input extents. This is useful in some network replay situations.
876
877         * replay/EventLoopInput.h:
878         * replay/ReplayController.cpp:
879         (WebCore::ReplayController::willDispatchEvent): Expand the assertion to include replaying.
880
881 2014-09-25  Jeremy Jones  <jeremyj@apple.com>
882
883         Race in ref pointer for WebVideoFullscreenInterfaceAVKit.
884         https://bugs.webkit.org/show_bug.cgi?id=137123
885
886         Reviewed by Eric Carlson.
887
888         Add WebThreadRun to prevent race with RefPtr of WebVideoFullscreenInterfaceAVKit.
889
890         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
891         (-[WebVideoFullscreenController didSetupFullscreen]): add WebThreadRun
892         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
893         (WebVideoFullscreenInterfaceAVKit::setDuration): ditto
894         (WebVideoFullscreenInterfaceAVKit::setCurrentTime): ditto
895         (WebVideoFullscreenInterfaceAVKit::setRate): ditto
896         (WebVideoFullscreenInterfaceAVKit::setVideoDimensions): ditto
897         (WebVideoFullscreenInterfaceAVKit::setSeekableRanges): ditto
898         (WebVideoFullscreenInterfaceAVKit::setAudioMediaSelectionOptions): ditto
899         (WebVideoFullscreenInterfaceAVKit::setLegibleMediaSelectionOptions): ditto
900         (WebVideoFullscreenInterfaceAVKit::setExternalPlayback): ditto
901         (WebVideoFullscreenInterfaceAVKit::setupFullscreen): ditto
902         (WebVideoFullscreenInterfaceAVKit::enterFullscreen): ditto
903         (WebVideoFullscreenInterfaceAVKit::exitFullscreen): ditto
904         (WebVideoFullscreenInterfaceAVKit::cleanupFullscreen): ditto
905         (WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen): ditto
906
907 2014-09-25  Chris Dumez  <cdumez@apple.com>
908
909         Unreviewed iOS build fix after r173944.
910
911         Add a missing header include.
912         See <rdar://problem/18454708> for more details.
913
914         * html/parser/HTMLTreeBuilder.cpp:
915
916 2014-09-25  Christophe Dumez  <cdumez@apple.com>
917
918         Stop using legacy NODE_TYPE_CASTS() macro in svg/
919         https://bugs.webkit.org/show_bug.cgi?id=137106
920
921         Reviewed by Ryosuke Niwa.
922
923         Stop using legacy NODE_TYPE_CASTS() in svg/ and use the new
924         SPECIALIZE_TYPE_TRAITS_*() macro instead so that is<>() / downcast<>()
925         can be used for those types.
926
927         No new tests, no behavior change.
928
929         * css/CSSComputedStyleDeclaration.cpp:
930         (WebCore::ComputedStyleExtractor::propertyValue):
931         * dom/Element.h:
932         * dom/Node.h:
933         (WebCore::is):
934         * dom/make_names.pl:
935         (printTypeHelpers):
936         * html/HTMLElement.h:
937         * html/HTMLMediaElement.h:
938         * html/HTMLPlugInImageElement.h:
939         * html/LabelableElement.h:
940         * mathml/MathMLElement.h:
941         Rename NodeTypeCastTraits::is() to NodeTypeCastTraits::isType() to
942         avoid naming conflict with the global is<>() function. This was an
943         issue when is<>() was called from one of the template specializations.
944
945         * rendering/svg/RenderSVGBlock.h:
946         (WebCore::RenderSVGBlock::graphicsElement):
947         * rendering/svg/RenderSVGGradientStop.cpp:
948         (WebCore::RenderSVGGradientStop::gradientElement):
949         * rendering/svg/RenderSVGInline.h:
950         (WebCore::RenderSVGInline::graphicsElement):
951         * rendering/svg/RenderSVGResourceClipper.cpp:
952         (WebCore::RenderSVGResourceClipper::pathOnlyClipping):
953         * rendering/svg/RenderSVGResourceContainer.cpp:
954         (WebCore::RenderSVGResourceContainer::transformOnNonScalingStroke):
955         * rendering/svg/RenderSVGShape.h:
956         (WebCore::RenderSVGShape::graphicsElement):
957         * rendering/svg/RenderSVGTransformableContainer.h:
958         * rendering/svg/SVGRenderSupport.cpp:
959         (WebCore::SVGRenderSupport::updateMaskedAncestorShouldIsolateBlending):
960         * rendering/svg/SVGRenderTreeAsText.cpp:
961         (WebCore::operator<<):
962         * rendering/svg/SVGRenderingContext.cpp:
963         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
964         * rendering/svg/SVGResources.cpp:
965         (WebCore::targetReferenceFromResource):
966         * svg/SVGAElement.cpp:
967         (WebCore::SVGAElement::defaultEventHandler):
968         * svg/SVGAnimateElement.cpp:
969         (WebCore::SVGAnimateElement::calculateAnimatedValue):
970         (WebCore::isSVGAnimateElement): Deleted.
971         Use is<>() / downcast<>() where appropriate.
972
973         * svg/SVGAnimateElement.h:
974         (WebCore::isSVGAnimateElement):
975         Use SPECIALIZE_TYPE_TRAITS_*() instead of NODE_TYPE_CASTS() and add
976         overload for isSVGAnimateElement() taking an SVGElement in argument to
977         bypass the is<SVGElement>() check when the input type is an SVGElement.
978
979         * svg/SVGAnimationElement.cpp:
980         (WebCore::SVGAnimationElement::currentValuesForValuesAnimation):
981         * svg/SVGElement.cpp:
982         (WebCore::SVGElement::getBoundingBox):
983         Use is<>() / downcast<>() where appropriate.
984
985         * svg/SVGElement.h:
986         * svg/SVGFilterPrimitiveStandardAttributes.h:
987         Use SPECIALIZE_TYPE_TRAITS_*() instead of NODE_TYPE_CASTS() and drop
988         the pre-existing NodeTypeCastTraits template specialization as it is
989         now generated by the macro.
990
991         * svg/SVGGradientElement.cpp:
992         (WebCore::isSVGGradientElement): Deleted.
993         * svg/SVGGradientElement.h:
994         (WebCore::isSVGGradientElement):
995         Use SPECIALIZE_TYPE_TRAITS_*() instead of NODE_TYPE_CASTS() and add
996         overload for isSVGAnimateElement() taking an SVGElement in argument to
997         bypass the is<SVGElement>() check when the input type is an SVGElement.
998
999         * svg/SVGGraphicsElement.h:
1000         (WebCore::isSVGGraphicsElement):
1001         Use SPECIALIZE_TYPE_TRAITS_*() instead of NODE_TYPE_CASTS().
1002
1003         * svg/SVGLinearGradientElement.cpp:
1004         (WebCore::SVGLinearGradientElement::collectGradientAttributes):
1005         * svg/SVGLocatable.cpp:
1006         (WebCore::SVGLocatable::getTransformToElement):
1007         * svg/SVGPolyElement.cpp:
1008         (WebCore::SVGPolyElement::synchronizePoints):
1009         (WebCore::SVGPolyElement::lookupOrCreatePointsWrapper):
1010         (WebCore::isSVGPolyElement): Deleted.
1011         Use is<>() / downcast<>() where appropriate.
1012
1013         * svg/SVGPolyElement.h:
1014         (WebCore::isSVGPolyElement):
1015         Use SPECIALIZE_TYPE_TRAITS_*() instead of NODE_TYPE_CASTS() and add
1016         overload for isPolyElement() taking an SVGElement in argument to
1017         bypass the is<SVGElement>() check when the input type is an SVGElement.
1018
1019         * svg/SVGRadialGradientElement.cpp:
1020         (WebCore::SVGRadialGradientElement::collectGradientAttributes):
1021         * svg/SVGTextContentElement.cpp:
1022         (WebCore::SVGTextContentElement::synchronizeTextLength):
1023         (WebCore::SVGTextContentElement::lookupOrCreateTextLengthWrapper):
1024         (WebCore::SVGTextContentElement::elementFromRenderer):
1025         Use is<>() / downcast<>() where appropriate.
1026
1027         * svg/SVGTextContentElement.h:
1028         WebCore::isSVGTextContentElement):
1029         Use SPECIALIZE_TYPE_TRAITS_*() instead of NODE_TYPE_CASTS().
1030
1031         * svg/SVGUseElement.cpp:
1032         (WebCore::SVGUseElement::toClipPath):
1033         Use is<>() / downcast<>() where appropriate. Also use tighter typing
1034         for value returned by shadowTreeElement().
1035
1036         * svg/animation/SVGSMILElement.cpp:
1037         (WebCore::SVGSMILElement::buildPendingResource):
1038         (WebCore::SVGSMILElement::connectConditions):
1039         (WebCore::SVGSMILElement::disconnectConditions):
1040         Use is<>() / downcast<>() where appropriate.
1041
1042         * svg/animation/SVGSMILElement.h:
1043         (WebCore::isSVGSMILElement):
1044         Use SPECIALIZE_TYPE_TRAITS_*() instead of NODE_TYPE_CASTS() and drop
1045         the pre-existing NodeTypeCastTraits template specialization as it is
1046         now generated by the macro.
1047
1048 2014-09-25  Brent Fulgham  <bfulgham@apple.com>
1049
1050         Minor refactoring to mediaType/presentationType
1051         https://bugs.webkit.org/show_bug.cgi?id=137085
1052
1053         Reviewed by Eric Carlson.
1054
1055         Add overloads for presentationType for the audio and video
1056         HTML elements so that we don't have to explicity check the
1057         tag name (via string comparison) to identify the type of
1058         element.
1059
1060         No new tests. Should create no change in behavior.
1061
1062         * html/HTMLAudioElement.h: Overload presentationType to always
1063         indicate audio type.
1064         * html/HTMLMediaElement.cpp:
1065         (WebCore::HTMLMediaElement::mediaType): Use the presentationType
1066         method implementation, rather than duplicating that code.
1067         * html/HTMLVideoElement.h: Overload presentationType to always
1068         return video type.
1069
1070 2014-09-25  Javier Fernandez  <jfernandez@igalia.com>
1071
1072         ASSERTION FAILED: columnCount in WebCore::CSSParser::parseGridTemplateAreasRow
1073         https://bugs.webkit.org/show_bug.cgi?id=136945
1074
1075         Reviewed by Sergio Villar Senin.
1076
1077         Checking out whether the grid-template-areas value contains a white-space only
1078         string, which is not valid as it does not produce a cell token.
1079
1080         Test: fast/css-grid-layout/grid-template-areas-empty-string-crash.html
1081
1082         * css/CSSParser.cpp:
1083         (WebCore::CSSParser::parseGridTemplateAreasRow):
1084
1085 2014-09-25  Csaba Osztrogon√°c  <ossy@webkit.org>
1086
1087         Remove WinCE port from trunk
1088         https://bugs.webkit.org/show_bug.cgi?id=136951
1089
1090         Reviewed by Alex Christensen.
1091
1092         * Modules/encryptedmedia/CDMPrivateMediaPlayer.cpp:
1093         * PlatformWinCE.cmake: Removed.
1094         * accessibility/AXObjectCache.cpp:
1095         * editing/FrameSelection.cpp:
1096         (WebCore::FrameSelection::modifyMovingRight):
1097         * loader/icon/wince/IconDatabaseWinCE.cpp: Removed.
1098         * page/EventHandler.cpp:
1099         (WebCore::EventHandler::sendContextMenuEventForKey):
1100         * page/Settings.cpp:
1101         * page/win/EventHandlerWin.cpp:
1102         (WebCore::EventHandler::createDraggingDataTransfer):
1103         * platform/ContextMenu.h:
1104         * platform/DragImage.cpp:
1105         * platform/FileSystem.h:
1106         * platform/graphics/BitmapImage.cpp:
1107         (WebCore::BitmapImage::mayFillWithSolidColor):
1108         * platform/graphics/FontGlyphs.cpp:
1109         (WebCore::FontGlyphs::glyphDataAndPageForCharacter):
1110         * platform/graphics/FontPlatformData.h:
1111         * platform/graphics/ImageBufferData.h:
1112         * platform/graphics/MediaPlayer.cpp:
1113         * platform/graphics/SimpleFontData.h:
1114         * platform/graphics/opentype/OpenTypeUtilities.cpp:
1115         (WebCore::renameAndActivateFont):
1116         * platform/graphics/opentype/OpenTypeUtilities.h:
1117         * platform/graphics/win/DIBPixelData.cpp:
1118         (WebCore::DIBPixelData::setRGBABitmapAlpha):
1119         * platform/graphics/win/GDIExtras.cpp: Removed.
1120         * platform/graphics/win/GDIExtras.h:
1121         (WebCore::hasAlphaBlendSupport):
1122         (WebCore::alphaBlendIfSupported):
1123         * platform/graphics/win/IconWin.cpp:
1124         (WebCore::Icon::createIconForFiles):
1125         (WebCore::Icon::paint):
1126         * platform/graphics/win/SimpleFontDataWin.cpp:
1127         (WebCore::SimpleFontData::initGDIFont):
1128         (WebCore::SimpleFontData::platformDestroy):
1129         (WebCore::SimpleFontData::boundsForGDIGlyph):
1130         (WebCore::SimpleFontData::widthForGDIGlyph):
1131         (WebCore::SimpleFontData::scriptFontProperties):
1132         * platform/graphics/wince/FontCacheWinCE.cpp: Removed.
1133         * platform/graphics/wince/FontCustomPlatformData.cpp: Removed.
1134         * platform/graphics/wince/FontCustomPlatformData.h: Removed.
1135         * platform/graphics/wince/FontPlatformData.cpp: Removed.
1136         * platform/graphics/wince/FontPlatformData.h: Removed.
1137         * platform/graphics/wince/FontWinCE.cpp: Removed.
1138         * platform/graphics/wince/GlyphPageTreeNodeWinCE.cpp: Removed.
1139         * platform/graphics/wince/GradientWinCE.cpp: Removed.
1140         * platform/graphics/wince/GraphicsContextWinCE.cpp: Removed.
1141         * platform/graphics/wince/ImageBufferDataWince.h: Removed.
1142         * platform/graphics/wince/ImageBufferWinCE.cpp: Removed.
1143         * platform/graphics/wince/ImageWinCE.cpp: Removed.
1144         * platform/graphics/wince/MediaPlayerPrivateWinCE.h: Removed.
1145         * platform/graphics/wince/MediaPlayerProxy.cpp: Removed.
1146         * platform/graphics/wince/MediaPlayerProxy.h: Removed.
1147         * platform/graphics/wince/PathWinCE.cpp: Removed.
1148         * platform/graphics/wince/PlatformPathWinCE.cpp: Removed.
1149         * platform/graphics/wince/PlatformPathWinCE.h: Removed.
1150         * platform/graphics/wince/SharedBitmap.cpp: Removed.
1151         * platform/graphics/wince/SharedBitmap.h: Removed.
1152         * platform/graphics/wince/SimpleFontDataWinCE.cpp: Removed.
1153         * platform/graphics/wince/WinCEGraphicsExtras.h: Removed.
1154         * platform/image-decoders/jpeg/JPEGImageDecoder.h:
1155         * platform/network/win/NetworkStateNotifierWin.cpp:
1156         (WebCore::NetworkStateNotifier::NetworkStateNotifier):
1157         * platform/win/COMPtr.h:
1158         * platform/win/ClipboardUtilitiesWin.cpp:
1159         * platform/win/ContextMenuItemWin.cpp:
1160         * platform/win/ContextMenuWin.cpp:
1161         (WebCore::ContextMenu::getContextMenuItems):
1162         (WebCore::ContextMenu::createPlatformContextMenuFromItems):
1163         * platform/win/DragImageWin.cpp:
1164         (WebCore::dragLabelFont):
1165         * platform/win/FileSystemWin.cpp:
1166         (WebCore::pathByAppendingComponent):
1167         (WebCore::pathGetFileName):
1168         (WebCore::storageDirectory):
1169         * platform/win/LoggingWin.cpp:
1170         (WebCore::logLevelString):
1171         * platform/win/PasteboardWin.cpp:
1172         (WebCore::PasteboardOwnerWndProc):
1173         (WebCore::Pasteboard::createForCopyAndPaste):
1174         (WebCore::pathRemoveBadFSCharacters):
1175         (WebCore::filesystemPathFromUrlOrTitle):
1176         (WebCore::createGlobalHDropContent):
1177         * platform/win/PlatformMouseEventWin.cpp:
1178         (WebCore::messageToEventType):
1179         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
1180         * platform/win/PlatformScreenWin.cpp:
1181         (WebCore::deviceInfoForWidget):
1182         (WebCore::screenIsMonochrome):
1183         * platform/win/PopupMenuWin.cpp:
1184         (WebCore::PopupMenuWin::show):
1185         (WebCore::PopupMenuWin::paint):
1186         (WebCore::PopupMenuWin::registerClass):
1187         (WebCore::PopupMenuWin::wndProc):
1188         * platform/win/ScrollbarThemeWin.cpp:
1189         (WebCore::ScrollbarThemeWin::paintButton):
1190         * platform/win/SharedBufferWin.cpp:
1191         * platform/win/SharedTimerWin.cpp:
1192         (WebCore::TimerWindowWndProc):
1193         (WebCore::initializeOffScreenTimerWindow):
1194         (WebCore::queueTimerProc):
1195         (WebCore::setSharedTimerFireInterval):
1196         (WebCore::stopSharedTimer):
1197         * platform/win/SoftLinking.h:
1198         * platform/win/SystemInfo.cpp:
1199         (WebCore::windowsVersion):
1200         (WebCore::processorArchitecture):
1201         (WebCore::architectureTokenForUAString):
1202         * platform/win/WCDataObject.cpp:
1203         (WebCore::WCDataObject::CopyMedium):
1204         * plugins/PluginDatabase.cpp:
1205         * plugins/PluginView.cpp:
1206         (WebCore::PluginView::stop):
1207         * plugins/PluginViewNone.cpp:
1208         * plugins/win/PluginDatabaseWin.cpp:
1209         (WebCore::addWindowsMediaPlayerPluginDirectory):
1210         (WebCore::addMacromediaPluginDirectories):
1211         * plugins/win/PluginPackageWin.cpp:
1212         (WebCore::PluginPackage::load):
1213         * plugins/win/PluginViewWin.cpp:
1214         (WebCore::setUpOffscreenPaintingHooks):
1215         (WebCore::registerPluginView):
1216         (WebCore::PluginView::wndProc):
1217         (WebCore::PluginView::updatePluginWidget):
1218         (WebCore::PluginView::paintIntoTransformedContext):
1219         (WebCore::PluginView::paint):
1220         (WebCore::PluginView::handleMouseEvent):
1221         (WebCore::PluginView::setParent):
1222         (WebCore::PluginView::setNPWindowRect):
1223         (WebCore::PluginView::platformStart):
1224         * rendering/RenderThemeWinCE.cpp: Removed.
1225         * rendering/RenderThemeWinCE.h: Removed.
1226         * storage/wince/DatabaseThreadWinCE.cpp: Removed.
1227         * storage/wince/DatabaseThreadWinCE.h: Removed.
1228         * storage/wince/StorageThreadWinCE.cpp: Removed.
1229         * storage/wince/StorageThreadWinCE.h: Removed.
1230
1231 2014-09-25  Carlos Garcia Campos  <cgarcia@igalia.com>
1232
1233         Unreviewed. Fix GTK+ build after r173944.
1234
1235         * page/ContextMenuController.cpp: Add missing include.
1236
1237 2014-09-24  Christophe Dumez  <cdumez@apple.com>
1238
1239         Use tighter typing for render objects in RenderGeometryMap
1240         https://bugs.webkit.org/show_bug.cgi?id=137102
1241
1242         Reviewed by Ryosuke Niwa.
1243
1244         Use tighter typing for render objects in RenderGeometryMap for clarity
1245         and efficiency.
1246
1247         In particular, using RenderElement type instead of RenderObject
1248         in canMapBetweenRenderers() allows us to call the faster
1249         RenderElement::style() instead of RenderObject::style().
1250
1251         No new tests, no behavior change.
1252
1253         * rendering/RenderGeometryMap.cpp:
1254         (WebCore::canMapBetweenRenderers):
1255         (WebCore::RenderGeometryMap::pushMappingsToAncestor):
1256
1257 2014-09-24  Christophe Dumez  <cdumez@apple.com>
1258
1259         Add initial is<>() / downcast<>() support for any type of Nodes
1260         https://bugs.webkit.org/show_bug.cgi?id=137056
1261
1262         Reviewed by Benjamin Poulain.
1263
1264         Add initial is<>() / downcast<>() support for any type of Nodes, not
1265         just Elements by:
1266         - Moving the is<>() / downcast<>() declarations from Element.h to
1267           Node.h
1268         - Introducing a SPECIALIZE_TYPE_TRAITS_*() macro that generates the
1269           needed template specializations for is<>() / downcast<>() to work.
1270           This macro will replace NODE_TYPE_CASTS() entirely once the code base
1271           is fully ported.
1272
1273         This patch makes use of SPECIALIZE_TYPE_TRAITS_*() macro for
1274         HTMLFormControlElement, that is an HTMLElement for which the template
1275         specializations cannot be automatically generated because it requires
1276         special handling.
1277
1278         This patch also makes use of SPECIALIZE_TYPE_TRAITS_*() macro for
1279         DocumentFragment to show that it can be used for non-Element Nodes.
1280
1281         No new tests, no behavior change.
1282
1283         * accessibility/AccessibilityNodeObject.cpp:
1284         (WebCore::AccessibilityNodeObject::isReadOnly):
1285         (WebCore::AccessibilityNodeObject::isRequired):
1286         (WebCore::AccessibilityNodeObject::isControl):
1287         * css/SelectorCheckerTestFunctions.h:
1288         (WebCore::isAutofilled):
1289         (WebCore::isDisabled):
1290         (WebCore::isEnabled):
1291         * css/StyleResolver.cpp:
1292         (WebCore::StyleResolver::canShareStyleWithElement):
1293         (WebCore::StyleResolver::adjustRenderStyle):
1294         * dom/Document.cpp:
1295         (WebCore::Document::importNode):
1296         (WebCore::Document::setFocusedElement):
1297         * dom/DocumentFragment.h:
1298         (WebCore::isDocumentFragment):
1299         * dom/Element.cpp:
1300         (WebCore::Element::focus):
1301         * dom/Element.h:
1302         (WebCore::is): Deleted.
1303         (WebCore::downcast): Deleted.
1304         * dom/Node.h:
1305         (WebCore::is):
1306         (WebCore::downcast):
1307         * dom/make_names.pl:
1308         (printTypeHelpers):
1309         * editing/FrameSelection.cpp:
1310         (WebCore::scanForForm):
1311         * editing/TextIterator.cpp:
1312         (WebCore::isRendererReplacedElement):
1313         * html/FormAssociatedElement.h:
1314         * html/HTMLElement.h:
1315         * html/HTMLFieldSetElement.cpp:
1316         (WebCore::updateFromControlElementsAncestorDisabledStateUnder):
1317         (WebCore::HTMLFieldSetElement::refreshElementsIfNeeded):
1318         * html/HTMLFormControlElement.cpp:
1319         (WebCore::HTMLFormControlElement::enclosingFormControlElement):
1320         * html/HTMLFormControlElement.h:
1321         (WebCore::isHTMLFormControlElement):
1322         * html/HTMLFormElement.cpp:
1323         (WebCore::HTMLFormElement::submitImplicitly):
1324         (WebCore::submitElementFromEvent):
1325         (WebCore::HTMLFormElement::validateInteractively):
1326         (WebCore::HTMLFormElement::submit):
1327         (WebCore::HTMLFormElement::reset):
1328         (WebCore::HTMLFormElement::formElementIndex):
1329         (WebCore::HTMLFormElement::defaultButton):
1330         (WebCore::HTMLFormElement::checkInvalidControlsAndCollectUnhandled):
1331         (WebCore::HTMLFormElement::documentDidResumeFromPageCache):
1332         * html/HTMLMediaElement.h:
1333         * html/HTMLPlugInImageElement.h:
1334         * html/HTMLSummaryElement.cpp:
1335         (WebCore::isClickableControl):
1336         * html/LabelableElement.h:
1337         * html/RadioNodeList.cpp:
1338         (WebCore::RadioNodeList::checkElementMatchesRadioNodeListFilter):
1339         (WebCore::RadioNodeList::elementMatches):
1340         * html/parser/HTMLConstructionSite.cpp:
1341         (WebCore::HTMLConstructionSite::findFosterSite):
1342         * html/parser/HTMLTreeBuilder.cpp:
1343         (WebCore::disallowTelephoneNumberParsing):
1344         * loader/FormSubmission.cpp:
1345         (WebCore::FormSubmission::create):
1346         * mathml/MathMLElement.h:
1347         * page/ContextMenuController.cpp:
1348         (WebCore::ContextMenuController::populate):
1349         * page/Frame.cpp:
1350         (WebCore::Frame::searchForLabelsBeforeElement):
1351         * rendering/RenderButton.cpp:
1352         (WebCore::RenderButton::formControlElement):
1353         * rendering/RenderLayer.cpp:
1354         (WebCore::RenderLayer::resize):
1355         * rendering/RenderTheme.cpp:
1356         (WebCore::RenderTheme::isReadOnlyControl):
1357         * svg/SVGElement.h:
1358         * svg/SVGFilterPrimitiveStandardAttributes.h:
1359         * svg/animation/SVGSMILElement.h:
1360
1361 2014-09-24  Darin Adler  <darin@apple.com>
1362
1363         Old Turkic characters behave as left-to-right instead of right-to-left, because they are encoded as surrogate pairs.
1364         https://bugs.webkit.org/show_bug.cgi?id=70029
1365
1366         Reviewed by Dan Bernstein.
1367
1368         Test: fast/text/international/old-turkic-direction.html
1369
1370         * CMakeLists.txt: Added InlineIterator.cpp.
1371         * WebCore.vcxproj/WebCore.vcxproj: Ditto.
1372         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
1373         * WebCore.xcodeproj/project.pbxproj: Ditto.
1374         * rendering/RenderingAllInOne.cpp: Ditto.
1375
1376         * rendering/InlineIterator.cpp: Added.
1377         (WebCore::InlineIterator::surrogateTextDirection): New function used to compute the direction
1378         when a surrogate pair is involved.
1379         * rendering/InlineIterator.h: Made the characterAt function private.
1380         (WebCore::InlineIterator::previousInSameNode): Took out unneeded range check. A zero will underflow
1381         and become a large number and the characterAt function will return 0 in that case.
1382         (WebCore::InlineIterator::direction): Added code to check U16_IS_SINGLE before calling
1383         u_charDirection, and call surrogateTextDirection instead.
1384
1385 2014-09-24  Christophe Dumez  <cdumez@apple.com>
1386
1387         Unreviewed build fix after r173941.
1388
1389         Rename shadow to m_shadow.
1390
1391         * rendering/TextPainter.h:
1392         (WebCore::ShadowApplier::shadowIsCompletelyCoveredByText):
1393
1394 2014-09-22  Myles C. Maxfield  <mmaxfield@apple.com>
1395
1396         REGRESSION: Text with a zero offset, zero blur shadow vanishes
1397         https://bugs.webkit.org/show_bug.cgi?id=136801
1398
1399         Reviewed by Darin Adler.
1400
1401         This patch performs some cleanup regarding TextPainter's shadow logic and handles an
1402         additional case of empty shadows. Previously, there was tight coupling between
1403         applyShadowToGraphicalContext() and paintTextWithShadows(), as they both used a
1404         collection of variables to determine how shadows are to be drawn. This complexity has
1405         been moved into a helper class, ShadowApplier, which performs what
1406         applyShadowToGraphicsContext() used to do, and cleans up correctly in its destructor.
1407         This removes the tight coupling mentioned earlier.
1408
1409         Test: fast/text/empty-shadow.html
1410
1411         * rendering/InlineTextBox.cpp:
1412         (WebCore::InlineTextBox::applyShadowToGraphicsContext): Moved to ShadowApplier.
1413         * rendering/InlineTextBox.h: Deleted applyShadowToGraphicsContext signature.
1414         * rendering/TextPainter.cpp:
1415         (WebCore::ShadowApplier::ShadowApplier): Perform the contents of applyShadowToGraphicsContext()
1416         (WebCore::ShadowApplier::~ShadowApplier): Undo the work done previously
1417         (WebCore::paintTextWithShadows): Create a ShadowApplier to do the relevant shadow work. In addition,
1418         refactor some boolean flags to more meaningful ones with relation to the computation at hand.
1419         (WebCore::isEmptyShadow): Moved to TextPainter.h, named shadowIsCompletelyCoveredByText()
1420         * rendering/TextPainter.h:
1421         (WebCore::ShadowApplier::ShadowApplier): Moved from InlineTextBox::applyShadowToGraphicsContext().
1422         (WebCore::ShadowApplier::extraOffset): Getter.
1423         (WebCore::ShadowApplier::~ShadowApplier): Moved from TextPainter::paintTextWithShadows().
1424         (WebCore::isLastShadowIteration): Helper function.
1425         (WebCore::shadowIsCompletelyCoveredByText): Determines whether or not we should not draw the shadow.
1426         * rendering/svg/SVGInlineTextBox.cpp:
1427         (WebCore::SVGInlineTextBox::paintTextWithShadows): Update to use ShadowApplier.
1428
1429 2014-09-24  Brian J. Burg  <burg@cs.washington.edu>
1430
1431         Web Inspector: subtract elapsed time while debugger is paused from profile nodes
1432         https://bugs.webkit.org/show_bug.cgi?id=136796
1433
1434         Reviewed by Timothy Hatcher.
1435
1436         * inspector/TimelineRecordFactory.cpp:
1437         (WebCore::buildInspectorObject):
1438
1439 2014-09-24  Christophe Dumez  <cdumez@apple.com>
1440
1441         Use is<HTML*Element>() instead of isHTML*Element() - Part 1
1442         https://bugs.webkit.org/show_bug.cgi?id=137068
1443
1444         Reviewed by Ryosuke Niwa.
1445
1446         Start using is<HTML*Element>() instead of isHTML*Element().
1447         Remaining usages will be updated in a follow-up patch to
1448         reduce the size of the change.
1449
1450         No new tests, no behavior change.
1451
1452         * accessibility/AccessibilityListBoxOption.cpp:
1453         (WebCore::AccessibilityListBoxOption::isSelected):
1454         (WebCore::AccessibilityListBoxOption::canSetSelectedAttribute):
1455         (WebCore::AccessibilityListBoxOption::stringValue):
1456         (WebCore::AccessibilityListBoxOption::listBoxOptionParentNode):
1457         * accessibility/AccessibilityMediaControls.cpp:
1458         (WebCore::AccessibilityMediaTimeline::valueDescription):
1459         * accessibility/AccessibilityMenuListOption.cpp:
1460         (WebCore::AccessibilityMenuListOption::setElement):
1461         * accessibility/AccessibilityMenuListPopup.cpp:
1462         (WebCore::AccessibilityMenuListPopup::menuListOptionAccessibilityObject):
1463         * accessibility/AccessibilityNodeObject.cpp:
1464         (WebCore::AccessibilityNodeObject::determineAccessibilityRole):
1465         (WebCore::AccessibilityNodeObject::isNativeTextControl):
1466         (WebCore::AccessibilityNodeObject::isNativeImage):
1467         (WebCore::AccessibilityNodeObject::isInputImage):
1468         (WebCore::AccessibilityNodeObject::isReadOnly):
1469         (WebCore::AccessibilityNodeObject::valueForRange):
1470         (WebCore::AccessibilityNodeObject::maxValueForRange):
1471         (WebCore::AccessibilityNodeObject::minValueForRange):
1472         (WebCore::isNodeActionElement):
1473         (WebCore::AccessibilityNodeObject::titleElementText):
1474         (WebCore::AccessibilityNodeObject::visibleText):
1475         (WebCore::AccessibilityNodeObject::title):
1476         (WebCore::AccessibilityNodeObject::colorValue):
1477         (WebCore::accessibleNameForNode):
1478         * accessibility/AccessibilityRenderObject.cpp:
1479         (WebCore::AccessibilityRenderObject::isFileUploadButton):
1480         (WebCore::AccessibilityRenderObject::addRadioButtonGroupMembers):
1481         (WebCore::AccessibilityRenderObject::setValue):
1482         (WebCore::AccessibilityRenderObject::accessibilityHitTest):
1483         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
1484         (WebCore::AccessibilityRenderObject::addTextFieldChildren):
1485         * accessibility/atk/AXObjectCacheAtk.cpp:
1486         (WebCore::notifyChildrenSelectionChange):
1487         * css/SelectorCheckerTestFunctions.h:
1488         (WebCore::isDisabled):
1489         (WebCore::isEnabled):
1490         (WebCore::isChecked):
1491         * css/StyleResolver.cpp:
1492         (WebCore::StyleResolver::adjustRenderStyle):
1493         * dom/EventDispatcher.cpp:
1494         (WebCore::EventDispatcher::dispatchEvent):
1495         * editing/FrameSelection.cpp:
1496         (WebCore::FrameSelection::selectAll):
1497         * editing/ReplaceSelectionCommand.cpp:
1498         (WebCore::ReplaceSelectionCommand::shouldPerformSmartReplace):
1499         * editing/VisibleSelection.cpp:
1500         (WebCore::VisibleSelection::isInPasswordField):
1501         * editing/cocoa/HTMLConverter.mm:
1502         (HTMLConverter::_processElement):
1503         * editing/gtk/EditorGtk.cpp:
1504         (WebCore::elementURL):
1505         * editing/ios/EditorIOS.mm:
1506         (WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection):
1507         * editing/markup.cpp:
1508         (WebCore::StyledMarkupAccumulator::appendText):
1509         (WebCore::isPlainTextMarkup):
1510         (WebCore::collectElementsToRemoveFromFragment):
1511         * html/HTMLCollection.cpp:
1512         (WebCore::isMatchingElement):
1513         * html/HTMLEmbedElement.cpp:
1514         (WebCore::HTMLEmbedElement::rendererIsNeeded):
1515         * html/HTMLFormControlElement.cpp:
1516         (WebCore::shouldAutofocus):
1517         * html/HTMLFormElement.cpp:
1518         (WebCore::HTMLFormElement::getTextFieldValues):
1519         (WebCore::HTMLFormElement::formElementIndex):
1520         * html/HTMLImageLoader.cpp:
1521         (WebCore::HTMLImageLoader::dispatchLoadEvent):
1522         (WebCore::HTMLImageLoader::notifyFinished):
1523         * html/HTMLNameCollection.cpp:
1524         (WebCore::DocumentNameCollection::elementMatchesIfIdAttributeMatch):
1525         (WebCore::DocumentNameCollection::elementMatchesIfNameAttributeMatch):
1526         (WebCore::DocumentNameCollection::elementMatches):
1527         * html/HTMLOptGroupElement.cpp:
1528         (WebCore::HTMLOptGroupElement::recalcSelectOptions):
1529         (WebCore::HTMLOptGroupElement::ownerSelectElement):
1530         * html/HTMLOptionElement.cpp:
1531         (WebCore::HTMLOptionElement::index):
1532         (WebCore::HTMLOptionElement::ownerSelectElement):
1533         * html/HTMLSelectElement.cpp:
1534         (WebCore::HTMLSelectElement::add):
1535         (WebCore::HTMLSelectElement::value):
1536         (WebCore::HTMLSelectElement::setValue):
1537         (WebCore::HTMLSelectElement::childShouldCreateRenderer):
1538         (WebCore::HTMLSelectElement::setLength):
1539         (WebCore::HTMLSelectElement::nextValidIndex):
1540         (WebCore::HTMLSelectElement::saveLastSelection):
1541         (WebCore::HTMLSelectElement::setActiveSelectionAnchorIndex):
1542         (WebCore::HTMLSelectElement::updateListBoxSelection):
1543         (WebCore::HTMLSelectElement::listBoxOnChange):
1544         (WebCore::HTMLSelectElement::recalcListItems):
1545         (WebCore::HTMLSelectElement::selectedIndex):
1546         (WebCore::HTMLSelectElement::selectOption):
1547         (WebCore::HTMLSelectElement::optionToListIndex):
1548         (WebCore::HTMLSelectElement::listToOptionIndex):
1549         (WebCore::HTMLSelectElement::deselectItemsWithoutValidation):
1550         (WebCore::HTMLSelectElement::saveFormControlState):
1551         (WebCore::HTMLSelectElement::searchOptionsForValue):
1552         (WebCore::HTMLSelectElement::restoreFormControlState):
1553         (WebCore::HTMLSelectElement::appendFormData):
1554         (WebCore::HTMLSelectElement::reset):
1555         (WebCore::HTMLSelectElement::updateSelectedState):
1556         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
1557         (WebCore::HTMLSelectElement::lastSelectedListIndex):
1558         (WebCore::HTMLSelectElement::optionAtIndex):
1559         (WebCore::HTMLSelectElement::accessKeySetSelectedIndex):
1560         (WebCore::HTMLSelectElement::length):
1561         * html/HTMLTagNames.in:
1562         * html/RadioInputType.cpp:
1563         (WebCore::RadioInputType::handleKeydownEvent):
1564         (WebCore::RadioInputType::isKeyboardFocusable):
1565         * html/parser/HTMLConstructionSite.cpp:
1566         (WebCore::hasImpliedEndTag):
1567         * html/parser/HTMLElementStack.cpp:
1568         (WebCore::HTMLNames::isSelectScopeMarker):
1569         * html/parser/HTMLTreeBuilder.cpp:
1570         (WebCore::HTMLTreeBuilder::processStartTagForInBody):
1571         (WebCore::HTMLTreeBuilder::processStartTag):
1572         (WebCore::HTMLTreeBuilder::processEndTag):
1573         * html/shadow/MediaControlElementTypes.cpp:
1574         (WebCore::mediaControlElementType):
1575         * loader/FormSubmission.cpp:
1576         (WebCore::FormSubmission::create):
1577         * loader/FrameLoader.cpp:
1578         (WebCore::FrameLoader::handleFallbackContent):
1579         * loader/ImageLoader.cpp:
1580         (WebCore::ImageLoader::dispatchPendingBeforeLoadEvent):
1581         * loader/SubframeLoader.cpp:
1582         (WebCore::SubframeLoader::requestObject):
1583         * loader/archive/cf/LegacyWebArchive.cpp:
1584         (WebCore::LegacyWebArchive::create):
1585         * page/Chrome.cpp:
1586         (WebCore::Chrome::setToolTip):
1587         * page/EventHandler.cpp:
1588         (WebCore::isSubmitImage):
1589         (WebCore::EventHandler::handleMousePressEvent):
1590         * page/FocusController.cpp:
1591         (WebCore::clearSelectionIfNeeded):
1592         * page/FrameView.cpp:
1593         (WebCore::FrameView::addEmbeddedObjectToUpdate):
1594         (WebCore::FrameView::updateEmbeddedObject):
1595         * page/PageSerializer.cpp:
1596         (WebCore::frameOwnerURLAttributeName):
1597         * page/SpatialNavigation.cpp:
1598         (WebCore::canScrollInDirection):
1599         * rendering/HitTestResult.cpp:
1600         (WebCore::HitTestResult::altDisplayString):
1601         (WebCore::HitTestResult::absoluteImageURL):
1602         (WebCore::HitTestResult::absolutePDFURL):
1603         (WebCore::HitTestResult::isContentEditable):
1604         * rendering/RenderBlockFlow.cpp:
1605         (WebCore::resizeTextPermitted):
1606         * rendering/RenderBox.cpp:
1607         (WebCore::RenderBox::sizesLogicalWidthToFitContent):
1608         * rendering/RenderButton.cpp:
1609         (WebCore::RenderButton::updateFromElement):
1610         (WebCore::RenderButton::canHaveGeneratedChildren):
1611         * rendering/RenderDetailsMarker.cpp:
1612         (WebCore::RenderDetailsMarker::isOpen):
1613         * rendering/RenderFileUploadControl.cpp:
1614         (WebCore::RenderFileUploadControl::uploadButton):
1615         * rendering/RenderImage.cpp:
1616         (WebCore::RenderImage::updateAltText):
1617         * rendering/RenderListBox.cpp:
1618         (WebCore::RenderListBox::updateFromElement):
1619         (WebCore::RenderListBox::addFocusRingRects):
1620         (WebCore::RenderListBox::paintItemForeground):
1621         (WebCore::RenderListBox::paintItemBackground):
1622         * rendering/RenderMenuList.cpp:
1623         (WebCore::selectedOptionCount):
1624         (RenderMenuList::updateOptionsWidth):
1625         (RenderMenuList::setTextFromOption):
1626         (RenderMenuList::itemText):
1627         (RenderMenuList::itemIsEnabled):
1628         (RenderMenuList::itemIsSelected):
1629         * rendering/RenderTheme.cpp:
1630         (WebCore::RenderTheme::paintSliderTicks):
1631         * testing/Internals.cpp:
1632         (WebCore::Internals::selectColorInColorChooser):
1633         (WebCore::Internals::wasLastChangeUserEdit):
1634         (WebCore::Internals::isSelectPopupVisible):
1635         * xml/parser/XMLDocumentParserLibxml2.cpp:
1636         (WebCore::XMLDocumentParser::startElementNs):
1637
1638 2014-09-24  Eric Carlson  <eric.carlson@apple.com>
1639
1640         [iOS] Remove MediaPlayer::setHasPlaybackTargetAvailabilityListeners
1641         https://bugs.webkit.org/show_bug.cgi?id=137075
1642
1643         Reviewed by Dean Jackson.
1644
1645         No new tests, this just removes unused code.
1646
1647         * platform/graphics/MediaPlayer.cpp:
1648         (WebCore::MediaPlayer::setHasPlaybackTargetAvailabilityListeners): Deleted.
1649         * platform/graphics/MediaPlayer.h:
1650         * platform/graphics/MediaPlayerPrivate.h:
1651         (WebCore::MediaPlayerPrivateInterface::setHasPlaybackTargetAvailabilityListeners): Deleted.
1652
1653 2014-09-21  Timothy Hatcher  <timothy@apple.com>
1654
1655         Make the Web Inspector use a separate web process.
1656
1657         https://bugs.webkit.org/show_bug.cgi?id=135120
1658
1659         Reviewed by Anders Carlsson.
1660
1661         * English.lproj/Localizable.strings: Updated.
1662
1663         * WebCore.exp.in:
1664         * WebCore.xcodeproj/project.pbxproj:
1665         * bindings/js/ScriptGlobalObject.h:
1666         * bindings/js/ScriptState.h:
1667         * inspector/InspectorFrontendHost.h:
1668         * inspector/InspectorPageAgent.h:
1669         * page/Chrome.h:
1670         Exported a few functions and private headers.
1671
1672         * inspector/InspectorController.cpp:
1673         (WebCore::InspectorController::InspectorController):
1674         (WebCore::InspectorController::setInspectorFrontendClient):
1675         (WebCore::InspectorController::hasInspectorFrontendClient):
1676         (WebCore::InspectorController::show):
1677         * inspector/InspectorController.h:
1678         Make InspectorFrontendClient a pointer instead of a std::unique_ptr.
1679         This makes it easier to implement InspectorFrontendClient as
1680         part of an existing object that is externally owned.
1681
1682         * testing/Internals.cpp:
1683         (WebCore::Internals::openDummyInspectorFrontend):
1684         (WebCore::Internals::closeDummyInspectorFrontend):
1685         * testing/Internals.h:
1686         Change InspectorFrontendClientDummy from being moved to owned.
1687
1688 2014-09-23  Dean Jackson  <dino@apple.com>
1689
1690         [Yosemite] Button text doesn't go white while pushing the button, like it does for real buttons
1691         https://bugs.webkit.org/show_bug.cgi?id=137054
1692         rdar://problem/17559038
1693
1694         Reviewed by Sam Weinig.
1695
1696         On Yosemite and above, system buttons paint with white-ish text when they
1697         are pressed. Since this isn't exposed by API, I've hardcoded the value
1698         into RenderThemeMac.
1699
1700         The actual state is exposed by adding a :active rule to html.css that
1701         uses a new CSSValueKeyword: ActiveButtonText.
1702
1703         Unfortunately I can't find a way to test this, because the active state isn't
1704         testable. We should really expose the Inspector's forcePseudoState function into
1705         window.internals.
1706
1707         * css/CSSValueKeywords.in: Add "activebuttontext".
1708         * css/html.css:
1709         (input[type="button"]:active, input[type="submit"]:active, input[type="reset"]:active, input[type="file"]::-webkit-file-upload-button:active, button:active): New rule for active
1710         button elements.
1711         * rendering/RenderTheme.cpp:
1712         (WebCore::RenderTheme::systemColor): Handle CSSValueActivebuttontext as black.
1713         * rendering/RenderThemeMac.mm:
1714         (WebCore::RenderThemeMac::systemColor): Handle CSSValueActivebuttontext as
1715         white with 75% opacity.
1716
1717 2014-09-24  Christophe Dumez  <cdumez@apple.com>
1718
1719         Use is<SVG*Element>() instead of isSVG*Element()
1720         https://bugs.webkit.org/show_bug.cgi?id=137058
1721
1722         Reviewed by Dirk Schulze.
1723
1724         Use is<SVG*Element>() instead of isSVG*Element() and drop support for
1725         generated isSVG*Element().
1726
1727         No new tests, no behavior change.
1728
1729         * css/CSSCursorImageValue.cpp:
1730         (WebCore::resourceReferencedByCursorElement):
1731         * css/StyleResolver.cpp:
1732         (WebCore::StyleResolver::useSVGZoomRulesForLength):
1733         * dom/DocumentStyleSheetCollection.cpp:
1734         (WebCore::DocumentStyleSheetCollection::collectActiveStyleSheets):
1735         * dom/ScriptElement.cpp:
1736         (WebCore::toScriptElementIfPossible):
1737         * dom/make_names.pl:
1738         (printTypeHelpers):
1739         * editing/gtk/EditorGtk.cpp:
1740         (WebCore::elementURL):
1741         * rendering/HitTestResult.cpp:
1742         (WebCore::HitTestResult::absoluteImageURL):
1743         (WebCore::HitTestResult::isLiveLink):
1744         * rendering/svg/RenderSVGEllipse.cpp:
1745         (WebCore::RenderSVGEllipse::calculateRadiiAndCenter):
1746         * rendering/svg/RenderSVGTransformableContainer.cpp:
1747         (WebCore::RenderSVGTransformableContainer::calculateLocalTransform):
1748         * rendering/svg/SVGPathData.cpp:
1749         (WebCore::updatePathFromCircleElement):
1750         * rendering/svg/SVGRenderTreeAsText.cpp:
1751         (WebCore::operator<<):
1752         * rendering/svg/SVGResources.cpp:
1753         (WebCore::targetReferenceFromResource):
1754         * svg/SVGAltGlyphDefElement.cpp:
1755         (WebCore::SVGAltGlyphDefElement::hasValidGlyphElements):
1756         * svg/SVGAltGlyphElement.cpp:
1757         (WebCore::SVGAltGlyphElement::hasValidGlyphElements):
1758         * svg/SVGAnimateMotionElement.cpp:
1759         (WebCore::SVGAnimateMotionElement::hasValidAttributeType):
1760         * svg/SVGDocument.cpp:
1761         (WebCore::SVGDocument::rootElement):
1762         * svg/SVGElement.cpp:
1763         (WebCore::SVGElement::isOutermostSVGSVGElement):
1764         (WebCore::SVGElement::ownerSVGElement):
1765         (WebCore::SVGElement::viewportElement):
1766         * svg/SVGFEComponentTransferElement.cpp:
1767         (WebCore::SVGFEComponentTransferElement::build):
1768         * svg/SVGFELightElement.cpp:
1769         (WebCore::SVGFELightElement::findLightElement):
1770         * svg/SVGFontData.cpp:
1771         (WebCore::SVGFontData::applySVGGlyphSelection):
1772         * svg/SVGFontElement.cpp:
1773         (WebCore::SVGFontElement::ensureGlyphCache):
1774         * svg/SVGFontFaceElement.cpp:
1775         (WebCore::SVGFontFaceElement::associatedFontElement):
1776         (WebCore::SVGFontFaceElement::rebuildFontFace):
1777         * svg/SVGFontFaceSrcElement.cpp:
1778         (WebCore::SVGFontFaceSrcElement::srcValue):
1779         (WebCore::SVGFontFaceSrcElement::childrenChanged):
1780         * svg/SVGGlyphElement.cpp:
1781         (WebCore::SVGGlyphElement::invalidateGlyphCache):
1782         * svg/SVGHKernElement.cpp:
1783         (WebCore::SVGHKernElement::insertedInto):
1784         (WebCore::SVGHKernElement::removedFrom):
1785         * svg/SVGLengthContext.cpp:
1786         (WebCore::SVGLengthContext::determineViewport):
1787         * svg/SVGLocatable.cpp:
1788         (WebCore::isViewportElement):
1789         * svg/SVGMPathElement.cpp:
1790         (WebCore::SVGMPathElement::pathElement):
1791         (WebCore::SVGMPathElement::notifyParentOfPathChange):
1792         * svg/SVGPathElement.cpp:
1793         (WebCore::SVGPathElement::invalidateMPathDependencies):
1794         * svg/SVGPatternElement.cpp:
1795         (WebCore::SVGPatternElement::collectPatternAttributes):
1796         * svg/SVGSVGElement.cpp:
1797         (WebCore::SVGSVGElement::setupInitialView):
1798         * svg/SVGUseElement.cpp:
1799         (WebCore::dumpInstanceTree):
1800         (WebCore::SVGUseElement::expandUseElementsInShadowTree):
1801         * svg/SVGVKernElement.cpp:
1802         (WebCore::SVGVKernElement::insertedInto):
1803         (WebCore::SVGVKernElement::removedFrom):
1804
1805 2014-09-24  Benjamin Poulain  <bpoulain@apple.com>
1806
1807         Remove the style marking from :nth-child()
1808         https://bugs.webkit.org/show_bug.cgi?id=137055
1809
1810         Reviewed by Andreas Kling.
1811
1812         Previously, :nth-child() had to mark the RenderStyle as unique in order
1813         to prevent it from being used for style sharing.
1814
1815         After r173229, :nth-child() use the more generic element marking
1816         "StyleIsAffectedByPreviousSibling".
1817
1818         In StyleResolver::canShareStyleWithElement(), StyleIsAffectedByPreviousSibling
1819         is already used to prevent style sharing of those elements, making the "Unique"
1820         flag redundant.
1821
1822         Since it is now useless, remove the style marking from SelectorChecker and the CSS JIT.
1823
1824         Tests: fast/css/nth-child-style-sharing-even.html
1825                fast/css/nth-child-style-sharing-fixed-integer.html
1826                fast/css/nth-child-style-sharing-odd.html
1827
1828         * css/SelectorChecker.cpp:
1829         (WebCore::SelectorChecker::checkOne):
1830         * cssjit/SelectorCompiler.cpp:
1831         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChild):
1832         (WebCore::SelectorCompiler::setElementChildIndexAndUpdateStyle): Deleted.
1833         * rendering/style/RenderStyle.h:
1834
1835 2014-09-23  Chris Dumez  <cdumez@apple.com>
1836
1837         Add support for is<HTML*Element>() for type checking
1838         https://bugs.webkit.org/show_bug.cgi?id=137015
1839
1840         Reviewed by Benjamin Poulain.
1841
1842         Add support for is<HTML*Element>() for type checking while keeping
1843         support for the legacy toHTML*Element() form until the code base is
1844         ported.
1845
1846         toHTML*Element() helpers are now macros to the new is<HTML*Element>()
1847         type checking helpers.
1848
1849         No new tests, no behavior change.
1850
1851         * dom/Document.cpp:
1852         (WebCore::Document::setTitle):
1853         * dom/Element.cpp:
1854         (WebCore::Element::childShouldCreateRenderer):
1855         * dom/Element.h:
1856         (WebCore::is):
1857         (WebCore::downcast):
1858         (WebCore::isElementOfType): Deleted.
1859         * dom/ElementAncestorIterator.h:
1860         (WebCore::lineageOfType):
1861         * dom/ElementIterator.h:
1862         (WebCore::findElementAncestorOfType):
1863         * dom/ElementTraversal.h:
1864         (WebCore::Traversal<ElementType>::firstChildTemplate):
1865         (WebCore::Traversal<ElementType>::lastChildTemplate):
1866         (WebCore::Traversal<ElementType>::firstWithinTemplate):
1867         (WebCore::Traversal<ElementType>::lastWithinTemplate):
1868         (WebCore::Traversal<ElementType>::nextTemplate):
1869         (WebCore::Traversal<ElementType>::previous):
1870         (WebCore::Traversal<ElementType>::nextSibling):
1871         (WebCore::Traversal<ElementType>::previousSibling):
1872         (WebCore::Traversal<ElementType>::nextSkippingChildren):
1873         * dom/TypedElementDescendantIterator.h:
1874         (WebCore::TypedElementDescendantIteratorAdapter<ElementType>::from):
1875         (WebCore::TypedElementDescendantConstIteratorAdapter<ElementType>::from):
1876         * dom/make_names.pl:
1877         (printTypeHelpers):
1878
1879 2014-09-23  Benjamin Poulain  <bpoulain@apple.com>
1880
1881         The style resolution cache applies properties incorrectly whenever direction != ltr
1882         https://bugs.webkit.org/show_bug.cgi?id=137052
1883
1884         Reviewed by Andreas Kling.
1885
1886         The optimization r135021 introduced a bug whenever the direction of subtree is not
1887         uniform in the whole page.
1888
1889         When StyleResolver::applyMatchedProperties() resolves the style, some properties are
1890         resolved differently based on the writing-mode and the direction.
1891
1892         In isCacheableInMatchedPropertiesCache(), the cases for writing-mode are already handled
1893         by not caching any style with anything else than the default.
1894         The direction was ignored, causing the bugs solved here.
1895
1896         Tests: css3/flexbox/flex-flow-2.html
1897                fast/css/style-resolver-cache-direction-1.html
1898                fast/css/style-resolver-cache-direction-2.html
1899                fast/css/style-resolver-cache-direction-3.html
1900
1901         * css/StyleResolver.cpp:
1902         (WebCore::isCacheableInMatchedPropertiesCache):
1903
1904 2014-09-23  Chris Dumez  <cdumez@apple.com>
1905
1906         Have CSS classes' methods return more references
1907         https://bugs.webkit.org/show_bug.cgi?id=137036
1908
1909         Reviewed by Ryosuke Niwa.
1910
1911         Have CSS classes' methods return more references instead of pointers
1912         when possible.
1913
1914         No new tests, no behavior change.
1915
1916         * css/CSSFontFaceRule.cpp:
1917         (WebCore::CSSFontFaceRule::style):
1918         * css/CSSFontFaceRule.h:
1919         * css/CSSGroupingRule.cpp:
1920         (WebCore::CSSGroupingRule::cssRules):
1921         * css/CSSGroupingRule.h:
1922         * css/CSSImportRule.cpp:
1923         (WebCore::CSSImportRule::media):
1924         * css/CSSImportRule.h:
1925         * css/CSSPageRule.cpp:
1926         (WebCore::CSSPageRule::style):
1927         * css/CSSPageRule.h:
1928         * css/CSSStyleRule.cpp:
1929         (WebCore::CSSStyleRule::style):
1930         * css/CSSStyleRule.h:
1931         * css/WebKitCSSKeyframeRule.cpp:
1932         (WebCore::WebKitCSSKeyframeRule::style):
1933         * css/WebKitCSSKeyframeRule.h:
1934         * css/WebKitCSSKeyframesRule.cpp:
1935         (WebCore::WebKitCSSKeyframesRule::cssRules):
1936         * css/WebKitCSSKeyframesRule.h:
1937         * css/WebKitCSSViewportRule.cpp:
1938         (WebCore::WebKitCSSViewportRule::style):
1939         * css/WebKitCSSViewportRule.h:
1940         * inspector/InspectorStyleSheet.cpp:
1941         (WebCore::asCSSRuleList):
1942         (WebCore::fillMediaListChain):
1943         (WebCore::InspectorStyleSheet::setRuleSelector):
1944         (WebCore::InspectorStyleSheet::deleteRule):
1945         (WebCore::InspectorStyleSheet::buildObjectForSelectorList):
1946         (WebCore::InspectorStyleSheet::buildObjectForRule):
1947         (WebCore::InspectorStyleSheet::styleForId):
1948         (WebCore::InspectorStyleSheet::ruleIndexByStyle):
1949         (WebCore::InspectorStyleSheet::ruleId):
1950         (WebCore::InspectorStyleSheet::revalidateStyle):
1951
1952 2014-09-23  Roger Fong  <roger_fong@apple.com>
1953
1954         [Windows] Enable CSS Supports Rule on Windows.
1955
1956         * css/CSSAllInOne.cpp:
1957
1958 2014-09-23  Christophe Dumez  <cdumez@apple.com>
1959
1960         Unreviewed build fix after r173893.
1961
1962         Partial revert of r173893 to fix debug builds.
1963
1964         * accessibility/AccessibilityNodeObject.cpp:
1965         (WebCore::AccessibilityNodeObject::text):
1966         * bindings/js/JSDOMWindowCustom.cpp:
1967         (WebCore::namedItemGetter):
1968         (WebCore::JSDOMWindow::getOwnPropertySlot):
1969         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
1970         * css/SelectorChecker.cpp:
1971         (WebCore::SelectorChecker::checkOne):
1972         * cssjit/SelectorCompiler.cpp:
1973         (WebCore::SelectorCompiler::makeContextStyleUniqueIfNecessaryAndTestIsPlaceholderShown):
1974         (WebCore::SelectorCompiler::makeElementStyleUniqueIfNecessaryAndTestIsPlaceholderShown):
1975         (WebCore::SelectorCompiler::isPlaceholderShown):
1976         * dom/Document.cpp:
1977         (WebCore::Document::processHttpEquiv):
1978         * dom/Element.cpp:
1979         (WebCore::Element::insertedInto):
1980         (WebCore::Element::removedFrom):
1981         (WebCore::Element::updateName):
1982         (WebCore::Element::updateId):
1983         * editing/Editor.cpp:
1984         (WebCore::Editor::selectionForCommand):
1985         (WebCore::findFirstMarkable):
1986         * editing/FrameSelection.cpp:
1987         (WebCore::FrameSelection::selectAll):
1988         * html/HTMLElement.cpp:
1989         (WebCore::HTMLElement::matchesReadWritePseudoClass):
1990         (WebCore::HTMLElement::directionality):
1991         * html/HTMLImageElement.cpp:
1992         (WebCore::HTMLImageElement::parseAttribute):
1993         * html/HTMLObjectElement.cpp:
1994         (WebCore::HTMLObjectElement::updateDocNamedItem):
1995         * html/HTMLPlugInImageElement.cpp:
1996         (WebCore::addPlugInsFromNodeListMatchingPlugInOrigin):
1997         * html/HTMLTextFormControlElement.cpp:
1998         (WebCore::enclosingTextFormControl):
1999         * page/FrameView.cpp:
2000         (WebCore::FrameView::addEmbeddedObjectToUpdate):
2001         (WebCore::FrameView::updateEmbeddedObject):
2002         * rendering/HitTestResult.cpp:
2003         (WebCore::HitTestResult::absolutePDFURL):
2004         * rendering/RenderEmbeddedObject.cpp:
2005         (WebCore::RenderEmbeddedObject::paintContents):
2006         (WebCore::RenderEmbeddedObject::layout):
2007         * rendering/RenderSnapshottedPlugIn.cpp:
2008         (WebCore::RenderSnapshottedPlugIn::plugInImageElement):
2009         * rendering/RenderTextControl.cpp:
2010         (WebCore::RenderTextControl::textFormControlElement):
2011         * rendering/RenderThemeMac.mm:
2012         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
2013         (WebCore::RenderThemeMac::paintSnapshottedPluginOverlay):
2014         * testing/Internals.cpp:
2015         (WebCore::Internals::visiblePlaceholder):
2016
2017 2014-09-22  Wenson Hsieh  <wenson_hsieh@apple.com>
2018
2019         Implement snapping behavior for Mac overflow scrolling
2020         https://bugs.webkit.org/show_bug.cgi?id=135774
2021
2022         Reviewed by Beth Dakin.
2023
2024         Hooks into AxisScrollSnapAnimator to implement overflow scroll snapping on Mac.
2025
2026         We need to find a way to test this!
2027
2028         * dom/Element.cpp:
2029         (WebCore::Element::dispatchWheelEvent):
2030         * page/EventHandler.cpp:
2031         (WebCore::handleWheelEventInAppropriateEnclosingBoxForSingleAxis):
2032         * platform/ScrollAnimator.cpp:
2033         (WebCore::ScrollAnimator::handleWheelEvent):
2034         (WebCore::ScrollAnimator::updateScrollAnimatorsAndTimers):
2035         (WebCore::ScrollAnimator::scrollOffsetInAxis):
2036         (WebCore::ScrollAnimator::immediateScrollInAxis):
2037         (WebCore::ScrollAnimator::startScrollSnapTimer):
2038         (WebCore::ScrollAnimator::stopScrollSnapTimer):
2039         (WebCore::ScrollAnimator::horizontalScrollSnapTimerFired):
2040         (WebCore::ScrollAnimator::verticalScrollSnapTimerFired):
2041         * platform/ScrollAnimator.h:
2042         * platform/mac/AxisScrollSnapAnimator.h:
2043         * platform/mac/AxisScrollSnapAnimator.mm:
2044         (WebCore::AxisScrollSnapAnimator::AxisScrollSnapAnimator):
2045         (WebCore::AxisScrollSnapAnimator::beginScrollSnapAnimation):
2046         (WebCore::AxisScrollSnapAnimator::endScrollSnapAnimation):
2047         (WebCore::AxisScrollSnapAnimator::initializeGlideParameters):
2048         * rendering/RenderLayer.cpp:
2049         (WebCore::RenderLayer::updateScrollInfoAfterLayout):
2050
2051 2014-09-23  Chris Dumez  <cdumez@apple.com>
2052
2053         Use downcast<HTML*Element>() instead of toHTML*Element()
2054         https://bugs.webkit.org/show_bug.cgi?id=137007
2055
2056         Reviewed by Benjamin Poulain.
2057
2058         Use downcast<HTML*Element>() instead of toHTML*Element() and drop
2059         transition macros for toHTML*Element().
2060
2061         This patch also cleans up the surrounding code.
2062
2063         No new tests, no behavior change.
2064
2065         * accessibility/AXObjectCache.cpp:
2066         (WebCore::AXObjectCache::focusedUIElementForPage):
2067         (WebCore::AXObjectCache::labelChanged):
2068         * accessibility/AccessibilityListBox.cpp:
2069         (WebCore::AccessibilityListBox::canSetSelectedChildrenAttribute):
2070         (WebCore::AccessibilityListBox::addChildren):
2071         * accessibility/AccessibilityListBoxOption.cpp:
2072         (WebCore::AccessibilityListBoxOption::isSelected):
2073         (WebCore::AccessibilityListBoxOption::stringValue):
2074         (WebCore::AccessibilityListBoxOption::listBoxOptionParentNode):
2075         * accessibility/AccessibilityMediaControls.cpp:
2076         (WebCore::AccessibilityMediaTimeline::valueDescription):
2077         * accessibility/AccessibilityMenuListOption.cpp:
2078         (WebCore::AccessibilityMenuListOption::isEnabled):
2079         (WebCore::AccessibilityMenuListOption::isSelected):
2080         (WebCore::AccessibilityMenuListOption::setSelected):
2081         (WebCore::AccessibilityMenuListOption::stringValue):
2082         * accessibility/AccessibilityMenuListPopup.cpp:
2083         (WebCore::AccessibilityMenuListPopup::addChildren):
2084         * accessibility/AccessibilityNodeObject.cpp:
2085         (WebCore::AccessibilityNodeObject::determineAccessibilityRole):
2086         (WebCore::AccessibilityNodeObject::isNativeTextControl):
2087         (WebCore::AccessibilityNodeObject::isNativeImage):
2088         (WebCore::AccessibilityNodeObject::isInputImage):
2089         (WebCore::AccessibilityNodeObject::isMultiSelectable):
2090         (WebCore::AccessibilityNodeObject::isReadOnly):
2091         (WebCore::AccessibilityNodeObject::valueForRange):
2092         (WebCore::AccessibilityNodeObject::maxValueForRange):
2093         (WebCore::AccessibilityNodeObject::minValueForRange):
2094         (WebCore::isNodeActionElement):
2095         (WebCore::AccessibilityNodeObject::alternativeText):
2096         (WebCore::AccessibilityNodeObject::visibleText):
2097         (WebCore::AccessibilityNodeObject::title):
2098         (WebCore::AccessibilityNodeObject::text):
2099         (WebCore::AccessibilityNodeObject::stringValue):
2100         (WebCore::AccessibilityNodeObject::colorValue):
2101         (WebCore::accessibleNameForNode):
2102         * accessibility/AccessibilityRenderObject.cpp:
2103         (WebCore::AccessibilityRenderObject::isFileUploadButton):
2104         (WebCore::AccessibilityRenderObject::stringValue):
2105         (WebCore::AccessibilityRenderObject::labelElementContainer):
2106         (WebCore::AccessibilityRenderObject::internalLinkElement):
2107         (WebCore::AccessibilityRenderObject::addRadioButtonGroupMembers):
2108         (WebCore::AccessibilityRenderObject::url):
2109         (WebCore::AccessibilityRenderObject::setValue):
2110         (WebCore::AccessibilityRenderObject::getDocumentLinks):
2111         (WebCore::AccessibilityRenderObject::accessibilityImageMapHitTest):
2112         (WebCore::AccessibilityRenderObject::accessibilityHitTest):
2113         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
2114         (WebCore::AccessibilityRenderObject::addTextFieldChildren):
2115         (WebCore::AccessibilityRenderObject::stringValueForMSAA):
2116         (WebCore::AccessibilityRenderObject::isLinked):
2117         * accessibility/AccessibilitySlider.cpp:
2118         (WebCore::AccessibilitySlider::inputElement):
2119         (WebCore::AccessibilitySliderThumb::elementRect):
2120         * accessibility/AccessibilityTable.cpp:
2121         (WebCore::AccessibilityTable::tableElement):
2122         (WebCore::AccessibilityTable::title):
2123         * accessibility/atk/AXObjectCacheAtk.cpp:
2124         (WebCore::notifyChildrenSelectionChange):
2125         * accessibility/atk/WebKitAccessibleInterfaceSelection.cpp:
2126         (optionFromSelection):
2127         (webkitAccessibleSelectionGetSelectionCount):
2128         * accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
2129         (webkitAccessibleTableGetCaption):
2130         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2131         (webkitAccessibleGetDescription):
2132         * accessibility/ios/AccessibilityObjectIOS.mm:
2133         (WebCore::AccessibilityObject::accessibilityPasswordFieldLength):
2134         * bindings/js/JSDOMWindowCustom.cpp:
2135         (WebCore::namedItemGetter):
2136         (WebCore::JSDOMWindow::getOwnPropertySlot):
2137         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
2138         * bindings/js/JSHTMLDocumentCustom.cpp:
2139         (WebCore::JSHTMLDocument::nameGetter):
2140         * bindings/js/JSHTMLFrameSetElementCustom.cpp:
2141         (WebCore::JSHTMLFrameSetElement::nameGetter):
2142         * bindings/js/JSNodeCustom.cpp:
2143         (WebCore::isReachableFromDOM):
2144         * css/SelectorChecker.cpp:
2145         (WebCore::SelectorChecker::checkOne):
2146         * css/SelectorCheckerTestFunctions.h:
2147         (WebCore::isChecked):
2148         * css/StyleResolver.cpp:
2149         (WebCore::StyleResolver::adjustRenderStyle):
2150         * css/StyleSheetList.cpp:
2151         (WebCore::StyleSheetList::getNamedItem):
2152         * cssjit/SelectorCompiler.cpp:
2153         (WebCore::SelectorCompiler::makeContextStyleUniqueIfNecessaryAndTestIsPlaceholderShown):
2154         (WebCore::SelectorCompiler::makeElementStyleUniqueIfNecessaryAndTestIsPlaceholderShown):
2155         (WebCore::SelectorCompiler::isPlaceholderShown):
2156         * dom/CurrentScriptIncrementer.h:
2157         (WebCore::CurrentScriptIncrementer::CurrentScriptIncrementer):
2158         * dom/DataTransfer.cpp:
2159         (WebCore::DataTransfer::setDragImage):
2160         * dom/Document.cpp:
2161         (WebCore::Document::setTitle):
2162         (WebCore::Document::processHttpEquiv):
2163         (WebCore::Document::iconURLs):
2164         * dom/DocumentOrderedMap.cpp:
2165         (WebCore::keyMatchesMapName):
2166         (WebCore::keyMatchesLowercasedMapName):
2167         (WebCore::keyMatchesLowercasedUsemap):
2168         (WebCore::DocumentOrderedMap::getElementByMapName):
2169         (WebCore::DocumentOrderedMap::getElementByLowercasedMapName):
2170         (WebCore::DocumentOrderedMap::getElementByLowercasedUsemap):
2171         (WebCore::DocumentOrderedMap::getElementByLabelForAttribute):
2172         * dom/DocumentStyleSheetCollection.cpp:
2173         (WebCore::DocumentStyleSheetCollection::collectActiveStyleSheets):
2174         * dom/Element.cpp:
2175         (WebCore::Element::insertedInto):
2176         (WebCore::Element::removedFrom):
2177         (WebCore::Element::updateName):
2178         (WebCore::Element::updateId):
2179         (WebCore::Element::updateLabel):
2180         (WebCore::Element::ensureCachedHTMLCollection):
2181         * dom/EventDispatcher.cpp:
2182         (WebCore::EventDispatcher::dispatchEvent):
2183         * dom/ScriptElement.cpp:
2184         (WebCore::toScriptElementIfPossible):
2185         * dom/VisitedLinkState.cpp:
2186         (WebCore::linkHashForElement):
2187         (WebCore::VisitedLinkState::determineLinkStateSlowCase):
2188         * dom/make_names.pl:
2189         (printTypeHelpers):
2190         * editing/Editor.cpp:
2191         (WebCore::Editor::selectionForCommand):
2192         (WebCore::imageElementFromImageDocument):
2193         (WebCore::findFirstMarkable):
2194         * editing/FrameSelection.cpp:
2195         (WebCore::FrameSelection::selectAll):
2196         (WebCore::scanForForm):
2197         * editing/MarkupAccumulator.cpp:
2198         (WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
2199         * editing/ReplaceSelectionCommand.cpp:
2200         (WebCore::ReplaceSelectionCommand::shouldPerformSmartReplace):
2201         * editing/VisibleSelection.cpp:
2202         (WebCore::VisibleSelection::nonBoundaryShadowTreeRootNode):
2203         (WebCore::VisibleSelection::isInPasswordField):
2204         * editing/cocoa/HTMLConverter.mm:
2205         (HTMLConverter::_processElement):
2206         * editing/ios/EditorIOS.mm:
2207         (WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection):
2208         * editing/markup.cpp:
2209         (WebCore::isPlainTextMarkup):
2210         * html/ColorInputType.cpp:
2211         (WebCore::ColorInputType::suggestions):
2212         * html/FTPDirectoryDocument.cpp:
2213         (WebCore::FTPDirectoryDocumentParser::loadDocumentTemplate):
2214         (WebCore::FTPDirectoryDocumentParser::createBasicDocument):
2215         * html/FormAssociatedElement.cpp:
2216         (WebCore::FormAssociatedElement::findAssociatedForm):
2217         * html/HTMLAnchorElement.cpp:
2218         (WebCore::appendServerMapMousePosition):
2219         * html/HTMLAreaElement.cpp:
2220         (WebCore::HTMLAreaElement::imageElement):
2221         * html/HTMLCollection.cpp:
2222         (WebCore::isMatchingElement):
2223         * html/HTMLElement.cpp:
2224         (WebCore::HTMLElement::matchesReadWritePseudoClass):
2225         (WebCore::HTMLElement::setInnerHTML):
2226         (WebCore::HTMLElement::directionality):
2227         * html/HTMLEmbedElement.cpp:
2228         (WebCore::HTMLEmbedElement::rendererIsNeeded):
2229         * html/HTMLFieldSetElement.cpp:
2230         (WebCore::HTMLFieldSetElement::refreshElementsIfNeeded):
2231         * html/HTMLFormControlElement.cpp:
2232         (WebCore::HTMLFormControlElement::computeIsDisabledByFieldsetAncestor):
2233         (WebCore::shouldAutofocus):
2234         * html/HTMLFormControlsCollection.cpp:
2235         (WebCore::HTMLFormControlsCollection::formControlElements):
2236         (WebCore::HTMLFormControlsCollection::formImageElements):
2237         * html/HTMLFormElement.cpp:
2238         (WebCore::HTMLFormElement::getTextFieldValues):
2239         (WebCore::HTMLFormElement::assertItemCanBeInPastNamesMap):
2240         * html/HTMLImageElement.cpp:
2241         (WebCore::HTMLImageElement::parseAttribute):
2242         * html/HTMLImageLoader.cpp:
2243         (WebCore::HTMLImageLoader::notifyFinished):
2244         * html/HTMLInputElement.cpp:
2245         (WebCore::HTMLInputElement::dataList):
2246         (WebCore::HTMLInputElement::setupDateTimeChooserParameters):
2247         * html/HTMLKeygenElement.cpp:
2248         (WebCore::HTMLKeygenElement::shadowSelect):
2249         * html/HTMLLegendElement.cpp:
2250         (WebCore::HTMLLegendElement::virtualForm):
2251         * html/HTMLMediaElement.cpp:
2252         (WebCore::HTMLMediaElement::parseAttribute):
2253         * html/HTMLNameCollection.cpp:
2254         (WebCore::DocumentNameCollection::elementMatchesIfIdAttributeMatch):
2255         (WebCore::DocumentNameCollection::elementMatchesIfNameAttributeMatch):
2256         (WebCore::DocumentNameCollection::elementMatches):
2257         * html/HTMLObjectElement.cpp:
2258         (WebCore::HTMLObjectElement::updateDocNamedItem):
2259         (WebCore::HTMLObjectElement::containsJavaApplet):
2260         * html/HTMLOptGroupElement.cpp:
2261         (WebCore::HTMLOptGroupElement::recalcSelectOptions):
2262         (WebCore::HTMLOptGroupElement::ownerSelectElement):
2263         * html/HTMLOptionElement.cpp:
2264         (WebCore::HTMLOptionElement::ownerDataListElement):
2265         (WebCore::HTMLOptionElement::ownerSelectElement):
2266         * html/HTMLOptionsCollection.cpp:
2267         (WebCore::HTMLOptionsCollection::add):
2268         * html/HTMLOptionsCollection.h:
2269         * html/HTMLPlugInImageElement.cpp:
2270         (WebCore::addPlugInsFromNodeListMatchingPlugInOrigin):
2271         * html/HTMLSelectElement.cpp:
2272         (WebCore::HTMLSelectElement::hasPlaceholderLabelOption):
2273         (WebCore::HTMLSelectElement::value):
2274         (WebCore::HTMLSelectElement::setValue):
2275         (WebCore::HTMLSelectElement::saveLastSelection):
2276         (WebCore::HTMLSelectElement::setActiveSelectionAnchorIndex):
2277         (WebCore::HTMLSelectElement::updateListBoxSelection):
2278         (WebCore::HTMLSelectElement::listBoxOnChange):
2279         (WebCore::HTMLSelectElement::recalcListItems):
2280         (WebCore::HTMLSelectElement::selectedIndex):
2281         (WebCore::HTMLSelectElement::selectOption):
2282         (WebCore::HTMLSelectElement::deselectItemsWithoutValidation):
2283         (WebCore::HTMLSelectElement::saveFormControlState):
2284         (WebCore::HTMLSelectElement::searchOptionsForValue):
2285         (WebCore::HTMLSelectElement::restoreFormControlState):
2286         (WebCore::HTMLSelectElement::appendFormData):
2287         (WebCore::HTMLSelectElement::reset):
2288         (WebCore::HTMLSelectElement::updateSelectedState):
2289         (WebCore::HTMLSelectElement::lastSelectedListIndex):
2290         (WebCore::HTMLSelectElement::optionAtIndex):
2291         (WebCore::HTMLSelectElement::accessKeySetSelectedIndex):
2292         * html/HTMLSummaryElement.cpp:
2293         (WebCore::HTMLSummaryElement::detailsElement):
2294         * html/HTMLTableElement.cpp:
2295         (WebCore::HTMLTableElement::caption):
2296         * html/HTMLTablePartElement.cpp:
2297         (WebCore::HTMLTablePartElement::findParentTable):
2298         * html/HTMLTableRowElement.cpp:
2299         (WebCore::HTMLTableRowElement::rowIndex):
2300         * html/HTMLTableRowsCollection.cpp:
2301         (WebCore::HTMLTableRowsCollection::rowAfter):
2302         (WebCore::HTMLTableRowsCollection::lastRow):
2303         (WebCore::HTMLTableRowsCollection::customElementAfter):
2304         * html/HTMLTableRowsCollection.h:
2305         * html/HTMLTemplateElement.cpp:
2306         (WebCore::HTMLTemplateElement::cloneNode):
2307         * html/HTMLTextFormControlElement.cpp:
2308         (WebCore::enclosingTextFormControl):
2309         * html/ImageDocument.cpp:
2310         (WebCore::ImageDocument::createDocumentStructure):
2311         * html/LabelsNodeList.cpp:
2312         (WebCore::LabelsNodeList::elementMatches):
2313         * html/MediaDocument.cpp:
2314         (WebCore::MediaDocumentParser::createDocumentStructure):
2315         (WebCore::descendentVideoElement):
2316         (WebCore::ancestorVideoElement):
2317         (WebCore::MediaDocument::replaceMediaElementTimerFired):
2318         * html/PluginDocument.cpp:
2319         (WebCore::PluginDocumentParser::createDocumentStructure):
2320         * html/RadioInputType.cpp:
2321         (WebCore::RadioInputType::handleKeydownEvent):
2322         (WebCore::RadioInputType::isKeyboardFocusable):
2323         * html/RadioNodeList.cpp:
2324         (WebCore::RadioNodeList::checkElementMatchesRadioNodeListFilter):
2325         * html/RangeInputType.cpp:
2326         (WebCore::RangeInputType::updateTickMarkValues):
2327         * html/parser/HTMLConstructionSite.cpp:
2328         (WebCore::insert):
2329         (WebCore::HTMLConstructionSite::insertTextNode):
2330         (WebCore::HTMLConstructionSite::ownerDocumentForCurrentNode):
2331         * html/parser/HTMLTreeBuilder.cpp:
2332         (WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
2333         * html/shadow/DetailsMarkerControl.cpp:
2334         (WebCore::DetailsMarkerControl::rendererIsNeeded):
2335         * html/shadow/MediaControlElements.cpp:
2336         (WebCore::MediaControlTextTrackContainerElement::updateDisplay):
2337         * html/shadow/MeterShadowElement.cpp:
2338         (WebCore::MeterShadowElement::meterElement):
2339         * html/shadow/ProgressShadowElement.cpp:
2340         (WebCore::ProgressShadowElement::progressElement):
2341         * html/shadow/TextControlInnerElements.cpp:
2342         (WebCore::SearchFieldResultsButtonElement::defaultEventHandler):
2343         (WebCore::SearchFieldCancelButtonElement::defaultEventHandler):
2344         (WebCore::SearchFieldCancelButtonElement::willRespondToMouseClickEvents):
2345         * inspector/InspectorCSSAgent.cpp:
2346         (WebCore::InspectorCSSAgent::viaInspectorStyleSheet):
2347         * inspector/InspectorDOMAgent.cpp:
2348         (WebCore::InspectorDOMAgent::buildObjectForNode):
2349         * loader/FormSubmission.cpp:
2350         (WebCore::FormSubmission::create):
2351         * loader/FrameLoader.cpp:
2352         (WebCore::FrameLoader::handleFallbackContent):
2353         * loader/ImageLoader.cpp:
2354         (WebCore::ImageLoader::dispatchPendingBeforeLoadEvent):
2355         * loader/SubframeLoader.cpp:
2356         (WebCore::SubframeLoader::requestObject):
2357         * page/Chrome.cpp:
2358         (WebCore::Chrome::setToolTip):
2359         * page/DragController.cpp:
2360         (WebCore::DragController::draggableElement):
2361         * page/EventHandler.cpp:
2362         (WebCore::isSubmitImage):
2363         * page/FocusController.cpp:
2364         (WebCore::FocusController::advanceFocusDirectionally):
2365         * page/FrameView.cpp:
2366         (WebCore::FrameView::addEmbeddedObjectToUpdate):
2367         (WebCore::FrameView::updateEmbeddedObject):
2368         * page/PageSerializer.cpp:
2369         (WebCore::PageSerializer::serializeFrame):
2370         * page/SpatialNavigation.cpp:
2371         (WebCore::FocusCandidate::FocusCandidate):
2372         * page/ios/FrameIOS.mm:
2373         (WebCore::ancestorRespondingToClickEvents):
2374         * rendering/HitTestResult.cpp:
2375         (WebCore::HitTestResult::altDisplayString):
2376         (WebCore::HitTestResult::absolutePDFURL):
2377         (WebCore::HitTestResult::enterFullscreenForVideo):
2378         (WebCore::HitTestResult::mediaControlsEnabled):
2379         (WebCore::HitTestResult::isLiveLink):
2380         (WebCore::HitTestResult::isContentEditable):
2381         * rendering/RenderButton.cpp:
2382         (WebCore::RenderButton::updateFromElement):
2383         * rendering/RenderCounter.cpp:
2384         (WebCore::planCounter):
2385         * rendering/RenderEmbeddedObject.cpp:
2386         (WebCore::RenderEmbeddedObject::paintContents):
2387         (WebCore::RenderEmbeddedObject::layout):
2388         * rendering/RenderFieldset.h:
2389         * rendering/RenderFileUploadControl.cpp:
2390         (WebCore::RenderFileUploadControl::inputElement):
2391         (WebCore::RenderFileUploadControl::uploadButton):
2392         * rendering/RenderFrame.cpp:
2393         (WebCore::RenderFrame::frameElement):
2394         * rendering/RenderFrameSet.cpp:
2395         (WebCore::RenderFrameSet::frameSetElement):
2396         * rendering/RenderHTMLCanvas.cpp:
2397         (WebCore::RenderHTMLCanvas::canvasElement):
2398         * rendering/RenderIFrame.cpp:
2399         (WebCore::RenderIFrame::iframeElement):
2400         * rendering/RenderImage.cpp:
2401         (WebCore::RenderImage::RenderImage):
2402         (WebCore::RenderImage::paintAreaElementFocusRing):
2403         (WebCore::RenderImage::paintIntoRect):
2404         (WebCore::RenderImage::imageMap):
2405         (WebCore::RenderImage::updateAltText):
2406         * rendering/RenderLayerBacking.cpp:
2407         (WebCore::canvasCompositingStrategy):
2408         (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
2409         (WebCore::RenderLayerBacking::updateConfiguration):
2410         * rendering/RenderLayerCompositor.cpp:
2411         (WebCore::RenderLayerCompositor::requiresCompositingForCanvas):
2412         * rendering/RenderListBox.cpp:
2413         (WebCore::RenderListBox::selectElement):
2414         (WebCore::RenderListBox::updateFromElement):
2415         (WebCore::RenderListBox::paintItemForeground):
2416         (WebCore::RenderListBox::paintItemBackground):
2417         * rendering/RenderListItem.cpp:
2418         (WebCore::RenderListItem::calcValue):
2419         (WebCore::RenderListItem::updateListMarkerNumbers):
2420         * rendering/RenderMarquee.cpp:
2421         (WebCore::RenderMarquee::marqueeSpeed):
2422         * rendering/RenderMenuList.cpp:
2423         (WebCore::selectedOptionCount):
2424         (RenderMenuList::selectElement):
2425         (RenderMenuList::updateOptionsWidth):
2426         (RenderMenuList::setTextFromOption):
2427         (RenderMenuList::itemText):
2428         (RenderMenuList::itemIsSelected):
2429         * rendering/RenderMeter.cpp:
2430         (WebCore::RenderMeter::meterElement):
2431         * rendering/RenderProgress.cpp:
2432         (WebCore::RenderProgress::progressElement):
2433         * rendering/RenderSlider.cpp:
2434         (WebCore::RenderSlider::element):
2435         * rendering/RenderSnapshottedPlugIn.cpp:
2436         (WebCore::RenderSnapshottedPlugIn::plugInImageElement):
2437         * rendering/RenderTextControl.cpp:
2438         (WebCore::RenderTextControl::textFormControlElement):
2439         * rendering/RenderTextControlMultiLine.cpp:
2440         (WebCore::RenderTextControlMultiLine::textAreaElement):
2441         * rendering/RenderTextControlSingleLine.cpp:
2442         (WebCore::RenderTextControlSingleLine::inputElement):
2443         * rendering/RenderTheme.cpp:
2444         (WebCore::RenderTheme::paintSliderTicks):
2445         * rendering/RenderThemeIOS.mm:
2446         (WebCore::RenderThemeIOS::paintMenuListButtonDecorations):
2447         * rendering/RenderThemeMac.mm:
2448         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
2449         (WebCore::RenderThemeMac::paintSnapshottedPluginOverlay):
2450         * rendering/RenderVideo.cpp:
2451         (WebCore::RenderVideo::videoElement):
2452         * svg/graphics/SVGImageCache.cpp:
2453         (WebCore::SVGImageCache::imageForRenderer):
2454         * svg/svgtags.in:
2455         Generate helpers to SVGAElement so that isSVGAElement() can be used
2456         instead of hasTagName(SVGNames::aTag). I did such update in this
2457         patch.
2458
2459         * testing/Internals.cpp:
2460         (WebCore::Internals::visiblePlaceholder):
2461         (WebCore::Internals::wasLastChangeUserEdit):
2462         (WebCore::Internals::updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks):
2463         (WebCore::Internals::isSelectPopupVisible):
2464         * xml/parser/XMLDocumentParserLibxml2.cpp:
2465         (WebCore::XMLDocumentParser::startElementNs):
2466
2467 2014-09-23  Chris Dumez  <cdumez@apple.com>
2468
2469         Have DataTransfer::files() return a reference
2470         https://bugs.webkit.org/show_bug.cgi?id=137039
2471
2472         Reviewed by Ryosuke Niwa.
2473
2474         Have DataTransfer::files() return a reference instead of a pointer as
2475         it can never return null.
2476
2477         No new tests, no behavior change.
2478
2479         * dom/DataTransfer.cpp:
2480         (WebCore::DataTransfer::files):
2481         * dom/DataTransfer.h:
2482
2483 2014-09-23  Chris Dumez  <cdumez@apple.com>
2484
2485         Have NamedNodeMap::element() and DOMStringMap::element() return a reference
2486         https://bugs.webkit.org/show_bug.cgi?id=137040
2487
2488         Reviewed by Ryosuke Niwa.
2489
2490         Have NamedNodeMap::element() and DOMStringMap::element() return a
2491         reference instead of a pointer as they can never return null.
2492
2493         No new tests, no behavior change.
2494
2495         * dom/DatasetDOMStringMap.h:
2496         * dom/NamedNodeMap.h:
2497         (WebCore::NamedNodeMap::element):
2498
2499 2014-09-23  Chris Dumez  <cdumez@apple.com>
2500
2501         Have DOMImplementation::document() and Element::attributes() return references
2502         https://bugs.webkit.org/show_bug.cgi?id=137035
2503
2504         Reviewed by Andreas Kling.
2505
2506         Have DOMImplementation::document() and Element::attributes() return
2507         references instead of pointers as they can never return null.
2508
2509         No new tests, no behavior change.
2510
2511         * bindings/scripts/CodeGeneratorJS.pm:
2512         (GenerateImplementation):
2513         Update the JS Bindings code generator to use WTF::getPtr() in a couple
2514         more places so that the implementation can return references instead
2515         of pointers even when [GenerateIsReachable=xxx] IDL extended attribute
2516         is used.
2517
2518         * dom/DOMImplementation.h:
2519         (WebCore::DOMImplementation::document):
2520         * dom/Element.cpp:
2521         (WebCore::Element::attributes):
2522         * dom/Element.h:
2523         (WebCore::Node::attributes):
2524
2525 2014-09-23  Chris Dumez  <cdumez@apple.com>
2526
2527         Have Document::ensureTemplateDocument() return a reference
2528         https://bugs.webkit.org/show_bug.cgi?id=137033
2529
2530         Reviewed by Ryosuke Niwa.
2531
2532         Have Document::ensureTemplateDocument() return a reference instead of
2533         a pointer as it can never return null.
2534
2535         No new tests, no behavior change.
2536
2537         * dom/Document.cpp:
2538         (WebCore::Document::ensureTemplateDocument):
2539         * dom/Document.h:
2540         * editing/markup.cpp:
2541         (WebCore::createFragmentForInnerOuterHTML):
2542         * html/HTMLTemplateElement.cpp:
2543         (WebCore::HTMLTemplateElement::content):
2544         (WebCore::HTMLTemplateElement::didMoveToNewDocument):
2545
2546 2014-09-23  Chris Dumez  <cdumez@apple.com>
2547
2548         Have Document::accessSVGExtensions() return a reference
2549         https://bugs.webkit.org/show_bug.cgi?id=137030
2550
2551         Reviewed by Ryosuke Niwa.
2552
2553         Have Document::accessSVGExtensions() return a reference instead of a
2554         pointer as it can never return null.
2555
2556         No new tests, no behavior change.
2557
2558         * dom/ContainerNode.cpp:
2559         (WebCore::ContainerNode::removeChild):
2560         (WebCore::ContainerNode::removeChildren):
2561         * dom/Document.cpp:
2562         (WebCore::Document::commonTeardown):
2563         (WebCore::Document::implicitClose):
2564         (WebCore::Document::accessSVGExtensions):
2565         * dom/Document.h:
2566         * dom/Element.cpp:
2567         (WebCore::Element::~Element):
2568         (WebCore::Element::removedFrom):
2569         * editing/markup.cpp:
2570         (WebCore::isPlainTextMarkup):
2571         * history/CachedFrame.cpp:
2572         (WebCore::CachedFrameBase::restore):
2573         * rendering/FilterEffectRenderer.cpp:
2574         (WebCore::FilterEffectRenderer::buildReferenceFilter):
2575         * rendering/svg/RenderSVGResource.cpp:
2576         (WebCore::removeFromCacheAndInvalidateDependencies):
2577         * rendering/svg/RenderSVGResourceContainer.cpp:
2578         (WebCore::svgExtensionsFromElement):
2579         * rendering/svg/RenderSVGResourceContainer.h:
2580         (WebCore::getRenderSVGResourceContainerById):
2581         (WebCore::getRenderSVGResourceById):
2582         * rendering/svg/SVGResources.cpp:
2583         (WebCore::registerPendingResource):
2584         (WebCore::SVGResources::buildCachedResources):
2585         * rendering/svg/SVGResourcesCache.cpp:
2586         (WebCore::resourcesCacheFromRenderer):
2587         (WebCore::SVGResourcesCache::resourceDestroyed):
2588         * svg/SVGElement.cpp:
2589         (WebCore::SVGElement::~SVGElement):
2590         (WebCore::SVGElement::reportAttributeParsingError):
2591         (WebCore::SVGElement::removedFrom):
2592         (WebCore::SVGElement::viewportElement):
2593         (WebCore::SVGElement::attributeChanged):
2594         (WebCore::SVGElement::buildPendingResourcesIfNeeded):
2595         (WebCore::SVGElement::accessDocumentSVGExtensions): Deleted.
2596         * svg/SVGElement.h:
2597         * svg/SVGFEConvolveMatrixElement.cpp:
2598         (WebCore::SVGFEConvolveMatrixElement::parseAttribute):
2599         * svg/SVGFEGaussianBlurElement.cpp:
2600         (WebCore::SVGFEGaussianBlurElement::parseAttribute):
2601         * svg/SVGFEImageElement.cpp:
2602         (WebCore::SVGFEImageElement::clearResourceReferences):
2603         (WebCore::SVGFEImageElement::buildPendingResource):
2604         * svg/SVGFitToViewBox.cpp:
2605         (WebCore::SVGFitToViewBox::parseViewBox):
2606         * svg/SVGFontFaceElement.cpp:
2607         (WebCore::SVGFontFaceElement::insertedInto):
2608         (WebCore::SVGFontFaceElement::removedFrom):
2609         * svg/SVGMPathElement.cpp:
2610         (WebCore::SVGMPathElement::buildPendingResource):
2611         (WebCore::SVGMPathElement::clearResourceReferences):
2612         * svg/SVGPathElement.cpp:
2613         (WebCore::SVGPathElement::parseAttribute):
2614         (WebCore::SVGPathElement::invalidateMPathDependencies):
2615         * svg/SVGPolyElement.cpp:
2616         (WebCore::SVGPolyElement::parseAttribute):
2617         * svg/SVGSVGElement.cpp:
2618         (WebCore::SVGSVGElement::~SVGSVGElement):
2619         (WebCore::SVGSVGElement::insertedInto):
2620         (WebCore::SVGSVGElement::removedFrom):
2621         * svg/SVGTRefElement.cpp:
2622         (WebCore::SVGTRefElement::detachTarget):
2623         (WebCore::SVGTRefElement::buildPendingResource):
2624         * svg/SVGTextPathElement.cpp:
2625         (WebCore::SVGTextPathElement::clearResourceReferences):
2626         (WebCore::SVGTextPathElement::buildPendingResource):
2627         * svg/SVGUseElement.cpp:
2628         (WebCore::SVGUseElement::clearResourceReferences):
2629         (WebCore::SVGUseElement::buildPendingResource):
2630         (WebCore::SVGUseElement::toClipPath):
2631         (WebCore::SVGUseElement::buildInstanceTree):
2632         * svg/animation/SVGSMILElement.cpp:
2633         (WebCore::SVGSMILElement::clearResourceReferences):
2634         (WebCore::SVGSMILElement::buildPendingResource):
2635
2636 2014-09-23  Joseph Pecoraro  <pecoraro@apple.com>
2637
2638         Web Inspector: Should be able to attach a debugger to a JSContext before anything is executed
2639         https://bugs.webkit.org/show_bug.cgi?id=136893
2640
2641         Reviewed by Timothy Hatcher.
2642
2643         Automatic inspection is currently disabled for web pages.
2644         This just updates the interfaces that changed.
2645
2646         * WebCore.exp.in:
2647         * inspector/InspectorController.cpp:
2648         (WebCore::InspectorController::connectFrontend):
2649         (WebCore::InspectorController::show):
2650         * inspector/InspectorController.h:
2651         * page/PageDebuggable.cpp:
2652         (WebCore::PageDebuggable::connect):
2653         * page/PageDebuggable.h:
2654         * testing/Internals.cpp:
2655         (WebCore::Internals::openDummyInspectorFrontend):
2656
2657 2014-09-23  Eduardo Lima Mitev  <elima@igalia.com>
2658
2659         [GTK] Adds implementation of subtle crypto HMAC algorithm
2660         https://bugs.webkit.org/show_bug.cgi?id=133320
2661
2662         Reviewed by Philippe Normand.
2663
2664         Tests are already in place under crypto/subtle/hmac-*.html
2665
2666         * crypto/gtk/CryptoAlgorithmHMACGtk.cpp:
2667         (WebCore::getGnutlsDigestAlgorithm):
2668         (WebCore::calculateSignature):
2669         (WebCore::CryptoAlgorithmHMAC::platformSign):
2670         (WebCore::CryptoAlgorithmHMAC::platformVerify):
2671
2672 2014-09-23  Eduardo Lima Mitev  <elima@igalia.com>
2673
2674         [GTK] Adds implementation of Subtle Crypto digest algorithms
2675         https://bugs.webkit.org/show_bug.cgi?id=133319
2676
2677         Reviewed by Philippe Normand.
2678
2679         Tests are already in place under crypto/subtle/sha-*.html
2680
2681         * crypto/gtk/CryptoDigestGtk.cpp:
2682         (WebCore::CryptoDigest::CryptoDigest):
2683         (WebCore::CryptoDigest::~CryptoDigest):
2684         (WebCore::CryptoDigest::create):
2685         (WebCore::CryptoDigest::addBytes):
2686         (WebCore::CryptoDigest::computeHash):
2687
2688 2014-09-15  Sergio Villar Senin  <svillar@igalia.com>
2689
2690         [CSS Grid Layout] Do not grow tracks when the growth factor is 0
2691         https://bugs.webkit.org/show_bug.cgi?id=136575
2692
2693         Reviewed by Darin Adler.
2694
2695         A couple of performance optimizations for the track sizing
2696         algorithm. On the one hand we avoid the computation of the
2697         available logical space share if the track has no growth potential
2698         (the current breadth is the maximum breadth) and on the other
2699         hand, we avoid calling RenderGrid::distributeSpaceToTracks() if
2700         the available logical space is not greater than 0.
2701
2702         The combined effect of these two changes is an impressive +16%
2703         improvement in auto-grid-lots-of-data.html performance test.
2704
2705         No new tests as there is no change in the functionality.
2706
2707         * rendering/RenderGrid.cpp:
2708         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
2709         (WebCore::RenderGrid::distributeSpaceToTracks):
2710
2711 2014-09-23  Ion Rosca  <rosca@adobe.com>
2712
2713         [CSS Blending] The composited layers isolated by the page group should blend with the default white background color.
2714         https://bugs.webkit.org/show_bug.cgi?id=136563
2715
2716         Reviewed by Simon Fraser.
2717
2718         If a blending layer is not isolated, then it should blend with a white backdrop:
2719         http://dev.w3.org/fxtf/compositing-1/#pagebackdrop
2720
2721         Tests: css3/blending/blend-mode-body-composited-child-background-color.html
2722                css3/blending/blend-mode-body-composited-child.html
2723
2724         * rendering/RenderLayerBacking.cpp:
2725         (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
2726         If the isolating composited layer is the root renderer, then it should have a backing store
2727         into which the initial white backdrop will be painted.
2728
2729 2014-09-22  Christophe Dumez  <cdumez@apple.com>
2730
2731         Unreviewed build fix after r173859.
2732
2733         Partial revert to fix debug build after r173859.
2734
2735         * accessibility/AccessibilityRenderObject.cpp:
2736         (WebCore::AccessibilityRenderObject::remoteSVGRootElement):
2737         * html/HTMLFrameOwnerElement.cpp:
2738         (WebCore::HTMLFrameOwnerElement::getSVGDocument):
2739         * page/EventHandler.cpp:
2740         (WebCore::EventHandler::handleMousePressEvent):
2741         (WebCore::EventHandler::handleMouseMoveEvent):
2742         (WebCore::EventHandler::handleMouseReleaseEvent):
2743         * page/Frame.cpp:
2744         (WebCore::Frame::setPageAndTextZoomFactors):
2745         * page/FrameView.cpp:
2746         (WebCore::FrameView::scrollToAnchor):
2747         * rendering/svg/RenderSVGBlock.h:
2748         (WebCore::RenderSVGBlock::graphicsElement):
2749         * rendering/svg/RenderSVGGradientStop.cpp:
2750         (WebCore::RenderSVGGradientStop::gradientElement):
2751         * rendering/svg/RenderSVGInline.h:
2752         (WebCore::RenderSVGInline::graphicsElement):
2753         * rendering/svg/RenderSVGResourceClipper.cpp:
2754         (WebCore::RenderSVGResourceClipper::pathOnlyClipping):
2755         * rendering/svg/RenderSVGResourceContainer.cpp:
2756         (WebCore::RenderSVGResourceContainer::transformOnNonScalingStroke):
2757         * rendering/svg/RenderSVGShape.h:
2758         (WebCore::RenderSVGShape::graphicsElement):
2759         * rendering/svg/RenderSVGTransformableContainer.h:
2760         * rendering/svg/SVGRenderSupport.cpp:
2761         (WebCore::SVGRenderSupport::updateMaskedAncestorShouldIsolateBlending):
2762         * rendering/svg/SVGRenderTreeAsText.cpp:
2763         (WebCore::operator<<):
2764         * rendering/svg/SVGRenderingContext.cpp:
2765         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
2766         * rendering/svg/SVGResources.cpp:
2767         (WebCore::targetReferenceFromResource):
2768         * svg/SVGAElement.cpp:
2769         (WebCore::SVGAElement::defaultEventHandler):
2770         * svg/SVGAnimateElement.cpp:
2771         (WebCore::SVGAnimateElement::calculateAnimatedValue):
2772         * svg/SVGAnimationElement.cpp:
2773         (WebCore::SVGAnimationElement::currentValuesForValuesAnimation):
2774         * svg/SVGElement.cpp:
2775         (WebCore::SVGElement::getBoundingBox):
2776         * svg/SVGLinearGradientElement.cpp:
2777         (WebCore::SVGLinearGradientElement::collectGradientAttributes):
2778         * svg/SVGLocatable.cpp:
2779         (WebCore::SVGLocatable::getTransformToElement):
2780         * svg/SVGPolyElement.cpp:
2781         (WebCore::SVGPolyElement::synchronizePoints):
2782         (WebCore::SVGPolyElement::lookupOrCreatePointsWrapper):
2783         * svg/SVGRadialGradientElement.cpp:
2784         (WebCore::SVGRadialGradientElement::collectGradientAttributes):
2785         * svg/SVGTextContentElement.cpp:
2786         (WebCore::SVGTextContentElement::synchronizeTextLength):
2787         (WebCore::SVGTextContentElement::lookupOrCreateTextLengthWrapper):
2788         (WebCore::SVGTextContentElement::elementFromRenderer):
2789         * svg/SVGUseElement.cpp:
2790         (WebCore::SVGUseElement::toClipPath):
2791         * svg/animation/SVGSMILElement.cpp:
2792         (WebCore::SVGSMILElement::connectConditions):
2793         (WebCore::SVGSMILElement::disconnectConditions):
2794         * svg/graphics/SVGImage.cpp:
2795         (WebCore::SVGImage::hasSingleSecurityOrigin):
2796         (WebCore::SVGImage::setContainerSize):
2797         (WebCore::SVGImage::containerSize):
2798         (WebCore::SVGImage::embeddedContentBox):
2799         (WebCore::SVGImage::hasRelativeWidth):
2800         (WebCore::SVGImage::hasRelativeHeight):
2801         (WebCore::SVGImage::computeIntrinsicDimensions):
2802         (WebCore::SVGImage::startAnimation):
2803         (WebCore::SVGImage::stopAnimation):
2804
2805 2014-09-22  Simon Fraser  <simon.fraser@apple.com>
2806
2807         Ensure that layout is up-to-date before hit-testing via RenderView
2808         https://bugs.webkit.org/show_bug.cgi?id=136651
2809
2810         Reviewed by David Hyatt.
2811
2812         Ensure that layout is up-to-date before we do hit-testing via the RenderView.
2813         Previously, RenderLayer::hitTest() called updateLayout(), but it's better
2814         to push that responsibility onto RenderView before entering the RenderLayer
2815         tree.
2816         
2817         Make callers a little more consistent in getting the RenderView via
2818         Frame::contentRenderer(), though perhaps we should remove that and just
2819         call Document::renderView() everywhere.
2820
2821         * accessibility/AccessibilityObject.cpp:
2822         (WebCore::AccessibilityObject::press): Hit test via the RenderView, rather
2823         than doing so on the RenderView's layer, to ensure that we updateLayout().
2824         * accessibility/AccessibilityRenderObject.cpp:
2825         (WebCore::AccessibilityRenderObject::accessibilityHitTest): This code calls
2826         hitTest() on arbitrary layers, so needs to explicitly update layout.
2827         * editing/FrameSelection.cpp:
2828         (WebCore::FrameSelection::contains):
2829         * page/EventHandler.cpp:
2830         (WebCore::EventHandler::eventMayStartDrag):
2831         (WebCore::EventHandler::updateSelectionForMouseDrag):
2832         (WebCore::EventHandler::hitTestResultAtPoint): The explicit updateLayout() is
2833         no longer needed.
2834         (WebCore::EventHandler::updateCursor):
2835         (WebCore::EventHandler::handleWheelEvent):
2836         (WebCore::EventHandler::hoverTimerFired):
2837         (WebCore::hitTestResultInFrame):
2838         * page/Frame.cpp:
2839         (WebCore::Frame::contentRenderer):
2840         * rendering/RenderLayer.cpp:
2841         (WebCore::RenderLayer::hitTest):
2842         * rendering/RenderView.cpp:
2843         (WebCore::RenderView::hitTest): Here's where we ensure that layout is up-to-date.
2844
2845 2014-09-22  Christophe Dumez  <cdumez@apple.com>
2846
2847         Use downcast<SVG*Element>() instead of toSVG*Element()
2848         https://bugs.webkit.org/show_bug.cgi?id=137004
2849
2850         Reviewed by Benjamin Poulain.
2851
2852         Use downcast<SVG*Element>() instead of toSVG*Element() for casting SVG
2853         Elements and get rid of the transition toSVG*Element() macros.
2854
2855         Also use downcast<MathML*Element>() instead of toMathML*Element() for
2856         casting MathML Elements.
2857
2858         The HTML Elements casting counterparts will be taken care of in a
2859         separate patch.
2860
2861         No new tests, no behavior change.
2862
2863         * accessibility/AccessibilityNodeObject.cpp:
2864         (WebCore::AccessibilityNodeObject::alternativeText):
2865         (WebCore::AccessibilityNodeObject::accessibilityDescription):
2866         * accessibility/AccessibilityRenderObject.cpp:
2867         (WebCore::AccessibilityRenderObject::remoteSVGRootElement):
2868         * bindings/js/JSElementCustom.cpp:
2869         (WebCore::toJSNewlyCreated):
2870         * bindings/js/JSNodeCustom.cpp:
2871         (WebCore::createWrapperInline):
2872         * css/CSSComputedStyleDeclaration.cpp:
2873         (WebCore::ComputedStyleExtractor::propertyValue):
2874         * css/CSSCursorImageValue.cpp:
2875         (WebCore::resourceReferencedByCursorElement):
2876         (WebCore::CSSCursorImageValue::updateIfSVGCursorIsUsed):
2877         * css/ElementRuleCollector.cpp:
2878         (WebCore::ElementRuleCollector::matchAllRules):
2879         * css/StyleResolver.cpp:
2880         (WebCore::StyleResolver::locateCousinList):
2881         (WebCore::StyleResolver::canShareStyleWithElement):
2882         (WebCore::StyleResolver::locateSharedStyle):
2883         * dom/DocumentStyleSheetCollection.cpp:
2884         (WebCore::DocumentStyleSheetCollection::collectActiveStyleSheets):
2885         * dom/Element.cpp:
2886         (WebCore::Element::synchronizeAllAttributes):
2887         (WebCore::Element::synchronizeAttribute):
2888         (WebCore::Element::boundsInRootViewSpace):
2889         (WebCore::Element::getBoundingClientRect):
2890         (WebCore::Element::childShouldCreateRenderer):
2891         (WebCore::Element::fastAttributeLookupAllowed):
2892         * dom/EventDispatcher.cpp:
2893         (WebCore::eventTargetRespectingTargetRules):
2894         * dom/ScriptElement.cpp:
2895         (WebCore::toScriptElementIfPossible):
2896         * dom/make_names.pl:
2897         (printTypeHelpers):
2898         * html/HTMLFrameOwnerElement.cpp:
2899         (WebCore::HTMLFrameOwnerElement::getSVGDocument):
2900         * inspector/InspectorCSSAgent.cpp:
2901         (WebCore::InspectorCSSAgent::viaInspectorStyleSheet):
2902         * mathml/MathMLElement.cpp:
2903         (WebCore::MathMLElement::isPhrasingContent):
2904         (WebCore::MathMLElement::childShouldCreateRenderer):
2905         (WebCore::MathMLElement::attributeChanged):
2906         * mathml/MathMLElement.h:
2907         (WebCore::Node::hasTagName):
2908         * mathml/MathMLSelectElement.cpp:
2909         (WebCore::MathMLSelectElement::getSelectedSemanticsChild):
2910         * page/EventHandler.cpp:
2911         (WebCore::EventHandler::handleMousePressEvent):
2912         (WebCore::EventHandler::handleMouseMoveEvent):
2913         (WebCore::EventHandler::handleMouseReleaseEvent):
2914         (WebCore::instanceAssociatedWithShadowTreeElement):
2915         * page/Frame.cpp:
2916         (WebCore::Frame::setPageAndTextZoomFactors):
2917         * page/FrameView.cpp:
2918         (WebCore::FrameView::scrollToAnchor):
2919         * rendering/RenderTableCell.cpp:
2920         (WebCore::RenderTableCell::parseColSpanFromDOM):
2921         (WebCore::RenderTableCell::parseRowSpanFromDOM):
2922         (WebCore::RenderTableCell::computePreferredLogicalWidths):
2923         * rendering/mathml/RenderMathMLMenclose.cpp:
2924         (WebCore::RenderMathMLMenclose::addChild):
2925         (WebCore::RenderMathMLMenclose::computePreferredLogicalWidths):
2926         (WebCore::RenderMathMLMenclose::updateLogicalHeight):
2927         (WebCore::RenderMathMLMenclose::paint):
2928         * rendering/svg/RenderSVGBlock.h:
2929         (WebCore::RenderSVGBlock::graphicsElement):
2930         * rendering/svg/RenderSVGForeignObject.cpp:
2931         (WebCore::RenderSVGForeignObject::foreignObjectElement):
2932         * rendering/svg/RenderSVGGradientStop.cpp:
2933         (WebCore::RenderSVGGradientStop::gradientElement):
2934         * rendering/svg/RenderSVGGradientStop.h:
2935         * rendering/svg/RenderSVGImage.cpp:
2936         (WebCore::RenderSVGImage::imageElement):
2937         * rendering/svg/RenderSVGInline.h:
2938         (WebCore::RenderSVGInline::graphicsElement):
2939         * rendering/svg/RenderSVGModelObject.cpp:
2940         (WebCore::getElementCTM):
2941         (WebCore::RenderSVGModelObject::checkIntersection):
2942         (WebCore::RenderSVGModelObject::checkEnclosure):
2943         * rendering/svg/RenderSVGModelObject.h:
2944         (WebCore::RenderSVGModelObject::element):
2945         * rendering/svg/RenderSVGRect.cpp:
2946         (WebCore::RenderSVGRect::rectElement):
2947         * rendering/svg/RenderSVGResource.cpp:
2948         (WebCore::removeFromCacheAndInvalidateDependencies):
2949         * rendering/svg/RenderSVGResourceClipper.cpp:
2950         (WebCore::RenderSVGResourceClipper::pathOnlyClipping):
2951         (WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage):
2952         * rendering/svg/RenderSVGResourceClipper.h:
2953         * rendering/svg/RenderSVGResourceContainer.cpp:
2954         (WebCore::RenderSVGResourceContainer::transformOnNonScalingStroke):
2955         * rendering/svg/RenderSVGResourceFilter.h:
2956         * rendering/svg/RenderSVGResourceLinearGradient.h:
2957         * rendering/svg/RenderSVGResourceMarker.h:
2958         * rendering/svg/RenderSVGResourceMasker.h:
2959         * rendering/svg/RenderSVGResourcePattern.cpp:
2960         (WebCore::RenderSVGResourcePattern::patternElement):
2961         * rendering/svg/RenderSVGResourceRadialGradient.h:
2962         * rendering/svg/RenderSVGRoot.cpp:
2963         (WebCore::RenderSVGRoot::svgSVGElement):
2964         * rendering/svg/RenderSVGShape.h:
2965         (WebCore::RenderSVGShape::graphicsElement):
2966         * rendering/svg/RenderSVGText.cpp:
2967         (WebCore::RenderSVGText::textElement):
2968         * rendering/svg/RenderSVGTextPath.cpp:
2969         (WebCore::RenderSVGTextPath::textPathElement):
2970         (WebCore::RenderSVGTextPath::layoutPath):
2971         * rendering/svg/RenderSVGTransformableContainer.cpp:
2972         (WebCore::RenderSVGTransformableContainer::calculateLocalTransform):
2973         * rendering/svg/RenderSVGTransformableContainer.h:
2974         * rendering/svg/RenderSVGViewportContainer.cpp:
2975         (WebCore::RenderSVGViewportContainer::svgSVGElement):
2976         * rendering/svg/SVGPathData.cpp:
2977         (WebCore::updatePathFromLineElement):
2978         (WebCore::updatePathFromPathElement):
2979         (WebCore::updatePathFromPolygonElement):
2980         (WebCore::updatePathFromPolylineElement):
2981         * rendering/svg/SVGRenderSupport.cpp:
2982         (WebCore::SVGRenderSupport::layoutChildren):
2983         (WebCore::SVGRenderSupport::applyStrokeStyleToContext):
2984         (WebCore::SVGRenderSupport::updateMaskedAncestorShouldIsolateBlending):
2985         * rendering/svg/SVGRenderTreeAsText.cpp:
2986         (WebCore::operator<<):
2987         * rendering/svg/SVGRenderingContext.cpp:
2988         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
2989         * rendering/svg/SVGResources.cpp:
2990         (WebCore::targetReferenceFromResource):
2991         (WebCore::SVGResources::buildCachedResources):
2992         * rendering/svg/SVGTextLayoutEngine.cpp:
2993         (WebCore::SVGTextLayoutEngine::layoutTextOnLineOrPath):
2994         * svg/SVGAElement.cpp:
2995         (WebCore::SVGAElement::createElementRenderer):
2996         (WebCore::SVGAElement::defaultEventHandler):
2997         * svg/SVGAltGlyphDefElement.cpp:
2998         (WebCore::SVGAltGlyphDefElement::hasValidGlyphElements):
2999         * svg/SVGAltGlyphElement.cpp:
3000         (WebCore::SVGAltGlyphElement::hasValidGlyphElements):
3001         * svg/SVGAnimateElement.cpp:
3002         (WebCore::SVGAnimateElement::calculateAnimatedValue):
3003         * svg/SVGAnimatedTransformList.cpp:
3004         (WebCore::SVGAnimatedTransformListAnimator::SVGAnimatedTransformListAnimator):
3005         * svg/SVGAnimationElement.cpp:
3006         (WebCore::SVGAnimationElement::currentValuesForValuesAnimation):
3007         (WebCore::SVGAnimationElement::adjustForInheritance):
3008         * svg/SVGDocument.cpp:
3009         (WebCore::SVGDocument::rootElement):
3010         * svg/SVGElement.cpp:
3011         (WebCore::SVGElement::ownerSVGElement):
3012         (WebCore::SVGElement::viewportElement):
3013         (WebCore::SVGElement::getBoundingBox):
3014         (WebCore::SVGElement::childShouldCreateRenderer):
3015         (WebCore::SVGElement::title):
3016         (WebCore::SVGElement::updateRelativeLengthsInformation):
3017         * svg/SVGElement.h:
3018         (WebCore::Node::hasTagName):
3019         * svg/SVGFEComponentTransferElement.cpp:
3020         (WebCore::SVGFEComponentTransferElement::build):
3021         * svg/SVGFEImageElement.cpp:
3022         (WebCore::SVGFEImageElement::buildPendingResource):
3023         * svg/SVGFilterElement.cpp:
3024         (WebCore::SVGFilterElement::childShouldCreateRenderer):
3025         * svg/SVGFilterPrimitiveStandardAttributes.h:
3026         (WebCore::isSVGFilterPrimitiveStandardAttributes):
3027         * svg/SVGFontData.cpp:
3028         (WebCore::SVGFontData::applySVGGlyphSelection):
3029         * svg/SVGFontElement.cpp:
3030         (WebCore::SVGFontElement::ensureGlyphCache):
3031         * svg/SVGFontFaceElement.cpp:
3032         (WebCore::SVGFontFaceElement::rebuildFontFace):
3033         * svg/SVGFontFaceFormatElement.cpp:
3034         (WebCore::SVGFontFaceFormatElement::childrenChanged):
3035         * svg/SVGFontFaceSrcElement.cpp:
3036         (WebCore::SVGFontFaceSrcElement::srcValue):
3037         (WebCore::SVGFontFaceSrcElement::childrenChanged):
3038         * svg/SVGFontFaceUriElement.cpp:
3039         (WebCore::SVGFontFaceUriElement::childrenChanged):
3040         * svg/SVGGlyphElement.cpp:
3041         (WebCore::SVGGlyphElement::invalidateGlyphCache):
3042         * svg/SVGGraphicsElement.h:
3043         (WebCore::isSVGGraphicsElement):
3044         * svg/SVGHKernElement.cpp:
3045         (WebCore::SVGHKernElement::insertedInto):
3046         (WebCore::SVGHKernElement::removedFrom):
3047         * svg/SVGImageLoader.cpp:
3048         (WebCore::SVGImageLoader::dispatchLoadEvent):
3049         * svg/SVGLengthContext.cpp:
3050         (WebCore::SVGLengthContext::determineViewport):
3051         * svg/SVGLinearGradientElement.cpp:
3052         (WebCore::setGradientAttributes):
3053         (WebCore::SVGLinearGradientElement::collectGradientAttributes):
3054         * svg/SVGLocatable.cpp:
3055         (WebCore::SVGLocatable::nearestViewportElement):
3056         (WebCore::SVGLocatable::farthestViewportElement):
3057         (WebCore::SVGLocatable::computeCTM):
3058         (WebCore::SVGLocatable::getTransformToElement):
3059         * svg/SVGMPathElement.cpp:
3060         (WebCore::SVGMPathElement::buildPendingResource):
3061         (WebCore::SVGMPathElement::pathElement):
3062         (WebCore::SVGMPathElement::notifyParentOfPathChange):
3063         * svg/SVGMarkerElement.cpp:
3064         (WebCore::SVGMarkerElement::synchronizeOrientType):
3065         (WebCore::SVGMarkerElement::lookupOrCreateOrientTypeWrapper):
3066         * svg/SVGPathElement.cpp:
3067         (WebCore::SVGPathElement::invalidateMPathDependencies):
3068         (WebCore::SVGPathElement::lookupOrCreateDWrapper):
3069         (WebCore::SVGPathElement::synchronizeD):
3070         * svg/SVGPathSegList.cpp:
3071         (WebCore::SVGPathSegList::commitChange):
3072         * svg/SVGPatternElement.cpp:
3073         (WebCore::SVGPatternElement::collectPatternAttributes):
3074         * svg/SVGPolyElement.cpp:
3075         (WebCore::SVGPolyElement::synchronizePoints):
3076         (WebCore::SVGPolyElement::lookupOrCreatePointsWrapper):
3077         * svg/SVGRadialGradientElement.cpp:
3078         (WebCore::setGradientAttributes):
3079         (WebCore::SVGRadialGradientElement::collectGradientAttributes):
3080         * svg/SVGSVGElement.cpp:
3081         (WebCore::SVGSVGElement::setupInitialView):
3082         * svg/SVGTextContentElement.cpp:
3083         (WebCore::SVGTextContentElement::synchronizeTextLength):
3084         (WebCore::SVGTextContentElement::lookupOrCreateTextLengthWrapper):
3085         (WebCore::SVGTextContentElement::elementFromRenderer):
3086         * svg/SVGTextContentElement.h:
3087         (WebCore::isSVGTextContentElement):
3088         * svg/SVGTextPathElement.cpp:
3089         (WebCore::SVGTextPathElement::buildPendingResource):
3090         * svg/SVGUseElement.cpp:
3091         (WebCore::dumpInstanceTree):
3092         (WebCore::SVGUseElement::buildPendingResource):
3093         (WebCore::SVGUseElement::toClipPath):
3094         (WebCore::SVGUseElement::buildInstanceTree):
3095         (WebCore::SVGUseElement::hasCycleUseReferencing):
3096         (WebCore::SVGUseElement::expandUseElementsInShadowTree):
3097         (WebCore::SVGUseElement::associateInstancesWithShadowTreeElements):
3098         * svg/SVGVKernElement.cpp:
3099         (WebCore::SVGVKernElement::insertedInto):
3100         (WebCore::SVGVKernElement::removedFrom):
3101         * svg/SVGViewSpec.cpp:
3102         (WebCore::SVGViewSpec::viewTarget):
3103         * svg/animation/SVGSMILElement.cpp:
3104         (WebCore::SVGSMILElement::buildPendingResource):
3105         (WebCore::SVGSMILElement::connectConditions):
3106         (WebCore::SVGSMILElement::disconnectConditions):
3107         * svg/animation/SVGSMILElement.h:
3108         (WebCore::isSVGSMILElement):
3109         * svg/graphics/SVGImage.cpp:
3110         (WebCore::SVGImage::hasSingleSecurityOrigin):
3111         (WebCore::SVGImage::setContainerSize):
3112         (WebCore::SVGImage::containerSize):
3113         (WebCore::SVGImage::embeddedContentBox):
3114         (WebCore::SVGImage::hasRelativeWidth):
3115         (WebCore::SVGImage::hasRelativeHeight):
3116         (WebCore::SVGImage::computeIntrinsicDimensions):
3117         (WebCore::SVGImage::startAnimation):
3118         (WebCore::SVGImage::stopAnimation):
3119         * svg/graphics/filters/SVGFEImage.cpp:
3120         (WebCore::FEImage::platformApplySoftware):
3121         * svg/properties/SVGAnimatedPathSegListPropertyTearOff.h:
3122         (WebCore::SVGAnimatedPathSegListPropertyTearOff::animValDidChange):
3123         * svg/properties/SVGPathSegListPropertyTearOff.cpp:
3124         (WebCore::SVGPathSegListPropertyTearOff::contextElement):
3125
3126 2014-09-22  Pratik Solanki  <psolanki@apple.com>
3127
3128         Follow on fix for [iOS] ASSERTION FAILED: WTF::isMainThread() in WebCore::memoryCache() when using WebKit1
3129         https://bugs.webkit.org/show_bug.cgi?id=136962
3130
3131         Rubber-stamped by Simon Fraser.
3132
3133         Remove the const per review comment. It is not needed.
3134
3135         * loader/cocoa/DiskCacheMonitorCocoa.mm:
3136         (WebCore::DiskCacheMonitor::DiskCacheMonitor):
3137
3138 2014-09-22  Simon Fraser  <simon.fraser@apple.com>
3139
3140         Move nodeFromPoint() back to Document where it belongs
3141         https://bugs.webkit.org/show_bug.cgi?id=137012
3142
3143         Reviewed by Zalan Bujtas.
3144
3145         nodeFromPoint() was moved into TreeScope for ShadowDOM work, but now we can move
3146         it back to its logical place.
3147         
3148         Make versions of elementFromPoint and caretRangeFromPoint that take LayoutPoints,
3149         and change the current scale/offset code to be in layout units (which results
3150         in a small behavior change).
3151         
3152         elementFromPoint(int, int) and caretRangeFromPoint(int, int) are still required
3153         for bindings code.
3154
3155         * dom/Document.cpp:
3156         (WebCore::Document::nodeFromPoint):
3157         (WebCore::Document::elementFromPoint):
3158         (WebCore::Document::caretRangeFromPoint):
3159         * dom/Document.h:
3160         (WebCore::Document::elementFromPoint): Move logic from TreeScope::elementFromPoint()
3161         here.
3162         * dom/TreeScope.cpp:
3163         (WebCore::nodeFromPoint): Deleted.
3164         (WebCore::TreeScope::elementFromPoint): Deleted.
3165         * dom/TreeScope.h:
3166
3167 2014-09-22  Benjamin Poulain  <bpoulain@apple.com>
3168
3169         Add the baseline implementation of :nth-child(An+B of selector-list)
3170         https://bugs.webkit.org/show_bug.cgi?id=136975
3171
3172         Reviewed by Darin Adler.
3173
3174         Tests: fast/css/nth-child-of-classname.html
3175                fast/css/nth-child-of-complex-selector.html
3176                fast/css/nth-child-of-compound-selector.html
3177                fast/css/nth-child-of-tagname.html
3178                fast/selectors/nth-child-of-basics.html
3179                fast/selectors/nth-child-of-class-style-update.html
3180                fast/selectors/nth-child-of-complex-selectors.html
3181                fast/selectors/nth-child-of-selector-list.html
3182
3183         * css/SelectorChecker.cpp:
3184         (WebCore::SelectorChecker::checkOne):
3185         Pretty basic:
3186         -Go over the previous siblings.
3187         -For each sibling, test the selector list. If it matches, increase the count.
3188
3189         * cssjit/SelectorCompiler.cpp:
3190         (WebCore::SelectorCompiler::addPseudoClassType):
3191         Skip any case of the new selector. This will be implemented separately.
3192
3193 2014-09-19  Myles C. Maxfield  <mmaxfield@apple.com>
3194
3195         Implement 'vhea', 'vmtx', and 'kern' tables in SVG -> OTF converter
3196         https://bugs.webkit.org/show_bug.cgi?id=136971
3197
3198         Reviewed by Darin Adler.
3199
3200         This patch fills in the tables related to vertical metrics and kerning. The vertical metrics tables are
3201         fairly straightforward. On the other hand, the 'kern' table has subtables which can be in a variety
3202         of formats; however, according to Microsoft, Windows only allows one particular format, which doesn't
3203         allow for ranges of glyphs to be described and therefore might lead to a large 'kern' table size. In
3204         the interest of platform agnosticism I have implemented this particular format, and have not actually
3205         witnessed any extremely large 'kern' tables in any of the fonts that I have looked at.
3206
3207         I also added basic support for the horiz-origin-x and horiz-origin-y SVG properties, though support
3208         might not be perfect based on my testing.
3209
3210         Regarding testing, after this patch, almost all of our SVG fonts tests pass (barring tiny rebaselining;
3211         the platform font system calculates slightly different advances than we did. These differences are tiny
3212         and expected from such a dramatic shift in text handling engines.) There are around two dozen failing
3213         tests left that look like they are actually indiciative of code problems.
3214
3215         * svg/SVGFontElement.cpp:
3216         (WebCore::SVGFontElement::ensureGlyphCache): Refactor to accept new signature of
3217         SVG*KernElement::build*KerningPair().
3218         * svg/SVGHKernElement.cpp:
3219         (WebCore::SVGHKernElement::buildHorizontalKerningPair): Refactor to allow for intermediate data to be
3220         returned, which the SVG -> OTF font converter can use.
3221         * svg/SVGHKernElement.h: New signature for buildHorizontalKerningPair().
3222         * svg/SVGToOTFFontConversion.cpp:
3223         (WebCore::SVGToOTFFontConverter::GlyphData::GlyphData): Save the glyph's vertical advance along with
3224         the glyph's horizontal advance.
3225         (WebCore::SVGToOTFFontConverter::KerningData::KerningData): This data represents a record in one of
3226         the two 'kern' subtables, and as such needs to be sorted.
3227         (WebCore::SVGToOTFFontConverter::KerningData::operator<): Sort comparator.
3228         (WebCore::SVGToOTFFontConverter::appendHEADTable): Save the unitsPerEm locally to save a conditional.
3229         (WebCore::SVGToOTFFontConverter::appendHHEATable): Ditto.
3230         (WebCore::SVGToOTFFontConverter::appendHMTXTable): Ditto. Also use the horizontal advance as opposed to
3231         the vertical advance.
3232         (WebCore::SVGToOTFFontConverter::appendOS2Table): Save the unitsPerEm locally to save a conditional.
3233         Also if the average advance isn't found in the font, use the missing glyph's advance. If there is no
3234         missing glyph, bail and use the unitsPerEm.
3235         (WebCore::SVGToOTFFontConverter::appendVORGTable): If the default vertical origin isn't found in the
3236         font, use the missing glyphs's vertical origin. If there is no missing glyph, bail and use 0.
3237         (WebCore::SVGToOTFFontConverter::appendVHEATable): Parallel of 'hhea' table, except for vertical info.
3238         (WebCore::SVGToOTFFontConverter::appendVMTXTable): Parallel of 'hmtx' table, except for vertical info.
3239         (WebCore::SVGToOTFFontConverter::appendKerningHelperFields): Computes and appends 4 fields that font
3240         parsers need in order to do a binary search on the kern records.
3241         (WebCore::SVGToOTFFontConverter::addCodepointRanges): For each codepoint in the ranges, look up its
3242         representative glyph and append it to a set.
3243         (WebCore::SVGToOTFFontConverter::addCodepoints): For each codepoint in the range, look up its
3244         representative glyph and append it to a set.
3245         (WebCore::SVGToOTFFontConverter::addGlyphNames): For each glyph name, look up its representative glyph
3246         and append it to a set.
3247         (WebCore::SVGToOTFFontConverter::computeKerningData): Call SVG*KernElement::build*KerningPair() and
3248         iterate through all the data it returned, building up records into a Vector.
3249         (WebCore::SVGToOTFFontConverter::appendKERNTable): Go through the vector that computeKerningData()
3250         returned and actually write out the two subtables. One is for horizontal kerning and the other is for
3251         vertical kerning.
3252         (WebCore::CFFBuilder::CFFBuilder): Use the position of the glyph origin to perform the initial moveto
3253         command.
3254         (WebCore::transcodeGlyphPaths): Get the glyph's origin and pass it to the CFFBuilder.
3255         (WebCore::SVGToOTFFontConverter::appendGlyphData): Templated overloading so that the missing glyph
3256         gets a null SVGGlyphElement pointer but the rest of the glyphs get a non-null one.
3257         (WebCore::SVGToOTFFontConverter::processGlyphElement): Called on both SVGGlyphElements and
3258         SVGMissingGlyphElements, this pulls out information from the element and computs its path information.
3259         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter): Use the new templated version of
3260         processGlyphElement so we can get the same glyph parsing behavior on SVGMissingGlyphElements. In
3261         addition, populate two maps for the kerning table creation function to use.
3262         (WebCore::SVGToOTFFontConverter::convertSVGToOTFFont): Append new tables.
3263         * svg/SVGVKernElement.cpp:
3264         (WebCore::SVGVKernElement::buildVerticalKerningPair): Refactor to allow for intermediate data to be
3265         returned, which the SVG -> OTF font converter can use.
3266         * svg/SVGVKernElement.h: New signature for buildVerticalKerningPair().
3267
3268 2014-09-22  Alexey Proskuryakov  <ap@apple.com>
3269
3270         WebSocket crash when a connection is closed from server side
3271         https://bugs.webkit.org/show_bug.cgi?id=137009
3272         rdar://problem/18333977
3273         rdar://problem/12708225
3274
3275         Reviewed by Brady Eidson.
3276
3277         I don't think that this can be tested with our test server.
3278
3279         * Modules/websockets/WebSocketChannel.cpp:
3280         (WebCore::WebSocketChannel::WebSocketChannel): Added logging.
3281         (WebCore::WebSocketChannel::~WebSocketChannel): Ditto.
3282         (WebCore::WebSocketChannel::close): Protect self, because startClosingHandshake
3283         can release the last reference.
3284         (WebCore::WebSocketChannel::fail): Added an assertion that the channel is always
3285         closed after this function.
3286         (WebCore::WebSocketChannel::startClosingHandshake): Protect self, and don't change
3287         the stack from closed back to closing if after failing to send closing handshake.
3288         (WebCore::WebSocketChannel::processOutgoingFrameQueue): Protect self.
3289
3290 2014-09-22  David Hyatt  <hyatt@apple.com>
3291
3292         Bad cast in isValidColumnSpanner.
3293         https://bugs.webkit.org/show_bug.cgi?id=133380.
3294
3295         Reviewed by Simon Fraser.
3296
3297         Added fast/multicol/multicol-crazy-nesting.html
3298
3299         * rendering/RenderMultiColumnFlowThread.cpp:
3300         (WebCore::isValidColumnSpanner):
3301         The crawl up the chain looking for unsplittable objects should use containing blocks
3302         and not be casting to parent boxes. You can have an inline in the parent chain, so
3303         this was not the right way to walk up the tree.
3304
3305 2014-09-22  David Hyatt  <hyatt@apple.com>
3306
3307         ASSERT in RenderMultiColumnSet::requiresBalancing.
3308         https://bugs.webkit.org/show_bug.cgi?id=136376.
3309
3310         Reviewed by David Kilzer.
3311
3312         Added fast/multicol/multicol-selection.html.
3313
3314         * rendering/RenderMultiColumnFlowThread.cpp:
3315         (WebCore::isValidColumnSpanner):
3316         Don't allow an object to become a spanner if it does not have the flow
3317         thread as its containing block. Otherwise the flow thread won't get notified
3318         of spanner placeholder insertions, and so the spanner ends up orphaned.
3319
3320 2014-09-19  Brent Fulgham  <bfulgham@apple.com>
3321
3322         [Win] Implement cap height in SimpleFontDataWin to enable initial-letter support for Windows.
3323         https://bugs.webkit.org/show_bug.cgi?id=136841
3324
3325         Reviewed by David Hyatt.
3326
3327         * platform/graphics/win/SimpleFontDataCGWin.cpp:
3328         (WebCore::SimpleFontData::platformInit): Add missing calls to set up our fonts.
3329
3330 2014-09-22  Eric Carlson  <eric.carlson@apple.com>
3331
3332         Update HTMLMediaElement logging
3333         https://bugs.webkit.org/show_bug.cgi?id=136991
3334
3335         Reviewed by Alexey Proskuryakov.
3336
3337         No new tests, only logging was changed.
3338
3339         * html/HTMLMediaElement.cpp:
3340         (WebCore::HTMLMediaElement::HTMLMediaElement):
3341         (WebCore::HTMLMediaElement::~HTMLMediaElement):
3342         (WebCore::HTMLMediaElement::parseAttribute):
3343
3344 2014-09-22  Eva Balazsfalvi  <evab.u-szeged@partner.samsung.com>
3345
3346         REGRESSION(r173631): It broke the !ENABLE(VIDEO) build
3347         https://bugs.webkit.org/show_bug.cgi?id=136946
3348
3349         Reviewed by Jer Noble.
3350
3351         No new tests required, no new functionality.
3352
3353         * page/DragController.cpp:
3354         (WebCore::DragController::startDrag):
3355
3356 2014-09-22  Mihnea Ovidenie  <mihnea@adobe.com>
3357
3358         [CSSRegions] Use nullptr in regions code
3359         https://bugs.webkit.org/show_bug.cgi?id=137001
3360
3361         Reviewed by Andrei Bucur.
3362
3363         No new tests as no new functionality is introduced.
3364
3365         * dom/DOMNamedFlowCollection.cpp:
3366         (WebCore::DOMNamedFlowCollection::item):
3367         (WebCore::DOMNamedFlowCollection::namedItem):
3368         * dom/NamedFlowCollection.cpp:
3369         (WebCore::NamedFlowCollection::flowByName):
3370         * dom/WebKitNamedFlow.cpp:
3371         (WebCore::WebKitNamedFlow::WebKitNamedFlow):
3372         * rendering/RenderFlowThread.cpp:
3373         (WebCore::RenderFlowThread::getLayerListForRegion):
3374         (WebCore::RenderFlowThread::regionForCompositedLayer):
3375         (WebCore::RenderFlowThread::regionAtBlockOffset):
3376         (WebCore::RenderFlowThread::mapFromFlowToRegion):
3377         (WebCore::RenderFlowThread::firstRegion):
3378         (WebCore::RenderFlowThread::lastRegion):
3379         (WebCore::RenderFlowThread::currentActiveRenderBox):
3380         * rendering/RenderNamedFlowThread.cpp:
3381         (WebCore::RenderNamedFlowThread::nextRendererForElement):
3382
3383 2014-09-17  Philippe Normand  <pnormand@igalia.com>
3384
3385         [GStreamer] Cannot play Vimeo video
3386         https://bugs.webkit.org/show_bug.cgi?id=134969
3387
3388         Reviewed by Sergio Villar Senin.
3389
3390         Ensure the GStreamer HTTP source element also sends cookies when
3391         it's sending its requests. Some streaming platforms such as Vimeo
3392         do server-side cookie checks on incoming requests before serving
3393         media data.
3394
3395         Test: http/tests/media/hls/video-cookie.html
3396
3397         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
3398         (webKitWebSrcStart): Set first-party cookie URL to the request so
3399         the ResourceLoader properly sets cookies in the HTTP request.
3400
3401 2014-09-22  Mihnea Ovidenie  <mihnea@adobe.com>
3402
3403         Leverage RenderLayerBacking::renderer() instead of m_owningLayer.renderer()
3404         https://bugs.webkit.org/show_bug.cgi?id=136954
3405
3406         Reviewed by Darin Adler.
3407
3408         No new tests just refactoring.
3409
3410         * rendering/RenderLayerBacking.cpp:
3411         (WebCore::RenderLayerBacking::updateCompositedBounds):
3412         (WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundImage):
3413         (WebCore::RenderLayerBacking::paintIntoLayer):
3414
3415 2014-09-22  Mihnea Ovidenie  <mihnea@adobe.com>
3416
3417         [CSS Regions] Assertion failure and null dereference crash when using animations and regions
3418         https://bugs.webkit.org/show_bug.cgi?id=136918
3419
3420         Reviewed by Andrei Bucur.
3421
3422         In some situations, for instance when an image has an attached animation, the style change caused by the animation
3423         triggers a geometry update for the backing store associated with the image's layer. This may occur before
3424         the layout for the image has finished.
3425
3426         Moreover, if the image in such situation - having a composited layer - is displayed in a region,
3427         sicne the layout did not finish yet, the mappings between the layers of the elements collected in the named flow
3428         and the regions associated with the named flow are not updated and cannot be used.
3429
3430         Therefore in those situations, we have to bail out early and use these mappings only after the layout has finished.
3431
3432         This patch also changes RenderLayerBacking method updateAfterDescendents -> updateAfterDescendants.
3433
3434         Test: fast/regions/animated-image-in-region.html