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