2009-03-26 Darin Adler <darin@apple.com>
[WebKit-https.git] / WebCore / ChangeLog
1 2009-03-26  Darin Adler  <darin@apple.com>
2
3         Reviewed by Geoff Garen.
4
5         Split JSLazyEventListener out into its own separate source file.
6         We'll be removing JSAbstractEventListener and JSProtectedEventListener soon,
7         so leave those in the same file with JSEventListener.
8
9         * GNUmakefile.am: Added JSLazyEventListener.
10         * WebCore.pro: Ditto.
11         * WebCore.scons: Ditto.
12         * WebCore.vcproj/WebCore.vcproj: Ditto.
13         * WebCore.xcodeproj/project.pbxproj: Ditto.
14         * WebCoreSources.bkl: Ditto.
15
16         * bindings/js/JSEventListener.cpp: Removed the JSLazyEventListener part.
17         Removed unneeded includes. Removed incorrect ASSERT_CLASS_FITS_IN_CELL, since
18         JSAbstractEventListener is not derived from JSCell.
19
20         * bindings/js/JSEventListener.h: Removed the JSLazyEventListener part
21         and the now-unneeded include of PlatformString.h.
22
23         * bindings/js/JSLazyEventListener.cpp: Copied from bindings/js/JSEventListener.cpp.
24         Kept only the JSLazyEventListener part.
25         (WebCore::eventParameterName): Made this have internal linkage by adding "static".
26         Also moved the default case out of the switch statement so we will get a warning
27         if we omit any cases in the future.
28
29         * bindings/js/JSLazyEventListener.h: Copied from bindings/js/JSEventListener.h.
30         Kept only the JSLazyEventListener part.
31
32         * bindings/js/ScriptController.cpp: Removed unneeded includes and sorted the
33         remanining ones. Include JSLazyEventListener.h instead of JSEventListener.h.
34
35 2009-03-26  Darin Adler  <darin@apple.com>
36
37         Reviewed by Geoff Garen.
38
39         Renamed JSUnprotectedEventListener to JSEventListener.
40         And related renames.
41
42         Soon Geoff will make all JavaScript event listeners use mark instead
43         of protect, so there's no need to emphasize "unprotected".
44
45         * bindings/js/JSDOMApplicationCacheCustom.cpp:
46         (WebCore::JSDOMApplicationCache::mark):
47         (WebCore::JSDOMApplicationCache::addEventListener):
48         (WebCore::JSDOMApplicationCache::removeEventListener):
49         * bindings/js/JSDOMGlobalObject.cpp:
50         (WebCore::JSDOMGlobalObject::~JSDOMGlobalObject):
51         (WebCore::JSDOMGlobalObject::findJSEventListener):
52         (WebCore::JSDOMGlobalObject::findOrCreateJSEventListener):
53         (WebCore::JSDOMGlobalObject::jsEventListeners):
54         (WebCore::JSDOMGlobalObject::jsInlineEventListeners):
55         * bindings/js/JSDOMGlobalObject.h:
56         * bindings/js/JSDOMWindowBase.h:
57         * bindings/js/JSEventListener.cpp:
58         (WebCore::JSEventListener::JSEventListener):
59         (WebCore::JSEventListener::~JSEventListener):
60         (WebCore::JSEventListener::listenerObj):
61         (WebCore::JSEventListener::globalObject):
62         (WebCore::JSEventListener::clearGlobalObject):
63         (WebCore::JSEventListener::mark):
64         * bindings/js/JSEventListener.h:
65         (WebCore::JSEventListener::create):
66         * bindings/js/JSMessagePortCustom.cpp:
67         (WebCore::JSMessagePort::mark):
68         (WebCore::JSMessagePort::addEventListener):
69         (WebCore::JSMessagePort::removeEventListener):
70         * bindings/js/JSWorkerContextCustom.cpp:
71         (WebCore::JSWorkerContext::mark):
72         (WebCore::JSWorkerContext::addEventListener):
73         (WebCore::JSWorkerContext::removeEventListener):
74         * bindings/js/JSWorkerCustom.cpp:
75         (WebCore::JSWorker::mark):
76         (WebCore::JSWorker::addEventListener):
77         (WebCore::JSWorker::removeEventListener):
78         * bindings/js/JSXMLHttpRequestCustom.cpp:
79         (WebCore::JSXMLHttpRequest::mark):
80         (WebCore::JSXMLHttpRequest::addEventListener):
81         (WebCore::JSXMLHttpRequest::removeEventListener):
82         * bindings/js/JSXMLHttpRequestUploadCustom.cpp:
83         (WebCore::JSXMLHttpRequestUpload::mark):
84         (WebCore::JSXMLHttpRequestUpload::addEventListener):
85         (WebCore::JSXMLHttpRequestUpload::removeEventListener):
86         * bindings/scripts/CodeGeneratorJS.pm:
87         All just renaming.
88
89 2009-03-26  Darin Adler  <darin@apple.com>
90
91         Reviewed by Geoff Garen.
92
93         Renamed JSEventListener to JSProtectedEventListener.
94         And related renames.
95
96         Soon Geoff will make all JavaScript event listeners use mark instead
97         of protect, and so this class will be be obsolete. We will rename
98         JSUnrpotectedEventListener to JSEventListener in the next check-in,
99         since that one will remain.
100
101         * bindings/js/JSDOMGlobalObject.cpp:
102         (WebCore::JSDOMGlobalObject::~JSDOMGlobalObject):
103         (WebCore::JSDOMGlobalObject::findJSProtectedEventListener):
104         (WebCore::JSDOMGlobalObject::findOrCreateJSProtectedEventListener):
105         (WebCore::JSDOMGlobalObject::jsProtectedEventListeners):
106         (WebCore::JSDOMGlobalObject::jsProtectedInlineEventListeners):
107         * bindings/js/JSDOMGlobalObject.h:
108         * bindings/js/JSDOMWindowBase.h:
109         * bindings/js/JSDOMWindowCustom.cpp:
110         (WebCore::JSDOMWindow::addEventListener):
111         (WebCore::JSDOMWindow::removeEventListener):
112         * bindings/js/JSEventListener.cpp:
113         (WebCore::JSProtectedEventListener::JSProtectedEventListener):
114         (WebCore::JSProtectedEventListener::~JSProtectedEventListener):
115         (WebCore::JSProtectedEventListener::listenerObj):
116         (WebCore::JSProtectedEventListener::globalObject):
117         (WebCore::JSProtectedEventListener::clearGlobalObject):
118         (WebCore::JSLazyEventListener::JSLazyEventListener):
119         (WebCore::JSLazyEventListener::parseCode):
120         * bindings/js/JSEventListener.h:
121         (WebCore::JSProtectedEventListener::create):
122         * bindings/js/JSNodeCustom.cpp:
123         (WebCore::JSNode::addEventListener):
124         (WebCore::JSNode::removeEventListener):
125         * bindings/js/JSSVGElementInstanceCustom.cpp:
126         (WebCore::JSSVGElementInstance::addEventListener):
127         (WebCore::JSSVGElementInstance::removeEventListener):
128         * bindings/scripts/CodeGeneratorJS.pm:
129         All just renaming.
130
131 2009-03-26  Dan Bernstein  <mitz@apple.com>
132
133         Reviewed by Anders Carlsson.
134
135         - fix <rdar://problem/6725042> BidiResolver::createBidiRunsForLine can
136           create runs extending beyond the end
137
138         No test because Safari does not use this version of
139         createBidiRunsForLine() with the end iterator not pointing to the end
140         of the text run.
141
142         * platform/text/BidiResolver.h:
143         (WebCore::BidiResolver::appendRun): Cap the end of the run at the end
144         of the line and set the reachedEndOfLine flag. This mirrors the logic
145         in the specialized version of appendRun() in bidi.cpp, which is why the
146         problem did not show up in HTML. Also avoid creating empty runs.
147
148 2009-03-26  Simon Fraser  <simon.fraser@apple.com>
149
150         Reviewed by Dave Hyatt
151         
152         https://bugs.webkit.org/show_bug.cgi?id=23914
153
154         Tests: compositing/overflow/ancestor-overflow.html
155                compositing/overflow/parent-overflow.html
156
157         * rendering/RenderLayer.cpp:
158         (WebCore::RenderLayer::calculateClipRects):
159         * rendering/RenderLayer.h:
160         (WebCore::ClipRects::infiniteRect):
161         New static method that returns a large rect that is used by the clipping
162         logic.
163         
164         * rendering/RenderLayerBacking.cpp:
165         (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
166         Use parentClipRects(), rather than calculateRects(), to compute the overflow
167         rect that we'll use to create a masking layer for composited clipping.
168         
169         * rendering/RenderLayerCompositor.cpp:
170         (WebCore::RenderLayerCompositor::clippedByAncestor):
171         Use parentClipRects() to see whether there's a layer between us and our
172         compositing ancestor which applies clipping.
173         
174         (WebCore::RenderLayerCompositor::clipsCompositingDescendants):
175         A layer which imposes clipping to its children doesn't have to be a stacking
176         context; it might be a normal flow layer; in either case, we can rely on the
177         hasCompositingDescendant() bit.
178
179 2009-03-26  Steve Falkenburg  <sfalken@apple.com>
180
181         https://bugs.webkit.org/show_bug.cgi?id=24837
182         Escape key should dismiss select menu
183
184         Reviewed by Adam Roben.
185
186         * platform/win/PopupMenuWin.cpp:
187         (WebCore::PopupWndProc):
188
189 2009-03-26  Kevin Ollivier  <kevino@theolliviers.com>
190
191         Reviewed by Alexey Proskuryakov.
192
193         Make sure the script uses LF line endings even on Windows.
194         
195         https://bugs.webkit.org/show_bug.cgi?id=24805
196
197         * WebCore/make-generated-sources.sh: Change svn:eol-style to LF
198
199 2009-03-26  Eli Fidler  <eli.fidler@torchmobile.com>
200
201         Reviewed by George Staikos.
202
203         Remove warnings all over the place by making operator precedence
204         explicit in cases like x && y || z.  No functional change.
205
206         * css/CSSFontSelector.cpp:
207         (WebCore::CSSFontSelector::addFontFaceRule):
208         * css/CSSParser.cpp:
209         (WebCore::CSSParser::parseValue):
210         (WebCore::CSSParser::parseShadow):
211         * dom/Document.cpp:
212         (WebCore::Document::shouldScheduleLayout):
213         * dom/Node.cpp:
214         (WebCore::Node::isBlockFlowOrBlockTable):
215         * dom/Node.h:
216         (WebCore::Node::document):
217         * dom/Position.cpp:
218         (WebCore::Position::next):
219         (WebCore::Position::upstream):
220         (WebCore::Position::downstream):
221         (WebCore::Position::getInlineBoxAndOffset):
222         * dom/PositionIterator.cpp:
223         (WebCore::PositionIterator::atStart):
224         * dom/Range.cpp:
225         (WebCore::Range::intersectsNode):
226         * editing/Editor.cpp:
227         (WebCore::Editor::setBaseWritingDirection):
228         * editing/InsertParagraphSeparatorCommand.cpp:
229         (WebCore::InsertParagraphSeparatorCommand::doApply):
230         * editing/ReplaceSelectionCommand.cpp:
231         (WebCore::ReplaceSelectionCommand::doApply):
232         * editing/TextIterator.cpp:
233         (WebCore::TextIterator::advance):
234         (WebCore::SimplifiedBackwardsTextIterator::advance):
235         * editing/VisiblePosition.cpp:
236         (WebCore::VisiblePosition::leftVisuallyDistinctCandidate):
237         (WebCore::VisiblePosition::rightVisuallyDistinctCandidate):
238         (WebCore::VisiblePosition::canonicalPosition):
239         * editing/htmlediting.cpp:
240         (WebCore::isMailBlockquote):
241         (WebCore::lineBreakExistsAtPosition):
242         * html/HTMLSelectElement.cpp:
243         (WebCore::HTMLSelectElement::parseMappedAttribute):
244         * loader/FTPDirectoryDocument.cpp:
245         (WebCore::processFileDateString):
246         * loader/ImageLoader.cpp:
247         (WebCore::ImageLoader::updateFromElement):
248         * loader/TextResourceDecoder.cpp:
249         (WebCore::TextResourceDecoder::checkForHeadCharset):
250         * page/AccessibilityObject.cpp:
251         (WebCore::updateAXLineStartForVisiblePosition):
252         * page/EventHandler.cpp:
253         (WebCore::EventHandler::sendContextMenuEvent):
254         * page/animation/AnimationBase.cpp:
255         (WebCore::PropertyWrapperGetter::equals):
256         (WebCore::PropertyWrapperShadow::equals):
257         * platform/ContextMenu.cpp:
258         (WebCore::ContextMenu::populate):
259         * platform/ScrollView.cpp:
260         (WebCore::ScrollView::adjustScrollbarsAvoidingResizerCount):
261         * platform/text/Base64.cpp:
262         (WebCore::base64Encode):
263         * platform/text/BidiResolver.h:
264         (WebCore::::raiseExplicitEmbeddingLevel):
265         (WebCore::::createBidiRunsForLine):
266         * rendering/InlineTextBox.cpp:
267         (WebCore::InlineTextBox::placeEllipsisBox):
268         * rendering/RenderBlock.cpp:
269         (WebCore::RenderBlock::addChild):
270         (WebCore::RenderBlock::repaintOverhangingFloats):
271         (WebCore::RenderBlock::fillInlineSelectionGaps):
272         (WebCore::RenderBlock::positionForPoint):
273         (WebCore::RenderBlock::calcInlinePrefWidths):
274         (WebCore::RenderBlock::hasLineIfEmpty):
275         * rendering/RenderBox.cpp:
276         (WebCore::RenderBox::imageChanged):
277         (WebCore::RenderBox::localCaretRect):
278         (WebCore::RenderBox::positionForPoint):
279         (WebCore::RenderBox::shrinkToAvoidFloats):
280         * rendering/RenderObject.h:
281         (WebCore::objectIsRelayoutBoundary):
282         * rendering/RenderTableCell.cpp:
283         (WebCore::RenderTableCell::clippedOverflowRectForRepaint):
284         * rendering/RenderText.cpp:
285         (WebCore::RenderText::calcPrefWidths):
286         * rendering/bidi.cpp:
287         (WebCore::RenderBlock::determineStartPosition):
288         (WebCore::textWidth):
289         * rendering/style/RenderStyle.cpp:
290         (WebCore::RenderStyle::diff):
291         * rendering/style/StyleInheritedData.cpp:
292         (WebCore::cursorDataEquivalent):
293         * rendering/style/StyleRareInheritedData.cpp:
294         (WebCore::StyleRareInheritedData::shadowDataEquivalent):
295         * rendering/style/StyleRareNonInheritedData.cpp:
296         (WebCore::StyleRareNonInheritedData::shadowDataEquivalent):
297         (WebCore::StyleRareNonInheritedData::animationDataEquivalent):
298         (WebCore::StyleRareNonInheritedData::transitionDataEquivalent):
299
300 2009-03-26  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
301
302         Reviewed by Holger Freyther.
303
304         https://bugs.webkit.org/show_bug.cgi?id=24804
305         [GTK] 401 responses cause rogue content to be loaded
306
307         Our soup code handles 401 responses itself, so we should not feed
308         the headers and data of those responses to the loader.
309
310         * platform/network/soup/ResourceHandleSoup.cpp:
311         (WebCore::gotHeadersCallback):
312         (WebCore::gotChunkCallback):
313
314 2009-03-25  Geoffrey Garen  <ggaren@apple.com>
315
316         Reviewed by Oliver Hunt and Darin Adler.
317         
318         Fixed <rdar://problem/6603167> Crash in WebKit!JSC::JSGlobalObject::resetPrototype
319         during Stress test (#3 & #7 WER crashes for Safari 4 Beta)
320         
321         The problem was that allocation of the global object would, for just a
322         moment, leave the global object's prototype unprotected from GC. This
323         bug doesn't apply to non-global DOM objects because their prototypes are
324         cached and marked by the global object.
325
326         No test case because the crashing condition is hard to deterministically
327         produce in a normal build, and in a Windows Release build with
328         COLLECT_ON_EVERY_ALLOCATION set to 1, existing tests crash/hang.
329
330         * bindings/js/JSDOMWindowShell.cpp:
331         (WebCore::JSDOMWindowShell::setWindow):
332         * bindings/js/WorkerScriptController.cpp:
333         (WebCore::WorkerScriptController::initScript): Protect the global object's
334         prototype from GC during construction, since the global object does not
335         yet point to it, and therefore won't mark it.
336
337 2009-03-25  Dean Jackson  <dino@apple.com>
338
339         Reviewed by Simon Fraser
340
341         https://bugs.webkit.org/show_bug.cgi?id=23361
342
343         When using hardware compositing, some images can be directly
344         rendered by the hardware - no need to draw them into a separate
345         context, therefore saving memory.
346         Only images with certain style properties can be directly
347         composited - basically anything that is not a simple image requires
348         the usual rendering path (eg. if the image has borders).
349
350         Test: compositing/direct-image-compositing.html
351
352         * manual-tests/resources/simple_image.png: Added.
353         * manual-tests/simple-image-compositing.html: Added.
354         * platform/graphics/Image.h:
355         (WebCore::Image::startAnimation):
356             - move this to public
357         * rendering/RenderImage.cpp:
358         (WebCore::RenderImage::imageChanged):
359             - poke compositing layer if image has changed
360         (WebCore::RenderImage::notifyFinished):
361             - let the compositing layer know that it can render the image
362         * rendering/RenderImage.h:
363         * rendering/RenderLayer.cpp:
364         (WebCore::RenderLayer::rendererContentChanged):
365         * rendering/RenderLayer.h:
366         * rendering/RenderLayerBacking.cpp:
367         (WebCore::RenderLayerBacking::canUseInnerContentLayer):
368         (WebCore::RenderLayerBacking::detectDrawingOptimizations):
369         (WebCore::RenderLayerBacking::rendererContentChanged):
370         * rendering/RenderLayerBacking.h:
371             - code to hook up direct compositing of images where
372               possible
373
374 2009-03-25  David Levin  <levin@chromium.org>
375
376         Reviewed by Dimitri Glazkov.
377
378         Chromium build fix. Fix #include in V8NodeFilterCondition.cpp due to the
379         rename of V8NodeFilter to V8NodeFilterCondition.
380
381         * bindings/v8/V8NodeFilterCondition.cpp:
382
383 2009-03-25  Simon Fraser  <simon.fraser@apple.com>
384
385         Reviewed by Darin Adler
386         
387         https://bugs.webkit.org/show_bug.cgi?id=24817
388         
389         When the slider range is zero, avoid a divide by zero, which caused the
390         thumb to be positioned off in the weeds, which broke painting.
391
392         Test: media/video-empty-source.html
393
394         * rendering/RenderSlider.cpp:
395         (WebCore::SliderRange::proportionFromValue):
396         (WebCore::SliderRange::valueFromProportion):
397         (WebCore::sliderPosition):
398         (WebCore::RenderSlider::setValueForPosition):
399
400 2009-03-24  Eric Seidel  <eric@webkit.org>
401
402         Reviewed by Darin Adler.
403
404         Remove dead code and style cleanup
405         https://bugs.webkit.org/show_bug.cgi?id=24684
406
407         * html/CanvasStyle.cpp:
408         (WebCore::CanvasStyle::CanvasStyle):
409           Coverty was annoyed that we didn't initialize all of our members.  I agree, but I didn't
410           want to paste all 8 members each time, so I just cleaned up the existing constructors and left them.
411         * page/FocusController.cpp:
412         (WebCore::FocusController::setFocusedNode):
413           "node" was checked just above and is already known to be non-null
414         * rendering/RenderLayer.cpp:
415         (WebCore::RenderLayer::insertOnlyThisLayer):
416           We were already using parentLayer w/o a NULL check above, so just add an explicit ASSERT and use it w/o NULL check
417         (WebCore::RenderLayer::resize):
418           element is already ASSERTed above, no need to null check it here
419         * rendering/RenderTableSection.cpp:
420         (WebCore::RenderTableSection::addCell):
421           currentCell.cell was just assigned to the value "cell" which is known to be non-null, no need to null check again.
422
423 2009-03-24  Eric Seidel  <eric@webkit.org>
424
425         Reviewed by Darin Adler.
426
427         Move ASSERT(foo) to before where foo-> is used
428         https://bugs.webkit.org/show_bug.cgi?id=24684
429
430         * platform/chromium/PasteboardChromium.cpp:
431         (WebCore::Pasteboard::writeImage):
432           Move ASSERTs to the top of the function, code was using "node" before ASSERT(node), once I moved
433           ASSERT(node) to the top of the function it made sense to move the rest of them there too.
434         * rendering/SVGRenderSupport.cpp:
435         (WebCore::prepareToRenderSVGContent):
436           move ASSERT(object) to *before* we use "object" :)
437
438 2009-03-24  Eric Seidel  <eric@webkit.org>
439
440         Reviewed by Simon Fraser.
441
442         Make TextTokenizer ASSERT that the buffer was freed
443         https://bugs.webkit.org/show_bug.cgi?id=24684
444
445         * loader/TextDocument.cpp:
446         (WebCore::TextTokenizer::TextTokenizer):
447         (WebCore::TextTokenizer::~TextTokenizer):
448         (WebCore::TextTokenizer::finish):
449           Make it clear by adding a ~TextTokenizer that finish() will always be called and the memory never leaked.
450
451 2009-03-24  Eric Seidel  <eric@webkit.org>
452
453         Reviewed by Darin Adler.
454
455         Fix case where lBreak.obj->isBR() when lBreak.obj was NULL
456         https://bugs.webkit.org/show_bug.cgi?id=24684
457
458         I don't have a test case where we were taking the wrong path here
459         However, adding an ASSERT(lBreak.obj) before this usage caused
460         multiple bidi tests to fail, so lBreak.obj can be null here.
461
462         * rendering/bidi.cpp:
463         (WebCore::RenderBlock::findNextLineBreak):
464           lBreak.obj can be null, so we can't call ->isBR() on it unconditionally.
465
466 2009-03-24  Eric Seidel  <eric@webkit.org>
467
468         Reviewed by Simon Fraser.
469
470         Style cleanup and dead code removal in dom, editing
471         https://bugs.webkit.org/show_bug.cgi?id=24684
472
473         * dom/ContainerNode.cpp:
474         (WebCore::ContainerNode::getUpperLeftCorner):
475         (WebCore::ContainerNode::getLowerRightCorner):
476         (WebCore::ContainerNode::getRect):
477           Coverty was (rightly) confused as to what the hell "o" was being used for
478           and whether or not it would ever be NULL.  I added some ASSERTS so that people (and machines)
479           would be less confused about the logic in getUpperLeftCorner/getLowerRightCorner
480         * dom/Document.cpp:
481         (WebCore::Document::recalcStyle):
482           Remove dead code, this block already checked that change == Force
483         * editing/ApplyStyleCommand.cpp:
484         (WebCore::ApplyStyleCommand::removeInlineStyle):
485           Coverty correctly identified that traversePreviousNodePostOrder can return NULL, thus
486           prev will be null, and we don't really explicitly handle it (like we probably should)
487           It's OK though, because we end up creating a null position object, which may not have
488           been what we intended, but we certainly don't crash.
489         * editing/InsertParagraphSeparatorCommand.cpp:
490         (WebCore::InsertParagraphSeparatorCommand::doApply):
491           Remove dead code, insertionPosition.node() is already checked to be non-null above.
492         * editing/markup.cpp:
493         (WebCore::appendStartMarkup):
494           removed dead code, annotate is already known to be true at this point in the file
495           !annotate was checked above, and break; was called.
496
497 2009-03-24  Eric Seidel  <eric@webkit.org>
498
499         Reviewed by Simon Fraser.
500
501         CSS dead code removal and cleanup from Coverty errors
502         https://bugs.webkit.org/show_bug.cgi?id=24684
503
504         * css/CSSStyleSelector.cpp:
505         (WebCore::CSSStyleSelector::applyProperty):
506           Every other place in the code we check settings() for NULL, so I made these places
507           check too, even though we should never be resolving style against a document which has
508           no frame (which I believe is the only time settings() can be null)
509         * css/CSSStyleSheet.cpp:
510         (WebCore::CSSStyleSheet::styleSheetChanged):
511           Removing dead code, "root" can never be null here.
512         * css/SVGCSSStyleSelector.cpp:
513         (WebCore::colorFromSVGColorCSSValue):
514         (WebCore::CSSStyleSelector::applySVGProperty):
515           Extra returns in the old macros caused dead code.  Removing the old macros and use modern
516           ones instead. :)
517           Extra null checks to value were not needed.  Added an ASSERT at the top of the function
518           to make it clear that value will never be NULL.
519           Added colorFromSVGColorCSSValue to clean up the code a little.
520
521 2009-03-24  Eric Seidel  <eric@webkit.org>
522
523         Reviewed by Simon Fraser.
524
525         Font fallback cleanup and added ASSERT for GlyphPageTreeNode
526         https://bugs.webkit.org/show_bug.cgi?id=24684
527
528         * css/CSSFontSelector.cpp:
529         (WebCore::compareFontFaces):
530           Coverty was concerned that it was possible to index off the end of weightFallbackRuleSets
531           I can't read the code well enough to tell, so I tried to make the code clearer
532           and added an ASSERT.        
533         * platform/graphics/GlyphPageTreeNode.cpp:
534         (WebCore::GlyphPageTreeNode::initializePage):
535           Coverty believes we can crash here due to j being larger than GlyphPage::size.  I think to is already
536           known to be < GlyphPage::size due to the min() statement above, but not being sure I added an ASSERT.
537
538 2009-03-24  Eric Seidel  <eric@webkit.org>
539
540         Reviewed by Simon Fraser.
541
542         Coverty inspired fixes in Animations/Transforms
543         https://bugs.webkit.org/show_bug.cgi?id=24684
544
545         * page/animation/AnimationBase.h:
546           Fix animate() signatures to match so that the virtual methods actually override one another. :)
547         * page/animation/AnimationController.cpp:
548         (WebCore::AnimationControllerPrivate::removeFromStartTimeResponseWaitList):
549           Attempt to fix this method, prevAnimation was never set to anything but NULL,
550           as far as I can tell the author originally intended to update it at the end
551           of the loop, which is what I changed this code to do.
552         * page/animation/ImplicitAnimation.cpp:
553         (WebCore::ImplicitAnimation::animate):
554           Make method signature match AnimationBase::animate
555         * page/animation/ImplicitAnimation.h:
556         * page/animation/KeyframeAnimation.cpp:
557         (WebCore::KeyframeAnimation::animate):
558           Make method signature match AnimationBase::animate
559         * page/animation/KeyframeAnimation.h:
560         * platform/graphics/transforms/PerspectiveTransformOperation.cpp:
561         (WebCore::PerspectiveTransformOperation::blend):
562           if (blendToIdentity) already returned above.
563         * platform/graphics/transforms/RotateTransformOperation.cpp:
564         (WebCore::RotateTransformOperation::blend):
565           if (blendToIdentity) already returned above.
566
567 2009-03-25  Eli Fidler  <eli.fidler@torchmobile.com>
568
569         Reviewed by George Staikos.
570
571         Fix compiler warnings regarding assignments in if statements.
572
573         * html/HTMLFormElement.cpp:
574         (WebCore::HTMLFormElement::createFormData):
575         * plugins/PluginPackage.cpp:
576         (WebCore::PluginPackage::compare):
577
578 2009-03-25  Dan Bernstein  <mitz@apple.com>
579
580         Reviewed by Dave Hyatt.
581
582         - fix <rdar://problem/6472150> repro crash in
583           RenderBlock::rightmostPosition(bool, bool) const at mercotte.fr using
584           menus
585
586         Test: fast/inline/continuation-positioned-reparenting.html
587
588         * rendering/RenderInline.cpp:
589         (WebCore::RenderInline::splitFlow): When repurposing the existing
590         container as the "pre" block, clear its positioned objects list, because
591         positioned descendants may end up in a different block after the split.
592
593 2009-03-24  Simon Fraser  <simon.fraser@apple.com>
594
595         Reviewed by Dave Hyatt
596         
597         https://bugs.webkit.org/show_bug.cgi?id=24784
598         
599         Length values in transform operations need to take zoom into account.
600
601         Test: fast/transforms/transforms-with-zoom.html
602
603         * css/CSSStyleSelector.cpp:
604         (WebCore::CSSStyleSelector::createTransformOperations):
605
606 2009-03-25  David Hyatt  <hyatt@apple.com>
607
608         Reviewed by Simon Fraser.
609
610         https://bugs.webkit.org/show_bug.cgi?id=24809, background-clip/origin don't use the correct
611         values.  Add support for the new values (while preserving the old values for backwards
612         compatibility).
613
614         Changed some existing test cases to use the new values.
615
616         * css/CSSParser.cpp:
617         (WebCore::CSSParser::parseFillProperty):
618         * css/CSSPrimitiveValueMappings.h:
619         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
620         (WebCore::CSSPrimitiveValue::operator EFillBox):
621         * css/CSSValueKeywords.in:
622
623 2009-03-25  Brett Wilson  <brettw@dhcp-172-22-71-191.mtv.corp.google.com>
624
625         Reviewed by Dimitri Glazkov.
626
627         Fix complex text opacity on the Chromium Windows port.
628         https://bugs.webkit.org/show_bug.cgi?id=24757
629
630         Test: fast/text/complex-text-opacity.html
631
632         * platform/graphics/chromium/FontChromiumWin.cpp:
633         (WebCore::):
634         (WebCore::TransparencyAwareFontPainter::TransparencyAwareFontPainter::TransparencyAwareFontPainter):
635         (WebCore::TransparencyAwareFontPainter::TransparencyAwareFontPainter::init):
636         (WebCore::TransparencyAwareFontPainter::TransparencyAwareFontPainter::initializeForGDI):
637         (WebCore::TransparencyAwareFontPainter::TransparencyAwareFontPainter::~TransparencyAwareFontPainter):
638         (WebCore::TransparencyAwareFontPainter::TransparencyAwareGlyphPainter::TransparencyAwareGlyphPainter):
639         (WebCore::TransparencyAwareFontPainter::TransparencyAwareGlyphPainter::~TransparencyAwareGlyphPainter):
640         (WebCore::TransparencyAwareFontPainter::TransparencyAwareGlyphPainter::estimateTextBounds):
641         (WebCore::TransparencyAwareFontPainter::TransparencyAwareGlyphPainter::drawGlyphs):
642         (WebCore::TransparencyAwareFontPainter::TransparencyAwareUniscribePainter::hdc):
643         (WebCore::TransparencyAwareFontPainter::TransparencyAwareUniscribePainter::TransparencyAwareUniscribePainter):
644         (WebCore::TransparencyAwareFontPainter::TransparencyAwareUniscribePainter::~TransparencyAwareUniscribePainter):
645         (WebCore::TransparencyAwareFontPainter::TransparencyAwareUniscribePainter::estimateTextBounds):
646         (WebCore::Font::drawGlyphs):
647         (WebCore::Font::drawComplexText):
648
649 2009-03-25  David Hyatt  <hyatt@apple.com>
650
651         Reviewed by Eric Seidel
652
653         Fix for bug 23198, border images should not clip to border radii.  The border-image should just ignore
654         the border-radius, since the assumption is that any desired rounding will be built into the border-image
655         itself.
656
657         Note that I do not agree with this change, but I am matching the spec.
658
659         Added fast/borders/border-image-border-radius.html
660
661         * rendering/RenderBoxModelObject.cpp:
662         (WebCore::RenderBoxModelObject::paintNinePieceImage):
663
664 2009-03-25  Gustavo Noronha Silva  <gns@gnome.org>
665
666         Reviewed by Holger Freyther.
667
668         https://bugs.webkit.org/show_bug.cgi?id=24750
669         [GTK] requests download instead of displaying page
670
671         Fix the Content-Type headers we get from soup, so that we set a
672         proper media type on the ResourceResponse.
673
674         * platform/network/soup/ResourceHandleSoup.cpp:
675         (WebCore::fillResponseFromMessage):
676
677 2009-03-25  Gustavo Noronha Silva  <gns@gnome.org>
678
679         Reviewed by Holger Freyther.
680
681         https://bugs.webkit.org/show_bug.cgi?id=24600
682         [GTK] responses with status code >= 400 should not be given special treatment
683
684         Do not special case requests that have HTTP responses >=
685         400. Redirects are handled automatically by libsoup, but the rest
686         of the responses should be treated like any other.
687
688         * platform/network/soup/ResourceHandleSoup.cpp:
689         (WebCore::):
690         (WebCore::gotHeadersCallback):
691         (WebCore::gotChunkCallback):
692         (WebCore::finishedCallback):
693
694 2009-03-25  Darin Adler  <darin@apple.com>
695
696         Reviewed by John Sullivan.
697
698         Tidy up LegacyWebArchive a bit. And don't include favicons in web archives when
699         they are being used only for selections, not an entire document.
700
701         * WebCore.base.exp: Remove exported function that's not used in WebKit.
702
703         * loader/archive/cf/LegacyWebArchive.cpp:
704         (WebCore::LegacyWebArchive::createPropertyListRepresentation): Made a static member
705         function so it can share private things with other member functions. Added some FIXME
706         comments to a branch of code I think is dead. Changed boolean argument into a named
707         one. Renamed to match other similar functions.
708         (WebCore::LegacyWebArchive::createResourceResponseFromPropertyListData): Ditto.
709         (WebCore::LegacyWebArchive::createResource): Ditto.
710         (WebCore::LegacyWebArchive::create): Merged the create and init functions.
711         (WebCore::LegacyWebArchive::rawDataRepresentation): Added some assertions because
712         we should never fail to write (we can fail to read).
713         (WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Made a static
714         member function as above.
715         (WebCore::LegacyWebArchive::createFromSelection): Ditto.
716         (WebCore::LegacyWebArchive::create): Iterate the vector with indices rather than
717         iterators. Only include the favicon if the first node is the document since we don't
718         want to include the favicon when copying and pasting.
719
720         * loader/archive/cf/LegacyWebArchive.h: Made one of the create functions private.
721         Made the Mac-specific functions be static member functions. Made other helpers be
722         static member functions. Removed the nit function.
723
724         * loader/archive/cf/LegacyWebArchiveMac.mm:
725         (WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Updated
726         comment and made this a static member function.
727         (WebCore::LegacyWebArchive::createPropertyListRepresentation): Ditto. Also made
728         it so we only type cast in one place.
729
730 2009-03-25  Darin Adler  <darin@apple.com>
731
732         Reviewed by David Hyatt.
733
734         Bug 24740: crash in RenderSlider::setPositionFromValue when calling pause() after setting <video> to display: none
735         https://bugs.webkit.org/show_bug.cgi?id=24740
736         rdar://problem/6679873
737
738         Bug 12104: Native Slider: When the thumb's height is specified as a percentage, it is not centered properly
739         https://bugs.webkit.org/show_bug.cgi?id=12104
740
741         Test: media/video-display-none-crash.html
742
743         The problem here was that RenderSlider was trying to position its thumb in a way that
744         requires it to call updateLayout inside rendering code. The right way to position a
745         child renderer is to do layout, so I had to write a layout function. And then fix a few
746         other small problems shown by the same test case.
747
748         * rendering/RenderSlider.cpp: Made defaultTrackLength have internal linkage.
749         Renamed HTMLSliderThumbElement to SliderThumbElement because we only use the HTML
750         prefix for public DOM classes, not elements used as implementation details.
751         Made SliderThumbElement function members private and got rid of unneeded default
752         argument value for shadowParent.
753         (WebCore::SliderRange::SliderRange): Added. Parses precision, max, and min attributes.
754         (WebCore::SliderRange::clampValue): Added. Does standard clamping based on the above.
755         (WebCore::SliderRange::valueFromElement): Added. Reads the value from the element in
756         a way that clamps to the range.
757         (WebCore::sliderPosition): Added. Computes the slider position: a double.
758         (WebCore::SliderThumbElement::SliderThumbElement): Removed unneeded explicit
759         initialization of m_initialClickPoint.
760         (WebCore::SliderThumbElement::defaultEventHandler): Call setValueForPosition instead
761         of calling setCurrentPosition and valueChanged.
762         (WebCore::RenderSlider::RenderSlider): Remove unneeded explicit initialization of m_thumb.
763         (WebCore::RenderSlider::styleDidChange): Remove unneeded second argument to createThumbStyle.
764         (WebCore::RenderSlider::createThumbStyle): Remove unneeded second argument. Get rid of code
765         setting the position to relative and setting the left and top. We now handle positioning
766         in a custom layout function.
767         (WebCore::RenderSlider::layout): Rewrote to handle positioning of the thumb as layout.
768         (WebCore::RenderSlider::updateFromElement): Added code to immediately update the value
769         in the element if it's out of range. This clamping used to be done as a side effect of
770         setPositionFromValue. Also, this has nothing to do with the renderer, so at some point
771         it could be moved into HTMLInputElement. Removed call to setPositionFromValue
772         and instead just rely on the call to setNeedsLayout. Fix the setNeedsLayout call to be
773         a normal setNeedsLayout(true), not a setNeedsLayout(true, false), because we do want
774         this to be propagated to the parent -- it's not called during layout.
775         (WebCore::RenderSlider::setValueForPosition): Refactor to use the new SliderRange
776         class. Also don't call setCurrentPosition; instead just call setNeedsLayout.
777         (WebCore::RenderSlider::currentPosition): Use the actual position of the renderer rather
778         than the style to find the position; that means this needs to be done after layout is done.
779         Also removed unneeded runtime checks and replaced them with assertions, after checking
780         all callers to see they already guarantee this.
781         (WebCore::RenderSlider::trackSize): Removed unneeded runtime checks and replaced them
782         with assertions, after checking all callers to see they already guarantee this.
783         (WebCore::RenderSlider::inDragMode): Added a null check for m_thumb so this won't
784         crash if called early on a brand new RenderSlider.
785
786         * rendering/RenderSlider.h: Made all functions private except for forwardEvent and inDragMode.
787         Renamed HTMLSliderThumbElement to SliderThumbElement because we only use the HTML
788         prefix for public DOM classes, not elements used as implementation details. Made the
789         mouseEventIsInThumb function non-virtual. Removed the return value and argument from
790         setPositionFromValue. Removed valueChanged and setCurrentPosition. Removed the oldStyle
791         argument to createThumbStyle (see above). Made SliderThumbElement a friend so it can use some
792         private member functions.
793
794 2009-03-25  Eli Fidler  <eli.fidler@torchmobile.com>
795
796         Reviewed by George Staikos.
797
798         Fix ambiguous else cases by adding braces to nested if()s with elses.
799
800         * loader/MainResourceLoader.cpp:
801         (WebCore::MainResourceLoader::continueAfterContentPolicy):
802         * page/EventHandler.cpp:
803         (WebCore::EventHandler::updateDragAndDrop):
804         * rendering/RenderListMarker.cpp:
805         (WebCore::toArmenianUnder10000):
806         * rendering/TextControlInnerElements.cpp:
807         (WebCore::TextControlInnerTextElement::defaultEventHandler):
808
809 2009-03-24  Eli Fidler  <eli.fidler@torchmobile.com>
810
811         Reviewed by George Staikos.
812
813         Move variable into proper platform block to quiet warning.
814
815         * html/CanvasRenderingContext2D.cpp:
816         (WebCore::CanvasRenderingContext2D::drawTextInternal):
817
818 2009-03-24  Eric Carlson  <eric.carlson@apple.com>
819
820         Reviewed by Antti Koivisto.
821
822         Fix for <rdar://problem/6719375> Deal with QTKit loadstate changes when playing streaming movies
823
824         *  WebCore/html/HTMLMediaElement.cpp:
825         (WebCore::HTMLMediaElement::setNetworkState): Deal with media engine reviving after having
826         network state of NETWORK_NO_SOURCE.
827
828         *  WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
829         (WebCore::MediaPlayerPrivate::updateStates): Reset m_readyState at each state change since
830         some types of movies currently cause QTKit's load state to bounce around. QTMovieLoadStatePlaythroughOK
831         corresponds to HaveFutureData, not HaveEnoughData.
832
833 2009-03-24  Adele Peterson  <adele@apple.com>
834
835         Reviewed by Darin Adler.
836
837         Fix for https://bugs.webkit.org/show_bug.cgi?id=24707
838         <rdar://problem/6593021> Deleting with a caret in a blank, quoted line decreases the quoting, but does not delete the line
839
840         * editing/TypingCommand.cpp: (WebCore::TypingCommand::deleteKeyPressed):
841         After breaking out of an empty mail blockquote, we still want continue with the deletion
842         so actual content will get deleted, and not just the quote style.
843
844 2009-03-24  Darin Adler  <darin@apple.com>
845
846         Reviewed by Brady Eidson.
847
848         <rdar://problem/6624662> REGRESSION (r39904): can't save certain web pages as web archive (ones without favicons!)
849
850         * loader/archive/cf/LegacyWebArchive.cpp:
851         (WebCore::LegacyWebArchive::create): Added a null check.
852
853 2009-03-24  Adam Langley  <agl@google.com>
854
855         Reviewed by Darin Fisher.
856
857         https://bugs.webkit.org/show_bug.cgi?id=24685
858
859         The Skia drawLine function takes subpixel values and attempts to draw
860         a line with subpixel precision. This is complex and slow for drawing
861         scrollbars which use only vertical and horizontal lines.
862
863         This changes the Chromium Linux scrollbar code to use drawIRect.
864
865         * platform/chromium/ScrollbarThemeChromiumLinux.cpp:
866         (WebCore::ScrollbarThemeChromium::invalidateOnMouseEnterExit):
867         (WebCore::drawVertLine):
868         (WebCore::drawHorizLine):
869         (WebCore::drawBox):
870         (WebCore::ScrollbarThemeChromium::paintTrackPiece):
871         (WebCore::ScrollbarThemeChromium::paintThumb):
872
873 2009-03-24  David Kilzer  <ddkilzer@apple.com>
874
875         Bug 23310: Setting an absolute path (/abs) on an <iframe> with no src doesn't resolve the URL properly
876
877         <https://bugs.webkit.org/show_bug.cgi?id=23310>
878
879         Reviewed by Darin Adler.
880
881         Test: fast/frames/iframe-no-src-set-location.html
882
883         * dom/Document.cpp:
884         (WebCore::Document::completeURL): If m_baseURL is empty or is
885         about:blank and we have a parent document, use the parent
886         document's URL for the base when completing a new URL.
887
888 2009-03-24  Simon Fraser  <simon.fraser@apple.com>
889
890         Reviewed by Dave Hyatt
891         
892         https://bugs.webkit.org/show_bug.cgi?id=24659
893         
894         When hit-testing 3d-transformed layers, it doesn't make sense to project the hitTestRect
895         into the coordinate space of the layer, and doing so can result in pathalogical quads
896         that break hit testing. In that case, simply use the same bounds as used for painting,
897         which are the composited bounds for this layer.
898
899         Test: transforms/3d/hit-testing/rotated-hit-test.html
900
901         * rendering/RenderLayer.cpp:
902         (WebCore::RenderLayer::hitTestLayer):
903
904 2009-03-24  Simon Fraser  <simon.fraser@apple.com>
905
906         Reviewed by Dave Hyatt
907
908         https://bugs.webkit.org/show_bug.cgi?id=24436
909         
910         When compositing is enabled, painting and hit testing end up using different
911         clipping roots, because, for painting, every composited layer is a clipping root,
912         but for hit testing only layers with transforms are. To fix this, we use
913         temporary clip rects for hit testing, if the page is in compositing mode.
914
915         * rendering/RenderLayer.cpp:
916         (WebCore::RenderLayer::paintLayer):
917         (WebCore::RenderLayer::hitTestLayer):
918         (WebCore::RenderLayer::parentClipRects):
919         (WebCore::RenderLayer::calculateRects):
920         * rendering/RenderLayer.h:
921
922 2009-03-24  Simon Fraser  <simon.fraser@apple.com>
923
924         Reviewed by Dan Bernstein
925         
926         https://bugs.webkit.org/show_bug.cgi?id=24782
927
928         Fix regression with CSS clip rects with non-length values, by reverting to
929         the original code, but passing the zoom multiplier through convertToLength().
930         
931         Also make stylistic change in createTransformOperations(), renaming 'inStyle'
932         to 'style.
933         
934         Tested by existing tests.
935
936         * css/CSSStyleSelector.cpp:
937         (WebCore::convertToLength):
938         (WebCore::CSSStyleSelector::applyProperty):
939         (WebCore::CSSStyleSelector::createTransformOperations):
940
941 2009-03-24  David Hyatt  <hyatt@apple.com>
942
943         Reviewed by Simon Fraser
944
945         https://bugs.webkit.org/show_bug.cgi?id=21789, overflow:hidden elements should clip their foreground contents
946         to a border-radius.
947
948         This patch makes non-self-painting overflow layers and control clips work with border-radius.  RenderLayers
949         that should be clipped by overflow ancestors with border-radius are still broken.
950
951         Added fast/clip/overflow-border-radius-clip.html
952
953         * rendering/RenderBox.cpp:
954         (WebCore::RenderBox::pushContentsClip):
955
956 2009-03-24  David Hyatt  <hyatt@apple.com>
957
958         Reviewed by Simon Fraser
959
960         https://bugs.webkit.org/show_bug.cgi?id=21789, overflow:hidden elements should clip their foreground contents.
961         
962         This first patch makes overflow:hidden properly clip the foreground contents of overflow:hidden replaced elements.  Common
963         replaced elements now default to overflow:hidden in the UA stylesheet (this is what the spec specifically recommends be
964         done).
965     
966         Added fast/replaced/border-radius-clip.html
967
968         * css/html4.css:
969         * rendering/RenderReplaced.cpp:
970         (WebCore::RenderReplaced::paint):
971         * rendering/RenderWidget.cpp:
972         (WebCore::RenderWidget::paint):
973
974 2009-03-24  Adele Peterson  <adele@apple.com>
975
976         RS by Mark Rowe.
977
978         Only build these Mail quirks checks in on the Mac.
979
980         * dom/Document.cpp: (WebCore::disableRangeMutation):
981         * html/HTMLElement.cpp: (WebCore::HTMLElement::inEitherTagList):
982
983 2009-03-24  Brent Fulgham  <bfulgham@webkit.org>
984
985         Build fix, no review.
986
987         Remove ResourceLoaderCFNet.cpp from build list for Cairo Releas
988         and Debug targets.
989
990         * WebCore.vcproj/WebCore.vcproj:
991
992 2009-03-24  Eric Carlson  <eric.carlson@apple.com>
993
994         Fix layout tests broken by r41907.
995
996         * html/HTMLMediaElement.cpp:
997         (WebCore::HTMLMediaElement::setReadyState): Don't set "was playing" based on the new ready state
998
999 2009-03-24  Dmitry Titov  <dimich@chromium.org>
1000
1001         Reviewed by Dimitri Glazkov.
1002
1003         https://bugs.webkit.org/show_bug.cgi?id=24689
1004         Fix Chromium compilation errors.
1005
1006         * bindings/v8/WorkerContextExecutionProxy.cpp:
1007         (WebCore::WorkerContextExecutionProxy::FindOrCreateEventListener):
1008         (WebCore::WorkerContextExecutionProxy::RemoveEventListener):
1009
1010 2009-03-24  Yury Semikhatsky  <yurys@chromium.org>
1011
1012         Reviewed by Darin Adler.
1013
1014         https://bugs.webkit.org/show_bug.cgi?id=24759
1015         Add missing methods Element.prototype.removeMatchingStyleClasses and
1016         Node.prototype.enclosingNodeOrSelfWithNodeNameInArray to SourceFrame content
1017         iframe. These methods are called by Element.prototype.removeStyleClass and
1018         Node.prototype.enclosingNodeOrSelfWithNodeName.
1019
1020         * inspector/front-end/SourceFrame.js:
1021         (WebInspector.SourceFrame.prototype._loaded):
1022
1023 2009-03-24  Mark Mentovai  <mark@chromium.org>
1024
1025         Reviewed by Mark Rowe.
1026
1027         https://bugs.webkit.org/show_bug.cgi?id=24653
1028         WebKit should be buildable without prefix header injection.
1029         Adds missing #includes and forward declarations as needed.
1030
1031         * editing/SmartReplaceCF.cpp:
1032         * platform/graphics/mac/ColorMac.mm:
1033         * platform/graphics/mac/FontCacheMac.mm:
1034         * platform/graphics/mac/FontCustomPlatformData.h:
1035         * platform/graphics/mac/FontMac.mm:
1036         * platform/graphics/mac/FontMacATSUI.mm:
1037         * platform/graphics/mac/FontPlatformData.h:
1038         * platform/graphics/mac/FontPlatformDataMac.mm:
1039         * platform/graphics/mac/GraphicsContextMac.mm:
1040         * platform/graphics/mac/SimpleFontDataMac.mm:
1041         * platform/mac/FoundationExtras.h:
1042         * platform/mac/LocalCurrentGraphicsContext.h:
1043         * platform/mac/WebCoreSystemInterface.h:
1044         * platform/mac/WebCoreSystemInterface.mm:
1045         * platform/mac/WebCoreTextRenderer.h:
1046         * platform/mac/WebCoreTextRenderer.mm:
1047         * platform/mac/WebFontCache.h:
1048         * platform/mac/WebFontCache.mm:
1049         * platform/text/PlatformString.h:
1050         * platform/text/mac/ShapeArabic.c:
1051         * platform/text/mac/StringMac.mm:
1052         * rendering/RenderThemeChromiumMac.h:
1053
1054 2009-03-24  Dan Bernstein  <mitz@apple.com>
1055
1056         Reviewed by Darin Adler.
1057
1058         - fix <rdar://problem/6107874> by capping the nesting depth of
1059           "block-level" elements generated by the parser
1060
1061         Test: fast/parser/block-nesting-cap.html
1062
1063         * html/HTMLParser.cpp:
1064         (WebCore::HTMLParser::HTMLParser):
1065         (WebCore::HTMLParser::insertNode):
1066         (WebCore::HTMLParser::pushBlock):
1067         (WebCore::HTMLParser::popOneBlockCommon):
1068         (WebCore::HTMLParser::freeBlock):
1069         * html/HTMLParser.h:
1070
1071 2009-03-23  Greg Bolsinga  <bolsinga@apple.com>
1072
1073         Reviewed by David Kilzer.
1074
1075         https://bugs.webkit.org/show_bug.cgi?id=24771
1076         
1077         DOMTimeStamps are based upon 1970.
1078
1079         * platform/mac/GeolocationServiceMac.mm:
1080         (-[WebCoreCoreLocationObserver locationManager:didUpdateToLocation:fromLocation:]):
1081
1082 2009-03-23  Eric Seidel  <eric@webkit.org>
1083
1084         Build fix, no review.
1085
1086         * rendering/RenderObject.cpp:
1087         (WebCore::RenderObject::createVisiblePosition): change .container to .isNotNull()
1088
1089 2009-03-23  Eric Seidel  <eric@webkit.org>
1090
1091         Reviewed by Darin Adler.
1092
1093         Rename Position::container to m_anchorNode and make it private
1094         https://bugs.webkit.org/show_bug.cgi?id=24760
1095
1096         More code cleanup for Position.
1097
1098         Change all uses of m_container to node()
1099         Eventually most uses of node() should change to anchorNode() to designate
1100         that it's the node the Position is anchored to, but not necessarily the
1101         container of the position (it could be the before/after neighbor).
1102
1103         Remove any code which sets m_container, and change it to use a new
1104         Position::moveToPosition function which takes a node and offset.
1105         It never makes sense to change the node and leave the offset.
1106
1107         * dom/Position.h:
1108         (WebCore::Position::Position):
1109         (WebCore::Position::clear):
1110         (WebCore::Position::anchorNode):
1111         (WebCore::Position::node):
1112         (WebCore::Position::moveToPosition):
1113         (WebCore::Position::moveToOffset):
1114         (WebCore::Position::isNull):
1115         (WebCore::Position::isNotNull):
1116         (WebCore::operator==):
1117         * dom/Range.cpp:
1118         (WebCore::Range::create):
1119         (WebCore::Range::compareBoundaryPoints):
1120         * dom/RangeBoundaryPoint.h:
1121         (WebCore::RangeBoundaryPoint::container):
1122         (WebCore::RangeBoundaryPoint::set):
1123         (WebCore::RangeBoundaryPoint::setOffset):
1124         (WebCore::RangeBoundaryPoint::setToChild):
1125         (WebCore::RangeBoundaryPoint::setToStart):
1126         (WebCore::RangeBoundaryPoint::setToEnd):
1127
1128 2009-03-17  Eric Seidel  <eric@webkit.org>
1129
1130         Reviewed by David Hyatt.
1131
1132         document.write() should be able to make a document strict mode
1133         https://bugs.webkit.org/show_bug.cgi?id=24336
1134
1135         Remove an implicit write of "<html>" on the first document.write call
1136         this was added as part of a KDE import http://trac.webkit.org/changeset/798
1137         with no layout test or explanation.  I can't think of any reason why
1138         an implicit <html> write is necessary (or correct), so I'm removing it and
1139         adding a test for the correct behavior.  The parser will add any necessary
1140         HTMLHTMLElements during the write() anyway.
1141
1142         Our behavior is now tested by fast/dom/Document/document-write-doctype
1143         and matches IE, FF fails this new test.  Mozilla bug filed:
1144         https://bugzilla.mozilla.org/show_bug.cgi?id=483908
1145
1146         * dom/Document.cpp:
1147         (WebCore::Document::write):
1148
1149 2009-03-23  Sam Weinig  <sam@webkit.org>
1150
1151         Reviewed by Dan Bernstein.
1152
1153         Fix for <rdar://problem/6140966>
1154         Empty Caches does not clear the Cross-site XMLHttpRequest preflight cache
1155
1156         * WebCore.base.exp:
1157         * WebCore.xcodeproj/project.pbxproj:
1158         * loader/CrossOriginPreflightResultCache.cpp:
1159         (WebCore::CrossOriginPreflightResultCache::empty):
1160         * loader/CrossOriginPreflightResultCache.h:
1161
1162 2009-03-23  Darin Adler  <darin@apple.com>
1163
1164         Reviewed by Adele Peterson.
1165
1166         Bug 24726: hit testing doesn't work right when the click is on anonymous content
1167         https://bugs.webkit.org/show_bug.cgi?id=24726
1168         rdar://problem/6696992
1169
1170         Test: editing/selection/hit-test-anonymous.html
1171
1172         * rendering/RenderBR.cpp:
1173         (WebCore::RenderBR::positionForPoint): Call createVisiblePosition instead of
1174         creating a VisiblePosition directly. It will handle finding non-anonymous
1175         content nearby if node() is 0.
1176         * rendering/RenderBlock.cpp:
1177         (WebCore::positionForPointRespectingEditingBoundaries): Ditto.
1178         (WebCore::positionForPointWithInlineChildren): Ditto.
1179         (WebCore::RenderBlock::positionForPoint): Ditto.
1180         * rendering/RenderBox.cpp:
1181         (WebCore::RenderBox::positionForPoint): Ditto.
1182         * rendering/RenderObject.cpp:
1183         (WebCore::RenderObject::positionForPoint): Ditto.
1184         (WebCore::RenderObject::createVisiblePosition): Added.
1185         * rendering/RenderObject.h: Added createVisiblePosition.
1186         * rendering/RenderReplaced.cpp:
1187         (WebCore::RenderReplaced::positionForPoint): Call createVisiblePosition.
1188         * rendering/RenderSVGInlineText.cpp:
1189         (WebCore::RenderSVGInlineText::positionForPoint): Ditto.
1190         * rendering/RenderText.cpp:
1191         (WebCore::RenderText::positionForPoint): Ditto.
1192
1193 2009-03-23  Adele Peterson  <adele@apple.com>
1194
1195         Reviewed by Darin Adler & Dave Hyatt.
1196
1197         Fix for <rdar://problem/6621310> REGRESSION(35185): Apple Travel HTML emails missing some style after Safari 4 upgrade
1198
1199         Leopard Mail doesn't expect <style> to be in the body.  This change reverts back to the old behavior of
1200         moving <style> to <head> for that version of Mail.
1201
1202         * html/HTMLElement.cpp: (WebCore::HTMLElement::inEitherTagList):
1203
1204 2009-03-23  Adele Peterson  <adele@apple.com>
1205
1206         Reviewed by Mark Rowe & Dave Hyatt.
1207
1208         Merge some of the individual Mail quirks into two settings that we can check for future quirks.
1209
1210         * WebCore.base.exp:
1211         * dom/Document.cpp:
1212         (WebCore::disableRangeMutation):
1213         (WebCore::Document::nodeChildrenChanged):
1214         (WebCore::Document::nodeWillBeRemoved):
1215         (WebCore::Document::textInserted):
1216         (WebCore::Document::textRemoved):
1217         (WebCore::Document::textNodesMerged):
1218         (WebCore::Document::textNodeSplit):
1219         * page/Settings.cpp:
1220         (WebCore::Settings::Settings):
1221         (WebCore::Settings::setNeedsLeopardMailQuirks):
1222         (WebCore::Settings::setNeedsTigerMailQuirks):
1223         * page/Settings.h:
1224         (WebCore::Settings::needsLeopardMailQuirks):
1225         (WebCore::Settings::needsTigerMailQuirks):
1226
1227 2009-03-23  Ada Chan  <adachan@apple.com>
1228
1229         https://bugs.webkit.org/show_bug.cgi?id=24762
1230         Support text-indent in <option> elements on windows platform.
1231
1232         Reviewed by Adele Peterson.
1233
1234         * css/themeWin.css:
1235         * platform/PopupMenuStyle.h: We don't honor font specified on <option> elements right now.  Make this
1236         explicit via windows themed default stylesheet.
1237         (WebCore::PopupMenuStyle::PopupMenuStyle): Also store text-indent and text-direction.
1238         (WebCore::PopupMenuStyle::textIndent):
1239         (WebCore::PopupMenuStyle::textDirection):
1240         * platform/win/PopupMenuWin.cpp:
1241         (WebCore::PopupMenu::paint): Adjust the text's x-coordinate if text-indent is supported for options and 
1242         text-indent is specified with LTR direction.
1243         * rendering/RenderMenuList.cpp:
1244         (WebCore::RenderMenuList::updateOptionsWidth): Take text-indent into account if theme supports text-indent for options.
1245         (WebCore::RenderMenuList::itemStyle): Use new PopupMenuStyle constructor on windows.
1246         (WebCore::RenderMenuList::menuStyle): Ditto.
1247         * rendering/RenderTextControlSingleLine.cpp:
1248         (WebCore::RenderTextControlSingleLine::menuStyle): Ditto.
1249         * rendering/RenderTheme.h:
1250         (WebCore::RenderTheme::popupOptionSupportsTextIndent): Added.  Default is false since we are only supporting it in windows for now.
1251         * rendering/RenderThemeWin.h:
1252         (WebCore::RenderThemeWin::popupOptionSupportsTextIndent): Returns true for windows.
1253
1254 2009-03-23  Sam Weinig  <sam@webkit.org>
1255
1256         Reviewed by Anders Carlsson.
1257
1258         Fix for https://bugs.webkit.org/show_bug.cgi?id=24699
1259         REGRESSION: Java Applets broken
1260         <rdar://problem/6707494>
1261
1262         Fix loading Java applets without a codeBase. Only pass the base (up to the
1263         the last path component) of the baseURL to the plug-in.
1264
1265         * html/HTMLAppletElement.cpp:
1266         (WebCore::HTMLAppletElement::createRenderer):
1267         * platform/KURL.cpp:
1268         (WebCore::KURL::baseAsString):
1269         * platform/KURL.h:
1270
1271 2009-03-23  Darin Adler  <darin@apple.com>
1272
1273         Reviewed by Sam Weinig.
1274
1275         * platform/KURL.h: Removed now-incorrect comments.
1276         None of the parts include the separator characters any more, now that
1277         query doesn't include the "?", so the comments explaining which do and do
1278         not are no-longer helpful.
1279
1280 2009-03-23  David Levin  <levin@chromium.org>
1281
1282         Reviewed by Dimitri Glazkov.
1283
1284         https://bugs.webkit.org/show_bug.cgi?id=24764
1285
1286         Renamed files V8NodeFilter -> V8NodeFilterCondition to reflect
1287         class names.  Also fixed some headers that got mangled in search/replace
1288         operations.
1289
1290         No change in behavior, so no test.
1291
1292         * bindings/v8/V8NodeFilter.h: Removed.
1293         * bindings/v8/V8NodeFilterCondition.cpp: Renamed from WebCore/bindings/v8/V8NodeFilter.cpp.
1294         * bindings/v8/V8NodeFilterCondition.h: Added.
1295         * bindings/v8/custom/V8ClipboardCustom.cpp:
1296         * bindings/v8/custom/V8DocumentCustom.cpp:
1297         * bindings/v8/custom/V8ElementCustom.cpp:
1298         * bindings/v8/custom/V8HTMLCanvasElementCustom.cpp:
1299         * bindings/v8/custom/V8NavigatorCustom.cpp:
1300
1301 2009-03-23  Darin Fisher  <darin@chromium.org>
1302
1303         Reviewed by Antti Koivisto.
1304
1305         https://bugs.webkit.org/show_bug.cgi?id=24741
1306
1307         Adds a unique across-browser-sessions identifier to FormData, which may
1308         be used by ResourceHandle as a secondary cache key to enable cached
1309         form submissions.
1310
1311         At issue: two otherwise identical form submissions may result in
1312         completely independent responses, which may each be appropriate to
1313         store and reuse from cache.
1314
1315         * html/HTMLFormElement.cpp: Added call to FormData::setIdentifier so that
1316         we only enable cached form submissions for those generated by HTML.  This
1317         way we do not bother with POSTs generated by XMLHttpRequest.
1318         (WebCore::generateFormDataIdentifier):
1319         (WebCore::HTMLFormElement::createFormData):
1320         * platform/network/FormData.cpp: Initialize m_identifier to 0, which means
1321         the unspecified identifier.  So by default there is no identifier and
1322         nothing changes.
1323         (WebCore::FormData::FormData):
1324         * platform/network/FormData.h: Added m_identifier with setter and getter.
1325         (WebCore::FormData::setIdentifier):
1326         (WebCore::FormData::identifier):
1327
1328 2009-03-23  Simon Fraser  <simon.fraser@apple.com>
1329
1330         Reviewed by Antti Koivisto
1331         
1332         https://bugs.webkit.org/show_bug.cgi?id=24733
1333         
1334         Fix media controller with full-page zoom. Previously, the media controller
1335         shadow nodes never saw style changes on the RenderMedia, so did not respond
1336         to zooming at all. Now, we update the style on the shadow renderers
1337         whenever RenderMedia gets a style change. Also fix the video thumb in
1338         the theme to be scaled properly.
1339
1340         Test: media/video-controls-zoomed.html
1341
1342         * rendering/MediaControlElements.cpp:
1343         (WebCore::MediaControlShadowRootElement::updateStyle):
1344         (WebCore::MediaTextDisplayElement::MediaTextDisplayElement):
1345         (WebCore::MediaTextDisplayElement::updateStyle):
1346         (WebCore::MediaControlInputElement::MediaControlInputElement):
1347         (WebCore::MediaControlInputElement::updateStyle):
1348         * rendering/MediaControlElements.h:
1349         * rendering/RenderMedia.cpp:
1350         (WebCore::RenderMedia::styleDidChange):
1351         * rendering/RenderMedia.h:
1352         * rendering/RenderThemeMac.mm:
1353         (WebCore::RenderThemeMac::adjustSliderThumbSize):
1354
1355 2009-03-23  Mike Belshe  <mike@belshe.com>
1356
1357         Reviewed by Darin Adler.
1358
1359         https://bugs.webkit.org/show_bug.cgi?id=24739
1360
1361         Rework StringImpl::create methods to try to allocate a single buffer
1362         rather than allocating both the StringImpl class and a separate data
1363         buffer.
1364
1365         * platform/text/StringImpl.cpp:
1366         * platform/text/StringImpl.h:
1367
1368 2009-03-23  Darin Adler  <darin@apple.com>
1369
1370         Reviewed by Antti Koivisto.
1371
1372         Based on a patch by Nico Weber <nicolasweber@gmx.de>
1373
1374         Bug 24755: LayoutTests/http/tests/misc/url-in-utf16le.html regression
1375         https://bugs.webkit.org/show_bug.cgi?id=24755
1376
1377         * platform/text/TextEncoding.cpp:
1378         (WebCore::TextEncoding::isUTF7Encoding): Added. Checks if the current encoding
1379         is UTF7 without loading extended codecs.
1380         (WebCore::TextEncoding::encodingForFormSubmission): Use isUTF7Encoding() instead
1381         of comparing with UTF7Encoding(). Eliminate the explicit check of
1382         noExtendedTextEncodingNameUsed() because that's now handled by the functions
1383         that this function calls instead.
1384
1385         * platform/text/TextEncoding.h: Added isUTF7Encoding function.
1386         Also tweaked formatting a bit.
1387
1388 2009-03-20  Peter Kasting  <pkasting@google.com>
1389
1390         Reviewed by Darin Fisher.
1391
1392         https://bugs.webkit.org/show_bug.cgi?id=24720
1393         RenderThemeChromium should draw something for Slider parts instead of
1394         dropping them on the floor.
1395
1396         * platform/chromium/ChromiumBridge.h:
1397         * rendering/RenderThemeChromiumWin.cpp:
1398         (WebCore::RenderThemeChromiumWin::adjustSliderThumbSize):
1399         (WebCore::RenderThemeChromiumWin::paintSliderTrack):
1400         (WebCore::RenderThemeChromiumWin::determineSliderThumbState):
1401         (WebCore::RenderThemeChromiumWin::getThemeData):
1402         * rendering/RenderThemeChromiumWin.h:
1403         (WebCore::RenderThemeChromiumWin::paintSliderThumb):
1404
1405 2009-03-23  Glen Murphy  <glen@chromium.org>
1406
1407         Reviewed by Darin Fisher.
1408
1409         https://bugs.webkit.org/show_bug.cgi?id=24657
1410
1411         Fix Skia drawing of highly scaled bitmaps; the conversion to
1412         IntRect produced visible layout test failures in highly scaled 
1413         coordinate systems.
1414
1415         Test: svg/custom/image-small-width-height.svg
1416
1417         * WebCore\platform\graphics\skia\ImageSkia.cpp:
1418
1419 2009-03-23  David Kilzer  <ddkilzer@apple.com>
1420
1421         Provide JavaScript exception information after slow script timeout
1422
1423         Reviewed by Oliver Hunt.
1424
1425         * bindings/js/ScriptController.cpp:
1426         (WebCore::ScriptController::evaluate): Changed to report
1427         exceptions for the Interrupted completion type as well.
1428
1429 2009-03-23  Simon Fraser  <simon.fraser@apple.com>
1430
1431         Reviewed by Darin Adler
1432
1433         https://bugs.webkit.org/show_bug.cgi?id=24736
1434         
1435         Fix three mostly-unrelated problems with full-page zoom:
1436         
1437         * dom/Document.cpp:
1438         (WebCore::Document::elementFromPoint):
1439         Document::elementFromPoint() needs to take full-page zoom into account.
1440         
1441         * dom/MouseRelatedEvent.cpp:
1442         (WebCore::MouseRelatedEvent::receivedTarget):
1443         Take full-page zoom into account when computing offsetX/offsetY.
1444         
1445         * html/HTMLSelectElement.cpp:
1446         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
1447         Don't use offsetX/offsetY when hit testing list boxes; offsets were broken
1448         with full-page zoom, and using pageX/pageY is easier because we don't
1449         have to worry about the event target, and we already have a point in
1450         absolute coordinates.
1451
1452         Tests: fast/forms/listbox-hit-test-zoomed.html
1453                fast/forms/search-zoomed.html
1454                fast/forms/slider-zoomed.html
1455
1456 2009-03-23  Simon Fraser  <simon.fraser@apple.com>
1457
1458         Reviewed by Dan Bernstein
1459
1460         https://bugs.webkit.org/show_bug.cgi?id=24753
1461         
1462         The rect for CSS 'clip' needs to have zooming applied to it.
1463
1464         Test: fast/css/clip-zooming.html
1465
1466         * css/CSSStyleSelector.cpp:
1467         (WebCore::CSSStyleSelector::applyProperty):
1468
1469 2009-03-23  Eric Carlson  <eric.carlson@apple.com>
1470
1471         Reviewed by Adam Roben.
1472
1473         <rdar://problem/6704282>
1474         https://bugs.webkit.org/show_bug.cgi?id=24719
1475         QTMovieWinTimer logic inversion
1476
1477         Fix logic inversion in the Win32 timer used by QTMovieWin that caused it to always
1478         use SetTimer, even when the intervals was below USER_TIMER_MINIMUM. A side effect of
1479         this was that a movie timer would sometimes be blocked for significant amounts of time 
1480         because WM_TIMER messages are not processed when the thread's message queue has any
1481         higher priority messages, and WebCore/Win's timer uses PostMessage for low interval
1482         timers. Also change SetTimer call to use HWND and custom message instead of 
1483         timer function since the timer already has an HWND for processing PostMessage.
1484
1485         Not possible to make a test for this because it is so timing dependant.
1486
1487         * platform/graphics/win/QTMovieWinTimer.cpp:
1488         (TimerWindowWndProc):
1489         (setSharedTimerFireDelay):
1490
1491 2009-03-23  Eric Carlson  <eric.carlson@apple.com>
1492
1493         Reviewed by Adele Peterson.
1494
1495         https://bugs.webkit.org/show_bug.cgi?id=24588
1496         
1497         Update media element implementation to current HTML5 spec
1498
1499         New tests: 
1500                media/media-constants.html
1501                media/video-seek-no-src-exception.html
1502                media/video-source-add-src.html
1503                media/video-src-invalid-remove.html
1504                media/video-src-plus-source.html
1505                media/video-timeupdate-during-playback.html
1506
1507         * dom/EventNames.h: Remove obsolute events, add new ones.
1508         * html/HTMLMediaElement.cpp:
1509         (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize new member vars.
1510         (WebCore::HTMLMediaElement::attributeChanged): Trigger load() only when we don't
1511         have a source.
1512         (WebCore::HTMLMediaElement::removedFromDocument): Deal with state name changes.
1513         (WebCore::HTMLMediaElement::scheduleProgressEvent): New, create a progress event and 
1514         add it to the event queue to be dispatch when the timer fires.
1515         (WebCore::HTMLMediaElement::scheduleEvent): New, create a generic event and add
1516         it to the event queue to be dispatch when the timer fires.
1517         (WebCore::HTMLMediaElement::enqueueEvent): Add an event to the queue and ticke the 
1518         asynch event timer.
1519         (WebCore::HTMLMediaElement::asyncEventTimerFired): Dispatch all pending events.
1520         (WebCore::HTMLMediaElement::loadTimerFired): Either trigger the initial load or
1521         try to load the next <source> url.
1522         (WebCore::HTMLMediaElement::load): Minor style change.
1523         (WebCore::HTMLMediaElement::loadInternal): The first part of the spec load algorithm, cleanup
1524         the current load (if any) and set up state for a new load.
1525         (WebCore::HTMLMediaElement::selectMediaResource): Deal with no 'src' or <source>, post 'loadstart'
1526         event, and initiate load from 'src' if present.
1527         (WebCore::HTMLMediaElement::loadNextSourceChild): Initiate load from next <source> url, or trigger
1528         noneSupported() if no more to consider.
1529         (WebCore::HTMLMediaElement::loadResource): Instantiate a new MediaPlayer and ask it to load a url.
1530         (WebCore::HTMLMediaElement::startProgressEventTimer): Start the repeating progress event timer.
1531         (WebCore::HTMLMediaElement::noneSupported): Post error event and set up state when no valid 
1532         media url was found.
1533         (WebCore::HTMLMediaElement::mediaEngineError): Post error event and set up state when no valid 
1534         media engine failed with a decode error or a network error.
1535         (WebCore::HTMLMediaElement::mediaPlayerNetworkStateChanged):
1536         (WebCore::HTMLMediaElement::setNetworkState): Updated for new spec network states.
1537         (WebCore::HTMLMediaElement::mediaPlayerReadyStateChanged):
1538         (WebCore::HTMLMediaElement::setReadyState): Updated for new spec ready state.
1539         (WebCore::HTMLMediaElement::progressEventTimerFired): Bail if the network is not active.
1540         (WebCore::HTMLMediaElement::seek): Return INVALID_STATE_ERR exception if state is too low or
1541         if player hasn't been set up yet. This is necessary becase load() is async. Clear the flag
1542         we use to guard against sending 'ended' more than once.
1543         (WebCore::HTMLMediaElement::duration): Don't bother calling media engine before it has metadata.
1544         (WebCore::HTMLMediaElement::setDefaultPlaybackRate): Remove exception param, 0 is no longer an
1545         invalid rate. 
1546         (WebCore::HTMLMediaElement::setPlaybackRate): Remove exception param, 0 is no longer an
1547         invalid rate. Cache rate being set so we can use it later if media engine isn't ready now.
1548         (WebCore::HTMLMediaElement::play): Remove exception param, play() before load() now just
1549         starts loading asynchronously.
1550         (WebCore::HTMLMediaElement::playInternal): Remove exception param. Fire 'waiting' or 'playing'
1551         event depending on current state.
1552         (WebCore::HTMLMediaElement::pause): Remove exception param, pause() before load() now just
1553         starts loading asynchronously.
1554         (WebCore::HTMLMediaElement::pauseInternal): Remove exception param.
1555         (WebCore::HTMLMediaElement::setVolume): dispatchEventAsync -> scheduleEvent
1556         (WebCore::HTMLMediaElement::setMuted): dispatchEventAsync -> scheduleEvent
1557         (WebCore::HTMLMediaElement::togglePlayState): Remove exception param.
1558         (WebCore::HTMLMediaElement::beginScrubbing): pause() doesn't take an exception param.
1559         (WebCore::HTMLMediaElement::startPlaybackProgressTimer): New, starts timer that fires 4 times per
1560         second when the movie is playing to timeupdate so we can post 'timeupdate' events.
1561         (WebCore::HTMLMediaElement::playbackProgressTimerFired): Timer proc.
1562         (WebCore::HTMLMediaElement::scheduleTimeupdateEvent): Bottleneck around scheduling a 'timeupdate'
1563         event because we both fire them them when the spec says we should and when the media engine
1564         says that time has jumped, but we don't want to fire more than one at a given movie time. We also
1565         use this bottleneck to keep track of the last time one was posted so we won't fire too often
1566         during playback.
1567         (WebCore::HTMLMediaElement::canPlay): readyState now tracks whether or not we have metadata.
1568         (WebCore::HTMLMediaElement::havePotentialSourceChild): New, checks to see if there are a <source>
1569         element with a 'src' attribute that we have not tried to load yet.
1570         (WebCore::HTMLMediaElement::nextSourceChild): New, returns the url and content type of the next
1571         <source> element that we haven't tried to load.
1572         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged): Schedule 'seeked' event when seeking completes.
1573         Set a flag when we post the 'ended' event, clear it when time changed and we aren't at the end since
1574         some media engines call this proc more than once when playback reaches the end and stops, but we
1575         don't want to post 'ended' more than once.
1576         (WebCore::HTMLMediaElement::mediaPlayerDurationChanged): New, added so media engine can inform
1577         when the movie duration changes and we can post 'durationchanged' event.
1578         (WebCore::HTMLMediaElement::mediaPlayerRateChanged): New, added so media engine can inform when
1579         the rate changed and we can updated our cached rate. This is useful because we only want to know
1580         post periodic 'timeupdate' events when the movie is actually playing, and because we want to know
1581         the actual playback rate when it differs from what we tried to set.
1582         (WebCore::HTMLMediaElement::mediaPlayerSizeChanged): New, added so media engine can inform when
1583         a movie's intrinsic size changes and we can inform the renderer.
1584         (WebCore::HTMLMediaElement::potentiallyPlaying): Renamed from activelyPlaying since the spec now
1585         uses "actively playing" for this concept. Update logic for new state names and un-comment calls
1586         to stoppedDueToErrors() and pausedForUserInteraction() since the spec says those condiditons
1587         are part of the answer.
1588         (WebCore::HTMLMediaElement::endedPlayback): Update logic for new state names. 
1589         (WebCore::HTMLMediaElement::stoppedDueToErrors): New, spec says this logic should be part of
1590         the determination of "potentially playing".
1591         (WebCore::HTMLMediaElement::pausedForUserInteraction): New, placeholder for when (if) user
1592         agent supports this spec concept.
1593         (WebCore::HTMLMediaElement::updatePlayState): Stop timer used to fire periodic 'timeupdate' 
1594         events when we pauses the movie. Set the media engine rate before calling play() in case it
1595         wasn't set up when the rate was changed.
1596         (WebCore::HTMLMediaElement::stopPeriodicTimers): New, stop the progress event and 'timeupate'
1597         event timers.
1598         (WebCore::HTMLMediaElement::userCancelledLoad): New, logic pulled out of documentWillBecomeInactive
1599         and updated for the current spec.
1600         (WebCore::HTMLMediaElement::documentWillBecomeInactive): Moved some logic to userCancelledLoad.
1601         (WebCore::HTMLMediaElement::documentDidBecomeActive): Update comments.
1602         (WebCore::HTMLMediaElement::initialURL): Update for refactoring of code that determines the 
1603         initial url.
1604         * html/HTMLMediaElement.h: Change ReadyState and NetworkState enums to match names in the spec,
1605         update for changes in .cpp.
1606         (WebCore::HTMLMediaElement::):
1607
1608         * html/HTMLMediaElement.idl: Update ready state and network state constants for spec changes.
1609         defaultPlaybackRate, playbackRate, play(), and pause() no longer raise exceptions.
1610
1611         * html/HTMLSourceElement.cpp:
1612         (WebCore::HTMLSourceElement::insertedIntoDocument): Update for network state name changes.
1613
1614         * html/HTMLVideoElement.cpp:
1615         (WebCore::HTMLVideoElement::updatePosterImage): Update for ready state name changes.
1616
1617         * html/MediaError.h:
1618         (WebCore::MediaError::): add MEDIA_ERR_NONE_SUPPORTED.
1619
1620         * html/MediaError.idl: add MEDIA_ERR_NONE_SUPPORTED.
1621
1622         * loader/MediaDocument.cpp:
1623         (WebCore::MediaDocument::defaultEventHandler): play() and pause() don't take an exception.
1624
1625         * platform/graphics/MediaPlayer.cpp:
1626         (WebCore::NullMediaPlayerPrivate::readyState): Update for newtork state name changes.
1627         (WebCore::MediaPlayer::sizeChanged): New, so engine can report intrinsic size changes.
1628         (WebCore::MediaPlayer::rateChanged): New, so engine can report rate changes.
1629         (WebCore::MediaPlayer::durationChanged): New, so engine can report duration changes.
1630         * platform/graphics/MediaPlayer.h: Update NetworkState and ReadyState enum names to match spec
1631         states.
1632         (WebCore::MediaPlayerClient::mediaPlayerDurationChanged): New.
1633         (WebCore::MediaPlayerClient::mediaPlayerRateChanged): New.
1634         (WebCore::MediaPlayerClient::mediaPlayerSizeChanged): New.
1635         (WebCore::MediaPlayer::):
1636
1637         * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
1638         (WebCore::MediaPlayerPrivate::MediaPlayerPrivate): Update for network/ready state name changes.
1639         (WebCore::MediaPlayerPrivate::load): Ditto.
1640         (WebCore::MediaPlayerPrivate::updateStates): Ditto.
1641         (WebCore::MediaPlayerPrivate::loadingFailed): Ditto.
1642
1643         * platform/graphics/mac/MediaPlayerPrivateQTKit.h: Update for network/ready state name changes.
1644         Remove endPointTimer, it is no longer necessary. Add m_enabledTrackCount and m_duration.
1645         (WebCore::MediaPlayerPrivate::metaDataAvailable):
1646         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
1647         (WebCore::MediaPlayerPrivate::MediaPlayerPrivate): No more m_endPointTimer or m_endTime. Initialize
1648         m_enabledTrackCount and m_duration. Update for network/ready state name changes.
1649         (WebCore::MediaPlayerPrivate::load): Update for network/ready state name changes.
1650         (WebCore::MediaPlayerPrivate::play): No more m_endPointTimer.
1651         (WebCore::MediaPlayerPrivate::pause): Ditto.
1652         (WebCore::MediaPlayerPrivate::currentTime): No more m_endTime.
1653         (WebCore::MediaPlayerPrivate::seek): Ditto.
1654         (WebCore::MediaPlayerPrivate::doSeek): Ditto, plus don't call setRate(0) when the rate is
1655         already zero.
1656         (WebCore::MediaPlayerPrivate::setEndTime): No more m_endTime.
1657         (WebCore::MediaPlayerPrivate::updateStates): Update for network/ready state name changes. Return
1658         different errors depending on what causes a failure. Watch for and report duration changes.
1659         (WebCore::MediaPlayerPrivate::rateChanged): Report rate changes.
1660         (WebCore::MediaPlayerPrivate::sizeChanged): Report size changes.
1661         (WebCore::MediaPlayerPrivate::didEnd): No more endpoint timer.
1662         (WebCore::MediaPlayerPrivate::setVisible): Update for network/ready state name changes.
1663         (WebCore::MediaPlayerPrivate::disableUnsupportedTracks): Don't return number of unsupported
1664         tracks, store in m_enabledTrackCount so we can use it to help determine causes of failure.
1665
1666         * platform/graphics/qt/MediaPlayerPrivatePhonon.cpp:
1667         (WebCore::MediaPlayerPrivate::MediaPlayerPrivate): Update for network/ready state name changes.
1668         (WebCore::MediaPlayerPrivate::load): Ditto.
1669         (WebCore::MediaPlayerPrivate::duration): Ditto.
1670         (WebCore::MediaPlayerPrivate::updateStates): Ditto.
1671         (WebCore::MediaPlayerPrivate::naturalSize): Ditto.
1672
1673         * platform/graphics/win/MediaPlayerPrivateQuickTimeWin.cpp:
1674         (WebCore::MediaPlayerPrivate::MediaPlayerPrivate): No more m_endPointTimer. Update for 
1675         network/ready state name changes.
1676         (WebCore::MediaPlayerPrivate::load): Update for network/ready state name changes. No more
1677         m_endPointTimer.
1678         (WebCore::MediaPlayerPrivate::play): No more m_endPointTimer.
1679         (WebCore::MediaPlayerPrivate::pause): Ditto. 
1680         (WebCore::MediaPlayerPrivate::setEndTime): Ditto.
1681         (WebCore::MediaPlayerPrivate::updateStates): Update for network/ready state name changes.
1682         (WebCore::MediaPlayerPrivate::didEnd): No more m_endPointTimer.
1683         * platform/graphics/win/MediaPlayerPrivateQuickTimeWin.h:
1684
1685         * rendering/MediaControlElements.cpp:
1686         (WebCore::MediaControlPlayButtonElement::defaultEventHandler): Update for network/ready state 
1687         name changes.
1688         (WebCore::MediaControlSeekButtonElement::defaultEventHandler): Ditto.
1689
1690 2009-03-22  Kevin Ollivier  <kevino@theolliviers.com>
1691
1692         wxGTK build fix. Add missing header.
1693
1694         * platform/wx/wxcode/gtk/non-kerned-drawing.cpp:
1695
1696 2009-03-22  Simon Fraser  <simon.fraser@apple.com>
1697
1698         Reviewed by Dan Bernstein
1699         
1700         https://bugs.webkit.org/show_bug.cgi?id=24665
1701         
1702         Image-map code in RenderImage could result in RenderImage::nodeAtPoint()
1703         setting HitTestResult::innerNode(), but returning false, which violates
1704         hit testing rules. Use a temporary HitTestResult so that we only fill in
1705         result when we know we've hit.
1706
1707         * rendering/RenderImage.cpp:
1708         (WebCore::RenderImage::nodeAtPoint):
1709
1710 2009-03-22  Simon Fraser  <simon.fraser@apple.com>
1711
1712         Reviewed by Dan Bernstein
1713         
1714         https://bugs.webkit.org/show_bug.cgi?id=24743
1715         
1716         Fix hit testing regression from r41840. We need to pass the temporary
1717         HitTestResult when testing sublayers, then only copy to 'result' when
1718         the layer is known to have been hit.
1719
1720         Test: fast/layers/zindex-hit-test.html
1721
1722         * rendering/RenderLayer.cpp:
1723         (WebCore::RenderLayer::hitTestLayer):
1724
1725 2009-03-20  Simon Fraser  <simon.fraser@apple.com>
1726
1727         Reviewed by Darin Adler
1728
1729         https://bugs.webkit.org/show_bug.cgi?id=24733
1730         
1731         Fix hit testing on video controls after full page zoom by fixing wider issue
1732         with event->pageX(), pageY() with zooming. pageX and pageY are "fixed" to be
1733         invariant under zooming (for JavaScript), so we keep an actual page point around
1734         in MouseEvent::absoluteLocation() to avoid the need to factor in zooming everywhere.
1735
1736         * dom/MouseRelatedEvent.cpp:
1737         (WebCore::MouseRelatedEvent::initCoordinates):
1738         (WebCore::MouseRelatedEvent::computePageLocation):
1739         * dom/MouseRelatedEvent.h:
1740         (WebCore::MouseRelatedEvent::absoluteLocation):
1741         (WebCore::MouseRelatedEvent::setAbsoluteLocation):
1742         Member var, and getter and setter for absoluteLocation.
1743         New method, computePageLocation(), to compute the actual page point,
1744         and call it when creating and initting mouse-related events.
1745
1746         * dom/Node.cpp:
1747         (WebCore::Node::dispatchMouseEvent):
1748         (WebCore::Node::dispatchWheelEvent):
1749         Keep non-adjusted pageX and pageY around, and call setAbsoluteLocation()
1750         on the event to replace a potentially rounded point.
1751         
1752         * html/HTMLInputElement.cpp:
1753         (WebCore::HTMLInputElement::defaultEventHandler):
1754         Clean up slider handling code.
1755         
1756         * html/HTMLSelectElement.cpp:
1757         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
1758         Add FIXME comment for use of offsetX/offsetY.
1759         
1760         * page/ContextMenuController.cpp:
1761         (WebCore::ContextMenuController::handleContextMenuEvent):
1762         Use absoluteLocation() when hit testing for context menus.
1763         
1764         * rendering/RenderFrameSet.cpp:
1765         (WebCore::RenderFrameSet::userResize):
1766         Use absoluteLocation() when resizing frames.
1767         
1768         * rendering/RenderMedia.cpp:
1769         (WebCore::RenderMedia::forwardEvent):
1770         Use absoluteLocation() when hit testing media controls.
1771
1772         * rendering/RenderSlider.cpp:
1773         (WebCore::HTMLSliderThumbElement::defaultEventHandler):
1774         (WebCore::RenderSlider::mouseEventIsInThumb):
1775         Use absoluteLocation() when handling slider events.
1776
1777         (WebCore::RenderSlider::forwardEvent):
1778         Factor some code out of HTMLInputElement::defaultEventHandler().
1779         
1780         * rendering/RenderTextControlSingleLine.cpp:
1781         (WebCore::RenderTextControlSingleLine::forwardEvent):
1782         Use absoluteLocation() when hit testing search field buttons, which fixees
1783         bugs in the search field with zooming.
1784
1785 2009-03-21  David Levin  <levin@chromium.org>
1786
1787         Reviewed by Dimitri Glazkov.
1788
1789         https://bugs.webkit.org/show_bug.cgi?id=24727
1790         Add V8XMLHttpRequest*.
1791
1792         * bindings/v8/V8XMLHttpRequestUtilities.cpp: Added.
1793         * bindings/v8/V8XMLHttpRequestUtilities.h: Added.
1794         * bindings/v8/custom/V8XMLHttpRequestConstructor.cpp: Added.
1795         * bindings/v8/custom/V8XMLHttpRequestCustom.cpp: Added.
1796         * bindings/v8/custom/V8XMLHttpRequestUploadCustom.cpp: Added.
1797
1798 2009-03-21  David Levin  <levin@chromium.org>
1799
1800         Reviewed by Dimitri Glazkov.
1801
1802         https://bugs.webkit.org/show_bug.cgi?id=24725
1803         Add V8NodeFilter.
1804
1805         * bindings/v8/V8NodeFilter.cpp: Added.
1806         * bindings/v8/V8NodeFilter.h: Added.
1807
1808 2009-03-21  Dan Bernstein  <mitz@apple.com>
1809
1810         Rubber-stamped by Kevin Decker
1811
1812         - remove some redundant #include statements
1813
1814         * bindings/js/JSDOMWindowBase.cpp:
1815
1816 2009-03-20  Dan Bernstein  <mitz@apple.com>
1817
1818         Reviewed by Mark Rowe.
1819
1820         - fix <rdar://problem/6574185> REGRESSION (3.2.2-TOT): hang in text drawing code
1821
1822         * platform/graphics/win/FontCGWin.cpp:
1823         (WebCore::drawGDIGlyphs): Changed glyph stroking to fill and stroke each
1824         glyph as a separate path, instead of all glyphs as a single path. This
1825         matches what CGContextShowGlyphsWithAdvances() does, and has comparable
1826         performance.
1827
1828 2009-03-20  Dean Jackson  <dino@apple.com>
1829
1830         Reviewed by Simon Fraser
1831
1832         Build fix for ENABLE(3D_RENDERING)
1833
1834         * rendering/RenderObject.h:
1835         (WebCore::makeMatrixRenderable):
1836
1837 2009-03-20  Dave Moore  <davemoore@google.com>
1838
1839         Reviewed by Dimitri Glazkov.
1840
1841         https://bugs.webkit.org/show_bug.cgi?id=24705
1842
1843         A bug in the V8 bindings is preventing chromium from setting the href on the
1844         location object...any attempt throws a security error, not just for javascript
1845         protocol
1846
1847         * page/Location.idl:
1848
1849 2009-03-20  Craig Schlenter  <craig.schlenter@gmail.com>
1850
1851         Reviewed by Dimitri Glazkov.
1852
1853         https://bugs.webkit.org/show_bug.cgi?id=24608
1854
1855         Include stdio.h needed for printf on gcc 4.4.0
1856
1857         * platform/KURLGoogle.cpp:
1858
1859 2009-03-20  Mike Belshe <mike@belshe.com>
1860
1861         Reviewed by Darin Fisher.
1862
1863         https://bugs.webkit.org/show_bug.cgi?id=24577
1864
1865         Don't let comments at the end of an event handler
1866         break the event handler.
1867
1868         No change in behavior, so no test.
1869
1870         * bindings/v8/V8LazyEventListener.cpp:
1871         (WebCore::V8LazyEventListener::getWrappedListenerFunction):
1872
1873 2009-03-20  Norbert Leser  <norbert.leser@nokia.com>
1874
1875         Reviewed by Darin Adler.
1876
1877         https://bugs.webkit.org/show_bug.cgi?id=24535
1878
1879         Fixes missing line terminator character (;) after macro call.
1880         It is common practice to add the trailing ";" where macros are substituted
1881         and not where they are defined with #define.
1882         This change is consistent with other macro declarations across webkit,
1883         and it also solves compilation failure with symbian compilers. 
1884  
1885         No change in behavior, so no test.
1886
1887         * bindings/js/JSDOMWindowShell.cpp:
1888         * bindings/js/JSEventListener.cpp:
1889         * bindings/js/JSImageConstructor.cpp:
1890         * bindings/js/JSInspectedObjectWrapper.cpp:
1891         * bindings/js/JSInspectorCallbackWrapper.cpp:
1892         * bindings/js/JSNamedNodesCollection.cpp:
1893         * bindings/js/JSNodeFilterCondition.cpp:
1894         * bindings/js/JSOptionConstructor.cpp:
1895         * bindings/js/JSQuarantinedObjectWrapper.cpp:
1896         * bindings/js/JSRGBColor.cpp:
1897         * bindings/js/JSWorkerContextBase.cpp:
1898         * bindings/js/JSXMLHttpRequestConstructor.cpp:
1899         * bindings/js/JSXSLTProcessorConstructor.cpp:
1900         * bindings/scripts/CodeGeneratorJS.pm:
1901
1902 2009-03-20  Mike Belshe  <mike@belshe.com>
1903
1904         Reviewed by Dimitri Glazkov and Dave Hyatt.
1905
1906         https://bugs.webkit.org/show_bug.cgi?id=24324
1907
1908         Make the minimum timer configurable for different platforms.
1909
1910         * page/DOMTimer.cpp:
1911         (WebCore::DOMTimer::DOMTimer):
1912         (WebCore::DOMTimer::fired):
1913         * page/DOMTimer.h:
1914         (WebCore::DOMTimer::minTimerInterval):
1915         (WebCore::DOMTimer::setMinTimerInterval):
1916
1917 2009-03-20  Dean McNamee  <deanm@chromium.org>
1918
1919         Reviewed by Darin Adler.
1920
1921         https://bugs.webkit.org/show_bug.cgi?id=22834
1922
1923         Make sure to consistently match new/delete and fastMalloc/fastFree.
1924
1925         * css/CSSSelectorList.cpp:
1926         (WebCore::CSSSelectorList::adoptSelectorVector):
1927         (WebCore::CSSSelectorList::deleteSelectors):
1928
1929 2009-03-20  Dan Bernstein  <mitz@apple.com>
1930
1931         Reviewed by Dave Hyatt.
1932
1933         - fix https://bugs.webkit.org/show_bug.cgi?id=23739
1934           <rdar://problem/6556371> REGRESSION (r36513): iframe isn't sized properly upon load
1935
1936         * rendering/RenderBlock.cpp:
1937         (WebCore::RenderBlock::percentHeightDescendants): Added this accessor.
1938         * rendering/RenderBlock.h:
1939         * rendering/RenderTableSection.cpp:
1940         (WebCore::RenderTableSection::layoutRows): Extended the check for
1941         children that flex to include other descendants with percent height
1942         which is relative to the cell.
1943
1944 2009-03-20  Dmitry Titov  <dimich@chromium.org>
1945
1946         Reviewed by Alexey Proskuryakov.
1947
1948         https://bugs.webkit.org/show_bug.cgi?id=24706
1949         Remove ScriptExecutionContext::encoding() since Workers do not need it.
1950         WorkerContext::encoding() is simply removed, while Document::encoding()
1951         made non-virtual and private. Workers use UTF-8 now except when instructed
1952         otherwise by http header. Also updated test.
1953
1954         * dom/Document.h: Made encoding() non-virtual and private.
1955         * dom/ScriptExecutionContext.h: removed encoding().
1956
1957         * workers/Worker.cpp:
1958         (WebCore::Worker::Worker):
1959         (WebCore::Worker::notifyFinished):
1960         * workers/WorkerContext.cpp: removed encoding() implementation.
1961         (WebCore::WorkerContext::WorkerContext):
1962         (WebCore::WorkerContext::completeURL):
1963         * workers/WorkerContext.h: removed encoding()
1964         (WebCore::WorkerContext::create):
1965         * workers/WorkerContextProxy.h:
1966         * workers/WorkerImportScriptsClient.cpp:
1967         (WebCore::WorkerImportScriptsClient::didReceiveData):
1968         * workers/WorkerMessagingProxy.cpp:
1969         (WebCore::WorkerMessagingProxy::startWorkerContext):
1970         * workers/WorkerMessagingProxy.h:
1971         * workers/WorkerThread.cpp:
1972         (WebCore::WorkerThreadStartupData::create):
1973         (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
1974         (WebCore::WorkerThread::create):
1975         (WebCore::WorkerThread::WorkerThread):
1976         (WebCore::WorkerThread::workerThread):
1977         * workers/WorkerThread.h:
1978         In all these, removed storing encoding and 'inheriting' it from the parent.
1979         Instead, they are all using UTF-8 now.
1980
1981 2009-03-20  Timothy Hatcher  <timothy@apple.com>
1982
1983         Change how threading exceptions are checked so they are reported
1984         by what round they were added. That way WebKit can decided the
1985         behavior per-round based on linked-on-or-after checks.
1986
1987         <rdar://problem/6626741&6648478&6635474&6674079>
1988
1989         Reviewed by Darin Adler.
1990
1991         * WebCore.base.exp: Export the new symbols.
1992         * bindings/objc/DOMAbstractView.mm: Use the new WebCoreThreadViolationCheckRoundOne macro.
1993         * bindings/scripts/CodeGeneratorObjC.pm: Ditto.
1994         * platform/ThreadCheck.h:
1995         * platform/mac/ThreadCheck.mm:
1996         (WebCore::readThreadViolationBehaviorFromUserDefaults): Refactor how the default is read.
1997         (WebCore::setDefaultThreadViolationBehavior): Take a round argument.
1998         (WebCore::reportThreadViolation): Ditto.
1999         (WebCoreReportThreadViolation): Ditto.
2000
2001 2009-03-20  Geoffrey Garen  <ggaren@apple.com>
2002
2003         Reviewed by Sam Weinig.
2004
2005         Fixed up an out-of-date comment.
2006
2007         * bindings/js/JSDOMWindowCustom.h:
2008         (WebCore::JSDOMWindow::customPut):
2009
2010 2009-03-20  Beth Dakin  <bdakin@apple.com>
2011
2012         Reviewed by Dave Hyatt.
2013
2014         Fix for https://bugs.webkit.org/show_bug.cgi?id=20909 REGRESSION 
2015         (r35318): A press release at pfizer.com does not display correctly
2016         - and corresponding -
2017         <rdar://problem/6680073>
2018
2019         * rendering/RenderObject.cpp:
2020         (WebCore::RenderObject::invalidateContainerPrefWidths):
2021         * rendering/RenderObject.h:
2022         (WebCore::RenderObject::markContainingBlocksForLayout):
2023
2024 2009-03-20  Eric Seidel  <eric@webkit.org>
2025
2026         Reviewed by Justin Garcia.
2027
2028         maxDeepOffset is confusing and should be removed
2029         https://bugs.webkit.org/show_bug.cgi?id=24586
2030
2031         Abstract some hard-to-read (but shared) logic into a new renderedAsNonInlineTableOrHR function.
2032         Add first/lastDeepEditingPositionForNode Position creation functions
2033         and deploy them to places we used to call maxDeepOffset.
2034
2035         Rename Position::atStart and atEnd to atStartOfTree atEndOfTree
2036         Add a new Position::atFirst/atLastEditingPositionForNode() and use these
2037         to replace a few more callers for maxDeepOffset()
2038         
2039         Rename maxDeepOffset to lastEditingOffsetForNode (so that we mere mortals have some clue what it does)
2040
2041         "Editing positions" are confusing because they have one
2042         of two behaviors, depending on if the container node is ignored
2043         by editing (if editingIgnoresContent(node) returns true) or not.
2044         Positions referring to nodes ignored by editing are
2045         neighbor-relative (they are before or after the node) where as
2046         positions reffering to other nodes are container-relative
2047         (they are between two child nodes of the container, identified
2048         by the offset() member).  I will be fixing this confusion in
2049         future patches.  These renames hopefully make the current behavior clearer.
2050
2051         * dom/Position.cpp:
2052         (WebCore::Position::previous):
2053         (WebCore::Position::next):
2054         (WebCore::Position::atFirstEditingPositionForNode):
2055         (WebCore::Position::atLastEditingPositionForNode):
2056         (WebCore::Position::atStartOfTree):
2057         (WebCore::Position::atEndOfTree):
2058         (WebCore::Position::previousCharacterPosition):
2059         (WebCore::Position::nextCharacterPosition):
2060         (WebCore::Position::upstream):
2061         (WebCore::Position::isCandidate):
2062         (WebCore::firstDeepEditingPositionForNode):
2063         (WebCore::lastDeepEditingPositionForNode):
2064         * dom/Position.h:
2065         * dom/PositionIterator.cpp:
2066         (WebCore::PositionIterator::operator Position):
2067         (WebCore::PositionIterator::increment):
2068         (WebCore::PositionIterator::decrement):
2069         (WebCore::PositionIterator::atEnd):
2070         (WebCore::PositionIterator::atEndOfNode):
2071         * editing/CompositeEditCommand.cpp:
2072         (WebCore::CompositeEditCommand::positionAvoidingSpecialElementBoundary):
2073         * editing/DeleteSelectionCommand.cpp:
2074         (WebCore::isTableCellEmpty):
2075         (WebCore::DeleteSelectionCommand::removeNode):
2076         (WebCore::DeleteSelectionCommand::handleGeneralDelete):
2077         * editing/Editor.cpp:
2078         (WebCore::Editor::advanceToNextMisspelling):
2079         * editing/InsertLineBreakCommand.cpp:
2080         (WebCore::InsertLineBreakCommand::doApply):
2081         * editing/InsertListCommand.cpp:
2082         (WebCore::InsertListCommand::doApply):
2083         * editing/ReplaceSelectionCommand.cpp:
2084         (WebCore::ReplaceSelectionCommand::positionAtEndOfInsertedContent):
2085         * editing/TypingCommand.cpp:
2086         (WebCore::TypingCommand::forwardDeleteKeyPressed):
2087         * editing/VisiblePosition.cpp:
2088         (WebCore::VisiblePosition::previous):
2089         (WebCore::VisiblePosition::leftVisuallyDistinctCandidate):
2090         (WebCore::VisiblePosition::left):
2091         (WebCore::VisiblePosition::rightVisuallyDistinctCandidate):
2092         (WebCore::VisiblePosition::right):
2093         * editing/VisibleSelection.cpp:
2094         (WebCore::VisibleSelection::selectionFromContentsOfNode):
2095         (WebCore::VisibleSelection::adjustSelectionToAvoidCrossingEditingBoundaries):
2096         * editing/htmlediting.cpp:
2097         (WebCore::nextVisuallyDistinctCandidate):
2098         (WebCore::previousVisuallyDistinctCandidate):
2099         (WebCore::firstEditablePositionAfterPositionInRoot):
2100         (WebCore::lastEditablePositionBeforePositionInRoot):
2101         (WebCore::lastOffsetForEditing):
2102         (WebCore::isFirstPositionAfterTable):
2103         (WebCore::isLastPositionBeforeTable):
2104         (WebCore::positionBeforeNode):
2105         (WebCore::positionAfterNode):
2106         (WebCore::enclosingEmptyListItem):
2107         (WebCore::caretMaxOffset):
2108         * editing/htmlediting.h:
2109         * editing/visible_units.cpp:
2110         (WebCore::renderedAsNonInlineTableOrHR):
2111         (WebCore::startOfParagraph):
2112         (WebCore::endOfParagraph):
2113         (WebCore::startOfEditableContent):
2114         (WebCore::endOfEditableContent):
2115         * page/AccessibilityObject.cpp:
2116         (WebCore::endOfStyleRange):
2117         * page/AccessibilityRenderObject.cpp:
2118         (WebCore::AccessibilityRenderObject::visiblePositionRange):
2119         * rendering/RenderBox.cpp:
2120         (WebCore::RenderBox::positionForPoint):
2121
2122 2009-03-20  Dmitry Titov  <dimich@chromium.org>
2123
2124         Reviewed by Dimitri Glazkov.
2125
2126         https://bugs.webkit.org/show_bug.cgi?id=24689
2127         Add (upstream) V8 bindings for Workers. Mostly style cleaning.
2128
2129         * bindings/v8/WorkerContextExecutionProxy.cpp: Added.
2130         * bindings/v8/WorkerContextExecutionProxy.h: Added.
2131         * bindings/v8/WorkerScriptController.cpp: Added.
2132         * bindings/v8/WorkerScriptController.h: Added.
2133         * bindings/v8/V8Index.h: Added. This is just a wrapper for v8_index.h, like V8Proxy.h
2134         * bindings/v8/V8Proxy.h: Added domObjectMap() function that wraps GetDOMObjectMap().
2135         * bindings/v8/V8WorkerContextEventListener.cpp:
2136         (WebCore::V8WorkerContextEventListener::callListenerFunction): TrackEvent() renamed trackEvent()
2137
2138 2009-03-20  Stephen White  <senorblanco@chromium.org>
2139
2140         Reviewed by Eric Seidel.
2141
2142         Fix for LayoutTests/fast/canvas/canvas-text-alignment.html
2143         on chromium/skia.  The problem was that the gradient matrix
2144         for text was being applied twice.  Fixed by reverting some of
2145         https://bugs.webkit.org/show_bug.cgi?id=23957, so that skiaDrawText
2146         is no longer responsible for measuring the text and scaling up
2147         the gradient matrix.  Instead, the text bounding box is passed
2148         in from SVGPaintServerGradient.  I didn't make this change for CG,
2149         since it uses a different method (the gradient is drawn using the
2150         text as a pre-rendered mask).
2151         https://bugs.webkit.org/show_bug.cgi?id=24687
2152
2153         * platform/graphics/skia/SkiaFontWin.cpp:
2154         (WebCore::skiaDrawText):
2155         * svg/graphics/SVGPaintServerGradient.cpp:
2156         (WebCore::SVGPaintServerGradient::setup):
2157
2158 2009-03-20  Xan Lopez  <xlopez@igalia.com>
2159
2160         Rubber-stamped by Holger Freyther.
2161
2162         There seems to be some rounding error in cairo (or in how we use
2163         cairo) with some fonts, like DejaVu Sans Mono, which makes cairo
2164         report a height smaller than ascent + descent, which is wrong and
2165         confuses WebCore's layout system. Workaround this while we figure
2166         out what's going on.
2167
2168         * platform/graphics/gtk/SimpleFontDataGtk.cpp:
2169         (WebCore::SimpleFontData::platformInit):
2170         * platform/graphics/gtk/SimpleFontDataPango.cpp:
2171         (WebCore::SimpleFontData::platformInit):
2172
2173 2009-03-19  Alexey Proskuryakov  <ap@webkit.org>
2174
2175         Reviewed by Darin Adler.
2176
2177         https://bugs.webkit.org/show_bug.cgi?id=24122
2178         <rdar://problem/6674179>
2179         REGRESSION: DOM Range extractContents/deleteContents failures seen on Moxiecode tests
2180
2181         Test: fast/dom/Range/deleted-range-endpoints.html
2182
2183         * dom/Range.cpp: (WebCore::Range::processContents): Set the final range in accordance
2184         to the specification.
2185
2186 2009-03-19  Anders Carlsson  <andersca@apple.com>
2187
2188         Reviewed by Dan Bernstein.
2189
2190         <rdar://problem/6682554> Flash content not being rendered (Shockwave Flash 10.0 r22)
2191         
2192         If calling updateWidget for some reason resulted in another widget being added to m_widgetUpdateSet, then
2193         that object would never be updated.
2194         
2195         * page/FrameView.cpp:
2196         (WebCore::FrameView::updateWidgets):
2197         Factor the widget updating code out into this method. Return true if the update set is empty.
2198         
2199         (WebCore::FrameView::performPostLayoutTasks):
2200         Loop over the update set multiple times until all widgets have been updated or until we reach the cap.
2201         
2202         * page/FrameView.h:
2203
2204 2009-03-18  Timothy Hatcher  <timothy@apple.com>
2205
2206         Make the defered data loading timer honor the Page's scheduled runloop pairs.
2207         Introduces a new RunLoopTimer class that has an API mimicking Timer but
2208         allows it to be scheduled with one or more SchedulePairs.
2209
2210         <rdar://problem/6687342> -[WebView scheduleInRunLoop:forMode:] has no affect on timers
2211
2212         Reviewed by Darin Adler.
2213
2214         * WebCore.xcodeproj/project.pbxproj: Adds the new RunLoopTimer.{cpp,h} files.
2215         * loader/MainResourceLoader.cpp:
2216         (WebCore::MainResourceLoader::handleDataLoadNow): Use the MainResourceLoaderTimer typedef.
2217         (WebCore::MainResourceLoader::startDataLoadTimer): Added. Start the timer and on
2218         Mac platforms also schedule with the Page's SchedulePairs.
2219         (WebCore::MainResourceLoader::handleDataLoadSoon): Call startDataLoadTimer().
2220         (WebCore::MainResourceLoader::setDefersLoading): Ditto.
2221         * loader/MainResourceLoader.h:
2222         * platform/cf/RunLoopTimerCF.cpp: Added.
2223         (WebCore::RunLoopTimerBase::~RunLoopTimerBase):
2224         (WebCore::timerFired):
2225         (WebCore::RunLoopTimerBase::start):
2226         (WebCore::RunLoopTimerBase::schedule):
2227         (WebCore::RunLoopTimerBase::stop):
2228         (WebCore::RunLoopTimerBase::isActive):
2229         * platform/RunLoopTimer.h: Added.
2230         (WebCore::RunLoopTimerBase::RunLoopTimerBase):
2231         (WebCore::RunLoopTimerBase::startRepeating):
2232         (WebCore::RunLoopTimerBase::startOneShot):
2233         (WebCore::RunLoopTimer::RunLoopTimer):
2234         (WebCore::RunLoopTimer::fired):
2235
2236 2009-03-19  Dimitri Glazkov  <dglazkov@chromium.org>
2237
2238         Reviewed by Darin Fisher.
2239
2240         https://bugs.webkit.org/show_bug.cgi?id=24702
2241         Upstream miscellaneous bindings changes.
2242
2243         * bindings/v8/ScheduledAction.cpp:
2244         (WebCore::ScheduledAction::execute): Changed to call lower-case evaluate.
2245         * bindings/v8/ScriptCallStack.h: Added an extra include.
2246
2247 2009-03-19  Simon Fraser  <simon.fraser@apple.com>
2248
2249         Reviewed by Dave Hyatt
2250
2251         https://bugs.webkit.org/show_bug.cgi?id=24686
2252         
2253         When hit testing a RenderLayer whose parent lives in a preserves-3D hierarchy,
2254         we need to compare the computed z-offset with the depth-test z-offset before
2255         deciding that such a RenderLayer was hit. This fixes an issue, tested by the
2256         3d-point-mapping-overlapping.html test, where the child of a transformed element
2257         is found by hit testing, even when some other element with greater Z overlaps
2258         them both.
2259         
2260         Improved the code by adding a utility method, isHitCandidate(), which computes and tests
2261         z-depth when necessary.
2262
2263         Tests: transforms/3d/point-mapping/3d-point-mapping-coplanar.html
2264                transforms/3d/point-mapping/3d-point-mapping-overlapping.html
2265
2266         * rendering/RenderLayer.cpp:
2267         (WebCore::isHitCandidate):
2268         (WebCore::RenderLayer::hitTestLayer):
2269
2270 2009-03-19  Jeremy Moskovich  <jeremy@chromium.org>
2271
2272         Reviewed by Dimitri Glazkov.
2273
2274         https://bugs.webkit.org/show_bug.cgi?id=24456
2275         Split ColorChromium.cpp into Mac & Windows variants.
2276         Remove Chromium Dependency on platform/graphics/mac/ColorMac.mm since we
2277         ultimately need to take a different approach.  For now, createCGColor()
2278         is copied from ColorMac.mm.
2279
2280         No observable change in behavior, so no test.
2281
2282         * platform/graphics/chromium/ColorChromium.cpp:
2283         (WebCore::focusRingColor):
2284         * platform/graphics/chromium/ColorChromiumMac.mm: Added.
2285
2286 2009-03-19  Pavel Feldman  <pfeldman@chromium.org>
2287
2288         Reviewed by Dimitri Glazkov.
2289
2290         https://bugs.webkit.org/show_bug.cgi?id=24675
2291         Unforking frontend: add custom InspectorController methods
2292         implementation.
2293
2294         * bindings/v8/custom/V8InspectorControllerCustom.cpp: Added.
2295
2296 2009-03-19  Jay Campan  <jcampan@google.com>
2297
2298         Reviewed by Dimitri Glazkov.
2299
2300         https://bugs.webkit.org/show_bug.cgi?id=24625
2301         Adding an accessor to the currently selected index in the PopupMenuChromium.
2302         This is required for implementing the deletion of an autocomplete entry in Chromium.
2303
2304         * platform/chromium/PopupMenuChromium.cpp:
2305         (WebCore::PopupContainer::selectedIndex):
2306         * platform/chromium/PopupMenuChromium.h:
2307
2308 2009-03-19  Evan Stade  <estade@chromium.org>
2309
2310         Reviewed by Dimitri Glazkov.
2311
2312         https://bugs.webkit.org/show_bug.cgi?id=24526
2313         Improve windows skia text stroking.
2314
2315         Test: LayoutTests/svg/custom/struct-use-09-b.svg
2316
2317         * platform/graphics/skia/SkiaFontWin.cpp: Close the path representing
2318         each font glyph polygon, rather than only closing the path once per
2319         letter. This fixes stroking for letters with multiple polygons, such
2320         as 'A' or 'D'.
2321         (WebCore::getPathForGlyph):
2322         (WebCore::skiaDrawText):
2323
2324 2009-03-19  Simon Hausmann  <simon.hausmann@nokia.com>
2325
2326         Reviewed by Tor Arne Vestbø.
2327
2328         Fixed support for doing calls from JavaScript into NPAPI Plugins for the Qt port on Windows.
2329
2330         Removed dead code for distinguishing between Widget and PluginView in the Qt port.
2331
2332         * bindings/js/ScriptControllerQt.cpp:
2333         (WebCore::ScriptController::createScriptInstanceForWidget): Removed incorrect isNPAPI check.
2334         * plugins/PluginView.cpp:
2335         (WebCore::PluginView::PluginView): Removed m_isNPAPIPlugin variable.
2336         * plugins/PluginView.h: Removed setter/getter.
2337         * plugins/mac/PluginViewMac.cpp:
2338         (WebCore::PluginView::init): Removed call to setIsNPAPIPlugin.
2339         * plugins/qt/PluginViewQt.cpp:
2340         (WebCore::PluginView::init): Ditto.
2341
2342 2009-03-19  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2343
2344         Reviewed by Oliver Hunt.
2345
2346         Bug 24596: ASSERT in JSC::PropertySlot::slotBase @ iGoogle homepage
2347         <https://bugs.webkit.org/show_bug.cgi?id=24596>
2348         <rdar://problem/6686493>
2349
2350         JSDOMWindow::customGetOwnPropertySlot() does an access check after calling
2351         JSGlobalObject::getOwnPropertySlot(). This causes the PropertySlot to be
2352         set twice, once to the value that is illegal to access, and then to undefined
2353         This causes an assertion failure in property access caching code.
2354
2355         The fix is to do the access check before calling JSGlobalObject::getOwnPropertySlot().
2356
2357         * bindings/js/JSDOMWindowCustom.h:
2358         (WebCore::JSDOMWindow::customGetOwnPropertySlot):
2359
2360 2009-03-18  Alexey Proskuryakov  <ap@webkit.org>
2361
2362         Reviewed by Sam Weinig.
2363
2364         https://bugs.webkit.org/show_bug.cgi?id=24676
2365         Simple cross-origin requests shouldn't dispatch upload progress events
2366
2367         Test: http/tests/xmlhttprequest/simple-cross-origin-progress-events.html
2368
2369         * loader/CrossOriginAccessControl.cpp: (WebCore::passesAccessControlCheck): Added a comment
2370         explaining the somewhat unexpected behavior of this function.
2371
2372         * xml/XMLHttpRequestUpload.cpp: (WebCore::XMLHttpRequestUpload::hasListeners):
2373         * xml/XMLHttpRequestUpload.h:
2374         Report whether there are any event listeners registered.
2375
2376         * xml/XMLHttpRequest.h: Added m_uploadEventsAllowed.
2377
2378         * xml/XMLHttpRequest.cpp:
2379         (WebCore::XMLHttpRequest::createRequest): Set m_uploadEventsAllowed flag.
2380         (WebCore::XMLHttpRequest::makeSameOriginRequest): Ditto.
2381         (WebCore::XMLHttpRequest::makeCrossOriginAccessRequest): Ditto.
2382         (WebCore::XMLHttpRequest::makeSimpleCrossOriginAccessRequest): Set request body - it can be
2383         non-empty for POST requests.
2384         (WebCore::XMLHttpRequest::makeCrossOriginAccessRequestWithPreflight): Set m_uploadEventsAllowed flag.
2385         (WebCore::XMLHttpRequest::handleAsynchronousPreflightResult): Ditto.
2386         (WebCore::XMLHttpRequest::abort): Only dispatch upload progress events if allowed.
2387         (WebCore::XMLHttpRequest::networkError): Ditto.
2388         (WebCore::XMLHttpRequest::abortError): Ditto.
2389         (WebCore::XMLHttpRequest::didSendData): Ditto.
2390
2391 2009-03-18  Marc-Antoine Ruel  <maruel@chromium.org>
2392
2393         Reviewed by Darin Fisher.
2394
2395         https://bugs.webkit.org/show_bug.cgi?id=24398
2396         Fix a crash when loading a svg file in Chromium's test_shell and
2397         then reloading the page.
2398
2399         * history/BackForwardListChromium.cpp:
2400         (WebCore::BackForwardList::BackForwardList):
2401         (WebCore::BackForwardList::close):
2402
2403 2009-03-18  Eric Carlson  <eric.carlson@apple.com>
2404
2405         Reviewed by Simon Fraser.
2406
2407         Fix for <rdar://problem/6685235>
2408         <video> element poster cannot be set dynamically if not originally set up in HTML
2409         
2410         Allocate the media engine immediately so the plug-in proxy is available for
2411         scripting right away.
2412
2413         * platform/graphics/MediaPlayer.cpp:
2414         (WebCore::MediaPlayer::MediaPlayer):
2415
2416 2009-03-18  Beth Dakin  <bdakin@apple.com>
2417
2418         Reviewed by Dave Hyatt.
2419
2420         Fix for <rdar://problem/6636747> REGRESSION (Safari 4 PB-r41326): 
2421         Popup menu appears at the wrong location on page at http://
2422         www.signonsandiego.com/
2423
2424         This was a regression from http://trac.webkit.org/changeset/40769, 
2425         which changed the base class of RenderInline to 
2426         RenderBoxModelObject rather than RenderBox.
2427
2428         * rendering/RenderObject.cpp:
2429         (WebCore::RenderObject::offsetParent): offsetParent should return a 
2430         RenderBoxModelObject rather than just a RenderBox, which is more 
2431         restrictive. 
2432
2433 2009-03-18  Anders Carlsson  <andersca@apple.com>
2434
2435         Reviewed by Darin Adler.
2436
2437         <rdar://problem/6504776> 
2438         CrashTracer: [USER] 188 crashes in Safari at com.apple.WebCore • WTF::HashTableIterator<WTF::RefPtr<WebCore::ResourceLoader>, ...
2439
2440         Return early in case calling the client ends up spinning the run loop and completing/cancelling the load.
2441         
2442         * loader/NetscapePlugInStreamLoader.cpp:
2443         (WebCore::NetscapePlugInStreamLoader::didCancel):
2444
2445 2009-03-18  David Levin  <levin@chromium.org>
2446
2447         Reviewed by Dimitri Glazkov.
2448
2449         https://bugs.webkit.org/show_bug.cgi?id=24664
2450         Upstreaming v8 collection.h
2451
2452         No change in behavior, so no test.
2453
2454         * bindings/v8/V8Collection.h: Added.
2455
2456 2009-03-18  Sam Weinig  <sam@webkit.org>
2457
2458         Reviewed by Simon Fraser.
2459
2460         Fix for https://bugs.webkit.org/show_bug.cgi?id=23966
2461         REGRESSION: Custom arrow navigation functionality doesn't work at dropular.net
2462         <rdar://problem/6589657>
2463
2464         Match the CSSOM spec for getClientRects and getBoundingClientRect by
2465         returning a 0x0 rect at the correct top/left position for empty inline
2466         boxes.
2467
2468         * rendering/RenderInline.cpp:
2469         (WebCore::RenderInline::absoluteRects):
2470         (WebCore::RenderInline::absoluteQuads):
2471
2472 2009-03-18  David Levin  <levin@chromium.org>
2473
2474         Reviewed by Eric Seidel.
2475
2476         Match the changes done for windows in the bug
2477         https://bugs.webkit.org/show_bug.cgi?id=24530.
2478
2479         No change in behavior, so no test.
2480
2481         * rendering/RenderThemeChromiumLinux.cpp:
2482         (WebCore::RenderThemeChromiumLinux::extraDefaultStyleSheet):
2483
2484 2009-03-18  Dirk Schulze  <krit@webkit.org>
2485
2486         Reviewed by Holger Freyther.
2487
2488         Added support for SVG's stroked texts to Qt.
2489
2490         [Qt] SVGs stroked text support missing
2491         https://bugs.webkit.org/show_bug.cgi?id=24262
2492
2493         * platform/graphics/qt/FontQt.cpp:
2494         (WebCore::Font::drawComplexText):
2495
2496 2009-03-18  Mark Rowe  <mrowe@apple.com>
2497
2498         Reviewed by Alexey Proskuryakov.
2499
2500         Fix fast/encoding/char-decoding.html with recent ICU.
2501
2502         * platform/text/TextCodecICU.cpp:
2503         (WebCore::TextCodecICU::decode): Look for gb18030 case-insensitively,
2504         as newer versions of ICU use GB18030 as the canonical name.
2505
2506 2009-03-17  David Levin  <levin@chromium.org>
2507
2508         Reviewed by Dimitri Glazkov.
2509
2510         https://bugs.webkit.org/show_bug.cgi?id=24662
2511         Chromium build fixes.
2512
2513         Bug https://bugs.webkit.org/show_bug.cgi?id=24663 tracks
2514         the invalid implementation of ScriptCallStack.
2515
2516         No change in behavior, so no test.
2517
2518         * bindings/v8/ScriptCallStack.h:
2519         (WebCore::ScriptCallStack::state):
2520         * platform/graphics/skia/PlatformContextSkia.cpp:
2521         (PlatformContextSkia::drawRect):
2522
2523 2009-03-17  David Carson  <dacarson@apple.com>
2524
2525         Reviewed by David Hyatt.
2526
2527         Add anchor elements to the simple style sheet so that applications that 
2528         are using WebKit just for simple text and links will also take advantage
2529         of the fast path.
2530
2531         * css/CSSStyleSelector.cpp:
2532         (WebCore::elementCanUseSimpleDefaultStyle):
2533
2534 2009-03-17  Darin Adler  <darin@apple.com>
2535
2536         Reviewed by Adele Peterson.
2537
2538         <rdar://problem/6687005> Need support for new move-left/right selectors.
2539
2540         * editing/EditorCommand.cpp:
2541         (WebCore::executeMoveToLeftEndOfLine): Added.
2542         (WebCore::executeMoveToLeftEndOfLineAndModifySelection): Added.
2543         (WebCore::executeMoveToRightEndOfLine): Added.
2544         (WebCore::executeMoveToRightEndOfLineAndModifySelection): Added.
2545         Added command entries for the functions above.
2546
2547 2009-03-17  Ojan Vafai  <ojan@chromium.org>
2548
2549         Reviewed by Adele Peterson.
2550
2551         Put the padding inside scrollbars on textareas.
2552         https://bugs.webkit.org/show_bug.cgi?id=24370
2553         
2554         Put the padding inside the scrollbars on textareas. This is done by moving the
2555         overflow from the shadowNode to the RenderTextControlMultiline. As a result,
2556         all of the scroll handing methods that RenderTextControl overrides can be moved
2557         down into RenderTextControlSingleLine since RenderTextControlMultiline can now
2558         just use RenderBlock's versions. This also allows RenderTextControlMultiLine to
2559         no longer need a custom layout method since the shadowNode can now just size
2560         like a regular DIV.
2561
2562         * css/CSSStyleSelector.cpp:
2563         (WebCore::CSSStyleSelector::adjustRenderStyle):
2564         * rendering/RenderTextControl.cpp:
2565         (WebCore::RenderTextControl::styleDidChange):
2566         (WebCore::RenderTextControl::selection):
2567         (WebCore::RenderTextControl::calcHeight):
2568         (WebCore::RenderTextControl::hitInnerTextElement):
2569         * rendering/RenderTextControl.h:
2570         * rendering/RenderTextControlMultiLine.cpp:
2571         (WebCore::RenderTextControlMultiLine::nodeAtPoint):
2572         (WebCore::RenderTextControlMultiLine::createInnerTextStyle):
2573         * rendering/RenderTextControlMultiLine.h:
2574         * rendering/RenderTextControlSingleLine.cpp:
2575         (WebCore::RenderTextControlSingleLine::styleDidChange):
2576         (WebCore::RenderTextControlSingleLine::autoscroll):
2577         (WebCore::RenderTextControlSingleLine::scrollWidth):
2578         (WebCore::RenderTextControlSingleLine::scrollHeight):
2579         (WebCore::RenderTextControlSingleLine::scrollLeft):
2580         (WebCore::RenderTextControlSingleLine::scrollTop):
2581         (WebCore::RenderTextControlSingleLine::setScrollLeft):
2582         (WebCore::RenderTextControlSingleLine::setScrollTop):
2583         (WebCore::RenderTextControlSingleLine::scroll):
2584         * rendering/RenderTextControlSingleLine.h:
2585         * rendering/TextControlInnerElements.cpp:
2586         (WebCore::RenderTextControlInnerBlock::RenderTextControlInnerBlock):
2587         (WebCore::RenderTextControlInnerBlock::positionForPoint):
2588         (WebCore::TextControlInnerTextElement::createRenderer):
2589
2590 2009-03-17  Darin Adler  <darin@apple.com>
2591
2592         Reviewed by David Hyatt.
2593
2594         Bug 24517: REGRESSION (r41552): innerHTML does an updateLayout -- unneeded and can be slow
2595         https://bugs.webkit.org/show_bug.cgi?id=24517
2596
2597         * editing/DeleteButtonController.cpp:
2598         (WebCore::DeleteButtonController::enable): Added a call to updateRendering, since
2599         determining whether to display the delete button involves style and updateRendering
2600         also updates style (should probably be named updateStyle, in fact). Not needed to fix
2601         this bug, but would have prevented the crash that led to this bug in the first place.
2602
2603         * editing/EditCommand.cpp:
2604         (WebCore::EditCommand::EditCommand): Get rid of unneeded null check. All frames have
2605         delete button controllers.
2606         * editing/Editor.cpp:
2607         (WebCore::Editor::rangeForPoint): Ditto.
2608
2609         * editing/markup.cpp:
2610         (WebCore::appendStartMarkup): Changed a "&" to a "&&" so that generating markup
2611         doesn't depend on renderers at all when the convertBlocksToInlines boolean is false.
2612         This allows us to omit the call to updateLayoutIgnorePendingStylesheets in the
2613         createMarkup function that's called by innerHTML.
2614         (WebCore::MarkupAccumulator::appendMarkup): Turned this into a class with a member
2615         function. Added a feature where the accumulator will skip a node. Moved arguments
2616         that don't change during recursion into an object. This function still is a bit
2617         inefficient, since it creates a new HashMap at every level as it recurses, but for now
2618         I did not tackle that. Also replaced the onlyIncludeChildren boolean with EChildrenOnly
2619         for consistency and clarity.
2620         (WebCore::createMarkup): Removed the call to updateLayoutIgnorePendingStylesheets.
2621         Instead of calling disable/enable on the delete button controller's container element,
2622         pass it in to the markup accumulator as a node to skip.
2623
2624 2009-03-17  Scott Violet  <sky@google.com>
2625
2626         Reviewed by Eric Seidel.
2627
2628         https://bugs.webkit.org/show_bug.cgi?id=24651
2629         Skia does not always render text fill/stroke pattern/gradient/color correctly
2630
2631         Changes Skia's font rendering to only render gradient/pattern if current
2632         color space indicates the gradient/pattern should be used.
2633         This is covered by LayoutTests/fast/canvas/canvas-text-alignment.html .
2634     
2635         * platform/graphics/GraphicsContext.cpp:
2636         (WebCore::GraphicsContext::strokeColorSpace):
2637         (WebCore::GraphicsContext::fillColorSpace):
2638         * platform/graphics/GraphicsContext.h:
2639         (WebCore::):
2640         * platform/graphics/GraphicsContextPrivate.h:
2641         * platform/graphics/skia/SkiaFontWin.cpp:
2642         (WebCore::paintSkiaText):
2643
2644 2009-03-17  Adele Peterson  <adele@apple.com>
2645
2646         Reviewed by Darin Adler.
2647
2648         Fix for https://bugs.webkit.org/show_bug.cgi?id=24655
2649         <rdar://problem/6633727> Hitting return at the end of a line with an anchor jumps me to the bottom of the message
2650
2651         Test: editing/inserting/6633727.html
2652
2653         This changes does a few things:
2654         1) Renames pos to insertionPosition.
2655         2) Eliminates "startNode".  It doesn't work well to consider the node separately from the insertionPosition.  
2656            The insertionPosition gets updated at various times, and it seems likely that startNode can get out of sync.
2657         3) Before building up a list of ancestors to move around when we insert the new block, make sure to use the deepest
2658            representation of the insertionPosition, so all ancestor nodes are correctly included.
2659
2660         * editing/InsertParagraphSeparatorCommand.cpp: (WebCore::InsertParagraphSeparatorCommand::doApply):
2661
2662 2009-03-17  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
2663
2664         Reviewed by Kevin Ollivier.
2665
2666         https://bugs.webkit.org/show_bug.cgi?id=24115
2667         Introduce platform independent stubs for plugins.
2668
2669         * plugins/PluginDataNone.cpp: Copied from WebCore/plugins/wx/PluginDataWx.cpp.
2670         * plugins/PluginPackageNone.cpp: Copied from WebCore/plugins/wx/PluginPackageWx.cpp.
2671         * plugins/PluginViewNone.cpp: Copied from WebCore/plugins/wx/PluginViewWx.cpp.
2672         * plugins/wx/PluginDataWx.cpp: Removed.
2673         * plugins/wx/PluginPackageWx.cpp: Removed.
2674         * plugins/wx/PluginViewWx.cpp: Removed.
2675         * webcore-wx.bkl:
2676
2677 2009-03-17  Darin Adler  <darin@apple.com>
2678
2679         Earlier version reviewed by Adele Peterson.
2680
2681         Bug 24304: REGRESSION (r39864): Hitting the space bar to select an <input type=radio>
2682         or push an <input type=button> or <button> causes the page to scroll down.
2683
2684         Would be best to add a regression test for Windows eventually; tested that this has
2685         no effect on the Mac OS X platform.
2686
2687         * html/HTMLInputElement.cpp:
2688         (WebCore::HTMLInputElement::defaultEventHandler): Added FIXMEs and tweaked formatting.
2689         Use the code that calls the base class's defaultEventHandler early only in the cases
2690         where it's needed: keydown and keypress events in text fields. In other cases, do the
2691         more typical thing and call the default handler only at the end of the function.
2692         This function already had code to make sure the keypress event for space never gets
2693         through, but it was running too late since the scrolling code was moved into the
2694         base class default event handler.
2695
2696 2009-03-17  Simon Fraser  <simon.fraser@apple.com>
2697
2698         Reviewed by Dave Hyatt
2699
2700         https://bugs.webkit.org/show_bug.cgi?id=24632
2701
2702         Fix repaint issues when composited layers come and go (only applies
2703         when ACCELERATED_COMPOSITING is turned on).
2704         
2705         * rendering/RenderLayer.cpp:
2706         (WebCore::RenderLayer::RenderLayer):
2707         * rendering/RenderLayer.h:
2708         (WebCore::RenderLayer::mustOverlayCompositedLayers):
2709         (WebCore::RenderLayer::setMustOverlayCompositedLayers):
2710         * rendering/RenderLayerBacking.cpp:
2711         (WebCore::RenderLayerBacking::RenderLayerBacking):
2712         * rendering/RenderLayerBacking.h:
2713
2714         Move what used to be the 'forceCompositingLayer' flag from RenderLayerBacking
2715         to RenderLayer, because we don't want the side-effects of creating RenderLayerBacking
2716         when setting this flag.
2717         
2718         * rendering/RenderLayerCompositor.cpp:
2719         (WebCore::RenderLayerCompositor::updateLayerCompositingState):
2720         When a RenderLayer flips into or out of compositing mode, compute a repaint
2721         rect relative to the containerForRepaint, and repaint it.
2722         
2723         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2724         Call layer->setMustOverlayCompositedLayers() rather than setForcedCompositingLayer().
2725         
2726         (WebCore::RenderLayerCompositor::needsToBeComposited):
2727         (WebCore::RenderLayerCompositor::requiresCompositingLayer):
2728         (WebCore::RenderLayerCompositor::requiresCompositingForTransform):
2729         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation):
2730         * rendering/RenderLayerCompositor.h:
2731         
2732         Rename requiresCompositingLayerForTransform() to requiresCompositingForTransform()
2733         and make it a class static method to match requiresCompositingForAnimation(). Both
2734         now take RenderObjects, rathern than RenderLayers.
2735         
2736         * rendering/style/RenderStyle.h:
2737         (WebCore::InheritedFlags::hasTransformRelatedProperty):
2738         Minor tidyup using convenience methods added in an earlier commit.
2739
2740 2009-03-17  Simon Fraser  <simon.fraser@apple.com>
2741
2742         Reviewed by Darin Adler
2743
2744         https://bugs.webkit.org/show_bug.cgi?id=24396
2745
2746         * config.h:
2747         Add WTF_USE_ACCELERATED_COMPOSITING, defined to 0 for now, and add some
2748         comments to make the #ifdefs more readable.
2749
2750         * css/CSSComputedStyleDeclaration.cpp:
2751         (WebCore::computedTransform):
2752         Add a comment to mention that we don't flatten the matrix.
2753         
2754         * css/MediaQueryEvaluator.cpp:
2755         (WebCore::transform_3dMediaFeatureEval):
2756         Have the 'transform-3d' media query evaluate to 'true' if 3d-rendering
2757         is supported.
2758         
2759         * platform/graphics/mac/GraphicsLayerCA.mm:
2760         (WebCore::GraphicsLayerCA::animateTransform):
2761         No need for the #ifdef here. If we don't support 3d, we will have already flattened
2762         the matrix.
2763         
2764         * platform/graphics/transforms/TransformationMatrix.cpp:
2765         (WebCore::TransformationMatrix::makeAffine):
2766         * platform/graphics/transforms/TransformationMatrix.h:
2767         New method to convert the matrix to an affine matrix by throwing a way the non-affine
2768         parts.
2769         
2770         * rendering/RenderLayer.cpp:
2771         (WebCore::RenderLayer::updateTransform):
2772         (WebCore::RenderLayer::currentTransform):
2773         * rendering/RenderLayerBacking.cpp:
2774         (WebCore::RenderLayerBacking::updateLayerTransform):
2775         If 3d rendering is not supported, convert the matrix to an affine matrix
2776         which can be rendered, and used for hit testing.
2777         
2778         * rendering/RenderLayerCompositor.cpp:
2779         Change the name of the exported symbol that webkitdirs.pm uses to know if
2780         3d rendering is supported. There is no other 3d-rendering-specific symbol we can sniff.
2781         
2782         * rendering/RenderObject.cpp:
2783         (WebCore::RenderObject::transformFromContainer):
2784         Only take perspective into account if 3d rendering is supported.
2785
2786         * rendering/RenderObject.h:
2787         (WebCore::makeMatrixRenderable):
2788         Utility method that flattens a matrix if 3d rendering is not supported.
2789
2790 2009-03-17  Kevin Ollivier  <kevino@theolliviers.com>
2791
2792         wx build fix. Fix typo after mouse wheel changes.
2793
2794         * platform/wx/MouseWheelEventWx.cpp:
2795         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
2796
2797 2009-03-17  Darin Adler  <darin@apple.com>
2798
2799         * inspector/ConsoleMessage.cpp:
2800         (WebCore::ConsoleMessage::isEqual): Fix build, remove stray parenthesis.
2801
2802 2009-03-17  Darin Adler  <darin@apple.com>
2803
2804         Fix crash seen right away when running run-webkit-tests.
2805
2806         * inspector/ConsoleMessage.cpp:
2807         (WebCore::ConsoleMessage::isEqual): Restore assertion to its behavior pre-refactoring.
2808         Also tweaked formatting a bit.
2809
2810 2009-03-17  Alexey Proskuryakov  <ap@webkit.org>
2811
2812         Reviewed by Darin Adler.
2813
2814         HTMLSelectElement::add() doesn't look at exception code returned from insertBefore(), so 
2815         it doesn't need to zero it out before calling.
2816
2817         * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): Removed "ec = 0" line.
2818
2819 2009-03-17  Dan Bernstein  <mitz@apple.com>
2820
2821         Reviewed by Adam Roben.
2822
2823         - WebCore part of adding a mechanism for controlling the caching of
2824           responses through WebFrameLoaderClient
2825
2826         Mac already has such a mechanism, and this adds one for CFNetwork ports.
2827
2828         * WebCore.vcproj/WebCore.vcproj: Added EmptyClients.h
2829         and ResourceLoaderCFNet.cpp.
2830
2831         * loader/EmptyClients.h:
2832         (WebCore::EmptyFrameLoaderClient::shouldCacheResponse): Added an
2833         implementation that always returns true.
2834
2835         * loader/FrameLoaderClient.h: Declared shouldCacheResponse().
2836
2837         * loader/ResourceLoader.h: Ditto.
2838
2839         * loader/cf/ResourceLoaderCFNet.cpp: Added.
2840         (WebCore::ResourceLoader::shouldCacheResponse): Added. Calls through to
2841         FrameLoaderClient::shouldCacheResponse().
2842
2843         * platform/network/ResourceHandleClient.h:
2844         (WebCore::ResourceHandleClient::shouldCacheResponse): Added an
2845         implementation that always returns true.
2846
2847         * platform/network/cf/ResourceHandleCFNet.cpp:
2848         (WebCore::willCacheResponse): Added a call to
2849         ResourceHandleClient::shouldCacheResponse(). If the client returns
2850         false, return 0, which will prevent CFNetwork from caching the response.
2851
2852 2009-03-17  Alexey Proskuryakov  <ap@webkit.org>
2853
2854         Reviewed by Darin Adler.
2855
2856         https://bugs.webkit.org/show_bug.cgi?id=13287
2857         Cannot change SELECT to a dynamically created option
2858
2859         Tests: fast/forms/add-and-remove-option.html
2860                fast/forms/add-remove-option-modification-event.html
2861                fast/forms/add-selected-option.html
2862                fast/forms/select-cache-desynchronization.html
2863
2864         * dom/ContainerNode.cpp:
2865         (WebCore::dispatchChildInsertionEvents): Increment DOM tree version. This will happen when
2866         dispatching DOMSubtreeModified again, but the version should be incremented for event
2867         listeners to have an up to date view of the DOM.
2868         (WebCore::dispatchChildRemovalEvents): Ditto.
2869
2870         * html/HTMLOptionElement.cpp: (WebCore::HTMLOptionElement::insertedIntoTree):
2871         Make sure that the select element knows about its new selected option.
2872
2873         * html/HTMLOptionElement.h: Use insertedIntoTree() instead of insertedIntoDocument(),
2874         because DOM also needs to be updated for forms that are not in document yet. Similar
2875         problems exist for node removing, but removedFromTree() is called at a wrong time, so
2876         those problems cannot be fixed without deeper refactoring.
2877
2878         * html/HTMLSelectElement.cpp:
2879         (WebCore::HTMLSelectElement::setRecalcListItems): Reset m_activeSelectionAnchorIndex - it
2880         doesn't make sense to keep the anchor after programmatically changing the selection, and
2881         keeping it was causing a failure in fast/forms/listbox-selection.html.
2882
2883         * html/HTMLSelectElement.h: Removed overrides for ContainerNode methods that only called
2884         base class versions.
2885
2886 2009-03-17  Steve Falkenburg  <sfalken@apple.com>
2887
2888         <rdar://problem/6690324> Accessing FTP sites reads unallocated memory, can result in garbled entries or crashes
2889         
2890         Reviewed by Darin Adler.
2891
2892         * loader/FTPDirectoryDocument.cpp:
2893         (WebCore::FTPDirectoryTokenizer::parseAndAppendOneLine): Assign CString to a local while we hold pointers into it.
2894
2895 2009-03-16  David Hyatt  <hyatt@apple.com>
2896
2897         <rdar://problem/6648411> REGRESSION: Layout of page is wrong at http://www.popcap.com/
2898
2899         Make sure that the initial shouldPaint check that looks at enclosingLayers properly skips over
2900         layers that don't paint themselves.  This is done by adding a new enclosingSelfPaintingLayer method
2901         so that RenderObjects can walk up the enclosing layer chain and skip any layers that don't paint
2902         themselves.
2903
2904         Reviewed by Darin Adler.
2905
2906         Added fast/block/float/overlapping-floats-with-overflow-hidden.html
2907
2908         * WebCore.base.exp:
2909         * rendering/RenderBlock.cpp:
2910         (WebCore::RenderBlock::addOverhangingFloats):
2911         * rendering/RenderObject.cpp:
2912         (WebCore::RenderObject::enclosingSelfPaintingLayer):
2913         * rendering/RenderObject.h:
2914
2915 2009-03-17  Xan Lopez  <xlopez@igalia.com>
2916
2917         Reviewed by Holger Freyther.
2918
2919         https://bugs.webkit.org/show_bug.cgi?id=24592
2920         [GTK] Crash in FcPatternHash
2921
2922         Style fixes.
2923
2924         * platform/graphics/gtk/FontPlatformDataGtk.cpp:
2925         (WebCore::FontPlatformData::operator=):
2926         * platform/graphics/gtk/FontPlatformDataPango.cpp:
2927
2928 2009-03-17  Xan Lopez  <xlopez@igalia.com>
2929
2930         Reviewed by Holger Freyther.
2931
2932         https://bugs.webkit.org/show_bug.cgi?id=24592
2933         [GTK] Crash in FcPatternHash
2934
2935         Sanitize memory management in pango fonts.
2936
2937         Release memory allocated by FontPlatformDataPango in its own
2938         destructor instead of doing it from other classes, and add copy
2939         constructor and '=' operator to be able to track referenced
2940         objects properly.
2941
2942         * platform/graphics/gtk/FontPlatformDataPango.cpp:
2943         (WebCore::FontPlatformData::~FontPlatformData):
2944         (WebCore::FontPlatformData::operator=):
2945         (WebCore::FontPlatformData::FontPlatformData):
2946         * platform/graphics/gtk/SimpleFontDataPango.cpp:
2947
2948 2009-03-17  Darin Adler  <darin@apple.com>
2949
2950         Reviewed by Alexey Proskuryakov.
2951
2952         Bug 24624: Crash in imageLoadEventTimerFired after adoptNode used on <img>,
2953         seen with inspector, which uses adoptNode
2954         https://bugs.webkit.org/show_bug.cgi?id=24624
2955         rdar://problem/6422850
2956
2957         Test: fast/dom/HTMLImageElement/image-load-cross-document.html
2958
2959         * dom/Document.cpp:
2960         (WebCore::Document::Document): Removed m_imageLoadEventTimer.
2961         (WebCore::Document::detach): Removed m_imageLoadEventDispatchSoonList and
2962         m_imageLoadEventDispatchingList.
2963         (WebCore::Document::implicitClose): Called ImageLoader::dispatchPendingLoadEvents
2964         instead of dispatchImageLoadEventsNow.
2965
2966         * dom/Document.h: Removed ImageLoader, dispatchImageLoadEventSoon,
2967         dispatchImageLoadEventsNow, removeImage, m_imageLoadEventDispatchSoonList,
2968         m_imageLoadEventDispatchingList, m_imageLoadEventTimer, and imageLoadEventTimerFired.
2969
2970         * loader/ImageLoader.cpp:
2971         (WebCore::loadEventSender): Added. Returns the single global ImageLoadEventSender
2972         object used privately as the target of the load event timer.
2973         (WebCore::ImageLoader::~ImageLoader): Call ImageLoadEventSender::cancelLoadEvent
2974         rather than Document::removeImage.
2975         (WebCore::ImageLoader::setImage): Use m_element directly, not element().
2976         (WebCore::ImageLoader::updateFromElement): Ditto. Also name the local variable
2977         document instead of doc.
2978         (WebCore::ImageLoader::notifyFinished): Call ImageLoadEventSender::dispatchLoadEventSoon
2979         rather than Document::dispatchImageLoadEventSoon.
2980         (WebCore::ImageLoader::dispatchPendingLoadEvent): Added. Handles the common logic
2981         about when load events can be dispatched so that dispatchLoadEvent only has to
2982         have the specific part for each derived class. This includes a check that the
2983         document is attached, which used to be handled by having documents empty out the
2984         image load event vectors in the detach function.
2985         (WebCore::ImageLoader::dispatchPendingLoadEvents): Added. Calls the appropriate
2986         function on the ImageLoadEventSender, which avoids the need to have that class be
2987         public in the ImageLoader header.
2988         (WebCore::ImageLoadEventSender::ImageLoadEventSender): Added. Has the code that
2989         was previously in the Document constructor.
2990         (WebCore::ImageLoadEventSender::dispatchLoadEventSoon): Added. Has the code that
2991         was previously in Document::dispatchImageLoadEventSoon.
2992         (WebCore::ImageLoadEventSender::cancelLoadEvent): Added. Has the code that was
2993         previously in Document::removeImage.
2994         (WebCore::ImageLoadEventSender::dispatchPendingLoadEvents): Added. Has the code
2995         that was previously in Document::dispatchImageLoadEventsNow.
2996         (WebCore::ImageLoadEventSender::timerFired): Added. Calls dispatchPendingLoadEvents.
2997
2998         * loader/ImageLoader.h: Improved comments. Made the virtual functions private
2999         or protected rather than public. Added static dispatchPendingLoadEvents function
3000         for use by Document and private dispatchPendingLoadEvent function for use by
3001         ImageLoadEventSender. Made setLoadingImage private and eliminated
3002         setHaveFiredLoadEvent since that can all be done inside the class without any
3003         member functions.
3004
3005         * html/HTMLImageLoader.cpp:
3006         (WebCore::HTMLImageLoader::dispatchLoadEvent): Removed logic to check whether a
3007         load event already fired and whether image() is 0. These are now both base class
3008         responsibilities.
3009         * svg/SVGImageLoader.cpp:
3010         (WebCore::SVGImageLoader::dispatchLoadEvent): Ditto.
3011         * wml/WMLImageLoader.cpp:
3012         (WebCore::WMLImageLoader::dispatchLoadEvent): Ditto.
3013
3014 2009-03-17  Dimitri Glazkov  <dglazkov@chromium.org>
3015
3016         Reviewed by Timothy Hatcher.
3017
3018         https://bugs.webkit.org/show_bug.cgi?id=24623
3019         Refactor ConsoleMessage to use ScriptFuncitonCall and eliminate JSC
3020         dependencies.
3021
3022         * bindings/js/ScriptFunctionCall.cpp:
3023         (WebCore::ScriptFunctionCall::appendArgument): Added uint and ScriptString-taking methods.
3024         * bindings/js/ScriptFunctionCall.h:
3025         * bindings/js/ScriptObjectQuarantine.cpp:
3026         (WebCore::quarantineValue): Added generic ScriptValue quarantine helper.
3027         * bindings/js/ScriptObjectQuarantine.h:
3028         * bindings/js/ScriptValue.cpp:
3029         (WebCore::ScriptValue::isEqual): Added.
3030         * bindings/js/ScriptValue.h:
3031         * inspector/ConsoleMessage.cpp:
3032         (WebCore::ConsoleMessage::ConsoleMessage):
3033         (WebCore::ConsoleMessage::addToConsole): Added.
3034         (WebCore::ConsoleMessage::isEqual): Changed to use ScriptValue::isEqual.
3035         * inspector/ConsoleMessage.h:
3036         (WebCore::ConsoleMessage::incrementCount): Added.
3037         * inspector/InspectorController.cpp:
3038         (WebCore::InspectorController::addConsoleMessage): Changed to use ConsoleMessage::addToConsole.
3039         (WebCore::InspectorController::populateScriptObjects): Ditto.
3040         * inspector/InspectorController.h:
3041
3042 2009-03-17  Kevin Ollivier  <kevino@theolliviers.com>
3043
3044         Reviewed by Mark Rowe.
3045
3046         Get BUILDING_ON_* defines from Platform.h.
3047         
3048         https://bugs.webkit.org/show_bug.cgi?id=24630
3049
3050         * WebCorePrefix.h:
3051
3052 2009-03-16  Xan Lopez  <xlopez@igalia.com>
3053
3054         Reviewed by Holger Freyther.
3055
3056         https://bugs.webkit.org/show_bug.cgi?id=24592
3057         [GTK] Crash in FcPatternHash
3058
3059         Sanitize memory management in gtk fonts.
3060
3061         Release memory allocated by FontPlatformDataGtk in its own
3062         destructor instead of doing it from other classes, and add copy
3063         constructor and '=' operator to be able to track referenced
3064         objects properly.
3065
3066         * platform/graphics/gtk/FontPlatformData.h:
3067         * platform/graphics/gtk/FontPlatformDataGtk.cpp:
3068         (WebCore::FontPlatformData::operator=):
3069         (WebCore::FontPlatformData::FontPlatformData):
3070         (WebCore::FontPlatformData::~FontPlatformData):
3071         * platform/graphics/gtk/SimpleFontDataGtk.cpp:
3072         (WebCore::SimpleFontData::platformDestroy):
3073
3074 2009-03-17  Ariya Hidayat  <ariya.hidayat@nokia.com>
3075
3076         Build fix for Qt < 4.5.
3077
3078         As reported by Yael Aharon  <yael.aharon@nokia.com>
3079
3080         * platform/graphics/qt/GraphicsContextQt.cpp:
3081         (WebCore::GraphicsContext::drawLine):
3082
3083 2009-03-17  Alexey Proskuryakov  <ap@webkit.org>
3084
3085         Reviewed by Sam Weinig.
3086
3087         https://bugs.webkit.org/show_bug.cgi?id=24614
3088         Access control checks are different in cached and uncached cases
3089
3090         Test: http/tests/xmlhttprequest/access-control-basic-non-simple-deny-cached.html
3091
3092         * loader/CrossOriginAccessControl.cpp:
3093         (WebCore::isOnAccessControlSimpleRequestMethodWhitelist): Factored out simple method
3094         check for use in both cached and uncached cases. In cached case, an old definition that
3095         omitted HEAD was still used.
3096         (WebCore::isOnAccessControlSimpleRequestHeaderWhitelist): Check that content type has an
3097         allowed value. This is needed in all call sites. Also changed to compare MIME type, not
3098         content type.
3099         (WebCore::isSimpleCrossOriginAccessRequest): Use the above methods.
3100
3101         * loader/CrossOriginAccessControl.h: Expose isOnAccessControlSimpleRequestMethodWhitelist.
3102
3103         * loader/CrossOriginPreflightResultCache.cpp:
3104         (WebCore::CrossOriginPreflightResultCacheItem::allowsCrossOriginMethod):
3105         (WebCore::CrossOriginPreflightResultCacheItem::allowsCrossOriginHeaders):
3106         Use the new checks for simple method and header.
3107
3108 2009-03-16  Gustavo Noronha Silva  <gns@gnome.org> and Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
3109
3110         Reviewed by Mark Rowe.
3111
3112         https://bugs.webkit.org/show_bug.cgi?id=24638
3113         [GTK] HTML5 media tags do not work
3114
3115         Add a repaint-requested signal to the video sink, and use it to
3116         call MediaPlayerPrivate::repaint, so that the video actually
3117         plays.
3118
3119         * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
3120         (WebCore::mediaPlayerPrivateRepaintCallback):
3121         (WebCore::MediaPlayerPrivate::createGSTPlayBin):
3122         * platform/graphics/gtk/VideoSinkGStreamer.cpp:
3123         (webkit_video_sink_idle_func):
3124         (webkit_video_sink_render):
3125         (webkit_video_sink_class_init):
3126
3127 2009-03-16  Gustavo Noronha Silva  <gns@gnome.org> and Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
3128
3129         Reviewed by Holger Freyther.
3130
3131         https://bugs.webkit.org/show_bug.cgi?id=24638
3132         [GTK] HTML5 media tags do not work
3133
3134         Work-around the fact that gst_element_query_duration returns true even
3135         though it is unable to figure out the duration when in stream (push)
3136         mode.
3137
3138         * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
3139         (WebCore::MediaPlayerPrivate::duration):
3140
3141 2009-03-16  Darin Adler  <darin@apple.com>
3142
3143         Reviewed by Kevin Decker.
3144
3145         <rdar://problem/6642742> Top Sites malfunction when switching text zoom mode
3146
3147         * page/Frame.cpp:
3148         (WebCore::Frame::setNeedsReapplyStyles): Don’t do anything if the frame is
3149         currently showing a non-HTML view.
3150
3151 2009-03-16  Darin Adler  <darin@apple.com>
3152
3153         Reviewed by Adele Peterson.
3154
3155         Bug 24629: moving forward or backward a paragraph fails at edge of document
3156         https://bugs.webkit.org/show_bug.cgi?id=24629
3157         rdar://problem/6544413
3158
3159         Test: editing/selection/move-paragraph-document-edges.html
3160
3161         * editing/visible_units.cpp:
3162         (WebCore::previousParagraphPosition): Use the last result from
3163         previousLinePosition rather than going all the way back to what was originally
3164         passed in when we hit exception cases like null or not moving. This correctly
3165         inherits the behavior of previousLinePosition when we are in a paragraph at the
3166         edge of a document.
3167         (WebCore::nextParagraphPosition): Ditto.
3168
3169 2009-03-16  Darin Adler  <darin@apple.com>
3170
3171         Reviewed by Adele Peterson.
3172
3173         Bug 24619: RenderObject::selectionStartEnd does not need to be a virtual function
3174         https://bugs.webkit.org/show_bug.cgi?id=24619
3175
3176         * rendering/RenderObject.h: Remove virtual keyword from selectionStartEnd declaration.
3177         * rendering/RenderView.h: Ditto.
3178
3179 2009-03-16  Peter Kasting  <pkasting@google.com>
3180
3181         Reviewed by David Hyatt.
3182
3183         https://bugs.webkit.org/show_bug.cgi?id=24368
3184         DOM scroll events should be based off the actual number of wheel
3185         ticks, not off the number of lines scrolled.  This matches IE.
3186
3187         * dom/Node.cpp:
3188         (WebCore::Node::dispatchWheelEvent):
3189         * dom/WheelEvent.cpp:
3190         (WebCore::WheelEvent::WheelEvent):
3191         * dom/WheelEvent.h:
3192         (WebCore::WheelEvent::create):
3193         * platform/PlatformWheelEvent.h:
3194         (WebCore::PlatformWheelEvent::wheelTicksX):
3195         (WebCore::PlatformWheelEvent::wheelTicksY):
3196         * platform/gtk/WheelEventGtk.cpp:
3197         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
3198         * platform/mac/WheelEventMac.mm:
3199         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
3200         * platform/qt/WheelEventQt.cpp:
3201         * platform/win/WheelEventWin.cpp:
3202         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
3203         * platform/wx/MouseWheelEventWx.cpp:
3204         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
3205
3206 2009-03-16  Simon Fraser  <simon.fraser@apple.com>
3207
3208         Reviewed by Eric Seidel
3209         
3210         Clean up a few issues in the Animation code:
3211
3212         * page/animation/AnimationBase.cpp:
3213         (WebCore::AnimationBase::updateStateMachine):
3214         Whitespace
3215         
3216         (WebCore::AnimationBase::willNeedService):
3217         Don't round to float, use std::max
3218
3219         * page/animation/AnimationController.cpp:
3220         (WebCore::AnimationControllerPrivate::startTimeResponse):
3221         Fix erroneously copied line to null out m_lastResponseWaiter.
3222
3223 2009-03-12  David Hyatt  <hyatt@apple.com>
3224
3225         Reviewed by Eric Seidel
3226
3227         https://bugs.webkit.org/show_bug.cgi?id=13632
3228
3229         Overflow scrolling needs to account for the bottom/right padding on the object itself as well
3230         as for bottom/right margins on children.
3231
3232         Existing tests cover this.
3233
3234         * rendering/RenderBlock.cpp:
3235         (WebCore::RenderBlock::lowestPosition):
3236         (WebCore::RenderBlock::rightmostPosition):
3237
3238 2009-03-16  Sam Weinig  <sam@webkit.org>
3239
3240         Reviewed by Anders Carlsson.
3241
3242         Fix for <rdar://problem/6320555>
3243         Add an upper limit for setting HTMLSelectElement.length.
3244
3245         Test: fast/forms/select-max-length.html
3246
3247         * html/HTMLSelectElement.cpp:
3248         (WebCore::HTMLSelectElement::setOption):
3249         (WebCore::HTMLSelectElement::setLength):
3250
3251 2009-03-16  Eric Carlson  <eric.carlson@apple.com>
3252
3253         Reviewed by Simon Fraser.
3254
3255         <rdar://problem/6686721> Media document crash in 64-bit WebKit
3256
3257         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3258         (WebCore::MediaPlayerPrivate::createQTMovieView): QTMovieContentViewClass is only used when
3259         rendering inline with old versions of QuickTime, so don't look for it when we are in a 
3260         media document.
3261
3262 2009-03-16  Dimitri Glazkov  <dglazkov@chromium.org>
3263
3264         Reviewed by Timothy Hatcher.
3265
3266         https://bugs.webkit.org/show_bug.cgi?id=24590
3267         Refactor InspectorDOMStorageResource to use ScriptFunctionCall.
3268
3269         * bindings/js/ScriptFunctionCall.cpp:
3270         (WebCore::ScriptFunctionCall::appendArgument): Added method for bool argument.
3271         * bindings/js/ScriptFunctionCall.h: Ditto, also cleaned up.
3272         * bindings/js/ScriptObjectQuarantine.cpp:
3273         (WebCore::getQuarantinedScriptObject): Added Storage helper.
3274         * bindings/js/ScriptObjectQuarantine.h: Ditto.
3275         * inspector/InspectorController.cpp:
3276         (WebCore::InspectorController::populateScriptObjects): Changed to use bind method.
3277         (WebCore::InspectorController::resetScriptObjects): Changed to use unbind method.
3278         (WebCore::InspectorController::didUseDOMStorage): Changed to use isSameHostAndType and bind methods.
3279         * inspector/InspectorController.h: Removed add/remove methods for DOM storage.
3280         * inspector/InspectorDOMStorageResource.cpp:
3281         (WebCore::InspectorDOMStorageResource::InspectorDOMStorageResource):
3282         (WebCore::InspectorDOMStorageResource::isSameHostAndType): Added.
3283         (WebCore::InspectorDOMStorageResource::bind): Added.
3284         (WebCore::InspectorDOMStorageResource::unbind): Added.
3285         * inspector/InspectorDOMStorageResource.h:
3286
3287 2009-03-16   Mike Belshe  <mike@belse.com>
3288
3289         Reviewed by Dimitri Glazkov.
3290
3291         https://bugs.webkit.org/show_bug.cgi?id=24580
3292         Fix query() to match KURL behavior, this time with the code that
3293         compiles.
3294
3295         * platform/KURLGoogle.cpp:
3296         (WebCore::KURL::query): Fix copy/paste mistake.
3297
3298 2009-03-16  Alexey Proskuryakov  <ap@webkit.org>
3299
3300         Reviewed by Darin Adler.
3301
3302         https://bugs.webkit.org/show_bug.cgi?id=21752
3303         REGRESSION: referencing XHR constructor for a not yet loaded frame permanently breaks it
3304
3305         Test: fast/dom/Window/window-early-properties-xhr.html
3306
3307         For some transitions, the Window object is not replaced, but Document is. When this happened,
3308         window.document property was updated, but references to Document kept in cached constructors
3309         were not.
3310
3311         * bindings/js/JSAudioConstructor.cpp:
3312         (WebCore::JSAudioConstructor::JSAudioConstructor):
3313         (WebCore::JSAudioConstructor::document):
3314         (WebCore::JSAudioConstructor::mark):
3315         * bindings/js/JSAudioConstructor.h:
3316         * bindings/js/JSImageConstructor.cpp:
3317         (WebCore::JSImageConstructor::JSImageConstructor):
3318         (WebCore::JSImageConstructor::document):
3319         (WebCore::JSImageConstructor::mark):
3320         * bindings/js/JSImageConstructor.h:
3321         * bindings/js/JSMessageChannelConstructor.cpp:
3322         (WebCore::JSMessageChannelConstructor::JSMessageChannelConstructor):
3323         (WebCore::JSMessageChannelConstructor::scriptExecutionContext):
3324         (WebCore::JSMessageChannelConstructor::mark):
3325         * bindings/js/JSMessageChannelConstructor.h:
3326         * bindings/js/JSOptionConstructor.cpp:
3327         (WebCore::JSOptionConstructor::JSOptionConstructor):
3328         (WebCore::JSOptionConstructor::document):
3329         (WebCore::JSOptionConstructor::mark):
3330         * bindings/js/JSOptionConstructor.h:
3331         * bindings/js/JSXMLHttpRequestConstructor.cpp:
3332         (WebCore::JSXMLHttpRequestConstructor::JSXMLHttpRequestConstructor):
3333         (WebCore::JSXMLHttpRequestConstructor::scriptExecutionContext):
3334         (WebCore::JSXMLHttpRequestConstructor::mark):
3335         * bindings/js/JSXMLHttpRequestConstructor.h:
3336         Changed cached constructors to keep a reference to Window, not Document.
3337
3338 2009-03-15  Alexey Proskuryakov  <ap@webkit.org>
3339
3340         Reviewed by Darin Adler.
3341
3342         https://bugs.webkit.org/show_bug.cgi?id=24549
3343         Impose a limit on Access-Control-Max-Age value
3344
3345         * loader/CrossOriginPreflightResultCache.cpp:
3346         (WebCore::CrossOriginPreflightResultCacheItem::parse):
3347
3348 2009-03-15  Greg Bolsinga  <bolsinga@apple.com>
3349
3350         Reviewed by David Kilzer.
3351
3352         <rdar://problem/6668875> Normalize Geolocation results
3353
3354         * platform/mac/GeolocationServiceMac.mm:
3355         (-[WebCoreCoreLocationObserver locationManager:didUpdateToLocation:fromLocation:]):
3356
3357 2009-03-15  Greg Bolsinga  <bolsinga@apple.com>
3358
3359         Reviewed by David Kilzer.
3360
3361         Update ::toString format as suggested by Darin Adler.
3362
3363         * page/Geoposition.cpp:
3364         (WebCore::Geoposition::toString):
3365
3366 2009-03-15  David Kilzer  <ddkilzer@apple.com>
3367
3368         <rdar://problem/6668238> WebCore is registering text encodings needlessly from KURL constructor.
3369
3370         Reviewed by Darin Adler.
3371
3372         Yet another case where we would trigger extended encoding loading needlessly.
3373
3374         * platform/text/TextEncoding.cpp:
3375         (WebCore::TextEncoding::encodingForFormSubmission):
3376
3377 2009-03-15  Simon Fraser  <simon.fraser@apple.com>
3378
3379         Build fix: no review.
3380
3381         * rendering/style/ContentData.h:
3382
3383 2009-03-15  David Kilzer  <ddkilzer@apple.com>
3384
3385         Bug 24542: Improve ContentData encapsulation
3386
3387         <https://bugs.webkit.org/show_bug.cgi?id=24542>
3388
3389         Reviewed by Simon Fraser.
3390
3391         No tests since there is no change in behavior.
3392
3393         * rendering/RenderObject.cpp:
3394         (WebCore::RenderObject::createObject): Used getter methods
3395         instead of data members on ContentData class.  Used isImage()
3396         convenience method.
3397         * rendering/RenderObjectChildList.cpp:
3398         (WebCore::RenderObjectChildList::updateBeforeAfterContent): Ditto.
3399
3400         * rendering/style/ContentData.cpp:
3401         (WebCore::ContentData::clear): Extracted code into
3402         deleteContent() method.
3403         (WebCore::ContentData::dataEquivalent): Added.  Extracted code
3404         from StyleRareNonInheritedData::contentDataEquivalent().
3405         (WebCore::ContentData::deleteContent): Added.  Used by setter
3406         methods.
3407         * rendering/style/ContentData.h: Made m_type, m_content and
3408         m_next private.
3409         (WebCore::ContentData::isCounter): Added.
3410         (WebCore::ContentData::isImage): Added.
3411         (WebCore::ContentData::isNone): Added.
3412         (WebCore::ContentData::isText): Added.
3413         (WebCore::ContentData::type): Added.
3414         (WebCore::ContentData::dataEquivalent): Added.
3415         (WebCore::ContentData::image): Added.
3416         (WebCore::ContentData::setImage): Added.
3417         (WebCore::ContentData::text): Added.
3418         (WebCore::ContentData::setText): Added.
3419         (WebCore::ContentData::counter): Added.
3420         (WebCore::ContentData::setCounter): Added.
3421         (WebCore::ContentData::next): Added.
3422         (WebCore::ContentData::setNext): Added.
3423
3424         * rendering/style/CounterContent.h:
3425         (WebCore::operator!=): Removed.
3426         (WebCore::operator==): Renamed operator!=() and reversed its
3427         logic after extracting code from
3428         StyleRareNonInheritedData::contentDataEquivalent() to create
3429         ContentData::dataEquivalent().
3430
3431         * rendering/style/RenderStyle.cpp:
3432         (WebCore::RenderStyle::setContent): Used new getters and setters
3433         on ContentData class.  Changed first argument from a StringImpl*
3434         to a PassRefPtr<StrimgImpl>.  Used isText() convenience method.
3435         * rendering/style/RenderStyle.h:
3436         (WebCore::RenderStyle::setContent): Updated declaration.
3437         * rendering/style/StyleRareNonInheritedData.cpp:
3438         (WebCore::StyleRareNonInheritedData::contentDataEquivalent):
3439         Extracted most logic in while() loop into
3440         ContentData::dataEquivalent().
3441
3442 2009-03-15  Gustavo Noronha Silva  <gns@gnome.org>
3443
3444         Reviewed by Anders Carlsson.
3445
3446         https://bugs.webkit.org/show_bug.cgi?id=24602
3447         [Gtk] Searching in thepiratebay.org doesn't work with more than 1 word
3448
3449         Reintroduce the URI into the soup message after having set it in
3450         the KURL, on redirects, to make sure it is properly encoded. This
3451         fixes bad request problems when servers give bad URIs on their
3452         response's Location header.
3453
3454         * platform/network/soup/ResourceHandleSoup.cpp:
3455         (WebCore::restartedCallback):
3456
3457 2009-03-15  Alexey Proskuryakov  <ap@webkit.org>
3458
3459         Reviewed by Darin Adler.
3460
3461         https://bugs.webkit.org/show_bug.cgi?id=19737
3462         No cursor and paste not enabled right clicking text field/area
3463
3464         Test: fast/events/right-click-focus.html
3465
3466         * page/EventHandler.cpp:
3467         (WebCore::EventHandler::handleMousePressEventSingleClick):
3468         (WebCore::EventHandler::handleMousePressEvent):
3469         Take normal code path for right clicks (we were taking it for Ctrl-clicks anyway).
3470
3471 2009-03-15  Alexey Proskuryakov  <ap@webkit.org>
3472
3473         Reviewed by Adele Peterson.
3474
3475         https://bugs.webkit.org/show_bug.cgi?id=23949
3476         HTMLSelectElement is in inconsistent state when handling mutation events
3477
3478         Test: fast/forms/mutation-event-recalc.html
3479
3480         * dom/ContainerNode.cpp:
3481         (WebCore::ContainerNode::insertBefore):
3482         (WebCore::ContainerNode::appendChild):
3483         Call childrenChanged() before dispatching modification events, not after.
3484
3485         * html/HTMLOptGroupElement.cpp:
3486         (WebCore::HTMLOptGroupElement::insertBefore):
3487         (WebCore::HTMLOptGroupElement::replaceChild):
3488         (WebCore::HTMLOptGroupElement::removeChild):
3489         (WebCore::HTMLOptGroupElement::appendChild):
3490         (WebCore::HTMLOptGroupElement::removeChildren):
3491         * html/HTMLSelectElement.cpp:
3492         (WebCore::HTMLSelectElement::add):
3493         (WebCore::HTMLSelectElement::remove):
3494         (WebCore::HTMLSelectElement::insertBefore):
3495         (WebCore::HTMLSelectElement::replaceChild):
3496         (WebCore::HTMLSelectElement::removeChild):
3497         (WebCore::HTMLSelectElement::appendChild):
3498         (WebCore::HTMLSelectElement::removeChildren):
3499         Remove calls to recalcSelectOptions(). It is too late to recalc now, after mutation events
3500         were already dispatched.
3501
3502 2009-03-14  Greg Bolsinga  <bolsinga@apple.com>
3503
3504         <rdar://problem/6683465>
3505
3506         Geolocation has to be able to handle NULL Frames.
3507
3508         Reviewed by Mark Rowe
3509     
3510 2009-03-14  Greg Bolsinga  <bolsinga@apple.com>
3511
3512         Reviewed by David Kilzer.
3513
3514         Geoposition::toString was missing the Coordinates after the update.
3515
3516         * page/Geoposition.cpp:
3517         (WebCore::Geoposition::toString):
3518
3519 2009-03-14  Jan Michael Alonzo  <jmalonzo@webkit.org>
3520
3521         Reviewed by Mark Rowe.
3522
3523         [Gtk] Build fix - pass a Coordinate to Geoposition::create
3524         https://bugs.webkit.org/show_bug.cgi?id=24603
3525
3526         Gtk build fix per r41650
3527         https://bugs.webkit.org/show_bug.cgi?id=24506
3528         Geolocation in Safari differs from the spec, no Coordinates attribute on Position