Templated LChar/UChar paths for simple line layout
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2013-11-08  Antti Koivisto  <antti@apple.com>
2
3         Templated LChar/UChar paths for simple line layout
4         https://bugs.webkit.org/show_bug.cgi?id=124035
5
6         Reviewed by Andreas Kling.
7
8         * rendering/SimpleLineLayout.cpp:
9         (WebCore::SimpleLineLayout::canUseForText):
10         (WebCore::SimpleLineLayout::canUseFor):
11         
12             Use a templated function to check for illegal characters.
13
14         (WebCore::SimpleLineLayout::skipWhitespaces):
15         
16             Make a template function.
17
18         (WebCore::SimpleLineLayout::textWidth):
19         
20             Make a template function plus some argument changes.
21
22         (WebCore::SimpleLineLayout::createTextRuns):
23         
24             Template function for creating runs while operating with either LChars or UChar.
25             Also simplified line breaking and text width measuring logic.
26
27         (WebCore::SimpleLineLayout::create):
28         
29             Pick the template.
30
31         * rendering/break_lines.cpp:
32         * rendering/break_lines.h:
33         
34             Move the implementation to the header (except for the table) so we can use the template
35             versions directly.
36
37         (WebCore::isBreakableSpace):
38         (WebCore::shouldBreakAfter):
39         (WebCore::needsLineBreakIterator):
40         (WebCore::nextBreakablePosition):
41         (WebCore::nextBreakablePositionIgnoringNBSP):
42
43 2013-11-08  Mario Sanchez Prada  <mario.prada@samsung.com>
44
45         AX: [ATK] <span> elements exposed through ATK when not needed
46         https://bugs.webkit.org/show_bug.cgi?id=123885
47
48         Reviewed by Chris Fleizach.
49
50         As per SVN r158195, the way it's decided whether <span> elements
51         should be ignored or not has slightly changed, causing that the
52         GTK/EFL ports expose them in cases that they should be ignored,
53         such as for text elements that neither are focusable (e.g. by
54         explicitly setting tabindex) nor have a meaningful accessible name
55         suggesting they should be exposed.
56
57         As a result, the flattening that ATK based ports normally do for
58         this kind of elements (by folding them into their parents) do not
59         work correctly anymore, making two tests to fail:
60
61             platform/gtk/accessibility/spans-paragraphs-and-divs.html
62             platform/gtk/accessibility/spans.html
63
64         This patch encapsulates the part of the logic that affects this in
65         the computeAccessibilityIsIgnored() method, placing it in a
66         new method of AccessibilityObject that we can call from ATK's
67         accessibilityPlatformIncludesObject() to ensure we hide those
68         <span> elements when they don't fulfill those requirements.
69
70         * accessibility/AccessibilityObject.cpp:
71         (WebCore::AccessibilityObject::hasAttributesRequiredForInclusion):
72         New virtual method encapsulating part of the logic from the function
73         that computes whether accessibility should be ignored or not.
74         * accessibility/AccessibilityObject.h:
75
76         * accessibility/AccessibilityNodeObject.cpp:
77         (WebCore::AccessibilityNodeObject::hasAttributesRequiredForInclusion):
78         Override of the new method adding additional checks, as extracted from
79         the original bits in computeAccessibilityIsIgnored().
80         * accessibility/AccessibilityNodeObject.h:
81
82         * accessibility/AccessibilityRenderObject.cpp:
83         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
84         Use the newly added function where we had the original code before.
85
86         * accessibility/atk/AccessibilityObjectAtk.cpp:
87         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
88         Make sure <span> elements are ignored if they are not focusable
89         and they don't have a meaningful accessible name.
90
91 2013-11-08  Carlos Garcia Campos  <cgarcia@igalia.com>
92
93         [GTK] Add missing symbols to WebKitDOMEventTarget.symbols
94         https://bugs.webkit.org/show_bug.cgi?id=123990
95
96         Reviewed by Philippe Normand.
97
98         Add webkit_dom_event_target_add_event_listener_with_closure and
99         webkit_dom_event_target_remove_event_listener_with_closure to the
100         symbols files.
101
102         * bindings/gobject/WebKitDOMEventTarget.symbols:
103         * bindings/gobject/webkitdom.symbols:
104
105 2013-11-07  Carlos Garcia Campos  <cgarcia@igalia.com>
106
107         [GTK] Use deprecation guards around deprecated API in GObject DOM bindings
108         https://bugs.webkit.org/show_bug.cgi?id=123899
109
110         Reviewed by Martin Robinson.
111
112         Do not include deprecated API when compiling with
113         WEBKIT_DISABLE_DEPRECATED option.
114
115         * bindings/scripts/CodeGeneratorGObject.pm:
116         (GenerateFunction):
117         * bindings/scripts/test/GObject/WebKitDOMTestEventTarget.cpp:
118         * bindings/scripts/test/GObject/WebKitDOMTestEventTarget.h:
119
120 2013-11-07  Brady Eidson  <beidson@apple.com>
121
122         Enhance SQL journal_mode setting code to be less likely to log an error.
123         <rdar://problem/15418577> and https://bugs.webkit.org/show_bug.cgi?id=124018
124
125         Reviewed by Anders Carlsson.
126
127         Even though the docs says SQLITE_ROW will always be returned, apparently SQLITE_OK is sometimes returned.
128         Change the code to handle that.
129
130         * platform/sql/SQLiteDatabase.cpp:
131         (WebCore::SQLiteDatabase::open): Save the statement result value, and accept SQLITE_OK as a non-error condition.
132
133 2013-11-07  Brady Eidson  <beidson@apple.com>
134
135         Update an out-dated ASSERT in IconDatabase code.
136         <rdar://problem/15171118> and https://bugs.webkit.org/show_bug.cgi?id=124030.
137
138         Reviewed by Andreas Kling.
139
140         With the asynchronous interfaces that have been added and the support for WK2 that has been added, 
141         this ASSERT can incorrectly fire if an icon is asked for before database cleanup is allowed.
142
143         * loader/icon/IconDatabase.cpp:
144         (WebCore::IconDatabase::synchronousIconForPageURL): Update an invalid ASSERT.
145
146 2013-11-07  Andreas Kling  <akling@apple.com>
147
148         RenderSVGResource helpers should take RenderStyle by const reference.
149         <https://webkit.org/b/124029>
150
151         Take const RenderStyle& instead of RenderStyle* in a few more places
152         so we can get rid of some ampersands and assertions.
153
154         Reviewed by Anders Carlsson.
155
156 2013-11-07  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
157
158         [AX] Generate toAccessibilityTableRow|Column|Cell to detect bad type casts
159         https://bugs.webkit.org/show_bug.cgi?id=123984
160
161         Reviewed by Mario Sanchez Prada.
162
163         As a step to let static_cast<> use TYPE_CASTS_BASE, AccessibilityTableRow|Column|Cell use
164         ACCESSIBILITY_OBJECT_TYPE_CASTS which can support more helper functions rather than manual
165         static_cast<>. This change will help to detect bad type casts further.
166
167         No new tests, no behavior changes.
168
169         * accessibility/AccessibilityARIAGrid.cpp:
170         (WebCore::AccessibilityARIAGrid::addTableCellChild):
171         (WebCore::AccessibilityARIAGrid::addChildren):
172         * accessibility/AccessibilityARIAGridCell.cpp:
173         (WebCore::AccessibilityARIAGridCell::rowIndexRange):
174         * accessibility/AccessibilityTable.cpp:
175         (WebCore::AccessibilityTable::addChildren):
176         (WebCore::AccessibilityTable::rowHeaders):
177         (WebCore::AccessibilityTable::columnHeaders):
178         (WebCore::AccessibilityTable::cellForColumnAndRow):
179         * accessibility/AccessibilityTableCell.h:
180         * accessibility/AccessibilityTableColumn.h:
181         * accessibility/AccessibilityTableRow.cpp:
182         (WebCore::AccessibilityTableRow::headerObject):
183         * accessibility/AccessibilityTableRow.h:
184         * accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
185         (cellAtIndex):
186         (webkitAccessibleTableGetColumnHeader):
187         (webkitAccessibleTableGetRowHeader):
188         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
189         (-[WebAccessibilityObjectWrapper tableCellParent]):
190         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
191         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
192
193 2013-11-07  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
194
195         REGRESSION (r154375): Image is oriented incorrectly
196         https://bugs.webkit.org/show_bug.cgi?id=123831
197
198         Reviewed by Antonio Gomes.
199
200         r154375 made that shouldRespectImageOrientation() isn't used by drawImage().
201         It causes an image isn't oriented correctly. This patch sets shouldRespectImageOrientation()
202         value by default.
203
204         * rendering/RenderImage.cpp:
205         (WebCore::RenderImage::paintReplaced):
206         (WebCore::RenderImage::paintIntoRect):
207
208 2013-11-07  Hans Muller  <hmuller@adobe.com>
209
210         [CSS Shapes] Image shape-outside with vertical gaps is handled incorrectly
211         https://bugs.webkit.org/show_bug.cgi?id=123934
212
213         Reviewed by Andreas Kling.
214
215         RasterShapeIntervals::getExcludedIntervals() was returning an empty
216         list when the line overlapped any vertical gap in the image. This short-circuit
217         had been mistakenly copied from getIncludedIntervals(), where it makes sense.
218
219         Test: fast/shapes/shape-outside-floats/shape-outside-floats-image-vgap.html
220
221         * rendering/shapes/RasterShape.cpp:
222         (WebCore::RasterShapeIntervals::getExcludedIntervals):
223
224 2013-11-07  Simon Fraser  <simon.fraser@apple.com>
225
226         Make contents layer borders more visible
227         https://bugs.webkit.org/show_bug.cgi?id=124025
228
229         Reviewed by Tim Horton.
230
231         Layer borders for contents layers are impossible to see when the
232         contentsLayer has the same bounds as its parent; make the contents
233         layer border 4px thick to make it more visible.
234
235         * platform/graphics/ca/GraphicsLayerCA.cpp:
236         (WebCore::GraphicsLayerCA::setupContentsLayer):
237
238 2013-11-07  Andreas Kling  <akling@apple.com>
239
240         InlineFlowBox always has a RenderBoxModelObject, take advantage.
241         <https://webkit.org/b/124024>
242
243         Since InlineFlowBox already has the branch-less renderer() returning
244         a RenderBoxModelObject&, avoid using InlineBox::boxModelObject()
245         wherever we have a tightly-typed box. One branch disappears from
246         every call site.
247
248         Deleted boxModelObject() on InlineFlowBox to prevent new code from
249         calling the less efficient function.
250
251         Reviewed by Anders Carlsson.
252
253 2013-11-07  Andreas Kling  <akling@apple.com>
254
255         CTTE: Scrolling tree nodes should always have a ScrollingTree&.
256         <https://webkit.org/b/124022>
257
258         Let ScrollingTreeNode and subclasses store the backpointer to the
259         tree as a ScrollingTree& reference.
260
261         Reviewed by Anders Carlsson.
262
263 2013-11-07  Simon Fraser  <simon.fraser@apple.com>
264
265         Lots of layers get solid color but transparent contents layers now
266         https://bugs.webkit.org/show_bug.cgi?id=123537
267
268         Reviewed by Tim Horton.
269         
270         We call rendererBackgroundColor() to determine the layer's background color,
271         but on most elements this returns the transparent color (a valid color).
272         This caused us to allocate a contentsLayer, and use the transparent color as its
273         backgroundColor, which was wasteful.
274         
275         Fix by only making a background-color layer if the color is not transparent (zero alpha).
276         
277         Also avoid making a new contents layer on every color change, and make sure that
278         we don't do implicit animations for backgroundColor, and some other properties
279         that were omitted by mistake.
280
281         Layer tree dumps don't dump content layers, so no way to test easily.
282
283         * platform/graphics/ca/GraphicsLayerCA.cpp:
284         (WebCore::GraphicsLayerCA::setContentsToSolidColor):
285         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
286         (nullActionsDictionary):
287
288 2013-11-07  Ryosuke Niwa  <rniwa@webkit.org>
289
290         DOMTokenList::add can add duplicated values if arguments had duplicated values
291         https://bugs.webkit.org/show_bug.cgi?id=123962
292
293         Reviewed by Benjamin Poulain.
294
295         Merge https://chromium.googlesource.com/chromium/blink/+/bd3822ad4ae3fc5d8f89f433a7bf04f697334305
296
297         In case we do element.classList.add('a', 'a') we need to ensure that we do not add the same token twice.
298         See http://dom.spec.whatwg.org/#dom-domtokenlist-add
299
300         * html/DOMTokenList.cpp:
301         (WebCore::DOMTokenList::add): Make sure filtered tokens are unique among themselves.
302
303 2013-11-07  Eric Carlson  <eric.carlson@apple.com>
304
305         Remove npr.org specific hack in HTMLMediaElement
306         https://bugs.webkit.org/show_bug.cgi?id=123859
307
308         Reviewed by Jer Noble.
309
310         Remove the site specific hack added in r57820, it is no longer necessary.
311
312         * html/HTMLMediaElement.cpp:
313         (WebCore::HTMLMediaElement::HTMLMediaElement): Remove m_dispatchingCanPlayEvent.
314         (HTMLMediaElement::play): Don't special case npr.org.
315         * html/HTMLMediaElement.h:
316
317 2013-11-07  Simon Fraser  <simon.fraser@apple.com>
318
319         Attempt to fix the 32-bit build. Virtual thunks seem to have different
320         symbol names between 32- and 64-bit.
321         
322         * WebCore.exp.in:
323
324 2013-11-07  Ryosuke Niwa  <rniwa@webkit.org>
325
326         Crash in HTMLMediaElement::contextDestroyed
327         https://bugs.webkit.org/show_bug.cgi?id=123963
328
329         Reviewed by Eric Carlson.
330
331         Merge https://chromium.googlesource.com/chromium/blink/+/177999cdb34b707465670f0feff723922939f278
332
333         * html/HTMLMediaElement.cpp:
334         (WebCore::HTMLMediaElement::~HTMLMediaElement):
335
336 2013-11-07  Jer Noble  <jer.noble@apple.com>
337
338         [Mac] Crash at com.apple.WebCore: -[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:] + 2084 
339         https://bugs.webkit.org/show_bug.cgi?id=124012
340
341         Reviewed by Eric Carlson.
342
343         The value of the 'duration' key is a NSConcreteValue wrapping a CMTime, not a NSNumber.
344
345         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
346         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
347
348 2013-11-07  Ryosuke Niwa  <rniwa@webkit.org>
349
350         Crash when submitting form in a document with null encoding
351         https://bugs.webkit.org/show_bug.cgi?id=123975
352
353         Reviewed by Alexey Proskuryakov.
354
355         Merge https://chromium.googlesource.com/chromium/blink/+/bba01a7fff09e3053ada96ababac2a6e4261fe5f
356         
357         The CString object which is passed to normalizeLineEndingsToCRLF() can be
358         a null string. It is created in FormDataList::appendString(), and it
359         produces a null CString if FormDataList::m_encoding is a null encoding.
360
361         Test: fast/forms/form-submit-in-image-document.html
362
363         * platform/text/LineEnding.cpp:
364         (internalNormalizeLineEndingsToCRLF):
365
366 2013-11-07  Anders Carlsson  <andersca@apple.com>
367
368         Use std::function for all policy continuation functions
369         https://bugs.webkit.org/show_bug.cgi?id=124011
370
371         Reviewed by Sam Weinig.
372
373         * loader/DocumentLoader.cpp:
374         (WebCore::DocumentLoader::willSendRequest):
375         (WebCore::DocumentLoader::responseReceived):
376         * loader/DocumentLoader.h:
377         * loader/FrameLoader.cpp:
378         (WebCore::FrameLoader::loadURL):
379         (WebCore::FrameLoader::load):
380         (WebCore::FrameLoader::loadWithDocumentLoader):
381         (WebCore::FrameLoader::loadPostRequest):
382         * loader/PolicyCallback.cpp:
383         (WebCore::PolicyCallback::clear):
384         (WebCore::PolicyCallback::set):
385         (WebCore::PolicyCallback::call):
386         (WebCore::PolicyCallback::clearRequest):
387         (WebCore::PolicyCallback::cancel):
388         * loader/PolicyCallback.h:
389         * loader/PolicyChecker.cpp:
390         (WebCore::PolicyChecker::checkNavigationPolicy):
391         (WebCore::PolicyChecker::checkNewWindowPolicy):
392         (WebCore::PolicyChecker::checkContentPolicy):
393         * loader/PolicyChecker.h:
394
395 2013-11-07  Brady Eidson  <beidson@apple.com>
396
397         Use SQLite journal mode WAL (WriteAheadLogging)
398         https://bugs.webkit.org/show_bug.cgi?id=124009
399
400         Reviewed by Anders Carlsson.
401
402         WriteAheadLogging journalling is better than the traditional rollback model.
403
404         * platform/sql/SQLiteDatabase.cpp:
405         (WebCore::SQLiteDatabase::open): Use a PRAGMA to set journal_mode to WAL.
406
407 2013-11-07  Mark Lam  <mark.lam@apple.com>
408
409         Cosmetic: rename xxxId to xxxID for ScriptId, SourceId, and BreakpointId.
410         https://bugs.webkit.org/show_bug.cgi?id=123945.
411
412         Reviewed by Geoffrey Garen.
413
414         No new tests.
415
416         * bindings/js/JSInjectedScriptHostCustom.cpp:
417         (WebCore::JSInjectedScriptHost::functionDetails):
418         * bindings/js/JavaScriptCallFrame.h:
419         (WebCore::JavaScriptCallFrame::sourceID):
420         * bindings/js/ScriptDebugServer.cpp:
421         (WebCore::ScriptDebugServer::ScriptDebugServer):
422         (WebCore::ScriptDebugServer::setBreakpoint):
423         (WebCore::ScriptDebugServer::removeBreakpoint):
424         (WebCore::ScriptDebugServer::hasBreakpoint):
425         (WebCore::ScriptDebugServer::clearBreakpoints):
426         (WebCore::ScriptDebugServer::updateCallFrame):
427         (WebCore::ScriptDebugServer::pauseIfNeeded):
428         * bindings/js/ScriptDebugServer.h:
429         * inspector/InspectorConsoleAgent.cpp:
430         (WebCore::InspectorConsoleAgent::addMessageToConsole):
431         * inspector/InspectorConsoleAgent.h:
432         * inspector/InspectorConsoleInstrumentation.h:
433         (WebCore::InspectorInstrumentation::addMessageToConsole):
434         * inspector/InspectorDOMAgent.cpp:
435         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
436         * inspector/InspectorDebuggerAgent.cpp:
437         (WebCore::InspectorDebuggerAgent::setBreakpointByUrl):
438         (WebCore::parseLocation):
439         (WebCore::InspectorDebuggerAgent::setBreakpoint):
440         (WebCore::InspectorDebuggerAgent::removeBreakpoint):
441         (WebCore::InspectorDebuggerAgent::continueToLocation):
442         (WebCore::InspectorDebuggerAgent::resolveBreakpoint):
443         (WebCore::InspectorDebuggerAgent::searchInContent):
444         (WebCore::InspectorDebuggerAgent::setScriptSource):
445         (WebCore::InspectorDebuggerAgent::getScriptSource):
446         (WebCore::InspectorDebuggerAgent::compileScript):
447         (WebCore::InspectorDebuggerAgent::runScript):
448         (WebCore::InspectorDebuggerAgent::didParseSource):
449         (WebCore::InspectorDebuggerAgent::didPause):
450         (WebCore::InspectorDebuggerAgent::clear):
451         (WebCore::InspectorDebuggerAgent::reset):
452         * inspector/InspectorDebuggerAgent.h:
453         * inspector/InspectorInstrumentation.cpp:
454         (WebCore::InspectorInstrumentation::addMessageToConsoleImpl):
455         * inspector/InspectorInstrumentation.h:
456         * inspector/ScriptDebugListener.h:
457
458 2013-11-07  Cidorvan Leite  <cidorvan.leite@openbossa.org>
459
460         Avoid invalid cairo matrix when drawing surfaces too small
461         https://bugs.webkit.org/show_bug.cgi?id=123810
462
463         Drawing surfaces too small makes inverse matrix with values too big,
464         when this happen, cairo context is not valid anymore and it stops to draw anything.
465
466         Reviewed by Martin Robinson.
467
468         Test: fast/canvas/drawImage-with-small-values.html
469
470         * platform/graphics/cairo/PlatformContextCairo.cpp:
471         (WebCore::PlatformContextCairo::drawSurfaceToContext):
472
473 2013-11-07  Antti Koivisto  <antti@apple.com>
474
475         Simple line layout crashes with SVG fonts
476         https://bugs.webkit.org/show_bug.cgi?id=124002
477
478         Reviewed by Simon Fraser.
479         
480         Don't use simple line layout for flows using SVG fonts. They crash if kerning is enabled.
481
482         Test: fast/text/svg-font-simple-line-crash.html
483
484         * platform/graphics/Font.h:
485         (WebCore::Font::isSVGFont):
486         
487             Add isSVGFont() so callers don't need to go via primaryFont().
488
489         * rendering/InlineTextBox.cpp:
490         (WebCore::InlineTextBox::constructTextRun):
491         * rendering/RenderBlock.cpp:
492         (WebCore::constructTextRunInternal):
493         * rendering/SimpleLineLayout.cpp:
494         (WebCore::SimpleLineLayout::canUseFor):
495         
496             Disallow SVG fonts.
497
498         * rendering/svg/SVGInlineTextBox.cpp:
499         (WebCore::SVGInlineTextBox::constructTextRun):
500         * rendering/svg/SVGTextMetrics.cpp:
501         (WebCore::SVGTextMetrics::constructTextRun):
502         (WebCore::SVGTextMetrics::SVGTextMetrics):
503         * rendering/svg/SVGTextRunRenderingContext.h:
504         
505             Get rid of the abstract textRunNeedsRenderingContext in favor of just testing isSVGFont().
506
507 2013-11-07  Simon Fraser  <simon.fraser@apple.com>
508
509         Allow customization of the contentsScale of TileController tiles
510         https://bugs.webkit.org/show_bug.cgi?id=124004
511
512         Reviewed by Tim Horton.
513
514         On some platorms, zooming out on pages with TiledBacking compositing
515         layers can cause very high memory use, because the TiledBacking retains
516         the original page scale while the zoom is in flight, but can be asked
517         to cover a large area.
518         
519         Make it possible to reduce memory use in this case by allowing RenderLayerCompositor
520         to provide an additional scale factor for newly created tiles. Platforms can
521         then customize this to create low-res tiles when necessary.
522
523         * WebCore.exp.in:
524         * platform/graphics/GraphicsLayerClient.h:
525         (WebCore::GraphicsLayerClient::contentsScaleMultiplierForNewTiles):
526         * platform/graphics/ca/GraphicsLayerCA.cpp:
527         (WebCore::GraphicsLayerCA::platformCALayerContentsScaleMultiplierForNewTiles):
528         * platform/graphics/ca/GraphicsLayerCA.h:
529         * platform/graphics/ca/PlatformCALayerClient.h:
530         (WebCore::PlatformCALayerClient::platformCALayerContentsScaleMultiplierForNewTiles):
531         * platform/graphics/ca/mac/TileController.h:
532         * platform/graphics/ca/mac/TileController.mm:
533         (WebCore::TileController::TileController):
534         (WebCore::TileController::setScale):
535         (WebCore::TileController::createTileLayer):
536         * rendering/RenderLayerBacking.cpp:
537         (WebCore::RenderLayerBacking::contentsScaleMultiplierForNewTiles):
538         * rendering/RenderLayerBacking.h:
539         * rendering/RenderLayerCompositor.cpp:
540         (WebCore::RenderLayerCompositor::contentsScaleMultiplierForNewTiles):
541         * rendering/RenderLayerCompositor.h:
542
543 2013-11-07  Jer Noble  <jer.noble@apple.com>
544
545         Unreviewed Win build fix after r158855; wrap shapeInfoForFloat() in an ENABLE(CSS_SHAPES) guard.
546
547         * rendering/FloatingObjects.cpp:
548
549 2013-11-07  Bem Jones-Bey  <bjonesbe@adobe.com>
550
551         Refactor logical left/right offset for line methods
552         https://bugs.webkit.org/show_bug.cgi?id=123898
553
554         Reviewed by David Hyatt.
555
556         Simplify the logical left/right offset for line methods and their
557         implementation, including the ComputeFloatOffsetAdapter. This also
558         reduces the number of line offset methods in RenderBlock.
559
560         No new tests, no behavior change.
561
562         * rendering/FloatingObjects.cpp:
563         (WebCore::ComputeFloatOffsetAdapter::ComputeFloatOffsetAdapter):
564         (WebCore::ComputeFloatOffsetAdapter::offset): Add a method to return
565             the offset instead of using a confusing out parameter.
566         (WebCore::::shapeOffset): Method to return the offset modified by the
567             shape delta. Moving the computation to this method allowed for
568             simplification of the users of ComputeFloatOffsetAdapter.
569         (WebCore::FloatingObjects::logicalLeftOffsetForPositioningFloat): Added this
570             method so that ShapeOutsideFloatOffsetMode isn't needed. Returns the
571             offset based on the float margin box.
572         (WebCore::FloatingObjects::logicalRightOffsetForPositioningFloat): Ditto.
573         (WebCore::FloatingObjects::logicalLeftOffset): This now only returns
574             the offset based on the shape's contour.
575         (WebCore::FloatingObjects::logicalRightOffset): Ditto.
576         (WebCore::::heightRemaining): Rename to properly follow the getter
577             naming convention.
578         * rendering/FloatingObjects.h:
579         * rendering/RenderBlock.h:
580         (WebCore::RenderBlock::logicalRightOffsetForLine): Update to remove
581             use of ShapeOutsideFloatOffsetMode and heightRemaining.
582         (WebCore::RenderBlock::logicalLeftOffsetForLine): Ditto.
583         (WebCore::RenderBlock::logicalRightFloatOffsetForLine): Ditto.
584         (WebCore::RenderBlock::logicalLeftFloatOffsetForLine): Ditto.
585         * rendering/RenderBlockFlow.cpp:
586         (WebCore::RenderBlockFlow::logicalLeftOffsetForPositioningFloat):
587             Positioning a float is the only case where the float margin box
588             should be used, and also the only case where heightRemaining is
589             needed. This handles that case.
590         (WebCore::RenderBlockFlow::logicalRightOffsetForPositioningFloat):
591             Ditto.
592         (WebCore::RenderBlockFlow::computeLogicalLocationForFloat): Update to
593             use logical(Left|Right)OffsetForPositioningFloatOnLine.
594         (WebCore::RenderBlockFlow::logicalLeftFloatOffsetForLine): Update to
595             remove use for ShapeOutsideFloatOffsetMode and heightRemaining.
596         (WebCore::RenderBlockFlow::logicalRightFloatOffsetForLine): Ditto.
597         * rendering/RenderBlockFlow.h:
598
599 2013-11-07  Alexandru Chiculita  <achicu@adobe.com>
600
601         Web Inspector: CSS Regions: Removing a content node of a ContentFlow from the DOM will send a 0 nodeId
602         https://bugs.webkit.org/show_bug.cgi?id=123577
603
604         Reviewed by Timothy Hatcher.
605
606         Test: inspector-protocol/model/content-flow-content-removal.html
607
608         Do not send unregister events for the content nodes of a flow when the element is not part of the DOM
609         anymore. We already send an unbind event, so the inspector is already notified that the node was removed.
610
611         * inspector/InspectorCSSAgent.cpp:
612         (WebCore::InspectorCSSAgent::didUnregisterNamedFlowContentElement):
613
614 2013-10-30  Jer Noble  <jer.noble@apple.com>
615
616         [MSE] Add mock MediaSource classes for testing.
617         https://bugs.webkit.org/show_bug.cgi?id=123322
618
619         Reviewed by Eric Carlson.
620
621         Tests: media/media-source/media-source-addsourcebuffer.html
622                media/media-source/media-source-append-buffer.html
623                media/media-source/media-source-canplaythrough.html
624                media/media-source/media-source-closed.html
625                media/media-source/media-source-play.html
626                media/media-source/media-source-track-enabled.html
627                media/media-source/media-source-tracks.html
628
629
630         Add mock implementation of platform MediaSource classes, allowing ports to test the
631         MediaSource API without having a platform implementation.
632
633         The MockMediaSource will support a byteformat defined in MockBox.h: a simple box-style media
634         format with an initialization segment containing a number of tracks, followed by a list of
635         samples.
636
637         Add a means to insert a new media engine factory at runtime, so the internals object can add
638         a MockMediaSourceMediaPlayer:
639         * platform/graphics/MediaPlayer.cpp:
640         (WebCore::MediaPlayerFactorySupport::callRegisterMediaEngine):
641         * platform/graphics/MediaPlayer.h:
642         * testing/Internals.cpp:
643         (WebCore::Internals::initializeMockMediaSource):
644         * testing/Internals.h:
645         * testing/Internals.idl:
646
647         For non-media-source supporting media engines, fail immediately when asked to load a media
648         source, so that the MockMediaSourceMediaPlayer will be instantiated as a fall-back:
649         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
650         (WebCore::MediaPlayerPrivateAVFoundation::load):
651         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
652         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
653         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
654         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
655         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
656         (WebCore::MediaPlayerPrivateQTKit::load):
657         (WebCore::MediaPlayerPrivateQTKit::supportsType):
658
659         Add new files to the project:
660         * WebCore.xcodeproj/project.pbxproj:
661         * Source/WebCore/WebCore.exp.in:
662
663         Update the MediaSource implementation:
664         * Modules/mediasource/MediaSource.cpp:
665         (WebCore::MediaSource::monitorSourceBuffers): Add a link to the spec.
666         * Modules/mediasource/SourceBuffer.cpp:
667         (WebCore::SourceBuffer::buffered): Ditto.
668         (WebCore::SourceBuffer::setTimestampOffset): Ditto.
669         (WebCore::SourceBuffer::validateInitializationSegment): Ditto.
670         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment): Ditto. Also,
671             bring the implementation up to date with part of the spec.
672         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): Remove "Predicate" from
673             SampleIsRandomAccessPredicate.
674
675         Add utility classes to parse and represent the bytestream supported by the MockMediaSource:
676         * platform/mock/mediasource/MockBox.cpp: Added.
677         (WebCore::MockBox::MockBox):
678         (WebCore::MockBox::peekType):
679         (WebCore::MockBox::peekLength):
680         (WebCore::MockTrackBox::MockTrackBox):
681         (WebCore::MockTrackBox::type):
682         (WebCore::MockInitializationBox::MockInitializationBox):
683         (WebCore::MockInitializationBox::type):
684         (WebCore::MockSampleBox::MockSampleBox):
685         (WebCore::MockSampleBox::type):
686         * platform/mock/mediasource/MockBox.h: Added.
687         (WebCore::MockBox::length):
688         (WebCore::MockBox::type):
689         (WebCore::MockTrackBox::trackID):
690         (WebCore::MockTrackBox::codec):
691         (WebCore::MockTrackBox::kind):
692         (WebCore::MockInitializationBox::duration):
693         (WebCore::MockInitializationBox::tracks):
694         (WebCore::MockSampleBox::presentationTimestamp):
695         (WebCore::MockSampleBox::decodeTimestamp):
696         (WebCore::MockSampleBox::duration):
697         (WebCore::MockSampleBox::trackID):
698         (WebCore::MockSampleBox::flags):
699         (WebCore::MockSampleBox::isSync):
700
701         Add a MediaPlayerPrivate implementation which uses MockMediaSource:
702         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp: Added.
703         (WebCore::MockMediaPlayerMediaSource::registerMediaEngine):
704         (WebCore::MockMediaPlayerMediaSource::create):
705         (WebCore::mimeTypeCache):
706         (WebCore::MockMediaPlayerMediaSource::getSupportedTypes):
707         (WebCore::MockMediaPlayerMediaSource::supportsType):
708         (WebCore::MockMediaPlayerMediaSource::MockMediaPlayerMediaSource):
709         (WebCore::MockMediaPlayerMediaSource::~MockMediaPlayerMediaSource):
710         (WebCore::MockMediaPlayerMediaSource::load):
711         (WebCore::MockMediaPlayerMediaSource::cancelLoad):
712         (WebCore::MockMediaPlayerMediaSource::play):
713         (WebCore::MockMediaPlayerMediaSource::pause):
714         (WebCore::MockMediaPlayerMediaSource::naturalSize):
715         (WebCore::MockMediaPlayerMediaSource::hasVideo):
716         (WebCore::MockMediaPlayerMediaSource::hasAudio):
717         (WebCore::MockMediaPlayerMediaSource::setVisible):
718         (WebCore::MockMediaPlayerMediaSource::seeking):
719         (WebCore::MockMediaPlayerMediaSource::paused):
720         (WebCore::MockMediaPlayerMediaSource::networkState):
721         (WebCore::MockMediaPlayerMediaSource::readyState):
722         (WebCore::MockMediaPlayerMediaSource::buffered):
723         (WebCore::MockMediaPlayerMediaSource::didLoadingProgress):
724         (WebCore::MockMediaPlayerMediaSource::setSize):
725         (WebCore::MockMediaPlayerMediaSource::paint):
726         (WebCore::MockMediaPlayerMediaSource::currentTimeDouble):
727         (WebCore::MockMediaPlayerMediaSource::durationDouble):
728         (WebCore::MockMediaPlayerMediaSource::seekDouble):
729         (WebCore::MockMediaPlayerMediaSource::advanceCurrentTime):
730         (WebCore::MockMediaPlayerMediaSource::updateDuration):
731         (WebCore::MockMediaPlayerMediaSource::setReadyState):
732         * platform/mock/mediasource/MockMediaPlayerMediaSource.h: Added.
733
734         Add a mock implementation of MediaSourcePrivate, which uses MockSourceBuffer:
735         * platform/mock/mediasource/MockMediaSourcePrivate.cpp: Added.
736         (WebCore::MockMediaSourcePrivate::create):
737         (WebCore::MockMediaSourcePrivate::MockMediaSourcePrivate):
738         (WebCore::MockMediaSourcePrivate::~MockMediaSourcePrivate):
739         (WebCore::MockMediaSourcePrivate::addSourceBuffer):
740         (WebCore::MockMediaSourcePrivate::removeSourceBuffer):
741         (WebCore::MockMediaSourcePrivate::duration):
742         (WebCore::MockMediaSourcePrivate::setDuration):
743         (WebCore::MockMediaSourcePrivate::markEndOfStream):
744         (WebCore::MockMediaSourcePrivate::unmarkEndOfStream):
745         (WebCore::MockMediaSourcePrivate::readyState):
746         (WebCore::MockMediaSourcePrivate::setReadyState):
747         (WebCore::MockMediaSourcePrivate::sourceBufferPrivateDidChangeActiveState):
748         (WebCore::MockSourceBufferPrivateHasAudio):
749         (WebCore::MockMediaSourcePrivate::hasAudio):
750         (WebCore::MockSourceBufferPrivateHasVideo):
751         (WebCore::MockMediaSourcePrivate::hasVideo):
752         * platform/mock/mediasource/MockMediaSourcePrivate.h: Added.
753         (WebCore::MockMediaSourcePrivate::activeSourceBuffers):
754         (WebCore::MockMediaSourcePrivate::player):
755
756         Add a mock implementation of SourceBufferPrivate, which uses MockBoxes to parse the
757         bytestream provided by SourceBuffer:
758         * platform/mock/mediasource/MockSourceBufferPrivate.cpp: Added.
759         (WebCore::MockMediaSample::create):
760         (WebCore::MockMediaSample::~MockMediaSample):
761         (WebCore::MockMediaSample::MockMediaSample):
762         (WebCore::MockMediaSample::platformSample):
763         (WebCore::MockMediaDescription::create):
764         (WebCore::MockMediaDescription::~MockMediaDescription):
765         (WebCore::MockMediaDescription::MockMediaDescription):
766         (WebCore::MockSourceBufferPrivate::create):
767         (WebCore::MockSourceBufferPrivate::MockSourceBufferPrivate):
768         (WebCore::MockSourceBufferPrivate::~MockSourceBufferPrivate):
769         (WebCore::MockSourceBufferPrivate::setClient):
770         (WebCore::MockSourceBufferPrivate::append):
771         (WebCore::MockSourceBufferPrivate::didReceiveInitializationSegment):
772         (WebCore::MockSourceBufferPrivate::didReceiveSample):
773         (WebCore::MockSourceBufferPrivate::abort):
774         (WebCore::MockSourceBufferPrivate::removedFromMediaSource):
775         (WebCore::MockSourceBufferPrivate::readyState):
776         (WebCore::MockSourceBufferPrivate::setReadyState):
777         (WebCore::MockSourceBufferPrivate::hasVideo):
778         (WebCore::MockSourceBufferPrivate::hasAudio):
779         * platform/mock/mediasource/MockSourceBufferPrivate.h: Added.
780
781         Create mock implementations of AudioTrackPrivate, VideoTrackPrivate, and TextTrackPrivate
782         which wrap the MockTrackBox class:
783         * platform/mock/mediasource/MockTracks.cpp: Added.
784         * platform/mock/mediasource/MockTracks.h: Added.
785         (WebCore::MockAudioTrackPrivate::create):
786         (WebCore::MockAudioTrackPrivate::~MockAudioTrackPrivate):
787         (WebCore::MockAudioTrackPrivate::id):
788         (WebCore::MockAudioTrackPrivate::MockAudioTrackPrivate):
789         (WebCore::MockTextTrackPrivate::create):
790         (WebCore::MockTextTrackPrivate::~MockTextTrackPrivate):
791         (WebCore::MockTextTrackPrivate::id):
792         (WebCore::MockTextTrackPrivate::MockTextTrackPrivate):
793         (WebCore::MockVideoTrackPrivate::create):
794         (WebCore::MockVideoTrackPrivate::~MockVideoTrackPrivate):
795         (WebCore::MockVideoTrackPrivate::id):
796         (WebCore::MockVideoTrackPrivate::MockVideoTrackPrivate):
797
798 2013-11-07  Thiago de Barros Lacerda  <thiago.lacerda@openbossa.org>
799
800         Changing MediaStreamDescriptor to MediaStreamPrivate
801         https://bugs.webkit.org/show_bug.cgi?id=123935
802
803         Reviewed by Eric Carlson.
804
805         No new tests needed.
806
807         * CMakeLists.txt:
808         * GNUmakefile.list.am:
809         * Modules/mediastream/MediaStream.cpp:
810         (WebCore::MediaStream::create):
811         (WebCore::MediaStream::MediaStream):
812         (WebCore::MediaStream::~MediaStream):
813         (WebCore::MediaStream::ended):
814         (WebCore::MediaStream::setEnded):
815         (WebCore::MediaStream::addTrack):
816         (WebCore::MediaStream::removeTrack):
817         (WebCore::MediaStream::removeRemoteSource):
818         * Modules/mediastream/MediaStream.h:
819         * Modules/mediastream/MediaStreamRegistry.cpp:
820         (WebCore::MediaStreamRegistry::registerURL):
821         (WebCore::MediaStreamRegistry::unregisterURL):
822         (WebCore::MediaStreamRegistry::lookupMediaStreamPrivate):
823         * Modules/mediastream/MediaStreamRegistry.h:
824         * Modules/mediastream/MediaStreamTrack.cpp:
825         * Modules/mediastream/MediaStreamTrack.h:
826         * Modules/mediastream/RTCPeerConnection.cpp:
827         (WebCore::RTCPeerConnection::addStream):
828         (WebCore::RTCPeerConnection::removeStream):
829         (WebCore::RTCPeerConnection::didAddRemoteStream):
830         (WebCore::RTCPeerConnection::didRemoveRemoteStream):
831         * Modules/mediastream/RTCPeerConnection.h:
832         * Modules/mediastream/UserMediaRequest.cpp:
833         (WebCore::UserMediaRequest::didCreateStream):
834         (WebCore::UserMediaRequest::callSuccessHandler):
835         * Modules/mediastream/UserMediaRequest.h:
836         * Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
837         (WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode):
838         * WebCore.xcodeproj/project.pbxproj:
839         * html/HTMLMediaElement.cpp:
840         (HTMLMediaElement::loadResource):
841         * platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp:
842         (WebCore::toWebMediaStreamPrivate):
843         (WebCore::MediaPlayerPrivate::lookupMediaStream):
844         * platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.h:
845         * platform/mediastream/MediaStreamCenter.cpp:
846         * platform/mediastream/MediaStreamCreationClient.h:
847         * platform/mediastream/MediaStreamPrivate.cpp: Renamed from Source/WebCore/platform/mediastream/MediaStreamDescriptor.cpp.
848         (WebCore::MediaStreamPrivate::create):
849         (WebCore::MediaStreamPrivate::addSource):
850         (WebCore::MediaStreamPrivate::removeSource):
851         (WebCore::MediaStreamPrivate::addRemoteSource):
852         (WebCore::MediaStreamPrivate::removeRemoteSource):
853         (WebCore::MediaStreamPrivate::addRemoteTrack):
854         (WebCore::MediaStreamPrivate::removeRemoteTrack):
855         (WebCore::MediaStreamPrivate::MediaStreamPrivate):
856         (WebCore::MediaStreamPrivate::setEnded):
857         (WebCore::MediaStreamPrivate::addTrack):
858         (WebCore::MediaStreamPrivate::removeTrack):
859         * platform/mediastream/MediaStreamPrivate.h: Renamed from Source/WebCore/platform/mediastream/MediaStreamDescriptor.h.
860         (WebCore::MediaStreamPrivateClient::~MediaStreamPrivateClient):
861         (WebCore::MediaStreamPrivate::~MediaStreamPrivate):
862         (WebCore::MediaStreamPrivate::client):
863         (WebCore::MediaStreamPrivate::setClient):
864         (WebCore::MediaStreamPrivate::id):
865         (WebCore::MediaStreamPrivate::numberOfAudioSources):
866         (WebCore::MediaStreamPrivate::audioSources):
867         (WebCore::MediaStreamPrivate::numberOfVideoSources):
868         (WebCore::MediaStreamPrivate::videoSources):
869         (WebCore::MediaStreamPrivate::numberOfAudioTracks):
870         (WebCore::MediaStreamPrivate::audioTracks):
871         (WebCore::MediaStreamPrivate::numberOfVideoTracks):
872         (WebCore::MediaStreamPrivate::videoTracks):
873         (WebCore::MediaStreamPrivate::ended):
874         * platform/mediastream/MediaStreamSource.cpp:
875         * platform/mediastream/MediaStreamSource.h:
876         * platform/mediastream/RTCPeerConnectionHandler.h:
877         * platform/mediastream/RTCPeerConnectionHandlerClient.h:
878         * platform/mediastream/blackberry/MediaStreamCenterBlackBerry.cpp:
879         * platform/mediastream/blackberry/MediaStreamCenterBlackBerry.h:
880         * platform/mediastream/gstreamer/MediaStreamCenterGStreamer.cpp:
881         * platform/mediastream/gstreamer/MediaStreamCenterGStreamer.h:
882         * platform/mediastream/mac/MediaStreamCenterMac.cpp:
883         (WebCore::MediaStreamCenterMac::createMediaStream):
884         * platform/mock/MockMediaStreamCenter.cpp:
885         (WebCore::MockMediaStreamCenter::createMediaStream):
886         * platform/mock/RTCPeerConnectionHandlerMock.cpp:
887         (WebCore::RTCPeerConnectionHandlerMock::addStream):
888         (WebCore::RTCPeerConnectionHandlerMock::removeStream):
889         * platform/mock/RTCPeerConnectionHandlerMock.h:
890
891 2013-11-07  Denis Nomiyama  <d.nomiyama@samsung.com>
892
893         [GTK] Glyphs in vertical text tests are rotated 90 degrees clockwise
894         https://bugs.webkit.org/show_bug.cgi?id=50619
895
896         Reviewed by Martin Robinson.
897
898         Implemented the OPENTYPE_VERTICAL feature for the GTK+ port. It resolves
899         the 90 degrees rotation problem of CJK characters when displaying
900         vertical text.
901
902         New tests are not required as the existing tests for vertical text will
903         work properly now.
904
905         * GNUmakefile.list.am: Added OpenTypeVerticalData.cpp and
906         OpenTypeVerticalData.h to platformgtk_sources.
907         * PlatformEfl.cmake: Added OpenTypeVerticalData.cpp.
908         * PlatformGTK.cmake: Added OpenTypeVerticalData.cpp.
909         * platform/graphics/FontCache.cpp: Originally the HashMap for
910         OpenTypeVerticalData was designed with FontFileKey as integer in the
911         Chromium port, which was an unique number provided by Skia. Since other
912         ports use FontFileKey as string, new generic hash functions had to be
913         implemented instead of using the specific ones for integers.
914         (WebCore::FontVerticalDataCacheKeyHash::hash): New hash function for
915         HashMap of OpenTypeVerticalData.
916         (WebCore::FontVerticalDataCacheKeyHash::equal): New function for
917         comparing hash indexes in the HashMap of OpenTypeVerticalData.
918         (WebCore::FontVerticalDataCacheKeyTraits::emptyValue): New function for
919         giving an empty FontFileKey.
920         (WebCore::FontVerticalDataCacheKeyTraits::constructDeletedValue): New
921         function to create a FontFileKey for deleted values.
922         (WebCore::FontVerticalDataCacheKeyTraits::isDeletedValue): New function
923         to check if a HashMap entry is available.
924         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
925         (WebCore::FontCustomPlatformData::fontPlatformData): Added font
926         orientation as a parameter to the FontPlatformData constructor.
927         * platform/graphics/freetype/FontPlatformData.h: Added m_orientation to
928         store the font orientation and m_horizontalOrientationMatrix to store
929         the Cairo matrix for horizontal orientation, which can be restored in
930         setOrientation().
931         (WebCore::FontPlatformData::FontPlatformData): Added font orientation as
932         a parameter.
933         (WebCore::FontPlatformData::orientation): Implemented this function
934         based on m_orientation.
935         * platform/graphics/freetype/FontPlatformDataFreeType.cpp: Added new
936         helper function rotateCairoMatrixForVerticalOrientation() to rotate the
937         Cairo matrix in case of vertical orientation.
938         (WebCore::FontPlatformData::FontPlatformData): Initialized
939         m_orientation.
940         (WebCore::FontPlatformData::operator=): Added m_orientation and
941         m_horizontalOrientationMatrix to the assignment operator.
942         (WebCore::FontPlatformData::operator==): Added m_orientation to the
943         equal operator.
944         (WebCore::FontPlatformData::initializeWithFontFace): Rotated and
945         translated fonts if orientation is vertical. Also stored the horizontal
946         Cairo matrix.
947         (WebCore::FontPlatformData::verticalData): Returned the vertical data
948         from the font cache.
949         (WebCore::FontPlatformData::openTypeTable): Loaded the font table into
950         a shared buffer.
951         (WebCore::FontPlatformData::setOrientation): Replaced the scaled font
952         data by rotating fonts according to the new orientation.
953         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
954         (WebCore::SimpleFontData::platformInit): Set the glyph's height and
955         width according to the font orientation. It also sets EM.
956         (WebCore::SimpleFontData::platformCreateScaledFontData): Added
957         orientation to the FontPlatformData constructor.
958         (WebCore::SimpleFontData::platformWidthForGlyph): Returned the glyph's
959         width according the orientation.
960         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
961         (WebCore::CairoGetGlyphWidthAndExtents): Obtained the character advance
962         and extents according to the font orientation.
963
964 2013-11-07  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
965
966         [AX] Use toAccessibilityRenderObject() instead of using static_cast<>
967         https://bugs.webkit.org/show_bug.cgi?id=123986
968
969         Reviewed by Mario Sanchez Prada.
970
971         Though there is toAccessibilityRenderObject(), static_cast<> are being used by many places.
972         To use toAccessibilityRenderObject() is more helpful to find bad type cast.
973
974         No new tests, no behavior changes.
975
976         * accessibility/AXObjectCache.cpp:
977         (WebCore::AXObjectCache::notificationPostTimerFired):
978         * accessibility/AccessibilityImageMapLink.cpp:
979         (WebCore::AccessibilityImageMapLink::imageMapLinkRenderer):
980         * accessibility/AccessibilityRenderObject.cpp:
981         (WebCore::AccessibilityRenderObject::handleActiveDescendantChanged):
982         (WebCore::AccessibilityRenderObject::inheritsPresentationalRole):
983         * accessibility/ios/AccessibilityObjectIOS.mm:
984         (WebCore::AccessibilityObject::accessibilityPasswordFieldLength):
985         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
986         (AXAttributeStringSetElement):
987         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
988
989 2013-11-07  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
990
991         [AX] Use toAccessibilityTable() instead of using manual static_cast<>
992         https://bugs.webkit.org/show_bug.cgi?id=123982
993
994         Reviewed by Mario Sanchez Prada.
995
996         Though there is toAccessibilityTable(), static_cast<> are being used by many places.
997         We need to use toAccessibilityTable().
998
999         No new tests, no behavior changes.
1000
1001         * accessibility/AccessibilityARIAGridRow.cpp:
1002         (WebCore::AccessibilityARIAGridRow::disclosedRows):
1003         (WebCore::AccessibilityARIAGridRow::disclosedByRow):
1004         * accessibility/AccessibilityTableHeaderContainer.cpp:
1005         (WebCore::AccessibilityTableHeaderContainer::addChildren):
1006         * accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
1007         (cell):
1008         (cellAtIndex):
1009         (webkitAccessibleTableGetIndexAt):
1010         (webkitAccessibleTableGetNColumns):
1011         (webkitAccessibleTableGetNRows):
1012         (webkitAccessibleTableGetColumnHeader):
1013         (webkitAccessibleTableGetRowHeader):
1014         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1015         (-[WebAccessibilityObjectWrapper tableParent]):
1016         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1017         (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
1018         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1019         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
1020
1021 2013-11-07  Andreas Kling  <akling@apple.com>
1022
1023         Use tighter InlineBox subtypes in some places.
1024         <https://webkit.org/b/123980>
1025
1026         RenderLineBreak and RenderBox line box wrappers are always going to
1027         be InlineElementBox, so codify this with tighter types. Also made
1028         the various positionLine() functions take tighter reference types.
1029
1030         All the casting to renderer-appropriate box types happens inside of
1031         RenderBlockFlow::computeBlockDirectionPositionsForLine() and
1032         propagates from there.
1033
1034         Reviewed by Antti Koivisto.
1035
1036 2013-11-07  Mario Sanchez Prada  <mario.prada@samsung.com>
1037
1038         AX: [ATK] Video and audio elements are not properly exposed
1039         https://bugs.webkit.org/show_bug.cgi?id=123894
1040
1041         Reviewed by Chris Fleizach.
1042
1043         Expose <audio> and <video> elements with ATK_ROLE_EMBEDDED, so we
1044         can identify them properly from ATK/AT-SPI based ATs.
1045
1046         Tests: platform/gtk/accessibility/media-controls-panel-title.html
1047                platform/efl/accessibility/media-emits-object-replacement.html
1048                platform/gtk/accessibility/media-emits-object-replacement.html
1049
1050         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1051         (atkRole): Add the new mapping.
1052
1053 2013-11-07  Laszlo Vidacs  <lac@inf.u-szeged.hu>
1054         
1055         Fix crash in BitmapImage::destroyDecodedData()
1056         https://bugs.webkit.org/show_bug.cgi?id=116494
1057
1058         Reviewed by Csaba Osztrogonác.
1059
1060         Merge from https://chromium.googlesource.com/chromium/blink/+/6b6887bf53068f8537908e501fdc7317ad2c6d86
1061
1062         * platform/graphics/BitmapImage.cpp:
1063         (WebCore::BitmapImage::destroyDecodedData):
1064
1065 2013-11-06  Sergio Villar Senin  <svillar@igalia.com>
1066
1067         [CSS Grid Layout] CSSParser should reject <track-list> without a <track-size>
1068         https://bugs.webkit.org/show_bug.cgi?id=118025
1069
1070         Reviewed by Andreas Kling.
1071
1072         From Blink r152914 by <jchaffraix@chromium.org>
1073
1074         Make sure that we parse at least 1 <track-size> inside each
1075         <track-list>. The old parser code allowed track-lists exclusively
1076         made of <track-name>. The way it was implemented eases the future
1077         addition of parsing for the repeat() function.
1078
1079         * css/CSSParser.cpp:
1080         (WebCore::CSSParser::parseGridTrackList):
1081         * css/StyleResolver.cpp:
1082         (WebCore::createGridTrackList): ASSERT if we don't find any
1083         <track-size> now that we detect their absence in the parser.
1084
1085 2013-11-06  Sergio Villar Senin  <svillar@igalia.com>
1086
1087         [CSS Grid Layout] Fix handling of 'inherit' and 'initial' for grid lines
1088         https://bugs.webkit.org/show_bug.cgi?id=115401
1089
1090         Reviewed by Andreas Kling.
1091
1092         From Blink r150585 by <jchaffraix@chromium.org>
1093
1094         Added support for 'inherit' and 'initial' special values to
1095         grid-auto-{columns|rows} and grid-definition-{columns|rows}.
1096
1097         * css/StyleResolver.cpp:
1098         (WebCore::StyleResolver::applyProperty): Resolve 'initial' and 'inherit'.
1099         * rendering/style/RenderStyle.h: Added initialNamedGrid{Column|Row}Lines().
1100         * rendering/style/StyleGridData.cpp:
1101         (WebCore::StyleGridData::StyleGridData): Initialize m_namedGrid{Column|Row}Lines.
1102
1103 2013-11-07  Andreas Kling  <akling@apple.com>
1104
1105         Clean up BidiRun a little bit.
1106         <https://webkit.org/b/123964>
1107
1108         Make BidiRun's member variables private and add accessors for them.
1109         In doing so, codify the following:
1110
1111             - BidiRun always has a corresponding RenderObject.
1112             - The inline box is never cleared after being set.
1113
1114         Reviewed by Antti Koivisto.
1115
1116 2013-11-07  Andreas Kling  <akling@apple.com>
1117
1118         More CSSPrimitiveValue constructors should return PassRef.
1119         <https://webkit.org/b/123953>
1120
1121         Make some more CSSPrimitiveValue constructor helpers (that are
1122         known to never return null) return PassRef instead of PassRefPtr.
1123
1124         Reviewed by Antti Koivisto.
1125
1126 2013-11-07  Andreas Kling  <akling@apple.com>
1127
1128         Generate type casting helpers for line boxes and use them.
1129         <https://webkit.org/b/123976>
1130
1131         Semi-automatically generate the full set of toFooInlineBox()
1132         helpers with macros instead of having them (partially) hand-coded.
1133         Replaced static_casts with the new helpers across the codebase.
1134
1135         Also made the isFooInlineBox() overrides private since they should
1136         never be called when the type is already known.
1137
1138         Reviewed by Antti Koivisto.
1139
1140 2013-11-07  Ryosuke Niwa  <rniwa@webkit.org>
1141
1142         Simplify Attr by removing m_specified member variable and setter
1143         https://bugs.webkit.org/show_bug.cgi?id=123965
1144
1145         Reviewed by Andreas Kling.
1146
1147         Merge https://chromium.googlesource.com/chromium/blink/+/597f44ec928e08820574728889adabc6d8ecd746
1148
1149         m_specified is always true in WebKit so simply return true in Attr::specified().
1150
1151         * dom/Attr.cpp:
1152         (WebCore::Attr::Attr):
1153         * dom/Attr.h:
1154         * dom/Document.cpp:
1155         (WebCore::Document::adoptNode):
1156
1157 2013-10-25  Jer Noble  <jer.noble@apple.com>
1158
1159         [MSE] Add MediaSource extensions to AudioTrack, VideoTrack, and TextTrack.
1160         https://bugs.webkit.org/show_bug.cgi?id=123374
1161
1162         Reviewed by Eric Carlson.
1163
1164         No tests added; tests will be added when Mock implementations are added in a future patch.
1165
1166         Add new partial interfaces for added methods on AudioTrack, TextTrack, and VideoTrack:
1167         * Modules/mediasource/AudioTrackMediaSource.idl: Add read-only sourceBuffer attribute.
1168         * Modules/mediasource/TextTrackMediaSource.idl: Ditto.
1169         * Modules/mediasource/VideoTrackMediaSource.idl: Ditto.
1170         * Modules/mediasource/AudioTrackMediaSource.h:
1171         (WebCore::AudioTrackMediaSource::sourceBuffer): Added static wrapper around non-static sourceBuffer().
1172         * Modules/mediasource/TextTrackMediaSource.h:
1173         (WebCore::TextTrackMediaSource::sourceBuffer): Ditto.
1174         * Modules/mediasource/VideoTrackMediaSource.h:
1175         (WebCore::VideoTrackMediaSource::sourceBuffer): Ditto.
1176
1177         Add support for writable kind & language attributes through a custom setter:
1178         * bindings/js/JSAudioTrackCustom.cpp:
1179         (WebCore::JSAudioTrack::setKind):
1180         (WebCore::JSAudioTrack::setLanguage):
1181         * bindings/js/JSTextTrackCustom.cpp:
1182         (WebCore::JSTextTrack::setKind):
1183         (WebCore::JSTextTrack::setLanguage):
1184         * bindings/js/JSVideoTrackCustom.cpp:
1185         (WebCore::JSVideoTrack::setKind):
1186         (WebCore::JSVideoTrack::setLanguage):
1187         * html/track/AudioTrack.idl:
1188         * html/track/TextTrack.idl:
1189         * html/track/VideoTrack.idl:
1190
1191         Add setter methods to the implementation classes:
1192         * html/track/TextTrack.cpp:
1193         (WebCore::TextTrack::TextTrack):
1194         (WebCore::TextTrack::setKind):
1195         (WebCore::TextTrack::setLanguage):
1196         * html/track/TextTrack.h:
1197         * html/track/TrackBase.cpp:
1198         (WebCore::TrackBase::TrackBase):
1199         (WebCore::TrackBase::setKind):
1200         (WebCore::TrackBase::setKindInternal):
1201         * html/track/TrackBase.h:
1202         (WebCore::TrackBase::setLanguage):
1203         (WebCore::TrackBase::sourceBuffer):
1204         (WebCore::TrackBase::setSourceBuffer):
1205         * html/track/VideoTrack.cpp:
1206         (WebCore::VideoTrack::VideoTrack):
1207         (WebCore::VideoTrack::setKind):
1208         (WebCore::VideoTrack::setLanguage):
1209         * html/track/VideoTrack.h:
1210
1211         Implement the unimplemented portions of MediaSource and SourceBuffer:
1212         * Modules/mediasource/MediaSource.cpp:
1213         (WebCore::MediaSource::removeSourceBuffer):
1214         * Modules/mediasource/MediaSourceBase.cpp:
1215         (WebCore::MediaSourceBase::MediaSourceBase):
1216         (WebCore::MediaSourceBase::setPrivateAndOpen):
1217         (WebCore::MediaSourceBase::setReadyState):
1218         (WebCore::MediaSourceBase::attachToElement):
1219         * Modules/mediasource/MediaSourceBase.h:
1220         (WebCore::MediaSourceBase::mediaElement):
1221         * Modules/mediasource/SourceBuffer.cpp:
1222         (WebCore::SourceBuffer::videoTracks):
1223         (WebCore::SourceBuffer::audioTracks):
1224         (WebCore::SourceBuffer::textTracks):
1225         (WebCore::SourceBuffer::sourceBufferPrivateDidAddAudioTrack):
1226         (WebCore::SourceBuffer::sourceBufferPrivateDidAddVideoTrack):
1227         (WebCore::SourceBuffer::sourceBufferPrivateDidAddTextTrack):
1228         (WebCore::SourceBuffer::sourceBufferPrivateDidChangeActiveState):
1229         * Modules/mediasource/SourceBuffer.h:
1230         * Modules/mediasource/SourceBuffer.idl:
1231
1232         Add new files to the project:
1233         * DerivedSources.make:
1234         * WebCore.xcodeproj/project.pbxproj:
1235
1236         And a smorgasbord of other utility changes:
1237         * html/HTMLMediaElement.cpp:
1238         (WebCore::HTMLMediaElement::loadResource): Pass this when attaching.
1239         (WebCore::HTMLMediaElement::mediaPlayerDidAddTextTrack): Ditto.
1240         * html/HTMLMediaSource.h:
1241         * html/track/TextTrackList.cpp:
1242         (TextTrackList::item): Make const.
1243         * html/track/TextTrackList.h:
1244         (WebCore::TextTrackList::lastItem): Added.
1245         * platform/graphics/InbandTextTrackPrivate.h:
1246         (WebCore::InbandTextTrackPrivate::create): Added.
1247         (WebCore::MockSourceBufferPrivate::trackDidChangeEnabled):
1248
1249 2013-11-06  Vani Hegde  <vani.hegde@samsung.com>
1250
1251         Applied background color is not retained after typing a characters
1252         https://bugs.webkit.org/show_bug.cgi?id=117337
1253
1254         Reviewed by Ryosuke Niwa.
1255
1256         While deleting a selection, only the inheritable style properties
1257         applied on the selection were saved.
1258         Since background color is considered as noninheritable style property,
1259         on deleting the selection, background color set on it was being lost.
1260         Hence on typing in new text, it would not have the applied
1261         background color set.
1262         Fixed by saving editing preoperties that are already in effect
1263         on a selection before deleting it.
1264
1265         Test: editing/style/background-color-retained.html
1266
1267         * editing/DeleteSelectionCommand.cpp:
1268         (WebCore::DeleteSelectionCommand::saveTypingStyleState):
1269         Modified as to save EditingPropertiesInEffect on a selection before
1270         deleting it.
1271
1272 2013-11-06  Andreas Kling  <akling@apple.com>
1273
1274         InlineBox: Make paint() and nodeAtPoint() pure virtuals.
1275         <https://webkit.org/b/123937>
1276
1277         ...and move the current implementations to InlineElementBox.
1278         All subclasses were already overriding these functions so the move
1279         is completely natural.
1280
1281         Reviewed by Anders Carlsson.
1282
1283 2013-11-06  Andreas Kling  <akling@apple.com>
1284
1285         Nothing should return std::unique_ptr<InlineBox>.
1286         <https://webkit.org/b/123936>
1287
1288         Made RenderBox, RenderLineBreak and RenderListMarker return tightly
1289         typed InlineElementBoxes instead.
1290
1291         Reviewed by Anders Carlsson.
1292
1293 2013-11-06  Daniel Bates  <dabates@apple.com>
1294
1295         [iOS] Upstream Letterpress effect
1296         https://bugs.webkit.org/show_bug.cgi?id=123932
1297
1298         Reviewed by Sam Weinig.
1299
1300         Test: platform/iphone-simulator/iphone/getComputedStyle-text-decoration-letterpress.html
1301
1302         * Configurations/FeatureDefines.xcconfig: Add feature define ENABLE_LETTERPRESS disabled
1303         by default. We only enable letterpress on iOS.
1304         * css/CSSComputedStyleDeclaration.cpp:
1305         (WebCore::renderTextDecorationFlagsToCSSValue): Add support for CSS value -webkit-letterpress.
1306         * css/CSSParser.cpp:
1307         (WebCore::CSSParser::parseTextDecoration): Ditto.
1308         * css/CSSPrimitiveValueMappings.h:
1309         (WebCore::CSSPrimitiveValue::operator TextDecoration): Ditto.
1310         * css/CSSValueKeywords.in: Added CSS value -webkit-letterpress.
1311         * platform/graphics/GraphicsContext.h:
1312         * platform/graphics/mac/FontMac.mm:
1313         (WebCore::fillVectorWithHorizontalGlyphPositions): Added.
1314         (WebCore::shouldUseLetterpressEffect): Added.
1315         (WebCore::showLetterpressedGlyphsWithAdvances): Added.
1316         (WebCore::showGlyphsWithAdvances): Modified to call showLetterpressedGlyphsWithAdvances()
1317         to show a letterpressed glyph. I also included additional iOS-specific changes.
1318         (WebCore::Font::drawGlyphs):
1319         * rendering/TextPaintStyle.cpp:
1320         (WebCore::TextPaintStyle::TextPaintStyle): 
1321         (WebCore::computeTextPaintStyle): Modified to compute letterpress effect style.
1322         (WebCore::updateGraphicsContext): Modified to apply/unapply letterpress effect drawing mode.
1323         * rendering/TextPaintStyle.h:
1324         * rendering/style/RenderStyleConstants.h:
1325
1326 2013-11-06  Ryosuke Niwa  <rniwa@webkit.org>
1327
1328         Crash in SliderThumbElement::dragFrom
1329         https://bugs.webkit.org/show_bug.cgi?id=123873
1330
1331         Reviewed by Sam Weinig.
1332
1333         Moved Ref.
1334
1335         * html/RangeInputType.cpp:
1336         (WebCore::RangeInputType::handleMouseDownEvent):
1337         * html/shadow/SliderThumbElement.cpp:
1338         (WebCore::SliderThumbElement::dragFrom):
1339
1340 2013-11-06  Daniel Bates  <dabates@apple.com>
1341
1342         Cleanup FontMac.mm
1343         https://bugs.webkit.org/show_bug.cgi?id=123928
1344
1345         Reviewed by Andy Estes.
1346
1347         * platform/graphics/mac/FontMac.mm:
1348         (WebCore::showGlyphsWithAdvances): Inline the value of variable isVertical as we
1349         reference it exactly once and its value is sufficiently clear.
1350         (WebCore::Font::drawGlyphs): Remove default case in switch block so that the compiler
1351         checks that all cases are covered. Move definition of platformData to the top of the
1352         function and use it whenever we want to access the platform font data
1353
1354 2013-11-06  Brent Fulgham  <bfulgham@apple.com>
1355
1356         [WebGL] We should not allow generateMipMap on compressed textures
1357         https://bugs.webkit.org/show_bug.cgi?id=123915
1358         <rdar://problem/15201274>
1359
1360         Reviewed by Dean Jackson.
1361
1362         Found by existing conformance/extensions/webgl-compressed-texture-s3tc.html
1363
1364         * html/canvas/WebGLRenderingContext.cpp:
1365         (WebCore::WebGLRenderingContext::compressedTexImage2D): Set compressed flag.
1366         (WebCore::WebGLRenderingContext::compressedTexSubImage2D): Ditto.
1367         (WebCore::WebGLRenderingContext::generateMipmap): For Apple builds, check state
1368         of compressed flag and generate appropriate WebGL error if necessary.
1369         * html/canvas/WebGLTexture.cpp:
1370         (WebCore::WebGLTexture::WebGLTexture): Set compressed flag to false by default
1371         (WebCore::WebGLTexture::isCompressed): Added
1372         (WebCore::WebGLTexture::setCompressed): Added
1373         * html/canvas/WebGLTexture.h:
1374         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1375         (WebCore::GraphicsContext3D::generateMipmap): Switch implementation to use proper
1376         glGenerateMipmaps, rather than the glGenerateMipmapsEXT method.
1377
1378 2013-11-06  Joseph Pecoraro  <pecoraro@apple.com>
1379
1380         Web Inspector: Changes to CodeGeneratorInspectorStrings.py should rebuild inspector generated files
1381         https://bugs.webkit.org/show_bug.cgi?id=123925
1382
1383         Reviewed by Timothy Hatcher.
1384
1385         * CMakeLists.txt:
1386         * DerivedSources.make:
1387         * GNUmakefile.am:
1388
1389 2013-11-06  Bem Jones-Bey  <bjonesbe@adobe.com>
1390
1391         Rename region line offset methods
1392         https://bugs.webkit.org/show_bug.cgi?id=123897
1393
1394         Reviewed by Sam Weinig.
1395
1396         Because of the large number of overloads on the line offset methods,
1397         it is very hard to read code using them, which also makes it harder to
1398         move them out of RenderBlock. This patch renames the methods that take
1399         a region as an argument to make it clearer when looking at the code
1400         how the differ from the ones that don't.
1401
1402         No new tests, no behavior change.
1403
1404         * rendering/RenderBlock.cpp:
1405         (WebCore::RenderBlock::computeStartPositionDeltaForChildAvoidingFloats):
1406         * rendering/RenderBlock.h:
1407         (WebCore::RenderBlock::availableLogicalWidthForLineInRegion):
1408         (WebCore::RenderBlock::logicalRightOffsetForLineInRegion):
1409         (WebCore::RenderBlock::logicalLeftOffsetForLineInRegion):
1410         (WebCore::RenderBlock::startOffsetForLineInRegion):
1411         (WebCore::RenderBlock::endOffsetForLineInRegion):
1412         (WebCore::RenderBlock::availableLogicalWidthForLine):
1413         * rendering/RenderBox.cpp:
1414         (WebCore::RenderBox::shrinkLogicalWidthToAvoidFloats):
1415         (WebCore::RenderBox::containingBlockAvailableLineWidthInRegion):
1416
1417 2013-11-06  Antti Koivisto  <antti@apple.com>
1418
1419         HTMLCollection should use CollectionIndexCache
1420         https://bugs.webkit.org/show_bug.cgi?id=123906
1421
1422         Reviewed by Ryosuke Niwa.
1423         
1424         More code sharing.
1425
1426         * bindings/js/JSDOMWindowCustom.cpp:
1427         (WebCore::namedItemGetter):
1428         * bindings/js/JSHTMLDocumentCustom.cpp:
1429         (WebCore::JSHTMLDocument::nameGetter):
1430         * dom/ChildNodeList.h:
1431         * dom/CollectionIndexCache.h:
1432         (WebCore::::nodeBeforeCached):
1433         (WebCore::::nodeAfterCached):
1434         (WebCore::::nodeAt):
1435             
1436             Add a mechanism for disabling use of backward traversal.
1437
1438         * dom/LiveNodeList.h:
1439         (WebCore::LiveNodeList::collectionCanTraverseBackward):
1440         * html/HTMLCollection.cpp:
1441         (WebCore::HTMLCollection::HTMLCollection):
1442         (WebCore::isMatchingElement):
1443         (WebCore::HTMLCollection::iterateForPreviousElement):
1444         (WebCore::firstMatchingElement):
1445         (WebCore::nextMatchingElement):
1446         (WebCore::HTMLCollection::length):
1447         (WebCore::HTMLCollection::item):
1448         (WebCore::nameShouldBeVisibleInDocumentAll):
1449         (WebCore::firstMatchingChildElement):
1450         (WebCore::nextMatchingSiblingElement):
1451         (WebCore::HTMLCollection::firstElement):
1452         (WebCore::HTMLCollection::traverseForward):
1453         (WebCore::HTMLCollection::collectionFirst):
1454         (WebCore::HTMLCollection::collectionLast):
1455         (WebCore::HTMLCollection::collectionTraverseForward):
1456         (WebCore::HTMLCollection::collectionTraverseBackward):
1457         (WebCore::HTMLCollection::invalidateCache):
1458         (WebCore::HTMLCollection::namedItem):
1459         (WebCore::HTMLCollection::updateNameCache):
1460         * html/HTMLCollection.h:
1461         (WebCore::HTMLCollection::collectionCanTraverseBackward):
1462         
1463             Disable use of backward traversal for collections that use custom traversal.
1464
1465 2013-11-06  Brendan Long  <b.long@cablelabs.com>
1466
1467         Add "id" attribute to TextTrack
1468         https://bugs.webkit.org/show_bug.cgi?id=123825
1469
1470         Reviewed by Eric Carlson.
1471
1472         Test: media/track/track-id.html
1473
1474         * html/HTMLMediaElement.cpp:
1475         (HTMLMediaElement::addTextTrack): Add emptyString() for track id.
1476         * html/track/AudioTrack.cpp:
1477         (WebCore::AudioTrack::AudioTrack): Pass trackPrivate->id() to TrackBase.
1478         (WebCore::AudioTrack::idChanged): Added, set id.
1479         * html/track/AudioTrack.h: Move m_id to TrackBase.
1480         * html/track/InbandTextTrack.cpp:
1481         (WebCore::InbandTextTrack::InbandTextTrack): Pass trackPrivate->id() to TrackBase.
1482         (WebCore::InbandTextTrack::idChanged): Added, set id.
1483         * html/track/InbandTextTrack.h: Add idChanged().
1484         * html/track/LoadableTextTrack.cpp:
1485         (WebCore::LoadableTextTrack::LoadableTextTrack): Add emptyString() for track id.
1486         (WebCore::LoadableTextTrack::id): Override to return the track element's id.
1487         * html/track/TextTrack.cpp:
1488         (WebCore::TextTrack::captionMenuOffItem): Add empty string for track id.
1489         (WebCore::TextTrack::captionMenuAutomaticItem): Add empty string for track id.
1490         (WebCore::TextTrack::TextTrack): Pass id to TrackBase.
1491         * html/track/TextTrack.h:
1492         (WebCore::TextTrack::create): Add id parameter.
1493         * html/track/TextTrack.idl: Add id attribute.
1494         * html/track/TrackBase.cpp:
1495         (WebCore::TrackBase::TrackBase): Add m_id.
1496         * html/track/TrackBase.h: Add id attribute / m_id.
1497         * html/track/VideoTrack.cpp:
1498         (WebCore::VideoTrack::VideoTrack): Pass trackPrivate->id() to TrackBase.
1499         (WebCore::VideoTrack::idChanged): Added, set id.
1500         * html/track/VideoTrack.h: Move m_id to TrackBase.
1501         * platform/graphics/TrackPrivateBase.h: Add idChanged() callback.
1502
1503 2013-11-06  Antti Koivisto  <antti@apple.com>
1504
1505         Move array position caching out from HTMLCollection
1506         https://bugs.webkit.org/show_bug.cgi?id=123895
1507
1508         Reviewed by Darin Adler.
1509
1510         This caching complicates the logic but is used by a single subclass
1511         (HTMLFormControlsCollection) only. The subclass can do the caching itself.
1512
1513         * html/HTMLAllCollection.cpp:
1514         (WebCore::HTMLAllCollection::HTMLAllCollection):
1515         * html/HTMLCollection.cpp:
1516         (WebCore::HTMLCollection::HTMLCollection):
1517         (WebCore::HTMLCollection::create):
1518         (WebCore::HTMLCollection::item):
1519         (WebCore::HTMLCollection::elementBeforeOrAfterCachedElement):
1520         (WebCore::HTMLCollection::firstElement):
1521         
1522             Renamed from traverseFirstElement.
1523
1524         (WebCore::HTMLCollection::traverseForwardToOffset):
1525         (WebCore::HTMLCollection::invalidateCache):
1526         
1527             Make cache invalidation virtual so we can clear HTMLTableRowsCollection index cache.
1528
1529         (WebCore::HTMLCollection::namedItem):
1530         (WebCore::HTMLCollection::updateNameCache):
1531         
1532             Use traverseForwardToOffset instead traverseNextElement. This allows removal of traverseNextElement.
1533
1534         * html/HTMLCollection.h:
1535         (WebCore::HTMLCollection::usesCustomForwardOnlyTraversal):
1536         
1537             Renamed the enum and the accessor to be more informative.
1538
1539         (WebCore::HTMLCollection::setCachedElement):
1540         (WebCore::HTMLCollection::customElementAfter):
1541         
1542             Renamed from virtualItemAfter.
1543
1544         * html/HTMLFormControlsCollection.cpp:
1545         (WebCore::HTMLFormControlsCollection::HTMLFormControlsCollection):
1546         (WebCore::findFormAssociatedElement):
1547         (WebCore::HTMLFormControlsCollection::customElementAfter):
1548         
1549             Move the array position caching logic here.
1550
1551         (WebCore::HTMLFormControlsCollection::invalidateCache):
1552         * html/HTMLFormControlsCollection.h:
1553         * html/HTMLNameCollection.cpp:
1554         (WebCore::HTMLNameCollection::HTMLNameCollection):
1555         * html/HTMLOptionsCollection.cpp:
1556         (WebCore::HTMLOptionsCollection::HTMLOptionsCollection):
1557         * html/HTMLTableRowsCollection.cpp:
1558         (WebCore::HTMLTableRowsCollection::HTMLTableRowsCollection):
1559         (WebCore::HTMLTableRowsCollection::customElementAfter):
1560         * html/HTMLTableRowsCollection.h:
1561
1562 2013-11-06  Michał Pakuła vel Rutka  <m.pakula@samsung.com>
1563
1564         [ATK] accessibility/title-ui-element-correctness.html fails
1565         https://bugs.webkit.org/show_bug.cgi?id=99825
1566
1567         Reviewed by Mario Sanchez Prada.
1568
1569         When calling setAtkRelationSetFromCoreObject a new ATK_LABELLED_BY_RELATION
1570         is added, adding proper label element as a relation. When the document structure
1571         has been changed and a different label should be linked as a relation, current ATK
1572         implementation adds it as a next target on relation's target list, while
1573         WTR/DumpRenderTree implementation takes only first one into account.
1574         This patch adds a new function removing current relations before adding new ones.
1575
1576         Covered by existing tests.
1577
1578         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1579         (removeAtkRelationFromRelationSetByType):
1580         (setAtkRelationSetFromCoreObject):
1581
1582 2013-11-06  Daniel Bates  <dabates@apple.com>
1583
1584         Add ENABLE(TEXT_SELECTION)
1585         https://bugs.webkit.org/show_bug.cgi?id=123827
1586
1587         Reviewed by Ryosuke Niwa.
1588
1589         Add compile-time guard, ENABLE(TEXT_SELECTION), to enable or
1590         disable selection painting in WebCore (enabled by default).
1591
1592         On iOS we disable WebCore selection painting and have UIKit
1593         paint the selection.
1594
1595         * rendering/InlineTextBox.cpp:
1596         (WebCore::InlineTextBox::paintSelection): Only paint selection when
1597         TEXT_SELECTION is enabled.
1598         * rendering/LogicalSelectionOffsetCaches.h:
1599         (WebCore::LogicalSelectionOffsetCaches::LogicalSelectionOffsetCaches):
1600         For now, add a ENABLE(TEXT_SELECTION)-guard around an assertion. Added
1601         a FIXME comment to investigate the callers and either move the assertion
1602         to the appropriate callers or structure the code such that we can remove
1603         the assertion.
1604         * rendering/RenderBlock.cpp:
1605         (WebCore::RenderBlock::paintSelection): Only paint selection when
1606         TEXT_SELECTION is enabled.
1607         * rendering/TextPaintStyle.cpp:
1608         (WebCore::computeTextSelectionPaintStyle): Only compute the selection
1609         paint style when TEXT_SELECTION is enabled. Otherwise, return a paint
1610         style identical to the text paint style. Also, substitute nullptr for 0.
1611
1612 2013-11-06  Jer Noble  <jer.noble@apple.com>
1613
1614         Unrevewied Windows build fix after r158736; add InlineElementBox.cpp to the RenderingAllInOne.cpp file.
1615
1616         * rendering/RenderingAllInOne.cpp:
1617
1618 2013-11-06  Sergio Villar Senin  <svillar@igalia.com>
1619
1620         Unreviewed build fix, style() return type is now a reference.
1621
1622         * rendering/RenderGrid.cpp:
1623         (WebCore::RenderGrid::resolveGridPositionFromStyle):
1624
1625 2013-11-06  Jer Noble  <jer.noble@apple.com>
1626
1627         Unreviewed 32-bit Mac build fix; use an explicit FloatSize -> IntSize conversion function.
1628
1629         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1630         (WebCore::MediaPlayerPrivateAVFoundationObjC::sizeChanged):
1631
1632 2013-11-04  Jer Noble  <jer.noble@apple.com>
1633
1634         Playing many sounds with HTML5 Audio makes WebKit unresponsive
1635         https://bugs.webkit.org/show_bug.cgi?id=116145
1636
1637         Reviewed by Eric Carlson.
1638
1639         Cache as much information as possible from AVPlayerItem to eliminate unneccesary
1640         calls into AVFoundation.
1641
1642         Add WillChange/DidChange functions to handle the results of KVO notifications
1643         from AVPlayerItem and AVPlayer:
1644         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1645         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformPlay):
1646         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformPause):
1647         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateRate):
1648         (WebCore::MediaPlayerPrivateAVFoundationObjC::playerItemStatusDidChange):
1649         (WebCore::MediaPlayerPrivateAVFoundationObjC::playbackLikelyToKeepUpWillChange):
1650         (WebCore::MediaPlayerPrivateAVFoundationObjC::playbackLikelyToKeepUpDidChange):
1651         (WebCore::MediaPlayerPrivateAVFoundationObjC::playbackBufferEmptyWillChange):
1652         (WebCore::MediaPlayerPrivateAVFoundationObjC::playbackBufferEmptyDidChange):
1653         (WebCore::MediaPlayerPrivateAVFoundationObjC::playbackBufferFullWillChange):
1654         (WebCore::MediaPlayerPrivateAVFoundationObjC::playbackBufferFullDidChange):
1655         (WebCore::MediaPlayerPrivateAVFoundationObjC::seekableTimeRangesDidChange):
1656         (WebCore::MediaPlayerPrivateAVFoundationObjC::loadedTimeRangesDidChange):
1657         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksDidChange):
1658         (WebCore::MediaPlayerPrivateAVFoundationObjC::hasEnabledAudioDidChange):
1659         (WebCore::MediaPlayerPrivateAVFoundationObjC::presentationSizeDidChange):
1660         (WebCore::MediaPlayerPrivateAVFoundationObjC::durationDidChange):
1661         (WebCore::MediaPlayerPrivateAVFoundationObjC::rateDidChange):
1662         (WebCore::itemKVOProperties):
1663         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
1664
1665         Instruct the HTMLMediaElement to cache the currentTime value for 5 seconds:
1666         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1667         (WebCore::MediaPlayerPrivateAVFoundationObjC::maximumDurationToCacheMediaTime):
1668
1669         Add and initialize member variables to hold these cached values:
1670         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1671         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1672         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
1673         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
1674
1675         Add a new Notification type which can take (and call) a Function object:
1676         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1677         (WebCore::MediaPlayerPrivateAVFoundation::dispatchNotification):
1678         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
1679         (WebCore::MediaPlayerPrivateAVFoundation::Notification::Notification):
1680         (WebCore::MediaPlayerPrivateAVFoundation::Notification::function):
1681
1682         Implement queries in terms of the cached values of AVPlayerItem and AVPlayer
1683         properties:
1684         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1685         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1686         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
1687         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
1688         (WebCore::MediaPlayerPrivateAVFoundationObjC::playerItemStatus):
1689         (WebCore::MediaPlayerPrivateAVFoundationObjC::rate):
1690         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformBufferedTimeRanges):
1691         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMinTimeSeekable):
1692         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMaxTimeSeekable):
1693         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMaxTimeLoaded):
1694         (WebCore::MediaPlayerPrivateAVFoundationObjC::totalBytes):
1695         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
1696         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateAudioTracks):
1697         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoTracks):
1698         (WebCore::MediaPlayerPrivateAVFoundationObjC::sizeChanged):
1699         (WebCore::MediaPlayerPrivateAVFoundationObjC::processLegacyClosedCaptionsTracks):
1700
1701         Invalidate the cached currentTime before calling scheduleTimeUpdate so that the
1702         correct movieTime is saved in m_clockTimeAtLastUpdateEvent:
1703         * html/HTMLMediaElement.cpp:
1704         (HTMLMediaElement::setReadyState):
1705
1706 2013-10-24  Sergio Villar Senin  <svillar@igalia.com>
1707
1708         [CSS Grid Layout] Add support for named grid areas
1709         https://bugs.webkit.org/show_bug.cgi?id=120045
1710
1711         Reviewed by Andreas Kling.
1712
1713         From Blink r155555, r155850 and r155889 by <jchaffraix@chromium.org>
1714
1715         Added support for named grid areas. Basically a named grid area is
1716         now a valid grid position. The shorthand parsing of grid-area was
1717         split from the grid-{row|column} as the rules for expanding are
1718         slightly different.
1719
1720         Unknown grid area names are treated as 'auto' as per the
1721         specification. This means that for those cases we need to trigger
1722         the auto-placement algorithm.
1723
1724         Tests: fast/css-grid-layout/grid-item-bad-named-area-auto-placement.html
1725                fast/css-grid-layout/grid-item-named-grid-area-resolution.html
1726
1727         * css/CSSComputedStyleDeclaration.cpp:
1728         (WebCore::valueForGridPosition):
1729         * css/CSSParser.cpp:
1730         (WebCore::CSSParser::parseValue):
1731         (WebCore::CSSParser::parseGridPosition):
1732         (WebCore::gridMissingGridPositionValue):
1733         (WebCore::CSSParser::parseGridItemPositionShorthand):
1734         (WebCore::CSSParser::parseGridAreaShorthand):
1735         (WebCore::CSSParser::parseSingleGridAreaLonghand):
1736         * css/CSSParser.h:
1737         * css/StyleResolver.cpp:
1738         (WebCore::StyleResolver::adjustRenderStyle):
1739         (WebCore::StyleResolver::adjustGridItemPosition):
1740         (WebCore::createGridPosition):
1741         * css/StyleResolver.h:
1742         * rendering/RenderGrid.cpp:
1743         (WebCore::RenderGrid::resolveGridPositionFromStyle):
1744         * rendering/style/GridPosition.h:
1745         (WebCore::GridPosition::isNamedGridArea):
1746         (WebCore::GridPosition::setNamedGridArea):
1747         (WebCore::GridPosition::namedGridLine):
1748
1749 2013-11-06  Chris Fleizach  <cfleizach@apple.com>
1750
1751         AX: Audio and Video attachments are not output to VoiceOver
1752         https://bugs.webkit.org/show_bug.cgi?id=123479
1753
1754         Reviewed by Mario Sanchez Prada.
1755
1756         Video and audio elements don't appear as distinct objects in the AX hierarchy,
1757         nor are they treated as replaceable objects when emitting the text. We should
1758         treat these characters like attachments, for one. On the Mac platform, we should
1759         also identify them with special subroles.
1760
1761         Tests: platform/mac/accessibility/media-emits-object-replacement.html
1762                platform/mac/accessibility/media-role-descriptions.html
1763
1764         * accessibility/AccessibilityNodeObject.cpp:
1765         (WebCore::AccessibilityNodeObject::isGenericFocusableElement):
1766         * accessibility/AccessibilityObject.h:
1767         * accessibility/AccessibilityRenderObject.cpp:
1768         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
1769         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
1770         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1771         (createAccessibilityRoleMap):
1772         (-[WebAccessibilityObjectWrapper subrole]):
1773         (-[WebAccessibilityObjectWrapper roleDescription]):
1774         * editing/TextIterator.cpp:
1775         (WebCore::isRendererReplacedElement):
1776
1777
1778 2013-11-06  Ryosuke Niwa  <rniwa@webkit.org>
1779
1780         Notify nodes removal to Range/Selection after dispatching blur and mutation event
1781         https://bugs.webkit.org/show_bug.cgi?id=123880
1782
1783         Reviewed by Andreas Kling.
1784
1785         Merge https://chromium.googlesource.com/chromium/blink/+/b60576a0560d14f8757e58d55d37b7cefa48a6ac
1786
1787         In willRemoveChildren in ContainerNode.cpp, call Document::nodeChildrenWillBeRemoved after instead of
1788         before dispatching mutation events because we need to update ranges created by those mutation event
1789         listeners. willRemoveChild was fixed in r115686.
1790
1791         Tests: editing/selection/selection-change-in-blur-event-by-remove-children.html
1792                editing/selection/selection-change-in-mutation-event-by-remove-children.html
1793                fast/dom/Range/range-created-during-remove-children.html
1794
1795         * dom/ContainerNode.cpp:
1796         (WebCore::willRemoveChildren):
1797
1798 2013-11-06  Ryosuke Niwa  <rniwa@webkit.org>
1799
1800         Fix out-of-date offset in selection range code in range.surroundContents
1801         https://bugs.webkit.org/show_bug.cgi?id=123871
1802
1803         Reviewed by Andreas Kling.
1804         
1805         Merge https://chromium.googlesource.com/chromium/blink/+/c89b413ff0fc4aafa0c71d180b0b1e131bb37707
1806
1807         The code in Range::insertNode assumeed that the start offset of the selection range within its container
1808         doesn't change across a call to insertBefore on the container but this is wrong. This patch recomputes
1809         the start offset when it is used after the insertBefore call.
1810
1811         Test: editing/selection/range-surroundContents-with-preceding-node.html
1812
1813         * dom/Range.cpp:
1814         (WebCore::Range::insertNode):
1815
1816 2013-11-06  Andreas Kling  <akling@apple.com>
1817
1818         Add InlineElementBox and stop instantiating InlineBox directly.
1819         <https://webkit.org/b/123882>
1820
1821         Make the InlineBox constructors protected and add a new class
1822         called InlineElementBox on top. This is somewhat analogous to the
1823         split between RenderText and RenderElement, and allows us to make
1824         renderer() return a far tighter RenderBoxModelObject& instead
1825         of a RenderObject&.
1826
1827         Moved over attachLine(), deleteLine() and extractLine() to start
1828         things off. More things will follow.
1829
1830         Reviewed by Antti Koivisto.
1831
1832 2013-11-06  Piotr Grad  <p.grad@samsung.com>
1833
1834         Seek for video doesn't work when playback rate is negative
1835         https://bugs.webkit.org/show_bug.cgi?id=123791
1836
1837         In MediaPlayerPrivateGStreamer::seek negative playback rate was not taken to account.
1838
1839         Reviewed by Philippe Normand.
1840
1841         Test: media/video-seek-with-negative-playback.html
1842
1843         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1844         (WebCore::MediaPlayerPrivateGStreamer::seek):
1845
1846 2013-11-06  Andreas Kling  <akling@apple.com>
1847
1848         Reinstate an annoying assertion that I accidentally commented out.
1849
1850         * loader/icon/IconDatabase.cpp:
1851         (WebCore::IconDatabase::synchronousIconForPageURL):
1852
1853 2013-11-06  Brendan Long  <b.long@cablelabs.com>
1854
1855         [GStreamer] Override label() and language() in Audio and VideoTrackPrivateGStreamer
1856         https://bugs.webkit.org/show_bug.cgi?id=123836
1857
1858         The tests are currently flakey because we only get the label and language if we get
1859         tags after the track client is set.
1860
1861         Reviewed by Philippe Normand.
1862
1863         No new tests because the tests already exist (this fixes flakeyness).
1864
1865         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h: Override label() and language() to use m_label and m_language.
1866         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h: Same.
1867         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h: Make m_label and m_language protected so they can be used in the functions above.
1868
1869 2013-11-05  Andreas Kling  <akling@apple.com>
1870
1871         RenderBlockFlow should only expose its line boxes as RootInlineBox.
1872         <https://webkit.org/b/123878>
1873
1874         The line boxes attached directly to a RenderBlockFlow are always
1875         RootInlineBox objects, so call sites should always use the tightly
1876         typed firstRootBox() and lastRootBox().
1877
1878         This allows the compiler to devirtualize calls to member functions
1879         of RootInlineBox that are marked FINAL.
1880
1881         Reviewed by Antti Koivisto.
1882
1883 2013-11-06  Ryosuke Niwa  <rniwa@webkit.org>
1884
1885         Assertion failure end < m_runCount in WebCore::BidiRunList<WebCore::BidiRun>::reverseRuns
1886         https://bugs.webkit.org/show_bug.cgi?id=123863
1887
1888         Reviewed by Andreas Kling.
1889
1890         Merge https://chromium.googlesource.com/chromium/blink/+/cbaa92c763a37d89eeabd01658e522219299290c
1891
1892         Test: fast/text/bidi-reverse-runs-crash.html
1893
1894         * platform/text/BidiResolver.h:
1895         (WebCore::BidiResolver<Iterator, Run>::createBidiRunsForLine): Don't reverse the runs if there's
1896         nothing to be reversed.
1897
1898 2013-11-05  Ryosuke Niwa  <rniwa@webkit.org>
1899
1900         Address the review comment after r158724.
1901
1902         * html/RangeInputType.cpp:
1903         (WebCore::RangeInputType::handleMouseDownEvent):
1904
1905 2013-11-05  Zalan Bujtas  <zalan@apple.com>
1906
1907         Widget's position change should not initiate layout, only when its size changes.
1908         https://bugs.webkit.org/show_bug.cgi?id=123860
1909
1910         Reviewed by Andreas Kling.
1911
1912         RenderWidgets initiate unnecessary layouts while scrolling when they are embedded to
1913         overflow:scroll containers. Scroll position change doesn't dirty the render tree
1914         so it should not trigger layout either.
1915
1916         Manual test added. Unfortunately we can't test against the number of layouts yet.
1917
1918         * rendering/RenderWidget.cpp:
1919         (WebCore::RenderWidget::setWidgetGeometry):
1920         (WebCore::RenderWidget::updateWidgetGeometry):
1921         (WebCore::RenderWidget::updateWidgetPosition):
1922
1923 2013-11-05  Ryosuke Niwa  <rniwa@webkit.org>
1924
1925         Use-after-free in SliderThumbElement::dragFrom
1926         https://bugs.webkit.org/show_bug.cgi?id=123873
1927
1928         Reviewed by Andreas Kling.
1929
1930         Ref the SliderThumbElement since it could go away inside dragFrom.
1931
1932         Test: fast/forms/range/range-type-change-onchange-2.html
1933
1934         * html/RangeInputType.cpp:
1935         (WebCore::RangeInputType::handleMouseDownEvent):
1936
1937 2013-11-05  Ryosuke Niwa  <rniwa@webkit.org>
1938
1939         Change the order of conditions to avoid computing rendererIsEditable()
1940         https://bugs.webkit.org/show_bug.cgi?id=123868
1941
1942         Reviewed by Andreas Kling.
1943
1944         Merge https://chromium.googlesource.com/chromium/blink/+/c89b413ff0fc4aafa0c71d180b0b1e131bb37707
1945
1946         When we need both Node::renderer() and Node::rendererIsEditable() conditions to be true to perform
1947         some operation, it is more effective to check for renderer() first, so that if this condition fails
1948         we can avoid unnecessary computation of rendererIsEditable().
1949
1950         * dom/Position.cpp:
1951         (WebCore::nextRenderedEditable):
1952         (WebCore::previousRenderedEditable):
1953         * page/EventHandler.cpp:
1954         (WebCore::EventHandler::handleMouseReleaseEvent):
1955
1956 2013-11-05  Ryosuke Niwa  <rniwa@webkit.org>
1957
1958         simpleUserAgentStyleSheet doesn't have focus ring on anchor element
1959         https://bugs.webkit.org/show_bug.cgi?id=123867
1960
1961         Reviewed by Andreas Kling.
1962
1963         Merge https://chromium.googlesource.com/chromium/blink/+/08ecc23c4d80be9969918c4baf0ac83dc6cb6cbd
1964
1965         * css/CSSDefaultStyleSheets.cpp:
1966
1967 2013-11-05  Ryosuke Niwa  <rniwa@webkit.org>
1968
1969         valueForBorderRadiusShorthand returns wrong values in some case
1970         https://bugs.webkit.org/show_bug.cgi?id=123866
1971
1972         Reviewed by Andreas Kling.
1973
1974         Merge https://chromium.googlesource.com/chromium/blink/+/0933728126f2db06ab8e945efc98bffa2d42af1c
1975
1976         Because valueForBorderRadiusShorthand misses the followings:
1977         - showHorizontalBottomRight depends on showHorizontalBottomLeft.
1978         - showHorizontalTopRight depends on showHorizontalBottomRight (including showHorizontalBottomLeft).
1979
1980         See also http://dev.w3.org/csswg/css-backgrounds/#the-border-radius
1981
1982         Test: fast/css/getComputedStyle/getComputedStyle-borderRadius-2.html
1983
1984         * css/CSSComputedStyleDeclaration.cpp:
1985         (WebCore::getBorderRadiusShorthandValue):
1986
1987 2013-11-05  Ryosuke Niwa  <rniwa@webkit.org>
1988
1989         Protect DOM nodes in IndentOutdentCommand::tryIndentingAsListItem()
1990         https://bugs.webkit.org/show_bug.cgi?id=123861
1991
1992         Reviewed by Benjamin Poulain.
1993
1994         Merge https://chromium.googlesource.com/chromium/blink/+/297442eb539a2b764fdad323de79099a70179186 partially.
1995
1996         * editing/IndentOutdentCommand.cpp:
1997         (WebCore::IndentOutdentCommand::tryIndentingAsListItem): Make selectedListItem, previousList, and nextList
1998         RefPtr since they're are used after calling insertNodeBefore.
1999
2000 2013-11-05  Andreas Kling  <akling@apple.com>
2001
2002         Apply more unique_ptr to line box management.
2003         <https://webkit.org/b/123857>
2004
2005         Make all of the functions that return newly-created line boxes
2006         return them packed up in std::unique_ptrs.
2007
2008         There is one exception in RenderBlockLineLayout where the function
2009         createInlineBoxForRenderer() is inconsistent about the ownership of
2010         the returned object. This will be addressed by a subsequent patch.
2011
2012         We now "release" the line boxes into their various home structures,
2013         so the pointer smartness doesn't go end-to-end just yet.
2014
2015         Reviewed by Anders Carlsson.
2016
2017 2013-11-05  Ryosuke Niwa  <rniwa@webkit.org>
2018
2019         getComputedStyle(x).lineHeight is affected by zooming
2020         https://bugs.webkit.org/show_bug.cgi?id=123847
2021
2022         Reviewed by Benjamin Poulain.
2023
2024         Merge https://chromium.googlesource.com/chromium/blink/+/7957097afbab2899ababd0d9c8acbf6e3eddb870
2025
2026         Test: fast/css/line-height-zoom-get-computed-style.html
2027
2028         * css/CSSComputedStyleDeclaration.cpp:
2029         (WebCore::lineHeightFromStyle): Don't round line-height values.
2030         * css/DeprecatedStyleBuilder.cpp:
2031         (WebCore::ApplyPropertyLineHeight::applyValue): Use the computed value instead of the used value.
2032
2033 2013-11-05  James Craig  <jcraig@apple.com>
2034
2035         AX: media controls accessibility needs more work
2036         https://bugs.webkit.org/show_bug.cgi?id=123749
2037
2038         Reviewed by Jer Noble.
2039
2040         Updated some of the control labels/roles to improve accessibility.
2041           - Volume slider is now keyboard/screenreader accessible.
2042           - muteButton was a checkbox toggling checked state, now a button that toggles label "mute/unmute"
2043           - fullscreenButton was a checkbox toggling checked state, now a button that toggles label "display/exit full screen"
2044           - captionButton was a checkbox, now a popup button that launches the newly accessible menu.
2045         Subtitles menu is now keyboard/screenreader accessible (uses roaming tabindex).
2046         Render dump expectations changed because volume slider is now hidden via... 
2047         ...opacity/size (to make accessible without hover) instead of display:none.
2048
2049         Updated existing test coverage.
2050
2051         * Modules/mediacontrols/mediaControlsApple.css:
2052         (audio::-webkit-media-controls-panel .volume-box):
2053         (audio::-webkit-media-controls-panel .volume-box:active):
2054         (audio::-webkit-media-controls-toggle-closed-captions-button):
2055         (audio::-webkit-media-controls-closed-captions-container .list):
2056         (audio::-webkit-media-controls-closed-captions-container li:focus):
2057         * Modules/mediacontrols/mediaControlsApple.js:
2058         (Controller.prototype.createControls):
2059         (Controller.prototype.handleFullscreenChange):
2060         (Controller.prototype.handleMuteButtonClicked):
2061         (Controller.prototype.handleMinButtonClicked):
2062         (Controller.prototype.handleMaxButtonClicked):
2063         (Controller.prototype.handleVolumeSliderChange):
2064         (Controller.prototype.buildCaptionMenu):
2065         (Controller.prototype.focusSiblingCaptionItem):
2066         (Controller.prototype.handleCaptionItemKeyUp):
2067
2068 2013-11-05  Andreas Kling  <akling@apple.com>
2069
2070         Move some plugin-specific code from RenderWidget to RenderEmbeddedObject.
2071         <https://webkit.org/b/123845>
2072
2073         All RenderWidgets representing plugins will be RenderEmbeddedObjects.
2074         Move some of the plugin-specific logic to RenderEmbeddedObject since it
2075         doesn't make sense for all RenderWidgets (frames, embedded documents)
2076         to care about this.
2077
2078         Reviewed by Anders Carlsson.
2079
2080 2013-11-05  Tim Horton  <timothy_horton@apple.com>
2081
2082         Fix the 32-bit build.
2083
2084         * WebCore.exp.in:
2085
2086 2013-11-05  Alexandru Chiculita  <achicu@adobe.com>
2087
2088         Web Inspector: Moving an element while in the DOMNodeRemoved handler will hide it in the inspector
2089         https://bugs.webkit.org/show_bug.cgi?id=123516
2090
2091         Reviewed by Timothy Hatcher.
2092
2093         InspectorInstrumentation::willRemoveDOMNode was actually calling both willRemoveDOMNodeImpl and
2094         didRemoveDOMNodeImpl, making the DOMAgent unbind the element even if it was still part of the DOM.
2095
2096         Because of that the DOMAgent was sending two events:
2097         1. When the element was about to be removed, just before JS "DOMNodeRemoved" was triggered.
2098         2. When the element was actually removed.
2099
2100         Note that inspector's event #2 will not know about the node, as it just removed it from the
2101         internal hashmap, so it will just use a nodeID == 0 for it.
2102
2103         This patch adds a separate call to InspectorInstrumentation::didRemoveDOMNode, just before the
2104         element is about to be removed. The InspectorInstrumentation::willRemoveDOMNode call is now only used
2105         by the DOMDebugger to trigger the DOM breakpoints in the Web Inspector. That feature is not exposed
2106         in the new Inspector UI, but can be used/tested using the protocol directly.
2107
2108         Tests: inspector-protocol/dom-debugger/node-removed.html
2109                inspector-protocol/dom/dom-remove-events.html
2110                inspector-protocol/dom/remove-multiple-nodes.html
2111
2112         * dom/ContainerNode.cpp:
2113         (WebCore::ContainerNode::removeBetween):
2114         * inspector/InspectorInstrumentation.h:
2115         (WebCore::InspectorInstrumentation::willRemoveDOMNode):
2116         (WebCore::InspectorInstrumentation::didRemoveDOMNode):
2117
2118 2013-11-05  Ryuan Choi  <ryuan.choi@samsung.com>
2119
2120         Unreviewed build fix on CMake based ports with GLES.
2121
2122         * CMakeLists.txt:
2123         Added OPENGLES2_LIBRARIES and OPENGLES2_INCLUDE_DIR into the includes and
2124         libraries list.
2125
2126 2013-11-05  Tim Horton  <timothy_horton@apple.com>
2127
2128         platformCALayerDeviceScaleFactor should be const
2129         https://bugs.webkit.org/show_bug.cgi?id=123842
2130
2131         Reviewed by Simon Fraser.
2132
2133         * WebCore.exp.in:
2134         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2135         (WebCore::LayerClient::platformCALayerDeviceScaleFactor):
2136         * platform/graphics/ca/GraphicsLayerCA.cpp:
2137         (WebCore::GraphicsLayerCA::platformCALayerDeviceScaleFactor):
2138         * platform/graphics/ca/GraphicsLayerCA.h:
2139         * platform/graphics/ca/PlatformCALayerClient.h:
2140         * platform/graphics/ca/mac/TileController.h:
2141         * platform/graphics/ca/mac/TileController.mm:
2142         (WebCore::TileController::platformCALayerDeviceScaleFactor):
2143         * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
2144         (WebCore::MediaPlayerPrivateQuickTimeVisualContext::LayerClient::platformCALayerDeviceScaleFactor):
2145         Constify PlatformCALayerClient::platformCALayerDeviceScaleFactor.
2146
2147 2013-11-05  Gavin Barraclough  <barraclough@apple.com>
2148
2149         Subresource loads should not prevent page throttling
2150         https://bugs.webkit.org/show_bug.cgi?id=123757
2151
2152         Reviewed by Alexey Proskuryakov.
2153
2154         The page-is-loading test for inhibiting process supression is currently
2155         too conservative, preventing supression of pages with infinitely loading
2156         resources (commonly XHRs). Instead, just rely on the FrameLoader being
2157         active (with hysteresis).
2158
2159         * loader/SubresourceLoader.cpp:
2160         (WebCore::SubresourceLoader::init):
2161         (WebCore::SubresourceLoader::checkForHTTPStatusCodeError):
2162         (WebCore::SubresourceLoader::didFinishLoading):
2163         (WebCore::SubresourceLoader::didFail):
2164         (WebCore::SubresourceLoader::willCancel):
2165         * loader/SubresourceLoader.h:
2166             - remove m_activityAssertion from SubresourceLoader.
2167
2168 2013-11-05  Tim Horton  <timothy_horton@apple.com>
2169
2170         [mac] PDFDocumentImage is too big if PDF has a crop box smaller than the media box
2171         https://bugs.webkit.org/show_bug.cgi?id=123840
2172         <rdar://problem/15308765>
2173
2174         Reviewed by Alexey Proskuryakov.
2175
2176         Test: fast/images/pdf-as-image-crop-box.html
2177
2178         * platform/graphics/cg/PDFDocumentImage.cpp:
2179         (WebCore::PDFDocumentImage::size):
2180         Use the crop box when determining the size of the image.
2181
2182         (WebCore::PDFDocumentImage::computeBoundsForCurrentPage):
2183         * platform/graphics/cg/PDFDocumentImage.h:
2184         * platform/graphics/mac/PDFDocumentImageMac.mm:
2185         (WebCore::PDFDocumentImage::computeBoundsForCurrentPage):
2186         Get rid of m_mediaBox, since we don't need it anymore.
2187
2188         (WebCore::PDFDocumentImage::drawPDFPage):
2189         PDFKit does the translation by the crop box origin for us;
2190         if we do it additionally, we'll be painting the wrong part of the image.
2191         So, don't do the translation here.
2192
2193 2013-11-05  Antti Koivisto  <antti@apple.com>
2194
2195         Factor index cache for NodeLists and HTMLCollections to a class
2196         https://bugs.webkit.org/show_bug.cgi?id=123823
2197
2198         Reviewed by Ryosuke Niwa.
2199
2200         Implement index cache class that can used by NodeLists and HTMLCollections that currently
2201         each have implementations of their own.
2202         
2203         This patch also implements ChildNodeList and LiveNodeList using CollectionIndexCache.
2204         HTMLCollection is will be transitioned later.
2205
2206         * GNUmakefile.list.am:
2207         * WebCore.vcxproj/WebCore.vcxproj:
2208         * WebCore.xcodeproj/project.pbxproj:
2209         * dom/ChildNodeList.cpp:
2210         (WebCore::ChildNodeList::ChildNodeList):
2211         (WebCore::ChildNodeList::length):
2212         (WebCore::ChildNodeList::item):
2213         
2214             The client calls to cache to for indexed and size access.
2215
2216         (WebCore::ChildNodeList::collectionFirst):
2217         (WebCore::ChildNodeList::collectionLast):
2218         (WebCore::ChildNodeList::collectionTraverseForward):
2219         (WebCore::ChildNodeList::collectionTraverseBackward):
2220         
2221             Cache calls back to these as needed to do the actual traversal.
2222
2223         (WebCore::ChildNodeList::invalidateCache):
2224         * dom/ChildNodeList.h:
2225         * dom/CollectionIndexCache.h: Added.
2226         
2227             Templated cache class itself.
2228
2229         (WebCore::::CollectionIndexCache):
2230         (WebCore::::nodeCount):
2231         (WebCore::::nodeBeforeCached):
2232         (WebCore::::nodeAfterCached):
2233         (WebCore::::nodeAt):
2234         (WebCore::::invalidate):
2235         * dom/LiveNodeList.cpp:
2236         (WebCore::firstMatchingElement):
2237         (WebCore::nextMatchingElement):
2238         (WebCore::traverseMatchingElementsForward):
2239         (WebCore::LiveNodeList::collectionFirst):
2240         (WebCore::LiveNodeList::collectionLast):
2241         (WebCore::LiveNodeList::collectionTraverseForward):
2242         (WebCore::LiveNodeList::collectionTraverseBackward):
2243         (WebCore::LiveNodeList::length):
2244         (WebCore::LiveNodeList::item):
2245         (WebCore::LiveNodeList::invalidateCache):
2246         * dom/LiveNodeList.h:
2247         (WebCore::LiveNodeList::LiveNodeList):
2248
2249 2013-11-05  Enrica Casucci  <enrica@apple.com>
2250
2251         Full width semicolon is wrong in vertical text.
2252         https://bugs.webkit.org/show_bug.cgi?id=123814
2253         <rdar://problem/15312541>
2254
2255         Reviewed by Benjamin Poulain.
2256
2257         The full width semicolon should always be upright.
2258         Adding it to the list of characters that should
2259         ignore rotation.
2260
2261         * platform/graphics/FontGlyphs.cpp:
2262         (WebCore::shouldIgnoreRotation):
2263
2264 2013-11-05  Andreas Kling  <akling@apple.com>
2265
2266         Remove unused RenderWidget::notifyWidget().
2267
2268         Rubber-stamped by Anders Carlsson.
2269
2270 2013-11-05  Commit Queue  <commit-queue@webkit.org>
2271
2272         Unreviewed, rolling out r158678.
2273         http://trac.webkit.org/changeset/158678
2274         https://bugs.webkit.org/show_bug.cgi?id=123820
2275
2276         Causes a new debug assertion failure on the Mavericks test
2277         system. (Requested by bfulgham on #webkit).
2278
2279         * rendering/mathml/RenderMathMLOperator.cpp:
2280
2281 2013-11-05  Renata Hodovan  <reni@webkit.org>
2282
2283         ASSERTION FAILED: isHTMLTitleElement(m_titleElement.get()) in WebCore::Document::setTitle
2284         https://bugs.webkit.org/show_bug.cgi?id=122092
2285
2286         Reviewed by Darin Adler.
2287
2288         Remove a bogus assert in Document::setTitle().
2289         m_titleElement can be either of HTMLTitleElement or SVGTitleElement. The assertion was wrong.
2290         
2291         Backported from Blink:
2292         https://src.chromium.org/viewvc/blink?revision=158620&view=revision
2293
2294         Test: svg/custom/title-assertion.html
2295
2296         * dom/Document.cpp:
2297         (WebCore::Document::setTitle):
2298         * svg/SVGTitleElement.cpp:
2299         (WebCore::SVGTitleElement::insertedInto):
2300
2301 2013-11-05  Martin Robinson  <mrobinson@igalia.com>
2302
2303         [MathML] Poor spacing around delimiters in MathML Torture Test 14
2304         https://bugs.webkit.org/show_bug.cgi?id=122837
2305
2306         Reviewed by Brent Fulgham.
2307
2308         Instead of stretching the vertical bar with the stretchable version, just repeat
2309         the normal vertical bar. This follows what Gecko does when rendering tall vertical
2310         bars and also works around an issue with STIX fonts leading to poor spacing in
2311         formulas.
2312
2313         * rendering/mathml/RenderMathMLOperator.cpp: Stretch the vertical bar with the
2314         normal variant.
2315
2316 2013-11-05  Daniel Bates  <dabates@apple.com>
2317
2318         XSSAuditor should catch reflected srcdoc properties even without a <frame> tag injection
2319
2320         From Blink r160615 by <tsepez@chromium.org>
2321         https://src.chromium.org/viewvc/blink?view=rev&revision=160615
2322
2323         Test: http/tests/security/xssAuditor/iframe-srcdoc-property-blocked.html
2324
2325         * html/parser/XSSAuditor.cpp:
2326         (WebCore::XSSAuditor::filterIframeToken):
2327
2328 2013-11-05  Éva Balázsfalvi  <balazsfalvi.eva@stud.u-szeged.hu>
2329
2330         Delete maketokenizer.
2331         https://bugs.webkit.org/show_bug.cgi?id=115155
2332
2333         Reviewed by Zoltan Herczeg.
2334
2335         This script was used to generate the old flex based CSS tokenizer. It
2336         was replaced by a custom tokenizer in r106217 but the script wasn't
2337         removed. Since there is no mention of it in the original bug nor any
2338         reference to maketokenizer in our build files, it's probably an
2339         oversight.
2340
2341         Merge from blink:
2342         https://chromium.googlesource.com/chromium/blink/+/2a1c8aaf867f707ccdcd8893446e907e2aa2e1c2
2343
2344         * css/maketokenizer: Removed.
2345
2346 2013-11-05  Zan Dobersek  <zdobersek@igalia.com>
2347
2348         Unreviewed. Unbreaking GCC builds.
2349
2350         * html/HTMLCollection.cpp:
2351         (WebCore::isMatchingElement): This inline function is not a template anymore.
2352
2353 2013-11-05  Antti Koivisto  <antti@apple.com>
2354
2355         Make it compile.
2356
2357         * dom/LiveNodeList.h:
2358         (WebCore::LiveNodeList::LiveNodeList):
2359         (WebCore::LiveNodeList::~LiveNodeList):
2360         * dom/NodeRareData.h:
2361         (WebCore::NodeListsNodeData::adoptDocument):
2362         * html/HTMLCollection.cpp:
2363         (WebCore::HTMLCollection::HTMLCollection):
2364         (WebCore::HTMLCollection::~HTMLCollection):
2365
2366 2013-11-05  Antti Koivisto  <antti@apple.com>
2367
2368         HTMLCollection should not be NodeList
2369         https://bugs.webkit.org/show_bug.cgi?id=123794
2370
2371         Reviewed by Andreas Kling.
2372
2373         HTMLCollection and NodeList are unrelated types in DOM yet our HTMLCollection inherits NodeList
2374         for code sharing reasons. While some code does get shared the types are sufficiently different 
2375         that this results in lots of unnecessary branches, complexity and general awkwardness. Code sharing 
2376         can be better achieved by means other than inheritance.
2377         
2378         This patch splits HTMLCollection from NodeList by copy-pasting and eliminating resulting redundancies. 
2379         Sharing comes later.
2380
2381         * dom/Attr.cpp:
2382         (WebCore::Attr::setValue):
2383         (WebCore::Attr::childrenChanged):
2384         * dom/ClassNodeList.cpp:
2385         (WebCore::ClassNodeList::~ClassNodeList):
2386         * dom/ContainerNode.cpp:
2387         (WebCore::ContainerNode::childrenChanged):
2388         (WebCore::ContainerNode::getElementsByTagName):
2389         (WebCore::ContainerNode::getElementsByName):
2390         (WebCore::ContainerNode::getElementsByClassName):
2391         (WebCore::ContainerNode::radioNodeList):
2392         * dom/Document.cpp:
2393         (WebCore::Document::Document):
2394         (WebCore::Document::~Document):
2395         (WebCore::Document::registerNodeList):
2396         (WebCore::Document::unregisterNodeList):
2397         (WebCore::Document::registerCollection):
2398         (WebCore::Document::unregisterCollection):
2399         (WebCore::Document::ensureCachedCollection):
2400         
2401             Add separate functions and map for registering HTMLCollections.
2402
2403         (WebCore::Document::all):
2404         (WebCore::Document::windowNamedItems):
2405         (WebCore::Document::documentNamedItems):
2406         * dom/Document.h:
2407         * dom/Element.cpp:
2408         (WebCore::Element::attributeChanged):
2409         (WebCore::Element::ensureCachedHTMLCollection):
2410         (WebCore::Element::cachedHTMLCollection):
2411         * dom/LiveNodeList.cpp:
2412         (WebCore::LiveNodeList::rootNode):
2413         (WebCore::isMatchingElement):
2414         (WebCore::LiveNodeList::iterateForPreviousElement):
2415         (WebCore::LiveNodeList::itemBefore):
2416         (WebCore::firstMatchingElement):
2417         (WebCore::nextMatchingElement):
2418         (WebCore::traverseMatchingElementsForwardToOffset):
2419         (WebCore::LiveNodeList::traverseLiveNodeListFirstElement):
2420         (WebCore::LiveNodeList::traverseLiveNodeListForwardToOffset):
2421         (WebCore::LiveNodeList::isLastItemCloserThanLastOrCachedItem):
2422         (WebCore::LiveNodeList::isFirstItemCloserThanCachedItem):
2423         (WebCore::LiveNodeList::length):
2424         (WebCore::LiveNodeList::item):
2425         (WebCore::LiveNodeList::elementBeforeOrAfterCachedElement):
2426         
2427             This code used to live in HTMLCollection.cpp. Copy-paste here and remove all branches not needed for NodeLists.
2428
2429         (WebCore::LiveNodeList::invalidateCache):
2430         
2431             NodeLists have no name caches.
2432
2433         * dom/LiveNodeList.h:
2434         (WebCore::LiveNodeList::LiveNodeList):
2435         (WebCore::LiveNodeList::~LiveNodeList):
2436         (WebCore::LiveNodeList::isRootedAtDocument):
2437         (WebCore::LiveNodeList::type):
2438         (WebCore::LiveNodeList::invalidateCache):
2439         (WebCore::LiveNodeList::setCachedElement):
2440         
2441             Merge LiveNodeListBase and LiveNodeList.
2442             Remove fields and code supporting HTMLCollection.
2443
2444         (WebCore::shouldInvalidateTypeOnAttributeChange):
2445         
2446             Move to global scope. This function is used both HTMLCollections and LiveNodeLists.
2447
2448         * dom/NameNodeList.cpp:
2449         (WebCore::NameNodeList::~NameNodeList):
2450         * dom/NameNodeList.h:
2451         (WebCore::NameNodeList::create):
2452         * dom/Node.cpp:
2453         (WebCore::shouldInvalidateNodeListCachesForAttr):
2454         (WebCore::Document::shouldInvalidateNodeListAndCollectionCaches):
2455         (WebCore::Document::invalidateNodeListAndCollectionCaches):
2456         (WebCore::Node::invalidateNodeListAndCollectionCachesInAncestors):
2457         (WebCore::NodeListsNodeData::invalidateCaches):
2458         * dom/Node.h:
2459         * dom/NodeRareData.h:
2460         (WebCore::NodeListsNodeData::addCacheWithAtomicName):
2461         (WebCore::NodeListsNodeData::addCacheWithName):
2462         (WebCore::NodeListsNodeData::addCacheWithQualifiedName):
2463         (WebCore::NodeListsNodeData::addCachedCollection):
2464         (WebCore::NodeListsNodeData::cachedCollection):
2465         (WebCore::NodeListsNodeData::removeCacheWithAtomicName):
2466         (WebCore::NodeListsNodeData::removeCacheWithName):
2467         (WebCore::NodeListsNodeData::removeCachedCollection):
2468         (WebCore::NodeListsNodeData::isEmpty):
2469         (WebCore::NodeListsNodeData::adoptDocument):
2470         (WebCore::NodeListsNodeData::namedCollectionKey):
2471         (WebCore::NodeListsNodeData::namedNodeListKey):
2472         (WebCore::NodeListsNodeData::deleteThisAndUpdateNodeRareDataIfAboutToRemoveLastList):
2473         
2474             Add separate cache for HTMLCollections.
2475
2476         * dom/TagNodeList.cpp:
2477         (WebCore::TagNodeList::TagNodeList):
2478         (WebCore::TagNodeList::~TagNodeList):
2479         * dom/TagNodeList.h:
2480         (WebCore::TagNodeList::create):
2481         (WebCore::HTMLTagNodeList::create):
2482         * html/CollectionType.h:
2483         
2484             Remove NodeList types.
2485
2486         * html/HTMLCollection.cpp:
2487         (WebCore::shouldOnlyIncludeDirectChildren):
2488         (WebCore::rootTypeFromCollectionType):
2489         (WebCore::invalidationTypeExcludingIdAndNameAttributes):
2490         (WebCore::HTMLCollection::HTMLCollection):
2491         (WebCore::HTMLCollection::~HTMLCollection):
2492         (WebCore::HTMLCollection::rootNode):
2493         (WebCore::isMatchingElement):
2494         (WebCore::HTMLCollection::iterateForPreviousElement):
2495         (WebCore::HTMLCollection::itemBefore):
2496         (WebCore::firstMatchingElement):
2497         (WebCore::nextMatchingElement):
2498         (WebCore::traverseMatchingElementsForwardToOffset):
2499         (WebCore::HTMLCollection::isLastItemCloserThanLastOrCachedItem):
2500         (WebCore::HTMLCollection::isFirstItemCloserThanCachedItem):
2501         (WebCore::HTMLCollection::setCachedElement):
2502         (WebCore::HTMLCollection::length):
2503         (WebCore::HTMLCollection::item):
2504         (WebCore::HTMLCollection::elementBeforeOrAfterCachedElement):
2505         (WebCore::HTMLCollection::traverseFirstElement):
2506         (WebCore::HTMLCollection::traverseNextElement):
2507         (WebCore::HTMLCollection::traverseForwardToOffset):
2508         (WebCore::HTMLCollection::invalidateCache):
2509         (WebCore::HTMLCollection::invalidateIdNameCacheMaps):
2510         (WebCore::HTMLCollection::namedItem):
2511         
2512             Remove NodeList specific branches and functions.
2513             LiveNodeListBase functions are now HTMLCollection functions.
2514
2515         * html/HTMLCollection.h:
2516         (WebCore::HTMLCollection::isRootedAtDocument):
2517         (WebCore::HTMLCollection::invalidationType):
2518         (WebCore::HTMLCollection::type):
2519         (WebCore::HTMLCollection::ownerNode):
2520         (WebCore::HTMLCollection::invalidateCache):
2521         (WebCore::HTMLCollection::document):
2522         (WebCore::HTMLCollection::overridesItemAfter):
2523         (WebCore::HTMLCollection::isElementCacheValid):
2524         (WebCore::HTMLCollection::cachedElement):
2525         (WebCore::HTMLCollection::cachedElementOffset):
2526         (WebCore::HTMLCollection::isLengthCacheValid):
2527         (WebCore::HTMLCollection::cachedLength):
2528         (WebCore::HTMLCollection::setLengthCache):
2529         (WebCore::HTMLCollection::setCachedElement):
2530         (WebCore::HTMLCollection::isItemRefElementsCacheValid):
2531         (WebCore::HTMLCollection::setItemRefElementsCacheValid):
2532         (WebCore::HTMLCollection::rootType):
2533         (WebCore::HTMLCollection::hasNameCache):
2534         (WebCore::HTMLCollection::setHasNameCache):
2535         
2536             Copy-paste functions and fields from former LiveNodeListBase.
2537
2538         * html/HTMLNameCollection.cpp:
2539         (WebCore::HTMLNameCollection::~HTMLNameCollection):
2540         * html/LabelableElement.cpp:
2541         (WebCore::LabelableElement::labels):
2542         * html/LabelsNodeList.cpp:
2543         (WebCore::LabelsNodeList::~LabelsNodeList):
2544         * html/LabelsNodeList.h:
2545         * html/RadioNodeList.cpp:
2546         (WebCore::RadioNodeList::~RadioNodeList):
2547         * html/RadioNodeList.h:
2548         (WebCore::RadioNodeList::create):
2549
2550 2013-11-05  Emilio Pozuelo Monfort  <pochu27@gmail.com>
2551
2552         [GTK] Add stubs for missing symbols in dom bindings
2553         https://bugs.webkit.org/show_bug.cgi?id=123663
2554
2555         Reviewed by Carlos Garcia Campos.
2556
2557         * bindings/gobject/WebKitDOMCustom.cpp:
2558         (webkit_dom_html_head_element_get_profile):
2559         (webkit_dom_html_head_element_set_profile):
2560         (webkit_dom_processing_instruction_get_data):
2561         (webkit_dom_processing_instruction_set_data):
2562         * bindings/gobject/WebKitDOMCustom.h:
2563         * bindings/gobject/WebKitDOMCustom.symbols:
2564
2565 2013-11-05  Zan Dobersek  <zdobersek@igalia.com>
2566
2567         Main thread tasks in ThreadableBlobRegistry should use std::unique_ptr
2568         https://bugs.webkit.org/show_bug.cgi?id=122946
2569
2570         Reviewed by Darin Adler.
2571
2572         The new BlobRegistryContext objects don't have to be adopted into OwnPtr and then have OwnPtr's leaked pointer
2573         passed into the WTF::callOnMainThread call - the pointer to the new heap-allocated object is passed in directly,
2574         with the object ending up being managed by std::unique_ptr in the designated main thread task.
2575
2576         * fileapi/ThreadableBlobRegistry.cpp:
2577         (WebCore::registerBlobURLTask):
2578         (WebCore::ThreadableBlobRegistry::registerBlobURL):
2579         (WebCore::registerBlobURLFromTask):
2580         (WebCore::unregisterBlobURLTask):
2581         (WebCore::ThreadableBlobRegistry::unregisterBlobURL):
2582
2583 2013-11-05  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2584
2585         [CSS] Enable css-image-orientation on EFL and GTK ports.
2586         https://bugs.webkit.org/show_bug.cgi?id=123698
2587
2588         Reviewed by Beth Dakin.
2589
2590         r157909 added wrong early return for css-image-orientation. It causes about 20 regressions in layout test
2591         when enabling css-image-orientation. This fixes those wrong implementation as well as enables it on EFL
2592         and GTK ports by default.
2593
2594         Test: fast/css/image-orientation/image-orientation.html
2595
2596         * loader/cache/CachedImage.cpp:
2597         (WebCore::CachedImage::imageSizeForRenderer):
2598         * platform/graphics/BitmapImage.cpp:
2599         (WebCore::BitmapImage::updateSize):
2600
2601 2013-11-05  Andreas Kling  <akling@apple.com>
2602
2603         RenderEmbeddedObject shouldn't know about fallback content.
2604         <https://webkit.org/b/123781>
2605
2606         Stop caching the presence of fallback (DOM) content in a flag on
2607         RenderEmbeddedObject and have SubframeLoader fetch it directly from
2608         HTMLObjectElement instead.
2609
2610         Also made SubframeLoader::requestObject() take the owner element
2611         by reference since we don't support owner-less embedded objects.
2612
2613         Reviewed by Antti Koivisto.
2614
2615 2013-11-05  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2616
2617         [GStreamer] Remove NATIVE_FULLSCREEN_VIDEO support
2618         https://bugs.webkit.org/show_bug.cgi?id=123437
2619
2620         Reviewed by Philippe Normand.
2621
2622         Removed some dead code as no GStreamer port is using the native
2623         fullscreen video support.
2624
2625         * GNUmakefile.list.am:
2626         * PlatformEfl.cmake:
2627         * PlatformGTK.cmake: Removed compilation of deleted files.
2628         * platform/graphics/MediaPlayer.h: Removed structures related to
2629         GStreamer and NATIVE_FULLSCREEN_VIDEO.
2630         * platform/graphics/gstreamer/FullscreenVideoControllerGStreamer.cpp: Removed.
2631         * platform/graphics/gstreamer/FullscreenVideoControllerGStreamer.h: Removed.
2632         * platform/graphics/gstreamer/GStreamerGWorld.cpp: Removed.
2633         * platform/graphics/gstreamer/GStreamerGWorld.h: Removed.
2634         * platform/graphics/gstreamer/ImageGStreamerCairo.cpp: Removed
2635         gst/video/video.h include.
2636         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2637         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
2638         (WebCore::MediaPlayerPrivateGStreamerBase::platformMedia):
2639         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):
2640         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2641         Removed code related to GStreamer and NATIVE_FULLSCREEN_VIDEO.
2642         * platform/graphics/gstreamer/PlatformVideoWindow.h: Removed.
2643         * platform/graphics/gstreamer/PlatformVideoWindowEfl.cpp: Removed.
2644         * platform/graphics/gstreamer/PlatformVideoWindowGtk.cpp: Removed.
2645         * platform/graphics/gstreamer/PlatformVideoWindowMac.mm: Removed.
2646         * platform/graphics/gstreamer/PlatformVideoWindowNix.cpp: Removed.
2647         * platform/graphics/gstreamer/PlatformVideoWindowPrivate.h: Removed.
2648         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
2649         (webkitVideoSinkRender):
2650         (webkitVideoSinkNew):
2651         * platform/graphics/gstreamer/VideoSinkGStreamer.h: Removed code
2652         related to GStreamer and NATIVE_FULLSCREEN_VIDEO.
2653         * platform/graphics/gtk/FullscreenVideoControllerGtk.cpp: Removed.
2654         * platform/graphics/gtk/FullscreenVideoControllerGtk.h: Removed.
2655
2656 2013-11-05  Andreas Kling  <akling@apple.com>
2657
2658         Remove RenderWidget::viewCleared().
2659         <https://webkit.org/b/123777>
2660
2661         This was some ancient hand-waving code from the KHTML era.
2662
2663         It was obviously confused (e.g RenderEmbeddedObject trying to handle
2664         iframe owners, even though that setup is impossible.)
2665
2666         Reviewed by Anders Carlsson.
2667
2668 2013-11-04  Brady Eidson  <beidson@apple.com>
2669
2670         IDB: Split backend Cursors and Transactions into their own files
2671         https://bugs.webkit.org/show_bug.cgi?id=123789
2672
2673         Reviewed by Alexey Proskuryakov.
2674
2675         No new tests (Rename, no change in behavior).
2676
2677         * CMakeLists.txt:
2678         * GNUmakefile.list.am:
2679         * WebCore.xcodeproj/project.pbxproj:
2680
2681         * Modules/indexeddb/IDBBackingStoreCursorInterface.h:
2682         (WebCore::IDBBackingStoreCursorInterface::~IDBBackingStoreCursorInterface):
2683
2684         * Modules/indexeddb/IDBBackingStoreInterface.h:
2685
2686         * Modules/indexeddb/IDBBackingStoreTransactionInterface.h: Added.
2687         (WebCore::IDBBackingStoreTransactionInterface::~IDBBackingStoreTransactionInterface):
2688
2689         * Modules/indexeddb/IDBCursorBackendImpl.cpp:
2690         (WebCore::IDBCursorBackendImpl::IDBCursorBackendImpl):
2691         * Modules/indexeddb/IDBCursorBackendImpl.h:
2692         (WebCore::IDBCursorBackendImpl::create):
2693
2694         * Modules/indexeddb/IDBFactoryBackendInterface.h:
2695
2696         * Modules/indexeddb/IDBIndexWriter.cpp:
2697         (WebCore::IDBIndexWriter::writeIndexKeys):
2698         (WebCore::IDBIndexWriter::verifyIndexKeys):
2699         (WebCore::IDBIndexWriter::addingKeyAllowed):
2700         * Modules/indexeddb/IDBIndexWriter.h:
2701
2702         * Modules/indexeddb/IDBTransactionBackendImpl.cpp:
2703         (WebCore::IDBTransactionBackendImpl::createCursorBackend):
2704         * Modules/indexeddb/IDBTransactionBackendImpl.h:
2705         * Modules/indexeddb/IDBTransactionBackendInterface.h:
2706
2707         * Modules/indexeddb/IDBTransactionBackendOperations.cpp:
2708         (WebCore::GetOperation::perform):
2709         (WebCore::OpenCursorOperation::perform):
2710         (WebCore::CountOperation::perform):
2711         (WebCore::DeleteRangeOperation::perform):
2712
2713         * Modules/indexeddb/leveldb/IDBBackingStoreCursorLevelDB.cpp: Added.
2714         (WebCore::IDBBackingStoreCursorLevelDB::IDBBackingStoreCursorLevelDB):
2715         (WebCore::IDBBackingStoreCursorLevelDB::firstSeek):
2716         (WebCore::IDBBackingStoreCursorLevelDB::advance):
2717         (WebCore::IDBBackingStoreCursorLevelDB::continueFunction):
2718         (WebCore::IDBBackingStoreCursorLevelDB::haveEnteredRange):
2719         (WebCore::IDBBackingStoreCursorLevelDB::isPastBounds):
2720         * Modules/indexeddb/leveldb/IDBBackingStoreCursorLevelDB.h: Added.
2721         (WebCore::IDBBackingStoreCursorLevelDB::~IDBBackingStoreCursorLevelDB):
2722         (WebCore::IDBBackingStoreCursorLevelDB::IDBBackingStoreCursorLevelDB):
2723
2724         * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.cpp:
2725         (WebCore::IDBBackingStoreLevelDB::compareIndexKeys):
2726         (WebCore::IDBBackingStoreLevelDB::updateIDBDatabaseVersion):
2727         (WebCore::IDBBackingStoreLevelDB::createObjectStore):
2728         (WebCore::IDBBackingStoreLevelDB::deleteObjectStore):
2729         (WebCore::IDBBackingStoreLevelDB::getRecord):
2730         (WebCore::IDBBackingStoreLevelDB::putRecord):
2731         (WebCore::IDBBackingStoreLevelDB::clearObjectStore):
2732         (WebCore::IDBBackingStoreLevelDB::deleteRecord):
2733         (WebCore::IDBBackingStoreLevelDB::getKeyGeneratorCurrentNumber):
2734         (WebCore::IDBBackingStoreLevelDB::maybeUpdateKeyGeneratorCurrentNumber):
2735         (WebCore::IDBBackingStoreLevelDB::keyExistsInObjectStore):
2736         (WebCore::IDBBackingStoreLevelDB::createIndex):
2737         (WebCore::IDBBackingStoreLevelDB::deleteIndex):
2738         (WebCore::IDBBackingStoreLevelDB::putIndexDataForRecord):
2739         (WebCore::findGreatestKeyLessThanOrEqual):
2740         (WebCore::IDBBackingStoreLevelDB::findKeyInIndex):
2741         (WebCore::IDBBackingStoreLevelDB::getPrimaryKeyViaIndex):
2742         (WebCore::IDBBackingStoreLevelDB::keyExistsInIndex):
2743         (WebCore::ObjectStoreKeyCursorImpl::create):
2744         (WebCore::ObjectStoreKeyCursorImpl::clone):
2745         (WebCore::ObjectStoreKeyCursorImpl::ObjectStoreKeyCursorImpl):
2746         (WebCore::ObjectStoreCursorImpl::create):
2747         (WebCore::ObjectStoreCursorImpl::clone):
2748         (WebCore::ObjectStoreCursorImpl::ObjectStoreCursorImpl):
2749         (WebCore::objectStoreCursorOptions):
2750         (WebCore::indexCursorOptions):
2751         (WebCore::IDBBackingStoreLevelDB::openObjectStoreCursor):
2752         (WebCore::IDBBackingStoreLevelDB::openObjectStoreKeyCursor):
2753         (WebCore::IDBBackingStoreLevelDB::openIndexKeyCursor):
2754         (WebCore::IDBBackingStoreLevelDB::openIndexCursor):
2755         (WebCore::IDBBackingStoreLevelDB::createBackingStoreTransaction):
2756         * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.h:
2757  
2758        * Modules/indexeddb/leveldb/IDBBackingStoreTransactionLevelDB.cpp: Added.
2759         (WebCore::IDBBackingStoreTransactionLevelDB::IDBBackingStoreTransactionLevelDB):
2760         (WebCore::IDBBackingStoreTransactionLevelDB::begin):
2761         (WebCore::IDBBackingStoreTransactionLevelDB::commit):
2762         (WebCore::IDBBackingStoreTransactionLevelDB::rollback):
2763         * Modules/indexeddb/leveldb/IDBBackingStoreTransactionLevelDB.h:
2764
2765         * Modules/indexeddb/leveldb/IDBFactoryBackendLevelDB.cpp:
2766         (WebCore::IDBFactoryBackendLevelDB::createCursorBackend):
2767         * Modules/indexeddb/leveldb/IDBFactoryBackendLevelDB.h:
2768
2769 2013-11-04  Zalan Bujtas  <zalan@apple.com>
2770
2771         Do not call setFrameRect on Widget unless its boundaries changed.
2772         https://bugs.webkit.org/show_bug.cgi?id=123781
2773
2774         Reviewed by Andreas Kling.
2775
2776         Call Widget:setFrameRect only when the frame's rect actually changes. It also
2777         cleans up the related weak reference code a bit.
2778         
2779         Covered by existing tests.
2780
2781         * rendering/RenderWidget.cpp:
2782         (WebCore::RenderWidget::setWidgetGeometry): 
2783
2784 2013-11-04  Santosh Mahto  <santosh.ma@samsung.com>
2785
2786         [webcore/html] remove extra header includes from cpp files.
2787         https://bugs.webkit.org/show_bug.cgi?id=123740
2788
2789         Reviewed by Darin Adler.
2790
2791         Removing redundant headers.
2792
2793         * html/BaseDateAndTimeInputType.cpp:
2794         * html/ColorInputType.cpp:
2795         * html/DOMFormData.cpp:
2796         * html/DOMURL.cpp:
2797         * html/DateInputType.cpp:
2798         * html/DateTimeInputType.cpp:
2799         * html/DateTimeLocalInputType.cpp:
2800         * html/FTPDirectoryDocument.cpp:
2801         * html/FileInputType.cpp:
2802         * html/FormController.cpp:
2803         * html/HTMLAnchorElement.cpp:
2804         * html/HTMLAreaElement.cpp:
2805         * html/HTMLCanvasElement.cpp:
2806         * html/HTMLCollection.cpp:
2807         * html/HTMLDetailsElement.cpp:
2808         * html/HTMLDocument.cpp:
2809         * html/HTMLElement.cpp:
2810         * html/HTMLFormControlsCollection.cpp:
2811         * html/HTMLFormElement.cpp:
2812         * html/HTMLImageElement.cpp:
2813         * html/HTMLInputElement.cpp:
2814         * html/HTMLLegendElement.cpp:
2815         * html/HTMLMapElement.cpp:
2816         * html/HTMLMediaElement.cpp:
2817         * html/HTMLOptionElement.cpp:
2818         * html/HTMLOptionsCollection.cpp:
2819         * html/HTMLPlugInImageElement.cpp:
2820         * html/HTMLProgressElement.cpp:
2821         * html/HTMLSummaryElement.cpp:
2822         * html/HTMLTemplateElement.cpp:
2823         * html/HTMLVideoElement.cpp:
2824         * html/HTMLViewSourceDocument.cpp:
2825         * html/MediaController.cpp:
2826         * html/MediaKeyEvent.cpp:
2827         * html/MonthInputType.cpp:
2828         * html/RangeInputType.cpp:
2829         * html/StepRange.cpp:
2830         * html/TextFieldInputType.cpp:
2831         * html/TimeInputType.cpp:
2832         * html/WeekInputType.cpp:
2833         * html/canvas/CanvasRenderingContext.cpp:
2834         * html/canvas/CanvasRenderingContext2D.cpp:
2835         * html/canvas/CanvasStyle.cpp:
2836         * html/canvas/OESVertexArrayObject.cpp:
2837         * html/parser/BackgroundHTMLParser.cpp:
2838         * html/parser/CSSPreloadScanner.cpp:
2839         * html/parser/CompactHTMLToken.cpp:
2840         * html/parser/HTMLConstructionSite.cpp:
2841         * html/parser/HTMLDocumentParser.cpp:
2842         * html/parser/HTMLElementStack.cpp:
2843         * html/parser/HTMLFormattingElementList.cpp:
2844         * html/parser/HTMLMetaCharsetParser.cpp:
2845         * html/parser/HTMLParserIdioms.cpp:
2846         * html/parser/HTMLPreloadScanner.cpp:
2847         * html/parser/HTMLTokenizer.cpp:
2848         * html/parser/HTMLTreeBuilder.cpp:
2849         * html/parser/HTMLTreeBuilderSimulator.cpp:
2850         * html/parser/HTMLViewSourceParser.cpp:
2851         * html/parser/TextDocumentParser.cpp:
2852         * html/parser/XSSAuditor.cpp:
2853         * html/shadow/ContentDistributor.cpp:
2854         * html/shadow/InsertionPoint.cpp:
2855         * html/shadow/MediaControlElements.cpp:
2856         * html/shadow/MediaControlsApple.cpp:
2857         * html/shadow/MediaControlsBlackBerry.cpp:
2858         * html/shadow/MediaControlsGtk.cpp:
2859         * html/shadow/SliderThumbElement.cpp:
2860         * html/track/AudioTrack.cpp:
2861         * html/track/InbandGenericTextTrack.cpp:
2862         * html/track/InbandTextTrack.cpp:
2863         * html/track/InbandWebVTTTextTrack.cpp:
2864         * html/track/TextTrack.cpp:
2865         * html/track/TextTrackCueGeneric.cpp:
2866         * html/track/TextTrackList.cpp:
2867         * html/track/TextTrackRegion.cpp:
2868         * html/track/TrackListBase.cpp:
2869         * html/track/VideoTrack.cpp:
2870         * html/track/WebVTTParser.cpp:
2871
2872 2013-11-04  Brady Eidson  <beidson@apple.com>
2873
2874         IDB: deleteDatabase() interface should be asynchronous
2875         https://bugs.webkit.org/show_bug.cgi?id=123787
2876
2877         Reviewed by Tim Horton.
2878
2879         No new tests (No behavior change for a tested port).
2880
2881         deleteDatabase now has no return value, but calls back to a bool function:
2882         * Modules/indexeddb/IDBBackingStoreInterface.h:
2883         * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.cpp:
2884         (WebCore::IDBBackingStoreLevelDB::deleteDatabase):
2885         * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.h:
2886
2887         Refactor to account for the new async deleteDatabase:
2888         * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
2889         (WebCore::IDBDatabaseBackendImpl::processPendingCalls):
2890         (WebCore::IDBDatabaseBackendImpl::deleteDatabase):
2891         (WebCore::IDBDatabaseBackendImpl::deleteDatabaseAsync):
2892         * Modules/indexeddb/IDBDatabaseBackendImpl.h:
2893
2894 2013-11-04  Brady Eidson  <beidson@apple.com>
2895
2896         Add Modules/indexeddb/leveldb to the WebCore.xcodeproj
2897
2898         Rubberstamped by Andreas Kling.
2899
2900         This will make hacking on IDB much easier for Mac developers as they won’t have
2901         to constantly add and then subtract the leveldb subdirectory.
2902
2903         The USE(LEVELDB) flag is still disabled so these files won’t actually build by default.
2904
2905         * WebCore.xcodeproj/project.pbxproj:
2906
2907 2013-11-04  Brady Eidson  <beidson@apple.com>
2908
2909         Address review feedback I forgot to commit in r158641
2910
2911         * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
2912         (WebCore::IDBDatabaseBackendImpl::processPendingOpenCalls):
2913
2914 2013-11-04  Brady Eidson  <beidson@apple.com>
2915
2916         IDB: Make opening/establishing a database asynchronous.
2917         https://bugs.webkit.org/show_bug.cgi?id=123775
2918
2919         Reviewed by Andreas Kling.
2920
2921         No new tests (No behavior change for a tested port).
2922
2923         * Modules/indexeddb/IDBBackingStoreInterface.h: Add getOrEstablishIDBDatabaseMetadata with a callback,
2924           removing getIDBDatabaseMetaData, getObjectStores, and createIDBDatabaseMetaData in the process.
2925
2926         * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.cpp:
2927         (WebCore::IDBBackingStoreLevelDB::getOrEstablishIDBDatabaseMetadata): Adapted from getIDBDatabaseMetaData,
2928           implement the asynchronous interface in terms of other LevelDB methods, always calling back synchronously.
2929         (WebCore::IDBBackingStoreLevelDB::createIDBDatabaseMetaData):
2930         * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.h:
2931
2932         * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
2933         (WebCore::IDBDatabaseBackendImpl::create):
2934         (WebCore::IDBDatabaseBackendImpl::openInternalAsync): Broken off from openInternal.
2935         (WebCore::IDBDatabaseBackendImpl::didOpenInternalAsync): Broken off from openInternal.
2936         (WebCore::IDBDatabaseBackendImpl::processPendingCalls):
2937         (WebCore::IDBDatabaseBackendImpl::processPendingOpenCalls): Broken off to allow didOpenInternalAsync
2938           to perform open callbacks in the failure case.
2939         (WebCore::IDBDatabaseBackendImpl::openConnection): Always queue open connection calls, then immediately processPendingCalls.
2940         (WebCore::IDBDatabaseBackendImpl::openConnectionInternal): Actually perform open connection calls.
2941         * Modules/indexeddb/IDBDatabaseBackendImpl.h:
2942
2943
2944 2013-11-04  Andreas Kling  <akling@apple.com>
2945
2946         CTTE: RenderFrameBase's widget is always a FrameView.
2947         <https://webkit.org/b/123771>
2948
2949         Delete widget() from RenderFrameBase and supplant a childView()
2950         that returns FrameView*. Strip away unnecessary casts and asserts.
2951
2952         Reviewed by Antti Koivisto.
2953
2954 2013-11-04  Zoltan Horvath  <zoltan@webkit.org>
2955
2956         [CSS Regions][CSS Shapes] Content in region doesn't respect shape-outside after initial layout pass
2957         <https://webkit.org/b/114829>
2958
2959         Although we set the size of a shape for shape-outside in RenderBlockFlow::insertFloatingObject based on the
2960         float's size, the actual height of the float is not always resolved at that point. (Look at cases when the shape
2961         has percentage based height or percentage based radius.) ShapeInfo::setShapeSize triggers a layout for 0 height
2962         value, which will be overriden later, when RenderBlockFlow::positionNewFloats sets the actual size of the float (shape).
2963         Thus it doesn't make sense to set the shape's size in insertFloatingObject and run those extra unnecessary layout passes,
2964         since it'll be overriden anyways. I moved the shape size setting logic into RenderBlockFlow::positionNewFloats.
2965
2966         The problem showed up when we had a shape-outside ellipse with percentage based radius, and we inserted the content
2967         with JavaScript into a region flow. The content has been layed out based on the 0 border radius, and relayout hasn't been
2968         triggered when it flew into the flow. This change sets the shape size only when we already have the height of the float,
2969         so the radius(es) can be resolved correctly, thus no unnecessary layout passes will happen and the layout will be correct as well.
2970
2971         Reviewed by David Hyatt.
2972
2973         Test: fast/shapes/shape-outside-floats/shape-outside-floats-layout-after-initial-layout-pass.html
2974
2975         * rendering/RenderBlockFlow.cpp:
2976         (WebCore::RenderBlockFlow::insertFloatingObject): Remove setting the size of the shape.
2977         (WebCore::RenderBlockFlow::positionNewFloats): Set the size of the shape here.
2978
2979 2013-11-04  Samuel White  <samuel_white@apple.com>
2980
2981         AX: AXShowMenu doesn't always work.
2982         https://bugs.webkit.org/show_bug.cgi?id=123649
2983
2984         Reviewed by Chris Fleizach.
2985
2986         No new tests, the change occurs in a code path that forces the context menu to show which
2987         locks up DRT if we try to test it (platform menu is shown). The change itself gives the mouse
2988         event handler a chance to handle our platform mouse event BEFORE the event ends up in the show
2989         context menu machinery. This is necessary because without it, the element will not become
2990         focused. Without focus, accessibility shows different/less menu items than a mouse click. The
2991         end result is that context menus shown via accessibility are consistent with menus shown via click.
2992
2993         * page/ContextMenuController.cpp:
2994         (WebCore::ContextMenuController::showContextMenuAt):
2995
2996 2013-11-04  Jeffrey Pfau  <jpfau@apple.com>
2997
2998         SMIL timers can still fire after the containing document has been torn down
2999         <https://webkit.org/b/123291>
3000
3001         Reviewed by Darin Adler.
3002
3003         Ensure that the timers get paused when the document is preparing to be torn down.
3004
3005         Test: svg/animations/smil-timers-not-disabled-crash.html
3006
3007         * dom/Document.cpp:
3008         (WebCore::Document::dropChildren):
3009         (WebCore::Document::commonTeardown):
3010         (WebCore::Document::prepareForDestruction):
3011         * dom/Document.h:
3012
3013 2013-11-04  Brendan Long  <b.long@cablelabs.com>
3014
3015         Move duplicate code in TrackPrivate classes to a common base class
3016         https://bugs.webkit.org/show_bug.cgi?id=123619
3017
3018         Reviewed by Darin Adler.
3019
3020         No new tests because this is just refactoring.
3021
3022         * GNUmakefile.list.am: Add TrackPrivateBase.
3023         * WebCore.vcxproj/WebCore.vcxproj: Same.
3024         * WebCore.vcxproj/WebCore.vcxproj.filters: Same.
3025         * WebCore.xcodeproj/project.pbxproj: Same.
3026         * html/track/AudioTrack.cpp:
3027         (WebCore::AudioTrack::inbandTrackIndex): Renamed audioTrackIndex() to trackIndex().
3028         (WebCore::AudioTrack::labelChanged): First argument is now a TrackPrivateBase*.
3029         (WebCore::AudioTrack::languageChanged): Same.
3030         (WebCore::AudioTrack::willRemove): Same.
3031         * html/track/AudioTrack.h: Update TrackPrivateBaseClient function signatures.
3032         * html/track/InbandTextTrack.cpp:
3033         (WebCore::InbandTextTrack::inbandTrackIndex): Renamed textTrackIndex() to trackIndex().
3034         (WebCore::InbandTextTrack::labelChanged): First argument is now a TrackPrivateBase*.
3035         (WebCore::InbandTextTrack::languageChanged): Same.
3036         (WebCore::InbandTextTrack::willRemove): Same.
3037         * html/track/InbandTextTrack.h: Update TrackPrivateBaseClient function signatures.
3038         * html/track/VideoTrack.cpp:
3039         (WebCore::VideoTrack::inbandTrackIndex): Renamed videoTrackIndex() to trackIndex().
3040         (WebCore::VideoTrack::labelChanged): First argument is now a TrackPrivateBase*.
3041         (WebCore::VideoTrack::languageChanged): Same.
3042         (WebCore::VideoTrack::willRemove): Same.
3043         * html/track/VideoTrack.h: Update TrackPrivateBaseClient function signatures.
3044         * platform/graphics/AudioTrackPrivate.h: Remove code that was moved to TrackPrivateBase.
3045         * platform/graphics/InbandTextTrackPrivate.h: Same.
3046         * platform/graphics/InbandTextTrackPrivateClient.h: Same.
3047         * platform/graphics/VideoTrackPrivate.h: Same.
3048         * platform/graphics/TrackPrivateBase.h: Refactored out duplicate code in AudioTrackPrivate, InbandTextTrackPrivate and VideoTrackPrivate.
3049         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.h: Renamed textTrackIndex() to trackIndex().
3050         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h: Same.
3051         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h: Renamed audioTrackIndex() to trackIndex().
3052         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h: Renamed videoTrackIndex() to trackIndex90.
3053
3054 2013-11-04  Andreas Kling  <akling@apple.com>
3055
3056         FrameView destructor is worried about being retained by a renderer.
3057         <https://webkit.org/b/123763>
3058
3059         There's no way we can be in ~FrameView() while also being owned by
3060         a RenderWidget. Remove some overly paranoid code that was making sure
3061         the renderer didn't have a reference on us.
3062
3063         Reviewed by Anders Carlsson.
3064
3065 2013-11-04  Eric Carlson  <eric.carlson@apple.com>
3066
3067         REGRESSION(r158311): media/media-fragments/TC0054.html and TC0061.html hit assertions
3068         https://bugs.webkit.org/show_bug.cgi?id=123555
3069
3070         Reviewed by Darin Adler.
3071
3072         No new tests, covered by existing tests.
3073
3074         * html/MediaFragmentURIParser.cpp:
3075         (WebCore::MediaFragmentURIParser::parseFragments): Don't add a fragment with empty key or value as
3076             they will not processed.
3077         (WebCore::MediaFragmentURIParser::parseNPTFragment): Remove excess whitespace.
3078
3079 2013-11-04  Patrick Gansterer  <paroga@webkit.org>
3080
3081         Remove code duplications in createFontCustomPlatformData()
3082         https://bugs.webkit.org/show_bug.cgi?id=123706
3083
3084         Reviewed by Darin Adler.
3085
3086         Move OpenTypeSanitizer and WOFF handling from the port specific
3087         implementations in createFontCustomPlatformData() into the only
3088         caller of this function CachedFont::ensureCustomFontData().
3089         Also change the parameter passing the SharedBuffer from a
3090         pointer to a reference since it is never null.
3091
3092         * loader/cache/CachedFont.cpp:
3093         (WebCore::CachedFont::ensureCustomFontData):
3094         * platform/graphics/blackberry/FontCustomPlatformData.h:
3095         * platform/graphics/blackberry/FontCustomPlatformDataBlackBerry.cpp:
3096         (WebCore::FontCustomPlatformData::FontCustomPlatformData):
3097         (WebCore::createFontCustomPlatformData):
3098         * platform/graphics/cairo/FontCustomPlatformData.h:
3099         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
3100         (WebCore::FontCustomPlatformData::FontCustomPlatformData):
3101         (WebCore::createFontCustomPlatformData):
3102         * platform/graphics/mac/FontCustomPlatformData.cpp:
3103         (WebCore::createFontCustomPlatformData):
3104         * platform/graphics/mac/FontCustomPlatformData.h:
3105         * platform/graphics/win/FontCustomPlatformData.cpp:
3106         (WebCore::createFontCustomPlatformData):
3107         * platform/graphics/win/FontCustomPlatformData.h:
3108         * platform/graphics/win/FontCustomPlatformDataCairo.cpp:
3109         (WebCore::createFontCustomPlatformData):
3110         * platform/graphics/wince/FontCustomPlatformData.cpp:
3111         (WebCore::createFontCustomPlatformData):
3112         * platform/graphics/wince/FontCustomPlatformData.h:
3113
3114 2013-11-04  Thiago de Barros Lacerda  <thiago.lacerda@openbossa.org>
3115
3116         Fixing MediaStreamDescriptor addSource and addTrack methods
3117         https://bugs.webkit.org/show_bug.cgi?id=123755
3118
3119         Reviewed by Eric Carlson.
3120
3121         We must store the track and source that is passed as parameter in a RefPtr,
3122         otherwise we will refer to a null pointer.
3123
3124         No new tests needed.
3125
3126         * platform/mediastream/MediaStreamDescriptor.cpp:
3127         (WebCore::MediaStreamDescriptor::addSource):
3128         (WebCore::MediaStreamDescriptor::addTrack):
3129
3130 2013-11-04  Tim Horton  <timothy_horton@apple.com>
3131
3132         Remove PlatformCALayer::playerLayer
3133         https://bugs.webkit.org/show_bug.cgi?id=123764
3134
3135         Reviewed by Sam Weinig.
3136
3137         * platform/graphics/ca/PlatformCALayer.h:
3138         * platform/graphics/ca/mac/PlatformCALayerMac.h:
3139         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
3140         (PlatformCALayerMac::clone):
3141         Remove playerLayer(), fold it into clone().
3142
3143 2013-11-04  Chris Fleizach  <cfleizach@apple.com>
3144
3145         AX: Mail attachments at the start of an email are not output by VoiceOver
3146         https://bugs.webkit.org/show_bug.cgi?id=123697
3147
3148         Reviewed by Ryosuke Niwa.
3149
3150         VoiceOver is expecting that "replaced elements" (attachments in a Mail message in this case) to be
3151         represented by the replacement character when asking for a stringForRange.
3152
3153         However, when that replaced element is at the beginning of the document, the logic does not work because
3154         there is a few code places that will take that first Position and advance it forward, not accounting for replaced elements.
3155         When using the TextIterator normally, it does account for these, so that's why it's only affecting as at the beginning of the document.
3156
3157         Also a "replaced element" can be more than just renderer->isReplaced(), hence the externing of the isRendererReplacedElement method
3158         and using that it in pertinent places.
3159
3160         Tests: platform/mac/accessibility/object-replacement-with-no-rendered-children-at-node-start.html
3161                platform/mac/accessibility/object-replacement-with-rendered-children-at-node-start.html
3162
3163         * accessibility/AccessibilityObject.cpp:
3164         (WebCore::replacedNodeNeedsCharacter):
3165         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3166         (nsStringForReplacedNode):
3167         * dom/Position.cpp:
3168         (WebCore::Position::isCandidate):
3169         * dom/PositionIterator.cpp:
3170         * dom/Range.cpp:
3171         (WebCore::Range::firstNode):
3172         * editing/TextIterator.cpp:
3173         (WebCore::isRendererReplacedElement):
3174         * editing/TextIterator.h:
3175
3176 2013-11-04  Andreas Kling  <akling@apple.com>
3177
3178         Use RenderAncestorIterator in a couple of places.
3179         <https://webkit.org/b/123725>
3180
3181         Take the ancestorsOfType<RenderMoo>() thingy out for a spin.
3182
3183         Found a bunch of parent chain walking loops that were really just
3184         looking for the first ancestor renderer of a certain type.
3185         They were a perfect fit for this pattern:
3186
3187             if (auto svgRoot = ancestorsOfType<RenderSVGRoot>(renderer).first())
3188                 svgRoot->shakeMoneyMaker();
3189
3190         Quite a bit clearer than the previous:
3191
3192             for (auto ancestor = renderer.parent(); ancestor; ancestor = ancestor->parent()) {
3193                 if (ancestor->isSVGRoot())
3194                     toRenderSVGRoot(ancestor)->makeMoneyShaker();
3195             }
3196
3197         Reviewed by Antti Koivisto.
3198
3199 2013-10-25  Jer Noble  <jer.noble@apple.com>
3200
3201         [MSE] Add a SourceBufferPrivateClient interface for platform -> html communication.
3202         https://bugs.webkit.org/show_bug.cgi?id=123373
3203
3204         Reviewed by Eric Carlson.
3205
3206         To enable communication between SourceBuffer and SourceBufferPrivate without introducing
3207         layering violations, add a new interface class SourceBufferPrivateInterface from which
3208         SourceBuffer will inherit.
3209
3210         * Modules/mediasource/SourceBuffer.cpp:
3211         (WebCore::SourceBuffer::SourceBuffer): Set the private's client.
3212         (WebCore::SourceBuffer::~SourceBuffer): Clear the private's client.
3213         (WebCore::SourceBuffer::sourceBufferPrivateDidEndStream): Added stub.
3214         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment): Hinno.
3215         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): Ditto.
3216         (WebCore::SourceBuffer::sourceBufferPrivateHasAudio): Ditto.
3217         (WebCore::SourceBuffer::sourceBufferPrivateHasVideo): Ditto.
3218         * Modules/mediasource/SourceBuffer.h:
3219         * WebCore.xcodeproj/project.pbxproj: Add new files to project.
3220         * platform/graphics/SourceBufferPrivate.h:
3221         * platform/graphics/SourceBufferPrivateClient.h: Added.
3222         (WebCore::SourceBufferPrivateClient::~SourceBufferPrivateClient): Empty destructor.
3223
3224 2013-11-01  Jer Noble  <jer.noble@apple.com>
3225
3226         [PluginProxy] Add a setting to disable video plugin proxy support in HTMLMediaElement.
3227         https://bugs.webkit.org/show_bug.cgi?id=123621
3228
3229         Reviewed by Eric Carlson.
3230
3231         Add a new Setting which will disable the video plugin proxy. Enable support for AVFoundation
3232         in iOS (which requries fixing a few compile errors resulting from classes and methods which
3233         are not available on iOS.
3234
3235         * WebCore.exp.in: Export wkAVAssetResolvedURL.
3236         * css/StyleResolver.cpp:
3237         (WebCore::StyleResolver::canShareStyleWithElement): Make conditional upon
3238             new isVideoPluginProxyEnabled() setting.
3239         * html/HTMLMediaElement.cpp:
3240         (WebCore::HTMLMediaElement::parseAttribute): Ditto.
3241         * html/HTMLMediaElement.h:
3242         * html/HTMLVideoElement.cpp:
3243         (WebCore::HTMLVideoElement::createRenderer): Ditto.
3244         (WebCore::HTMLVideoElement::attach): Ditto.
3245         (WebCore::HTMLVideoElement::parseAttribute): Ditto.
3246         (HTMLVideoElement::setDisplayMode): Ditto.
3247         * html/HTMLVideoElement.h:
3248         * page/Settings.cpp:
3249         (WebCore::Settings::setVideoPluginProxyEnabled): Simple setter.
3250         * page/Settings.h:
3251         (WebCore::Settings::isVideoPluginProxyEnabled): Simple getter.
3252         * platform/graphics/MediaPlayer.cpp:
3253         (WebCore::installedMediaEngines): Conditionally add MediaPlayerPrivateIOS and always add
3254             MediaPlayerPriateAVFoundationObjC.
3255         * platform/graphics/MediaPlayerPrivate.h:
3256         (WebCore::MediaPlayerPrivateInterface::deliverNotification): Add default implementation.
3257         (WebCore::MediaPlayerPrivateInterface::setMediaPlayerProxy): Ditto.
3258         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3259         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3260         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC): Use new
3261             HAS_ and USE_ macros instead of __MAC_OS_MIN_VERNSION_REQUIRED.
3262         (WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC): Ditto.
3263         (WebCore::MediaPlayerPrivateAVFoundationObjC::hasContextRenderer): Ditto.
3264         (WebCore::MediaPlayerPrivateAVFoundationObjC::createContextVideoRenderer): Ditto.
3265         (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyContextVideoRenderer): Ditto.
3266         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Ditto.
3267         (WebCore::MediaPlayerPrivateAVFoundationObjC::paint): Ditto.
3268         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer): Use cachedCGColor instead
3269             of CGColorGetConstantColor.
3270         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput): Use CVPixelBuffer pixel
3271             format constant instead of QuickDraw constant.
3272         (WebCore::MediaPlayerPrivateAVFoundationObjC::createPixelBuffer): Ditto.
3273         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput): Draw to intermediary
3274             CGImage on iOS.
3275         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h:
3276         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
3277         * platform/ios/WebCoreSystemInterfaceIOS.mm:
3278         * platform/mac/WebCoreSystemInterface.h:
3279
3280 2013-11-04  Andreas Kling  <akling@apple.com>
3281
3282         REGRESSION(r158561): fast/block/float/float-append-child-crash.html asserting.
3283
3284         The non-const ancestor iterator was walking siblings, not ancestors.
3285
3286         Rubber-stamped by Antti Koivisto.
3287
3288 2013-10-31  Jer Noble  <jer.noble@apple.com>
3289
3290         [MSE] [Mac] Disclaim support for MSE in AVFoundation and QTKit engines
3291         https://bugs.webkit.org/show_bug.cgi?id=123593
3292
3293         Reviewed by Eric Carlson.
3294
3295         Immediately fail if asked to load a Media Source in engines which do not support
3296         them.
3297
3298         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
3299         (WebCore::MediaPlayerPrivateAVFoundation::load):
3300         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
3301         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3302         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
3303         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
3304         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3305         (WebCore::MediaPlayerPrivateQTKit::load):
3306         (WebCore::MediaPlayerPrivateQTKit::supportsType):
3307
3308 2013-11-04  Hans Muller  <hmuller@adobe.com>
3309
3310         [CSS Shapes] image valued shape element margin can cause an ASSERT fail
3311         https://bugs.webkit.org/show_bug.cgi?id=123743
3312
3313         Reviewed by Andreas Kling.
3314
3315         When margin-top is specified for a shape's element, the Y coordinates passed
3316         to RasterShapeIntervals::getExcludedIntervals() may be negative. This is
3317         because the incoming logical coordinates are relative to the content or
3318         padding box, depending on the box-sizing property. The RasterShape::getExcludedIntervals()
3319         method now clips the incoming Y coordinates to the shape's bounds before
3320         accessing the shape's intervals.
3321
3322         Test: fast/shapes/shape-outside-floats/shape-outside-floats-margin-crash.html
3323
3324         * rendering/shapes/RasterShape.cpp:
3325         (WebCore::RasterShapeIntervals::getExcludedIntervals):
3326
3327 2013-11-04  Antti Koivisto  <antti@apple.com>
3328
3329         Make LiveNodeListBase use Elements instead of Nodes
3330         https://bugs.webkit.org/show_bug.cgi?id=123745
3331
3332         Reviewed by Anders Carlsson.
3333
3334         * WebCore.exp.in:
3335         * dom/Element.cpp:
3336         (WebCore::Element::firstElementChild):
3337         (WebCore::Element::lastElementChild):
3338         
3339             Switch to correct calls. ElementTraversal::previous and previousChild are no longer equivalent.
3340
3341         * dom/ElementTraversal.h:
3342         (WebCore::::lastWithinTemplate):
3343         (WebCore::::previousTemplate):
3344         
3345             Fix ElementTraversal::lastWithin and previous. They had no real clients and didn't work correctly.
3346             With LiveNodeListBase starting to use these they get excellent test coverage.
3347
3348         * dom/LiveNodeList.cpp:
3349         (WebCore::LiveNodeListBase::invalidateCache):
3350         * dom/LiveNodeList.h:
3351         (WebCore::LiveNodeListBase::LiveNodeListBase):
3352         (WebCore::LiveNodeListBase::isElementCacheValid):
3353         (WebCore::LiveNodeListBase::cachedElement):
3354         (WebCore::LiveNodeListBase::cachedElementOffset):
3355         (WebCore::LiveNodeListBase::setCachedElement):
3356         
3357             Make the cache Element based.
3358             Switch to Elements in all helpers.
3359             Rename item -> element for clarity.
3360
3361         * dom/NodeIterator.cpp:
3362         (WebCore::NodeIterator::NodePointer::moveToPrevious):
3363         (WebCore::NodeIterator::updateForNodeRemoval):
3364         
3365             This code expected the old inconsistent NodeTraversal::previous behavior where the traversal includes
3366             the root as the last item. Drop the stayWithin parameter and handle the one case where it is needed here.
3367
3368         * dom/NodeTraversal.cpp:
3369         (WebCore::NodeTraversal::last):
3370         (WebCore::NodeTraversal::deepLastChild):
3371         * dom/NodeTraversal.h:
3372         
3373             Support ElementTraversal::previous/lastWithin.
3374
3375         (WebCore::NodeTraversal::previous):
3376         
3377             This was slightly wrong too.
3378
3379         * html/HTMLCollection.cpp:
3380         (WebCore::previousElement):
3381         (WebCore::lastElement):
3382         (WebCore::LiveNodeListBase::iterateForPreviousElement):
3383         (WebCore::LiveNodeListBase::itemBefore):
3384         (WebCore::LiveNodeListBase::isLastItemCloserThanLastOrCachedItem):
3385         (WebCore::LiveNodeListBase::isFirstItemCloserThanCachedItem):
3386         (WebCore::LiveNodeListBase::setCachedElement):
3387         (WebCore::LiveNodeListBase::item):
3388         (WebCore::LiveNodeListBase::elementBeforeOrAfterCachedElement):
3389         * html/HTMLCollection.h:
3390         (WebCore::HTMLCollection::isEmpty):
3391         (WebCore::HTMLCollection::hasExactlyOneItem):
3392
3393 2013-11-04  Michael Saboff  <msaboff@apple.com>
3394
3395         Eliminate HostCall bit from JSC Stack CallerFrame
3396         https://bugs.webkit.org/show_bug.cgi?id=123642
3397
3398         Reviewed by Geoffrey Garen.
3399
3400         Updated JavaScript stack walking as a result of the corresponding changes made in
3401         JavaScriptCore.
3402
3403         * bindings/js/ScriptController.cpp:
3404         (WebCore::ScriptController::shouldBypassMainWorldContentSecurityPolicy):
3405         * bindings/js/ScriptDebugServer.cpp:
3406         (WebCore::ScriptDebugServer::stepOutOfFunction):
3407         (WebCore::ScriptDebugServer::returnEvent):
3408         (WebCore::ScriptDebugServer::didExecuteProgram):
3409
3410 2013-11-04  Bem Jones-Bey  <bjonesbe@adobe.com>
3411
3412         [css shapes] Fix support for shape-outside on a float with padding
3413         https://bugs.webkit.org/show_bug.cgi?id=123590
3414
3415         Reviewed by Alexandru Chiculita.
3416
3417         The line top was being improperly converted to the coordinates of the
3418         shape, causing the shape to be positioned incorrectly when the float
3419         had padding. This fixes that problem.
3420
3421         No new tests, covered by updates to existing ones.
3422
3423         * rendering/shapes/ShapeOutsideInfo.cpp:
3424         (WebCore::ShapeOutsideInfo::updateDeltasForContainingBlockLine):
3425
3426 2013-11-04  Alexey Proskuryakov  <ap@apple.com>
3427
3428         Implement generateKey for HMAC and AES-CBC
3429         https://bugs.webkit.org/show_bug.cgi?id=123669
3430
3431         Reviewed by Dan Bernstein.
3432
3433         Tests: crypto/subtle/aes-cbc-generate-key.html
3434                crypto/subtle/hmac-generate-key.html
3435
3436         * WebCore.xcodeproj/project.pbxproj: Added new files.
3437
3438         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
3439         (WebCore::createAesKeyGenParams): Added bindings for AesKeyGenParams.
3440         (WebCore::JSCryptoAlgorithmDictionary::createParametersForGenerateKey): Handle
3441         algorithms that generate AES and HMAC keys.
3442
3443         * bindings/js/JSSubtleCryptoCustom.cpp: (WebCore::JSSubtleCrypto::generateKey): Added.
3444
3445         * crypto/CryptoAlgorithmAesKeyGenParams.h: Added.
3446
3447         * crypto/CryptoKey.cpp: (WebCore::CryptoKey::randomData):
3448         * crypto/CryptoKey.h:
3449         * crypto/CryptoKeyMac.cpp: Added
3450         Expose a function that produces random data for symmetric crypto keys. Cross-platform
3451         implementation uses ARC4 code from WTF, while Mac uses a system function that
3452         provides a FIPS validated random number generator.
3453
3454         * crypto/CryptoKeyAES.cpp: (WebCore::CryptoKeyAES::generate):
3455         * crypto/CryptoKeyAES.h:
3456         Added a function that creates AES keys.
3457
3458         * crypto/SubtleCrypto.idl: Added generateKey.
3459
3460         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
3461         (WebCore::CryptoAlgorithmAES_CBC::generateKey): Added.
3462
3463         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
3464         (WebCore::CryptoAlgorithmHMAC::generateKey): Added.
3465
3466         * crypto/keys/CryptoKeyHMAC.cpp: (WebCore::CryptoKeyHMAC::generate):
3467         * crypto/keys/CryptoKeyHMAC.h:
3468         Added a function that creates HMAC keys.
3469
3470         * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp: Removed generateKey stub, the implementation
3471         ended up in cross-platform file.
3472
3473         * crypto/mac/CryptoAlgorithmHMACMac.cpp: Ditto.
3474
3475 2013-11-04  Daniel Bates  <dabates@apple.com>
3476
3477         Revert SetCGFontRenderingMode() build fix for Chromium Mac
3478         https://bugs.webkit.org/show_bug.cgi?id=123633
3479
3480         Reviewed by Darin Adler.
3481
3482         Reverts <http://trac.webkit.org/changeset/134380>, which
3483         was a Chromium Mac build fix for <http://trac.webkit.org/changeset/134348>
3484         (https://bugs.webkit.org/show_bug.cgi?id=101787). Chromium doesn't
3485         build against top-of-tree WebKit.
3486
3487         * platform/graphics/mac/FontMac.mm:
3488         (WebCore::Font::drawGlyphs):
3489         * platform/mac/WebCoreSystemInterface.h:
3490         * platform/mac/WebCoreSystemInterface.mm:
3491
3492 2013-11-04  Commit Queue  <commit-queue@webkit.org>
3493
3494         Unreviewed, rolling out r158526.
3495         http://trac.webkit.org/changeset/158526
3496         https://bugs.webkit.org/show_bug.cgi?id=123744
3497
3498         it broke the build (Requested by jessieberlin on #webkit).
3499
3500         * WebCore.xcodeproj/project.pbxproj:
3501         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
3502         (WebCore::createAesCbcParams):
3503         (WebCore::createHmacParams):
3504         (WebCore::createHmacKeyParams):
3505         (WebCore::JSCryptoAlgorithmDictionary::createParametersForGenerateKey):
3506         * bindings/js/JSSubtleCryptoCustom.cpp:
3507         * crypto/CryptoAlgorithmAesKeyGenParams.h: Removed.
3508         * crypto/CryptoKey.cpp:
3509         * crypto/CryptoKey.h:
3510         * crypto/CryptoKeyAES.cpp:
3511         * crypto/CryptoKeyAES.h:
3512         * crypto/CryptoKeyMac.cpp: Removed.
3513         * crypto/SubtleCrypto.idl:
3514         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
3515         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
3516         * crypto/keys/CryptoKeyHMAC.cpp:
3517         * crypto/keys/CryptoKeyHMAC.h:
3518         * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
3519         (WebCore::CryptoAlgorithmAES_CBC::generateKey):
3520         * crypto/mac/CryptoAlgorithmHMACMac.cpp:
3521         (WebCore::CryptoAlgorithmHMAC::generateKey):
3522
3523 2013-11-04  Przemyslaw Szymanski  <p.szymanski3@samsung.com>
3524
3525         [Texmap] Remove redundant calls in CoordinatedGraphicsScene
3526         https://bugs.webkit.org/show_bug.cgi?id=123737
3527
3528         Reviewed by Noam Rosenthal.
3529
3530         Removing unused code left after few refactoring patches.
3531
3532         No new tests. Covered by existing ones.
3533
3534         * platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp:
3535         (WebCore::CoordinatedGraphicsScene::paintToCurrentGLContext):
3536
3537 2013-11-04  Andreas Kling  <akling@apple.com>
3538
3539         CSSPrimitiveValue color constructors should return PassRef.
3540         <https://webkit.org/b/123728>
3541
3542         Make CSSPrimitiveValue::createColor() and the corresponding
3543         CSSValuePool helper functions return PassRef<CSSPrimitiveValue>.
3544
3545         Also made CSSValuePool slightly less stupid when hitting the upper
3546         size limit on the color value cache: instead of throwing out cache
3547         and rebuilding it from scratch, just remove one value at random.
3548
3549         Reviewed by Antti Koivisto.
3550
3551 2013-11-04  Andreas Kling  <akling@apple.com>
3552
3553         Some more RenderChildIterator deployment.
3554         <https://webkit.org/b/123735>
3555
3556         Convert another handful of loops to use childrenOfType<RenderFoo>
3557         iterators, mostly for skipping over uninteresting text renderers.
3558
3559         Reviewed by Antti Koivisto.
3560
3561 2013-11-04  Andreas Kling  <akling@apple.com>
3562
3563         LabelsNodeList always is always rooted at a LabelableElement.
3564         <https://webkit.org/b/123730>
3565
3566         Tighten up LabelsNodeList by enforcing that it's only rooted to
3567         a LabelableElement. Also marked the class FINAL and made its
3568         create() helper return PassRef.
3569
3570         Reviewed by Antti Koivisto.
3571
3572 2013-11-04  Andreas Kling  <akling@apple.com>
3573
3574         REGRESSION: RenderStyle is leaked when not creating renderer for display:none
3575         <https://webkit.org/b/123726>
3576
3577         Explicitly drop the RenderStyle reference in RenderElement::createFor
3578         if we decide to not create any renderer.
3579
3580         Reviewed by Antti Koivisto.
3581
3582         Test: fast/css/renderstyle-leak-with-display-none.html
3583
3584         * rendering/RenderElement.cpp:
3585         (WebCore::RenderElement::createFor):
3586
3587 2013-11-04  Santosh Mahto  <santosh.ma@samsung.com>
3588
3589         [webcore/dom] Remove extra header includes from cpp files.
3590         https://bugs.webkit.org/show_bug.cgi?id=123720
3591
3592         Reviewed by Andreas Kling.
3593
3594         Removing redundant headers from dom related cpp files.
3595
3596         * dom/Attr.cpp:
3597         * dom/CharacterData.cpp:
3598         * dom/ChildListMutationScope.cpp:
3599         * dom/ChildNodeList.cpp:
3600         * dom/ContainerNode.cpp:
3601         * dom/ContainerNodeAlgorithms.cpp:
3602         * dom/DOMNamedFlowCollection.cpp:
3603         * dom/DatasetDOMStringMap.cpp:
3604         * dom/Document.cpp:
3605         * dom/DocumentEventQueue.cpp:
3606         * dom/DocumentMarkerController.cpp:
3607         * dom/DocumentOrderedMap.cpp:
3608         * dom/DocumentStyleSheetCollection.cpp:
3609         * dom/Element.cpp:
3610         * dom/ElementRareData.cpp:
3611         * dom/Event.cpp:
3612         * dom/EventContext.cpp:
3613         * dom/EventDispatcher.cpp:
3614         * dom/EventTarget.cpp:
3615         * dom/ExceptionBase.cpp:
3616         * dom/FocusEvent.cpp:
3617         * dom/InlineStyleSheetOwner.cpp:
3618         * dom/KeyboardEvent.cpp:
3619         * dom/LiveNodeList.cpp:
3620         * dom/MessageEvent.cpp:
3621         * dom/MessagePort.cpp:
3622         * dom/MouseRelatedEvent.cpp:
3623         * dom/MutationEvent.cpp:
3624         * dom/MutationObserver.cpp:
3625         * dom/MutationObserverInterestGroup.cpp:
3626         * dom/MutationObserverRegistration.cpp:
3627         * dom/MutationRecord.cpp:
3628         * dom/NameNodeList.cpp:
3629         * dom/NamedFlowCollection.cpp:
3630         * dom/NamedNodeMap.cpp:
3631         * dom/Node.cpp:
3632         * dom/NodeIterator.cpp:
3633         * dom/NodeTraversal.cpp:
3634         * dom/PositionIterator.cpp:
3635         * dom/ProcessingInstruction.cpp:
3636         * dom/Range.cpp:
3637         * dom/RegisteredEventListener.cpp:
3638         * dom/ScopedEventQueue.cpp:
3639         * dom/ScriptElement.cpp:
3640         * dom/ScriptRunner.cpp:
3641         * dom/SelectorQuery.cpp:
3642         * dom/ShadowRoot.cpp:
3643         * dom/StyledElement.cpp:
3644         * dom/TagNodeList.cpp:
3645         * dom/Text.cpp:
3646         * dom/TextEvent.cpp:
3647         * dom/TouchEvent.cpp:
3648         * dom/TreeScope.cpp:
3649         * dom/TreeScopeAdopter.cpp:
3650         * dom/TreeWalker.cpp:
3651         * dom/UIEvent.cpp:
3652         * dom/UserActionElementSet.cpp:
3653         * dom/UserTypingGestureIndicator.cpp:
3654         * dom/VisitedLinkState.cpp:
3655         * dom/WebKitNamedFlow.cpp:
3656
3657 2013-11-04  Andreas Kling  <akling@apple.com>
3658
3659         HTMLAllCollection is always rooted at a Document.
3660         <https://webkit.org/b/123724>
3661
3662         Tighten up HTMLAllCollection by making the constructor take a
3663         Document& instead of a ContainerNode&. Drive-by application of
3664         FINAL and PassRef also happened.
3665
3666         Reviewed by Antti Koivisto.
3667
3668 2013-11-04  Andreas Kling  <akling@apple.com>
3669
3670         Make more CSSValue subclass constructors return PassRef.
3671         <https://webkit.org/b/123731>
3672
3673         Make the constructor helpers for the following classes return
3674         PassRef instead of PassRefPtr:
3675
3676             - CSSFontValue
3677             - CSSImageSetValue
3678             - CSSUnicodeRangeValue
3679             - WebKitCSSArrayFunctionValue
3680             - WebKitCSSFilterValue
3681             - WebKitCSSMatFunctionValue
3682             - WebKitCSSMixFunctionValue
3683             - WebKitCSSShaderValue
3684             - WebKitCSSTransformValue
3685
3686         Reviewed by Antti Koivisto.
3687
3688 2013-11-04  Jozsef Berta  <jberta@inf.u-szeged.hu>
3689
3690         Buildfix after r158182 for GCC 4.6
3691         https://bugs.webkit.org/show_bug.cgi?id=123442
3692
3693         Reviewed by Csaba Osztrogonác.
3694
3695         Added explicit "friend class", because  GCC 4.6 doesn't support extended friend declaration (c++11)
3696
3697         * dom/ScopedEventQueue.h:
3698
3699 2013-11-04  Andreas Kling  <akling@apple.com>
3700
3701         HTMLTableRowsCollection is always rooted at a HTMLTableElement.
3702         <https://webkit.org/b/123721>
3703
3704         Tighten up HTMLTableRowsCollection by making the create() helper
3705         take a HTMLTableElement& and adding a HTMLSelectElement& getter.
3706
3707         Reviewed by Antti Koivisto.
3708
3709 2013-11-04  Andreas Kling  <akling@apple.com>
3710
3711         HTMLNameCollection and friends are always rooted at a Document.
3712         <https://webkit.org/b/123722>
3713
3714         Tighten WindowNameCollection and DocumentNameCollection by making
3715         their constructors take a Document&, and add a slightly better
3716         document() than the one we inherit from LiveNodeListBase.
3717
3718         Also marked the classes FINAL and made create() helpers return
3719         PassRef instead of PassRefPtr.
3720
3721         Reviewed by Antti Koivisto.
3722
3723 2013-11-04  Andreas Kling  <akling@apple.com>
3724
3725         Add an ancestor renderer iterator.
3726         <https://webkit.org/b/123718>
3727
3728         Add ancestor iterators for renderers, analogous to element ancestor
3729         iterators. They walk the chain of parent renderers, stopping at each
3730         ancestor of a certain type.
3731
3732         Just like child renderer iterators, this requires isRendererOfType()
3733         to be implemented for the targeted renderer class.
3734
3735         You use them like this:
3736
3737         auto frameSets = ancestorsOfType<RenderFrameSet>(*this);
3738         for (auto frameSet = frameSets.begin(), end = frameSets.end(); frameSet != end; ++frameSet)
3739             frameSet->thisOrThat();
3740
3741         To complete the patch, I put them to use in a couple of random places.
3742
3743         Reviewed by Antti Koivisto.
3744
3745 2013-11-04  Mihnea Ovidenie  <mihnea@adobe.com>
3746
3747         [CSSRegions] Use auto keyword to clean-up for loops
3748         https://bugs.webkit.org/show_bug.cgi?id=123699
3749
3750         Reviewed by Anders Carlsson.
3751
3752         Start using auto keyword for loops.
3753         Also, since region breaks (forced breaks) can be added only on boxes,
3754         i changed RenderFlowThread::addForcedRegionBreak to use a RenderBox* instead of RenderObject*.
3755
3756         No change in functionality, no new tests.
3757
3758         * dom/WebKitNamedFlow.cpp:
3759         (WebCore::WebKitNamedFlow::firstEmptyRegionIndex):
3760         * rendering/FlowThreadController.cpp:
3761         (WebCore::FlowThreadController::ensureRenderFlowThreadWithName):
3762         (WebCore::FlowThreadController::styleDidChange):
3763         (WebCore::FlowThreadController::layoutRenderNamedFlowThreads):
3764         (WebCore::FlowThreadController::updateFlowThreadsChainIfNecessary):
3765         (WebCore::FlowThreadController::updateFlowThreadsNeedingLayout):
3766         (WebCore::FlowThreadController::updateFlowThreadsNeedingTwoStepLayout):
3767         (WebCore::FlowThreadController::resetFlowThreadsWithAutoHeightRegions):
3768         (WebCore::FlowThreadController::updateFlowThreadsIntoConstrainedPhase):
3769         (WebCore::FlowThreadController::updateFlowThreadsIntoOverflowPhase):
3770         (WebCore::FlowThreadController::updateFlowThreadsIntoMeasureContentPhase):
3771         (WebCore::FlowThreadController::updateFlowThreadsIntoFinalPhase):
3772         (WebCore::FlowThreadController::updateRenderFlowThreadLayersIfNeeded):
3773         (WebCore::FlowThreadController::collectFixedPositionedLayers):
3774         (WebCore::FlowThreadController::isAutoLogicalHeightRegionsCountConsistent):
3775         * rendering/RenderFlowThread.cpp:
3776         (WebCore::RenderFlowThread::validateRegions):
3777         (WebCore::RenderFlowThread::hasCompositingRegionDescendant):
3778         (WebCore::RenderFlowThread::getLayerListForRegion):
3779         (WebCore::RenderFlowThread::updateLayerToRegionMappings):
3780         (WebCore::RenderFlowThread::updateLogicalWidth):
3781         (WebCore::RenderFlowThread::computeLogicalHeight):
3782         (WebCore::RenderFlowThread::repaintRectangleInRegions):
3783         (WebCore::RenderFlowThread::removeRenderBoxRegionInfo):
3784         (WebCore::RenderFlowThread::logicalWidthChangedInRegionsForBlock):
3785         (WebCore::RenderFlowThread::clearRenderObjectCustomStyle):
3786         (WebCore::RenderFlowThread::clearRenderBoxRegionInfoAndCustomStyle):
3787         (WebCore::RenderFlowThread::setRegionRangeForBox):
3788         (WebCore::RenderFlowThread::getRegionRangeForBox):
3789         (WebCore::RenderFlowThread::regionInRange):
3790         (WebCore::RenderFlowThread::checkRegionsWithStyling):
3791         (WebCore::RenderFlowThread::objectInFlowRegion):
3792         (WebCore::RenderFlowThread::isAutoLogicalHeightRegionsCountConsistent):
3793         (WebCore::RenderFlowThread::initializeRegionsComputedAutoHeight):
3794         (WebCore::RenderFlowThread::markAutoLogicalHeightRegionsForLayout):
3795         (WebCore::RenderFlowThread::markRegionsForOverflowLayoutIfNeeded):
3796         (WebCore::RenderFlowThread::updateRegionsFlowThreadPortionRect):
3797         (WebCore::RenderFlowThread::addForcedRegionBreak):
3798         (WebCore::RenderFlowThread::collectLayerFragments):
3799         (WebCore::RenderFlowThread::fragmentsBoundingBox):
3800         (WebCore::RenderFlowThread::addRegionsVisualEffectOverflow):
3801         (WebCore::RenderFlowThread::addRegionsVisualOverflowFromTheme):
3802         (WebCore::RenderFlowThread::addRegionsOverflowFromChild):
3803         (WebCore::RenderFlowThread::addRegionsLayoutOverflow):
3804         (WebCore::RenderFlowThread::clearRegionsOverflow):
3805         * rendering/RenderFlowThread.h:
3806         * rendering/RenderNamedFlowThread.cpp:
3807         (WebCore::RenderNamedFlowThread::nextRendererForNode):
3808         (WebCore::RenderNamedFlowThread::previousRendererForNode):
3809         (WebCore::RenderNamedFlowThread::dependsOn):
3810         (WebCore::addRegionToList):
3811         (WebCore::RenderNamedFlowThread::computeOversetStateForRegions):
3812         (WebCore::RenderNamedFlowThread::checkInvalidRegions):
3813         (WebCore::RenderNamedFlowThread::pushDependencies):
3814         * rendering/RenderRegion.cpp:
3815         (WebCore::RenderRegion::setRegionObjectsRegionStyle):
3816         (WebCore::RenderRegion::restoreRegionObjectsOriginalStyle):
3817         (WebCore::RenderRegion::computeChildrenStyleInRegion):
3818
3819 2013-11-03  Zan Dobersek  <zdobersek@igalia.com>
3820
3821         PingLoader objects unnecessarily pass through OwnPtr
3822         https://bugs.webkit.org/show_bug.cgi?id=122942
3823
3824         Reviewed by Darin Adler.
3825
3826         There's no need to store new PingLoader objects into an OwnPtr just to leak them out a few lines later
3827         into an unused variable. New objects are created through a new helper method and then left unmanaged as
3828         they're guaranteed to destroy themselves when they receive a response of any kind.
3829
3830         * loader/PingLoader.cpp:
3831         (WebCore::PingLoader::loadImage): Call the new createPingLoader method to spawn the PingLoader.
3832         (WebCore::PingLoader::sendPing): Ditto.
3833         (WebCore::PingLoader::sendViolationReport): Ditto.
3834         (WebCore::PingLoader::createPingLoader): A helper method that creates a new PingLoader object
3835         * loader/PingLoader.h: Declare the new PingLoader::createPingLoader method.
3836
3837 2013-11-03  Andreas Kling  <akling@apple.com>
3838
3839         HTMLOptionsCollection is always rooted at a HTMLSelectElement.
3840         <https://webkit.org/b/123719>
3841
3842         Tighten up HTMLOptionsCollection by making the constructor take
3843         a HTMLSelectElement& and adding a HTMLSelectElement& getter instead
3844         of casting all over the place. Removed now-pointless assertions.
3845
3846         Reviewed by Sam Weinig.
3847
3848 2013-11-03  Andreas Kling  <akling@apple.com>
3849
3850         RenderTextFragment: Tighten first-letter logic.
3851         <https://webkit.org/b/123714>
3852
3853         Reviewed by Antti Koivisto.
3854
3855         * editing/TextIterator.cpp:
3856         (WebCore::firstRenderTextInFirstLetter):
3857
3858             Use iterator helper to find first RenderText child.
3859
3860         (WebCore::TextIterator::handleTextNodeFirstLetter):
3861
3862             Tightening through type inference.
3863
3864         * rendering/RenderBlock.cpp:
3865         (WebCore::RenderBlock::updateFirstLetterStyle):
3866         (WebCore::RenderBlock::createFirstLetterRenderer):
3867         * rendering/RenderTextFragment.h:
3868
3869             The first letter renderer is always a RenderBoxModelObject,
3870             so make the code deal in that instead of RenderObject.
3871
3872         * rendering/RenderChildIterator.h:
3873         (WebCore::RenderChildIteratorAdapter::first):
3874         (WebCore::RenderChildIteratorAdapter::last):
3875
3876             Remove excess ampersands that were keeping this from building.
3877
3878 2013-11-03  Andreas Kling  <akling@apple.com>
3879
3880         CSSPrimitiveValue identifier constructors should return PassRef.
3881         <https://webkit.org/b/123712>
3882
3883         Make CSSPrimitiveValue::createIdentifier() and the corresponding
3884         CSSValuePool helper return PassRef<CSSPrimitiveValue>.
3885
3886         Reviewed by Antti Koivisto.
3887
3888 2013-11-03  Andreas Kling  <akling@apple.com>
3889
3890         Use RenderChildIterator in two more loops.
3891         <https://webkit.org/b/123713>
3892
3893         Switch two more renderer child traversal loops to childrenOfType.
3894
3895         Reviewed by Antti Koivisto.
3896
3897 2013-11-03  Andreas Kling  <akling@apple.com>
3898
3899         CSSShadowValue constructor should return PassRef.
3900         <https://webkit.org/b/123711>
3901
3902         Make CSSShadowValue::create() return a PassRef since it will never
3903         return null.
3904
3905         Reviewed by Sam Weinig.
3906
3907 2013-11-03  Andreas Kling  <akling@apple.com>
3908
3909         CSSLineBoxContainValue constructor should return PassRef.
3910         <https://webkit.org/b/123710>
3911
3912         Make CSSLineBoxContainValue::create() return a PassRef since it
3913         will never return null.
3914
3915         Reviewed by Sam Weinig.
3916
3917 2013-11-03  Antti Koivisto  <antti@apple.com>
3918
3919         LiveNodeLists should have non-null ContainerNode as root
3920         https://bugs.webkit.org/show_bug.cgi?id=123709
3921
3922         Reviewed by Andreas Kling.
3923
3924         After moving ChildNodeList off from LiveNodeList the root is now always at least a ContainerNode.
3925
3926         * dom/ContainerNode.cpp:
3927         (WebCore::ContainerNode::getElementsByTagName):
3928         (WebCore::ContainerNode::getElementsByTagNameNS):
3929         (WebCore::ContainerNode::getElementsByName):
3930         (WebCore::ContainerNode::getElementsByClassName):
3931         (WebCore::ContainerNode::radioNodeList):
3932         
3933             Also these move from Node to ContainerNode to make tighter typing work.
3934
3935 2013-11-03  Antti Koivisto  <antti@apple.com>
3936
3937         Switch createContextualFragment to element iterator
3938         https://bugs.webkit.org/show_bug.cgi?id=123704
3939
3940         Reviewed by Andreas Kling.
3941
3942         * editing/FrameSelection.cpp:
3943         (WebCore::scanForForm):
3944         
3945             Use type helpers instead of hasTagName
3946
3947         * editing/markup.cpp:
3948         (WebCore::collectElementsToRemoveFromFragment):
3949         (WebCore::removeElementFromFragmentPreservingChildren):
3950         (WebCore::createContextualFragment):
3951         * html/HTMLFormElement.cpp:
3952         (WebCore::HTMLFormElement::formElementIndex):
3953         
3954             Use type helpers instead of hasTagName
3955
3956         * html/HTMLTagNames.in:
3957         
3958             Generate type helpers for <html>.
3959
3960 2013-11-03  Antti Koivisto  <antti@apple.com>
3961
3962         ChildNodeList should not be LiveNodeList
3963         https://bugs.webkit.org/show_bug.cgi?id=123708
3964
3965         Reviewed by Sam Weinig.
3966
3967         ChildNodeList is a poor fit to be a LiveNodeList. It is heavily special-cased. It is also
3968         the only subtype that returns non-Elements thus preventing tightening.
3969
3970         * bindings/js/JSNodeListCustom.cpp:
3971         (WebCore::JSNodeListOwner::isReachableFromOpaqueRoots):
3972         
3973             Support new types.
3974
3975         * dom/ChildNodeList.cpp:
3976         (WebCore::EmptyNodeList::~EmptyNodeList):
3977         (WebCore::ChildNodeList::ChildNodeList):
3978         (WebCore::ChildNodeList::~ChildNodeList):
3979         (WebCore::ChildNodeList::length):
3980         (WebCore::childFromFirst):
3981         (WebCore::childFromLast):
3982         (WebCore::ChildNodeList::nodeBeforeCached):
3983         (WebCore::ChildNodeList::nodeAfterCached):
3984         (WebCore::ChildNodeList::item):
3985         (WebCore::ChildNodeList::namedItem):
3986         (WebCore::ChildNodeList::invalidateCache):
3987         
3988             Implement the same caching optimizations as LiveNodeList with tighter, less generic code.
3989
3990         * dom/ChildNodeList.h:
3991         
3992             Inherit ChildNodeList directly from NodeList.
3993
3994             Add new EmptyNodeList type. This is only ever used if NodeList is requested for a non-container node.
3995             It allows tighter typing in ChildNodeList.
3996
3997         * dom/LiveNodeList.cpp:
3998         (WebCore::LiveNodeList::namedItem):
3999         * dom/LiveNodeList.h:
4000         (WebCore::LiveNodeListBase::LiveNodeListBase):
4001         (WebCore::LiveNodeListBase::~LiveNodeListBase):
4002         (WebCore::LiveNodeList::LiveNodeList):
4003         
4004             Remove ChildNodeList specific code and branches.
4005
4006         * dom/Node.cpp:
4007         (WebCore::Node::childNodes):
4008         
4009             Return EmptyNodeList for non-containers.
4010
4011         * dom/NodeList.h:
4012         (WebCore::NodeList::~NodeList):
4013         (WebCore::NodeList::isLiveNodeList):
4014         (WebCore::NodeList::isChildNodeList):
4015         (WebCore::NodeList::isEmptyNodeList):
4016         
4017             For isReachableFromOpaqueRoots.
4018
4019         * dom/NodeRareData.h:
4020         (WebCore::NodeListsNodeData::ensureChildNodeList):
4021         (WebCore::NodeListsNodeData::removeChildNodeList):
4022         (WebCore::NodeListsNodeData::ensureEmptyChildNodeList):
4023         (WebCore::NodeListsNodeData::removeEmptyChildNodeList):
4024         (WebCore::NodeListsNodeData::NodeListsNodeData):
4025         (WebCore::NodeListsNodeData::deleteThisAndUpdateNodeRareDataIfAboutToRemoveLastList):
4026         
4027             EmptyNodeList support.
4028
4029         * html/CollectionType.h:
4030         * html/HTMLCollection.cpp:
4031         (WebCore::shouldOnlyIncludeDirectChildren):
4032         (WebCore::rootTypeFromCollectionType):
4033         (WebCore::invalidationTypeExcludingIdAndNameAttributes):
4034         (WebCore::isMatchingElement):
4035         (WebCore::LiveNodeListBase::itemBefore):
4036         (WebCore::LiveNodeListBase::traverseLiveNodeListFirstElement):
4037         (WebCore::LiveNodeListBase::traverseLiveNodeListForwardToOffset):
4038         (WebCore::LiveNodeListBase::item):
4039         (WebCore::LiveNodeListBase::itemBeforeOrAfterCachedItem):
4040         
4041             Remove ChildNodeList specific code and branches.
4042
4043 2013-11-03  Patrick Gansterer  <paroga@webkit.org>
4044
4045         [WINCE] Replace OwnPtr with GDIObject
4046         https://bugs.webkit.org/show_bug.cgi?id=123670
4047