b832b034a20ca949d2b0a038830008693e121042
[WebKit-https.git] / WebCore / ChangeLog
1 2008-03-19  Sam Weinig  <sam@webkit.org>
2
3         Reviewed by Anders Carlsson.
4
5         Fix for <rdar://problem/5785694>
6         Crash occurs at KJS::Collector::collect() when loading web clip widgets with a PAC file
7
8         Make the activeExecStates stack per JSGlobalObject instead of static to ensure
9         thread safety.
10
11         * bindings/objc/WebScriptObject.mm:
12         (+[WebScriptObject throwException:]): Change to throw an exception on the current
13         GlobalObject instead of the top of the static activeExecStates stack.
14         (-[WebScriptObject setException:]): Change to use the top of the rootObjects GlobalObject
15         instead of the top of the static activeExecStates stack.
16
17         * bridge/c/c_instance.cpp:
18         * bridge/c/c_instance.h:
19         * bridge/jni/jni_instance.cpp:
20         (JavaInstance::virtualBegin):
21         (JavaInstance::virtualEnd):
22         * bridge/jni/jni_instance.h:
23         * bridge/objc/objc_instance.h:
24         * bridge/objc/objc_instance.mm:
25         (ObjcInstance::~ObjcInstance):
26         (ObjcInstance::virtualBegin):
27         (ObjcInstance::virtualEnd):
28         * bridge/runtime.cpp:
29         (KJS::Bindings::Instance::setDidExecuteFunction):
30         (KJS::Bindings::Instance::didExecuteFunction):
31         (KJS::Bindings::Instance::setCurrentGlobalObject): Added.
32         (KJS::Bindings::Instance::currentGlobalObject): Added.
33         (KJS::Bindings::Instance::begin):
34         (KJS::Bindings::Instance::end):
35         * bridge/runtime.h:
36         (KJS::Bindings::Instance::virtualBegin): Renamed from begin().
37         (KJS::Bindings::Instance::virtualEnd): Renamed from end().
38         We now store the currently active globalObject everytime we cross the runtime
39         object boundary.  To do this, we take advantage of the existing begin/end
40         methods that are called when crossing this boundary, making begin set the current
41         globalObject and then call the old begin, now called virtualBegin.
42
43 2008-03-19  Brady Eidson  <beidson@apple.com>
44
45         Reviewed by Anders
46
47         Change SharedBuffer so the wrapping platform data aspect can be shared with all CoreFoundation platforms
48         (Mac and Windows instead of just Mac)
49
50         * WebCore.vcproj/WebCore.vcproj: Add SharedBufferCF.cpp
51         * WebCore.xcodeproj/project.pbxproj: Ditto
52
53         * platform/SharedBuffer.cpp:
54         * platform/SharedBuffer.h: Change the private c'tor from NSData to CFDataRef, other PLATFORM tweaks
55
56         * platform/cf/SharedBufferCF.cpp: Added.
57         (WebCore::SharedBuffer::SharedBuffer):
58         (WebCore::SharedBuffer::createCFData): Non-Mac version of createCFData
59         (WebCore::SharedBuffer::hasPlatformData):
60         (WebCore::SharedBuffer::platformData):
61         (WebCore::SharedBuffer::platformDataSize):
62         (WebCore::SharedBuffer::maybeTransferPlatformData):
63         (WebCore::SharedBuffer::clearPlatformData):
64
65         * platform/mac/SharedBufferMac.mm:
66         (WebCore::SharedBuffer::wrapNSData): Use the CFDataRef constructor via toll-free bridging
67         (WebCore::SharedBuffer::createCFData): Mac-specific version of createCFData
68
69 2008-03-19  Oliver Hunt  <oliver@apple.com>
70
71         Reviewed by Antti.
72
73         Bug 17954: Canvas arc() with radius of 0 throws exception
74         http://bugs.webkit.org/show_bug.cgi?id=17954
75
76         Simple fix -- use >= instead of > when validating the radius.
77
78         * html/CanvasRenderingContext2D.cpp:
79         (WebCore::CanvasRenderingContext2D::arc):
80
81 2008-03-19  Justin Garcia  <justin.garcia@apple.com>
82
83         Reviewed by Oliver.
84
85         <rdar://problem/5794920> Acid3: Assertion failure in VisiblePosition::previous when clicking on results (17004)
86         
87         The position inside an empty inline-block was a candidate, but upstream and downstream
88         would move across it without stopping.  This confused canonicalPosition, since no more
89         than two candidates should have the same upstream/downstream (be visually equivalent).
90         
91         Code was added intentionally in isCandidate to make VisiblePositions inside empty 
92         inline-blocks, so we need to make upstream/downstream understand that.
93
94         * dom/Position.cpp:
95         (WebCore::endsOfNodeAreVisuallyDistinctPositions): upstream and downstream used to only
96         stop when entering or leaving a non-inline element (referred to as a "block").  We must also 
97         avoid entering or leaving an empty inline-block.  This will allow a VisiblePosition there, to 
98         match up with what the code in isCandidate intended.
99         (WebCore::enclosingVisualBoundary): Removed enclosingBlock and replaced it with this.
100         (WebCore::Position::upstream): Added better comments, called the new functions.
101         (WebCore::Position::downstream): Ditto.
102         * dom/Position.h:
103
104 2008-03-19  Dan Bernstein  <mitz@apple.com>
105
106         Rubber-stamped by John Sullivan.
107
108         - change CSS property and value keyword constants from all-caps with
109           underscores to intra-caps.
110
111         * css/makeprop.pl:
112         * css/makevalues.pl:
113         * All files using the constants
114
115 2008-03-19  Adam Roben  <aroben@apple.com>
116
117         Make clicking anywhere in a row in the DOM tree select that row's node
118
119         We now have mousedown and dblclick event listeners on the root of the
120         tree that forward the event to the node on the row the mouse is over.
121
122         Reviewed by Tim Hatcher.
123
124         * page/inspector/DocumentPanel.js:
125         (WebInspector.DocumentPanel): Added a dblclick and mousedown event
126         listeners to the root of the tree.
127         (WebInspector.DocumentPanel._treeElementFromEvent): Added. Finds the
128         tree element for the row underneath the mouse.
129         (WebInspector.DocumentPanel._ondblclick): Added. Sends the dblclick
130         event on to the tree element in the current row.
131         (WebInspector.DocumentPanel._onmousedown): Added. Selects the tree
132         element in the current row.
133         * page/inspector/treeoutline.js:
134         (TreeOutline.treeElementFromPoint): Added.
135         (TreeElement.treeElementSelected): Changed to call
136         TreeElement.isEventWithinDisclosureTriangle, and added an early return.
137         (TreeElement.treeElementToggled): Ditto.
138         (TreeElement.isEventWithinDisclosureTriangle): Added.
139         * page/inspector/utilities.js:
140         (Node.enclosingNodeOrSelfWithNodeNameInArray): Added.
141         (Node.enclosingNodeOrSelfWithNodeName): Now just calls
142         enclosingNodeOrSelfWithNodeNameInArray.
143         (Elemnt.get totalOffsetLeft): Added.
144         (Elemnt.get totalOffsetTop): Added.
145
146 2008-03-19  Dan Bernstein  <mitz@apple.com>
147
148         Reviewed by Sam Weinig.
149
150         - fix assertion failure in RenderBlock::determineStartPosition() at http://www.wired.com/techbiz/it/magazine/16-04/bz_apple
151
152         Test: fast/repaint/line-flow-with-floats-10.html
153
154         * rendering/bidi.cpp:
155         (WebCore::RenderBlock::determineStartPosition): Removed bogus assertion.
156         If the float's top margin has changed and it has not been repositioned
157         yet, we do not have its new y position.
158
159 2008-03-19  David Hyatt  <hyatt@apple.com>
160
161         New implementation of full page zoom.  Because of how much doesn't transform when zooming, and because
162         of the need to obey viewport constraints, I decided to take a completely different approach.  Now CSS
163         lengths and intrinsic sizes are simply adjusted by the zoom factor.  This approach works much better and
164         avoids pixel cracks more than the old approach.   In addition widgets "just work", namely plugins zoom
165         and scrollbars do not.
166
167         This patch also implements the IE zoom CSS property.  This property allows fine-grained control over
168         zooming at the element level.  It takes values of normal | <number> | <percentage> to match WinIE.  In
169         addition, in the vein of text-size-adjust for text zooming, I have extended the zoom property with an
170         extra value, reset.  The reset keyword can be used to prevent a section of the page from scaling at all
171         when a zoom is applied.
172
173         Reviewed by olliej
174
175         * css/CSSComputedStyleDeclaration.cpp:
176         (WebCore::):
177         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
178         Support the new 'zoom' property for getComputedStyle.
179
180         * css/CSSParser.cpp:
181         (WebCore::CSSParser::parseValue):
182         Code that parses the 'zoom' property.
183
184         * css/CSSPrimitiveValue.cpp:
185         (WebCore::CSSPrimitiveValue::computeLengthInt):
186         (WebCore::CSSPrimitiveValue::computeLengthIntForLength):
187         (WebCore::CSSPrimitiveValue::computeLengthShort):
188         (WebCore::CSSPrimitiveValue::computeLengthFloat):
189         (WebCore::CSSPrimitiveValue::computeLengthDouble):
190         * css/CSSPrimitiveValue.h:
191         Extend all of the computeLength methods to take a multiplier so that lengths can be adjusted by the
192         zoom factor.
193
194         * css/CSSPropertyNames.in:
195         Add the new zoom property to the list of properties we understand.
196
197         * css/CSSStyleSelector.cpp:
198         (WebCore::CSSStyleSelector::applyDeclarations):
199         (WebCore::CSSStyleSelector::applyProperty):
200         (WebCore::CSSStyleSelector::mapBackgroundSize):
201         (WebCore::CSSStyleSelector::mapBackgroundXPosition):
202         (WebCore::CSSStyleSelector::mapBackgroundYPosition):
203         (WebCore::CSSStyleSelector::getComputedSizeFromSpecifiedSize):
204         * css/CSSStyleSelector.h:
205         (WebCore::CSSStyleSelector::setStyle):
206         Pass in the zoom factor when computing all lengths in CSS.
207
208         * css/CSSValueKeywords.in:
209         Add support for the 'reset' keyword of the zoom property.
210
211         * dom/Document.cpp:
212         (WebCore::Document::recalcStyle):
213         Set the 'zoom' CSS property on the RenderView.  This is how we implement full page zoom.
214
215         * html/CanvasRenderingContext2D.cpp:
216         (WebCore::size):
217         Make sure the back end canvas size ignores zooming when rendering images.
218
219         * html/HTMLImageElement.cpp:
220         (WebCore::HTMLImageElement::width):
221         (WebCore::HTMLImageElement::height):
222         (WebCore::HTMLImageElement::naturalWidth):
223         (WebCore::HTMLImageElement::naturalHeight):
224         Use the unzoomed width/height if we have no style information in HTMLImageElement.cpp.
225
226         * loader/CachedImage.cpp:
227         (WebCore::CachedImage::ref):
228         (WebCore::CachedImage::imageSize):
229         (WebCore::CachedImage::imageRect):
230         * loader/CachedImage.h:
231         (WebCore::CachedImage::canRender):
232         Force access to the CachedImage metrics to take a multiplier so that people have to think about
233         the zoom factor.  The "intrinsic size" of the image then takes that into account.
234
235         * loader/ImageDocument.cpp:
236         (WebCore::ImageTokenizer::finish):
237         (WebCore::ImageDocument::scale):
238         (WebCore::ImageDocument::resizeImageToFit):
239         (WebCore::ImageDocument::imageChanged):
240         (WebCore::ImageDocument::restoreImageSize):
241         (WebCore::ImageDocument::imageFitsInWindow):
242         Make sure image documents respect the zoom.
243
244         * page/AnimationController.cpp:
245         (WebCore::ImplicitAnimation::animate):
246         Make the 'zoom' CSS property work with CSS transitions.
247
248         * page/Frame.h:
249         (WebCore::Frame::pageZoomFactor):
250         (WebCore::Frame::textZoomFactor):
251         Add accessors for obtaining the pageZoom vs. textZoom.
252
253         * page/FrameView.cpp:
254         (WebCore::FrameView::adjustViewSize):
255         Remove the old zoom implementation that used transforms.
256
257         * page/mac/WebCoreAXObject.mm:
258         (-[WebCoreAXObject accessibilityIsIgnored]):
259         Pass in the zoom factor.
260
261         * rendering/InlineFlowBox.cpp:
262         (WebCore::InlineFlowBox::paintBackground):
263         (WebCore::InlineFlowBox::paintBoxDecorations):
264         Pass in the zoom factor when testing for size.
265
266         * rendering/RenderBox.cpp:
267         (WebCore::RenderBox::calculateBackgroundSize):
268         (WebCore::RenderBox::imageChanged):
269         (WebCore::RenderBox::paintBackgroundExtended):
270         (WebCore::RenderBox::calcHeight):
271         * rendering/RenderFrameSet.cpp:
272         (WebCore::RenderFrameSet::layout):
273         * rendering/RenderHTMLCanvas.cpp:
274         (WebCore::RenderHTMLCanvas::canvasSizeChanged):
275         * rendering/RenderHTMLCanvas.h:
276         (WebCore::RenderHTMLCanvas::renderName):
277         (WebCore::RenderHTMLCanvas::intrinsicSizeChanged):
278         * rendering/RenderImage.cpp:
279         (WebCore::RenderImage::setImageSizeForAltText):
280         (WebCore::RenderImage::imageChanged):
281         (WebCore::RenderImage::calcReplacedWidth):
282         (WebCore::RenderImage::calcReplacedHeight):
283         * rendering/RenderImage.h:
284         (WebCore::RenderImage::intrinsicSizeChanged):
285         * rendering/RenderListMarker.cpp:
286         (WebCore::RenderListMarker::layout):
287         (WebCore::RenderListMarker::imageChanged):
288         (WebCore::RenderListMarker::getRelativeMarkerRect):
289         * rendering/RenderObject.cpp:
290         (WebCore::RenderObject::mustRepaintBackgroundOrBorder):
291         (WebCore::RenderObject::paintBorder):
292         Pass in the zoom factor when testing for size.
293
294         * rendering/RenderReplaced.cpp:
295         (WebCore::RenderReplaced::RenderReplaced):
296         (WebCore::RenderReplaced::setStyle):
297         (WebCore::RenderReplaced::intrinsicSizeChanged):
298         * rendering/RenderReplaced.h:
299         Added a new call when the zoom factor changes, intrinsicSizeChanged().  Replaced element subclasses
300         respond to this via overrides.
301
302         * rendering/RenderStyle.cpp:
303         (WebCore::StyleVisualData::StyleVisualData):
304         (WebCore::StyleInheritedData::StyleInheritedData):
305         (WebCore::StyleInheritedData::operator==):
306         (WebCore::RenderStyle::diff):
307         * rendering/RenderStyle.h:
308         (WebCore::StyleVisualData::operator==):
309         (WebCore::RenderStyle::zoom):
310         (WebCore::RenderStyle::zoomInEffect):
311         (WebCore::RenderStyle::setZoom):
312         (WebCore::RenderStyle::setZoomInEffect):
313         (WebCore::RenderStyle::initialZoom):
314         Support for 'zoom' in the RenderStyle.  "zoomInEffect" represents the computed zoom taking into account
315         all the zooms specified on ancestors.
316
317         * rendering/RenderTableCol.cpp:
318         (WebCore::RenderTableCol::imageChanged):
319         * rendering/RenderTableRow.cpp:
320         (WebCore::RenderTableRow::imageChanged):
321         * rendering/RenderTableSection.cpp:
322         (WebCore::RenderTableSection::imageChanged):
323         * rendering/RenderVideo.h:
324         (WebCore::RenderVideo::intrinsicSizeChanged):
325         Pass in the zoom factor.
326
327         * rendering/RenderView.cpp:
328         (WebCore::RenderView::calcHeight):
329         (WebCore::RenderView::calcWidth):
330         (WebCore::RenderView::layout):
331         (WebCore::RenderView::viewHeight):
332         (WebCore::RenderView::viewWidth):
333         * rendering/RenderView.h:
334         (WebCore::RenderView::zoomFactor):
335         Back out the old implementation.
336
337 2008-03-19  Adam Roben  <aroben@apple.com>
338
339         Rename firstParent* methods to enclosingNode*
340
341         Rubberstamped by John Sullivan.
342
343         * page/inspector/ConsolePanel.js:
344         * page/inspector/DocumentPanel.js:
345         * page/inspector/NetworkPanel.js:
346         * page/inspector/inspector.js:
347         * page/inspector/utilities.js:
348
349 2008-03-19  Dan Bernstein  <mitz@apple.com>
350
351         Reviewed by John Sullivan.
352
353         - fix <rdar://problem/5805070> CrashTracer: [USER] 33 crashes in Safari at com.apple.WebCore: WebCore::FrameView::layout + 431
354
355         Test: fast/dynamic/subtree-parent-static-y.html
356
357         * rendering/RenderObject.cpp:
358         (WebCore::RenderObject::markContainingBlocksForLayout): Avoid calling
359         this method on the parent if the parent is the new layout subtree root,
360         which would result in marking all the way to the top, when it should
361         actually do nothing.
362
363 2008-03-19  Mark Rowe  <mrowe@apple.com>
364
365         Reviewed by Oliver Hunt.
366
367         Use WTF::Unicode abstraction rather than using ICU functions directly.
368
369         * html/PreloadScanner.cpp:
370         (WebCore::PreloadScanner::tokenize):
371
372 2008-03-19  Mark Rowe  <mrowe@apple.com>
373
374         Attempt to fix the Gtk build.
375
376         * platform/network/curl/ResourceHandleCurl.cpp:
377         (WebCore::ResourceHandle::setHostAllowsAnyHTTPSCertificate):
378
379 2008-03-18  Darin Adler  <darin@apple.com>
380
381         Reviewed by Maciej.
382
383         - Speed up JavaScript built-in properties by changing the
384           hash table to take advantage of the identifier objects
385
386         5% speedup for Acid3 test 26
387
388         * bindings/js/JSDOMWindowBase.cpp:
389         (WebCore::JSDOMWindowBase::getOwnPropertySlot): Update for change to HashTable.
390         (WebCore::JSDOMWindowBase::put): Ditto.
391         * bindings/js/JSDOMWindowCustom.cpp:
392         (WebCore::JSDOMWindow::customGetOwnPropertySlot): Ditto.
393         * bindings/js/JSHTMLInputElementBase.cpp:
394         (WebCore::JSHTMLInputElementBase::getOwnPropertySlot): Ditto.
395         * bindings/js/JSHistoryCustom.cpp:
396         (WebCore::JSHistory::customGetOwnPropertySlot): Ditto.
397         * bindings/js/JSLocation.cpp:
398         (WebCore::JSLocation::customGetOwnPropertySlot): Ditto.
399         (WebCore::JSLocation::put): Ditto.
400         * bindings/js/kjs_binding.cpp:
401         (WebCore::nonCachingStaticFunctionGetter): Ditto.
402
403         * bindings/scripts/CodeGeneratorJS.pm: Same changes as in the
404         create_hash_table script.
405
406 2008-03-18  Matt Lilek  <webkit@mattlilek.com>
407
408         Fix the Gtk build for real this time.
409
410         * platform/network/curl/AuthenticationChallenge.h:
411
412 2008-03-18  Sam Weinig  <sam@webkit.org>
413
414         Reviewed by Anders Carlsson.
415
416         Fix for http://bugs.webkit.org/show_bug.cgi?id=17057
417         REGRESSION: Frequent random crashes in WebCore::JSNodeList::indexGetter
418         <rdar://problem/5725058>
419
420         Tests: fast/dom/NodeList/5725058-crash-scenario-1.html
421                fast/dom/NodeList/5725058-crash-scenario-2.html
422                fast/dom/NodeList/5725058-crash-scenario-3.html
423
424         * dom/ChildNodeList.cpp: 
425         (WebCore::ChildNodeList::ChildNodeList):
426         * dom/ChildNodeList.h:
427         Remove rootNodeChildrenChanged() method and fix the constructor to not 
428         pass in a needsNotifications argument to DynamicNodeList, as it no longer
429         takes one.
430
431         * dom/ClassNodeList.cpp:
432         (WebCore::ClassNodeList::ClassNodeList):
433         Don't pass the needsNotifications argument to DynamicNodeList.
434
435         * dom/ContainerNode.cpp:
436         (WebCore::ContainerNode::childrenChanged):
437         Rename call to hasNodeLists() to hasNodeListCaches().
438
439         * dom/Document.cpp:
440         (WebCore::Document::Document):
441         (WebCore::Document::~Document): Zero out the m_document variable to signify
442         to destructors down the destruction chain that this is a Document type node
443         being destructed, and thus, accessing document() is prohibited.
444         * dom/Document.h:
445         (WebCore::Document::addNodeListCache): Renamed from addNodeList.
446         (WebCore::Document::removeNodeListCache): Renamed from removeNodeList, adds assertion.
447         (WebCore::Document::hasNodeListCaches): Renamed from hasNodeListCaches.
448         Rename m_numNodeLists to m_numNodeListCaches.
449
450         * dom/DynamicNodeList.cpp:
451         (WebCore::DynamicNodeList::DynamicNodeList):
452         (WebCore::DynamicNodeList::~DynamicNodeList):
453         (WebCore::DynamicNodeList::invalidateCache):
454         (WebCore::DynamicNodeList::Caches::Caches):
455         * dom/DynamicNodeList.h:
456         (WebCore::DynamicNodeList::hasOwnCaches):
457         Remove the needsNotifications concept from DynamicNodeList, instead, manually
458         invalidate the cache for lists that own their own cache.
459
460         * dom/NameNodeList.cpp:
461         (WebCore::NameNodeList::NameNodeList):
462         * dom/NameNodeList.h:
463         Remove rootNodeAttributeChanged() method and fix the constructor to not 
464         pass in a needsNotifications argument to DynamicNodeList, as it no longer
465         takes one.
466
467         * dom/Node.cpp:
468         (WebCore::Node::~Node): Decrement the document's nodeListCache count
469         if we had a NodeListsNodeData cache and this is not the Document being
470         destructor, as tagged by a null m_document.
471         (WebCore::Node::childNodes): Increment the document's nodeListCache count 
472         if we need create the NodeListsNodeData.
473         (WebCore::Node::registerDynamicNodeList): Increment the document's nodeListCache count 
474         if we need create the NodeListsNodeData.  Change to invalidate all the caches, instead 
475         of just the ChildNodeList, if document has had no NodeListCaches.
476         (WebCore::Node::unregisterDynamicNodeList): Change to remove the cache from the m_listsWithCaches
477         set if it is owned by the NodeList and clear the m_nodeLists if it is empty.
478         (WebCore::Node::notifyLocalNodeListsAttributeChanged): Move logic to 
479         NodeListsNodeData::invalidateAttributeCaches and clear the cache pointer if it is empty.
480         (WebCore::Node::notifyLocalNodeListsChildrenChanged): Move logic to 
481         NodeListsNodeData::invalidateCaches and clear the cache pointer if it is empty.
482         (WebCore::Node::notifyNodeListsChildrenChanged): Cleanup.
483         (WebCore::Node::getElementsByName): Increment the document's nodeListCache count 
484         if we need create the NodeListsNodeData.
485         (WebCore::Node::getElementsByClassName): Increment the document's nodeListCache count 
486         if we need create the NodeListsNodeData.
487
488         (WebCore::NodeListsNodeData::invalidateCaches): Added.
489         (WebCore::NodeListsNodeData::invalidateAttributeCaches): Added.
490         (WebCore::NodeListsNodeData::isEmpty): Added.
491
492         * dom/TagNodeList.cpp:
493         (WebCore::TagNodeList::TagNodeList):
494         Don't pass the needsNotifications argument to DynamicNodeList.
495
496 2008-03-18  Matt Lilek  <webkit@mattlilek.com>
497
498         Not reviewed, build fix.
499
500         * platform/network/curl/AuthenticationChallenge.h:
501
502 2008-03-18  Brent Fulgham  <bfulgham@gmail.com>
503
504         Reviewed by Adam Roben.
505
506         Provide some stub implementations for things that WebKit
507         uses for performing authentication/challenge activities.  This
508         is in support of http://bugs.webkit.org/show_bug.cgi?id=17837
509
510         * platform/network/ResourceHandle.h:
511         * platform/network/curl/AuthenticationChallenge.h:
512         (WebCore::AuthenticationChallenge::AuthenticationChallenge):
513         (WebCore::AuthenticationChallenge::sourceHandle):
514
515 2008-03-18  Eric Seidel  <eric@webkit.org>
516
517         Reviewed by Oliver.
518
519         Fix SVGImage crash seen once, and obvious via code inspection.
520         
521         I was not able to find a test case for this.
522
523         * svg/graphics/SVGImage.cpp:
524         (WebCore::SVGImage::setContainerSize):
525         (WebCore::SVGImage::usesContainerSize):
526         (WebCore::SVGImage::hasRelativeWidth):
527         (WebCore::SVGImage::hasRelativeHeight):
528
529 2008-03-18  Rodney Dawes  <dobey@wayofthemonkey.com>
530
531         Fix Qt build after r31123.
532
533         Add PluginView methods to TemporaryLinkStubs.
534
535         * platform/qt/TemporaryLinkStubs.cpp:
536
537 2008-03-18  Sam Weinig  <sam@webkit.org>
538
539         Reviewed by Darin Adler.
540
541         - Speed up JavaScript prototype and constructor object creation
542           using a static Identifier in the self() methods to avoid the
543           cost of creating one from a c-string each time.
544
545         5% speedup for Acid3 test 26
546
547         * bindings/scripts/CodeGeneratorJS.pm:
548
549 2008-03-18  Antti Koivisto  <antti@apple.com>
550
551         Reviewed by Mark Rowe.
552
553         Enable preloading for other platforms besides Mac.
554
555         * GNUmakefile.am:
556         * WebCore.pro:
557         * WebCore.vcproj/WebCore.vcproj:
558         * WebCoreSources.bkl:
559         * html/HTMLTokenizer.cpp:
560         * html/HTMLTokenizer.h:
561         * html/PreloadScanner.cpp:
562         (WebCore::PreloadScanner::tokenize):
563
564 2008-03-18  Dan Bernstein  <mitz@apple.com>
565
566         Reviewed by Adele Peterson.
567
568         - fix <rdar://problem/5805127> REGRESSION (r31116): Assertion failure (floatIndex < floats.size()) in RenderBlock::determineStartPosition() at digg.com
569
570         Test: fast/dynamic/floating-to-positioned.html
571
572         * rendering/RenderObject.cpp:
573         (WebCore::RenderObject::setStyle): Added code to remove a float from
574         object lists if its position property changes to something other than
575         static, since then it ceases to be a float.
576
577 2008-03-18  Adam Roben  <aroben@apple.com>
578
579         Windows build fix after r31123
580
581         * plugins/win/PluginViewWin.cpp: Add back MozillaUserAgent.
582
583 2008-03-18  Dan Bernstein  <mitz@apple.com>
584
585         Reviewed by Darin Adler.
586
587         - eliminate RenderFlow::m_clear
588
589         * rendering/RenderBlock.cpp:
590         (WebCore::RenderBlock::layoutBlock): Removed code to set m_clear.
591         (WebCore::RenderBlock::newLine): Added a 'clear' parameter.
592         * rendering/RenderBlock.h:
593         * rendering/RenderFlow.h:
594         (WebCore::RenderFlow::RenderFlow): Removed initialization of m_clear.
595         * rendering/bidi.cpp:
596         (WebCore::RenderBlock::layoutInlineChildren): Added a local 'clear'
597         variable, passing a pointer to it to findNextLineBreak() and its value
598         to newLine(). 
599         (WebCore::RenderBlock::findNextLineBreak): Added a 'clear' parameter,
600         which this method adjusts when it encounters a <br>.
601
602 2008-03-18  Simon Hausmann  <hausmann@webkit.org>
603
604         Reviewed by Holger.
605
606         Fix the Qt build and clean up the invoke mechanism for dispatching
607         functions in the main thread by using QMetaObject::invokeMethod
608         instead of posting a null event.
609
610         * platform/qt/MainThreadQt.cpp:
611
612 2008-03-18  Rodney Dawes  <dobey@wayofthemonkey.com>
613
614         Fix Mac build from commit of r31123.
615
616         Add a typedef for NSView* to PlatformWidget, remove duplicate PluginMessageThrottlerWin definition.
617
618         * platform/Widget.h:
619         * WebCore.vcproj/WebCore.vcproj:
620
621 2008-03-18  Rodney Dawes  <dobey@wayofthemonkey.com>
622
623         Reviewed by Jon Honeycutt.
624
625         Add PluginView.cpp and npapi.cpp to build files.
626         Copy win/PluginViewWin.cpp to PluginView.cpp for shared code.
627         Split Windows specific code out of PluginView.cpp.
628         Add #if USE(NPOBJECT) around dependant code.
629         Use npruntime_internal.h instead of npapi.h.
630         Add PlatformWidget typedef to Widget.h.
631         Update WidgetGtk.cpp for the PlatformWidget usage.
632         Add needed methods to TemporaryLinkStubs for GTK+ port.
633
634         * GNUmakefile.am:
635         * WebCore.pro:
636         * WebCoreSources.bkl:
637         * WebCore.vcproj/WebCore.vcproj:
638         * plugins/win/PluginViewWin.cpp:
639         * plugins/PluginView.cpp:
640         * plugins/PluginView.h:
641         * plugins/npapi.cpp:
642         * platform/Widget.h:
643         * platform/gtk/WidgetGtk.cpp:
644         * platform/gtk/TemporaryLinkStubs.cpp:
645
646 2008-03-17  Darin Adler  <darin@apple.com>
647
648         Reviewed by Maciej.
649
650         - speed up document property fetching (eliminate the AtomicString
651           objects made during document property lookup)
652
653         3% speedup for Acid3 test 26
654
655         * bindings/js/JSDOMWindowBase.cpp:
656         (WebCore::JSDOMWindowBase::getOwnPropertySlot): Use AtomicString::find to
657         locate the AtomicString, only if already present. Also call the new faster
658         versions of the hasNamedItem and hasElementWithId functions that don't
659         ref/deref the AtomicStringImpl, get inlined, etc.
660         * bindings/js/JSHTMLDocumentCustom.cpp:
661         (WebCore::JSHTMLDocument::canGetItemsForName): Ditto.
662         (WebCore::writeHelper): Use a Vector instead of a String to build up
663         the string to avoid the bad performance of string append.
664
665         * dom/Document.cpp: Tweaked code and comments a bit. Nothing substantive.
666         * dom/Document.h: Added new hasElementWithId function that's faster than
667         getElementById because it doesn't ref/deref the AtomicStringImpl*, gets
668         inlined, doesn't have to handle the 0 case, and doesn't try to return the
669         element pointer (just a boolean).
670
671         * html/HTMLAppletElement.cpp:
672         (WebCore::HTMLAppletElement::parseMappedAttribute): Use AtomicString
673         consistently. Also renamed the data member for clarity.
674         (WebCore::HTMLAppletElement::insertedIntoDocument): Ditto.
675         (WebCore::HTMLAppletElement::removedFromDocument): Ditto.
676         * html/HTMLAppletElement.h: Ditto.
677
678         * html/HTMLDocument.cpp:
679         (WebCore::addItemToMap): Use AtomicString instead of String.
680         (WebCore::removeItemFromMap): Ditto.
681         (WebCore::HTMLDocument::addNamedItem): Updated for member name change.
682         (WebCore::HTMLDocument::removeNamedItem): Ditto.
683         (WebCore::HTMLDocument::addExtraNamedItem): Ditto.
684         (WebCore::HTMLDocument::removeExtraNamedItem): Ditto.
685         (WebCore::HTMLDocument::clear): Added. Moved code here from the JavaScript
686         bindings. If we're going to have an empty placeholder function, there's no
687         reason to have it in the bindings instead of here.
688         * html/HTMLDocument.h: Added clear. Changed the named item function
689         arguments to AtomicString insted of String. Changed the NameCountMap to
690         use AtomicStringImpl* instead of StringImpl*. Renamed the data members
691         to add a m_ prefix and remove the needless doc prefix. Added hasNamedItem
692         and hasExtraNamedItem functions that are inlined and faster than the old
693         idiom because they doesn't ref/deref the AtomicStringImpl*, get inlined,
694         and don't have to handle the 0 case.
695         * html/HTMLDocument.idl: Removed the [Custom] attribute on clear and took
696         it out of the JavaScript-specific section.
697
698         * html/HTMLEmbedElement.cpp:
699         (WebCore::HTMLEmbedElement::parseMappedAttribute): Use AtomicString
700         consistently. Also renamed the data member for clarity.
701         (WebCore::HTMLEmbedElement::insertedIntoDocument): Ditto.
702         (WebCore::HTMLEmbedElement::removedFromDocument): Ditto.
703         * html/HTMLFormElement.cpp:
704         (WebCore::HTMLFormElement::insertedIntoDocument): Ditto.
705         (WebCore::HTMLFormElement::removedFromDocument): Ditto.
706         (WebCore::HTMLFormElement::parseMappedAttribute): Ditto.
707         * html/HTMLFormElement.h: Ditto.
708
709         * html/HTMLFrameElementBase.cpp:
710         (WebCore::HTMLFrameElementBase::openURL): Renamed m_name to m_frameName for
711         clarity, since the frame name is not the same as the name attribute.
712         (WebCore::HTMLFrameElementBase::parseMappedAttribute): Ditto.
713         (WebCore::HTMLFrameElementBase::setNameAndOpenURL): Ditto.
714         * html/HTMLFrameElementBase.h: Ditto.
715
716         * html/HTMLIFrameElement.cpp:
717         (WebCore::HTMLIFrameElement::parseMappedAttribute): Use AtomicString
718         consistently. Also renamed the data member for clarity.
719         (WebCore::HTMLIFrameElement::insertedIntoDocument): Ditto.
720         (WebCore::HTMLIFrameElement::removedFromDocument): Ditto.
721         * html/HTMLIFrameElement.h: Ditto.
722         * html/HTMLImageElement.cpp:
723         (WebCore::HTMLImageElement::parseMappedAttribute): Ditto.
724         (WebCore::HTMLImageElement::insertedIntoDocument): Ditto.
725         (WebCore::HTMLImageElement::removedFromDocument): Ditto.
726         * html/HTMLImageElement.h: Ditto.
727         * html/HTMLObjectElement.cpp:
728         (WebCore::HTMLObjectElement::parseMappedAttribute): Ditto.
729         (WebCore::HTMLObjectElement::insertedIntoDocument): Ditto.
730         (WebCore::HTMLObjectElement::removedFromDocument): Ditto.
731         (WebCore::HTMLObjectElement::updateDocNamedItem): Ditto.
732         * html/HTMLObjectElement.h: Ditto.
733
734         * html/HTMLParamElement.cpp:
735         (WebCore::HTMLParamElement::isURLAttribute): Use equalIgnoringCase instead
736         of callling lower().
737
738         * html/HTMLPlugInElement.h: Changed the type of m_name. The code that
739         uses this is in HTMLAppletElement, HTMLEmbedElement, and HTMLObjectElement.
740
741         * platform/text/AtomicString.cpp:
742         (WebCore::equal): Moved to an inline so we can share this code between a
743         few different functions. It could move to a header too if we want to use
744         it elsewhere.
745         (WebCore::UCharBufferTranslator::equal): Change to use inline.
746         (WebCore::HashAndCharactersTranslator::hash): Added.
747         (WebCore::HashAndCharactersTranslator::equal): Added.
748         (WebCore::HashAndCharactersTranslator::translate): Added.
749         (WebCore::AtomicString::add): Improved the Identifier and UString overloads
750         to use the already-computed hash code instead of rehashing the string.
751         (WebCore::AtomicString::find): Added.
752         * platform/text/AtomicString.h: Added a find function so we can avoid
753         allocating memory just to look up a string in an atomic string set or map.
754
755         * platform/text/StringImpl.h: Added declarations needed for the
756         AtomicString changes.
757
758 2008-03-17  Timothy Hatcher  <timothy@apple.com>
759
760         Reviewed by Mark Rowe.
761
762         Bug 17908: Various bugs in the Console completion code
763         http://bugs.webkit.org/show_bug.cgi?id=17908
764
765         * page/inspector/ConsolePanel.js:
766         (WebInspector.ConsolePanel.complete): Moved the code that checked for the caret being at the end
767         of the prompt into the _caretAtEndOfPrompt helper function.
768         (WebInspector.ConsolePanel.messagesSelectStart): Clear and redo the auto complete when the selection changes.
769         (WebInspector.ConsolePanel._caretInsidePrompt): Fixed a logic error that always caused a false result.
770         (WebInspector.ConsolePanel._caretAtEndOfPrompt): Added. Tests if the selection is a caret at the
771         end of the prompt.
772         (WebInspector.ConsolePanel._moveCaretToEndOfPrompt): Changed the offset to use the childNodes length.
773         This makes sure the caret is at the end when there are multiple text nodes in the prompt.
774
775 2008-03-17  Dan Bernstein  <mitz@apple.com>
776
777         Rubber-stamped by Dave Hyatt.
778
779         - FloatingObject cleanup
780
781         Renamed FloatingObject's data members as follows: node -> m_renderer,
782         startY -> m_top, endY -> m_bottom, left -> m_left, width -> m_width,
783         and noPaint -> !m_shouldPaint, reversing the meaning of the flag.
784
785         Also addressed the FIXME in RenderBlock::containsFloat().
786
787         * rendering/RenderBlock.cpp:
788         (WebCore::RenderBlock::repaintOverhangingFloats):
789         (WebCore::RenderBlock::paintFloats):
790         (WebCore::RenderBlock::insertFloatingObject):
791         (WebCore::RenderBlock::removeFloatingObject):
792         (WebCore::RenderBlock::positionNewFloats):
793         (WebCore::RenderBlock::leftRelOffset):
794         (WebCore::RenderBlock::rightRelOffset):
795         (WebCore::RenderBlock::nextFloatBottomBelow):
796         (WebCore::RenderBlock::floatBottom):
797         (WebCore::RenderBlock::floatRect):
798         (WebCore::RenderBlock::lowestPosition):
799         (WebCore::RenderBlock::rightmostPosition):
800         (WebCore::RenderBlock::leftmostPosition):
801         (WebCore::RenderBlock::leftBottom):
802         (WebCore::RenderBlock::rightBottom):
803         (WebCore::RenderBlock::clearFloats):
804         (WebCore::RenderBlock::addOverhangingFloats):
805         (WebCore::RenderBlock::addIntrudingFloats):
806         (WebCore::RenderBlock::containsFloat): Changed to return false if the
807         floats lists exists but is empty, since line layout code no longer
808         relies on the buggy behavior.
809         (WebCore::RenderBlock::nodeAtPoint):
810         (WebCore::RenderBlock::adjustForBorderFit):
811         * rendering/RenderBlock.h:
812         (WebCore::RenderBlock::containsFloats):
813         (WebCore::RenderBlock::FloatingObject::FloatingObject):
814         * rendering/bidi.cpp:
815         (WebCore::RenderBlock::layoutInlineChildren):
816         (WebCore::RenderBlock::matchedEndLine):
817
818 2008-03-17  Dan Bernstein  <mitz@apple.com>
819
820         Reviewed by Dave Hyatt.
821
822         - allow incremental relayout of blocks that contain floats
823
824         Tests: fast/repaint/line-flow-with-floats-[1-9].html
825
826         * rendering/RenderBlock.cpp:
827         (WebCore::RenderBlock::clearFloatsIfNeeded): Cleaned up by moving most
828         of the function body out of an if statement which was replaced with an
829         early return.
830         (WebCore::RenderBlock::insertFloatingObject): Cleaned up by moving most
831         of the function body out of an if statement and moving the ASSERT, which
832         is a crash in release builds, to the beginning. Made this function set
833         the m_isDescendant flag of floating objects it creates.
834         (WebCore::RenderBlock::removeFloatingObject): Added a call to
835         markLinesDirtyInVerticalRange() when removing a float from a block with
836         inline children.
837         (WebCore::RenderBlock::markLinesDirtyInVerticalRange): Added. Marks the
838         lines in the given range as dirty.
839         (WebCore::RenderBlock::clearFloats): Added code to detect changes to
840         the geometry of floats intruding into this block from other blocks and
841         mark any lines whose available width has changed as a result as dirty.
842
843         * rendering/RenderBlock.h:
844         (WebCore::RenderBlock::FloatWithRect::FloatWithRect): Added a structure
845         to cache a float with its position and size.
846         (WebCore::RenderBlock::FloatingObject::FloatingObject): Added an
847         m_isDescendant flag, used by clearFloats() to distinguish between floats
848         entering the block from outside and floats internal to the block.
849
850         * rendering/RootInlineBox.h:
851         (WebCore::RootInlineBox::floats): Added.
852         (WebCore::RootInlineBox::floatsPtr): Added.
853         (WebCore::RootInlineBox::Overflow::Overflow): Added a data member to
854         hold the floats originating on the line.
855
856         * rendering/bidi.cpp:
857         (WebCore::RenderBlock::layoutInlineChildren): Made the existence of
858         floats not force a full layout. Changed to cache the geometry of floats
859         in the block and detect changes to it. If a float's size or position
860         changes, all lines from that point on are treated as dirty. An exception
861         is a change in the dimensions of a float on an otherwise-clean line,
862         which only dirties lines potentially affected by the change (see
863         determineStartPosition()). Added code to update each RootInlineBox's
864         set of floats as lines are laid out. Added code to shift floats
865         belonging to clean lines in the end along with the lines.
866         (WebCore::RenderBlock::determineStartPosition): Made this function look
867         for changes to floats' dimensions and mark lines as dirty accordingly.
868         Also look for new floats and if found, cause a full layout. Added code
869         to re-add floats belonging to clean lines.
870         (WebCore::RenderBlock::matchedEndLine): Added checking that the clean
871         lines in the end can be shifted vertically as needed, i.e. that the
872         available width along the way is uniform.
873
874 2008-03-17  Eric Seidel  <eric@webkit.org>
875
876         Reviewed by darin.
877
878         Fix _NPN_IntFromIdentifier (and export the symbol for use!)
879
880         Test: plugins/netscape-identifier-conversion.html
881
882         * WebCore.NPAPI.exp:
883         * bridge/npruntime.cpp:
884         (_NPN_IntFromIdentifier):
885
886 2008-03-17  Sam Weinig  <sam@webkit.org>
887
888         Reviewed by Dan Bernstein.
889
890         Add HTMLCollection constructor to the Window object. (Omission noticed by Harri Porten)
891
892         * page/DOMWindow.idl: 
893
894 2008-03-17  Holger Hans Peter Freyther  <zecke@selfish.org>
895
896         Unreviewed Gtk+ build fix.
897
898         * platform/gtk/ScrollViewGtk.cpp: remove const
899
900 2008-03-17  Julien Chaffraix  <julien.chaffraix@gmail.com>
901
902         Reviewed by Holger.
903
904         <http://bugs.webkit.org/show_bug.cgi?id=17754>
905
906         - Implement ResourceHandle::loadResourceSynchronously to dispatch synchronous
907           requests.
908
909         - Implement WebCoreSynchronousLoader, the ResourceHandleClient which holds
910           the network data, response and error for us during the transfert.
911
912         * platform/network/ResourceHandleInternal.h: Remove trailing white space.
913         * platform/network/curl/ResourceHandleCurl.cpp: Add WebCoreSynchronousLoader
914         (WebCore::WebCoreSynchronousLoader::resourceResponse):
915         (WebCore::WebCoreSynchronousLoader::resourceError):
916         (WebCore::WebCoreSynchronousLoader::data):
917         (WebCore::WebCoreSynchronousLoader::WebCoreSynchronousLoader):
918         (WebCore::WebCoreSynchronousLoader::didReceiveResponse):
919         (WebCore::WebCoreSynchronousLoader::didReceiveData):
920         (WebCore::WebCoreSynchronousLoader::didFinishLoading):
921         (WebCore::WebCoreSynchronousLoader::didFail):
922         (WebCore::ResourceHandle::loadResourceSynchronously): Implement method
923         using WebCoreSynchronousLoader.
924
925         * platform/network/curl/ResourceHandleManager.cpp:
926         (WebCore::ResourceHandleManager::dispatchSynchronousJob):
927         (WebCore::ResourceHandleManager::startJob):
928         (WebCore::ResourceHandleManager::initializeHandle): Handle initialization
929         method used both for synchronous and asynchronous job.
930
931         * platform/network/curl/ResourceHandleManager.h:
932
933 2008-03-17  Darin Adler  <darin@apple.com>
934
935         - try to fix GTK build
936
937         * platform/ScrollView.h: Make setGtkAdjustments adjustment.
938         And non-virtual (why was it virtual?).
939
940 2008-03-17  Rodney Dawes  <dobey@wayofthemonkey.com>
941
942         Fix Bug 17898: Split PluginMessageThrottlerWin into its own files
943
944         <http://bugs.webkit.org/show_bug.cgi?id=17898>
945
946         Move the PluginMessageThrottlerWin class into its own files, in
947         preparation for refactoring PluginView code to be shared.
948
949         Reviewed and tweaked by Adam Roben.
950
951         * WebCore.vcproj/WebCore.vcproj:
952         * plugins/PluginView.h:
953         * plugins/win/PluginMessageThrottlerWin.cpp: Added.
954         * plugins/win/PluginMessageThrottlerWin.h: Added.
955         * plugins/win/PluginViewWin.cpp:
956
957 2008-03-17  Adam Roben  <aroben@apple.com>
958
959         More Windows build fixes after r31098
960
961         * platform/ScrollView.h: Make some more methods public.
962
963 2008-03-17  Adam Roben  <aroben@apple.com>
964
965         Windows and Qt build fixes after r31098
966
967         * platform/ScrollView.h: Mark methods public that still need to be so.
968
969 2008-03-16  Timothy Hatcher  <timothy@apple.com>
970
971         Reviewed by Darin Adler.
972
973         Bug 17883: Console completion should support bracket notation
974         http://bugs.webkit.org/show_bug.cgi?id=17883
975
976         Also fixes a bug where the Inspector's window object was used instead of the
977         inspected window object.
978
979         * page/inspector/ConsolePanel.js:
980         (WebInspector.ConsolePanel.complete): Add a comment about the _backwardsRange call.
981         (WebInspector.ConsolePanel.completions): Add a comment about the _backwardsRange call.
982         Check the last character of the expression for a dot or bracket. Fallback
983         to the InspectorController.inspectedWindow() instead of window, this was a bad bug.
984         If the expression caused an exception, just consider the prefix a window property.
985         When bracket notation is used remember what quote was used and compared property names
986         with that quote surrounding it. Also escape the property name for the quote and backslash.
987
988 2008-03-17  Robert Blaut  <webkit@blaut.biz>
989
990         Reviewed by Darin.
991
992         Fix for bug http://bugs.webkit.org/show_bug.cgi?id=17696
993         Set default margin-bottom for form element in quirk mode
994         and be compatible with Gecko.
995
996         Tests: fast/css/margin-bottom-form-element-quirk.html
997                fast/css/margin-bottom-form-element-strict.html
998
999         * css/html4.css:
1000         * css/quirks.css:
1001
1002 2008-03-17  Antti Koivisto  <antti@apple.com>
1003
1004         Reviewed by Darin.
1005
1006         Speculative fix for http://bugs.webkit.org/show_bug.cgi?id=17878
1007         Bug 17878: REGRESSION: Acid3 sometimes crashes Webkit under WebCore::Loader::Host::cancelRequests
1008         
1009         I can't reproduce the crash or make a test case for this one but I'm pretty sure this
1010         is the problem. Essentially the same bug as http://bugs.webkit.org/show_bug.cgi?id=17862
1011         except in didFail() instead of didFinishLoading().
1012
1013         * loader/loader.cpp:
1014         (WebCore::Loader::Host::didFail):
1015
1016 2008-03-17  Jan Michael Alonzo  <jmalonzo@unpluggable.com>
1017
1018         Reviewed and tweaked by Darin.
1019
1020         http://bugs.webkit.org/show_bug.cgi?id=17172
1021         Refactor platform checks in ScrollView.h
1022
1023         * platform/ScrollView.h: Change #ifs around.
1024
1025 2008-03-17  Yuzhu Shen  <yuzhu.shen@gmail.com>
1026
1027         Reviewed by Darin.
1028
1029         Fix the bug: http://bugs.webkit.org/show_bug.cgi?id=17760
1030         It is necessary to load the image even when src="".
1031
1032         Test: fast/images/load-img-with-empty-src.html
1033
1034         * html/HTMLImageLoader.cpp:
1035         (WebCore::HTMLImageLoader::updateFromElement): isNull rather than isEmpty.
1036
1037 2008-03-17  Rodney Dawes  <dobey@wayofthemonkey.com>
1038
1039         Fix GTK+ build from r31094.
1040
1041         * plugins/gtk/PluginDatabaseGtk.cpp:
1042         (PluginDatabase::getPluginsInPaths):
1043
1044 2008-03-17  Adam Roben  <aroben@apple.com>
1045
1046         Fix Bug 17876: REGRESSION (r31060): Attempting to visit Ofcom page causes crash
1047
1048         <http://bugs.webkit.org/show_bug.cgi?id=17876>
1049
1050         Reviewed by John.
1051
1052         Test: fast/dom/remove-named-attribute-crash.html
1053
1054         * dom/NamedAttrMap.cpp:
1055         (WebCore::NamedAttrMap::removeAttribute): Store the Attribute we're
1056         going to remove from the m_attributes Vector in a RefPtr so it doesn't
1057         get deleted when it is removed from the Vector.
1058
1059 2008-03-17  Rodney Dawes  <dobey@wayofthemonkey.com>
1060
1061         Reviewed by Adam Roben.
1062
1063         Implement PluginDatabase for GTK+ with PluginDatabaseGtk.cpp.
1064         Remove implemented methods from TemporaryLinkStubs.
1065
1066         * GNUmakefile.am:
1067         * plugins/gtk:
1068         * plugins/gtk/PluginDatabaseGtk.cpp:
1069         * platform/gtk/TemporaryLinkStubs.cpp:
1070
1071 2008-03-17  Simon Hausmann  <hausmann@webkit.org>
1072
1073         Fix the Qt build.
1074
1075         * platform/text/qt/TextCodecQt.cpp:
1076         (WebCore::TextCodecQt::encode):
1077         * platform/text/qt/TextCodecQt.h:
1078
1079 2008-03-16  Maciej Stachowiak  <mjs@apple.com>
1080
1081         Not reviewed, just fixing an incomplete comment from the last commit.
1082
1083         * dom/Range.cpp:
1084         (WebCore::Range::surroundContents):
1085
1086 2008-03-16  Maciej Stachowiak  <mjs@apple.com>
1087
1088         Reviewed by Darin.
1089
1090         - fixed "Acid3 expects different exceptions for surroundContents calls involving comment nodes (affects Acid3 test 11)"
1091         http://bugs.webkit.org/show_bug.cgi?id=17509
1092         
1093         This gets us to 92/100
1094
1095         * dom/Range.cpp:
1096         (WebCore::Range::surroundContents): Check for
1097         HIERARCHY_REQUEST_ERR before BAD_BOUNDARYPOINTS_ERR, since Acid3
1098         expects exceptional conditions to be tested in the order that the
1099         spec lists them. Also, adjust the HIERARCHY_REQUEST_ERR check. If
1100         the start point of the range is in a comment node, the node that
1101         would be the parent of a partial replacement is actually the
1102         comment node's parent (since comment nodes have character
1103         indices), so we should do the HIERARCHY_REQUEST_ERR check based on
1104         the parent of the comment node, as for text nodes, even though it
1105         will fail later with a different exception because it is not
1106         allowed to surround a partially selected non-text node.
1107
1108 2008-03-16  Marvin Decker  <marv.decker@gmail.com>
1109
1110         Reviewed by Darin.
1111
1112         Fix bug 15119: URL query characters that are unencodable in the
1113         request's character set should be converted to XML entities with
1114         non-alphanumeric characters escaped.
1115
1116         Test: http/tests/uri/escaped-entity.html
1117
1118         * html/FormDataList.cpp:
1119         (WebCore::FormDataList::appendString):
1120         * html/HTMLFormElement.cpp:
1121         (WebCore::HTMLFormElement::formData):
1122         * platform/KURL.cpp:
1123         (WebCore::encodeRelativeString):
1124         * platform/text/String.cpp:
1125         (WebCore::String::latin1):
1126         (WebCore::String::utf8):
1127         * platform/text/TextCodec.cpp:
1128         (WebCore::TextCodec::unencodableCharReplacement):
1129         * platform/text/TextCodec.h:
1130         (WebCore::):
1131         * platform/text/TextCodecICU.cpp:
1132         (WebCore::urlEscapedEntityCallback):
1133         (WebCore::gbkUrlEscapedEntityCallack):
1134         (WebCore::TextCodecICU::encode):
1135         * platform/text/TextCodecICU.h:
1136         (WebCore::TextCodecICU::setNeedsGBKFallbacks):
1137         * platform/text/TextCodecLatin1.cpp:
1138         (WebCore::encodeComplexWindowsLatin1):
1139         (WebCore::TextCodecLatin1::encode):
1140         * platform/text/TextCodecLatin1.h:
1141         * platform/text/TextCodecUTF16.cpp:
1142         (WebCore::TextCodecUTF16::encode):
1143         * platform/text/TextCodecUTF16.h:
1144         * platform/text/TextCodecUserDefined.cpp:
1145         (WebCore::encodeComplexUserDefined):
1146         (WebCore::TextCodecUserDefined::encode):
1147         * platform/text/TextCodecUserDefined.h:
1148         * platform/text/TextEncoding.cpp:
1149         (WebCore::TextEncoding::encode):
1150         * platform/text/TextEncoding.h:
1151         * platform/text/mac/TextCodecMac.cpp:
1152         (WebCore::TextCodecMac::encode):
1153         * platform/text/mac/TextCodecMac.h:
1154         * xml/XMLHttpRequest.cpp:
1155         (WebCore::XMLHttpRequest::send):
1156
1157 2008-03-16  Kevin Ollivier  <kevino@theolliviers.com>
1158
1159         Rubber stamped by Darin.
1160
1161         Add set-webkit-configuration support for wx port, and centralize
1162         build dir location setting.
1163
1164         http://bugs.webkit.org/show_bug.cgi?id=17790
1165
1166         * webcore-base.bkl:
1167
1168 2008-03-16  Darin Adler  <darin@apple.com>
1169
1170         Reviewed by Mark Rowe.
1171
1172         - http://bugs.webkit.org/show_bug.cgi?id=17881
1173           a little cleanup for HTMLTextAreaElement
1174
1175         Tests: fast/forms/textarea-default-value-leading-newline.html
1176                fast/forms/textarea-linewrap-dynamic.html
1177
1178         * html/HTMLTextAreaElement.cpp:
1179         (WebCore::HTMLTextAreaElement::HTMLTextAreaElement): Tweaked names/
1180         (WebCore::HTMLTextAreaElement::selectionStart): Ditto, also use early return
1181         and check for < 0 rather than -1 specifically.
1182         (WebCore::HTMLTextAreaElement::selectionEnd): Ditto.
1183         (WebCore::HTMLTextAreaElement::setSelectionStart): Early return.
1184         (WebCore::HTMLTextAreaElement::setSelectionEnd): Ditto.
1185         (WebCore::HTMLTextAreaElement::select): Ditto.
1186         (WebCore::HTMLTextAreaElement::setSelectionRange): Ditto.
1187         (WebCore::HTMLTextAreaElement::parseMappedAttribute): Changed value parsing
1188         to treat unknown values as meaning "default" rather than "leave value as-is".
1189         Only call setNeedsLayoutAndPrefWidthsRecalc when mode changed.
1190         (WebCore::HTMLTextAreaElement::createRenderer): Removed name of unused argument.
1191         (WebCore::HTMLTextAreaElement::appendFormData): Updated for name changes.
1192         (WebCore::HTMLTextAreaElement::isKeyboardFocusable): Got rid of unnneeded explicit
1193         class name in isFocusable call.
1194         (WebCore::HTMLTextAreaElement::isMouseFocusable): Ditto.
1195         (WebCore::HTMLTextAreaElement::updateFocusAppearance): Tweaked formatting.
1196         (WebCore::HTMLTextAreaElement::defaultEventHandler): Ditto.
1197         (WebCore::HTMLTextAreaElement::updateValue): Early return.
1198         (WebCore::HTMLTextAreaElement::setValue): Got rid of intermediate value to
1199         eliminate on small refcount churn.
1200         (WebCore::HTMLTextAreaElement::defaultValue): Got rid of unneeded redundant
1201         string length checks, since String already checks all indexing and returns 0.
1202         (WebCore::HTMLTextAreaElement::setDefaultValue): Added code to normalize
1203         line endings and add a leading line ending to fix cases where the first
1204         character is a newline.
1205         (WebCore::HTMLTextAreaElement::accessKeyAction): Removed name of unused arg.
1206         (WebCore::HTMLTextAreaElement::accessKey): Changed return value to avoid
1207         refcount churn.
1208         (WebCore::HTMLTextAreaElement::selection): Updated names and use < 0 instead
1209         of -1 specifically.
1210
1211         * html/HTMLTextAreaElement.h: Replaced wrap function with more-specific
1212         shouldWrapText one. Changed return value of accessKey. Made WrapMethod enum
1213         provate and renamed the values. Renamed cachedSelStart and cachedSelEnd to
1214         m_cachedSelectionStart and m_cachedSelectionEnd.
1215
1216         * rendering/RenderTextControl.cpp:
1217         (WebCore::RenderTextControl::createInnerTextStyle): Updated for change to
1218         HTMLTextAreaElement wrap function.
1219
1220 2008-03-16  Antti Koivisto  <antti@apple.com>
1221
1222         Reviewed by Mitz.
1223
1224         Fix http/tests/security/frame-loading-via-document-write.html
1225         which was broken by the preload patch.
1226         
1227         Don't print error message when preload fails local file security check.
1228         Some minor refactoring.
1229
1230         * html/PreloadScanner.cpp:
1231         (WebCore::PreloadScanner::emitTag):
1232         (WebCore::PreloadScanner::emitCSSRule):
1233         * loader/Cache.cpp:
1234         (WebCore::Cache::requestResource):
1235         * loader/Cache.h:
1236         * loader/DocLoader.cpp:
1237         (WebCore::DocLoader::requestResource):
1238         (WebCore::DocLoader::preload):
1239         (WebCore::DocLoader::printPreloadStats):
1240         * loader/DocLoader.h:
1241
1242 2008-03-16  Antti Koivisto  <antti@apple.com>
1243
1244         Reviewed by Darin.
1245         
1246         Fix http://bugs.webkit.org/show_bug.cgi?id=17862
1247         REGRESSION (r31038): Reproducible crash under DocLoader::checkForReload() at marware.com
1248         
1249         This was a memory smasher introduced by the preloading patch. 
1250         If a script resource was marked uncacheable, early deletion of the 
1251         Request object would cause deletion of the CachedResource too if
1252         it was referred more than once in a single document.
1253
1254         Test: http/tests/misc/uncacheable-script-repeated.html
1255
1256         * loader/loader.cpp:
1257         (WebCore::Loader::Host::servePendingRequests):
1258         (WebCore::Loader::Host::didFinishLoading):
1259
1260 2008-03-16  Yuzhu Shen  <yuzhu.shen@gmail.com>
1261
1262         Reviewed by Darin.
1263
1264         Fix bug http://bugs.webkit.org/show_bug.cgi?id=17714
1265         <img href="#"> should go to top of the page.
1266
1267         Test: fast/html/empty-fragment-id-goto-top.html
1268
1269         * loader/FrameLoader.cpp:
1270         (WebCore::FrameLoader::gotoAnchor):
1271
1272 2008-03-16  Thiago Macieira  <thiago.macieira@trolltech.com>
1273
1274         Reviewed by Darin.
1275
1276         Don't use RefPtr in classes you haven't seen the implementation of.
1277
1278         Forward-declaration and declaration of RefPtr<Foo> is ok. But you
1279         cannot *use* said objects until Foo is defined. This is true even for
1280         initialisation with a 0.
1281
1282         Seems the HP aCC compiler is more strict here than gcc.
1283
1284         * editing/SplitTextNodeCommand.h:
1285         * page/FrameTree.h:
1286         * xml/XPathExpressionNode.h:
1287
1288 2008-03-16  Darin Adler  <darin@apple.com>
1289
1290         Reviewed by Mitz.
1291
1292         - fix http://bugs.webkit.org/show_bug.cgi?id=14941
1293           <rdar://problem/5404093> textarea value from JavaScript includes extra newline
1294
1295         Test: fast/forms/textarea-trailing-newline.html
1296
1297         * rendering/RenderTextControl.cpp:
1298         (WebCore::RenderTextControl::finishText): Added code to strip the trailing
1299         newline. It's possible there are some obscure cases where this is not wanted,
1300         but I couldn't find any. If someone finds a case where this is bad, we can
1301         make the code conditional.
1302
1303 2008-03-16  Darin Adler  <darin@apple.com>
1304
1305         Reviewed by Mitz.
1306
1307         - fix http://bugs.webkit.org/show_bug.cgi?id=17876
1308           Attempting to visit Ofcom page causes crash
1309
1310         This is causing intermittent crashes on some existing test cases on the buildbot
1311         too; I don't have a 100% test case right now, but it should be easy to add one later
1312         and this does fix a crash in a test we already have.
1313
1314         * dom/CharacterData.cpp:
1315         (WebCore::CharacterData::CharacterData): Initialize m_data to the empty string,
1316         not the null string. The class assumes the string can never being null.
1317         (WebCore::CharacterData::setData): If asked to set the data to the null string,
1318         set it to the empty string instead. This matches what the (non-empty) constructor
1319         has always done.
1320
1321 2008-03-15  Timothy Hatcher  <timothy@apple.com>
1322
1323         Reviewed by Adam Roben.
1324
1325         Bug 17870: Web Inspector console should feel more like a terminal
1326         http://bugs.webkit.org/show_bug.cgi?id=17870
1327
1328         Bug 14390: Console input area should be more noticeable
1329         http://bugs.webkit.org/show_bug.cgi?id=14390
1330
1331         Adds tab completion, auto completion and a blended input prompt.
1332         The prompt is also focused when the console is shown.
1333            Implements a new look, that will be part of the UI refresh.
1334
1335         * page/inspector/ConsolePanel.js: 
1336         (WebInspector.ConsolePanel): Renamed a few properties.
1337         (WebInspector.ConsolePanel.get/set promptText): Property to set
1338         and get the current prompt text. Does not affect command history.
1339         (WebInspector.ConsolePanel.show): Make the prompt focus on show.
1340         (WebInspector.ConsolePanel.acceptAutoComplete): Accepts any
1341         pending auto complete text.
1342         (WebInspector.ConsolePanel.clearAutoComplete): Cancels any pending
1343         auto complete text.
1344         (WebInspector.ConsolePanel.autoCompleteSoon): Sets a timeout to auto
1345         complete in 250 ms, only if there isn't a pending auto complete.
1346         (WebInspector.ConsolePanel.complete): 
1347         (WebInspector.ConsolePanel.completions): Generate a list of possible
1348         completions based on the prefix and the previous expression ranges.
1349         (WebInspector.ConsolePanel._backwardsRange): Helper to scan backwards
1350         from a node and offset to find a start node and offset of the first
1351         character found in the characters string.
1352         (WebInspector.ConsolePanel._evalInInspectedWindow): Helper to eval in the
1353         inspected window.
1354         (WebInspector.ConsolePanel._caretInsidePrompt): Returns true if the selection
1355         is collapsed and is inside the prompt element.
1356         (WebInspector.ConsolePanel._moveCaretToEndOfPrompt): Moves the selection
1357         to the end of the prompt.
1358         (WebInspector.ConsolePanel._onTabPressed): Calls complete on
1359         tab press.
1360         (WebInspector.ConsolePanel._onEnterPressed): Call clearAutoComplete so the
1361         autocompletion text is not evaluated.
1362
1363         * page/inspector/Images/errorIcon.png: New image.
1364         * page/inspector/Images/userInputIcon.png: Added.
1365         * page/inspector/Images/userInputPreviousIcon.png: Added.
1366         * page/inspector/Images/warningIcon.png: New image.
1367         * page/inspector/inspector.css: New refreshed UI.
1368
1369 2008-03-15  Mark Mentovai  <mark@moxienet.com>
1370
1371         Reviewed and landed by Darin.
1372
1373         - http://bugs.webkit.org/show_bug.cgi?id=17833
1374           use file extensions instead of explicit file types in WebCore's Xcode project
1375
1376         * WebCore.xcodeproj/project.pbxproj: Remove unnecessary
1377           uses of explicitFileType, preferring lastKnownFileType ("File Type:
1378           Default for File" in Xcode's File Info's General tab).  Files below
1379           that relied on an explicit file type setting other than what would
1380           be implied by their extensions have been renamed to have correct
1381           extensions.
1382         * bridge/jni/jni_jsobject.cpp: Removed.
1383         * bridge/jni/jni_jsobject.mm: Copied from bridge/jni/jni_jsobject.cpp.
1384         * loader/mac/LoaderNSURLExtras.m: Removed.
1385         * loader/mac/LoaderNSURLExtras.mm: Copied from loader/mac/LoaderNSURLExtras.m.
1386         * platform/mac/SharedTimerMac.cpp: Removed.
1387         * platform/mac/SharedTimerMac.mm: Copied from platform/mac/SharedTimerMac.cpp.
1388
1389 2008-03-15  Darin Adler  <darin@apple.com>
1390
1391         Reviewed by Sam.
1392
1393         - fix http://bugs.webkit.org/show_bug.cgi?id=11997
1394           Ranges are not fixed after mutation (affects Acid3 test 13)
1395
1396         Test: fast/dom/Range/mutation.html
1397
1398         * WebCore.xcodeproj/project.pbxproj: Added NodeWithIndex.h, NodeWithIndexAfter.h,
1399         and NodeWithIndexBefore.h.
1400
1401         * dom/CharacterData.cpp:
1402         (WebCore::CharacterData::setData): Replaced call to Document::removeMarkers
1403         with call to Document::textRemoved.
1404         (WebCore::CharacterData::insertData): Replaced call to Document::shiftMarkers
1405         with call to Document::textInserted.
1406         (WebCore::CharacterData::deleteData): Replaced call to Document::removeMarkers
1407         and Document::shiftMarkers with call to Document::textRemoved.
1408         (WebCore::CharacterData::replaceData): Replaced call to Document::removeMarkers
1409         and Document::shiftMarkers with call to Document::textRemoved and
1410         Document::textInserted.
1411         (WebCore::CharacterData::containsOnlyWhitespace): Tweaked a bit.
1412
1413         * dom/ContainerNode.cpp:
1414         (WebCore::ContainerNode::childrenChanged): Added a call to
1415         Document::nodeChildrenChanged when the nmber of children was changed (and not
1416         by the parser).
1417         (WebCore::dispatchChildRemovalEvents): Updated for name change.
1418
1419         * dom/Document.cpp:
1420         (WebCore::Document::~Document): Assert that all ranges are gone.
1421         (WebCore::Document::nodeChildrenChanged): Added. Calls nodeChildrenChanged on
1422         all ranges.
1423         (WebCore::Document::nodeWillBeRemoved): Renamed from notifyBeforeNodeRemoval.
1424         Added code to call nodeWillBeRemoved on all ranges.
1425         (WebCore::Document::textInserted): Added. Calls textInserted on all ranges and
1426         also calls shiftMarkers.
1427         (WebCore::Document::textRemoved): Added. Calls textRemoved on all ranges and also
1428         calls removeMarkers and shiftMarkers.
1429         (WebCore::Document::textNodesMerged): Added. Calls textNodesMerged on all ranges.
1430         (WebCore::Document::textNodeSplit): Added. Calls textNodeSplit on all ranges.
1431         (WebCore::Document::attachRange): Added. Adds range to the HashSet of all ranges
1432         for this document.
1433         (WebCore::Document::detachRange): Added. Removes range from the HashSet.
1434         * dom/Document.h: Added the new functions and the data member.
1435
1436         * dom/Element.cpp:
1437         (WebCore::Element::normalizeAttributes): Added. Contains the part of the
1438         normalize function that's specific to Element. Better encapsulation to have it
1439         here rather than in Node::normalize.
1440         * dom/Element.h: Added the new function.
1441
1442         * dom/Node.cpp:
1443         (WebCore::Node::normalize): Rewrote so it's no longer recursive. Also added
1444         a call to textNodesMerged after each pair of nodes is merged but before the
1445         second node is removed.
1446         (WebCore::Node::traverseNextNodePostOrder): Added. Helper function used by
1447         normalize, but also useful elsewhere.
1448         * dom/Node.h: Added the new function.
1449
1450         * dom/NodeIterator.cpp:
1451         (WebCore::NodeIterator::nodeWillBeRemoved): Renamed from notifyBeforeNodeRemoval.
1452         * dom/NodeIterator.h: Ditto.
1453
1454         * dom/ProcessingInstruction.cpp:
1455         (WebCore::ProcessingInstruction::setData): Call textRemoved.
1456
1457         * dom/Range.cpp:
1458         (WebCore::NodeWithIndex::index): Added. Computes and stores index.
1459         (WebCore::NodeWithIndexBefore::indexBefore): Added. Computes and stores index.
1460         (WebCore::NodeWithIndexAfter::indexAfter): Added. Computes and stores index.
1461         (WebCore::Range::Range): Call attachRange.
1462         (WebCore::Range::~Range): Call detachRange unless the range is already detached.
1463         (WebCore::Range::commonAncestorContainer): Removed check for WRONG_DOCUMENT_ERR.
1464         It's no longer possible to create a range where the two containers are non-zero
1465         and have no common ancestor.
1466         (WebCore::Range::isPointInRange): Rewrote expression to be more readable.
1467         (WebCore::Range::compareNode): Changed local variable to use int for consistency.
1468         (WebCore::Range::compareBoundaryPoints): Replaced ASSERT with ASSERT_NOT_REACHED.
1469         (WebCore::Range::deleteContents): Removed check for INVALID_STATE_ERR and
1470         initialization of ec to 0; both are now inside checkDeleteExtract.
1471         (WebCore::Range::intersectsNode): Changed local variable to use int for consistency.
1472         Also changed comparison to use < 0 and >= 0 rather than checking explicitly for 1
1473         and -1.
1474         (WebCore::Range::processContents): Changed code to not get the nodeType multiple
1475         times on the same node, and tweaked formatting. Removed code to update the range
1476         on deletion, because the normal delete logic will take care of that now.
1477         (WebCore::Range::extractContents): Removed check for INVALID_STATE_ERR and
1478         initialization of ec to 0; both are now inside checkDeleteExtract.
1479         (WebCore::Range::insertNode): Changed local variable to use int for consistency.
1480         (WebCore::Range::toString): Changed variable name to pastLast.
1481         (WebCore::Range::detach): Call detachRange.
1482         (WebCore::Range::checkDeleteExtract): Added check for detached range and code to
1483         set ec to 0; moved here from the two callers. Also changed variable name to pastLast.
1484         (WebCore::endpointNodeChildrenChanged): Added.
1485         (WebCore::Range::nodeChildrenChanged): Added.
1486         (WebCore::endpointNodeWillBeRemoved): Added.
1487         (WebCore::Range::nodeWillBeRemoved): Added.
1488         (WebCore::endpointTextInserted): Added.
1489         (WebCore::Range::textInserted): Added.
1490         (WebCore::endpointTextRemoved): Added.
1491         (WebCore::Range::textRemoved): Added.
1492         (WebCore::endpointTextNodesMerged): Added.
1493         (WebCore::Range::textNodesMerged): Added.
1494         (WebCore::endpointTextNodesSplit): Added.
1495         (WebCore::Range::textNodeSplit): Added.
1496
1497         * dom/Range.h: Added new member functions.
1498
1499         * dom/NodeWithIndex.h: Added. Makes it so we won't find the index for the same
1500         node more than once.
1501         * dom/NodeWithIndexAfter.h: Added. Similar to NodeWithIndex but gives the index after a
1502         node and treats a node pointer of 0 as meaning "before first node in parent container".
1503         * dom/NodeWithIndexBefore.h: Added.  Similar to NodeWithIndex but treats a node pointer of 0
1504         as meaning "after last node in parent container".
1505
1506         * dom/Text.cpp:
1507         (WebCore::Text::splitText): Call textNodeSplit.
1508
1509         * editing/ApplyStyleCommand.cpp:
1510         (WebCore::ApplyStyleCommand::applyInlineStyle): Changed variable name to pastLast.
1511
1512 2008-03-15  Julien Chaffraix  <julien.chaffraix@gmail.com>
1513
1514         Reviewed by Holger.
1515
1516         [CURL] Crash below ResourceHandleManager::setupPOST when job->request().httpBody() is NULL
1517         http://bugs.webkit.org/show_bug.cgi?id=16906
1518
1519         Add null checks for httpBody() to match other ports.
1520
1521         Test: http/tests/xmlhttprequest/xmlhttprequest-post-crash.html
1522
1523         * platform/network/curl/ResourceHandleManager.cpp:
1524         (WebCore::readCallback): Add null check.
1525         (WebCore::ResourceHandleManager::setupPOST): Ditto.
1526
1527 2008-03-14  Steve Falkenburg  <sfalken@apple.com>
1528
1529         PGO build fixes.
1530
1531         * WebCore.vcproj/WebCore.vcproj:
1532
1533 2008-03-14  Anders Carlsson  <andersca@apple.com>
1534
1535         Reviewed by Sam.
1536
1537         <rdar://problem/5794989>
1538         https://bugs.webkit.org/show_bug.cgi?id=17792
1539         REGRESSION (Safari 3.0.4-3.1): Ordering tickets from Sweden's biggest train operator doesn't work
1540
1541         Pass the frame loader that should be used for looking up the frame name to FrameLoader::createWindow
1542         so that somewindow.open calls where the active window and 'somewindow' differ return the correct frame.
1543         
1544         * bindings/js/JSDOMWindowBase.cpp:
1545         (WebCore::createWindow):
1546         * loader/FrameLoader.cpp:
1547         (WebCore::FrameLoader::createWindow):
1548         * loader/FrameLoader.h:
1549
1550 2008-03-14  Dan Bernstein  <mitz@apple.com>
1551
1552         Reviewed by Mark Rowe.
1553
1554         - fix <rdar://problem/5797836> shadow offsets are smaller than specified
1555
1556         * platform/graphics/cg/GraphicsContextCG.cpp:
1557         (WebCore::GraphicsContext::setShadow): Made the workaround for
1558         <rdar://problem/5539388> unconditional.
1559
1560 2008-03-14  Adam Roben  <aroben@apple.com>
1561
1562         Fix it right this time
1563
1564         * platform/MainThread.cpp: Cast to unsigned so we can use %u in the
1565         format string.
1566         * platform/mac/MainThreadMac.mm:
1567
1568 2008-03-14  Adam Roben  <aroben@apple.com>
1569
1570         Mac build fix
1571
1572         * platform/mac/MainThreadMac.mm: Corrected a typo.
1573
1574 2008-03-14  Dan Bernstein  <mitz@apple.com>
1575
1576         Reviewed by Darin Adler.
1577
1578         - fix http://bugs.webkit.org/show_bug.cgi?id=17834
1579           REGRESSION: floated first-letter does not work when included in table
1580
1581         Test: fast/css/first-letter-float.html
1582
1583         * rendering/RenderBlock.cpp:
1584         (WebCore::RenderBlock::updateFirstLetter): Changed the search for the
1585         first text node to stop at a float if that float is an existing first-
1586         letter.
1587
1588 2008-03-14  Sam Weinig  <sam@webkit.org>
1589
1590         Fix Mac build
1591
1592         * WebCore.xcodeproj/project.pbxproj:
1593
1594 2008-03-13  Adam Roben  <aroben@apple.com>
1595
1596         Make most of callOnMainThread's implementation be cross-platform
1597
1598         I took the non-platform-specific parts of MainThreadWin.cpp and moved
1599         them to a new MainThread.cpp. Each platform is now responsible for
1600         implementing one function, scheduleDispatchFunctionsOnMainThread,
1601         which is supposed to set things up so that
1602         dispatchFunctionsFromMainThread gets called from the main thread in
1603         the near future.
1604
1605         Reviewed by Alexey.
1606
1607         * GNUmakefile.am: Added MainThread.cpp to the project.
1608         * WebCore.pro: Ditto.
1609         * WebCore.vcproj/WebCore.vcproj: Ditto.
1610         * WebCore.xcodeproj/project.pbxproj: Ditto.
1611         * WebCoreSources.bkl: Ditto.
1612         * platform/MainThread.cpp:
1613           - Copied from WebCore/platform/win/MainThreadWin.cpp.
1614           - Removed the Windows-specific parts.
1615         (WebCore::callOnMainThread): Changed to call
1616         scheduleDispatchFunctionsOnMainThread instead of PostMessage.
1617         * platform/gtk/MainThreadGtk.cpp:
1618         (WebCore::timeoutFired): Renamed from callFunctionOnMainThread. Now
1619         just calls dispatchFunctionsFromMainThread.
1620         (WebCore::scheduleDispatchFunctionsOnMainThread): Added. Calls through
1621         to g_timeout_add.
1622         * platform/mac/MainThreadMac.mm: Renamed WebCoreFunctionWrapper to
1623         WebCoreMainThreadCaller.
1624         (-[WebCoreMainThreadCaller call]): Calls through to
1625         dispatchFunctionsFromMainThread.
1626         (WebCore::scheduleDispatchFunctionsOnMainThread): Makes a new
1627         WebCoreMainThreadCaller and calls performSelectorOnMainThread on it.
1628         * platform/qt/MainThreadQt.cpp: Removed PerformFunctionEvent.
1629         (WebCore::MainThreadInvoker::event): Chagned to call through to
1630         dispatchFunctionsFromMainThread.
1631         (WebCore::scheduleDispatchFunctionsOnMainThread): Sends an empty event
1632         to the MainThreadInvoker.
1633         * platform/win/MainThreadWin.cpp:
1634           - Removed the non-Windows-specific parts.
1635           - Removed some unnecessary initialization of static variables to 0.
1636         (WebCore::ThreadingWindowWndProc): Changed to call
1637         dispatchFunctionsFromMainThread.
1638         (WebCore::scheduleDispatchFunctionsOnMainThread): Calls through to
1639         PostMessage.
1640         * platform/wx/MainThreadWx.cpp:
1641         (WebCore::scheduleDispatchFunctionsOnMainThread): Added.
1642
1643 2008-03-14  Beth Dakin  <bdakin@apple.com>
1644
1645         Reviewed by Geoff.
1646
1647         Fix for <rdar://problem/5728171> Potential PLT speedup: don't 
1648         realloc every time inside NamedAttrMap::addAttribute
1649
1650         The speed-up for this turned out to be so small that it is mostly 
1651         imperceptible. It is likely that it is a tiny boost, though, and 
1652         the new code is much cleaner.
1653
1654         * dom/Element.cpp:
1655         (WebCore::Element::setAttributeMap): attrs is now called 
1656         m_attributes
1657         * dom/NamedAttrMap.cpp: The array attrs is now the Vector of 
1658         RefPtrs called m_attributes, and there is no longer any need for 
1659         the len member variable. 
1660         (WebCore::NamedAttrMap::NamedAttrMap): 
1661         (WebCore::NamedAttrMap::item):
1662         (WebCore::NamedAttrMap::getAttributeItem):
1663         (WebCore::NamedAttrMap::clearAttributes):
1664         (WebCore::NamedAttrMap::operator=):
1665         (WebCore::NamedAttrMap::addAttribute):
1666         (WebCore::NamedAttrMap::removeAttribute):
1667         (WebCore::NamedAttrMap::mapsEquivalent):
1668         * dom/NamedAttrMap.h: Same.
1669         (WebCore::NamedAttrMap::length):
1670         (WebCore::NamedAttrMap::attributeItem):
1671         (WebCore::NamedAttrMap::shrinkToLength):
1672         (WebCore::NamedAttrMap::reserveCapacity):
1673         * html/HTMLTokenizer.cpp: One of the benefits of the old array was 
1674         that it never took up more memory than it needed to. So the 
1675         tokenizer utilizes new member functions on NamedAttrMap 
1676         (shrinkToLength and reserveCapacity) to try to keep memory usage at 
1677         a minimum. 
1678         (WebCore::Token::addAttribute):
1679         (WebCore::HTMLTokenizer::processToken):
1680
1681 2008-03-14  David D. Kilzer  <ddkilzer@apple.com>
1682
1683         BUILD FIX when ENABLE(MAC_JAVA_BRIDGE) set to 0.
1684
1685         * page/mac/FrameMac.mm: Move up #if ENABLE(MAC_JAVA_BRIDGE) guard
1686         to comment out unused code.
1687
1688 2008-03-14  David D. Kilzer  <ddkilzer@apple.com>
1689
1690         Unify concept of enabling the Mac Java bridge.
1691
1692         Reviewed by Darin and Anders.
1693
1694         No test cases added since there is no change in functionality.
1695
1696         * DerivedSources.make: Added check for ENABLE_MAC_JAVA_BRIDGE macro.
1697         If defined as "1", add WebCore.JNI.exp to WEBCORE_EXPORT_DEPENDENCIES.
1698         * WebCore.JNI.exp: Added.
1699         * WebCore.base.exp: Moved exported JNI methods to WebCore.JNI.exp.
1700
1701         * bridge/jni/jni_class.cpp: Added #if ENABLE(MAC_JAVA_BRIDGE) guard.
1702         * bridge/jni/jni_class.h: Ditto.
1703         * bridge/jni/jni_instance.cpp: Ditto.
1704         * bridge/jni/jni_instance.h: Ditto.
1705         * bridge/jni/jni_jsobject.cpp: Ditto.
1706         * bridge/jni/jni_jsobject.h: Ditto.
1707         * bridge/jni/jni_objc.mm: Ditto.
1708         * bridge/jni/jni_runtime.cpp: Ditto.
1709         * bridge/jni/jni_runtime.h: Ditto.
1710         * bridge/jni/jni_utility.cpp: Ditto.
1711         * bridge/jni/jni_utility.h: Ditto.
1712
1713         * bridge/runtime.cpp: Removed unused #include statements.
1714         * bridge/runtime.h:
1715         (KJS::Bindings::Instance::BindingLanguage): Added #if ENABLE(MAC_JAVA_BRIDGE)
1716         guard for JavaLanguage enum.  Also added #if PLATFORM(MAC) guard for
1717         ObjectiveCLanguage enum to match corresponding code in runtime.cpp.
1718
1719         * config.h: Removed definition of HAVE_JNI.
1720
1721         * loader/FrameLoaderClient.h:
1722         (WebCore::FrameLoaderClient::javaApplet): Added #if ENABLE(MAC_JAVA_BRIDGE) guard.
1723         * page/Frame.cpp:
1724         (WebCore::Frame::Frame): Ditto.
1725         * page/Frame.h:
1726         (WebCore::Frame::initJavaJSBindings): Ditto.
1727         * page/mac/FrameMac.mm:
1728         (WebCore::Frame::createScriptInstanceForWidget): Ditto.
1729         (WebCore::Frame::initJavaJSBindings): Ditto.
1730
1731 2008-03-13  Darin Adler  <darin@apple.com>
1732
1733         * html/PreloadScanner.h: Corrected license.
1734         * html/PreloadScanner.cpp: Corrected license.
1735
1736 2008-03-13  Mark Mentovai  <mark@moxienet.com>
1737
1738         Reviewed by darin.  Landed by eseidel.
1739
1740         * platform/FloatConversion.h: Include a header to get CoreGraphics
1741         types when using CoreGraphics types.
1742
1743 2008-03-13  Mark Mentovai  <mark@moxienet.com>
1744
1745         Reviewed by eseidel.  Landed by eseidel.
1746
1747         * WebCore.xcodeproj/project.pbxproj:
1748         * css/CSSParser.cpp:
1749         * css/makeprop.pl:
1750         Move CSSPropertyNames.c to CSSPropertyNames.cpp
1751
1752 2008-03-13  Mark Mentovai  <mark@moxienet.com>
1753
1754         Reviewed by eseidel.  Landed by eseidel.
1755
1756         * platform/Arena.h: Use statement1;statement2 instead of
1757         (statement1,statement2) in CLEAR_UNUSED.
1758
1759 2008-03-13  Tommi Komulainen  <tommi.komulainen@iki.fi>
1760
1761         Reviewed by Alp Toker.
1762
1763         http://bugs.webkit.org/show_bug.cgi?id=17821
1764         [SOUP] POST requests are empty
1765
1766         Send the HTTP request body as well.
1767
1768         * platform/network/soup/ResourceHandleSoup.cpp:
1769         (WebCore::ResourceHandle::start):
1770
1771 2008-03-13  Dan Bernstein  <mitz@apple.com>
1772
1773         Reviewed by Dave Hyatt.
1774
1775         - fix http://bugs.webkit.org/show_bug.cgi?id=17819
1776           Border-collapse: collapse later cell wins on PC, earlier cell on Mac
1777
1778         Test: fast/table/border-collapsing/equal-precedence-resolution.html
1779
1780         * rendering/RenderTableCell.cpp:
1781         (WebCore::RenderTableCell::collapsedLeftBorder): When calling
1782         compareBorders() with borders that may have the same precedence, made
1783         sure to pass the border belonging to the earlier (in document order)
1784         element first, since compareBorders() prefers the first argument when
1785         there is a tie.
1786         (WebCore::RenderTableCell::collapsedRightBorder): Ditto.
1787         (WebCore::RenderTableCell::collapsedTopBorder): Ditto.
1788
1789 2008-03-13  Adam Roben  <aroben@apple.com>
1790
1791         wx build fix and Windows leak fix after r31034
1792
1793         * platform/graphics/wx/ImageWx.cpp:
1794         (WebCore::Image::loadPlatformResource): Use SharedBuffer::create.
1795         * platform/win/SharedBufferWin.cpp:
1796         (WebCore::SharedBuffer::createWithContentsOfFile): Ditto (we were
1797         leaking the SharedBuffer here before).
1798
1799 2008-03-13  Antti Koivisto  <antti@apple.com>
1800
1801         Reviewed by Eric.
1802
1803         Correct a few issues spotted by Mike Belshe. 
1804
1805         * html/PreloadScanner.cpp:
1806         (WebCore::PreloadScanner::tokenize):
1807         * loader/loader.cpp:
1808         (WebCore::Loader::cancelRequests):
1809
1810 2008-03-13  Rodney Dawes  <dobey@wayofthemonkey.com>
1811
1812         Fix GTK+ build for SharedBuffer changes.
1813
1814         * platform/graphics/gtk/ImageGtk.cpp:
1815         (Image::loadPlatformResource):
1816
1817 2008-03-13  Steve Falkenburg  <sfalken@apple.com>
1818
1819         More PGO build fixes.
1820
1821         * WebCorePrefix.cpp:
1822
1823 2008-03-13  Antti Koivisto  <antti@apple.com>
1824
1825         Reviewed by Darin.
1826         
1827         Make page loads go fast.
1828         
1829         http://bugs.webkit.org/show_bug.cgi?id=17480
1830
1831         - Implement speculative preloading. When a script load blocks the main parser, use a side 
1832           parser to pick up more resources.
1833         - Implement per-host load queues, prioritize scripts and stylesheets over images.
1834         
1835         Depending on content and network latency this may speed things up quite a bit.
1836
1837         * WebCore.xcodeproj/project.pbxproj:
1838         * dom/Document.cpp:
1839         (WebCore::Document::implicitClose):
1840         Clear the preloads after laoding completes.
1841         
1842         * html/HTMLLinkElement.cpp:
1843         (WebCore::HTMLLinkElement::parseMappedAttribute):
1844         (WebCore::HTMLLinkElement::tokenizeRelAttribute):
1845         * html/HTMLLinkElement.h:
1846         Make tokenizeRelAttribute() public static so it can be used from elsewhere.
1847         Eliminate a pointless bitfield so I can get references.
1848         
1849         * html/HTMLTokenizer.cpp:
1850         (WebCore::HTMLTokenizer::scriptHandler):
1851         (WebCore::HTMLTokenizer::scriptExecution):
1852         (WebCore::HTMLTokenizer::write):
1853         * html/HTMLTokenizer.h:
1854         Spin up the preload scanner whenever a script load blocks the parser. One scanner tracks the end of 
1855         the document while temporary ones are created as needed to scan document.write() output.
1856         
1857         * html/PreloadScanner.cpp: Added.
1858         (WebCore::PreloadScanner::PreloadScanner):
1859         (WebCore::PreloadScanner::~PreloadScanner):
1860         (WebCore::PreloadScanner::begin):
1861         (WebCore::PreloadScanner::end):
1862         (WebCore::PreloadScanner::reset):
1863         (WebCore::PreloadScanner::write):
1864         (WebCore::isWhitespace):
1865         (WebCore::PreloadScanner::clearLastCharacters):
1866         (WebCore::PreloadScanner::rememberCharacter):
1867         (WebCore::PreloadScanner::lastCharactersMatch):
1868         (WebCore::legalEntityFor):
1869         (WebCore::PreloadScanner::consumeEntity):
1870         (WebCore::PreloadScanner::tokenize):
1871         (WebCore::PreloadScanner::processAttribute):
1872         (WebCore::PreloadScanner::emitCharacter):
1873         (WebCore::PreloadScanner::tokenizeCSS):
1874         (WebCore::PreloadScanner::emitTag):
1875         (WebCore::PreloadScanner::emitCSSRule):
1876         * html/PreloadScanner.h: Added.
1877         (WebCore::PreloadScanner::inProgress):
1878         (WebCore::PreloadScanner::):
1879         HTML5 tokenization plus some glue code. Fake CSS parsing thrown in just for fun.
1880         
1881         * loader/Cache.cpp:
1882         (WebCore::Cache::pruneDeadResources):
1883         Preloads have zero refcount, avoid kicking them out too early.
1884         
1885         * loader/CachedResource.cpp:
1886         (WebCore::CachedResource::CachedResource):
1887         (WebCore::CachedResource::ref):
1888         * loader/CachedResource.h:
1889         (WebCore::CachedResource::):
1890         (WebCore::CachedResource::preloadResult):
1891         (WebCore::CachedResource::setRequestedFromNetworkingLayer):
1892         (WebCore::CachedResource::canDelete):
1893         (WebCore::CachedResource::isPreloaded):
1894         (WebCore::CachedResource::increasePreloadCount):
1895         (WebCore::CachedResource::decreasePreloadCount):
1896         Keep track which resources are preloads. Avoid deleting them. Track
1897         at which point of the loading preloads get utilized to enable some interesting 
1898         statistics.
1899         
1900         * loader/DocLoader.cpp:
1901         (WebCore::DocLoader::~DocLoader):
1902         (WebCore::DocLoader::checkForReload):
1903         (WebCore::DocLoader::registerPreload):
1904         (WebCore::DocLoader::clearPreloads):
1905         (WebCore::DocLoader::printPreloadStats):
1906         * loader/DocLoader.h:
1907         Ensure we utilize preloaded resources during reloads.
1908         Keep a list of all preloads in the document. Clear the preloads after
1909         parsing is complete. Some debug statistics.
1910         
1911         * loader/DocumentLoader.cpp:
1912         (WebCore::DocumentLoader::isLoadingInAPISense):
1913         Avoid signaling that loading is complete too early. 
1914         
1915         * loader/loader.cpp:
1916         (WebCore::Loader::Loader):
1917         (WebCore::Loader::~Loader):
1918         (WebCore::Loader::determinePriority):
1919         (WebCore::Loader::load):
1920         (WebCore::Loader::scheduleServePendingRequests):
1921         (WebCore::Loader::requestTimerFired):
1922         (WebCore::Loader::servePendingRequests):
1923         (WebCore::Loader::cancelRequests):
1924         (WebCore::Loader::Host::Host):
1925         (WebCore::Loader::Host::~Host):
1926         (WebCore::Loader::Host::addRequest):
1927         (WebCore::Loader::Host::hasRequests):
1928         (WebCore::Loader::Host::servePendingRequests):
1929         (WebCore::Loader::Host::didFinishLoading):
1930         (WebCore::Loader::Host::didFail):
1931         (WebCore::Loader::Host::didReceiveResponse):
1932         (WebCore::Loader::Host::didReceiveData):
1933         (WebCore::Loader::Host::cancelPendingRequests):
1934         (WebCore::Loader::Host::cancelRequests):
1935         * loader/loader.h:
1936         (WebCore::Loader::):
1937         Distribute load requests to per-host priority queues. Limit the number of loads issued to the 
1938         networking layer so we have better changes of getting important requests through first.
1939         Prioritize scripts > stylesheets > images.
1940
1941 2008-03-13  David Hyatt  <hyatt@apple.com>
1942
1943         This patch makes full page zoom work pretty well. It fixes repainting so that it works when transforms
1944         are set on the RenderView. It also implements the "smart layout" behavior that other browsers support when
1945         zooming. The page will still try to constrain to the viewport size even when zoomed.
1946
1947         Reviewed by john
1948
1949         * dom/Document.cpp:
1950         (WebCore::Document::recalcStyle):
1951         Make sure to test for transform changes even when there is no zoom.  This fixes repainting issues
1952         caused by jumping from a zoomed state back to the standard size.
1953
1954         * page/FrameView.cpp:
1955         (WebCore::FrameView::adjustViewSize):
1956         Adjust for the zoom factor (the render tree is in unzoomed coordinates, but the scrollbars of the view
1957         need to handle zoomed coordinates).
1958
1959         * rendering/RenderBox.cpp:
1960         (WebCore::RenderBox::calcHeight):
1961         Fix the body-sizing-to-the-view-height quirk so that it takes the zoom factor into account when
1962         stretching to fill the viewport.
1963
1964         * rendering/RenderLayer.cpp:
1965         (WebCore::RenderLayer::updateLayerPositions):
1966         (WebCore::RenderLayer::setHasVisibleContent):
1967         Remove the FIXMEs now that absoluteClippedOverflowRect works with transforms on the RenderView.
1968
1969         * rendering/RenderView.cpp:
1970         (WebCore::RenderView::calcHeight):
1971         (WebCore::RenderView::calcWidth):
1972         Make sure the calculated width/height take the zoom factor into account in order to get the "smart layout"
1973         behavior.
1974
1975         (WebCore::RenderView::layout):
1976         When deciding whether children have to get a relayout, we need to check the zoomed width/height and not just
1977         the viewport size.
1978
1979         (WebCore::RenderView::computeAbsoluteRepaintRect):
1980         Patched to take into account transforms set on the RenderView.
1981
1982         (WebCore::RenderView::docHeight):
1983         (WebCore::RenderView::docWidth):
1984         Patched to just always use m_width and m_height initially, since those have already been adjusted for
1985         the zoom factor.
1986
1987         (WebCore::RenderView::zoomedHeight):
1988         (WebCore::RenderView::zoomedWidth):
1989         * rendering/RenderView.h:
1990         New helper methods for obtaining the adjusted width/height of the viewport taking into account the
1991         zoom factor.
1992
1993 2008-03-13  Anders Carlsson  <andersca@apple.com>
1994
1995         Build fix.
1996
1997         * WebCore.base.exp:
1998
1999 2008-03-13  Anders Carlsson  <andersca@apple.com>
2000
2001         Reviewed by Adam.
2002
2003         Get rid of actualRequest, it is not used anymore. Also, get rid of 
2004         initialRequest and replace all uses with originalRequest because those are
2005         the same thing.
2006         
2007         * loader/DocumentLoader.cpp:
2008         * loader/DocumentLoader.h:
2009         * loader/FrameLoader.cpp:
2010         (WebCore::FrameLoader::initialRequest):
2011         (WebCore::FrameLoader::originalRequestURL):
2012
2013 2008-03-13  Brady Eidson  <beidson@apple.com>
2014
2015         Reviewed by Anders
2016
2017         Convert SharedBuffer to start with a refCount of 1
2018
2019         * loader/ImageDocument.cpp:
2020         (WebCore::ImageTokenizer::finish):
2021
2022         * loader/ResourceLoader.cpp:
2023         (WebCore::ResourceLoader::addData):
2024         (WebCore::ResourceLoader::willStopBufferingData):
2025
2026         * loader/icon/IconDatabase.cpp:
2027         (WebCore::IconDatabase::defaultIcon):
2028         (WebCore::IconDatabase::getImageDataForIconURLFromSQLDatabase):
2029
2030         * loader/loader.cpp:
2031         (WebCore::Loader::didReceiveData):
2032
2033         * platform/SharedBuffer.h:
2034         (WebCore::SharedBuffer::create): Make all constructors private, add ::create() calls
2035         * platform/SharedBuffer.cpp:
2036         (WebCore::SharedBuffer::SharedBuffer): Revert to default RefCounted constructor to start with a ref count of 1
2037         (WebCore::SharedBuffer::copy):
2038         * platform/mac/SharedBufferMac.mm:
2039         (WebCore::SharedBuffer::wrapNSData):
2040         (WebCore::SharedBuffer::SharedBuffer): Revert to default RefCounted constructor to start with a ref count of 1
2041
2042 2008-03-13  Steve Falkenburg  <sfalken@apple.com>
2043
2044         PGO build fixes.
2045         
2046         Disable PGO for normal release builds.
2047         Added work-in-progress Release_PGOInstrument/Release_PGOOptimize targets.
2048
2049         * WebCore.vcproj/WebCore.vcproj:
2050
2051 2008-03-13  Anders Carlsson  <andersca@apple.com>
2052
2053         Reviewed by Darin.
2054
2055         Make a bunch of DocumentLoader setters/getters inline.
2056         
2057         * loader/DocumentLoader.cpp:
2058         * loader/DocumentLoader.h:
2059         (WebCore::DocumentLoader::isStopping):
2060         (WebCore::DocumentLoader::setCommitted):
2061         (WebCore::DocumentLoader::isCommitted):
2062         (WebCore::DocumentLoader::isLoading):
2063         (WebCore::DocumentLoader::setLoading):
2064         (WebCore::DocumentLoader::response):
2065         (WebCore::DocumentLoader::mainDocumentError):
2066         (WebCore::DocumentLoader::setResponse):
2067         (WebCore::DocumentLoader::isClientRedirect):
2068         (WebCore::DocumentLoader::setIsClientRedirect):
2069         (WebCore::DocumentLoader::overrideEncoding):
2070         (WebCore::DocumentLoader::responses):
2071         (WebCore::DocumentLoader::triggeringAction):
2072         (WebCore::DocumentLoader::setTriggeringAction):
2073         (WebCore::DocumentLoader::setOverrideEncoding):
2074         (WebCore::DocumentLoader::setLastCheckedRequest):
2075         (WebCore::DocumentLoader::lastCheckedRequest):
2076         (WebCore::DocumentLoader::title):
2077         (WebCore::DocumentLoader::setLoadingFromCachedPage):
2078         (WebCore::DocumentLoader::isLoadingFromCachedPage):
2079
2080 2008-03-13  Rodney Dawes  <dobey@wayofthemonkey.com>
2081
2082         Fix builds without SVG enabled.
2083
2084         * page/Frame.cpp:
2085         (Frame::shouldApplyTextZoom):
2086         (Frame::shouldApplyPageZoom):
2087
2088 2008-03-13  Simon Hausmann  <hausmann@webkit.org>
2089
2090         Fix the Qt build.
2091
2092         * bridge/qt/qt_instance.cpp:
2093         (KJS::Bindings::QtInstance::getQtInstance):
2094         (KJS::Bindings::QtInstance::getRuntimeObject):
2095         * bridge/qt/qt_instance.h:
2096         (KJS::Bindings::QtInstance::create):
2097         * bridge/qt/qt_runtime.cpp:
2098         (KJS::Bindings::convertQVariantToValue):
2099         (KJS::Bindings::QtConnectionObject::execute):
2100         * page/qt/FrameQt.cpp:
2101         (WebCore::Frame::createScriptInstanceForWidget):
2102
2103 2008-03-12  Sam Weinig  <sam@webkit.org>
2104
2105         Reviewed by Darin Adler.
2106
2107         Fix <rdar://problem/5784773>
2108         Crash loading QT movies @ apple.com/ipodtouch/features.html with a PAC file (WebKitThreadingException)
2109
2110         Make bridged RuntimeObjects get collected on the main thread only. This is necessary
2111         because clients of the bridged objects are unlikely to prepared for a collection on 
2112         non-main thread, which can happen with a PAC file.
2113
2114         * bridge/runtime_object.cpp:
2115         (RuntimeObjectImp::RuntimeObjectImp):
2116
2117 2008-03-12  Adam Roben  <aroben@apple.com>
2118
2119         Fix Bug 17815: Inspector's DOM tree should descend into subframes
2120
2121         <http://bugs.webkit.org/show_bug.cgi?id=17815>
2122
2123         Reviewed by Tim.
2124
2125         * page/inspector/DocumentPanel.js:
2126         (WebInspector.DocumentPanel.revealNode): Changed to provide
2127         _isAncestorIncludingParentFramesWithinPanel and
2128         _parentNodeOrFrameElementWithinPanel for the isAncestor and getParent
2129         parameters to findTreeElement so that parent frames will be searched.
2130         (WebInspector.DocumentPanel.updateBreadcrumb):
2131           - Changed while loop to for loop
2132           - Use _parentNodeOrFrameElementWithinPanel instead of
2133             Node.parentNode to move to the next node
2134           - The loop now ends when we reach the DocumentPanel's document node
2135           - Traversal past other Document nodes is now allowed
2136           - We add the "start" class to the final crumb after the loop exits
2137         (WebInspector.DocumentPanel._getDocumentForNode): Added. Simple helper
2138         that returns the node itself if the node is a Document node, or the
2139         node's ownerDocument otherwise.
2140         (WebInspector.DocumentPanel._parentNodeOrFrameElementWithinPanel):
2141         Added. Returns the node's parent node or, in the case of a Document
2142         node, the node's window's owning frame element, but will not return a
2143         node that is in a parent frame of the DocumentPanel's Document.
2144         (WebInspector.DocumentPanel._isAncestorIncludingParentFramesWithinPanel):
2145         Added. Returns true if a is an ancestor of b if a is an ancestor of a
2146         frame element whose subframe(s) contain b.
2147         (WebInspector.DOMNodeTreeElement): We now consider ourselves to have
2148         children if we have a contentDocument.
2149         (WebInspector.DOMNodeTreeElement.onpopulate): Moved the appendChild
2150         loop into a function so that we can add both children of our
2151         contentDocument and children of our node to the tree.
2152         (WebInspector.DOMNodeTreeElement.ondblclick): Changed so that we get
2153         the rootDOMNode by traversing the tree outline hierarchy instead of
2154         the DOM hierarchy so that we can easily jump up to a parent frame.
2155
2156 2008-03-12  Adam Roben  <aroben@apple.com>
2157
2158         Update the styles/metrics panes and breadcrumb after editing DOM
2159         attributes
2160
2161         Reviewed by Tim.
2162
2163         * page/inspector/DocumentPanel.js:
2164         (WebInspector.DocumentPanel.set focusedDOMNode): Moved code to update
2165         the parts of the DocumentPanel other than the DOM tree into a new
2166         function, _focusedNodeChanged.
2167         (WebInspector.DocumentPanel._focusedNodeChanged): Added. The
2168         forceUpdate parameter specifies whether the update should occur even
2169         if the focused node hasn't changed since the last update.
2170         (WebInspector.DocumentPanel.updateBreadcrumb): Added a forceUpdate
2171         parameter. If forceUpdate is true, we always rebuild the breadcrumbs.
2172         (WebInspector.DocumentPanel.updateStyles): Added a forceUpdate
2173         parameter. If forceUpdate is true, we always rebuild the styles pane.
2174         (WebInspector.DOMNodeTreeElement._attributeEditingCommitted): Added a
2175         call to DocumentPanel._focusedNodeChanged. We have to force the update
2176         because we haven't changed the focused node (the attributes of the
2177         node have changed).
2178         * page/inspector/StylesSidebarPane.js:
2179         (WebInspector.StylesSidebarPane.update): Added a forceUpdate
2180         parameter. If forceUpdate is true we always rebuild the styles.
2181
2182 2008-03-12  Mark Rowe  <mrowe@apple.com>
2183
2184         Further Gtk and Qt build fixes.
2185
2186         * bridge/runtime.cpp:
2187         (KJS::Bindings::Instance::createRuntimeObject): Adapt Qt-only code for change to PassRefPtr.
2188         * page/gtk/FrameGtk.cpp: Add missing include.
2189
2190 2008-03-12  Mark Rowe  <mrowe@apple.com>
2191
2192         Fix Gtk and Qt builds.
2193
2194         * page/gtk/FrameGtk.cpp:
2195         * page/qt/FrameQt.cpp:
2196
2197 2008-03-12  Mark Rowe  <mrowe@apple.com>
2198
2199         Mac build fix.
2200
2201         * WebCore.base.exp:  Remove symbol.
2202
2203 2008-03-12  Steve Falkenburg  <sfalken@apple.com>
2204
2205         Build fix.
2206
2207         * page/win/FrameWin.cpp:
2208
2209 2008-03-12  Steve Falkenburg  <sfalken@apple.com>
2210
2211         Build fix.
2212
2213         * plugins/win/PluginViewWin.cpp:
2214         (WebCore::PluginView::bindingInstance):
2215
2216 2008-03-12  Darin Adler  <darin@apple.com>
2217
2218         Reviewed by Anders.
2219
2220         - http://bugs.webkit.org/show_bug.cgi?id=17640
2221           eliminate WebCoreFrameBridge
2222
2223         * WebCore.base.exp: Added more exports, needed by code moved from WebCoreFrameBridge
2224         to WebFrame in WebKit.
2225         * WebCore.xcodeproj/project.pbxproj: Added more headers, same reason. Also deleted
2226         WebCoreFrameBridge.h and WebCoreFrameBridge.mm.
2227
2228         * page/Frame.cpp:
2229         (WebCore::Frame::Frame): Added call to initJavaJSBindings(), formerly handled by
2230         the WebCoreFrameBridge.
2231         * page/Frame.h: Added initJavaJSBindings function.
2232
2233         * page/mac/FrameMac.mm:
2234         (WebCore::updateRenderingForBindings): Moved here from WebCoreFrameBridge.
2235         (WebCore::Frame::initJavaJSBindings): Ditto; code was in the init function.
2236
2237         * page/mac/WebCoreFrameBridge.h: Removed.
2238         * page/mac/WebCoreFrameBridge.mm: Removed.
2239
2240 2008-03-12  Sam Weinig  <sam@webkit.org>
2241
2242         Reviewed by Anders Carlsson.
2243
2244         Don't go through the Document just to get the frame Element.
2245
2246         * page/DOMWindow.cpp:
2247         (WebCore::DOMWindow::frameElement):
2248
2249 2008-03-12  Anders Carlsson  <andersca@apple.com>
2250
2251         Reviewed by Geoff and Sam.
2252
2253         More Instance cleanup:
2254         
2255         * Make Instance inherit from RefCounted instead of doing its own refcounting.        
2256         * Make all Instance subclasses private, add static create methods.         
2257         * Have Instance start out with a refcount of 1.
2258         * Get rid of Instance::createBindingForLanguageInstance and call the individual 
2259           instance constructor methods instead.
2260         * Fix many methods to take and return PassRefPtr<Instance> to ensure that the
2261           refcounting is done correctly.
2262          
2263         * bridge/c/c_instance.h:
2264         (KJS::Bindings::CInstance::create):
2265         * bridge/c/c_utility.cpp:
2266         (KJS::Bindings::convertNPVariantToValue):
2267         * bridge/jni/jni_instance.cpp:
2268         (JavaInstance::invokeMethod):
2269         * bridge/jni/jni_instance.h:
2270         (KJS::Bindings::JavaInstance::create):
2271         * bridge/jni/jni_jsobject.cpp:
2272         (JavaJSObject::convertJObjectToValue):
2273         * bridge/jni/jni_runtime.cpp:
2274         (JavaField::valueFromInstance):
2275         (JavaArray::valueAt):
2276         * bridge/objc/objc_instance.h:
2277         (KJS::Bindings::ObjcInstance::create):
2278         * bridge/objc/objc_utility.mm:
2279         (KJS::Bindings::convertObjcValueToValue):
2280         * bridge/qt/qt_instance.cpp:
2281         (KJS::Bindings::QtRuntimeObjectImp::QtRuntimeObjectImp):
2282         (KJS::Bindings::QtInstance::getQtInstance):
2283         (KJS::Bindings::QtInstance::getRuntimeObject):
2284         * bridge/qt/qt_instance.h:
2285         * bridge/runtime.cpp:
2286         (KJS::Bindings::Instance::Instance):
2287         (KJS::Bindings::Instance::createRuntimeObject):
2288         * bridge/runtime.h:
2289         * bridge/runtime_object.cpp:
2290         (RuntimeObjectImp::RuntimeObjectImp):
2291         * bridge/runtime_object.h:
2292         * page/Frame.h:
2293         * page/mac/FrameMac.mm:
2294         (WebCore::Frame::createScriptInstanceForWidget):
2295         * page/win/FrameWin.cpp:
2296         (WebCore::Frame::createScriptInstanceForWidget):
2297         * plugins/PluginView.h:
2298         * plugins/win/PluginViewWin.cpp:
2299         (WebCore::PluginView::bindingInstance):
2300
2301 2008-03-12  Dan Bernstein  <mitz@apple.com>
2302
2303         Suggested by Darin Adler. Reviewed by Dave Hyatt.
2304
2305         - speed up BidiIterator::direction()
2306
2307         * rendering/bidi.cpp:
2308         (WebCore::BidiIterator::current): Made inline and corrected the
2309         out-of-bounds condition to work with 0-length text and offsets beyond
2310         the end of the text.
2311         (WebCore::BidiIterator::direction): Changed to call current() and not
2312         call the virtual method isListMarker() most of the time.
2313         (WebCore::addMidpoint): Removed unnecessary null-check of smidpoints.
2314         (WebCore::appendRunsForObject): Ditto.
2315
2316 2008-03-12  Adam Roben  <aroben@apple.com>
2317
2318         Make URLs not be underlined while editing them in the DOM view
2319
2320         Reviewed by Tim.
2321
2322         * page/inspector/inspector.css:
2323
2324 2008-03-12  Adam Roben  <aroben@apple.com>
2325
2326         Part of Bug 17224: DOM nodes/attributes should be editable
2327
2328         <http://bugs.webkit.org/show_bug.cgi?id=17224>
2329         <rdar://problem/5732825>
2330
2331         We now start editing if the user single-clicks on an attribute,
2332         attribute value, or text node while the parent element is selected.
2333         Previously, we started editing on double-click regardless of the
2334         selection state of the element.
2335
2336         URLs in the DOM tree are now followed on Alt/Option-click, rather than
2337         on just click.
2338
2339         Reviewed by Tim.
2340
2341         * English.lproj/InspectorLocalizedStrings.js: Added four new localized
2342         strings.
2343         * page/inspector/DocumentPanel.js:
2344         (WebInspector.DOMNodeTreeElement.onattach): Call new
2345         _makeURLSActivateOnModifiedClick.
2346         (WebInspector.DOMNodeTreeElement._makeURLsActivateOnModifiedClick):
2347         Added. Changes the tooltip of each link in this element to indicate
2348         that Alt/Option-click will follow the URL, and sets the
2349         followOnAltClick property on each link.
2350         (WebInspector.DOMNodeTreeElement.onselect): Mark that we're being
2351         selected.
2352         (WebInspector.DOMNodeTreeElement.onmousedown): If we're not currently
2353         being selected, start editing.
2354         (WebInspector.DOMNodeTreeElement.ondblclick): We no longer start
2355         editing here. We block re-rooting of the tree if we're currently
2356         editing.
2357         (WebInspector.DOMNodeTreeElement._startEditing):
2358           - Don't do anything if we're not focused
2359           - Pass the event down to _startEditingAttribute.
2360         (WebInspector.DOMNodeTreeElement._startEditingAttribute): Don't do
2361         anything if the event target is a URL and the Alt/Option key is
2362         pressed -- in this case we want to follow the link.
2363         (WebInspector.DOMNodeTreeElement._updateTitle): Call
2364         _makeURLsActivateOnClick again since the anchor elements have all been
2365         recreated.
2366         * page/inspector/inspector.js:
2367         (WebInspector.documentClick): If the anchor as a followOnAltClick
2368         property and the Alt/Option key is not pressed, do nothing.
2369
2370 2008-03-12  Ada Chan  <adachan@apple.com>
2371
2372         Fixed the initial value of zoom factor.
2373
2374         Reviewed by Adam.
2375
2376         * page/Frame.cpp:
2377         (WebCore::FramePrivate::FramePrivate):
2378
2379 2008-03-12  David Hyatt  <hyatt@apple.com>
2380
2381         Make full page zoom vaguely work.  This patch uses the CSS transform system to turn on full page zoom at the
2382         document level.  There are many many bugs that I'm going to file to track all the issues (most of the issues
2383         are just bugs with transforms themselves).
2384
2385         Reviewed by Adam Roben
2386
2387         * css/CSSStyleSelector.cpp:
2388         (WebCore::CSSStyleSelector::applyProperty):
2389         (WebCore::CSSStyleSelector::getComputedSizeFromSpecifiedSize):
2390         * dom/Document.cpp:
2391         (WebCore::Document::recalcStyle):
2392         * page/Frame.cpp:
2393         (WebCore::Frame::shouldApplyTextZoom):
2394         (WebCore::Frame::shouldApplyPageZoom):
2395         * page/Frame.h:
2396         * rendering/RenderLayer.cpp:
2397         (WebCore::RenderLayer::updateLayerPositions):
2398         (WebCore::RenderLayer::setHasVisibleContent):
2399         (WebCore::RenderLayer::paintLayer):
2400         (WebCore::RenderLayer::hitTestLayer):
2401         * rendering/RenderLayer.h:
2402
2403 2008-03-12  David Hyatt  <hyatt@apple.com>
2404
2405         Make the zoom factor a float and not a percent.
2406
2407         Reviewed by antti
2408
2409         * WebCore.base.exp:
2410         * css/CSSStyleSelector.cpp:
2411         (WebCore::CSSStyleSelector::applyProperty):
2412         (WebCore::CSSStyleSelector::getComputedSizeFromSpecifiedSize):
2413         * page/Frame.cpp:
2414         (WebCore::Frame::zoomFactor):
2415         (WebCore::Frame::setZoomFactor):
2416         * page/Frame.h:
2417         * page/FramePrivate.h:
2418         * svg/SVGSVGElement.cpp:
2419         (WebCore::SVGSVGElement::currentScale):
2420         (WebCore::SVGSVGElement::setCurrentScale):
2421
2422 2008-03-12  David Hyatt  <hyatt@apple.com>
2423
2424         Eliminate setTextMultiplier from the bridge.  Make Webkit just call setZoomFactor on the frame directly.
2425
2426         Reviewed by Tim H.
2427
2428         * WebCore.base.exp:
2429         * page/mac/WebCoreFrameBridge.h:
2430         * page/mac/WebCoreFrameBridge.mm:
2431
2432 2008-03-12  Dan Bernstein  <mitz@apple.com>
2433
2434         Reviewed by Darin Adler and Sam Weinig.
2435
2436         - <rdar://problem/4433248> use CoreText API instead of SPI on Leopard
2437
2438         Use CTFontCopyGraphicsFont and CTFontGetPlatformFont on Leopard instead
2439         of wkGetCGFontFromNSFont and wkGetNSFontATSUFontId, relying on NSFont
2440         and CTFontRef being toll-free bridged.
2441
2442         * WebCore.Tiger.exp:
2443         * WebCore.base.exp:
2444         * platform/graphics/mac/FontMac.mm:
2445         (WebCore::Font::drawGlyphs): Changed to use the cgFont() accessor.
2446         * platform/graphics/mac/FontPlatformData.h:
2447         Made m_cgFont a RetainPtr on Leopard.
2448         (WebCore::toCTFontRef): Added a function that encapsulates the
2449         toll-free bridging.
2450         (WebCore::FontPlatformData::FontPlatformData):
2451         (WebCore::FontPlatformData::cgFont): Added this accessor method.
2452         * platform/graphics/mac/FontPlatformDataMac.mm:
2453         (WebCore::FontPlatformData::FontPlatformData): Changed to use
2454         CoreText API on Leopard.
2455         (WebCore::FontPlatformData::setFont): Ditto.
2456         * platform/graphics/mac/SimpleFontDataMac.mm:
2457         (WebCore::initFontData):
2458         (WebCore::pathFromFont):
2459         (WebCore::SimpleFontData::platformInit):
2460         (WebCore::SimpleFontData::platformWidthForGlyph):
2461         * platform/mac/WebCoreSystemInterface.mm:
2462
2463 2008-03-12  David Harrison  <harrison@apple.com>
2464
2465         Reviewed by Darin.
2466
2467         <rdar://problem/5607382> CrashTracer: [REGRESSION] 2290 crashes in Safari at com.apple.WebCore: -[WebCoreAXObject isWebArea] + 8
2468
2469         The problem was that we lost track of the AX cache for a subframe when Frame::disconnectOwnerElement() was
2470         called, so we were unable to locate the AXObjects to de-register from AppKit's accessibility registry.
2471         Also saw that cache clearing was missing from Document::detach(), and fixed that.
2472         
2473         Also added a debug-only check that AXObjectCache::remove() not finding the AXObject is expected.
2474         
2475         Lastly, RenderWidget::destroy() now skips trying to remove the AXObject if accessibility has never been enabled.
2476        
2477         * dom/Document.cpp:
2478         (WebCore::Document::attach):
2479         Assert that there is no AX cache (since there is no renderer).
2480         
2481         (WebCore::Document::detach):
2482         Destroy the AX cache installed on this document.
2483         
2484         (WebCore::Document::clearAXObjectCache):
2485         New. Destroy the AX cache associated with this document.
2486         
2487         (WebCore::Document::axObjectCache):
2488         Added some comments.
2489         
2490         * dom/Document.h:
2491         Declare clearAXObjectCache().
2492         
2493         * page/Frame.cpp:
2494         (WebCore::Frame::disconnectOwnerElement):
2495         Destroy the AX cache associated with this frame's document.
2496         
2497         * page/mac/AXObjectCacheMac.mm:
2498         (WebCore::AXObjectCache::remove):        
2499         * page/mac/WebCoreAXObject.mm:
2500         (-[WebCoreAXObject initWithRenderer:]):
2501         (-[WebCoreAXObject detach]):
2502         * rendering/RenderObject.cpp:
2503         (WebCore::RenderObject::RenderObject):
2504         (WebCore::RenderObject::~RenderObject):
2505         * rendering/RenderObject.h:
2506         (WebCore::RenderObject::setHasAXObject):
2507         (WebCore::RenderObject::hasAXObject):
2508         Add debug-only check that AXObjectCache::remove() not finding the AXObject is expected.
2509         
2510         * rendering/RenderWidget.cpp:
2511         (WebCore::RenderWidget::destroy):
2512         Skip call to remove the AXObject if accessibility has never been enabled. A simple speed optimization in the
2513         very common case that the accessibility APIs are not being used. Same as in RenderObject::destroy().
2514
2515 2008-03-12  Xan Lopez  <xan@gnome.org>
2516
2517         Reviewed by Alp Toker.
2518
2519         http://bugs.webkit.org/show_bug.cgi?id=15229
2520
2521         Add Pango font backend.
2522
2523         Original patch by Sven Herzberg <sven@imendio.com>
2524
2525         * GNUmakefile.am:
2526         * platform/graphics/gtk/FontCacheGtk.cpp:
2527         (WebCore::FontCache::fontExists):
2528         * platform/graphics/gtk/FontCustomPlatformDataPango.cpp: Added.
2529         (WebCore::FontCustomPlatformData::~FontCustomPlatformData):
2530         (WebCore::FontCustomPlatformData::fontPlatformData):
2531         (WebCore::releaseData):
2532         (WebCore::createFontCustomPlatformData):
2533         * platform/graphics/gtk/FontPlatformData.h:
2534         (WebCore::FontPlatformData::FontPlatformData):
2535         (WebCore::FontPlatformData::hash):
2536         * platform/graphics/gtk/FontPlatformDataPango.cpp: Added.
2537         (WebCore::FontPlatformData::FontPlatformData):
2538         (WebCore::FontPlatformData::init):
2539         (WebCore::FontPlatformData::~FontPlatformData):
2540         (WebCore::FontPlatformData::isFixedPitch):
2541         (WebCore::FontPlatformData::setFont):
2542         (WebCore::FontPlatformData::operator==):
2543         * platform/graphics/gtk/GlyphPageTreeNodePango.cpp: Added.
2544         (WebCore::pango_font_get_glyph):
2545         (WebCore::GlyphPage::fill):
2546         * platform/graphics/gtk/SimpleFontDataPango.cpp: Added.
2547         (WebCore::SimpleFontData::platformInit):
2548         (WebCore::SimpleFontData::platformDestroy):
2549         (WebCore::SimpleFontData::smallCapsFontData):
2550         (WebCore::SimpleFontData::containsCharacters):
2551         (WebCore::SimpleFontData::determinePitch):
2552         (WebCore::SimpleFontData::platformWidthForGlyph):
2553         (WebCore::SimpleFontData::setFont):
2554
2555 2008-03-12  Justin Garcia  <justin.garcia@apple.com>
2556
2557         Reviewed by Oliver.
2558         
2559         <rdar://problem/5770834> Crash at InsertTextCommand::prepareForTextInsertion() doing RemoveFormat in a certain list
2560         
2561         Fixes some (but not all) of the instances of:
2562         <rdar://problem/5659795> CrashTracer: [REGRESSION] 187 crashes in Safari at com.apple.WebCore: WebCore::InsertTextCommand::prepareForTextInsertion + 241
2563         <rdar://problem/5779631> CrashTracer: [USER] 25 crashes in Mail at WebCore::InsertTextCommand::prepareForTextInsertion
2564
2565         * editing/InsertLineBreakCommand.cpp:
2566         (WebCore::InsertLineBreakCommand::doApply): applyStyle may have destroyed content that held
2567         the old endingSelection(), so we must recompute it.  Added a FIXME.  Added a few comments.
2568         * editing/RemoveFormatCommand.cpp:
2569         (WebCore::RemoveFormatCommand::doApply): Added a FIXME.
2570
2571 2008-03-11  Alexey Proskuryakov  <ap@webkit.org>
2572
2573         Reviewed by Darin.
2574
2575         <rdar://problem/5640615> REGRESSION (Safari 2-3): Changing subframe encoding rules broke
2576         some sites.
2577
2578         Other browsers' behavior keeps changing; let's implement what Firefox and Opera do now:
2579         if the frame and subframe belong to the same site, then the encoding is inherited from parent
2580         frame to subframe. Otherwise, it is not.
2581
2582         Always inheriting the encoding would cause a security problem.
2583
2584         Tests: http/tests/misc/frame-default-enc-different-domain.html
2585                http/tests/misc/frame-default-enc-same-domain.html
2586                fast/encoding/frame-default-enc.html
2587
2588         * loader/FrameLoader.cpp:
2589         (WebCore::FrameLoader::write): Also removed a check for m_frame->document() being non-null -
2590         this function also has code that uses it without checking, so it must be safe.
2591
2592 2008-03-12  Mark Rowe  <mrowe@apple.com>
2593
2594         Gtk build fix.
2595
2596         * page/Frame.h: Forward-declare FramePrivate.
2597
2598 2008-03-11  Steve Falkenburg  <sfalken@apple.com>
2599
2600         Disable LTCG/PGO for all of WebCore for now.
2601         We'll re-enable this as part of follow-on PGO work.
2602         
2603         Reviewed by Oliver.
2604
2605         * WebCore.vcproj/WebCore.vcproj:
2606
2607 2008-03-11  Darin Adler  <darin@apple.com>
2608
2609         Reviewed by Sam.
2610
2611         - remove all bridge-related things from WebCore except the bridge itself
2612
2613         * WebCore.base.exp: Removed the bridge and setBridge functions.
2614
2615         * loader/FrameLoader.cpp:
2616         (WebCore::FrameLoader::detachFromParent): Removed call to the bridge's
2617         close method.
2618
2619         * page/Frame.cpp:
2620         (WebCore::Frame::~Frame): Removed call to setBridge(0).
2621         (WebCore::FramePrivate::FramePrivate): Removed initialization of m_bridge.
2622         * page/Frame.h: Removed setBridge and bridge functions.
2623         * page/FramePrivate.h: Removed m_bridge pointer.
2624         * page/mac/FrameMac.mm: Removed setBridge and bridge functions.
2625
2626         * page/mac/WebCoreFrameBridge.h: Added setWebCoreFrame: method.
2627         Removed bridgeForDOMDocument: and clearFrame methods.
2628         * page/mac/WebCoreFrameBridge.mm: Ditto.
2629         (-[WebCoreFrameBridge close]): Changed to set m_frame to 0 directly.
2630         (-[WebCoreFrameBridge setWebCoreFrame:]): Added.
2631
2632 2008-03-11  Darin Adler  <darin@apple.com>
2633
2634         - restored some code I removed in the Range change; this code can't go
2635           until the rest of the Range fix is in
2636
2637         * dom/Range.cpp:
2638         (WebCore::Range::commonAncestorContainer): Added back the check for 0
2639         that I removed erroneously in the Range patch.
2640         (WebCore::Range::processContents): Left in assertions I used to debug
2641         this.
2642
2643 2008-03-11  Darin Adler  <darin@apple.com>
2644
2645         - fix Release build
2646
2647         * platform/mac/ScrollViewMac.mm:
2648         (WebCore::ScrollView::setContentsPos): Don't use NSMakePoint.
2649
2650 2008-03-11  Darin Adler  <darin@apple.com>
2651
2652         Reviewed by Anders.
2653
2654         - simplify Mac code for ScrollView, since it's used only for FrameView
2655           and not in two different modes like it was historically
2656         - remove code depending on the bridge to get from an NSView to a WebCore::Frame
2657
2658         * bindings/objc/DOMHTML.mm:
2659         (-[DOMHTMLInputElement _rectOnScreen]): getDocumentView -> documentView.
2660
2661         * bridge/jni/jni_jsobject.cpp:
2662         (createRootObject): Instead of using WebCoreViewFactory to find the frame given
2663         and NSView, use the WebCoreFrameView interface to do it.
2664
2665         * editing/mac/EditorMac.mm:
2666         (WebCore::Editor::paste): getDocumentView -> documentView.
2667         * editing/mac/SelectionControllerMac.mm:
2668         (WebCore::SelectionController::notifyAccessibilityForSelectionChange): Ditto.
2669
2670         * page/FrameView.h: Fixed comment.
2671
2672         * page/InspectorController.cpp:
2673         (WebCore::InspectorController::drawNodeHighlight): Removed uneeded typecasts
2674         to ScrollView* since FrameView is derived from ScrollView.
2675
2676         * page/mac/EventHandlerMac.mm:
2677         (WebCore::EventHandler::focusDocumentView): getDocumentView -> documentView.
2678         * page/mac/FrameMac.mm:
2679         (WebCore::Frame::imageFromRect): Ditto.
2680         * page/mac/WebCoreAXObject.mm:
2681         (-[WebCoreAXObject position]): Ditto.
2682         (-[WebCoreAXObject doAXTextMarkerForPosition:]): Ditto.
2683         (-[WebCoreAXObject rendererForView:]): Updated code that used to use
2684         WebCoreBridgeHolder to use WebCoreFrameView instead.
2685
2686         * page/mac/WebCoreFrameBridge.mm:
2687         (-[WebCoreFrameBridge computePageRectsWithPrintWidthScaleFactor:printHeight:]):
2688         getDocumentView -> documentView.
2689
2690         * page/mac/WebCoreFrameView.h: Removed the WebCoreScrollbarMode type; we just
2691         use WebCore::ScrollbarMode directly. Renamed the WebCoreFrameView protocol to
2692         WebCoreFrameScrollView, since it's a protocol for the scroll view, not the
2693         frame view itself. Replaced WebCoreBridgeHolder protocol with WebCoreFrameView
2694         protocol, which returns a WebCore::Frame directly rather than a bridge.
2695
2696         * page/mac/WebCoreViewFactory.h: Eliminated the bridgeForView method.
2697
2698         * platform/ScrollView.h: Moved the constructor and destructor out of the
2699         class-specific #if blocks. Renamed Mac-specific function that gets the
2700         NSView for from getDocumentView to documentView and a scrollView function
2701         that returns an appropriately classed NSScrollView.
2702
2703         * platform/graphics/MediaPlayer.h: Changed type of parentWidget to FrameView
2704         instead of Widget.
2705         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2706         (WebCore::MediaPlayerPrivate::createQTMovieView): Removed unnecessary cast.
2707
2708         * platform/mac/PopupMenuMac.mm:
2709         (WebCore::PopupMenu::show): getDocumentView -> documentView.
2710         * platform/mac/ScrollViewMac.mm:
2711         (WebCore::ScrollView::ScrollView): Added.
2712         (WebCore::ScrollView::~ScrollView): Added.
2713         (WebCore::ScrollView::scrollView): Added.
2714         (WebCore::ScrollView::visibleWidth): Removed unused non-NSScrollView case.
2715         (WebCore::ScrollView::visibleHeight): Ditto.
2716         (WebCore::ScrollView::visibleContentRect): Ditto.
2717         (WebCore::ScrollView::visibleContentRectConsideringExternalScrollers): Ditto.
2718         (WebCore::ScrollView::contentsWidth): Ditto.
2719         (WebCore::ScrollView::contentsHeight): Ditto.
2720         (WebCore::ScrollView::contentsX): Ditto.
2721         (WebCore::ScrollView::contentsY): Ditto.
2722         (WebCore::ScrollView::scrollOffset): Ditto.
2723         (WebCore::ScrollView::scrollRectIntoViewRecursively): Ditto.
2724         (WebCore::ScrollView::setContentsPos): Ditto.
2725         (WebCore::ScrollView::setVScrollbarMode): Ditto.
2726         (WebCore::ScrollView::setHScrollbarMode): Ditto.
2727         (WebCore::ScrollView::setScrollbarsMode): Ditto.
2728         (WebCore::ScrollView::vScrollbarMode): Ditto.
2729         (WebCore::ScrollView::hScrollbarMode): Ditto.
2730         (WebCore::ScrollView::suppressScrollbars): Ditto.
2731         (WebCore::ScrollView::addChild): Ditto.
2732         (WebCore::ScrollView::resizeContents): Ditto.
2733         (WebCore::ScrollView::updateContents): Ditto.
2734         (WebCore::ScrollView::contentsToWindow): Ditto.
2735         (WebCore::ScrollView::windowToContents): Ditto.
2736         (WebCore::ScrollView::setStaticBackground): Ditto.
2737         (WebCore::ScrollView::documentView): Renamed and removed unused case.
2738         (WebCore::ScrollView::scrollbarUnderMouse): Removed incorrect comment.
2739
2740         * platform/mac/WidgetMac.mm:
2741         (WebCore::Widget::getOuterView): Update for protocol name change.
2742
2743         * rendering/RenderThemeMac.mm:
2744         (WebCore::RenderThemeMac::paintCheckbox): getDocumentView -> documentView.
2745         (WebCore::RenderThemeMac::paintRadio): Ditto.
2746         (WebCore::RenderThemeMac::paintButton): Ditto.
2747         (WebCore::RenderThemeMac::paintMenuList): Ditto.
2748         (WebCore::RenderThemeMac::paintSliderThumb): Ditto.
2749         (WebCore::RenderThemeMac::paintSearchField): Ditto.
2750         (WebCore::RenderThemeMac::paintSearchFieldCancelButton): Ditto.
2751         (WebCore::RenderThemeMac::paintSearchFieldResultsDecoration): Ditto.
2752         (WebCore::RenderThemeMac::paintSearchFieldResultsButton): Ditto.
2753
2754 2008-03-11  Brent Fulgham  <bfulgham@gmail.com>
2755
2756         Reviewed by Adam Roben.
2757
2758         Split CookieJarWin.cpp into CFNet and non-CFNet versions to
2759         reduce the massive amount of conditionalization in the file.
2760         (see http://bugs.webkit.org/show_bug.cgi?id=17788)
2761
2762         * WebCore.vcproj/WebCore.vcproj:
2763         * platform/network/win/CookieJarCFNetWin.cpp: Copied from WebCore/platform/network/win/CookieJarWin.cpp.
2764         (WebCore::setCookies):
2765         (WebCore::cookies):
2766         (WebCore::cookiesEnabled):
2767         * platform/network/win/CookieJarWin.cpp:
2768         (WebCore::setCookies):
2769         (WebCore::cookies):
2770         (WebCore::cookiesEnabled):
2771
2772 2008-03-11  Darin Adler  <darin@apple.com>
2773
2774         Reviewed by Sam.
2775
2776         - eliminate the remaining parts of WebCoreBridge used for calls to WebKit from WebCore
2777
2778         * page/ChromeClient.h: Added new client functions to replace calls up to WebKit
2779         that were formerly handled by the bridge.
2780
2781         * page/Frame.h: Removed unneeded declarations. Moved declarations of script-specific
2782         functions to a ScriptController section. Removed willPopupMenu.
2783
2784         * page/mac/ChromeMac.mm:
2785         (WebCore::Chrome::focusNSView): Changed to call firstResponder and makeFirstResponder
2786         via the client instead of the bridge.
2787
2788         * page/mac/EventHandlerMac.mm:
2789         (WebCore::EventHandler::passMouseDownEventToWidget): Changed to call firstResponder
2790         and makeFirstResponder via the chrome client instead of the bridge.
2791
2792         * page/mac/FrameMac.mm: Removed willPopupMenu.
2793
2794         * page/mac/WebCoreFrameBridge.h: Removed WebCoreFrameBridge protocol and
2795         SubclassResponsibility category. Also removed some unneeded imports.
2796
2797         * platform/mac/PopupMenuMac.mm:
2798         (WebCore::PopupMenu::show): Call willPopUpMenu on chrome client instead of frame.
2799
2800         * platform/mac/WidgetMac.mm:
2801         (WebCore::Widget::setIsSelected): Call functions directly on the view rather than
2802         calling via the bridge.
2803
2804 2008-03-11  Darin Adler  <darin@apple.com>
2805
2806         Reviewed by Mitz.
2807
2808         - make some Range improvements (preparation for Range support for DOM mutation)
2809
2810         Made constructors private, added create functions.
2811         Made refcount start at 1 rather than starting at 0 and being incremented.
2812         Made Range use two Position objects for the start/end container/offset pairs.
2813
2814         * WebCore.base.exp: Updated.
2815
2816         * dom/Document.cpp:
2817         (WebCore::Document::createRange): Changed to use Range::create.
2818         (WebCore::Document::removeMarkers): Updated for Range::first/pastLastNode name change.
2819
2820         * dom/Position.cpp:
2821         (WebCore::Position::formatForDebugger): Updated for member variable name change.
2822         (WebCore::Position::showTreeForThis): Ditto.
2823         (WebCore::startPosition): Changed to use Range::startPosition.
2824         (WebCore::endPosition): Changed to use Range::endPosition.
2825
2826         * dom/Position.h: Made the data members public and renamed them to container
2827         and offset. But since offset() is already a function, temporarily used posOffset
2828         for the data member. Later we'll get rid of offset(). Made more functions inline.
2829         Removed the constructor that takes a PositionIterator.
2830
2831         * dom/PositionIterator.cpp:
2832         (WebCore::PositionIterator::operator Position): Added. Replaces the constructor
2833         that used to be in Position.
2834         * dom/PositionIterator.h: Added conversion operator to produce a Position.
2835         Removed friend declaration for Position.
2836
2837         * dom/Range.cpp:
2838         (WebCore::Range::Range): Updated constructors for data member changes and made
2839         them use a refcount of 1.
2840         (WebCore::Range::create): Added.
2841         (WebCore::Range::startContainer): Updated to eliminate use of m_detached; detached
2842         is now indicated by m_start.container of 0. Also updated to use m_start instead
2843         of the old m_startContainer.
2844         (WebCore::Range::startOffset): Ditto.
2845         (WebCore::Range::endContainer): Ditto.
2846         (WebCore::Range::endOffset): Ditto.
2847         (WebCore::Range::commonAncestorContainer): Ditto.
2848         (WebCore::Range::collapsed): Ditto.
2849         (WebCore::Range::setStart): Ditto.
2850         (WebCore::Range::setEnd): Ditto.
2851         (WebCore::Range::collapse): Ditto.
2852         (WebCore::Range::isPointInRange): Ditto.
2853         (WebCore::Range::comparePoint): Ditto.
2854         (WebCore::Range::compareNode): Ditto.
2855         (WebCore::Range::compareBoundaryPoints): Ditto.
2856         (WebCore::Range::boundaryPointsValid): Ditto.
2857         (WebCore::Range::deleteContents): Ditto.
2858         (WebCore::Range::intersectsNode): Ditto.
2859         (WebCore::Range::processContents): Ditto.
2860         (WebCore::Range::extractContents): Ditto.
2861         (WebCore::Range::cloneContents): Ditto.
2862         (WebCore::Range::insertNode): Ditto.
2863         (WebCore::Range::toString): Ditto.
2864         (WebCore::Range::text): Ditto.
2865         (WebCore::Range::createContextualFragment): Ditto.
2866         (WebCore::Range::detach): Ditto.
2867         (WebCore::Range::checkNodeBA): Changed to use switch statements instead of
2868         multiple calls to the virtual nodeType() function.
2869         (WebCore::Range::cloneRange): Ditto.
2870         (WebCore::Range::setStartAfter): Ditto.
2871         (WebCore::Range::setEndBefore): Ditto.
2872         (WebCore::Range::setEndAfter): Ditto.
2873         (WebCore::Range::selectNode): Ditto.
2874         (WebCore::Range::selectNodeContents): Ditto.
2875         (WebCore::Range::surroundContents): Ditto.
2876         (WebCore::Range::setStartBefore): Ditto.
2877         (WebCore::Range::checkDeleteExtract): Ditto.
2878         (WebCore::Range::containedByReadOnly): Ditto.
2879         (WebCore::Range::firstNode): Ditto.
2880         (WebCore::Range::editingStartPosition): Ditto.
2881         (WebCore::Range::pastLastNode): Ditto.
2882         (WebCore::Range::addLineBoxRects): Ditto.
2883         (WebCore::Range::formatForDebugger): Ditto.
2884         (WebCore::operator==): Ditto.
2885         (WebCore::rangeOfContents): Ditto.
2886         (WebCore::Range::maxStartOffset): Ditto.
2887         (WebCore::Range::maxEndOffset): Ditto.
2888
2889         * dom/Range.h: Made constructors private. Added create functions.
2890         Added getters for startContainer/Offset and endContainer/Offset that
2891         return 0 instead of an exception for detached ranges that are inline
2892         and don't require an ExceptionCode out parameter. Changed the parameters
2893         to setStart and setEnd to PassRefPtr. Removed isDetached function.
2894         Made ActionType and processContents private. Made startPosition and
2895         endPosition inlines and have then return const&. Renamed startNode and
2896         pastEndNode to firstNode and pastLastNode to reduce the chance of
2897         confusion with startContainer/endContainer. Used Position for m_start
2898         and m_end instead of separate container and offset members. Changed
2899         maxStartOffset and maxEndOffset into int to match other offsets.
2900
2901         * editing/ApplyStyleCommand.cpp:
2902         (WebCore::ApplyStyleCommand::applyBlockStyle): Changed to use Range::create.
2903         (WebCore::ApplyStyleCommand::applyInlineStyle): Ditto.
2904         * editing/CompositeEditCommand.cpp:
2905         (WebCore::CompositeEditCommand::inputText): Ditto.
2906         (WebCore::CompositeEditCommand::moveParagraphs): Ditto.
2907         * editing/DeleteSelectionCommand.cpp:
2908         (WebCore::DeleteSelectionCommand::mergeParagraphs): Ditto.
2909         * editing/Editor.cpp:
2910         (WebCore::Editor::fontForSelection): Changed for pastLastNode name change.
2911         (WebCore::Editor::setComposition): Changed to use Range::create.
2912         (WebCore::paragraphAlignedRangeForRange): Ditto.
2913         (WebCore::markMisspellingsOrBadGrammar): Changed to get rid of check for
2914         isDetached and check for 0 from startContainer instead.
2915         (WebCore::Editor::compositionRange): Changed to use Range::create.
2916         * editing/EditorCommand.cpp:
2917         (WebCore::unionDOMRanges): Ditto.
2918         * editing/Selection.cpp:
2919         (WebCore::Selection::toRange): Ditto.
2920         * editing/TextIterator.cpp:
2921         (WebCore::TextIterator::TextIterator): Changed for firstNode and pastLastNode
2922         name change.
2923         (WebCore::TextIterator::range): Changed to use Range::create.
2924         (WebCore::SimplifiedBackwardsTextIterator::range): Ditto.
2925         (WebCore::TextIterator::subrange): Ditto.
2926         * editing/VisiblePosition.cpp:
2927         (WebCore::makeRange): Ditto.
2928         * editing/VisiblePosition.h: Added now-needed include.
2929         * editing/htmlediting.cpp:
2930         (WebCore::indexForVisiblePosition): Changed to use Range::create.
2931         (WebCore::avoidIntersectionWithNode): Changed to get rid of check for
2932         isDetached and check for 0 instead and to use Range::create.
2933         * editing/markup.cpp:
2934         (WebCore::renderedText): Changed to use Range::create.
2935         (WebCore::createMarkup): Changed to no longer use isDetached and also
2936         for new firstNode/pastEndNode names.
2937         (WebCore::createFragmentFromText): Ditto.
2938         * editing/visible_units.cpp:
2939         (WebCore::previousBoundary): Changed to use Range::create.
2940         * page/mac/WebCoreFrameBridge.mm:
2941         (-[WebCoreFrameBridge convertToNSRange:]): Changed to no longer use
2942         isDetached().
2943         * rendering/RenderTextControl.cpp:
2944         (WebCore::RenderTextControl::visiblePositionForIndex): Changed to use Range::create.
2945         (WebCore::RenderTextControl::indexForVisiblePosition): Ditto.
2946
2947 2008-03-11  Daniel Zucker <zucker@wake3.com>
2948
2949         Reviewed by Adam Roben.
2950
2951         There are a handful of placed where the use of CFNetwork-specific
2952         calls are protected by PLATFORM(CF).  Revise to use the more specific
2953         USE(CFNETWORK) macro.  (See http://bugs.webkit.org/show_bug.cgi?id=17783) 
2954
2955         * platform/network/ProtectionSpace.cpp:  Change PLATFORM(CF) to USE(CFNETWORK)
2956         * platform/network/ResourceHandle.cpp: Change PLATFORM(CF) to USE(CFNETWORK)
2957         * platform/network/win/CookieJarWin.cpp:  Correct error in
2958           InternetGetCookie call.  Conditionalize 'cookiesEnabled' the same
2959           as all other implementations in this file.
2960
2961 2008-03-11  Xan Lopez  <xan@gnome.org>
2962
2963         Reviewed by Alp Toker.
2964
2965         http://bugs.webkit.org/show_bug.cgi?id=16476
2966
2967         Add libsoup HTTP backend.
2968         
2969         * GNUmakefile.am:
2970         * platform/network/ResourceHandleInternal.h:
2971         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
2972         * platform/network/soup/AuthenticationChallenge.h: Added.
2973         (WebCore::AuthenticationChallenge::AuthenticationChallenge):
2974         * platform/network/soup/ResourceError.h: Added.
2975         (WebCore::ResourceError::ResourceError):
2976         * platform/network/soup/ResourceHandleSoup.cpp: Added.
2977         (WebCore::ResourceHandleInternal::~ResourceHandleInternal):
2978         (WebCore::ResourceHandle::~ResourceHandle):
2979         (WebCore::dataCallback):
2980         (WebCore::parseDataUrl):
2981         (WebCore::ResourceHandle::start):
2982         (WebCore::ResourceHandle::cancel):
2983         (WebCore::ResourceHandle::bufferedData):
2984         (WebCore::ResourceHandle::supportsBufferedData):
2985         (WebCore::ResourceHandle::setDefersLoading):
2986         (WebCore::ResourceHandle::loadsBlocked):
2987         (WebCore::ResourceHandle::willLoadFromCache):
2988         * platform/network/soup/ResourceRequest.h: Copied from WebCore/platform/network/curl/ResourceRequest.h.
2989         (WebCore::ResourceRequest::ResourceRequest):
2990         (WebCore::ResourceRequest::doUpdatePlatformRequest):
2991         * platform/network/soup/ResourceResponse.h: Added.
2992         (WebCore::ResourceResponse::ResourceResponse):
2993         (WebCore::ResourceResponse::setResponseFired):
2994         (WebCore::ResourceResponse::responseFired):
2995         (WebCore::ResourceResponse::doUpdateResourceResponse):
2996
2997 2008-03-11  Rodney Dawes  <dobey@wayofthemonkey.com>
2998
2999         Fix Qt build.
3000
3001         * plugins/qt/PluginDataQt.cpp:
3002         (PluginData::initPlugins)
3003
3004 2008-03-11  Adam Roben  <aroben@apple.com>
3005
3006         Make attribute quoting in DOM view more consistent with source view
3007
3008         Two changes which make the DOM view more consistent with source view:
3009          1) We now quote all attribute values, including URLs
3010          2) The quotes around the values are now purple, matching the left and
3011             right angle brackets that surround the tag
3012
3013         One bug fixed by these changes:
3014          1) The entire URL is selected for editing when you double-click a URL
3015             that is an attribute value. Previously, the first and last
3016             characters were not included in the selection.
3017
3018         Reviewed by Darin.
3019
3020         * page/inspector/DocumentPanel.js:
3021         (WebInspector.DOMNodeTreeElement._startEditingAttribute): Don't need
3022         to account for the quotes around attribute values anymore because the
3023         quotes are now outside the webkit-html-attribute-value span.
3024         * page/inspector/utilities.js:
3025         (nodeTitleInfo): Quote all attribute values, including URLs, and place
3026         the quotes outside the webkit-html-attribute-value span.
3027
3028 2008-03-11  Adam Roben  <aroben@apple.com>
3029
3030         Stop including pthread.h in WebCore on Windows
3031
3032         Reviewed by Darin.
3033
3034         * WebCore.vcproj/WebCore.vcproj:
3035           - Changed the include path to not contain pthreads/
3036           - Let VS remove a duplicate FileConfiguration element
3037           - Let VS have its way with the file ordering
3038         * WebCorePrefix.h: Made the #include of pthread.h be compiled out on
3039         Windows.
3040         * loader/FTPDirectoryDocument.cpp: Added a Windows-specific #define of
3041         localtime_r (pthread.h was providing a macro that substituted plain
3042         old localtime before, but localtime_s is "more secure", so I went with
3043         that).
3044         * loader/FTPDirectoryParser.cpp: Ditto for gmtime_r.
3045
3046 2008-03-11  Adam Roben  <aroben@apple.com>
3047
3048         Roll out r30961 since it broke the default site icon on Windows
3049
3050         * loader/icon/IconDatabase.cpp:
3051         (WebCore::IconDatabase::defaultIcon):
3052
3053 2008-03-11  Dan Bernstein  <mitz@apple.com>
3054
3055         Reviewed by Darin Adler.
3056
3057         - clean up line layout code
3058
3059         * platform/graphics/GraphicsContext.cpp:
3060         (WebCore::TextRunIterator::increment): Removed the resolver parameter.
3061         (WebCore::GraphicsContext::drawBidiText): Adjusted for changes to
3062         createBidiRunsForLine(), which no longer takes a start parameter.
3063         * platform/text/BidiResolver.h:
3064         (WebCore::BidiResolver::): Made Noncopyable and removed the
3065         m_adjustEmbedding member variable.
3066         (WebCore::BidiResolver::position): Added. Returns the resolver's current
3067         position.
3068         (WebCore::BidiResolver::setPosition): Added. Sets the resolver's current
3069         position without changing any other state.
3070         (WebCore::BidiResolver::increment): Added. Advances the resolver to the
3071         next position, allowing the iterator to push and pop embedding.
3072         (WebCore::BidiResolver::appendRun): Removed the resolver parameter in
3073         the call to increment().
3074         (WebCore::BidiResolver::embed): Removed code to save, set and restore
3075         m_adjustEmbedding.
3076         (WebCore::BidiResolver::createBidiRunsForLine): Changed to not take a
3077         'start' iterator. Instead, start at the current position. Removed code
3078         to set m_adjustEmbedding. Changed for noncopyability.
3079         * rendering/RenderBlock.h:
3080         * rendering/bidi.cpp:
3081         (WebCore::bidiNext): Made the resolver parameter optional. Changed to
3082         null-check the 'end of inline' pointer only twice.
3083         (WebCore::bidiFirst): Made the resolver parameter optional.
3084         (WebCore::BidiIterator::increment): Ditto.
3085         (WebCore::BidiState::increment): Added. Overrides the default
3086         BidiResolver::increment() method by passing the resolver to
3087         BidiIterator::increment().
3088         (WebCore::checkMidpoints): Removed the resolver parameter.
3089         (WebCore::BidiState::appendRun): Removed code to save, set and restore
3090         m_adjustEmbedding. Adjusted for change to increment().
3091         (WebCore::RenderBlock::bidiReorderLine): Removed the 'start' parameter
3092         and unreachable code.
3093         (WebCore::buildCompactRuns): Adjusted for changes to BidiResolver/
3094         (WebCore::RenderBlock::layoutInlineChildren): Moved code to initialize
3095         the resolver from this method to determineStartPosition(). Unified the
3096         resolver with the 'start' iterator. Removed unreachable code. Moved one
3097         statement from the beginning of the while loop to the end.
3098         (WebCore::RenderBlock::determineStartPosition): Moved code to initialize
3099         the resolver from layoutInlineChildren() into this method.
3100         (WebCore::RenderBlock::matchedEndLine): Adjusted for the resolver and
3101         the 'start' iterator being one object.
3102         (WebCore::skipNonBreakingSpace): Made the parameter const.
3103         (WebCore::requiresLineBox): Ditto.
3104         (WebCore::RenderBlock::generatesLineBoxesForInlineChild): Adjusted for
3105         the change to BidiIterator::increment().
3106         (WebCore::RenderBlock::skipWhitespace): Made two versions of this
3107         method, one for BidiIterator and one for BidiState.
3108         (WebCore::shouldSkipWhitespaceAfterStartObject): Removed the resolver
3109         parameter.
3110         (WebCore::RenderBlock::findNextLineBreak): Removed the resolver
3111         parameter. Removed calls to setAdjustEmbedding(). Removed the 'previous'
3112         variable and changed the 'last' variable to do its job.
3113         * rendering/bidi.h:
3114
3115 2008-03-10  Adam Roben  <aroben@apple.com>
3116
3117         Part of Bug 17224: DOM nodes/attributes should be editable
3118
3119         <http://bugs.webkit.org/show_bug.cgi?id=17224>
3120         <rdar://problem/5732825>
3121
3122         This patch makes text nodes editable via double-click.
3123
3124         Reviewed by Tim.
3125
3126         * page/inspector/DocumentPanel.js:
3127         (WebInspector.DOMNodeTreeElement._startEditing):
3128           - Moved most of this code to _startEditingAttribute
3129           - Calls _startEditingTextNode or _startEditingAttribute as
3130             appropriate
3131         (WebInspector.DOMNodeTreeElement._startEditingAttribute): Added. Code
3132         came from _startEditing.
3133         (WebInspector.DOMNodeTreeElement._startEditingTextNode): Added.
3134         (WebInspector.DOMNodeTreeElement._textNodeEditingCommitted): Added.
3135         (WebInspector.DOMNodeTreeElement._editingCancelled): Renamed from
3136         _attributeEditingCancelled.
3137         * page/inspector/utilities.js:
3138         (nodeTitleInfo): Wrap text nodes in a webkit-html-text-node span so
3139         that we can easily recognize/edit them.
3140
3141 2008-03-11  Holger Hans Peter Freyther  <zecke@selfish.org>
3142
3143         Reviewed by Darin.
3144
3145         r25512 inlined the urlIcon to improve the startup time of Safari on Mac. Inlining is
3146         not suitable for platforms where this icon is themable. E.g. the Qt platform is allowing
3147         to theme this icon and the Gtk+ platform will probably end up with themable icons
3148         as well.
3149         
3150         Remove dead code from the windows port and move the urlIcon from the windows
3151         directory to the Resource directory to be used by Qt and other ports.
3152         
3153         Ifdef the usage of the built-in icon in IconDatabase.cpp and for Qt do not use
3154         it. Gtk+ currently has no proper implementation of Image::loadPlatformResource but
3155         once it does it wants to use this for getting the urlIcon as well.
3156
3157         * Resources/urlIcon.png: Renamed from WebKit/win/WebKit.vcproj/urlIcon.png.
3158         * loader/icon/IconDatabase.cpp:
3159         (WebCore::IconDatabase::defaultIcon):
3160
3161 2008-03-11  Tor Arne Vestbø  <tavestbo@trolltech.com>
3162
3163         Reviewed by Darin.
3164
3165         Implemented HTML media element support for QtWebKit, using Phonon.
3166
3167         http://bugs.webkit.org/show_bug.cgi?id=17766
3168
3169         * WebCore.pro:
3170         * platform/graphics/MediaPlayer.cpp:
3171         * platform/graphics/qt/MediaPlayerPrivatePhonon.cpp: Added.
3172         (debugMediaObject):
3173         (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
3174         (WebCore::MediaPlayerPrivate::~MediaPlayerPrivate):
3175         (WebCore::MediaPlayerPrivate::getSupportedTypes):
3176         (WebCore::MediaPlayerPrivate::hasVideo):
3177         (WebCore::MediaPlayerPrivate::load):
3178         (WebCore::MediaPlayerPrivate::cancelLoad):
3179         (WebCore::MediaPlayerPrivate::play):
3180         (WebCore::MediaPlayerPrivate::pause):
3181         (WebCore::MediaPlayerPrivate::paused):
3182         (WebCore::MediaPlayerPrivate::seek):
3183         (WebCore::MediaPlayerPrivate::seeking):
3184         (WebCore::MediaPlayerPrivate::duration):
3185         (WebCore::MediaPlayerPrivate::currentTime):
3186         (WebCore::MediaPlayerPrivate::setEndTime):
3187         (WebCore::MediaPlayerPrivate::maxTimeBuffered):
3188         (WebCore::MediaPlayerPrivate::maxTimeSeekable):
3189         (WebCore::MediaPlayerPrivate::bytesLoaded):
3190         (WebCore::MediaPlayerPrivate::totalBytesKnown):
3191         (WebCore::MediaPlayerPrivate::totalBytes):
3192         (WebCore::MediaPlayerPrivate::setRate):
3193         (WebCore::MediaPlayerPrivate::setVolume):
3194         (WebCore::MediaPlayerPrivate::setMuted):
3195         (WebCore::MediaPlayerPrivate::dataRate):
3196         (WebCore::MediaPlayerPrivate::networkState):
3197         (WebCore::MediaPlayerPrivate::readyState):
3198         (WebCore::MediaPlayerPrivate::updateStates):
3199         (WebCore::MediaPlayerPrivate::setVisible):
3200         (WebCore::MediaPlayerPrivate::setRect):
3201         (WebCore::MediaPlayerPrivate::loadStateChanged):
3202         (WebCore::MediaPlayerPrivate::rateChanged):
3203         (WebCore::MediaPlayerPrivate::sizeChanged):
3204         (WebCore::MediaPlayerPrivate::timeChanged):
3205         (WebCore::MediaPlayerPrivate::volumeChanged):
3206         (WebCore::MediaPlayerPrivate::didEnd):
3207         (WebCore::MediaPlayerPrivate::loadingFailed):
3208         (WebCore::MediaPlayerPrivate::naturalSize):
3209         (WebCore::MediaPlayerPrivate::eventFilter):
3210         (WebCore::MediaPlayerPrivate::repaint):
3211         (WebCore::MediaPlayerPrivate::paint):
3212         (WebCore::MediaPlayerPrivate::stateChanged):
3213         (WebCore::MediaPlayerPrivate::tick):
3214         (WebCore::MediaPlayerPrivate::metaDataChanged):
3215         (WebCore::MediaPlayerPrivate::seekableChanged):
3216         (WebCore::MediaPlayerPrivate::hasVideoChanged):
3217         (WebCore::MediaPlayerPrivate::bufferStatus):
3218         (WebCore::MediaPlayerPrivate::finished):
3219         (WebCore::MediaPlayerPrivate::currentSourceChanged):
3220         (WebCore::MediaPlayerPrivate::aboutToFinish):
3221         (WebCore::MediaPlayerPrivate::prefinishMarkReached):
3222         (WebCore::MediaPlayerPrivate::totalTimeChanged):
3223         * platform/graphics/qt/MediaPlayerPrivatePhonon.h: Added.
3224         (WebCore::MediaPlayerPrivate::):
3225         (WebCore::MediaPlayerPrivate::isAvailable):
3226
3227 2008-03-10  Sam Weinig  <sam@webkit.org>
3228
3229         Reviewed by Beth Dakin.
3230
3231         Throw a SECURITY_ERR when accessing a tainted canvas
3232         by CanvasRenderingContext2D::getImageData() and
3233         HTMLCanvasElement::toDataURL().
3234
3235         * html/CanvasRenderingContext2D.cpp:
3236         (WebCore::CanvasRenderingContext2D::getImageData):
3237         * html/CanvasRenderingContext2D.h:
3238         * html/CanvasRenderingContext2D.idl:
3239         * html/HTMLCanvasElement.cpp:
3240         (WebCore::HTMLCanvasElement::toDataURL):
3241         * html/HTMLCanvasElement.h:
3242         * html/HTMLCanvasElement.idl:
3243
3244 2008-03-10  Justin Garcia  <justin.garcia@apple.com>
3245
3246         Reviewed by Sam.
3247
3248         <rdar://problem/5779984> REGRESSION (r30391): GMail: Safari won't display the Edit Link dialog
3249
3250         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
3251         (WebCore::hasCSSPropertyNamePrefix): Fixed a typo.  The code was only
3252         comparing the first character of the prefix to the first character
3253         of the property name.
3254
3255 2008-03-10  Andre Boule  <aboule@apple.com>
3256
3257         Reviewed by Beth.
3258
3259         Hold off on initializing the frame to avoid the RenderView getting 
3260         a null FrameView. This could potentially cause problems.
3261
3262         * svg/graphics/SVGImage.cpp:
3263         (WebCore::SVGImage::dataChanged):
3264
3265 2008-03-10  Darin Adler  <darin@apple.com>
3266
3267         - try to fix Qt build
3268
3269         * bridge/qt/qt_runtime.cpp:
3270         (KJS::Bindings::convertQVariantToValue): Change KJS::UChar to UChar.
3271
3272 2008-03-10  Darin Adler  <darin@apple.com>
3273
3274         Reviewed by Antti.
3275
3276         - fix <rdar://problem/3059610> VIP: links opened in new frame, window, or tab
3277           should be redrawn as visited immediately
3278         - fix <rdar://problem/4382809> Going "back" a page doesn't change the color of
3279           the visited URL at directory.umi
3280         - fix http://bugs.webkit.org/show_bug.cgi?id=4941
3281           Visited links should be marked as visited
3282         - fix http://bugs.webkit.org/show_bug.cgi?id=7960
3283           REGRESSION: Visited link color doesn't displayed after loading page from cache
3284
3285         We now mark all links on a page as "changed" at the appropriate times.
3286
3287         * WebCore.base.exp: Update since I made completeURL be a const member function.
3288
3289         * css/CSSStyleSelector.cpp: Got rid of some unneeded globals that could be turned
3290         into locals. Also changed some static data members to file-scoped globals with
3291         internal linkage. Renamed the globals to get rid of the m_ prefix. Changed the
3292         prefix on m_styleNotYetAvailable to s_styleNotYetAvailable.
3293         (WebCore::CSSStyleSelector::CSSStyleSelector): Updated for name changes.
3294         (WebCore::parseUASheet): Tweak the comment.
3295         (WebCore::CSSStyleSelector::loadDefaultStyle): Updated for name changes and to
3296         use local variables instead of globals where possible.
3297         (WebCore::CSSStyleSelector::checkPseudoState): Made this a member function so
3298         it can store the link in a hash. Also changed it to have a return value instead
3299         of having it modify a global variable. Added code to put the hash into a set so
3300         we can tell later if this is one of the links that affects this page.
3301         (WebCore::CSSStyleSelector::canShareStyleWithElement): Updated for the change to
3302         checkPseudoState.
3303         (WebCore::CSSStyleSelector::matchUARules): Updated for name changes.
3304         (WebCore::CSSStyleSelector::styleForElement): Ditto.
3305         (WebCore::CSSStyleSelector::adjustRenderStyle): Ditto.
3306         (WebCore::CSSStyleSelector::pseudoStyleRulesForElement): Changed code to read
3307         the SVG style sheet to use a boolean global and put it right here in the function
3308         since this is the only code that needs to know about it.
3309         (WebCore::CSSStyleSelector::checkOneSelector): Updated for name changes.
3310         (WebCore::colorForCSSValue): Moved code inside the function that is not needed
3311         anywhere else.
3312         (WebCore::CSSStyleSelector::getColorFromPrimitiveValue): Updaed for the change
3313         to checkPseudoState.
3314         (WebCore::CSSStyleSelector::allVisitedStateChanged): Added. Calls setChanged on
3315         all links if there were any in the set.
3316         (WebCore::CSSStyleSelector::visitedStateChanged): Added. Calls setChanged on all
3317         links if the one that changed is in the set.
3318
3319         * css/CSSStyleSelector.h: Removed unused StyleSelector class and State enum. Made
3320         CSSStyleSelector derive from Noncopyable. Made lots of member functions private that
3321         didn't need to be public, and removed others that could be made into non-member
3322         functions. Changed pseudoStyleRulesForElement to take a const String& instead of
3323         a StringImpl*. Added new allVisitedStateChanged and visitedStateChanged functions.
3324         Got rid of unneeded friend declarations.
3325
3326         * dom/Document.cpp:
3327         (WebCore::Document::completeURL): Made const.
3328         (WebCore::findSlashDotDotSlash): Moved here from PageGroup.
3329         (WebCore::findSlashSlash): Ditto.
3330         (WebCore::findSlashDotSlash): Ditto.
3331         (WebCore::containsColonSlashSlash):
3332         (WebCore::cleanPath): Ditto.
3333         (WebCore::matchLetter): Ditto.
3334         (WebCore::needsTrailingSlash): Ditto.
3335         (WebCore::Document::visitedLinkHash): Moved this here from PageGroup. This is
3336         the poor-man's completeURL function. The idea of putting it here is that this
3337         way it can be alongside the real completeURL function. Later we should figure out
3338         a way to make this function share more code with the real thing and match behavior.
3339
3340         * dom/Document.h: Marked completeURL function const. Added visitedLinkHash function.
3341
3342         * page/DOMWindow.cpp:
3343         (WebCore::DOMWindow::getMatchedCSSRules): Updated for change to CSSStyleSelector.
3344
3345         * page/Page.cpp:
3346         (WebCore::Page::allVisitedStateChanged): Added. Calls allVisitedStateChanged on all
3347         style selectors.
3348         (WebCore::Page::visitedStateChanged): Ditto.
3349         * page/Page.h: Added the above functions.
3350
3351         * page/PageGroup.cpp:
3352         (WebCore::PageGroup::isLinkVisited): Changed to take a visitedLinkHash parameter.
3353         The CSSStyleSelector now handles actually computing the hash, and it does so by
3354         calling code in Document.
3355         (WebCore::PageGroup::addVisitedLink): Refactored so the two overloaded copies share
3356         a bit more code. Added code that calls visitedStateChanged if a new link was added.
3357         (WebCore::PageGroup::removeVisitedLinks): Added code to call allVisitedStateChanged
3358         if any visited links are removed.
3359         * page/PageGroup.h: Include StringHash.h instead of having the AlreadyHashed struct
3360         definition here.
3361
3362         * platform/text/StringHash.h:
3363         (WebCore::CaseFoldingHash::hash): Tweaked to make this a bit more consistent with
3364         the StringImpl::computeHash function, using the same technique for avoiding 0.
3365         (WebCore::AlreadyHashed::hash): Added. Was formerly in PageGroup.h.
3366         (WebCore::AlreadyHashed::avoidDeletedValue): Added. Was formerly in PageGroup.cpp.
3367
3368         * rendering/RenderStyle.cpp:
3369         (WebCore::RenderStyle::isStyleAvailable): Changed to use an inline function instead
3370         of getting directly at a data member so the data member could be made private.
3371
3372         * loader/FrameLoader.cpp:
3373         (WebCore::FrameLoader::scrollToAnchor): Added call to updateHistoryForAnchorScroll.
3374         (WebCore::FrameLoader::updateHistoryForAnchorScroll): Added.
3375         * loader/FrameLoader.h: Added updateHistoryForAnchorScroll.
3376
3377 2008-03-10  Adam Roben  <aroben@apple.com>
3378
3379         Part of Bug 17224: DOM nodes/attributes should be editable
3380
3381         <http://bugs.webkit.org/show_bug.cgi?id=17224>
3382         <rdar://problem/5732825>
3383
3384         This patch makes DOM attributes editable via double-click.
3385
3386         Reviewed by Tim.
3387
3388         * page/inspector/DocumentPanel.js:
3389         (WebInspector.DOMNodeTreeElement.onmousedown): Don't do anything if
3390         we're being edited, since we want default editing behaviors to work.
3391         (WebInspector.DOMNodeTreeElement.ondblclick): Try to start editing
3392         before doing anything else.
3393         (WebInspector.DOMNodeTreeElement._startEditing): Added. Currently only
3394         lets you edit attributes.
3395         (WebInspector.DOMNodeTreeElement._attributeEditingCommitted): Added.
3396         Uses a scratch element to get the new attribute(s) parsed, then sets
3397         the attribute(s) on the node in the inspected document.
3398         (WebInspector.DOMNodeTreeElement._attributeEditingCancelled): Added.
3399         (WebInspector.DOMNodeTreeElement._updateTitle): Added. Refreshes the
3400         representation of the node in the Inspector's DOM tree to reflect
3401         the node's current state.
3402         * page/inspector/inspector.css: Made the .editing class apply
3403         everywhere.
3404         * page/inspector/utilities.js:
3405         (nodeTitleInfo): Changed to surround attribute name/value pairs in a
3406         webkit-html-attribute span so that we can easily edit the pair as a
3407         whole.
3408
3409 2008-03-10  David Kilzer  <ddkilzer@apple.com>
3410
3411         Fix 64-bit builds.
3412
3413         Reviewed by Stephanie.
3414
3415         WebCore.exp only gets generated once for both 32-bit and 64-bit builds,
3416         so we must exclude the _NPN symbols when creating WebCore.LP64.exp.
3417
3418         * WebCore.xcodeproj/project.pbxproj: Reverted build phase shell code to
3419         r30826 to remove _NPN symbols from 64-bit builds in WebCore.LP64.exp.
3420
3421 2008-03-10  Eric Seidel  <eric@webkit.org>
3422
3423         Reviewed by Darin.
3424
3425         Remove KJS::UChar, use ::UChar instead
3426         http://bugs.webkit.org/show_bug.cgi?id=17017
3427
3428         To functional changes, thus no tests.
3429
3430         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
3431         (WebCore::hasCSSPropertyNamePrefix):
3432         (WebCore::cssPropertyName):
3433         * bindings/js/JSDOMWindowBase.cpp:
3434         (WebCore::windowProtoFuncAToB):
3435         (WebCore::windowProtoFuncBToA):
3436         * bindings/js/JSSVGPODTypeWrapper.h:
3437         * bindings/js/kjs_proxy.cpp:
3438         (WebCore::KJSProxy::evaluate):
3439         * bridge/objc/objc_utility.mm:
3440         (KJS::Bindings::throwError):
3441         * dom/Document.cpp:
3442         (WebCore::Document::parseQualifiedName):
3443         * platform/text/AtomicString.cpp:
3444         (WebCore::AtomicString::add):
3445         * platform/text/String.cpp:
3446         (WebCore::String::String):
3447         (WebCore::String::operator Identifier):
3448         (WebCore::String::operator UString):
3449         * platform/text/TextCodecICU.cpp:
3450         (WebCore::TextCodecICU::decode):
3451         * svg/SVGAnimatedTemplate.h:
3452
3453 2008-03-10  Darin Adler  <darin@apple.com>
3454
3455         Reviewed by Sam.
3456
3457         - eliminate keyboard UI mode method from WebCoreFrameBridge
3458
3459         * page/ChromeClient.h: Added keyboardUIMode function.
3460         (WebCore::ChromeClient::keyboardUIMode): Ditto.
3461         * page/mac/EventHandlerMac.mm:
3462         (WebCore::EventHandler::tabsToAllControls): Call chrome client function instead
3463         of bridge function.
3464         * page/mac/WebCoreFrameBridge.h: Removed keyboardUIMode method, and other unused
3465         ones.
3466
3467         * WebCore.xcodeproj/project.pbxproj: Allowed Xcode to change the project.
3468         Do not try to fight the Xcode.
3469
3470 2008-03-10  Darin Adler  <darin@apple.com>
3471
3472         - oops, forgot to save last couple changes from the editor
3473
3474         * bindings/js/JSDOMWindowCustom.cpp:
3475         (WebCore::markDOMObjectWrapper): Tweaked a tiny bit.
3476         (WebCore::JSDOMWindow::mark): Sorted alphabetically.
3477
3478 2008-03-10  Darin Adler  <darin@apple.com>
3479
3480         Reviewed by Geoff.
3481
3482         - fix failing regression test (window.navigator is getting garbage
3483           collected and thus losing its custom properties)
3484
3485         * bindings/js/JSDOMWindowCustom.cpp:
3486         (WebCore::markDOMObject): Added helper function.
3487         (WebCore::JSDOMWindow::mark): Added. Marks the wrappers for all the objects that hang
3488         off the window object.
3489
3490         * page/DOMWindow.h:
3491         (WebCore::DOMWindow::optionalScreen): Added so we can get the Screen object without
3492         creating it if it's already there.
3493         (WebCore::DOMWindow::optionalSelection): Ditto.
3494         (WebCore::DOMWindow::optionalHistory): Ditto.
3495         (WebCore::DOMWindow::optionalLocationbar): Ditto.
3496         (WebCore::DOMWindow::optionalMenubar): Ditto.
3497         (WebCore::DOMWindow::optionalPersonalbar): Ditto.
3498         (WebCore::DOMWindow::optionalScrollbars): Ditto.
3499         (WebCore::DOMWindow::optionalStatusbar): Ditto.
3500         (WebCore::DOMWindow::optionalToolbar): Ditto.
3501         (WebCore::DOMWindow::optionalConsole): Ditto.
3502         (WebCore::DOMWindow::optionalNavigator): Ditto.
3503
3504         * page/DOMWindow.idl: Added the CustomMarkFunction flag. Sorted the flags in
3505         alphabetical order since there are a lot of them.
3506
3507 2008-03-10  Darin Adler  <darin@apple.com>
3508
3509         Reviewed by Sam.
3510
3511         - eliminate Java applet methods from WebCoreFrameBridge
3512
3513         * loader/FrameLoaderClient.h: Added a javaApplet function.
3514         * page/mac/FrameMac.mm:
3515         (WebCore::Frame::createScriptInstanceForWidget): Streamlined the code.
3516         Use the loader client instead of the bridge to get the applet.
3517         * page/mac/WebCoreFrameBridge.h: Removed the getAppletInView and
3518         pollForAppletInView methods. Also removed other unused things.
3519
3520 2008-03-10  Marc-Antoine Ruel  <maruel@gmail.com>
3521
3522         Reviewed by Eric, landed by Darin.
3523
3524         http://bugs.webkit.org/show_bug.cgi?id=16095
3525         Move GraphicsContextPrivate to its own header file.
3526
3527         Moves GraphicsContextState and GraphicsContextPrivate to its
3528         own header
3529
3530         * WebCore.vcproj/WebCore.vcproj:
3531         * platform/graphics/GraphicsContext.cpp:
3532         * platform/graphics/GraphicsContextPrivate.h: Added.
3533         (WebCore::GraphicsContextState::GraphicsContextState):
3534         (WebCore::GraphicsContextPrivate::GraphicsContextPrivate):
3535
3536 2008-03-10  Julien Chaffraix  <julien.chaffraix@gmail.com>
3537
3538         Reviewed and landed by Darin.
3539
3540         bug 12182 : XMLHttpRequest should raise SECURITY_ERR for same-origin policy violations
3541
3542         Removed reference to PERMISSION_DENIED (previous non standard exception) and replaced it
3543         by DOM exception SECURITY_ERR. Updated XMLHttpRequest::open to raise SECURITY_ERR.
3544
3545         * bindings/js/kjs_binding.cpp:
3546         (WebCore::setDOMException): Removed PERMISSION_DENIED code.
3547         * dom/ExceptionCode.cpp: Added SECURITY_ERR exception.
3548         * dom/ExceptionCode.h: Ditto.
3549         * xml/XMLHttpRequest.cpp:
3550         (WebCore::XMLHttpRequest::open): Returns SECURITY_ERR now.
3551         * xml/XMLHttpRequestException.h: Removed PERMISSION_DENIED.
3552
3553 2008-03-09  Adam Roben  <aroben@apple.com>
3554
3555         Refactor CSS editing code so we can share it with DOM editing
3556
3557         Add WebInspector.startEditing, which takes the element to be edited, a
3558         committedCallback, a cancelledCallback, and a context parameter. This
3559         function takes care of setting up the element for editing, and calls
3560         either the cancelledCallback or committedCallback when editing ends.
3561
3562         Reviewed by Tim.
3563
3564         * page/inspector/StylesSidebarPane.js:
3565         (WebInspector.StylePropertyTreeElement.startEditing):
3566           - Call WebInspector.isBeingEdited and WebInspector.startEditing
3567           - Removed code now handled by WebInspector.startEditing
3568         (WebInspector.StylePropertyTreeElement.editingEnded):
3569           - Renamed from endEditing
3570           - Removed code now handled by WebInspector.startEditing
3571         (WebInspector.StylePropertyTreeElement.editingCancelled):
3572           - Renamed from cancelEditing
3573           - Changed parameters to match WebInspector.startEditing's
3574             cancelledCallback
3575         (WebInspector.StylePropertyTreeElement.editingCommitted):
3576           - Renamed from commitEditing
3577           - Changed parameters to match WebInspector.startEditing's
3578             committedCallback
3579         * page/inspector/inspector.js:
3580         (WebInspector.changeFocus): Changed a call to firstParentWithClassName
3581         to firstParentOrSelfWithClassName so that if the focusable element
3582         itself is the target it will be recognized. I don't know why this
3583         change wasn't needed before this.
3584         (WebInspector.isBeingEdited): Added.
3585         (WebInspector.startEditing): Added.
3586
3587 2008-03-10  Adam Roben  <aroben@apple.com>
3588
3589         Windows build fix
3590
3591         * WebCore.vcproj/WebCore.vcproj: Pick up generated source files out of
3592         $(WebKitOutputDir) instead of hard-coding WebKitBuild.
3593
3594 2008-03-10  Darin Adler  <darin@apple.com>
3595
3596         * DerivedSources.make: Merge plug-in-related changes with the new way of handling
3597         autogenerated DOM classes.
3598
3599 2008-03-10  Johnny Ding  <johnnyding.webkit@gmail.com>
3600
3601         Reviewed, tweaked and landed by Alexey.
3602
3603         - fix http://bugs.webkit.org/show_bug.cgi?id=17732        
3604
3605         We didn't have a fallback to frame encoding in the case of loading a script via
3606         changing its src attribute.
3607
3608         Test: fast/dom/HTMLScriptElement/script-decoding-error-after-setting-src.html
3609
3610         * html/HTMLScriptElement.cpp:
3611         (WebCore::HTMLScriptElement::parseMappedAttribute): Use a helper function to get proper
3612         charset for correct decoding of script content.
3613         (WebCore::HTMLScriptElement::insertedIntoDocument):
3614         (WebCore::HTMLScriptElement::scriptCharset): A helper function for getting proper charset
3615         for the script (as much as can be determined prior to loading it).
3616         * html/HTMLScriptElement.h:
3617         * html/HTMLTokenizer.cpp:
3618         (WebCore::HTMLTokenizer::parseTag): Use a helper function to get proper charset for correct
3619         decoding of script content.
3620
3621 2008-03-10  Simon Hausmann  <hausmann@webkit.org>
3622
3623         Reviewed by Lars.
3624
3625         Fix reference counting of returned MimeType and Plugin objects
3626         created in the array wrappers.
3627
3628         * plugins/MimeTypeArray.cpp:
3629         * plugins/MimeTypeArray.h:
3630         * plugins/Plugin.cpp:
3631         * plugins/Plugin.h:
3632         * plugins/PluginArray.cpp:
3633         * plugins/PluginArray.h:
3634
3635 2008-03-10  Simon Hausmann  <hausmann@webkit.org>
3636
3637         Wx linking fix.
3638
3639         Added missing stubs for PluginData.
3640
3641         * platform/wx/TemporaryLinkStubs.cpp:
3642
3643 2008-03-10  Simon Hausmann  <hausmann@webkit.org>
3644
3645         Windows build fix that I forgot to merge earlier ;(
3646
3647         Forward declare Page as class, not struct.
3648
3649         * plugins/PluginData.h:
3650
3651 2008-03-10  Simon Hausmann  <hausmann@webkit.org>
3652
3653         Attempt to fix the Wx build.
3654
3655         * WebCoreSources.bkl:
3656
3657 2008-03-07  Simon Hausmann  <hausmann@webkit.org>
3658
3659         Reviewed by Darin.
3660
3661         Done with Lars.
3662
3663         http://bugs.webkit.org/show_bug.cgi?id=16815
3664
3665         Ported the manually written JS bindings of window.navigator,
3666         window.navigator.plugins and window.navigator.mimeTypes to
3667         auto-generated bindings.
3668
3669         Moved the globally cached plugin and mimetype information to a
3670         per WebCore::Page shared PluginData structure.
3671
3672         Implemented window.navigator.plugins.refresh() in a
3673         platform-independent way.
3674
3675         * DerivedSources.make:
3676         * GNUmakefile.am:
3677         * WebCore.pro:
3678         * WebCore.vcproj/WebCore.vcproj:
3679         * WebCore.xcodeproj/project.pbxproj:
3680         * bindings/js/JSDOMWindowBase.cpp:
3681         (WebCore::JSDOMWindowBase::getValueProperty):
3682         * bindings/js/JSMimeTypeArrayCustom.cpp: Added.
3683         (WebCore::JSMimeTypeArray::canGetItemsForName):
3684         (WebCore::JSMimeTypeArray::nameGetter):
3685         * bindings/js/JSNavigatorCustom.cpp: Added.
3686         (WebCore::needsYouTubeQuirk):
3687         (WebCore::JSNavigator::appVersion):
3688         * bindings/js/JSPluginArrayCustom.cpp: Added.
3689         (WebCore::JSPluginArray::canGetItemsForName):
3690         (WebCore::JSPluginArray::nameGetter):
3691         * bindings/js/JSPluginCustom.cpp: Added.
3692         (WebCore::JSPlugin::canGetItemsForName):
3693         (WebCore::JSPlugin::nameGetter):
3694         * bindings/js/kjs_navigator.cpp: Removed.
3695         * bindings/js/kjs_navigator.h: Removed.
3696         * dom/Clipboard.cpp:
3697         * dom/DOMImplementation.cpp:
3698         (WebCore::DOMImplementation::createDocument):
3699         * loader/FrameLoader.cpp:
3700         (WebCore::FrameLoader::shouldUsePlugin):
3701         * page/DOMWindow.cpp:
3702         (WebCore::DOMWindow::clear):
3703         (WebCore::DOMWindow::navigator):
3704         * page/DOMWindow.h:
3705         * page/DOMWindow.idl:
3706         * page/DragController.cpp:
3707         * page/Frame.cpp:
3708         * page/Frame.h:
3709         * page/Navigator.cpp: Added.
3710         (WebCore::Navigator::Navigator):
3711         (WebCore::Navigator::~Navigator):
3712         (WebCore::Navigator::disconnectFrame):
3713         (WebCore::Navigator::appCodeName):
3714         (WebCore::Navigator::appName):
3715         (WebCore::Navigator::appVersion):
3716         (WebCore::Navigator::language):
3717         (WebCore::Navigator::userAgent):
3718         (WebCore::Navigator::platform):
3719         (WebCore::Navigator::plugins):
3720         (WebCore::Navigator::mimeTypes):
3721         (WebCore::Navigator::product):
3722         (WebCore::Navigator::productSub):
3723         (WebCore::Navigator::vendor):
3724         (WebCore::Navigator::vendorSub):
3725         (WebCore::Navigator::cookieEnabled):
3726         (WebCore::Navigator::javaEnabled):
3727         * page/Navigator.h: Added.
3728         (WebCore::Navigator::create):
3729         (WebCore::Navigator::frame):
3730         * page/Navigator.idl: Added.
3731         * page/Page.cpp:
3732         (WebCore::Page::refreshPlugins):
3733         (WebCore::Page::pluginData):
3734         * page/Page.h:
3735         * page/Plugin.h: Removed.
3736         * page/mac/FrameMac.mm:
3737         * page/mac/WebCoreFrameBridge.mm:
3738         (-[WebCoreFrameBridge canProvideDocumentSource]):
3739         * page/mac/WebCoreViewFactory.h:
3740         * page/qt/FrameQt.cpp:
3741         * page/win/FrameWin.cpp:
3742         * platform/gtk/TemporaryLinkStubs.cpp:
3743         * platform/mac/PlugInInfoStoreMac.mm: Removed.
3744         * platform/qt/MIMETypeRegistryQt.cpp:
3745         (WebCore::MIMETypeRegistry::getMIMETypeForExtension):
3746         * plugins/MimeType.cpp: Added.
3747         (WebCore::MimeType::MimeType):
3748         (WebCore::MimeType::~MimeType):
3749         (WebCore::MimeType::type):
3750         (WebCore::MimeType::suffixes):
3751         (WebCore::MimeType::description):
3752         (WebCore::MimeType::enabledPlugin):
3753         * plugins/MimeType.h: Added.
3754         (WebCore::MimeType::create):
3755         * plugins/MimeType.idl: Added.
3756         * plugins/MimeTypeArray.cpp: Added.
3757         (WebCore::MimeTypeArray::MimeTypeArray):
3758         (WebCore::MimeTypeArray::~MimeTypeArray):
3759         (WebCore::MimeTypeArray::length):
3760         (WebCore::MimeTypeArray::item):
3761         (WebCore::MimeTypeArray::canGetItemsForName):
3762         (WebCore::MimeTypeArray::nameGetter):
3763         (WebCore::MimeTypeArray::getPluginData):
3764         * plugins/MimeTypeArray.h: Added.
3765         (WebCore::MimeTypeArray::create):
3766         (WebCore::MimeTypeArray::disconnectFrame):
3767         * plugins/MimeTypeArray.idl: Added.
3768         * plugins/Plugin.cpp: Added.
3769         (WebCore::Plugin::Plugin):
3770         (WebCore::Plugin::~Plugin):
3771         (WebCore::Plugin::name):
3772         (WebCore::Plugin::filename):
3773         (WebCore::Plugin::description):
3774         (WebCore::Plugin::length):
3775         (WebCore::Plugin::item):
3776         (WebCore::Plugin::canGetItemsForName):
3777         (WebCore::Plugin::nameGetter):
3778         * plugins/Plugin.h: Added.
3779         (WebCore::Plugin::create):
3780         * plugins/Plugin.idl: Added.
3781         * plugins/PluginArray.cpp: Added.
3782         (WebCore::PluginArray::PluginArray):
3783         (WebCore::PluginArray::~PluginArray):
3784         (WebCore::PluginArray::length):
3785         (WebCore::PluginArray::item):
3786         (WebCore::PluginArray::canGetItemsForName):
3787         (WebCore::PluginArray::nameGetter):
3788         (WebCore::PluginArray::refresh):
3789         (WebCore::PluginArray::getPluginData):
3790         * plugins/PluginArray.h: Added.
3791         (WebCore::PluginArray::create):
3792         (WebCore::PluginArray::disconnectFrame):
3793         * plugins/PluginArray.idl: Added.
3794         * plugins/PluginData.cpp: Added.
3795         (WebCore::PluginData::PluginData):
3796         (WebCore::PluginData::~PluginData):
3797         (WebCore::PluginData::supportsMimeType):
3798         (WebCore::PluginData::pluginNameForMimeType):
3799         * plugins/PluginData.h: Added.
3800         (WebCore::PluginData::create):
3801         (WebCore::PluginData::disconnectPage):
3802         (WebCore::PluginData::page):
3803         (WebCore::PluginData::plugins):
3804         (WebCore::PluginData::mimes):
3805         * plugins/mac/PluginDataMac.mm: Added.
3806         (WebCore::PluginData::initPlugins):
3807         (WebCore::PluginData::refresh):
3808         * plugins/qt/PluginDataQt.cpp: Added.
3809         (WebCore::PluginData::initPlugins):
3810         * plugins/win/PluginDataWin.cpp: Added.
3811         (WebCore::PluginData::initPlugins):
3812         (WebCore::PluginData::refresh):
3813
3814 2008-03-10  Simon Hausmann  <hausmann@webkit.org>
3815
3816         Reviewed by Holger.
3817
3818         Replace two printfs() in the Qt port with notImplemented().
3819
3820         * html/CanvasRenderingContext2D.cpp:
3821         (WebCore::CanvasRenderingContext2D::applyStrokePattern):
3822         (WebCore::CanvasRenderingContext2D::applyFillPattern):
3823
3824 2008-03-10  Simon Hausmann  <hausmann@webkit.org>
3825
3826         Reviewed by Alp.
3827
3828         Compilation fix with gcc 4.3: Include stdio.h for printf.
3829
3830         * html/CanvasRenderingContext2D.cpp:
3831         * html/HTMLCanvasElement.cpp:
3832
3833 2008-03-09  Steve Falkenburg  <sfalken@apple.com>
3834
3835         Stop Windows build if an error occurs in a prior project.
3836
3837         Rubber stamped by Darin.
3838
3839         * WebCore.vcproj/WebCore.vcproj:
3840         * WebCore.vcproj/WebCoreGenerated.vcproj:
3841
3842 2008-03-09  Darin Adler  <darin@apple.com>
3843
3844         * DerivedSources.make: Third try at fixing the build.
3845         * bindings/js/JSRGBColor.cpp: And touching this file.
3846
3847 2008-03-09  Darin Adler  <darin@apple.com>
3848
3849         * DerivedSources.make: One *more* try at fixing the build.
3850
3851 2008-03-09  Darin Adler  <darin@apple.com>
3852
3853         * DerivedSources.make: One more try at fixing the build.
3854
3855 2008-03-09  Darin Adler  <darin@apple.com>
3856
3857         * DerivedSources.make: Re-land the change, fixed, and with an attempt to fix the
3858         bots by removing the incorrect file.
3859
3860 2008-03-09  Oliver Hunt  <oliver@apple.com>
3861
3862         RS=Mark Rowe
3863
3864         Roll out r30909 -- it breaks the build and is a non-trivial fix (according to weinig)
3865
3866         * DerivedSources.make:
3867
3868 2008-03-09  Darin Adler  <darin@apple.com>
3869
3870         Reviewed by Adam.
3871
3872         * DerivedSources.make: Put the list of DOM classes into its own
3873         variable, and generate the JavaScript bindings and Objective-C
3874         bindings dependencies from that. Added some separators to make it
3875         a little easier to see the sections of the file. Moved all the
3876         Mac-specific rules (except for the SVG conditional part) down
3877         to the bottom of the file in a separate section.
3878
3879 2008-03-09  Adam Roben  <aroben@apple.com>
3880
3881         Windows build fix
3882
3883         * WebCore.vcproj/WebCore.vcproj: Make sure all Cairo files are
3884         excluded from all three CG-based configurations: Debug, Release, and
3885         Debug_Internal.
3886
3887 2008-03-08  Mark Rowe  <mrowe@apple.com>
3888
3889         Attempt to fix the Qt build.
3890
3891         * platform/MIMETypeRegistry.cpp:  Add missing include.
3892
3893 2008-03-08  Oliver Hunt  <oliver@apple.com>
3894
3895         Reviewed by Sam W.
3896
3897         Bug 16516: canvas image patterns stop working with some transformations
3898
3899         Simple fix.  We used x/yStep of FLT_MAX to fake a no-repeat-x/y pattern
3900         with CG.  However any transforms involving FLT_MAX immediately get
3901         consumed by the introduced floating point error.  yStep had already been
3902         clamped to a much smaller arbitrary value, and this patch makes us use
3903         that clamp value for xStep as well.
3904
3905         * html/CanvasPattern.cpp:
3906         (WebCore::CanvasPattern::createPattern):
3907
3908 2008-03-08  Oliver Hunt  <oliver@apple.com>
3909
3910         Reviewed by Mitz.
3911
3912         Bug 17728: Canvas.createPattern with null repeat argument throws an exception
3913
3914         Trivial fix, we were calling toString on null which produces the string "null",
3915         we just needed to switch to using valueToStringWithNullCheck rather than 
3916         JSValue::toString directly
3917
3918         Test: fast/canvas/canvas-pattern-behaviour.html
3919
3920         * WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp:
3921         (WebCore::JSCanvasRenderingContext2D::createPattern):
3922
3923 2008-03-08  Mark Rowe  <mrowe@apple.com>
3924
3925         Reviewed by Darin Adler.
3926
3927         Fix 64-bit build with GCC 4.2.
3928
3929         * bindings/objc/WebScriptObject.mm: Use NSUInteger in place of unsigned where required.
3930         * platform/mac/SharedBufferMac.mm: Ditto.
3931
3932 2008-03-08  Dan Bernstein  <mitz@apple.com>
3933
3934         Reviewed by Oliver Hunt.
3935
3936         - fix garbage in transparent areas in canvas.toDataURL results
3937
3938         * platform/graphics/cg/ImageBufferCG.cpp:
3939         (WebCore::ImageBuffer::toDataURL): Clear the bitmap context before
3940         painting the canvas image onto it.
3941
3942 2008-03-08  Darin Adler  <darin@apple.com>
3943
3944         Reviewed by Adele.
3945
3946         - eliminate custom highlight methods from WebCoreFrameBridge
3947
3948         * page/Chrome.cpp:
3949         (WebCore::ChromeClient::customHighlightRect): Added.
3950         (WebCore::ChromeClient::paintCustomHighlight): Added.
3951         * page/ChromeClient.h: Added custom highlight functions.
3952         * page/Frame.h: Removed custom highlight functions.
3953         * page/mac/FrameMac.mm: Ditto.
3954         * page/mac/WebCoreFrameBridge.h: Removed custom highlight methods.
3955         * rendering/InlineTextBox.cpp:
3956         (WebCore::InlineTextBox::paintCustomHighlight): Changed code to use
3957         the ChromeClient instead of WebCoreFrameBridge to do the custom highlight.
3958         * rendering/RenderBox.cpp:
3959         (WebCore::RenderBox::paintCustomHighlight): Ditto.
3960         * rendering/RootInlineBox.cpp:
3961         (WebCore::RootInlineBox::addHighlightOverflow): Ditto.
3962         (WebCore::RootInlineBox::paintCustomHighlight): Ditto.
3963
3964 2008-03-07  Stephanie Lewis  <slewis@apple.com>
3965
3966         Reviewed by Oliver.
3967
3968         Fix Windows build.
3969
3970         * platform/graphics/cg/ImageBufferCG.cpp:
3971         (WebCore::ImageBuffer::toDataURL):
3972
3973 2008-03-07  David D. Kilzer  <ddkilzer@apple.com>
3974
3975         Unify concept of enabling Netscape Plug-in API (NPAPI).
3976
3977         Reviewed by Darin.
3978
3979         No test cases since there is no change in functionality.
3980
3981         * DerivedSources.make: Added check for ENABLE_NETSCAPE_PLUGIN_API macro.
3982         If defined as "1", add WebCore.NPAPI.exp to WEBCORE_EXPORT_DEPENDENCIES.
3983         * WebCore.NPAPI.exp: Added.
3984         * WebCore.base.exp: Moved exported NPAPI methods to WebCore.NPAPI.exp.
3985         * WebCore.xcodeproj/project.pbxproj: Removed changes in r30826 (except
3986         comments) since we now handle exported NPAPI methods via DerivedSources.make.
3987
3988         * config.h: Removed USE(NPOBJECT) since we now use ENABLE(NETSCAPE_PLUGIN_API) as
3989         defined in Platform.h.
3990
3991         * bindings/objc/DOM.mm: Replaced USE(NPOBJECT) with ENABLE(NETSCAPE_PLUGIN_API).
3992         (-[DOMElement _NPObject]):
3993
3994         * bridge/NP_jsobject.cpp: Replaced !PLATFORM(DARWIN) || !defined(__LP64__) with
3995         ENABLE(NETSCAPE_PLUGIN_API).
3996         * bridge/NP_jsobject.h: Ditto.
3997         * bridge/c/c_class.cpp: Ditto.
3998         * bridge/c/c_class.h: Ditto.
3999         * bridge/c/c_instance.cpp: Ditto.
4000         * bridge/c/c_instance.h: Ditto.
4001         * bridge/c/c_runtime.cpp: Ditto.
4002         * bridge/c/c_runtime.h: Ditto.
4003         * bridge/c/c_utility.cpp: Ditto.
4004         * bridge/c/c_utility.h: Ditto.
4005         * bridge/npruntime.cpp: Ditto.
4006         * bridge/npruntime_impl.h: Ditto.
4007         * bridge/npruntime_priv.h: Ditto.
4008         * bridge/runtime.cpp: Ditto.
4009         (KJS::Bindings::Instance::createBindingForLanguageInstance):
4010
4011         * html/HTMLPlugInElement.cpp: Replaced USE(NPOBJECT) with ENABLE(NETSCAPE_PLUGIN_API).
4012         (WebCore::HTMLPlugInElement::HTMLPlugInElement):
4013         (WebCore::HTMLPlugInElement::~HTMLPlugInElement):
4014         * html/HTMLPlugInElement.h: Ditto.
4015
4016         * page/Frame.cpp: Replaced USE(NPOBJECT) with ENABLE(NETSCAPE_PLUGIN_API).
4017         (WebCore::Frame::clearScriptObjects):
4018         (WebCore::FramePrivate::FramePrivate): Also added #if ENABLE(NETSCAPE_PLUGIN_API)
4019         guard around m_windowScriptNPObject.
4020         * page/Frame.h: Replaced USE(NPOBJECT) with ENABLE(NETSCAPE_PLUGIN_API).
4021         * page/FramePrivate.h: Added #if ENABLE(NETSCAPE_PLUGIN_API) guard around
4022         m_windowScriptNPObject.
4023         * page/mac/FrameMac.mm: Replaced USE(NPOBJECT) with ENABLE(NETSCAPE_PLUGIN_API).
4024         (WebCore::Frame::createScriptInstanceForWidget):
4025
4026 2008-03-07  Alexey Proskuryakov  <ap@webkit.org>
4027
4028         Reviewed by Darin.
4029
4030         REGRESSION: Korean decoding doesn't support extended EUC-KR.
4031
4032         Test: fast/encoding/char-decoding.html
4033
4034         * platform/text/TextCodecICU.cpp:
4035         (WebCore::TextCodecICU::registerExtendedEncodingNames): Untangle the system of duplicate ICU
4036         encoding names by manually registering windows-939-2000, and mapping all other related
4037         encodings to it.
4038
4039 2008-03-07  Dan Bernstein  <mitz@apple.com>
4040
4041         Reviewed by Stephanie.
4042
4043         - try to fix leaks seen on Tiger after r30840
4044
4045         * css/CSSStyleSelector.cpp:
4046         (WebCore::CSSStyleSelector::~CSSStyleSelector): Use the default operator
4047         delete, rather than arena delete, to deallocate the root default style.
4048
4049 2008-03-07  Pierre-Luc Beaudoin  <pierre-luc.beaudoin@collabora.co.uk>
4050
4051         Reviewed by Alp Toker.
4052
4053         http://bugs.webkit.org/show_bug.cgi?id=17681
4054         GtkLauncher fails to render an element with position: fixed
4055
4056         Implement the required parts of PlatformScreenGtk.
4057
4058         * ChangeLog:
4059         * platform/gtk/PlatformScreenGtk.cpp:
4060         (WebCore::screenDepth):
4061         (WebCore::screenIsMonochrome):
4062         (WebCore::screenRect):
4063
4064 2008-03-07  Oliver Hunt  <oliver@apple.com>
4065
4066         Reviewed by Darin Adler.
4067
4068         Bug 16610: <canvas> restore() removes path segments created before it
4069
4070         The problem here is that WebKit stored the Path as part of the state, so
4071         restore would incorrectly lose changes made to the canvas path.  To match
4072         Firefox and HTML5 we make two real changes:
4073           * Move the context path from the state object directly onto the context.
4074             This is responsible for all the changes to the path manipulation functions
4075           * Add transform tracking to each state -- this is needed to correctly transform
4076             the current path when restore()-ing to a prior state.
4077
4078         Test: fast/canvas/canvas-save-restore-with-path.html
4079
4080         * html/CanvasRenderingContext2D.cpp:
4081         (WebCore::CanvasRenderingContext2D::restore):
4082         (WebCore::CanvasRenderingContext2D::scale):
4083         (WebCore::CanvasRenderingContext2D::rotate):
4084         (WebCore::CanvasRenderingContext2D::translate):
4085         (WebCore::CanvasRenderingContext2D::transform):
4086         (WebCore::CanvasRenderingContext2D::beginPath):
4087         (WebCore::CanvasRenderingContext2D::closePath):
4088         (WebCore::CanvasRenderingContext2D::moveTo):
4089         (WebCore::CanvasRenderingContext2D::lineTo):
4090         (WebCore::CanvasRenderingContext2D::quadraticCurveTo):
4091         (WebCore::CanvasRenderingContext2D::arcTo):
4092         (WebCore::CanvasRenderingContext2D::arc):
4093         (WebCore::CanvasRenderingContext2D::rect):
4094         (WebCore::CanvasRenderingContext2D::clearPathForDashboardBackwardCompatibilityMode):
4095         (WebCore::CanvasRenderingContext2D::fill):
4096         (WebCore::CanvasRenderingContext2D::stroke):
4097         (WebCore::CanvasRenderingContext2D::clip):
4098         (WebCore::CanvasRenderingContext2D::isPointInPath):
4099         * html/CanvasRenderingContext2D.h:
4100
4101 2008-03-07  Oliver Hunt  <oliver@apple.com>
4102
4103         Reviewed by Ada.
4104
4105         Fix for crash caused by FrameLoader incorrectly assuming it has
4106         a RenderWidget
4107
4108         In some circumstances an application embedding a WebView may 
4109         choose to prevent a webview from loading a resource.  If that
4110         resource was requested by an <object> element then we may 
4111         fallback to different content which may not produce a RenderWidget.
4112         Unfortunately FrameLoader::loadSubframe was assuming that if a
4113         renderer was produced it would always be a RenderWidget, and arbitrarily
4114         performed what could be an incorrect cast.  This could then lead to
4115         a crash.
4116
4117         We currently don't have anyway of making a test for this.
4118
4119         * loader/FrameLoader.cpp:
4120         (WebCore::FrameLoader::loadSubframe):
4121
4122 2008-03-07  Samuel Weinig  <sam@webkit.org>
4123
4124         Reviewed by Oliver Hunt.
4125
4126         Fix for http://bugs.webkit.org/show_bug.cgi?id=16673
4127         <canvas> lacks toDataURL()
4128
4129         Tests: fast/canvas/toDataURL-noData.html
4130                fast/canvas/toDataURL-supportedTypes.html
4131
4132         * html/CanvasRenderingContext2D.cpp:
4133         (WebCore::CanvasRenderingContext2D::printSecurityExceptionMessage): Make message non-global.
4134         * html/HTMLCanvasElement.cpp:
4135         (WebCore::HTMLCanvasElement::printSecurityExceptionMessage): Log error message indicating that toDataURL has
4136         been called on a tainted canvas. 
4137         (WebCore::HTMLCanvasElement::toDataURL): This does the tainted canvas check, ensures that the canvas has pixel
4138         data, checks to see if the MIME type is supported.  Unsupported MIME types and the null string (which is made
4139         by passing no argument/null/undefined in JavaScript) are treated as being PNG, as per the spec.  The actual 
4140         toDataURL logic is actually done in the ImageBuffer class.
4141         * html/HTMLCanvasElement.h: Add function declarations.
4142         * html/HTMLCanvasElement.idl: Add function declaration.
4143
4144         * platform/MIMETypeRegistry.cpp:
4145         (WebCore::initializeSupportedImageMIMETypes):