612a6bf3ee6815c6f984ca981f9054b0c76bf7bd
[WebKit-https.git] / WebCore / ChangeLog
1 2007-03-25  Alexey Proskuryakov  <ap@webkit.org>
2
3         Reviewed by Darin.
4
5         A partial fix for http://bugs.webkit.org/show_bug.cgi?id=13021
6         XPath can be very slow
7
8         * xml/XPathExpression.cpp:
9         (WebCore::XPathExpression::evaluate): Reset a reference to the context node, as this may prevent the whole document
10         from being destroyed in time.
11
12         * dom/Attr.cpp:
13         (WebCore::Attr::createTextChild): Instead of calling appendChild(), just do the few operations it really needs to perform.
14         * dom/ContainerNode.h:
15         (WebCore::ContainerNode::fastSetFirstChild):
16         (WebCore::ContainerNode::fastSetLastChild):
17         Added operations that let Attr hack internal ContainerNode data (evil, but fast!).
18
19         * xml/XPathStep.cpp:
20         (WebCore::XPath::Step::evaluate):
21         (WebCore::XPath::Step::nodesInAxis):
22         (WebCore::XPath::Step::nodeMatches):
23         * xml/XPathStep.h:
24         Merged node testing into axis enumeration. This saves a lot of Vector resizing and passing, and is necessary for future 
25         optimizations (sometimes, we can just pick the single result node instead of enumerating and filtering the whole axis).
26
27 2007-03-24  Mitz Pettel  <mitz@webkit.org>
28
29         Reviewed by Darin.
30
31         - fix http://bugs.webkit.org/show_bug.cgi?id=13156
32           REGRESSION (r19621): Pasting breakable content where wrapped line is too long to fit in a textarea fails to draw a horizontal scrollbar
33
34         Test: fast/text/midword-break-after-breakable-char.html
35
36         Breaking in the middle of the word
37         is allowed only if no breaking opportunity between words has occurred yet. The
38         first position on the line should not be considered "between words" even if
39         it is a breaking opportunity.
40         
41         * rendering/bidi.cpp:
42         (WebCore::RenderBlock::findNextLineBreak): Changed according to the above. Also
43         cleaned up a couple of lines.
44
45 2007-03-24  David Hyatt  <hyatt@apple.com>
46
47         Fix for bugzilla bug 13187, place a hard limit on the amount of decoded data that WebCore will keep
48         around even on live pages (pages being displayed in tabs/windows or in the back/forward cache).
49         Images will decode to paint and once the decoded data exceeds the cache size, the decoded data will be
50         tossed.
51
52         Refine the flushing algorithm to apply the two-pass decode/evict model to each LRU-SP queue individually, rather
53         than to all the lists at once.  This allows the cache to evict large encoded resources before flushing small
54         or frequently accessed decoded onces.
55
56         Added information on live/decoded data to the cache statistics.
57
58         Reviewed by darin
59
60         * loader/Cache.cpp:
61         (WebCore::Cache::Cache):
62         (WebCore::Cache::pruneLiveResources):
63         (WebCore::Cache::pruneAllResources):
64         (WebCore::Cache::setMaximumSize):
65         (WebCore::Cache::remove):
66         (WebCore::Cache::lruListFor):
67         (WebCore::Cache::removeFromLRUList):
68         (WebCore::Cache::insertInLRUList):
69         (WebCore::Cache::liveLRUListFor):
70         (WebCore::Cache::removeFromLiveResourcesList):
71         (WebCore::Cache::insertInLiveResourcesList):
72         (WebCore::Cache::addToLiveResourcesSize):
73         (WebCore::Cache::removeFromLiveResourcesSize):
74         (WebCore::Cache::adjustSize):
75         (WebCore::Cache::getStatistics):
76         * loader/Cache.h:
77         (WebCore::Cache::TypeStatistic::TypeStatistic):
78         * loader/CachedImage.cpp:
79         (WebCore::CachedImage::decodedSizeWillChange):
80         (WebCore::CachedImage::decodedSizeChanged):
81         * loader/CachedImage.h:
82         * loader/CachedResource.cpp:
83         (WebCore::CachedResource::CachedResource):
84         (WebCore::CachedResource::ref):
85         (WebCore::CachedResource::deref):
86         (WebCore::CachedResource::setEncodedSize):
87         (WebCore::CachedResource::liveResourceAccessed):
88         * loader/CachedResource.h:
89         (WebCore::CachedResource::liveAccessCount):
90         (WebCore::CachedResource::resetLiveAccessCount):
91         (WebCore::CachedResource::increaseLiveAccessCount):
92         * platform/graphics/BitmapImage.cpp:
93         (WebCore::BitmapImage::destroyDecodedData):
94         (WebCore::BitmapImage::cacheFrame):
95         * platform/graphics/ImageObserver.h:
96         * rendering/RenderBox.cpp:
97         (WebCore::RenderBox::paintBackgroundExtended):
98         * rendering/RenderImage.cpp:
99         (WebCore::RenderImage::paint):
100         * rendering/RenderListMarker.cpp:
101         (WebCore::RenderListMarker::paint):
102         * rendering/RenderObject.cpp:
103         (WebCore::RenderObject::paintBorderImage):
104
105 2007-03-24  Darin Adler  <darin@apple.com>
106
107         Reviewed by Mitz.
108
109         - fix http://bugs.webkit.org/show_bug.cgi?id=13123
110           CSS selectors that use :lang, :not, and namespaces do not serialize correctly
111
112         Test: fast/css/css-selector-text.html
113
114         * css/CSSSelector.cpp: (WebCore::CSSSelector::selectorText): Add the namespace
115         prefix for tag or attribute names, the sub-selector for :not, and the argument
116         for :lang.
117
118 2007-03-24  Brady Eidson  <beidson@apple.com>
119
120         Reviewed by Adam
121
122         <rdar://problem/5086210> - Move RetainPtr to WTF
123
124         * ForwardingHeaders/wtf/RetainPtr.h: Added.
125         * WebCore.xcodeproj/project.pbxproj: Removed WebCore/RetainPtr.h
126         
127         * history/HistoryItem.h: Changed #include to <wtf/RetainPtr.h>
128         * history/PageCache.h: Ditto
129         * page/mac/WebCoreFrameBridge.mm: Ditto
130         * platform/ContextMenu.h: Ditto
131         * platform/ContextMenuItem.h: Ditto
132         * platform/DragImage.h: Ditto
133         * platform/FileChooser.h: Ditto
134         * platform/PlatformKeyboardEvent.h: Ditto
135         * platform/PopupMenu.h: Ditto
136         * platform/SharedBuffer.h: Ditto
137         * platform/cf/RetainPtr.h: Removed.
138         * platform/graphics/Icon.h: Changed #include
139         * platform/mac/ClipboardMac.h: Ditto
140         * platform/mac/PasteboardMac.mm: Ditto
141         * platform/mac/WidgetMac.mm: Ditto
142         * platform/network/AuthenticationChallenge.h: Ditto
143         * platform/network/ResourceError.h: Ditto
144         * platform/network/ResourceHandle.h: Ditto
145         * platform/network/ResourceRequest.h: Ditto
146         * platform/network/ResourceResponse.h: Ditto
147         * rendering/RenderThemeMac.mm: Ditto
148
149 2007-03-24  Mitz Pettel  <mitz@webkit.org>
150
151         Fix for <rdar://problem/5086797>, layoutPending is now reporting incorrect results, which will lead
152         to all sorts of layout issues.  This is in bugzilla as 13179.
153
154         Reviewed by hyatt
155
156         - fix http://bugs.webkit.org/show_bug.cgi?id=13179
157           REGRESSION (r20410): In debug builds, loading a certain page is suspended until redisplay is forced
158
159         Moved the root->needsLayout() check from layoutPending() to needsLayout()
160         to restore the behavior before r20324.
161
162         * page/FrameView.cpp:
163         (WebCore::FrameView::layoutPending):
164         (WebCore::FrameView::needsLayout):
165
166 2007-03-24  Mitz Pettel  <mitz@webkit.org>
167
168         Reviewed by Adele.
169
170         - fix http://bugs.webkit.org/show_bug.cgi?id=13180
171               <rdar://problem/5084478>
172           Another debug build crash from ASSERTION FAILED: !needsLayout()
173
174         No test possible because updateRendering() is always called after script
175         execution.
176
177         * page/FrameView.cpp:
178         (WebCore::FrameView::layout): Get the layout root after calling recalcStyle()
179         since a style recalc may result in needing to do start layout at the root.
180
181 2007-03-24  Nikolas Zimmermann  <zimmermann@kde.org>
182
183         Not reviewed. Build fix.
184
185         Fix FloatRect vs. IntRect confusion.
186
187         * rendering/RenderSVGImage.cpp:
188         (WebCore::RenderSVGImage::nodeAtPoint):
189
190 2007-03-25  Mark Rowe  <mrowe@apple.com>
191
192         Fix incorrect radar number.
193
194         * platform/network/mac/ResourceHandleMac.mm:
195         (-[WebCoreResourceHandleAsDelegate connection:willCacheResponse:]):
196
197 2007-03-23  Nikolas Zimmermann  <zimmermann@kde.org>
198
199         Reviewed by Oliver.
200
201         Fix all known RenderSVGImage problems.
202
203         Fixes: http://bugs.webkit.org/show_bug.cgi?id=12126 (RenderSVGImage seems to suffer from integer overflow)
204         Fixes: http://bugs.webkit.org/show_bug.cgi?id=12442 (raster images disappearing during script execution (SVG))
205         Fixes: http://bugs.webkit.org/show_bug.cgi?id=12572 (WebKit does not properly invalidate image region after image load)
206
207         Added test: svg/custom/scrolling-embedded-svg-file-image-repaint-problem.html
208
209         In RenderSVGImage::paint, do not call shouldPaint() as this will never work properly for SVG renderers, as shouldPaint
210         doesn't take into account any special SVG transformation (localTransform/absoluteTransform). Just remove the call.
211
212         Fix hit detection on RenderSVGImage - it didn't work properly at all. No idea why I didn't notice before.
213         Thanks Andreas Neumann once again for writing excellent bug reports and pointing me to them :-)
214
215         The carto.net navigation tools work as expected now, and also the "dock like" image effect example.
216
217         * rendering/RenderSVGImage.cpp:
218         (WebCore::RenderSVGImage::paint):
219         (WebCore::RenderSVGImage::nodeAtPoint):
220
221 2007-03-24  Mitz Pettel  <mitz@webkit.org>
222
223         Reviewed by Dave Hyatt.
224
225         - http://bugs.webkit.org/show_bug.cgi?id=13177
226           Suppress control characters in the ATSUI code path
227
228         * platform/mac/FontMac.mm:
229         (WebCore::overrideLayoutOperation):
230         (WebCore::ATSULayoutParameters::initialize):
231
232 >>>>>>> .r20473
233 2007-03-24  David Hyatt  <hyatt@apple.com>
234
235         Fix for <rdar://problem/5086400>, images scrolled offscreen continue to animate.  Safari 2 would
236         halt animations when images were no longer visible.
237
238         Reviewed by mjs, olliej
239
240         * platform/graphics/BitmapImage.cpp:
241         (WebCore::BitmapImage::advanceAnimation):
242
243 2007-03-24  David Hyatt  <hyatt@apple.com>
244
245         Fix for <rdar://problem/508328>, sluggish text entry in search field.  Make sure
246         our size actually changed before we decide to do a full repaint because of background/border
247         complexities.
248
249         Reviewed by aroben
250
251         * rendering/RenderObject.cpp:
252         (WebCore::RenderObject::repaintAfterLayoutIfNeeded):
253
254 2007-03-23  Dave Hyatt  <hyatt@apple.com>
255
256         Fix for <rdar://problem/5048219>, spurious glyphs in gmail.   This is bugzilla bug 13136, which
257         will remain open to cover patching the complex text path.
258         
259         Reviewed by aroben
260
261         * platform/Font.cpp:
262         (WebCore::Font::glyphDataForCharacter):
263         * platform/Font.h:
264         (WebCore::Font::treatAsZeroWidthSpace):
265         * platform/GlyphPageTreeNode.cpp:
266         (WebCore::GlyphPageTreeNode::initializePage):
267
268 2007-03-23  Mitz Pettel  <mitz@webkit.org>
269
270         Reviewed by Adele.
271
272         - fix http://bugs.webkit.org/show_bug.cgi?id=13153
273           REGRESSION: Visual highlighting of pre-populated blank line in textarea is broken
274
275         - fix a bug where selecting across a soft line break did not highlight to
276           the end of the first line if it contained skipped whitespace
277
278         Test: fast/text/selection-hard-linebreak.html
279
280         * rendering/InlineTextBox.cpp:
281         (WebCore::InlineTextBox::selectionState): Changed to treat a selection that ends on the
282         end of a hard line break as if it ends after the line break. Fixed the case of a selection
283         that starts and ends in the same text object as the box but does not intersect it
284         to return SelectionNone instead of selectionBoth.
285
286 2007-03-23  Mitz Pettel  <mitz@webkit.org>
287
288         Reviewed by Adele.
289
290         - fix http://bugs.webkit.org/show_bug.cgi?id=13124
291           REGRESSION: Reproducible crash in Widget::getView
292
293         Test: fast/frames/hover-timer-crash.html
294
295         * page/Frame.cpp:
296         (WebCore::Frame::setView): Added a call to EventHandler::clear().
297
298 2007-03-23  Justin Garcia  <justin.garcia@apple.com>
299
300         Reviewed by adele
301
302         <rdar://problem/5078739> 
303         Crash in in ReplaceSelectionCommand if the fragment contains only a style span
304
305         * editing/ReplaceSelectionCommand.cpp:
306         (WebCore::ReplaceSelectionCommand::doApply): Check 
307         for an empty fragment after removing a redundant
308         style span instead of before.
309
310 2007-03-23  David Hyatt  <hyatt@apple.com>
311
312         <rdar://problem/5085063>
313
314         Fix non-looping animation on cuteoverload.com. Just always flush
315         decoded data for large animated images to avoid our cache getting
316         out of sync with the image source.
317
318         Reviewed by ggaren
319
320         * platform/graphics/BitmapImage.cpp:
321         (WebCore::BitmapImage::advanceAnimation):
322
323 2007-03-23  Adele Peterson  <adele@apple.com>
324
325         Reviewed by Darin.
326
327         Fix for <rdar://problem/5061024> REGRESSION: Returning false from onkeypress event on Input is ignored when key is Tab
328         http://bugs.webkit.org/show_bug.cgi?id= 13020
329
330         No known way to add a layout test for this.  We would need a way to know exactly how the event was consumed.
331
332         * page/EventHandler.cpp: (WebCore::EventHandler::defaultKeyboardEventHandler):
333           If the keypress event has its default behavior prevented, then we should consider the keydown event handled.
334
335 2007-03-23  Justin Garcia  <justin.garcia@apple.com>
336
337         Reviewed by darin
338
339         <rdar://problem/5080333> 
340         REGRESSION: Selection changes when changing the alignment of an image
341         
342         Regression occurred when we started using moveParagraphs
343         to move content in applyBlockStyle.  moveParagraphs 
344         moves by copying, deleting and reinserting content, and
345         so must be accompanied by selection preservation code.
346         That code uses rangeFromLocationAndLength and rangeLength,
347         which use TextIterators, which don't emit anything for images 
348         and other replaced elements, causing this bug.
349
350         * editing/ApplyStyleCommand.cpp:
351         (WebCore::ApplyStyleCommand::applyBlockStyle): Ask rangeLength 
352         and rangeFromLocationAndLength to request that their
353         TextIterators emit spaces for replaced elements.
354         Use rangeCompliantEquivalent()s when creating a Range from
355         VisiblePositions, since some VisiblePositions have illegal
356         deepEquivalent()s.
357         * editing/CompositeEditCommand.cpp:
358         (WebCore::CompositeEditCommand::moveParagraphs): Ditto.
359         * editing/TextIterator.cpp:
360         (WebCore::TextIterator::TextIterator):
361         (WebCore::TextIterator::handleReplacedElement): Emit
362         a space if requested.
363         (WebCore::TextIterator::representNodeOffsetZero): Emit
364         ranges before m_node, not around m_lastTextNode.  These
365         ranges should represent the part of the document associated
366         with the emitted character. 
367         (WebCore::TextIterator::rangeLength): Take in the new bool.
368         (WebCore::TextIterator::rangeFromLocationAndLength): Ditto.
369         Also, don't loop an extra time after finding the end of the
370         range when we're looking for zero length ranges.  This appeared
371         to be a workaround for the bugs fixed in representNodeOffsetZero
372         in this patch.
373         * editing/TextIterator.h:
374
375 2007-03-24  Mark Rowe  <mrowe@apple.com>
376
377         Rubber-stamped by Darin.
378
379         * Configurations/WebCore.xcconfig: Remove unnecessary INFOPLIST_PREPROCESS.
380
381 2007-03-23  Darin Adler  <darin@apple.com>
382
383         * html/HTMLBodyElement.cpp: Fix comment typo.
384
385 2007-03-23  George Staikos  <staikos@kde.org>
386
387         Reviewed and committed by George.
388
389         Patch from Adam Treat to make the Qt build work without SVG and XSLT.
390         XMLNames is required in any case.
391
392         * WebCore.pro:
393
394 2007-03-23  Darin Adler  <darin@apple.com>
395
396         Reviewed by Hyatt.
397
398         - <rdar://problem/5074439> handle margins on frame and iframe elements
399           without involving FrameView, FrameLoader, etc.
400
401         * html/HTMLBodyElement.cpp: (WebCore::HTMLBodyElement::insertedIntoDocument):
402         Grab the margin from the frame directly here. There was no real benefit
403         to doing this via FrameView. Later we can delete quite a bit of unneeded code
404         here and in WebKit that exists only to set up the margin values in FrameView,
405         which are now unused.
406
407 2007-03-23  Adele Peterson  <adele@apple.com>
408
409         Reviewed by Darin.
410
411         Fix for <rdar://problem/5080428> REGRESSION: getting value for hidden input element fails after the fix for Bug 11866
412         http://bugs.webkit.org/show_bug.cgi?id=13121
413
414         Rolled out the change for 11866 that made hidden input elements store the value separately from the value attribute.
415         Added an m_originalValue field that gets set when the element is done being parsed (in closeRenderer).  In reset,
416         use the m_originalValue for hidden input elements.
417
418         * html/HTMLInputElement.cpp:
419         (WebCore::HTMLInputElement::closeRenderer):
420         (WebCore::HTMLInputElement::reset):
421         (WebCore::HTMLInputElement::setValue):
422         (WebCore::HTMLInputElement::storesValueSeparateFromAttribute):
423         * html/HTMLInputElement.h:
424
425 2007-03-23  Mitz Pettel  <mitz@webkit.org>
426
427         Reviewed by Dave Hyatt.
428
429         - fix http://bugs.webkit.org/show_bug.cgi?id=13157
430               <rdar://problem/5083995>
431           List markers positioned incorrectly and don't repaint properly on Oxford homepage
432
433         Test: fast/lists/marker-image-error.html
434
435         * rendering/RenderListMarker.cpp:
436         (WebCore::RenderListMarker::imageChanged): Mark ourselves for relayout if
437         the image failed to load, since that means we will use a bullet instead.
438
439 2007-03-23  Zack Rusin  <zrusin@trolltech.com>
440
441         Fix the compile.
442
443         * platform/graphics/qt/ImageSourceQt.cpp:
444
445 2007-03-22  Dave Hyatt  <hyatt@apple.com>
446
447         Fix for <rdar://problem/5083072>.
448
449         * page/Frame.cpp:
450         (WebCore::Frame::setPrinting):
451         (WebCore::Frame::forceLayoutWithPageWidthRange):
452         * page/Frame.h:
453         * page/mac/WebCoreFrameBridge.mm:
454         (-[WebCoreFrameBridge forceLayoutWithMinimumPageWidth:maximumPageWidth:adjustingViewSize:]):
455
456 2007-03-22  Anders Carlsson  <acarlsson@apple.com>
457
458         Reviewed by Ada.
459
460         <rdar://problem/5074974>
461         CrashTracer: [USER] repro crash in Safari at com.apple.WebCore: WebCore::FrameLoader::activeDocumentLoader const + 6
462         
463         * loader/mac/NetscapePlugInStreamLoaderMac.mm:
464         (WebCore::NetscapePlugInStreamLoader::didReceiveResponse):
465         Don't use ResourceResponse:isHTTP here since that only looks at the protocol instead of if the response came from a 
466         HTTP server (and not a web archive).
467
468 2007-03-22  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
469
470         Not reviewed - gdk build fix.
471
472         * platform/graphics/cairo/ImageSourceCairo.cpp:
473
474 2007-03-22  Dave Hyatt  <hyatt@apple.com>
475
476         Fix for <rdar://problem/5083473>.  Make sure wheeling still forwards to the frame view even
477         when no node is hit.  Technically not ever hitting a node is a regression from the RenderView
478         size changes (making it be the size of the initial containing block according to CSS2.1), but
479         we should still handle this case gracefully in case it comes up again.
480        
481         Reviewed by olliej
482
483         * page/EventHandler.cpp:
484         (WebCore::EventHandler::handleWheelEvent):
485
486 2007-03-22  Justin Garcia  <justin.garcia@apple.com>
487
488         Reviewed by kevin
489
490         <rdar://problem/5081257> 
491         REGRESSION: New Mail signatures start out empty
492
493         * editing/VisiblePosition.cpp:
494         (WebCore::VisiblePosition::canonicalPosition): Allow
495         descent from positions inside the document into an 
496         editable body.
497
498 2007-03-22  Brady Eidson  <beidson@apple.com>
499
500         Reviewed by Adele and John
501
502         <rdar://5043528> - Prepare for new API
503         
504         * platform/network/ResourceHandle.cpp:
505         (WebCore::ResourceHandle::clearAuthentication): Clear CF type
506
507 2007-03-22  Beth Dakin  <bdakin@apple.com>
508
509         Patch by Hyatt, reviewed and committed by me.
510
511         Does not reproduce consistently, so a layout test does not seem 
512         possible.
513
514         Fix for <rdar://problem/5082421> Constantly hitting ASSERT(!
515         needsLayout()) in RenderView::paint()
516
517         * page/FrameView.cpp:
518         (WebCore::FrameView::layoutPending): It is not enough to ask if the 
519         layout timer is active. There may be times that we don't have a 
520         body yet so we cannot schedule layout yet, but the root still needs 
521         layout.  
522
523 2007-03-22  John Sullivan  <sullivan@apple.com>
524
525         Reviewed by Darin
526         
527         Followup for recent fix to 5079700, found by assertion added to Safari.
528
529         * page/mac/FrameMac.mm:
530         (WebCore::Frame::searchForLabelsBeforeElement):
531         Fixed another place in this method where an empty NSString was being returned instead of nil.
532         Cleaned up the style a little too.
533
534 2007-03-22  David Hyatt  <hyatt@apple.com>
535
536         Remove unnecessary destroyFrameAtIndex call.  Now that we throw away
537         the image source, it is no longer needed.
538
539         Reviewed by beth
540
541         * platform/graphics/BitmapImage.cpp:
542         (WebCore::BitmapImage::destroyDecodedData):
543
544 2007-03-22  David Harrison  <harrison@apple.com>
545
546         Reviewed by Geoff, Darin.
547
548         <rdar://problem/5077892> In RapidWeaver 3.5.1, a crash occurs when attempting to load Safari Bookmarks in iMedia Browser
549         
550         * platform/mac/ThreadCheck.mm:
551         (WebCore::_WebCoreThreadViolationCheck):
552         Change default on Tiger to NSLog rather than raise an exception.
553
554 2007-03-22  Darin Adler  <darin@apple.com>
555
556         Reviewed by Brady.
557
558         - use binary_search instead of hash table; slightly better performance and
559           less memory use
560
561         * platform/network/ResourceHandle.cpp: (WebCore::ResourceHandle::portAllowed):
562         Use binary_search.
563
564 2007-03-22  Darin Adler  <darin@apple.com>
565
566         Reviewed by Adele.
567
568         - fix <rdar://problem/5074630> detachChildren call should move from WebKit to WebCore
569
570         * loader/FrameLoader.cpp: (WebCore::FrameLoader::setDocumentLoader):
571         Add a call to detachChildren() after the call to prepareForDataSourceReplacement().
572         There was no reason for this crucial loading step to be left to the client.
573
574 2007-03-22  David Hyatt  <hyatt@apple.com>
575
576         Minor refactoring and cleanup of the bridge calls that want to control layout settings on the RenderView.
577         Have the bridge talk through the FrameView instead of just asking for the RenderView directly.
578
579         Add an assert to help catch situations where the RenderView needs layout at paint time, since this is a known
580         catastrophic scenario that will (much of the time) result in a crash in RenderTableSection::paint.
581
582         Reviewed by aroben
583
584         * page/FrameView.cpp:
585         (WebCore::FrameView::adjustViewSize):
586         (WebCore::FrameView::needsLayout):
587         (WebCore::FrameView::setNeedsLayout):
588         * page/FrameView.h:
589         * page/mac/WebCoreFrameBridge.mm:
590         (-[WebCoreFrameBridge needsLayout]):
591         (-[WebCoreFrameBridge setNeedsLayout]):
592         * rendering/RenderView.cpp:
593         (WebCore::RenderView::paint):
594
595 2007-03-21  Geoffrey Garen  <ggaren@apple.com>
596
597         Reviewed by Beth Dakin.
598         
599         Re-worked the fix in r20375. 'M' and 'm' are not the only commands that
600         accept "extra" coordinates -- virtually all commands accept them.
601
602         * ksvg2/svg/SVGParserUtilities.cpp:
603         (WebCore::SVGPathParser::parseSVG):
604
605 2007-03-21  David Harrison  <harrison@apple.com>
606
607         Reviewed by hyatt.
608
609         <rdar://problem/5072460> CrashTracer: [USER] 1 crashes in Xcode at com.apple.ImageIO.framework: getBandProcPNG + 168
610
611         An NSData object was being alloc/init'd, then returned callers who cast the pointer as a
612         CFDataRef, including calling CFRelease on it. The problem is that under garbage collection, the NS
613         retain count is ignored (it's always 0), but the CFRetain and CFRelease are not ignored. This
614         caused the object to be over-released. The solution that works in both GC and non-GC is to "transfer"
615         the initial NS retain count to the CF retain count, using HardRetainWithNSRelease.
616         
617         The creator of the NSData was SharedBuffer::createNSData. The callers were PDFDocumentImage::dataChanged()
618         and ImageSource::setData(). This particular crash involved the ImageSource::setData() case.
619
620         * platform/SharedBuffer.h:
621         Declare createCFData().
622         
623         * platform/graphics/cg/ImageSourceCG.cpp:
624         (WebCore::ImageSource::setData):
625         Call createCFData instead of createNSData.
626         
627         * platform/graphics/cg/PDFDocumentImage.cpp:
628         (WebCore::PDFDocumentImage::dataChanged):
629         Call createCFData instead of createNSData.
630         
631        * platform/mac/SharedBufferMac.mm:
632         (WebCore::SharedBuffer::createCFData):
633         Implement createCFData(). Use HardRetainWithNSRelease for gc safety.
634         
635 2007-03-21  Mitz Pettel  <mitz@webkit.org>
636
637         Reviewed by Darin.
638
639         - fix http://bugs.webkit.org/show_bug.cgi?id=13145
640           Regression: Scrollbar not resizing after display none
641
642         Test: fast/dynamic/view-overflow.html
643
644         * rendering/RenderView.cpp:
645         (WebCore::RenderView::layout): Reset overflowHeight() and overflowWidth()
646         before calling docHeight() and docWidth(), since the former act as a lower
647         bound for the latter.
648
649 2007-03-21  Geoffrey Garen  <ggaren@apple.com>
650
651         Reviewed by Beth Dakin.
652         
653         A little cleanup based work I've been doing on the SVG parsers.
654
655         * ksvg2/svg/SVGParserUtilities.h:
656         (WebCore::skipString):
657         * ksvg2/svg/SVGPreserveAspectRatio.cpp: Moved checkString into
658         SVGParserUtilities.h, so it could be with all its friends. Renamed 
659         "checkString" to "skipString" to match the rest of the code and to be 
660         clear about which functions move the buffer pointer.
661         (WebCore::SVGPreserveAspectRatio::parsePreserveAspectRatio):
662         * ksvg2/svg/SVGTransformable.cpp:
663         (WebCore::SVGTransformable::parseTransformAttribute): Changed gotos into 
664         returns. Removed unnecessary magic number.
665
666 2007-03-21  Geoffrey Garen  <ggaren@apple.com>
667
668         Reviewed by Beth Dakin.
669         
670         Fixed <rdar://problem/5078471> SVG rgb color parser runs past end of 
671         buffer when running fuzzing test
672
673         * ksvg2/svg/SVGColor.cpp:
674         (WebCore::parseNumberOrPercent): Check for past the end condition.
675         (WebCore::SVGColor::colorFromRGBColorString): Reversed "read past end
676         of buffer, then check if you're past the end" logic.
677
678 2007-03-21  Geoffrey Garen  <ggaren@apple.com>
679
680         Reviewed by Beth Dakin.
681         
682         Fixed <rdar://problem/5079410> SVG path parser hangs, exhausts memory when 
683         running fuzzer test
684
685         * ksvg2/svg/SVGParserUtilities.cpp:
686         (WebCore::SVGPathParser::parseSVG): Don't assume that extra digits are
687         always preceded by an 'M' or an 'm'.
688
689 2007-03-21  John Sullivan  <sullivan@apple.com>
690
691         Reviewed by Adam
692         
693         - fixed <rdar://problem/5079700> REGRESSION (r19702): Name/password aren't autofilled 
694           or saved for .Mac homepage login
695
696         * page/mac/FrameMac.mm:
697         (WebCore::Frame::searchForLabelsBeforeElement):
698         don't count empty strings as valid results
699
700 2007-03-21  Justin Garcia  <justin.garcia@apple.com>
701
702         Reviewed by darin
703
704         * editing/markup.cpp:
705         (WebCore::styleFromMatchedRulesAndInlineDecl): 
706         Release the RefPtr to avoid increasing/decreasing
707         the refcount unnecessarily.
708         (WebCore::propertyMissingOrEqualToNone): Added and used
709         instead of converting values to strings.
710         (WebCore::elementHasTextDecorationProperty): 
711         (WebCore::createMarkup):
712
713 2007-03-21  Justin Garcia  <justin.garcia@apple.com>
714
715         Reviewed by oliver
716
717         <rdar://problem/5075944> 
718         REGRESSION: Partially selected underlined content pastes as plain text
719         
720         We stopped adding markup for all the ancestors
721         of lastClosed up to the commonAncestorBlock
722         because it was adding a lot of unnecessary markup.
723         This caused us to lose underlining when copying a 
724         partially selected underlined element (even though 
725         we put all styles that the copied markup inherits 
726         into a style span, because the text-decoration 
727         isn't inheritable).
728
729         * editing/markup.cpp:
730         (WebCore::styleFromMatchedRulesAndInlineDecl): Moved
731         code here.
732         (WebCore::elementHasTextDecorationProperty): Added.
733         (WebCore::createMarkup): If the copied markup has a
734         text-decoration because some common ancestor has
735         a text-decoration property set, include that ancestor
736         and all its descendants in the copied markup.
737
738 2007-03-21  Oliver Hunt  <oliver@apple.com>
739
740         Reviewed by Antti.
741
742         Update a few SVG attribute parsers to be more defensive against
743         reading beyond the end of input. 
744
745         Fixes rdar://problem/5077218 -- SVG transform parser runs past
746         end of buffer when running fuzzing test
747
748         * ksvg2/svg/SVGParserUtilities.cpp:
749         (WebCore::SVGPathParser::parseSVG):
750         * ksvg2/svg/SVGParserUtilities.h:
751         (WebCore::skipOptionalSpacesOrDelimiter):
752         * ksvg2/svg/SVGTransformable.cpp:
753         (WebCore::parseTransformParamList):
754         (WebCore::SVGTransformable::parseTransformAttribute):
755
756 2007-03-21  Alexey Proskuryakov  <ap@webkit.org>
757
758         Reviewed by Mitz.
759
760         http://bugs.webkit.org/show_bug.cgi?id=13140
761         Crash after loading SVG fragment with XMLHttpRequest (Yosemite Map Geology Layer)
762
763         Test: svg/carto.net/frameless-svg-parse-error.html
764
765         * ksvg2/misc/SVGDocumentExtensions.cpp:
766         (WebCore::SVGDocumentExtensions::reportError): Added a null check.
767         (WebCore::SVGDocumentExtensions::reportWarning): Ditto.
768
769 2007-03-21  Beth Dakin  <bdakin@apple.com>
770
771         Reviewed by Geoff.
772
773         Fix for <rdar://problem/5072678> Crash in
774         RenderLayer::scrollRectToVisible with MallocScribble enabled
775
776         I tried to fix this earlier today but my fix caused a regression
777         scrolling through RSS pages. It turns out that sometimes scroll
778         events need to propagate immediately, and sometimes they must be
779         delayed or they risk deleting objects that are expected to be
780         around after the event has propagated. Mitz's original fix made
781         sheduleEvent() only delay events that happen during layout. This
782         fix marks two other places in addition to layout where events also
783         need to be delayed. These two places are places that were marked
784         with FIXMEs that Mitz removed in his original patch. (There was a
785         third FIXME in RenderLayer::updateScrollInfoAfterLayout() but that
786         case is only called through layout and is covered by Mitz's
787         original patch.)
788
789         * page/FrameView.cpp:
790         (WebCore::FrameView::~FrameView): Added assertion.
791         (WebCore::FrameView::layout): Call new functions to increment and 
792         decrement the queued events count.
793         (WebCore::FrameView::pauseScheduledEvents):
794         (WebCore::FrameView::resumeScheduledEvents): Decrement queued 
795         events count and dispatch events if the count has zeroed.
796         * page/FrameView.h:
797         * rendering/RenderLayer.cpp:
798         (WebCore::RenderLayer::scrollRectToVisible):
799         (WebCore::Marquee::start):
800
801 2007-03-21  Mitz Pettel  <mitz@webkit.org>
802
803         Reviewed by John Sullivan.
804
805         - fix http://bugs.webkit.org/show_bug.cgi?id=13130
806           REGRESSION: Sometimes a frame resizer keeps following the mouse after mouseup
807
808         * rendering/RenderFrameSet.cpp:
809         (WebCore::RenderFrameSet::userResize): Reordered the code to allow resizing
810         to be terminated by a mouseup event regardless of whether the frameset needs
811         layout.
812
813 2007-03-20  Anders Carlsson  <acarlsson@apple.com>
814
815         Reviewed by Oliver.
816
817         <rdar://problem/5077252> 
818         In NetNewsWire 2.1.1 and 3.0d62, a crash occurs after triple-clicking a link on the page
819         
820         * loader/FrameLoader.cpp:
821         (WebCore::FrameLoader::load):
822         Move the m_inStopAllLoaders check to the load function that's common for loading a request or substitute data.
823
824 2007-03-20  Brady Eidson  <beidson@apple.com>
825
826         Reviewed by Anders.
827
828         <rdar://problem/5073391> and http://bugs.webkit.org/show_bug.cgi?id=13137
829
830         Crash in IconDatabase when private browsing is enabled.
831
832         The problem was caused by http://trac.webkit.org/projects/webkit/changeset/20182 
833         which changed many uses of char[] and Vector<char> to SharedBuffer.  The patch
834         tended to literally replace a Vector<char> with RefPtr<SharedBuffers> but forgot
835         to enforce the concept that Vector<char>'s always exist, whereas RefPtr<SharedBuffers>
836         can be null.  This led to derefs.
837
838         I took the opportunity to rework the iconDB functions to live in a SharedBuffer 
839         world, as that didn't exist when they were originally written - now they just return
840         SharedBuffers instead of taking a Vector<char>& as a parameter
841
842         * loader/icon/IconDatabase.cpp:
843         (WebCore::IconDatabase::imageDataForIconURL): Return a SharedBuffer
844         (WebCore::IconDatabase::iconForPageURL): Null check the SharedBuffer before asking
845           it if it's empty
846         (WebCore::IconDatabase::imageDataForIconURLQuery): Return a new SharedBuffer
847
848         * loader/icon/IconDatabase.h: Return SharedBuffer's instead of taking Vector<char>&'s
849
850 2007-03-20  Adam Roben  <aroben@apple.com>
851
852         Rubberstamped by Adele.
853
854         Roll out r20348 because it was causing crashes.
855
856         * page/FrameView.cpp:
857         (WebCore::FrameViewPrivate::FrameViewPrivate):
858         (WebCore::FrameView::layout):
859         (WebCore::FrameView::scheduleEvent):
860
861 2007-03-20  Timothy Hatcher  <timothy@apple.com>
862
863         Reviewed by Kevin Decker.
864
865         Rolling out part of r19828 that caused a scrolling regression in Mail.
866
867         <rdar://problem/4820817> Message jumps around when trying to select text
868
869         * platform/mac/ScrollViewMac.mm:
870         (WebCore::ScrollView::visibleContentRect):
871         (WebCore::ScrollView::updateContents):
872
873 2007-03-20  Brady Eidson  <beidson@apple.com>
874
875         Reviewed by John
876
877         <rdar://5071341> - Crash in IconLoader::finishLoading()
878         
879         Though the reproducibility of the crash is still elusive, there's been a crasher likely uncovered 
880         Hyatt's recent caching changings to the IconLoader.  This crash tends to hit on sites without favicons,
881         that serve up complex 404 pages, often when the load is cancelled or redirected.  Occasionally, it *seems*
882         the IconLoader is getting failed/cancelled twice.
883         
884         This patch adds some assertions and a "fail gracefully in a release build" check that will have to
885         serve us until we know more about the cause.
886
887         * loader/icon/IconLoader.cpp:
888         (WebCore::IconLoader::didFail): Add an assertion to catch this case
889         (WebCore::IconLoader::finishLoading): Add an assertion to catch the case, and fail
890           gracefully in debug builds.  Also add an efficiency check to not commit to the DB if there is no
891           IconURL
892
893 2007-03-20  Antti Koivisto  <antti@apple.com>
894
895         Reviewed by Darin.
896
897         - fix http://bugs.webkit.org/show_bug.cgi?id=10747
898         REGRESSION: Using two fingers on a trackpad to scroll inside a text area makes the whole page move
899         <rdar://problem/5045710>
900         
901         Eat smooth scroll events in WebCore if pointer is over scrollable area. Not
902         really a good fix, smooth scrolling should be supported properly. It should do for now.
903
904         * page/EventHandler.cpp:
905         (WebCore::EventHandler::handleWheelEvent):
906         * rendering/RenderListBox.cpp:
907         (WebCore::RenderListBox::isScrollable):
908         * rendering/RenderListBox.h:
909         * rendering/RenderObject.cpp:
910         (WebCore::RenderObject::isScrollable):
911         * rendering/RenderObject.h:
912         * rendering/RenderTextControl.cpp:
913         (WebCore::RenderTextControl::isScrollable):
914         * rendering/RenderTextControl.h:
915
916 2007-03-20  Beth Dakin  <bdakin@apple.com>
917
918         Reviewed by Geoff.
919
920         Covered by existing test case.
921
922         Fix for <rdar://problem/5072678> Crash in 
923         RenderLayer::scrollRectToVisible with MallocScribble enabled
924
925         This removes some code that was added with http://bugs.webkit.org/
926         show_bug.cgi?id=8360. This code was not needed to fix that bug, but 
927         the idea behind it was that there are times when it is safe for 
928         scheduleEvent() to propagate the event immediately. The 
929         MallocScribble crash revealed that this assumption was a bit too 
930         broad; the cause of the crash was that we were propagating events 
931         immediately when it was not safe. Mitz and I discussed this online 
932         and we agree that the safest solution is to revert to the old 
933         behavior here, and always delay the propagation of the event. 
934
935         * page/FrameView.cpp:
936         (WebCore::FrameViewPrivate::FrameViewPrivate):
937         (WebCore::FrameView::layout):
938         (WebCore::FrameView::scheduleEvent):
939
940 2007-03-20  Brady Eidson  <beidson@apple.com>
941
942         Reviewed by John Sullivan
943
944         Add some very helpful logging to the IconLoader's SubresourceLoaderClient impl.
945
946         * loader/icon/IconLoader.cpp:
947         (WebCore::IconLoader::didReceiveResponse):
948         (WebCore::IconLoader::didReceiveData):
949         (WebCore::IconLoader::didFail):
950         (WebCore::IconLoader::didFinishLoading):
951
952 2007-03-20  Justin Garcia  <justin.garcia@apple.com>
953
954         Reviewed by darin
955
956         <rdar://problem/5071074> 
957         REGRESSION: Links are pasted as plain text at certain positions
958         
959         moveParagraphs calls createMarkup without annotation, which leaves
960         out anchor elements that aren't fully selected.
961
962         * editing/CompositeEditCommand.cpp:
963         (WebCore::CompositeEditCommand::moveParagraphs): We don't want 
964         createMarkup to do full annotation here.  Doing so could include 
965         special ancestor blocks, which would prevent the copied content 
966         from appearing in the destination paragraph when it's re-inserted.  
967         Annotation would also inline styles from style sheets,  which is 
968         unnecessary because the content is being moved to the same 
969         document it's being moved from.
970         Added a new bool to createMarkup that when true allows markup for 
971         special ancestors as long as they are inline when annotation is off.
972         * editing/markup.cpp:
973         (WebCore::createMarkup): Don't set specialCommonAncestor if annotation
974         is off, unless it's inline and we've been told it's ok to include such
975         elements.
976         * editing/markup.h:
977
978 2007-03-20  Alexey Proskuryakov  <ap@webkit.org>
979
980         Reviewed by Darin.
981
982         http://bugs.webkit.org/show_bug.cgi?id=12497
983         Implement XPath result ordering.
984
985         XPath::NodeVector typedef is replaced with a real XPath::NodeSet class that knows how 
986         to sort itself, and can remember whether it has been already sorted.
987
988         * CMakeLists.txt:
989         * WebCore.pro:
990         * WebCore.xcodeproj/project.pbxproj:
991         * WebCoreSources.bkl:
992         Added XPathNodeSet files.
993
994         * xml/XPathExpression.cpp: Fixed includes.
995
996         * xml/XPathFunctions.cpp:
997         (WebCore::XPath::FunId::evaluate): Mark the resulting node-set as unsorted.
998         (WebCore::XPath::FunLocalName::evaluate): Replacing NodeVector with NodeSet.
999         (WebCore::XPath::FunNamespaceURI::evaluate): Ditto.
1000         (WebCore::XPath::FunName::evaluate): Ditto.
1001         (WebCore::XPath::FunCount::evaluate): Ditto.
1002         (WebCore::XPath::FunSum::evaluate): Ditto.
1003
1004         * xml/XPathNodeSet.cpp: Added.
1005         (WebCore::XPath::parentWithDepth):
1006         (WebCore::XPath::sortBlock):
1007         (WebCore::XPath::NodeSet::sort): Sort the node-set in document order.
1008         (WebCore::XPath::NodeSet::reverse): Reverse the order (useful for making axes such as 
1009         parent or ancestor sorted).
1010         (WebCore::XPath::NodeSet::firstNode): Returns the first node in document order; currently
1011         implemented via fully sorting the node-set, but this can obviously be optimized.
1012         (WebCore::XPath::NodeSet::anyNode): Added for symmetry with firstNode().
1013         
1014         * xml/XPathNodeSet.h: Added.
1015         (WebCore::XPath::NodeSet::NodeSet):
1016         (WebCore::XPath::NodeSet::operator=):
1017         (WebCore::XPath::NodeSet::size):
1018         (WebCore::XPath::NodeSet::isEmpty):
1019         (WebCore::XPath::NodeSet::operator[]):
1020         (WebCore::XPath::NodeSet::reserveCapacity):
1021         (WebCore::XPath::NodeSet::clear):
1022         (WebCore::XPath::NodeSet::swap):
1023         (WebCore::XPath::NodeSet::append):
1024         (WebCore::XPath::NodeSet::markSorted):
1025         (WebCore::XPath::NodeSet::isSorted):
1026         Most of these methods just call Vector counterparts. 
1027
1028         * xml/XPathParser.cpp: Updated the copyright notice.
1029
1030         * xml/XPathPath.cpp:
1031         (WebCore::XPath::Filter::evaluate): Replacing NodeVector with NodeSet.
1032         (WebCore::XPath::Path::evaluate): Ditto.
1033         (WebCore::XPath::LocationPath::evaluate): Replacing NodeVector with NodeSet. This function
1034         always marks the result as unsorted, because it is hard to tell whether a step breaks node order.
1035         Identifying and implementing special cases when it is not necessary to do so is an important
1036         future optimization.
1037
1038         * xml/XPathPath.h: Replacing NodeVector with NodeSet.
1039         * xml/XPathPredicate.cpp:
1040         (WebCore::XPath::EqTestOp::compare): Replacing NodeVector with NodeSet.
1041         (WebCore::XPath::Union::evaluate): Replacing NodeVector with NodeSet. Currently, Union just
1042         marks the result as unordered; we can consider using merge sort to avoid this.
1043
1044         * xml/XPathResult.cpp:
1045         (WebCore::XPathResult::XPathResult): Replacing NodeVector with NodeSet.
1046         (WebCore::XPathResult::singleNodeValue): Ditto.
1047         (WebCore::XPathResult::snapshotLength): Ditto.
1048         (WebCore::XPathResult::iterateNext): Ditto.
1049         (WebCore::XPathResult::snapshotItem): Ditto.
1050         (WebCore::XPathResult::convertTo): Ditto. Sort the result when requested to.
1051
1052         * xml/XPathResult.h: Replacing NodeVector with NodeSet.
1053
1054         * xml/XPathStep.cpp:
1055         (WebCore::XPath::Step::evaluate): If the input is not sorted, mark the output as such, too.
1056         (WebCore::XPath::Step::nodesInAxis): Fixed a number of bugs when enumerating with an
1057         attribute context node.
1058         (WebCore::XPath::Step::nodeTestMatches): Replacing NodeVector with NodeSet.
1059         * xml/XPathStep.h: Ditto.
1060
1061         * xml/XPathUtil.cpp:
1062         (WebCore::XPath::isValidContextNode): XPath data model doesn't put attribute data into child
1063         nodes, so passing such node as a context could cause problems.
1064
1065         * xml/XPathUtil.h: Removed NodeVector typedef.
1066
1067         * xml/XPathValue.cpp:
1068         (WebCore::XPath::Value::Value):
1069         (WebCore::XPath::Value::toNodeSet):
1070         (WebCore::XPath::Value::toBoolean):
1071         (WebCore::XPath::Value::toNumber):
1072         (WebCore::XPath::Value::toString):
1073         * xml/XPathValue.h:
1074         (WebCore::XPath::Value::):
1075         (WebCore::XPath::Value::isNodeSet):
1076         Replacing NodeVector with NodeSet.
1077
1078 2007-03-21  Mark Rowe  <mrowe@apple.com>
1079
1080         Build fix.
1081
1082         * bindings/objc/WebScriptObject.mm:
1083         (-[WebScriptObject methodForSelector:]):
1084         (-[WebScriptObject respondsToSelector:]):
1085
1086 2007-03-21  Mark Rowe  <mrowe@apple.com>
1087
1088         Reviewed by Tim Hatcher.
1089
1090         Fix for http://bugs.webkit.org/show_bug.cgi?id=13129.
1091         Bug 13129: Democracy Player dies in NSException from WebScriptObject on startup.
1092
1093         Some cross-language scripting bridges use the presence of -(int)count to determine
1094         whether to treat objects as sequence-like.  All WebScriptObject's exposed this method
1095         which lead to non-collection WebScriptObject's being mishandled by PyObjC.  We now
1096         expose -count only when the object we wrap looks like a collection from a JavaScript
1097         point of view (eg, it has a length property).
1098
1099         * bindings/objc/WebScriptObject.mm:
1100         (-[WebScriptObject _shouldRespondToCount]):
1101         (-[WebScriptObject methodForSelector:]):
1102         (-[WebScriptObject respondsToSelector:]):
1103         (-[WebScriptObject _count]):
1104         * bindings/objc/WebScriptObjectPrivate.h:
1105
1106 2007-03-20  Darin Adler  <darin@apple.com>
1107
1108         * page/EventHandler.cpp: (WebCore::EventHandler::handleMouseMoveEvent):
1109         Fix obvious typo in the change from last night -- forgot to assign to the variable.
1110
1111 2007-03-20  Dave Hyatt  <hyatt@apple.com>
1112
1113         Refactor fonts a bit for portability.
1114        
1115         Reviewed by aroben
1116
1117         * platform/Font.cpp:
1118         (WebCore::Font::drawSimpleText):
1119         (WebCore::Font::drawGlyphBuffer):
1120         (WebCore::Font::floatWidthForSimpleText):
1121         * platform/Font.h:
1122         * platform/FontData.h:
1123         (WebCore::FontData::isSystemFont):
1124         (WebCore::FontData::scriptCache):
1125         * platform/GlyphBuffer.h:
1126         (WebCore::GlyphBuffer::add):
1127
1128 2007-03-20  Anders Carlsson  <acarlsson@apple.com>
1129
1130         Reviewed by Adam.
1131
1132         Stub out a couple of CFNetwork backend functions.
1133         
1134         * platform/network/ResourceHandle.h:
1135
1136 2007-03-19  Oliver Hunt  <oliver@apple.com>
1137
1138         Reviewed by Ada.
1139
1140         Protect against possibility of JS detaching a frame (and losing its view)
1141         midway through a mouse move.
1142
1143         * page/EventHandler.cpp:
1144         (WebCore::EventHandler::handleMouseMoveEvent):
1145
1146 2007-03-19  Alexey Proskuryakov  <ap@webkit.org>
1147
1148         Reviewed by Darin.
1149
1150         http://bugs.webkit.org/show_bug.cgi?id=13107
1151         XPath should raise an exception when trying to parse an unknown function
1152
1153         Test: fast/xpath/invalid-functions.html
1154
1155         * xml/XPathFunctions.cpp:
1156         (WebCore::XPath::createFunction): Return 0 if the function couldn't be created.
1157         * xml/XPathGrammar.y: Handle nulls returned from createFunction().
1158
1159 2007-03-19  Adele Peterson  <adele@apple.com>
1160
1161         Reviewed by Beth.
1162
1163         Fix for http://bugs.webkit.org/show_bug.cgi?id=13087
1164         <rdar://problem/5064316> REGRESSION: Allow setting the checked attribute in js and in markup for unnamed radio buttons (dominos.com)
1165
1166         Test: fast/forms/radio_checked_name.html
1167
1168         We were matching a WinIE quirk that does not allow a user to check and uncheck an unnamed radio button.  But they still
1169         allow the checked attribute to be set in html, and changed in javascript.  So this change matches that behavior.
1170
1171         * html/HTMLInputElement.cpp:
1172         (WebCore::HTMLInputElement::parseMappedAttribute): We no longer need a special call to setChecked when parsing the name
1173          attribute, since we setChecked will now work with unnamed radio buttons.
1174         (WebCore::HTMLInputElement::preDispatchEventHandler): Added comment.
1175         (WebCore::HTMLInputElement::setChecked): Don't check for the unnamed radio button case here.
1176         (WebCore::HTMLInputElement::postDispatchEventHandler): Don't call setChecked for unnamed radio buttons.
1177         (WebCore::HTMLInputElement::defaultEventHandler): ditto.
1178
1179 2007-03-19  Adam Roben  <aroben@apple.com>
1180
1181         Rubberstamped by Oliver.
1182
1183         * bridge/JavaScriptStatistics.cpp: Added missing header for
1184         correctness.
1185
1186 2007-03-19  Andrew Wellington  <proton@wiretapped.net>
1187
1188         Reviewed by Maciej.
1189
1190         Really set Xcode editor to use 4 space indentation (http://webkit.org/coding/coding-style.html)
1191
1192         * WebCore.xcodeproj/project.pbxproj:
1193
1194 2007-03-19  Justin Garcia  <justin.garcia@apple.com>
1195
1196         Reviewed by darin
1197         
1198         <rdar://problem/5071074> 
1199         REGRESSION: Links that aren't fully selected copy and paste as only text
1200         
1201         We stopped adding markup for all commonAncestorBlocks
1202         and the ancestors of lastClosed up to them because it 
1203         was adding a lot of unnecessary markup.
1204
1205         * editing/markup.cpp:
1206         (WebCore::createMarkup): Also include markup for nodes
1207         up to an enclosing anchor.  Cleaned up the code for
1208         including special common ancestors a bit.
1209
1210 2007-03-19  Nikolas Zimmermann  <zimmermann@kde.org>
1211
1212         Reviewed by Lars Knoll.
1213
1214         Fix crash when opening a SVG document which contains SVG elements, but no <svg> root element.
1215         Moving the mouse was crashing WebKit. Fixes svg/hixie/dynamic/006.xml.
1216
1217         * rendering/RenderObject.cpp:
1218         (WebCore::RenderObject::updateHitTestResult):
1219
1220 2007-03-19  Mitz Pettel  <mitz@webkit.org>
1221
1222         Reviewed by Hyatt.
1223
1224         - fix http://bugs.webkit.org/show_bug.cgi?id=13117
1225         REGRESSION (r14658): Flickering text fields when updating via javascript
1226
1227         * page/Frame.cpp:
1228         (WebCore::Frame::forceLayout): Added a flag to allow partial relayout.
1229         * page/Frame.h:
1230         * page/mac/WebCoreFrameBridge.mm:
1231         (-[WebCoreFrameBridge forceLayoutAdjustingViewSize:]): Allow partial relayout
1232         if not adjusting view size.
1233         (-[WebCoreFrameBridge needsLayout]): Changed to check for pending subtree
1234         layout instead of just whether the root needs layout.
1235
1236 2007-03-18  Nikolas Zimmermann  <zimmermann@kde.org>
1237
1238         Reviewed by Maciej.
1239
1240         Make JS function calls on POD-types (ie. SVGLength) take effect.
1241         Calling ie. newValueInSpecifiedUnits on SVGLength works as expected.
1242
1243         This worked fine before we switched to SVGLength POD type, so this
1244         can be considered as P1 regression fix.
1245
1246         Partly fix svg/hixie/dynamic/005-broken.svg. We match Opera now though
1247         it's not yet completly fixed. Setting baseVal attribute on SVGAnimatedString
1248         doesn't work as expected - needs a seperated fix.
1249
1250         * bindings/scripts/CodeGeneratorJS.pm:
1251
1252 2007-03-19  Adele Peterson  <adele@apple.com>
1253
1254         Reviewed by Adam.
1255
1256         Adding comments and a little cleanup from my last checkin.
1257
1258         * html/HTMLSelectElement.cpp:
1259         (WebCore::HTMLSelectElement::setSelectedIndex): Removed commented out assert.  Added comment about how we use onChange.
1260         (WebCore::HTMLSelectElement::selectAll): Added comment about how we use saveLastSelection and onChange.
1261         (WebCore::HTMLSelectElement::dispatchFocusEvent): ditto.
1262         (WebCore::HTMLSelectElement::dispatchBlurEvent): ditto.
1263         (WebCore::HTMLSelectElement::menuListDefaultEventHandler): ditto.
1264         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler): ditto.
1265         (WebCore::HTMLSelectElement::menuListOnChange): Added assert that usesMenuList() is true.
1266         (WebCore::HTMLSelectElement::listBoxOnChange): Added assert that usesMenuList() is false.
1267         (WebCore::HTMLSelectElement::saveLastSelection): Added early return for menu lists.
1268
1269 2007-03-19  Mitz Pettel  <mitz@webkit.org>
1270
1271         Reviewed by Tim Hatcher.
1272
1273         - fix http://bugs.webkit.org/show_bug.cgi?id=13091
1274           REGRESSION (r20075): Wrong text style and pixel break in Apple Store Locator HUD
1275
1276         Test: fast/innerHTML/additional-inline-style.html
1277
1278         * editing/markup.cpp:
1279         (WebCore::startMarkup): Changed to add inline style based on CSS rules only
1280         in AnnotateForInterchange mode.
1281
1282 2007-03-19  Zack Rusin  <zrusin@trolltech.com>
1283
1284         Compile fix.
1285
1286         * platform/qt/ScrollViewQt.cpp:
1287         (WebCore::ScrollView::update):
1288
1289 2007-03-19  Adam Roben  <aroben@apple.com>
1290
1291         Reviewed by Hyatt and Maciej.
1292
1293         Renamed WebCoreJavaScript to JavaScriptStatistics and made it C++ as
1294         part of <rdar://problem/5071653>.
1295
1296         All layout tests pass.
1297
1298         * WebCore.exp: Updated.
1299         * WebCore.xcodeproj/project.pbxproj: Updated.
1300         * bridge/JavaScriptStatistics.cpp: Moved from
1301         bridge/mac/WebCoreJavaScript.mm, and converted to C++.
1302         (WebCore::collect):
1303         (WebCore::JavaScriptStatistics::objectCount):
1304         (WebCore::JavaScriptStatistics::interpreterCount):
1305         (WebCore::JavaScriptStatistics::protectedObjectCount):
1306         (WebCore::JavaScriptStatistics::rootObjectTypeCounts):
1307         (WebCore::JavaScriptStatistics::garbageCollect):
1308         (WebCore::JavaScriptStatistics::garbageCollectOnAlternateThread):
1309         (WebCore::JavaScriptStatistics::shouldPrintExceptions):
1310         (WebCore::JavaScriptStatistics::setShouldPrintExceptions):
1311         * bridge/JavaScriptStatistics.h: Added.
1312         * bridge/mac/WebCoreJavaScript.h: Removed.
1313         * bridge/mac/WebCoreJavaScript.mm: Removed.
1314
1315 2007-03-18  Maciej Stachowiak  <mjs@apple.com>
1316
1317         Reviewed by Mark.
1318
1319         - avoid static construction (and global variable access) in a smarter, more portable way,
1320         to later enable MUTLI_THREAD mode to work on other platforms and compilers.
1321         
1322         * bindings/js/JSCustomXPathNSResolver.cpp:
1323         (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
1324         * bindings/js/JSHTMLInputElementBase.cpp:
1325         (WebCore::JSHTMLInputElementBaseFunction::JSHTMLInputElementBaseFunction):
1326         * bindings/js/JSHTMLOptionElementConstructor.cpp:
1327         (WebCore::JSHTMLOptionElementConstructor::JSHTMLOptionElementConstructor):
1328         * bindings/js/JSXMLHttpRequest.cpp:
1329         (KJS::JSXMLHttpRequestConstructorImp::JSXMLHttpRequestConstructorImp):
1330         * bindings/js/JSXSLTProcessor.cpp:
1331         (KJS::XSLTProcessorConstructorImp::XSLTProcessorConstructorImp):
1332         * bindings/js/kjs_dom.cpp:
1333         (KJS::DOMNamedNodeMap::getOwnPropertySlot):
1334         (KJS::DOMNamedNodesCollection::getOwnPropertySlot):
1335         * bindings/js/kjs_events.cpp:
1336         (KJS::JSAbstractEventListener::handleEvent):
1337         * bindings/js/kjs_html.cpp:
1338         (KJS::HTMLElementFunction::HTMLElementFunction):
1339         (KJS::JSHTMLCollection::getOwnPropertySlot):
1340         * bindings/js/kjs_window.cpp:
1341         (KJS::ScheduledAction::execute):
1342         * bindings/objc/WebScriptObject.mm:
1343         * bindings/scripts/CodeGeneratorJS.pm:
1344
1345 2007-03-18  Andrew Wellington  <proton@wiretapped.net>
1346
1347         Reviewed by Mark Rowe
1348
1349         Set Xcode editor to use 4 space indentation (http://webkit.org/coding/coding-style.html)
1350
1351         * WebCore.xcodeproj/project.pbxproj:
1352
1353 2007-03-18  David Hyatt  <hyatt@apple.com>
1354
1355         Fix for REGRESSION bug 13108, frame borders being painted when they shouldn't be.  Rework both frame borders
1356         and resizing to be more like other browsers.
1357
1358         Reviewed by ggaren
1359
1360         fast/frames/no-frame-borders.html
1361
1362         * html/HTMLFrameElement.cpp:
1363         (WebCore::HTMLFrameElement::HTMLFrameElement):
1364         (WebCore::HTMLFrameElement::attach):
1365         (WebCore::HTMLFrameElement::parseMappedAttribute):
1366         * html/HTMLFrameElement.h:
1367         (WebCore::HTMLFrameElement::hasFrameBorder):
1368         * html/HTMLFrameElementBase.cpp:
1369         (WebCore::HTMLFrameElementBase::HTMLFrameElementBase):
1370         (WebCore::HTMLFrameElementBase::parseMappedAttribute):
1371         * html/HTMLFrameElementBase.h:
1372         * html/HTMLFrameSetElement.cpp:
1373         (WebCore::HTMLFrameSetElement::attach):
1374         * html/HTMLFrameSetElement.h:
1375         (WebCore::HTMLFrameSetElement::hasFrameBorder):
1376         * html/HTMLIFrameElement.cpp:
1377         (WebCore::HTMLIFrameElement::HTMLIFrameElement):
1378         * rendering/RenderFrame.cpp:
1379         (WebCore::RenderFrame::edgeInfo):
1380         * rendering/RenderFrame.h:
1381         * rendering/RenderFrameSet.cpp:
1382         (WebCore::RenderFrameSet::paint):
1383         (WebCore::RenderFrameSet::GridAxis::resize):
1384         (WebCore::RenderFrameSet::fillFromEdgeInfo):
1385         (WebCore::RenderFrameSet::computeEdgeInfo):
1386         (WebCore::RenderFrameSet::edgeInfo):
1387         (WebCore::RenderFrameSet::layout):
1388         (WebCore::RenderFrameSet::startResizing):
1389         (WebCore::RenderFrameSet::continueResizing):
1390         (WebCore::RenderFrameSet::canResizeRow):
1391         (WebCore::RenderFrameSet::canResizeColumn):
1392         (WebCore::RenderFrameSet::splitPosition):
1393         (WebCore::RenderFrameSet::hitTestSplit):
1394         (WebCore::RenderFrameSet::dump):
1395         * rendering/RenderFrameSet.h:
1396         (WebCore::):
1397         (WebCore::FrameEdgeInfo::FrameEdgeInfo):
1398         (WebCore::FrameEdgeInfo::preventResize):
1399         (WebCore::FrameEdgeInfo::allowBorder):
1400         (WebCore::FrameEdgeInfo::setPreventResize):
1401         (WebCore::FrameEdgeInfo::setAllowBorder):
1402
1403 2007-03-19  Mark Rowe  <mrowe@apple.com>
1404
1405         Rubber-stamped by Brady.
1406
1407         Update references to bugzilla.opendarwin.org with bugs.webkit.org.
1408
1409         * ChangeLog:
1410         * WebCore.vcproj/WebCore/build-generated-files.sh:
1411         * manual-tests/ATSU-bad-layout.html:
1412         * manual-tests/accidental-strict-mode.html:
1413         * manual-tests/applet-param-no-name.html:
1414         * manual-tests/bidi-parens.html:
1415         * manual-tests/bugzilla-3855.html:
1416         * manual-tests/bugzilla-4840.html:
1417         * manual-tests/bugzilla-6821.html:
1418         * manual-tests/containing-block-position-chage.html:
1419         * manual-tests/contenteditable-link.html:
1420         * manual-tests/css3-cursor-fallback-quirks.html:
1421         * manual-tests/css3-cursor-fallback-strict.html:
1422         * manual-tests/custom-cursors.html:
1423         * manual-tests/dictionary-scrolled-iframe.html:
1424         * manual-tests/dom-manipulation-on-resize.html:
1425         * manual-tests/drag-image-to-address-bar.html:
1426         * manual-tests/empty-link-target.html:
1427         * manual-tests/empty-title-popup.html:
1428         * manual-tests/first-line-style-crash.html:
1429         * manual-tests/invalid-mouse-event.html:
1430         * manual-tests/left-overflow-repaint.html:
1431         * manual-tests/linkjump-3.html:
1432         * manual-tests/log-keypress-events.html:
1433         * manual-tests/named-window-blank-target.html:
1434         * manual-tests/plain-text-paste.html:
1435         * manual-tests/plugin-controller-datasource.html:
1436         * manual-tests/pre-tab-selection-rect.html:
1437         * manual-tests/redirection-target.html:
1438         * manual-tests/redraw-page-cache-visited-links.html:
1439         * manual-tests/reset-initiatedDrag.html:
1440         * manual-tests/resources/named-window-blank-target-step2.html:
1441         * manual-tests/resources/named-window-blank-target-step3.html:
1442         * manual-tests/resources/named-window-blank-target-step4.html:
1443         * manual-tests/resources/redraw-page-cache-visited-links-2.html:
1444         * manual-tests/scrollbar-hittest.html:
1445         * manual-tests/scrollbar-hittest2.html:
1446         * manual-tests/subview-click-assertion.html:
1447         * manual-tests/tabbing-input-google.html:
1448         * manual-tests/text-field-autoscroll.html:
1449         * manual-tests/textarea-after-stylesheet-link.html:
1450         * manual-tests/textarea-focus.html:
1451         * manual-tests/whitespace-pre-affinity.html:
1452
1453 2007-03-18  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
1454
1455         Not reviewed - gdk build fix.
1456
1457         * platform/gdk/ScrollViewGdk.cpp:
1458         (WebCore::ScrollView::update): add a stub
1459
1460 2007-03-18  Brady Eidson  <beidson@apple.com>
1461
1462         Reviewed by Hyatt
1463
1464         http://bugs.webkit.org/show_bug.cgi?id=13111
1465         When stopped a load before it completes, partial images become the 
1466         broken image icon
1467
1468         * loader/loader.cpp:
1469         (WebCore::Loader::didFail): Split off into a method that knows the 
1470           difference between failed and cancelled.  If a load is cancelled,
1471           don't call error() on the object - only remove it from the cache
1472         (WebCore::Loader::cancelRequests): Call didFail(loader, true)
1473         * loader/loader.h: Added didFail(SubresourceLoader*, bool cancelled)
1474
1475 2007-03-18  Mitz Pettel  <mitz@webkit.org>
1476
1477         Reviewed by Adele.
1478
1479         - fix http://bugs.webkit.org/show_bug.cgi?id=13101
1480           REGRESSION (NativeTextField): Specifying word-wrap:break-word makes text field wrap
1481
1482         Test: fast/forms/input-text-word-wrap.html
1483
1484         * rendering/RenderTextControl.cpp:
1485         (WebCore::RenderTextControl::createInnerTextStyle): Force the inner block to
1486         'word-wrap:normal'.
1487
1488 2007-03-18  Dan Waylonis  <waylonis@mac.com>
1489
1490         Reviewed by Tim Hatcher.
1491
1492         Fix http://bugs.webkit.org/show_bug.cgi?id=13005
1493         Bug 13005: WebScriptObject +throwException needs NULL check.
1494
1495         Add checking for NULL interpreter before throwing exception.
1496
1497         * bindings/objc/WebScriptObject.mm:
1498         (+[WebScriptObject throwException:]):
1499
1500 2007-03-18  Geoffrey Garen  <ggaren@apple.com>
1501
1502         Reviewed by Oliver Hunt.
1503         
1504         Fixed http://bugs.webkit.org/show_bug.cgi?id=13106
1505         REGRESSION: Incomplete document.all implementation breaks abtelectronics.com 
1506         (Style Change Through JavaScript Blanks Content)
1507         
1508         When indexing into collections, treat the empty string as an invalid argument,
1509         instead of the number 0.
1510
1511         * bindings/js/kjs_html.cpp:
1512         (KJS::JSHTMLCollection::getOwnPropertySlot):
1513         (KJS::JSHTMLCollection::callAsFunction):
1514         (KJS::JSHTMLCollectionPrototypeFunction::callAsFunction):
1515
1516 2007-03-18  David Hyatt  <hyatt@apple.com>
1517
1518         Use fillRect instead of drawLine, since drawLine has some odd behavior (it's only used for borders).
1519
1520         Reviewed by aroben
1521
1522         * platform/graphics/IntRect.h:
1523         * rendering/RenderFrameSet.cpp:
1524         (WebCore::RenderFrameSet::paintColumnBorder):
1525         (WebCore::RenderFrameSet::paintRowBorder):
1526
1527 2007-03-18  David Hyatt  <hyatt@apple.com>
1528
1529         Change the frameborder color to be light gray for framesets.
1530
1531         Reviewed by aroben
1532
1533         * rendering/RenderFrameSet.cpp:
1534         (WebCore::borderFillColor):
1535         (WebCore::RenderFrameSet::paintColumnBorder):
1536         (WebCore::RenderFrameSet::paintRowBorder):
1537
1538 2007-03-18  David Hyatt  <hyatt@apple.com>
1539
1540         Make iframes work properly with frameborder="0".
1541
1542         Reviewed by aroben
1543
1544         * html/HTMLIFrameElement.cpp:
1545         (WebCore::HTMLIFrameElement::mapToEntry):
1546         (WebCore::HTMLIFrameElement::parseMappedAttribute):
1547
1548 2007-03-18  David Hyatt  <hyatt@apple.com>
1549
1550         Add a 2px border by default to <iframe>s for compatibility with other browsers.
1551
1552         Reviewed by aroben
1553
1554         * css/html4.css:
1555
1556 2007-03-18  David Hyatt  <hyatt@apple.com>
1557
1558         Move frame borders out of WebKit and into WebCore.
1559
1560         Reviewed by aroben, olliej
1561
1562         * bridge/mac/FrameViewMac.mm:
1563         * css/html4.css:
1564         * html/HTMLFrameSetElement.cpp:
1565         (WebCore::HTMLFrameSetElement::HTMLFrameSetElement):
1566         (WebCore::HTMLFrameSetElement::mapToEntry):
1567         (WebCore::HTMLFrameSetElement::parseMappedAttribute):
1568         (WebCore::HTMLFrameSetElement::attach):
1569         * html/HTMLFrameSetElement.h:
1570         (WebCore::HTMLFrameSetElement::hasBorderColor):
1571         * page/FrameView.cpp:
1572         (WebCore::FrameViewPrivate::FrameViewPrivate):
1573         * page/FrameView.h:
1574         * page/mac/WebCoreFrameBridge.h:
1575         * platform/graphics/IntRect.h:
1576         (WebCore::IntRect::topLeft):
1577         (WebCore::IntRect::topRight):
1578         (WebCore::IntRect::bottomLeft):
1579         (WebCore::IntRect::bottomRight):
1580         * rendering/RenderFrame.cpp:
1581         (WebCore::RenderFrame::viewCleared):
1582         * rendering/RenderFrameSet.cpp:
1583         (WebCore::borderStartEdgeColor):
1584         (WebCore::borderEndEdgeColor):
1585         (WebCore::RenderFrameSet::paintColumnBorder):
1586         (WebCore::RenderFrameSet::paintRowBorder):
1587         (WebCore::RenderFrameSet::paint):
1588         * rendering/RenderFrameSet.h:
1589         * rendering/RenderPartObject.cpp:
1590         (WebCore::RenderPartObject::viewCleared):
1591         * rendering/RenderView.cpp:
1592         (WebCore::RenderView::repaintViewRectangle):
1593
1594 2007-03-17  David Hyatt  <hyatt@apple.com>
1595
1596         Make onload do an explicit paint when a top-level document is ready (to ensure that a first paint always
1597         happens before any timers set by the onload can fire).
1598
1599         Reviewed by aroben
1600
1601         * dom/Document.cpp:
1602         (WebCore::Document::implicitClose):
1603         * platform/ScrollView.h:
1604         * platform/mac/ScrollViewMac.mm:
1605         (WebCore::ScrollView::update):
1606
1607 2007-03-17  Dave Hyatt  <hyatt@apple.com>
1608
1609         Prevent starvation of user input and painting when processing timers.
1610         If we are already in the processing of a custom timer message, don't allow that
1611         processing to do another PostMessage.  Force SetTimer to be used instead.
1612       
1613         Reviewed by ggaren
1614
1615        * platform/win/SharedTimerWin.cpp:
1616         (WebCore::TimerWindowWndProc):
1617         (WebCore::setSharedTimerFireTime):
1618
1619 2007-03-17  Geoffrey Garen  <ggaren@apple.com>
1620
1621         Reviewed by Beth Dakin.
1622
1623         Fixed <rdar://problem/5070967> REGRESSION (r20211): Repro crash when 
1624         closing View Source window
1625         
1626         I award myself 0 points, and may God have mercy on my soul.
1627
1628         * bindings/js/kjs_proxy.cpp:
1629         (WebCore::KJSProxy::~KJSProxy):
1630
1631 2007-03-17  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
1632
1633         Not reviewed - gdk build fix.
1634
1635         * platform/gdk/TemporaryLinkStubs.cpp:
1636         (Pasteboard::writeURL):
1637
1638 2007-03-17  David Hyatt  <hyatt@apple.com>
1639
1640         Fix tiny PLT regression.  Don't examine the border/background data for RenderImage when images change
1641         unless we actually have a border/background.
1642
1643         Reviewed by Brady
1644
1645         * rendering/RenderImage.cpp:
1646         (WebCore::RenderImage::imageChanged):
1647
1648 2007-03-17  Nikolas Zimmermann  <zimmermann@kde.org>
1649
1650         Reviewed by Sam Weinig.
1651
1652         Fixes: http://bugs.webkit.org/show_bug.cgi?id=13046 (CSS styles on hover and focus are broken for <use>)
1653         Fixes: http://bugs.webkit.org/show_bug.cgi?id=12838 (SVG <use> CSS styles broken)
1654         Added test: svg/custom/use-css-events.svg
1655
1656         In general this fixes the peepo.co.uk website.
1657
1658         Forgot to pass the actual StyleChange to the recalcStyle() function,
1659         when calling it on the shadow tree root element.
1660
1661         * ksvg2/svg/SVGUseElement.cpp:
1662         (WebCore::SVGUseElement::recalcStyle):
1663
1664 2007-03-17  Timothy Hatcher  <timothy@apple.com>
1665
1666         Reviewed by Mark Rowe.
1667
1668         Made Version.xcconfig smarter when building for different configurations.
1669         Now uses the 522+ OpenSource version for Debug and Release, while using the
1670         full 522.4 version for Production builds. The system prefix is also computed
1671         based on the current system, so 4522.4 on Tiger and 5522.4 on Leopard.
1672
1673         * Configurations/Version.xcconfig:
1674         * Configurations/WebCore.xcconfig:
1675
1676 2007-03-17  Antti Koivisto  <antti@apple.com>
1677
1678         Reviewed by Adele.
1679
1680         Fix http://bugs.webkit.org/show_bug.cgi?id=12595
1681         REGRESSION: Can't add item to cart at lnt.com (JS type error)
1682         <rdar://problem/4722863>
1683         
1684         Emulate Firefox behavior where form elements accessed by a name
1685         can be accessed with that name later even if the name changes or
1686         even if element is removed from the document.
1687         
1688         This is loosely based on Darin's earlier patch for the same problem but
1689         is much less expansive. It takes somewhat different approach to more closely
1690         mimic Firefox behavior. Includes expanded test case.
1691
1692         * bindings/js/JSHTMLFormElementCustom.cpp:
1693         (WebCore::JSHTMLFormElement::canGetItemsForName):
1694             Use new the HTMLFormElement::getNamedElements() method
1695         (WebCore::JSHTMLFormElement::nameGetter):
1696             Use new the HTMLFormElement::getNamedElements() method
1697         * html/HTMLFormElement.cpp:
1698         (WebCore::HTMLFormElement::HTMLFormElement):
1699         (WebCore::HTMLFormElement::~HTMLFormElement):
1700         (WebCore::HTMLFormElement::elementForAlias):
1701         (WebCore::HTMLFormElement::addElementAlias):
1702             Maintain a map of known element aliases
1703         (WebCore::HTMLFormElement::getNamedElements):
1704             Get a list of elements matching the name, based both their
1705             current names and known aliases (earlier names).
1706             Keep the alias list in sync.
1707         * html/HTMLFormElement.h:
1708
1709 2007-03-17  Adele Peterson  <adele@apple.com>
1710
1711         Reviewed by Hyatt.
1712
1713         Fix for <rdar://problem/4990050> REGRESSION: onchange gets fired when clicking on a programmatically selected element in a listbox
1714         http://bugs.webkit.org/show_bug.cgi?id=12725
1715
1716         Test: updated fast/forms/listbox-onchange.html
1717
1718         Added HTMLSelectElement::saveLastSelection that is called before changing a selection that could result
1719         in onChange being called.  m_lastOnChangeIndex and m_lastOnChangeSelection no longer have to be up-to date all the time, 
1720         they just have to be up-to-date before we execute an action that may trigger onChange.
1721
1722         * html/HTMLOptionElement.cpp: (WebCore::HTMLOptionElement::setSelectedState): Added.
1723           The HTMLSelectElement will only set an option's selected state with this method.  This ensures
1724           that notifyOptionSelected won't get called when the call originates from the select element.
1725         * html/HTMLOptionElement.h:
1726
1727         * html/HTMLSelectElement.cpp:
1728         (WebCore::HTMLSelectElement::deselectItems): Calls setSelectedState.
1729         (WebCore::HTMLSelectElement::setSelectedIndex): ditto. Don't update the last selection variables here.  Scroll to the new selection.
1730          The scrolling call used to only be in notifyOptionSelected.  There's no reason we shouldn't scroll when the selection is set through
1731          the HTMLSelectElement.
1732         (WebCore::HTMLSelectElement::setValue): Call setSelectedIndex to update all options selected state.
1733         (WebCore::HTMLSelectElement::restoreState): Call setSelectedState.
1734         (WebCore::HTMLSelectElement::selectAll): Call saveLastSelection before making the selection, and calling onChange.
1735         (WebCore::HTMLSelectElement::recalcListItems): Call setSelectedState.  Don't need to save selection here anymore, 
1736          since it will get saved before we call onChange.
1737         (WebCore::HTMLSelectElement::reset): ditto.
1738         (WebCore::HTMLSelectElement::dispatchFocusEvent): Added. Call saveLastSelection for menu lists, since onChange can be fired
1739          on blur.
1740         (WebCore::HTMLSelectElement::dispatchBlurEvent): Call menuListOnChange.
1741         (WebCore::HTMLSelectElement::menuListDefaultEventHandler): Call saveLastSelection before showing the popup window.
1742         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):  Call saveLastSelection during mousedown (to prepare for an 
1743          onchange during mouseup, or after autoscroll).
1744         (WebCore::HTMLSelectElement::updateListBoxSelection): Call setSelectedState.
1745
1746         (WebCore::HTMLSelectElement::menuListOnChange): Added. Compares the m_lastOnChangeIndex to the selectedIndex().
1747         (WebCore::HTMLSelectElement::listBoxOnChange): Move the m_lastOnChangeSelection creation to saveLastSelection.
1748         (WebCore::HTMLSelectElement::saveLastSelection): Added. Sets m_lastOnChangeIndex or m_lastOnChangeSelection.
1749         * html/HTMLSelectElement.h:
1750         * platform/PopupMenu.h:
1751
1752 2007-03-16  Oliver Hunt  <oliver@apple.com>
1753
1754         Reviewed by Hyatt.
1755
1756         The old canSaveAsWebArchive call was necessary as stand alone
1757         images used to be rendered by ImageDocument.
1758
1759         Fixes rdar://problem/5061252
1760
1761         * dom/Clipboard.cpp:
1762         * dom/Clipboard.h:
1763         (WebCore::Clipboard::setDragHasStarted):
1764         * page/DragClient.h:
1765         (WebCore::DragClient::declareAndWriteDragImage):
1766         * platform/mac/ClipboardMac.mm:
1767         (WebCore::ClipboardMac::declareAndWriteDragImage):
1768
1769 2007-03-16  Anders Carlsson  <acarlsson@apple.com>
1770
1771         Reviewed by Maciej.
1772
1773         <rdar://problem/4869095>
1774         default content type changed for XMLHttpRequest POSTs changed (breaks Flickrator 0.1 widget)
1775         
1776         * xml/xmlhttprequest.cpp:
1777         (WebCore::XMLHttpRequest::send):
1778
1779 2007-03-16  Brady Eidson  <beidson@apple.com>
1780
1781         Rubberstamped by Tim Hatcher
1782
1783         Update the hash table header for Window object properties
1784
1785         * bindings/js/kjs_window.cpp:
1786
1787 2007-03-16  Brady Eidson  <beidson@apple.com>
1788
1789         Reviewed by Anders
1790
1791         <rdar://problem/5061826> and
1792         http://bugs.webkit.org/show_bug.cgi?id=12863
1793         Implement window.stop()
1794
1795         * bindings/js/kjs_window.cpp:
1796         (KJS::WindowFunc::callAsFunction): Add case Window::Stop
1797         * bindings/js/kjs_window.h:
1798         (KJS::Window::): Add "Stop"
1799
1800 2007-03-16  Geoffrey Garen  <ggaren@apple.com>
1801
1802         Reviewed by Brady Eidson.
1803
1804         Fixed dir creation to account for already existing dirs and missing leading
1805         dirs in path.
1806         
1807         * loader/icon/IconDatabase.cpp:
1808         (WebCore::makeAllDirectories):
1809
1810 2007-03-16  David Hyatt  <hyatt@apple.com>
1811
1812         Fix for 13084, assertion failure in the Cache.  Convert the client list
1813         to a HashCountedSet so that multiple refs and derefs are allowed.
1814
1815         Fix RenderImage so that if it has the same image used as a background/border
1816         and as the foreground that it will repaint properly (can be tested using
1817         border-image and a foreground image).
1818
1819         Optimize list marker so that it doesn't waste time in the base class method,
1820         since list markers don't support background or border images.
1821
1822         Reviewed by andersca
1823
1824         * ChangeLog:
1825         * loader/CachedResource.cpp:
1826         (WebCore::CachedResource::ref):
1827         * loader/CachedResource.h:
1828         * loader/CachedResourceClientWalker.cpp:
1829         (WebCore::CachedResourceClientWalker::CachedResourceClientWalker):
1830         * loader/CachedResourceClientWalker.h:
1831         * rendering/RenderImage.cpp:
1832         (WebCore::RenderImage::imageChanged):
1833         * rendering/RenderListMarker.cpp:
1834         (WebCore::RenderListMarker::imageChanged):
1835
1836 2007-03-16  Geoffrey Garen  <ggaren@apple.com>
1837
1838         Reviewed by Anders Carlsson.
1839         
1840         Fixed <rdar://problem/5065399> REGRESSION: leaks in Frame::bindingRootObject 
1841         seen on buildbot
1842
1843         The problem was that we were initializing the same WebScriptObject twice.
1844         This caused it to leak its original set of ivars.
1845         
1846         I think some refactoring could prevent this situation from arising in the
1847         first place, but I'm just adding a check at the call site for now, to do 
1848         the simplest thing.
1849
1850         * bindings/objc/WebScriptObject.mm:
1851         (-[WebScriptObject _setImp:originRootObject:rootObject:]): Added ASSERTs
1852         against multiple calls.
1853
1854         * bindings/objc/WebScriptObjectPrivate.h: Renamed _initializeWithObjectImp
1855         to setImp because "init" vs "initialize" was a too subtle indication that
1856         one was a Cocoa initializer and one was not.
1857
1858 2007-03-16  Lars Knoll <lars@trolltech.com>
1859
1860         don't use #import in .cpp files.
1861
1862         * editing/qt/EditorQt.cpp:
1863
1864 2007-03-16  Lars Knoll <lars@trolltech.com>
1865
1866         Fix the Qt build once again.
1867
1868         * platform/qt/PasteboardQt.cpp:
1869         (WebCore::Pasteboard::Pasteboard):
1870         (WebCore::Pasteboard::writeSelection):
1871         (WebCore::Pasteboard::plainText):
1872         (WebCore::Pasteboard::documentFragment):
1873         (WebCore::Pasteboard::writeURL):
1874         (WebCore::Pasteboard::writeImage):
1875         (WebCore::Pasteboard::clear):
1876
1877 2007-03-15  Shrikant Gangoda  <shrikant.gangoda@celunite.com>
1878
1879         Gdk build fix.
1880
1881         * loader/gdk/FrameLoaderClientGdk.cpp:
1882         (WebCore::FrameLoaderClientGdk::blockedError):
1883         * loader/gdk/FrameLoaderClientGdk.h:
1884
1885 2007-03-15  Beth Dakin  <bdakin@apple.com>
1886
1887         Reviewed by Geoff.
1888
1889         Fix for http://bugs.webkit.org/show_bug.cgi?id=13088 REGRESSION
1890         (r19761-19779): Copy image no longer includes image address 
1891         (rdar://5067927)
1892
1893         writeURL() does not need an isImage parameter. Now that it accepts 
1894         the types as a parameter, we can just declare the appropriate image 
1895         types within writeImage and send them to writeURL(). Also, 
1896         declaring the types twice is what broke this.
1897
1898         * platform/Pasteboard.h:
1899         * platform/mac/PasteboardMac.mm:
1900         (WebCore::Pasteboard::writeURL):
1901         (WebCore::Pasteboard::writeImage):
1902
1903 2007-03-15  Adele Peterson  <adele@apple.com>
1904
1905         Reviewed by Kevin Decker.
1906
1907         Fix for <rdar://problem/4926179> Text in menulist control should never update if menu is open
1908
1909         * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::updateFromElement):
1910           Only setTextFromOption if the menu isn't visible.
1911
1912 2007-03-15  Brady Eidson  <beidson@apple.com>
1913
1914         Reviewed by Oliver
1915
1916         A few platform specific tweaks
1917
1918         * platform/cf/RetainPtr.h:
1919         (WebCore::RetainPtr::releaseRef): Fixed releaseRef to work with CF
1920         
1921         * platform/network/ResourceHandle.h: Added a "releaseRef" style call
1922
1923 2007-03-15  Maciej Stachowiak  <mjs@apple.com>
1924
1925         Reviewed by Geoff and Steve.
1926
1927         * config.h: Remove unneeded hack.
1928
1929 2007-03-15  Justin Garcia  <justin.garcia@apple.com>
1930
1931         Reviewed by john
1932         
1933         <rdar://problem/5062376> 
1934         REGRESSION: In Mail and Gmail, can't change alignment to text after it has been applied
1935         
1936         Bring back the remove step in applyBlockStyle.  It's 
1937         necessary because addBlockStyleIfNeeded assumes that 
1938         the properties it adds aren't already on the block that 
1939         it adds them to.
1940
1941         * editing/ApplyStyleCommand.cpp:
1942         (WebCore::ApplyStyleCommand::applyBlockStyle): 
1943         Bring back the remove step (added a testcase).
1944         Don't do the add step if m_removeOnly is true (no testcase
1945         because there aren't any clients using removeOnly functionality
1946         to remove styles yet, only styled elemets).
1947         Moved the code for creating new blocks up one level
1948         to this function so that we can pass blocks to removeCSSStyle.
1949         When converting VisiblePositions to indices and vice versa,
1950         use the highest node in the shadow tree if we're in one as
1951         the scope (working on a testcase).
1952         (WebCore::ApplyStyleCommand::addBlockStyle): Moved code to
1953         applyBlockStyle.
1954         * editing/ApplyStyleCommand.h: 
1955
1956 2007-03-15  Brady Eidson  <beidson@apple.com>
1957
1958         Reviewed by Maciej
1959
1960         <rdar://problem/4429701>
1961         Implements a port blocking black list that matches Firefox's
1962
1963         * loader/FrameLoader.cpp:
1964         (WebCore::FrameLoader::blockedError): Call through to the client for blockedError 
1965         * loader/FrameLoader.h:
1966
1967         * loader/FrameLoaderClient.h: Get the "port blocked" error for the current platform
1968
1969         * loader/ResourceLoader.cpp:
1970         (WebCore::ResourceLoader::wasBlocked): ResourceHandleClient method to pass on the didFail(error)
1971         (WebCore::ResourceLoader::blockedError): Following the pattern of "CancelledError()", get the 
1972           error to fail with for the didFail() call
1973         * loader/ResourceLoader.h:
1974
1975         * platform/graphics/svg/SVGImageEmptyClients.h:
1976         (WebCore::SVGEmptyFrameLoaderClient::blockedError): Added stub
1977
1978         * platform/network/ResourceHandle.cpp:
1979         (WebCore::ResourceHandle::create): If the port is blocked, create the handle but schedule it for
1980           deferred failure on a timer
1981         (WebCore::ResourceHandle::scheduleBlockedFailure): Do the timer scheduling
1982         (WebCore::ResourceHandle::fireBlockedFailure): Fire the timer here
1983         (WebCore::ResourceHandle::portAllowed): Implements checking of Mozilla's
1984         * platform/network/ResourceHandle.h:
1985         * platform/network/ResourceHandleClient.h:
1986         (WebCore::ResourceHandleClient::wasBlocked): Virtual for clients to get the "blocked" message
1987
1988 2007-03-15  Beth Dakin  <bdakin@apple.com>
1989
1990         Reviewed by Hyatt.
1991
1992         Fix for <rdar://problem/5065396> REGRESSION: leaks in 
1993         RenderBlock::layoutInlineChildren seen on buildbot
1994
1995         This leak appeared after http://trac.webkit.org/projects/webkit/
1996         changeset/20188. This change shifted line boxes around in 
1997         removeChild(). But since removeChild() calls 
1998         setNeedsLayoutAndMinMaxRecalc(), all of the line boxes will be 
1999         removed once we actually lay out anyway. So this patch fixes the 
2000         leak by deleting the line boxes instead of shifting them around. 
2001
2002         * editing/IndentOutdentCommand.cpp:
2003         (WebCore::IndentOutdentCommand::outdentParagraph): Call into 
2004         updateLayout(). This fixes an assertion I got in editing/
2005         execCommand/4976800.html This is very similar to the line box fix I 
2006         made recently (http://trac.webkit.org/projects/webkit/changeset/
2007         20177). We need to update layout before relying on VisiblePositions 
2008         after removing a node.
2009         * rendering/RenderBlock.cpp:
2010         (WebCore::RenderBlock::deleteLinesForBlock): New helper function 
2011         since this functionality is needed in three places now.
2012         (WebCore::RenderBlock::makeChildrenNonInline): Call into new 
2013         deleteLinesForBlock().
2014         (WebCore::RenderBlock::removeChild): Same.
2015         * rendering/RenderBlock.h:
2016
2017 2007-03-15  Timothy Hatcher  <timothy@apple.com>
2018
2019         Reviewed by John.
2020
2021         * Factored out most of our common build settings into .xcconfig files. Anything that was common in
2022           each build configuration was factored out into the shared .xcconfig file.
2023         * Adds a Version.xcconfig file to define the current framework version, to be used in other places.
2024         * Use the new $(BUNDLE_VERSION) (defined in Version.xcconfig) in the preprocessed Info.plist.
2025         * Use the versions defined in Version.xcconfig to set $(DYLIB_CURRENT_VERSION).
2026
2027         * Configurations/Base.xcconfig: Added.
2028         * Configurations/DebugRelease.xcconfig: Added.
2029         * Configurations/Version.xcconfig: Added.
2030         * Configurations/WebCore.xcconfig: Added.
2031         * Info.plist:
2032         * WebCore.xcodeproj/project.pbxproj:
2033
2034 2007-03-15  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
2035
2036         Not reviewed - gdk build fixes.
2037
2038         * platform/gdk/EditorClientGdk.cpp:
2039         (WebCore::EditorClientGdk::handleKeypress):
2040         * platform/graphics/cairo/ImageSourceCairo.cpp:
2041         (WebCore::ImageSource::setData):
2042         * platform/graphics/gdk/ImageGdk.cpp:
2043         (WebCore::Image::loadPlatformResource):
2044
2045 2007-03-14  Justin Garcia  <justin.garcia@apple.com>
2046
2047         Reviewed by john
2048         
2049         ~2x speed up of 5k rich text paste:
2050         http://shakespeare.mit.edu/hamlet/full.html        
2051
2052         * editing/ReplaceSelectionCommand.cpp:
2053         (WebCore::ReplaceSelectionCommand::doApply): Remove the top 
2054         level style span if it's unnecessary before inserting
2055         into the document, it's faster than doing it after.
2056         * editing/ReplaceSelectionCommand.h: Exposed 
2057         ReplacementFragment::removeNodePreservingChildren so that
2058         the style span can be removed using non-undoable removes,
2059         like the rest of the removes done on the ReplacementFragment.
2060         * editing/markup.cpp:
2061         (WebCore::createMarkup): Make the style span the top level
2062         element, otherwise it's useless.  This also facilitates the
2063         optimization mentioned above.
2064         When including markup for a fully selected root, include markup
2065         for all the nodes beneath that fully selected root, to preserve 
2066         the structure and appearance of the copied markup.  Did this
2067         by merging with the code for adding markup for descendants of
2068         special commonAncestorBlocks.
2069
2070 2007-03-15  Beth Dakin  <bdakin@apple.com>
2071
2072         Rubber-stamped by Adele.
2073
2074         Rolling out http://trac.webkit.org/projects/webkit/changeset/20148 
2075         (which is a fix for http://bugs.webkit.org/show_bug.cgi?id=12595 
2076         and rdar://4722863) because it causes a horrible memory-trasher. 
2077
2078         * bindings/js/JSHTMLFormElementCustom.cpp:
2079         (WebCore::JSHTMLFormElement::canGetItemsForName):
2080         (WebCore::JSHTMLFormElement::nameGetter):
2081         * bindings/js/kjs_dom.cpp:
2082         (KJS::):
2083         (KJS::DOMNamedNodesCollection::DOMNamedNodesCollection):
2084         (KJS::DOMNamedNodesCollection::lengthGetter):
2085         (KJS::DOMNamedNodesCollection::indexGetter):
2086         (KJS::DOMNamedNodesCollection::getOwnPropertySlot):
2087         * bindings/js/kjs_dom.h:
2088         (KJS::DOMNamedNodesCollection::classInfo):
2089         * bindings/js/kjs_html.cpp:
2090         (KJS::JSHTMLCollection::getNamedItems):
2091         * dom/ChildNodeList.cpp:
2092         (WebCore::ChildNodeList::ChildNodeList):
2093         (WebCore::ChildNodeList::length):
2094         (WebCore::ChildNodeList::item):
2095         (WebCore::ChildNodeList::nodeMatches):
2096         * dom/ChildNodeList.h:
2097         * dom/NameNodeList.cpp:
2098         (WebCore::NameNodeList::NameNodeList):
2099         (WebCore::NameNodeList::item):
2100         (WebCore::NameNodeList::nodeMatches):
2101         * dom/NameNodeList.h:
2102         (WebCore::NameNodeList::rootNodeAttributeChanged):
2103         * dom/Node.cpp:
2104         (WebCore::TagNodeList::TagNodeList):
2105         (WebCore::TagNodeList::nodeMatches):
2106         (WebCore::Node::registerNodeList):
2107         (WebCore::Node::unregisterNodeList):
2108         * dom/Node.h:
2109         * dom/NodeList.cpp:
2110         (WebCore::NodeList::NodeList):
2111         (WebCore::NodeList::~NodeList):
2112         (WebCore::NodeList::recursiveLength):
2113         (WebCore::NodeList::itemForwardsFromCurrent):
2114         (WebCore::NodeList::itemBackwardsFromCurrent):
2115         (WebCore::NodeList::recursiveItem):
2116         (WebCore::NodeList::itemWithName):
2117         (WebCore::NodeList::rootNodeChildrenChanged):
2118         * dom/NodeList.h:
2119         (WebCore::NodeList::rootNodeAttributeChanged):
2120         * html/HTMLFormElement.cpp:
2121         (WebCore::HTMLFormElement::HTMLFormElement):
2122         (WebCore::HTMLFormElement::~HTMLFormElement):
2123         (WebCore::HTMLFormElement::formData):
2124         (WebCore::HTMLFormElement::parseMappedAttribute):
2125         (WebCore::HTMLFormElement::removeFormElement):
2126         * html/HTMLFormElement.h:
2127         * html/HTMLGenericFormElement.cpp:
2128         (WebCore::HTMLGenericFormElement::parseMappedAttribute):
2129         (WebCore::HTMLGenericFormElement::insertedIntoTree):
2130         * html/HTMLGenericFormElement.h:
2131         * html/HTMLInputElement.cpp:
2132         (WebCore::HTMLInputElement::parseMappedAttribute):
2133
2134 2007-03-15  Geoffrey Garen  <ggaren@apple.com>
2135
2136         Added an assert to help catch a bug. Hopefully someone will hit it!
2137         
2138         * bindings/js/kjs_proxy.cpp:
2139         (WebCore::KJSProxy::~KJSProxy):
2140
2141 2007-03-14  Oliver Hunt  <oliver@apple.com>
2142
2143         Reviewed by Adele.
2144
2145         Fix for rdar://problem/5061737.
2146         
2147         This was a regression from the original Objective-C -> C++ conversion
2148         for the drag logic.  We don't need to call Range::startNode as we just
2149         need the document that contains the range.   
2150
2151         * page/DragController.cpp:
2152         (WebCore::documentFragmentFromDragData):
2153
2154 2007-03-14  Mitz Pettel  <mitz@webkit.org>
2155
2156         Reviewed by Hyatt.
2157
2158         - http://bugs.webkit.org/show_bug.cgi?id=13071
2159           REGRESSION: Plain text files no longer wrap lines longer than the width of the browser window
2160
2161         Test: fast/loader/text-document-wrapping.html
2162
2163         * loader/TextDocument.cpp:
2164         (WebCore::TextTokenizer::write): Specified word-wrap:break-word for the <pre> element.
2165
2166 2007-03-14  Mitz Pettel  <mitz@webkit.org>
2167
2168         Reviewed by Hyatt.
2169
2170         - fix http://bugs.webkit.org/show_bug.cgi?id=13072
2171           REGRESSION (r15617): white-space: pre-wrap breaks off the last character of a wide word
2172
2173         Test: fast/text/whitespace/pre-wrap-last-char.html
2174
2175         * rendering/bidi.cpp:
2176         (WebCore::RenderBlock::findNextLineBreak): Undid the change from r15617.
2177
2178 2007-03-14  David Hyatt  <hyatt@apple.com>
2179
2180         Add asserts to help catch double refs and double derefs of CachedResources.
2181
2182         Reviewed by mjs
2183
2184         * loader/CachedResource.cpp:
2185         (WebCore::CachedResource::ref):
2186         (WebCore::CachedResource::deref):
2187
2188 2007-03-14  Alice Liu  <alice.liu@apple.com>
2189
2190         Rubber-stamped by Hyatt.
2191
2192         Adding null check to prevent the crash that happens on 2nd run of iBench HTML load test
2193
2194         * loader/icon/IconDataCache.cpp:
2195         (WebCore::IconDataCache::writeToDatabase):
2196
2197 === Safari-5522.4 ===
2198
2199 2007-03-14  Adele Peterson  <adele@apple.com>
2200
2201         Reviewed by Adam.
2202
2203         Fix for <rdar://problem/5062898> REGRESSION: autocomplete window in text fields doesn't come up
2204
2205         When we moved the initialization of a bunch of variables in the HTMLFormElement constructor, m_autocomplete accidently got initialized to false.
2206
2207         * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::HTMLFormElement):
2208
2209 2007-03-14  Steve Falkenburg  <sfalken@apple.com>
2210
2211         Reviewed by Adam.
2212
2213         Added missing null check in case this is called on a subframe
2214         that hasn't started loading.
2215
2216         * page/Frame.cpp:
2217         (WebCore::Frame::setMarkedTextMatchesAreHighlighted): Check for a null document.
2218
2219 2007-03-14  Antti Koivisto  <antti@apple.com>
2220
2221         Reviewed by Geoff.
2222
2223         Fix http://bugs.webkit.org/show_bug.cgi?id=13060
2224         REGRESSION: Repro ASSERT failure in Cache::adjustSize running layout tests
2225         <rdar://5060208>
2226         
2227         Script evaluation may have dereffed the CachedScript object already, causing double deref and
2228         eventually m_liveResourcesSize underflow.
2229
2230         * html/HTMLScriptElement.cpp:
2231         (WebCore::HTMLScriptElement::notifyFinished):
2232
2233 2007-03-14  Adele Peterson  <adele@apple.com>
2234
2235         Reviewed by Darin.
2236
2237         Added InsertTab, InsertBacktab, InsertLineBreak, and InsertNewline to the editing command table.
2238         Added Event parameter to execCommand, and to all of the enabled and exec functions.  Right now,
2239         the event is only used by the newly added commands.  But in the future, many (and possibly all) of
2240         these editing commands will need to consider the event so they are applied to the correct selection.
2241
2242         * WebCore.exp:
2243         * editing/Editor.cpp:
2244         (WebCore::execCopy):
2245         (WebCore::execCut):
2246         (WebCore::execDelete):
2247         (WebCore::execBackwardDelete):
2248         (WebCore::execForwardDelete):
2249         (WebCore::execMoveBackward):
2250         (WebCore::execMoveBackwardAndModifySelection):
2251         (WebCore::execMoveUpByPageAndModifyCaret):
2252         (WebCore::execMoveDown):
2253         (WebCore::execMoveDownAndModifySelection):
2254         (WebCore::execMoveForward):
2255         (WebCore::execMoveForwardAndModifySelection):
2256         (WebCore::execMoveDownByPageAndModifyCaret):
2257         (WebCore::execMoveLeft):
2258         (WebCore::execMoveLeftAndModifySelection):
2259         (WebCore::execMoveRight):
2260         (WebCore::execMoveRightAndModifySelection):
2261         (WebCore::execMoveToBeginningOfDocument):
2262         (WebCore::execMoveToBeginningOfDocumentAndModifySelection):
2263         (WebCore::execMoveToBeginningOfSentence):
2264         (WebCore::execMoveToBeginningOfSentenceAndModifySelection):
2265         (WebCore::execMoveToBeginningOfLine):
2266         (WebCore::execMoveToBeginningOfLineAndModifySelection):
2267         (WebCore::execMoveToBeginningOfParagraph):
2268         (WebCore::execMoveToBeginningOfParagraphAndModifySelection):
2269         (WebCore::execMoveToEndOfDocument):
2270         (WebCore::execMoveToEndOfDocumentAndModifySelection):
2271         (WebCore::execMoveToEndOfSentence):
2272         (WebCore::execMoveToEndOfSentenceAndModifySelection):
2273         (WebCore::execMoveToEndOfLine):
2274         (WebCore::execMoveToEndOfLineAndModifySelection):
2275         (WebCore::execMoveToEndOfParagraph):
2276         (WebCore::execMoveToEndOfParagraphAndModifySelection):
2277         (WebCore::execMoveParagraphBackwardAndModifySelection):
2278         (WebCore::execMoveParagraphForwardAndModifySelection):
2279         (WebCore::execMoveUp):
2280         (WebCore::execMoveUpAndModifySelection):
2281         (WebCore::execMoveWordBackward):
2282         (WebCore::execMoveWordBackwardAndModifySelection):
2283         (WebCore::execMoveWordForward):
2284         (WebCore::execMoveWordForwardAndModifySelection):
2285         (WebCore::execMoveWordLeft):
2286         (WebCore::execMoveWordLeftAndModifySelection):
2287         (WebCore::execMoveWordRight):
2288         (WebCore::execMoveWordRightAndModifySelection):
2289         (WebCore::execPaste):
2290         (WebCore::execSelectAll):
2291         (WebCore::execToggleBold):
2292         (WebCore::execToggleItalic):
2293         (WebCore::execRedo):
2294         (WebCore::execUndo):
2295         (WebCore::execInsertTab):
2296         (WebCore::execInsertBacktab):
2297         (WebCore::execInsertNewline):
2298         (WebCore::execInsertLineBreak):
2299         (WebCore::enabled):
2300         (WebCore::canPaste):
2301         (WebCore::hasEditableSelection):
2302         (WebCore::hasEditableRangeSelection):
2303         (WebCore::hasRangeSelection):
2304         (WebCore::hasRichlyEditableSelection):
2305         (WebCore::canRedo):
2306         (WebCore::canUndo):
2307         (WebCore::CommandEntry::):
2308         (WebCore::Editor::toggleBold):
2309
2310         (WebCore::Editor::execCommand): Added optional event parameter.
2311         (WebCore::Editor::insertText): Added.  Calls handleTextInputEvent.
2312         (WebCore::Editor::insertTextWithoutSendingTextEvent): Renamed from insertText.
2313          Performs the actual insertion without dispatching any event.
2314         * editing/Editor.h:
2315         * page/EventHandler.cpp: (WebCore::EventHandler::defaultTextInputEventHandler):
2316           Call insertTextWithoutSendingTextEvent.
2317
2318 2007-03-14  Justin Garcia  <justin.garcia@apple.com>
2319
2320         Reviewed by darin
2321         
2322         ~3x speedup pasting 5k lines of rich text:
2323         http://shakespeare.mit.edu/hamlet/full.html
2324         ~2x speedup pasting 10k lines of plain text
2325         
2326         * css/CSSComputedStyleDeclaration.cpp:
2327         (WebCore::computedStyle): Added for convenience.
2328         * css/CSSComputedStyleDeclaration.h:
2329         * editing/ReplaceSelectionCommand.cpp:
2330         (WebCore::ReplaceSelectionCommand::removeRedundantStyles):
2331         The code that pushed down the top level style span had
2332         a bug in it that made it do unnecessary work.  Instead of
2333         fixing the bug I removed the code because it was used to 
2334         help see more redundancies in second level style spans, but 
2335         createMarkup now *only* creates a top level style span.
2336         Only remove redundant styles from style spans and only remove
2337         unstyled elements if they are style spans.  FF doesn't
2338         remove redundant styles from elements, or remove redundant 
2339         font tags on copy/paste.  We could offer this functionality 
2340         through a separate "cleanup" command.
2341         * editing/markup.cpp:
2342         (WebCore::createMarkup): Only add markup for ancestors of 
2343         lastClosed if we're including markup for acommonAncestorBlock 
2344         (we do this for commonAncestorBlocks like tables and lists),
2345         otherwise it's unnecessary/redundant.
2346
2347 2007-03-14  Anders Carlsson  <acarlsson@apple.com>
2348
2349         Reviewed by Ada.
2350
2351         Make sure to call ResourceLoader::didReceiveData to ensure that there's a shared buffer with the resource
2352         data, since SubresourceLoaderClients now make use of that buffer.
2353         
2354         * loader/SubresourceLoader.cpp:
2355         (WebCore::SubresourceLoader::didReceiveData):
2356
2357 2007-03-14  Administrator  <acarlsson@apple.com>
2358
2359         Get the size from the shared buffer.
2360         
2361         * platform/graphics/cg/ImageSourceCG.cpp:
2362         (WebCore::ImageSource::setData):
2363         * platform/graphics/cg/PDFDocumentImage.cpp:
2364         (WebCore::PDFDocumentImage::dataChanged):
2365
2366 2007-03-14  Mitz Pettel  <mitz@webkit.org>
2367
2368         Reviewed by Hyatt, thumbs up by Darin.
2369
2370         - fix http://bugs.webkit.org/show_bug.cgi?id=12782
2371           Reproducible crash in BidiContext::deref
2372
2373         Test: fast/dynamic/anonymous-block-orphaned-lines.html
2374
2375         * rendering/InlineBox.cpp:
2376         (WebCore::InlineBox::root): Added an assertion that we return a root inline box.
2377         * rendering/RenderBlock.cpp:
2378         (WebCore::RenderBlock::removeChild): Added code to adopt the line boxes of
2379         anonymous blocks being destroyed instead of leaving them orphaned, which
2380         is what caused this crash. The boxes will be deleted on the next layout, but
2381         this ensures consistency in the mean time.
2382
2383 2007-03-14  Lars Knoll <lars@trolltech.com>
2384
2385         Reviewed by Antti.
2386
2387         Fix the Qt build.
2388         Add a getter to SharedBuffer that returns a reference to the internal
2389         Vector to avoid an extra copy of the data.
2390
2391         * platform/SharedBuffer.h:
2392         (WebCore::SharedBuffer::buffer):
2393         * platform/graphics/qt/ImageQt.cpp:
2394         (WebCore::Image::loadPlatformResource):
2395         * platform/graphics/qt/ImageSourceQt.cpp:
2396         (WebCore::detectImageFormat):
2397         (WebCore::createDecoder):
2398         (WebCore::ImageSource::setData):
2399
2400 2007-03-14  Antti Koivisto  <antti@apple.com>
2401
2402         Reviewed by Mitz.
2403         
2404         Fix <rdar://problem/5058774>
2405         REGRESSION: In Mail, caret appears oversized when typing in a To Do note
2406         
2407         Horizontal and vertical were switched. Was regression from
2408         http://trac.webkit.org/projects/webkit/changeset/20103
2409
2410         * rendering/RootInlineBox.cpp:
2411         (WebCore::RootInlineBox::addHighlightOverflow):
2412
2413 2007-03-14  David Hyatt  <hyatt@apple.com>
2414
2415         Tweak the data() functions of stylesheets and scripts to be internally consistent.
2416
2417         * loader/CachedCSSStyleSheet.cpp:
2418         (WebCore::CachedCSSStyleSheet::data):
2419         * loader/CachedScript.cpp:
2420         (WebCore::CachedScript::data):
2421         * loader/CachedXSLStyleSheet.cpp:
2422         (WebCore::CachedXSLStyleSheet::data):
2423
2424 2007-03-14  David Hyatt  <hyatt@apple.com>
2425
2426         Fix Radar 5050688.  
2427
2428         For large animated GIFs, destroy and recreate the source for every animation frame.  This keeps
2429         the memory consumption down while giant images are animating.
2430
2431         Reviewed by andersca
2432
2433         * platform/graphics/BitmapImage.cpp:
2434         (WebCore::BitmapImage::BitmapImage):
2435         (WebCore::BitmapImage::destroyDecodedData):
2436         (WebCore::BitmapImage::dataChanged):
2437         (WebCore::BitmapImage::advanceAnimation):
2438         * platform/graphics/BitmapImage.h:
2439
2440 2007-03-14  David Hyatt  <hyatt@apple.com>
2441
2442         Make sure to use CFDataCreateWithBytesNoCopy where we can.
2443
2444         Reviewed by andersca
2445
2446         * platform/graphics/cg/ImageSourceCG.cpp:
2447         (WebCore::ImageSource::setData):
2448         * platform/graphics/cg/PDFDocumentImage.cpp:
2449         (WebCore::PDFDocumentImage::dataChanged):
2450
2451 2007-03-13  David Hyatt  <hyatt@apple.com>
2452
2453         Fix for bugzilla bug 13050 and also radar p1 5050645.
2454
2455         This patch reworks resource loading to avoid having redundant buffers in the icon database and in cached
2456         images in the WebCore cache.  It also avoids overcopying in top-level image documents and in the icon
2457         database.
2458
2459         There is now only one SharedBuffer for a resource and everybody observes that buffer now instead of ever
2460         making their own.  Even ImageIO uses the SharedBuffer while decoding.
2461
2462         The page in 13050 dropped from 145mb down to 45mb of memory use with this change for a stunning savings
2463         of 100mb.
2464
2465         Reviewed by olliej, mjs
2466
2467         * WebCore.exp:
2468         * loader/CachedCSSStyleSheet.cpp:
2469         (WebCore::CachedCSSStyleSheet::data):
2470         * loader/CachedCSSStyleSheet.h:
2471         * loader/CachedImage.cpp:
2472         (WebCore::CachedImage::data):
2473         * loader/CachedImage.h:
2474         * loader/CachedResource.cpp:
2475         (WebCore::CachedResource::CachedResource):
2476         (WebCore::CachedResource::~CachedResource):
2477         * loader/CachedResource.h:
2478         (WebCore::CachedResource::data):
2479         * loader/CachedScript.cpp:
2480         (WebCore::CachedScript::data):
2481         * loader/CachedScript.h:
2482         * loader/CachedXSLStyleSheet.cpp:
2483         (WebCore::CachedXSLStyleSheet::data):
2484         * loader/CachedXSLStyleSheet.h:
2485         * loader/DocLoader.cpp:
2486         (WebCore::DocLoader::checkCacheObjectStatus):
2487         * loader/ImageDocument.cpp:
2488         (WebCore::ImageTokenizer::writeRawData):
2489         (WebCore::ImageTokenizer::finish):
2490         * loader/icon/IconDataCache.cpp:
2491         (WebCore::IconDataCache::setImageData):
2492         (WebCore::IconDataCache::writeToDatabase):
2493         * loader/icon/IconDataCache.h:
2494         * loader/icon/IconDatabase.cpp:
2495         (WebCore::IconDatabase::imageDataForIconURL):
2496         (WebCore::IconDatabase::iconForPageURL):
2497         (WebCore::IconDatabase::setIconDataForIconURL):
2498         (WebCore::IconDatabase::setHaveNoIconForIconURL):
2499         (WebCore::IconDatabase::imageDataForIconURLQuery):
2500         * loader/icon/IconDatabase.h:
2501         * loader/icon/IconLoader.cpp:
2502         (WebCore::IconLoader::startLoading):
2503         (WebCore::IconLoader::didReceiveResponse):
2504         (WebCore::IconLoader::didReceiveData):
2505         (WebCore::IconLoader::didFail):
2506         (WebCore::IconLoader::finishLoading):
2507         (WebCore::IconLoader::clearLoadingState):
2508         * loader/icon/IconLoader.h:
2509         * loader/icon/SQLStatement.cpp:
2510         (WebCore::SQLStatement::getColumnBlobAsVector):
2511         (WebCore::SQLStatement::isExpired):
2512         * loader/icon/SQLStatement.h:
2513         * loader/loader.cpp:
2514         (WebCore::Loader::didFinishLoading):
2515         (WebCore::Loader::didReceiveData):
2516         * page/mac/WebCoreFrameBridge.mm:
2517         (-[WebCoreFrameBridge getData:andResponse:forURL:]):
2518         (-[WebCoreFrameBridge getAllResourceDatas:andResponses:]):
2519         * platform/SharedBuffer.h:
2520         (WebCore::SharedBuffer::isEmpty):
2521         * platform/graphics/BitmapImage.cpp:
2522         (WebCore::BitmapImage::destroyDecodedData):
2523         (WebCore::BitmapImage::dataChanged):
2524         * platform/graphics/BitmapImage.h:
2525         * platform/graphics/Image.cpp:
2526         (WebCore::Image::setData):
2527         * platform/graphics/Image.h:
2528         (WebCore::Image::dataChanged):
2529         (WebCore::Image::data):
2530         * platform/graphics/ImageSource.h:
2531         * platform/graphics/cg/ImageSourceCG.cpp:
2532         (WebCore::ImageSource::setData):
2533         * platform/graphics/cg/PDFDocumentImage.cpp:
2534         (WebCore::PDFDocumentImage::dataChanged):
2535         * platform/graphics/cg/PDFDocumentImage.h:
2536         * platform/graphics/mac/ImageMac.mm:
2537         (WebCore::Image::loadPlatformResource):
2538         * platform/graphics/svg/SVGImage.cpp:
2539         (WebCore::SVGImage::setData):
2540         * platform/mac/PasteboardMac.mm:
2541         (WebCore::fileWrapperForImage):
2542
2543 2007-03-13  Justin Garcia  <justin.garcia@apple.com>
2544
2545         Reviewed by darin
2546         
2547         <rdar://problem/5046875> 
2548         Gmail Editor: Applying alignment to selected text in message also applies alignment to signature
2549
2550         * editing/ApplyStyleCommand.cpp:
2551         (WebCore::ApplyStyleCommand::doApply): Don't call applyBlockStyle unless
2552         there is a block style to apply.
2553         (WebCore::ApplyStyleCommand::applyBlockStyle): Don't do the remove step.
2554         It was unnecessary and removed properties from blocks that could contain 
2555         content outside the range being operated on (added a testcase).
2556         (WebCore::ApplyStyleCommand::addBlockStyleIfNeeded): Used an early return
2557         instead of if-nesting.
2558         * editing/ApplyStyleCommand.h:
2559         * editing/CompositeEditCommand.cpp:
2560         (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
2561         Return the new block, if one was created.  Use moveParagraphs to move
2562         paragraphs into the new block, instead of moving nodes.  The old code moved
2563         too much (added a testcase).
2564         * editing/CompositeEditCommand.h:
2565
2566 2007-03-13  Oliver Hunt  <oliver@apple.com>
2567
2568         Reviewed by Brady.
2569
2570         To fix <rdar://problem/5044366> we now pass a NSString
2571         representation of the URL extracted with _web_originalDataAsString
2572         instead of relying on [NSURL absoluteString] in the bridge
2573
2574         * page/mac/WebCoreFrameBridge.h:
2575         * page/mac/WebCoreFrameBridge.mm:
2576         (-[WebCoreFrameBridge getData:andResponse:forURL:]):
2577
2578 2007-03-13  Brady Eidson  <beidson@apple.com>
2579
2580         Reviewed by Anders
2581
2582         <rdar://problem/5048818> - REGRESSION: Incompletely loaded resources being saved to the object cache
2583
2584         Due to a subtle change in loader behavior back in 10904, we would stop all loaders before calling 
2585         didFail() on them in the Cache loader.  As a result, we basically cleared all of the Subresource Loaders 
2586         out of the Cache loader before more properly failing them as errored out.  The result?  Partially loaded
2587         resources being cached.
2588         
2589         Since Loader::didFail() both calls error() on the object *and* removes the loader, the solution is to call 
2590         didFail() for all cancelled loaders instead of *only* removing them from the set of active loaders.
2591         
2592         In addition, pages that didn't completely load were being saved to the back/forward cache.  To fix that,
2593         I added a null check on the DocumentLoader's error to see if the page ended in an error, or did indeed 
2594         completely load.
2595
2596         Note that the layout test for this - if possible - will require other enhancements including possibly adding
2597         support for window.stop().  That task is documented in <rdar://problem/5061826>
2598
2599         * loader/FrameLoader.cpp:
2600         (WebCore::FrameLoader::provisionalLoadStarted): Fixed a few bugs relating to my original BFCache rewrite to
2601           more perfectly restore the original behavior - including only caching HTML documents via the 
2602           m_client->canCachePage() call
2603         (WebCore::FrameLoader::canCachePage): Don't make the call to m_client->canCachePage() as that serves a different
2604           purpose
2605           - Check the mainDocumentError to see if the load ended in error as a further criteria in determining the 
2606           cachability of a page
2607
2608         * loader/loader.cpp:
2609         (WebCore::Loader::cancelRequests): Call didFail(cancelledError()) instead of just removing the loaders from the 
2610           loaders-in-progress set.  This adds the effect of properly cleaning up the cached object.
2611
2612 2007-03-13  Beth Dakin  <bdakin@apple.com>
2613
2614         Rendering part reviewed by Hyatt. Editing part consulted with and 
2615         rubber stamped by Justin and Harrison.
2616
2617         Fix for <rdar://problem/5025925> A hang occurs in Safari when 
2618         attempting to print page at http://www.pcadvisor.co.uk
2619
2620         * rendering/RenderBlock.cpp:
2621         (WebCore::RenderBlock::makeChildrenNonInline): 
2622         RenderBlock::makeChildrenNonInline() takes a block's inline 
2623         children and turns them into block children. If the children had 
2624         line boxes, those boxes were being leaked. In the layout test I 
2625         added with the change (and at pcadvisor.co.uk during printing) 
2626         children were being made non-inline, and then they were being made 
2627         inline again. This meant that some of the children ended up 
2628         pointing to totally stale line boxes that are normally just leaked. 
2629         This caused an infinite loop in RenderFlow::destroy(). This patch 
2630         simply deletes everyone's line boxes in 
2631         RenderBlock::makeChildrenNonInline()
2632
2633         * editing/InsertParagraphSeparatorCommand.cpp:
2634         (WebCore::InsertParagraphSeparatorCommand::doApply): The other part 
2635         of this fix is that I added a call to updateLayout in 
2636         InsertParagraphSeparatorCommand::doApply(). One layout test 
2637         (editing/spelling/spelling.html) was changed by my patch to 
2638         RenderBlock. doApply() inserts a node into the render tree. In at 
2639         least one case in spelling.html, that caused some line boxes to be 
2640         deleted. Back in doApply() this meant that the RenderTree was out-
2641         of-date, and we mistakenly thought we were at the end of the 
2642         paragraph. This caused us to insert a RenderBR() at the end of the 
2643         tree instead of an empty RenderText(). No one seems to know exactly 
2644         why we insert either, or if the change is necessarily a problem. It 
2645         is clear, though, that the RenderTree in doApply() is out-of-date 
2646         after inserting the node and deleting some line boxes, so it seems 
2647         prudent to call into updateLayout().
2648
2649 2007-03-13  Adam Roben  <aroben@apple.com>
2650
2651         Reviewed by Anders.
2652
2653         * platform/FontData.h: Added m_isSystemFont parameter to match NSFont.
2654
2655 2007-03-13  Beth Dakin  <bdakin@apple.com>
2656
2657         Reviewed by Maciej.
2658
2659         Export DocumentLoader::setFrame(). Part of fix for <rdar://
2660         problem/4277074> 8F32: Help Viewer crashed on clicking link - 
2661         KHTMLView::viewportMouseReleaseEvent (12647)
2662
2663         * WebCore.exp:
2664
2665 2007-03-13  Darin Adler  <darin@apple.com>
2666
2667         Reviewed by Maciej.
2668
2669         - fix http://bugs.webkit.org/show_bug.cgi?id=12794
2670           <rdar://problem/5028154> REGRESSION: TripTik planner at aaa.com never
2671           finishes loading due to unclosed canvas tag (12794)
2672
2673         Change <canvas> elements so that their contents are parsed normally,
2674         but not rendered. This change fixes the bug, because normal parsing
2675         rules close the <canvas> element in that case. The special parser
2676         stuff was just getting in the way.
2677
2678         Also do some basic cleanup to the HTML parser. This was motivated by
2679         an earlier version of this patch that made even more changes to the
2680         parser, but the cleanup is still worth landing.
2681
2682         Test: fast/canvas/canvas-hides-fallback.html
2683         Test: fast/canvas/script-inside-canvas-fallback.html
2684         Test: fast/canvas/unclosed-canvas-1.html
2685         Test: fast/canvas/unclosed-canvas-2.html
2686         Test: fast/canvas/unclosed-canvas-3.html
2687         Test: fast/canvas/unclosed-canvas-4.html
2688
2689         * html/HTMLCanvasElement.h: Added a data member to keep track of whether the
2690         renderer is a RenderHTMLCanvas or not.
2691         * html/HTMLCanvasElement.cpp:
2692         (WebCore::HTMLCanvasElement::createRenderer): If JavaScript is enabled, create
2693         a RenderHTMLCanvas. If it's not, let the default code create the default type
2694         of renderer, which will result in fallback content being visible. The
2695         RenderHTMLCanvas class already hides all of its children. Set the m_rendererIsCanvas
2696         boolean accordingly. Since the actual storage for the canvas is allocated lazily
2697         when you actually get a drawing context, we don't need to do anything special
2698         to prevent it when JavaScript is disabled; the relevant functions won't be called.
2699         (WebCore::HTMLCanvasElement::reset): Protect the code that manipulates the
2700         RenderHTMLCanvas with a check of m_rendererIsCanvas. This is the only code inside
2701         the DOM element that relies on the renderer type.
2702
2703         * html/HTMLParser.h: Removed unneeded includes. Marked HTMLParser as
2704         Noncopyable. Changed the Document parameter to the constructor to instead
2705         be HTMLDocument. Renamed discard_until to m_skipModeTag for clarity.
2706         Removed unused noSpaces function and unneeded public doc() function.
2707         Moved data members all down to the end so you can see them together in order.
2708         Renamed map to m_currentMapElement and isindex to m_isindexElement.
2709         Removed unused end and headLoaded data members.  Renamed m_fragment to
2710         m_isParsingFragment to make it clearer that it's a boolean, not a fragment.
2711
2712         * html/HTMLParser.cpp:
2713         (WebCore::HTMLParser::HTMLParser): Changed to use member construction
2714         syntax instead of calling reset(). This is especially helpful in the
2715         fragment case, where calling reset() later on is illegal, so not using
2716         it in the constructor lets us assert.
2717         (WebCore::HTMLParser::~HTMLParser): Did an explicit deref instead of
2718         calling setCurrent for its side effect.
2719         (WebCore::HTMLParser::reset): Updated for member name changes and removal
2720         and to use document instead of doc().
2721         (WebCore::HTMLParser::setCurrent): Use document instead of doc().
2722         (WebCore::HTMLParser::setSkipMode): Added. No longer inline. Now sets the
2723         m_inCanvasBeforeFirstOpenTag data member to false.
2724         (WebCore::HTMLParser::parseToken): Tightened up the skip mode logic at the
2725         top of the function, and added a FIXME about the strange case there where
2726         we don't skip yet stay in skip mode. Updated for renaming and doc().
2727         (WebCore::HTMLParser::insertNode): Updated for renaming and doc().
2728         (WebCore::HTMLParser::handleError): Ditto.
2729         (WebCore::HTMLParser::framesetCreateErrorCheck): Ditto.
2730         (WebCore::HTMLParser::isindexCreateErrorCheck): Changed to use RefPtr.
2731         (WebCore::HTMLParser::noscriptCreateErrorCheck): Updated for renaming and doc().
2732         (WebCore::HTMLParser::mapCreateErrorCheck): Ditto.
2733         (WebCore::HTMLParser::getNode): Removed the special case for canvas here.
2734         Canvas fallback is now handled in the DOM, not the parser. Updated for
2735         renaming and doc().
2736         (WebCore::HTMLParser::allowNestedRedundantTag): Changed a #define into a C++
2737         constant.
2738         (WebCore::HTMLParser::processCloseTag): Updated for renaming and doc().
2739         (WebCore::HTMLParser::isInline): Ditto.
2740         (WebCore::HTMLParser::tagIsOnStack): Added. Used by new canvas logic.
2741         (WebCore::HTMLParser::popBlock): Updated for renaming and doc(). Also renamed
2742         the local variable Elem to elem.
2743         (WebCore::HTMLParser::createHead): Ditto.
2744         (WebCore::HTMLParser::handleIsindex): Changed to use RefPtr.
2745         (WebCore::HTMLParser::startBody): Updated for renaming and doc().
2746         (WebCore::HTMLParser::finished): Ditto.
2747
2748 2007-03-13  David Hyatt  <hyatt@apple.com>
2749
2750         Two more cleanup fixes to the cache.  Don't call destroyDecodedData in the BitmapImage destructor, since
2751         clearing the image source and calling setData on it again causes it to do an extra copy of the encoded
2752         data.  Since we're about to be destroyed this is just wasteful.
2753
2754         When the cache prunes, don't allow it to destroy the decoded data of an image that is still actively loading,
2755         since we've established that ImageIO can actually crash if you yank the rug out from under it like that.
2756
2757         Reviewed by ggaren
2758
2759         * loader/Cache.cpp:
2760         (WebCore::Cache::prune):
2761         * platform/graphics/BitmapImage.cpp:
2762         (WebCore::BitmapImage::~BitmapImage):
2763
2764 2007-03-13  Anders Carlsson  <acarlsson@apple.com>
2765
2766         Try fixing the Qt build.
2767         
2768         * editing/Editor.h:
2769         (WebCore::Editor::setStartNewKillRingSequence):
2770
2771 2007-03-13  David Harrison  <harrison@apple.com>
2772
2773         Reviewed by Justin.
2774
2775         <rdar://problem/5031181> cntl-k at end of paragraph adds nothing to the kill ring
2776         <rdar://problem/5031189> REGRESSION: cntl-y yanks only the most recently killed content
2777
2778         For rdar://5031181, properly extend the selection before the killring handling, and
2779         make sure plainText of that selection returns a linefeed.
2780         
2781         For rdar://5031189, restore Editor::deleteRange() code that continued current killring,
2782         even though the range deletion implicitly stopped it via changing the selection.
2783         
2784         A byproduct of this change is the elimination of RUNDFINDER vs CONTENT TextIterator. The
2785         only difference between the two was whether to emit a newline when the range started
2786         with a blockflow element. No callers actually need that any more.
2787
2788         Tests added:
2789         * editing/pasteboard/emacs-ctrl-k-y-001-expected.checksum: Added.
2790         * editing/pasteboard/emacs-ctrl-k-y-001-expected.png: Added.
2791         * editing/pasteboard/emacs-ctrl-k-y-001-expected.txt: Added.
2792         * editing/pasteboard/emacs-ctrl-k-y-001.html: Added.
2793
2794         * editing/Editor.cpp:
2795         (WebCore::Editor::deleteRange):
2796         Clear the "start new kill ring sequence" setting, because it was set to true
2797         when the selection was updated by deleting the range.
2798         
2799         (WebCore::Editor::deleteWithDirection):
2800         If extending the selection to the end of paragraph resulted in a caret selection,
2801         extend by character, to handle the case when the selection started as a caret at
2802         the end of paragraph.
2803         
2804         * editing/TextIterator.cpp:
2805         (WebCore::TextIterator::TextIterator):
2806         Initialize new member variables for tracking handling of the beginning of the range.
2807         
2808         (WebCore::TextIterator::advance):
2809         Call representNodeOffsetZero on the m_endContainer.
2810         Move visibility checks into handleTextNode and handleReplacedElement.
2811         
2812         (WebCore::TextIterator::handleTextNode):
2813         (WebCore::TextIterator::handleTextBox):
2814         Call emitText.
2815         
2816         (WebCore::TextIterator::handleReplacedElement):
2817         Moved visibility check into here.
2818         
2819         (WebCore::shouldEmitNewlinesBeforeAndAfterNode):
2820         
2821         (WebCore::TextIterator::shouldRepresentNodeOffsetZero):
2822         (WebCore::TextIterator::representNodeOffsetZero):
2823         New. Emits proper sequence when encountering offset 0 of a node, including the
2824         m_endContainer. Started with code from handleNonTextNode.
2825         
2826         (WebCore::TextIterator::handleNonTextNode):
2827         Call representNodeOffsetZero.
2828         
2829         (WebCore::TextIterator::exitNode):
2830         Similar to shouldRepresentNodeOffsetZero, do not emit the newline if the node
2831         was collapsed, and before any other emitted content.
2832         
2833         (WebCore::TextIterator::emitCharacter):
2834         
2835         (WebCore::TextIterator::emitText):
2836         New. Consolidates code used by handleText and handleTextBox.
2837         
2838         (WebCore::CharacterIterator::CharacterIterator):
2839         Removed RUNFINDER.
2840
2841         (WebCore::WordAwareIterator::WordAwareIterator):
2842         Removed RUNFINDER.
2843         
2844         (WebCore::WordAwareIterator::advance):
2845         Formatting.
2846
2847         (WebCore::TextIterator::rangeLength):
2848         Formatting.
2849         
2850         * editing/TextIterator.h:
2851         Added member variables for tracking handling of the beginning of the range.
2852         Eliminated concept of RUNDFINDER vs CONTENT TextIterator.
2853         
2854         * editing/visible_units.cpp:
2855         (WebCore::nextBoundary):
2856         Eliminated concept of RUNDFINDER vs CONTENT TextIterator.
2857
2858 2007-03-13  David Hyatt  <hyatt@apple.com>
2859
2860         Clean up the null image case in CachedImage::data to make sure the size totals will stay accurate.
2861         I'm not convinced this case can even be hit, but I'm cleaning it up just in case.
2862
2863         * loader/CachedImage.cpp:
2864         (WebCore::CachedImage::data):
2865
2866 2007-03-13  David Hyatt  <hyatt@apple.com>
2867
2868         Reorder the call to allReferencesRemoved, since otherwise the live object size will become
2869         incorrect.
2870
2871         * loader/CachedResource.cpp:
2872         (WebCore::CachedResource::deref):
2873
2874 2007-03-13  Antti Koivisto  <antti@apple.com>
2875
2876         Reviewed by Darin.
2877         
2878         Fix http://bugs.webkit.org/show_bug.cgi?id=11083
2879         REGRESSION: Typing tab key fails to insert a tab character in Google Docs editable area
2880         <rdar://problem/4757650>
2881         
2882         Allow inserting tabs in designMode. Backtab behaves like before (matches FF).
2883
2884         * page/EventHandler.cpp:
2885         (WebCore::EventHandler::defaultTabEventHandler):
2886
2887 2007-03-13  David Hyatt  <hyatt@apple.com>
2888
2889         Fix two counting errors in the decoded size of objects in the WebCore cache.  We need to explicitly
2890         destroy decoded data when clearing out a partially loaded image that had an error, since the destructor
2891         (although it does destroy the data) disconnects the observer so that the notification doesn't happen.
2892
2893         Some CachedImages aren't in the cache (like image documents).  When the decoded size of such an image
2894         changes we should not notify the cache, since - newsflash - we aren't actually in it.
2895
2896         Reviewed by ggaren
2897
2898         * loader/CachedImage.cpp:
2899         (WebCore::CachedImage::clear):
2900         (WebCore::CachedImage::decodedSizeChanged):
2901
2902 2007-03-13  Darin Adler  <darin@apple.com>
2903
2904         Reviewed by Tim Hatcher and John Sullivan.
2905
2906         - fix <rdar://problem/4915303> CrashTracer: 36 crashes in Safari at
2907           com.apple.AppKit: -[NSView getRectsBeingDrawn:count:] + 502
2908
2909         * page/mac/FrameMac.mm: (WebCore::Frame::imageFromRect):
2910         This was calling drawRect: directly, but NSView's getRectsBeingDrawn:count:
2911         method was never really safe to call unless it was AppKit that called your
2912         drawRect: method. Changed it to call drawSingleRect: instead. A little ugly,
2913         but seems to work and will almost certainly fix the bug.
2914
2915 2007-03-13  Nikolas Zimmermann  <zimmermann@kde.org>
2916
2917         Reviewed by Maciej.
2918
2919         Fixes: http://bugs.webkit.org/show_bug.cgi?id=12974
2920
2921         Call forgetGenericContext in JSSVGPathSeg destructor, otherwhise
2922         we'll hit an ASSERT in a debug build, when running svg/custom/js-update-path-changes.svg
2923         a few dozen times in a single WebKit instance. The ASSERT is good and just warns that
2924         there was already a generic context pointer registered, and the new "to be registered"
2925         object already exists, but pointing to a different object. That's because garbage collection
2926         calls the JSSVGPathSeg destructor, but that didn't cleanup the generic context map.
2927
2928         Only JSSVGPathSeg is hit by this problem, as it's the only non SVGAnimated* type
2929         using the generic context system while using a custom JSSVGPathSegList implementation.
2930
2931         Also cleanup JSSVGPathSegListCustom code to call the static forgetGenericContext
2932         method instead of doing the same using custom code.
2933
2934         * bindings/js/JSSVGPathSegListCustom.cpp:
2935         (WebCore::removeFromPathSegContextMap):
2936         (WebCore::JSSVGPathSegList::clear):
2937         (WebCore::JSSVGPathSegList::removeItem):
2938         * bindings/scripts/CodeGeneratorJS.pm:
2939
2940 2007-03-13  Darin Adler  <darin@apple.com>
2941
2942         Reviewed by Adele.
2943
2944         - fix http://bugs.webkit.org/show_bug.cgi?id=12595
2945           <rdar://problem/4722863> REGRESSION: Can't add item to cart at lnt.com
2946           (JS type error) (12595)
2947
2948         Test: fast/forms/old-names.html
2949
2950         * bindings/js/JSHTMLFormElementCustom.cpp:
2951         (WebCore::JSHTMLFormElement::canGetItemsForName): If the form collection has
2952         nothing for a given name, try the form's oldNamedElement function.
2953         (WebCore::JSHTMLFormElement::nameGetter): Ditto.
2954
2955         * bindings/js/kjs_dom.h: Removed the DOMNamedNodesCollection. Instead we will use
2956         a class derived from NodeList.
2957         * bindings/js/kjs_dom.cpp: Ditto.
2958
2959         * bindings/js/kjs_html.cpp:
2960         (KJS::VectorNodeList::VectorNodeList): Added. Constructor for a new class derived
2961         from NodeList to be used for the named items result from a collection -- uses a
2962         vector of node pointers.
2963         (KJS::VectorNodeList::length): Added.
2964         (KJS::VectorNodeList::item): Added.
2965         (KJS::JSHTMLCollection::getNamedItems): Use VectorNodeList and the existing wrapper
2966         for NodeList rather than a custom JavaScript class, DOMNamedNodesCollection.
2967
2968         * dom/ChildNodeList.h:
2969         * dom/ChildNodeList.cpp:
2970         (WebCore::ChildNodeList::ChildNodeList): Updated to derive from TreeNodeList,
2971         since NodeList is now a simpler class.
2972         (WebCore::ChildNodeList::elementMatches): Updated for name and parameter change.
2973
2974         * dom/NameNodeList.h:
2975         * dom/NameNodeList.cpp:
2976         (WebCore::NameNodeList::NameNodeList): Updated to derive from TreeNodeList,
2977         since NodeList is now a simpler class.
2978         (WebCore::NameNodeList::rootNodeAttributeChanged): Updated for name and
2979         parameter change.
2980
2981         * dom/Node.h: Change register/unregister functions to take TreeNodeList.
2982         * dom/Node.cpp:
2983         (WebCore::TagNodeList::TagNodeList): Updated to derive from TreeNodeList,
2984         since NodeList is now a simpler abstract class.
2985         (WebCore::TagNodeList::elementMatches): Updated for name and parameter change.
2986         (WebCore::Node::registerNodeList): Changed type from NodeList to TreeNodeList.
2987         (WebCore::Node::unregisterNodeList): Ditto.
2988
2989         * dom/NodeList.h: Broke NodeList into a simpler base class and a derived class
2990         with the machinery for iterating a tree, called TreeNodeList.
2991         * dom/NodeList.cpp:
2992         (WebCore::NodeList::~NodeList): Added.
2993         (WebCore::NodeList::itemWithName): Factored out of the old itemWithName.
2994         (WebCore::TreeNodeList::TreeNodeList): Renamed from NodeList.
2995         (WebCore::TreeNodeList::~TreeNodeList): Ditto.
2996         (WebCore::TreeNodeList::recursiveLength): Ditto.
2997         (WebCore::TreeNodeList::itemForwardsFromCurrent): Ditto.
2998         (WebCore::TreeNodeList::itemBackwardsFromCurrent): Ditto.
2999         (WebCore::TreeNodeList::recursiveItem): Ditto.
3000         (WebCore::TreeNodeList::itemWithName): Factored half of this into this function,
3001         the other half in NodeList::itemWithName.
3002         (WebCore::TreeNodeList::rootNodeAttributeChanged): Added. No longer inline.
3003         (WebCore::TreeNodeList::rootNodeChildrenChanged): Renamed from NodeList.
3004
3005         * html/HTMLFormElement.h: Added formElementNameChanged and oldNamedElement
3006         fucntions, and a map called m_oldNames. Also removed m_boundary, which I
3007         thought I had already done.
3008         * html/HTMLFormElement.cpp:
3009         (WebCore::HTMLFormElement::HTMLFormElement): Initialize m_oldNames to 0.
3010         Switched the rest of the members to initialization syntax.
3011         (WebCore::HTMLFormElement::~HTMLFormElement): Delete m_oldNames.
3012         (WebCore::HTMLFormElement::formElementNameChanged): Added. Stores a reference
3013         to one element under each of its old names.
3014         (WebCore::HTMLFormElement::oldNamedElement): Added. Returns the old element
3015         that once had a given name.
3016
3017         * html/HTMLGenericFormElement.h:
3018         * html/HTMLGenericFormElement.cpp:
3019         (WebCore::HTMLGenericFormElement::parseMappedAttribute): When the name
3020         attribute changes, tell the form about the old name.
3021         (WebCore::HTMLGenericFormElement::insertedIntoTree): When telling a form
3022         about an element, also store away the old name so that we can use it
3023         when the name changes later.
3024
3025         * html/HTMLInputElement.cpp:
3026         (WebCore::HTMLInputElement::parseMappedAttribute): Added a call to the
3027         base class in the nameAttr case, so the code in HTMLGenericFormElement
3028         above will get called in the input element case.
3029
3030 2007-03-13  Antti Koivisto  <antti@apple.com>
3031
3032         Reviewed by Alexey.
3033
3034         Alexey spotted a DOS by using string of 64k unbreakable character in
3035         fix for http://bugs.webkit.org/show_bug.cgi?id=12833
3036
3037         * dom/Text.cpp:
3038         (WebCore::Text::createWithLengthLimit):
3039
3040 2007-03-13  Lars Knoll <lars@trolltech.com>
3041
3042         Fix the Qt build
3043
3044         * WebCore.pro:
3045
3046 2007-03-13  Rob Buis  <buis@kde.org>
3047
3048         Reviewed by Darin.
3049
3050         http://bugs.webkit.org/show_bug.cgi?id=12576
3051         WebKit does not support xlink:show attributes
3052
3053         Make an exception for non-empty targets, these should be opened
3054         in a new window, unless the value is _self.
3055
3056         * ksvg2/svg/SVGAElement.cpp:
3057         (WebCore::SVGAElement::defaultEventHandler):
3058
3059 2007-03-13  David Hyatt  <hyatt@apple.com>
3060
3061         - fix cache issues seen in http://bugs.webkit.org/show_bug.cgi?id=13050
3062           6 objects and ~200MB leaked after opening then closing tab
3063           <rdar://problem/5058714>
3064
3065         Double the encoded size of images for now.  We do this to account for a bug in ImageIO where they hold
3066         a separate copy of image data.  See <rdar://problem/5050645>.
3067
3068         Reviewed by aroben.
3069
3070         * loader/CachedImage.cpp:
3071         (WebCore::CachedImage::data):
3072
3073 2007-03-12  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
3074
3075         Not reviewed - gdk build fix.
3076
3077         * platform/gdk/TemporaryLinkStubs.cpp:
3078         (SearchPopupMenu::enabled): add missing stub.
3079
3080 2007-03-12  David Kilzer  <ddkilzer@kilzer.net>
3081
3082         Reviewed by Darin.
3083
3084         - fix http://bugs.webkit.org/show_bug.cgi?id=13045
3085           REGRESSION: Blackboard CourseWare Error with Nightlies after Mar 8
3086
3087         * html/HTMLFormElement.cpp:
3088         (WebCore::getUniqueBoundaryString): Speculative fix: remove dashes from
3089         the boundary prefix that appear after non-dash characters.
3090
3091 2007-03-12  Mitz Pettel  <mitz@webkit.org>
3092
3093         Reviewed by Anders.
3094
3095         - fix http://bugs.webkit.org/show_bug.cgi?id=13015
3096           REGRESSION (r17233-r17241): Repro crash when leaving a page whose unload handler submits a form
3097
3098         Test: fast/loader/onunload-form-submit-crash-2.html
3099
3100         * loader/DocumentLoader.cpp:
3101         (WebCore::DocumentLoader::finishedLoading): Added null check.
3102
3103 2007-03-12  Anders Carlsson  <acarlsson@apple.com>
3104
3105         Reviewed by Darin.
3106
3107         <rdar://problem/4900071>
3108         http://bugs.webkit.org/show_bug.cgi?id=6454
3109         ASSERTION: Navigating 'back' in frameset: !_private->previousItem (6454)
3110
3111         Change back the behavior of checkLoadComplete to traverse the entire frame tree instead of
3112         just the parent frames of the current frame. This is needed in order to reset the previous history item
3113         for all frames when doing a frame navigation. (This was changed in revision 11819)
3114         
3115         * loader/FrameLoader.cpp:
3116         (WebCore::FrameLoader::recursiveCheckLoadComplete):
3117         (WebCore::FrameLoader::checkLoadComplete):
3118         * loader/FrameLoader.h:
3119
3120 2007-03-12  Justin Garcia  <justin.garcia@apple.com>
3121
3122         Reviewed by darin
3123         
3124         <rdar://problem/5056619> 
3125         REGRESSION: Gmail Editor: Dragging text into Reply (textarea) field results in a crash at WebCore::InsertNodeBeforeCommand::doApply()
3126         
3127         * editing/SelectionController.cpp:
3128         (WebCore::removingNodeRemovesPosition): Added.
3129         (WebCore::SelectionController::nodeWillBeRemoved): Clear the
3130         selection if it's inside a shadow tree.
3131         * page/DragController.cpp:
3132         (WebCore::setSelectionToDragCaret): Return false to signal to
3133         clients that a drop shouldn't be performed if the second attempt
3134         to set a selection ends up in non-editable content.
3135
3136 2007-03-12  Darin Adler  <darin@apple.com>
3137
3138         Reviewed by Tim Hatcher.
3139
3140         - fixed JavaScript wrapper classes to be correct for a variety of cases
3141           that a new test uncovered: was broken for at least 5 classes
3142
3143         - fixed Objective-C wrapper classes to be correct for a variety of cases
3144           that a test case uncovered: was broken for ast least 50 classes
3145
3146         - added missing DOM API for creating OverflowEvent and WheelEvent instances
3147
3148         Test: fast/dom/wrapper-classes.html
3149
3150         * DerivedSources.make: Added missing bindings: HTMLCanvasElement for ObjC,
3151         CDATASection, Comment, and EntityReference for JavaScript.
3152         * WebCore.xcodeproj/project.pbxproj: Added those new generated files.
3153
3154         * bindings/js/JSHTMLElementWrapperFactory.cpp:
3155         (WebCore::createJSHTMLWrapper): Corrected the wrapper classes for <keygen>,
3156         which needs an HTMLSelectElement wrapper, and <xmp>, which needs an
3157         HTMLPreElement wrapper.
3158
3159         * bindings/objc/DOMInternal.h: Updated for new naming scheme.
3160         Also moved createDOMWrapper from the KJS namespace to the WebCore namespace.
3161         * bindings/objc/DOMUtility.mm:
3162         (KJS::createDOMWrapper): Broke the core function into a separate one, and
3163         left it in the KJS namespace because Objective-C++ rules make it impossible
3164         for it to work in the WebCore namespace. Used a macro-based implementation
3165         to cut down on repeated code, and added missing cases for Counter,
3166         HTMLOptionsCollection, Range, XPathExpression, XPathResult, Event, RGBColor,
3167         Rect, Window, DOMImplementation, NodeIterator, TreeWalker, and HTMLCollection.
3168         (WebCore::createDOMWrapper): The other half of the function.
3169
3170         * bindings/objc/DOM.mm:
3171         (WebCore::createElementClassMap): Corrected the wrapper classes for
3172         <canvas>, which needs a DOMHTMLCanvasElement wrapper, <del>, which needs
3173         a DOMHTMLModElement wrapper, <embed>, which needs a DOMHTMLEmbedElement
3174         wrapper, <ins>, which needs a DOMHTMLModElement wrapper, <th>, which needs
3175         a DOMHTMLTableCellElement wrapper, and <xmp>, which needs an
3176         DOMHTMLPreElement wrapper.
3177         (+[DOMNode _wrapNode:]): Updated for new naming scheme.
3178         (+[DOMNode _wrapEventTarget:]): Ditto.
3179         (+[DOMNodeFilter _wrapNodeFilter:]): Ditto.
3180         (ObjCNodeFilterCondition::acceptNode): Ditto.
3181         (-[DOMDocument createNodeIterator:whatToShow:filter:expandEntityReferences:]): Ditto.
3182         (-[DOMDocument createTreeWalker:whatToShow:filter:expandEntityReferences:]): Ditto.
3183         (WebCore::ObjCEventListener::handleEvent): Ditto.
3184
3185         * dom/Document.cpp: (WebCore::Document::createEvent):
3186         Added cases for OverflowEvent and WheelEvent.
3187
3188         * dom/OverflowEvent.h: Added empty constructor and initOverflowEvent.
3189         * dom/OverflowEvent.cpp:
3190         (WebCore::OverflowEvent::OverflowEvent): Added.
3191         (WebCore::OverflowEvent::initOverflowEvent): Added.
3192         * dom/OverflowEvent.idl: Added initOverflowEvent.
3193
3194         * bindings/objc/PublicDOMInterfaces.h: Added initOverflowEvent.
3195
3196         * bindings/objc/DOMCSS.mm:
3197         (+[DOMStyleSheet _wrapStyleSheet:]): Updated for new naming scheme.
3198         (+[DOMCSSRule _wrapCSSRule:]): Corrected wrapper for CSSUnknownRule.
3199         (+[DOMCSSValue _wrapCSSValue:]): Updated for new naming scheme.
3200
3201         * bindings/js/kjs_css.h:
3202         (KJS::DOMRGBColor::impl): Added. Used when making an ObjC wrapper.
3203         (KJS::DOMRect::impl): Ditto.
3204
3205         * bindings/js/kjs_dom.cpp: (KJS::toJS): Corrected the wrapper classes for
3206         CDATASection, Comment, and EntityReference.
3207
3208         * bindings/js/kjs_html.cpp: Corrected the class name for HTMLElement
3209         (was "DOMHTMLElement") and HTMLCollection (was "Collection").
3210
3211         * bindings/objc/DOMImplementationFront.h:
3212         * bindings/objc/DOMImplementationFront.cpp:
3213         (WebCore::implementationFront): Added new overload that returns a front given
3214         a JavaScript wrapper. Needed by the code that makes the Objective-C wrapper.
3215
3216         * bindings/objc/WebScriptObject.mm:
3217         (+[WebScriptObject _convertValueToObjcValue:originRootObject:rootObject:]):
3218         Updated since createDOMWrapper is now in the WebCore namespace.
3219
3220         * bindings/scripts/CodeGeneratorObjC.pm: Update the naming scheme for the
3221         wrapper creation functions to use _wrapElement: rather then _elementWith:
3222         style. Removed now-unneeded special cases for things that needed to stay
3223         upper-case, since we don't have to do the whole lcfirst thing.
3224
3225         * html/HTMLCanvasElement.idl: Added #if so we can successfully generate the
3226         Objective-C wrapper for this class, even though we can't yet handle the
3227         DOMObject return type.
3228
3229         * html/HTMLOptionsCollection.idl: Added GenerateNativeConverter so we get
3230         an appropriate toJS function.
3231
3232         * bindings/objc/DOMEvents.mm:
3233         (+[DOMEvent _wrapEvent:]):
3234         * bindings/objc/DOMHTML.mm:
3235         (-[DOMHTMLDocument createDocumentFragmentWithMarkupString:baseURL:]):
3236         (-[DOMHTMLDocument createDocumentFragmentWithText:]):
3237         * bindings/objc/DOMObject.mm:
3238         (-[DOMObject sheet]):
3239         * bindings/objc/DOMRGBColor.mm:
3240         (-[DOMRGBColor red]):
3241         (-[DOMRGBColor green]):
3242         (-[DOMRGBColor blue]):
3243         (-[DOMRGBColor alpha]):
3244         (+[DOMRGBColor _wrapRGBColor:]):
3245         * bindings/objc/DOMSVGPathSegInternal.mm:
3246         (+[DOMSVGPathSeg _wrapSVGPathSeg:]):
3247         * bindings/objc/DOMXPath.mm:
3248         (+[DOMNativeXPathNSResolver _wrapXPathNSResolver:]):
3249         * page/mac/WebCoreFrameBridge.mm:
3250         (-[WebCoreFrameBridge nodesFromList:]):
3251         (-[WebCoreFrameBridge elementWithName:inForm:]):
3252         (-[WebCoreFrameBridge formForElement:]):
3253         (-[WebCoreFrameBridge currentForm]):
3254         (-[WebCoreFrameBridge controlsInForm:]):
3255         (-[WebCoreFrameBridge rangeByAlteringCurrentSelection:SelectionController::direction:SelectionController::granularity:]):
3256         (-[WebCoreFrameBridge convertNSRangeToDOMRange:]):
3257         (-[WebCoreFrameBridge markDOMRange]):
3258         (-[WebCoreFrameBridge markedTextDOMRange]):
3259         (-[WebCoreFrameBridge smartDeleteRangeForProposedRange:]):
3260         (-[WebCoreFrameBridge documentFragmentWithMarkupString:baseURLString:]):
3261         (-[WebCoreFrameBridge documentFragmentWithText:inContext:]):
3262         (-[WebCoreFrameBridge documentFragmentWithNodesAsParagraphs:]):
3263         (-[WebCoreFrameBridge replaceSelectionWithNode:selectReplacement:smartReplace:matchStyle:]):
3264         (-[WebCoreFrameBridge replaceSelectionWithText:selectReplacement:smartReplace:]):
3265         (-[WebCoreFrameBridge increaseSelectionListLevel]):
3266         (-[WebCoreFrameBridge increaseSelectionListLevelOrdered]):
3267         (-[WebCoreFrameBridge increaseSelectionListLevelUnordered]):
3268         (-[WebCoreFrameBridge dragCaretDOMRange]):
3269         (-[WebCoreFrameBridge editableDOMRangeForPoint:]):
3270         (-[WebCoreFrameBridge characterRangeAtPoint:]):
3271         (-[WebCoreFrameBridge typingStyle]):
3272         (-[WebCoreFrameBridge rangeOfCharactersAroundCaret]):
3273         * platform/mac/ClipboardMac.mm:
3274         (WebCore::ClipboardMac::declareAndWriteDragImage):
3275         * platform/mac/PasteboardMac.mm:
3276         (WebCore::Pasteboard::writeSelection):
3277         Updated for new naming scheme.
3278
3279 2007-03-12  Timothy Hatcher  <timothy@apple.com>
3280
3281         Reviewed by Darin.
3282
3283         <rdar://problem/4990691> REGRESSION: Selecting text in Adium's Messages field causes horizontal shift
3284
3285         Corrected the recursive point conversion and scrolling done in scrollPointRecursively to use the
3286         document view of each NSClipView.
3287
3288         * platform/mac/ScrollViewMac.mm:
3289         (WebCore::ScrollView::scrollPointRecursively): Call convertPoint:fromView: on the document views,
3290         not the clip views as we encounter them. Then call constrainScrollPoint: on the converted point to
3291         constrain to the document view bounds. And finally call scrollPoint: on the document view, not the clip view.
3292
3293 2007-03-12  Antti Koivisto  <antti@apple.com>
3294
3295         Reviewed by Alexey.
3296
3297         Fix http://bugs.webkit.org/show_bug.cgi?id=12833
3298         REGRESSION: Selecting text in 6.6MB txt file is sluggish as of the Feb 19th nightly
3299         <rdar://problem/5028159>
3300         
3301         Divide large text blocks (>64kB) over multiple text nodes. This limits linebox searches to
3302         a manageable subset.
3303         
3304         * dom/Text.cpp:
3305         (WebCore::Text::createWithLengthLimit):
3306         * dom/Text.h:
3307         * html/HTMLParser.cpp:
3308         (WebCore::HTMLParser::parseToken):
3309         * loader/TextDocument.cpp:
3310         (WebCore::TextTokenizer::write):
3311
3312 2007-03-12  David Hyatt  <hyatt@apple.com>
3313
3314         Fix a regression in printing.  Printer fonts need to be part of the
3315         font cache key, since printer fonts have different glyph widths.
3316         (Integer antialiasing is used for screen fonts but not for printer fonts.)
3317
3318         Reviewed by aroben
3319
3320         * platform/FontCache.cpp:
3321         (WebCore::FontPlatformDataCacheKey::FontPlatformDataCacheKey):
3322         (WebCore::FontPlatformDataCacheKey::operator==):
3323         (WebCore::computeHash):
3324         (WebCore::FontCache::getCachedFontPlatformData):
3325
3326 2007-03-12  Lars Knoll <lars@trolltech.com>
3327
3328         add missing symbol to fix the Qt build again.
3329
3330         * platform/qt/SearchPopupMenuQt.cpp:
3331         (WebCore::SearchPopupMenu::enabled):
3332
3333 2007-03-12  Adele Peterson  <adele@apple.com>
3334
3335         Reviewed by Oliver.
3336
3337         Adding the ability to enable or disable a SearchPopupMenu.
3338
3339         * platform/SearchPopupMenu.h:
3340         * platform/mac/SearchPopupMenuMac.mm: (WebCore::SearchPopupMenu::enabled):
3341         * rendering/RenderTextControl.cpp: (WebCore::RenderTextControl::showPopup):
3342
3343 2007-03-12  Rob Buis  <buis@kde.org>
3344
3345         Reviewed by Nikolas Zimmermann.
3346
3347         http://bugs.webkit.org/show_bug.cgi?id=12500
3348         SVG fails to correctly handle all link style selectors
3349         http://bugs.webkit.org/show_bug.cgi?id=12567
3350         <text> elements ignore <a> children
3351
3352         Allow <a> inside svg text and handle xlink:show.
3353
3354         * ksvg2/svg/SVGAElement.cpp:
3355         (WebCore::SVGAElement::createRenderer):
3356         (WebCore::SVGAElement::defaultEventHandler):
3357         (WebCore::SVGAElement::childShouldCreateRenderer):
3358         * ksvg2/svg/SVGAElement.h:
3359         * ksvg2/svg/SVGElement.h:
3360         (WebCore::SVGElement::isTextContent):
3361         * ksvg2/svg/SVGTextContentElement.h:
3362         (WebCore::SVGTextContentElement::isTextContent):
3363         * ksvg2/svg/SVGTextElement.cpp:
3364         (WebCore::SVGTextElement::childShouldCreateRenderer):
3365         * rendering/SVGInlineFlowBox.cpp:
3366         (WebCore::translateBox):
3367         (WebCore::placePositionedBoxesHorizontally):
3368         (WebCore::placeBoxesVerticallyWithAbsBaseline):
3369
3370 2007-03-12  Adele Peterson  <adele@apple.com>
3371
3372         Reviewed by Oliver.
3373
3374         Add a missing parameter to the constructor.
3375
3376         * platform/PlatformKeyboardEvent.h:
3377         * platform/win/KeyEventWin.cpp: (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
3378
3379 2007-03-12  Lars Knoll <lars@trolltech.com>
3380
3381         Fix the Qt build. I still get crashes though :/
3382
3383         * platform/graphics/qt/ImageDecoderQt.cpp:
3384         (WebCore::ImageDecoderQt::clearFrame):
3385         * platform/graphics/qt/ImageDecoderQt.h:
3386         * platform/graphics/qt/ImageSourceQt.cpp:
3387         (WebCore::ImageSource::setData):
3388         (WebCore::ImageSource::frameIsCompleteAtIndex):
3389         (WebCore::ImageSource::clear):
3390         (WebCore::ImageSource::destroyFrameAtIndex):
3391         * platform/qt/ClipboardQt.cpp:
3392         (WebCore::ClipboardQt::ClipboardQt):
3393         * platform/qt/ClipboardQt.h:
3394         * platform/qt/DragDataQt.cpp:
3395         (WebCore::DragData::createClipboard):
3396
3397 2007-03-11  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
3398
3399         Not reviewed - gdk build fixes.
3400
3401         * platform/gdk/EditorClientGdk.cpp:
3402         (WebCore::EditorClientGdk::respondToChangedSelection): add stub
3403         * platform/gdk/EditorClientGdk.h:
3404         * platform/gdk/FrameGdk.cpp:
3405         * platform/gdk/TemporaryLinkStubs.cpp:
3406         (Editor::markMisspellings): add stub
3407
3408 2007-03-11  Alexey Proskuryakov  <ap@webkit.org>
3409
3410         Reviewed by Adele.
3411
3412         http://bugs.webkit.org/show_bug.cgi?id=12560
3413         W3C XPath test Text_Nodes.svg fails
3414
3415         * xml/XPathStep.cpp:
3416         (WebCore::XPath::Step::nodeTestMatches): Revert the fix, as the behavior doesn't appear 
3417         all that desirable as it did at first glance.
3418
3419 2007-03-11  Oliver Hunt  <oliver@apple.com>
3420
3421         Reviewed by hyatt.
3422
3423         Fix for <rdar://problem/5055690> ASSERTION failure on drop into 
3424         editable element with content changed on drop 
3425
3426         After setting the selection for a drop into an editable region 
3427         we make sure the we succeeded.  If we didn't we assume a focus handler
3428         or similar altered the element contents and try again, if the second
3429         attempt fails we bail out.
3430
3431         * page/DragController.cpp:
3432         (WebCore::setSelectionToDragCaret):
3433         (WebCore::DragController::concludeDrag):
3434
3435 2007-03-11  Oliver Hunt  <oliver@apple.com>
3436
3437         Reviewed by Adele.
3438
3439         Moving Frame{Mac}::respondToChangedSelection to Frame.cpp
3440         Added new EditorClient method to handle old bridge function
3441         
3442         * bridge/EditorClient.h:
3443            Added respondToChangedSelection to replace old bridge function
3444         * editing/Editor.cpp:
3445         (WebCore::Editor::respondToChangedSelection):
3446            Add client call to replace old bridge call from Frame::respondToChangedSelection
3447         * editing/SelectionController.cpp:
3448         (WebCore::SelectionController::setSelection):
3449            No longer directly call Editor as Frame::respondToChangedSelection
3450            makes the call
3451         * page/Frame.cpp:
3452         (WebCore::Frame::respondToChangedSelection):
3453            Moved from FrameMac, replaced bridge call with call to Editor
3454         * page/mac/FrameMac.mm:
3455            Moved respondToChangedSelection to Frame.cpp
3456         * page/mac/WebCoreFrameBridge.h:
3457            Removed respondToChangedSelection from bridge
3458         * page/qt/FrameQt.cpp:
3459            Remove stub method for respondToChangedSelection
3460
3461 2007-03-11  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
3462
3463         Reviewed by Brady Eidson.
3464
3465         Linux/gdk fix.
3466
3467         * loader/gdk/FrameLoaderClientGdk.cpp:
3468         (WebCore::FrameLoaderClientGdk::shouldGoToHistoryItem): return true so
3469         that FrameLoader:goBackOrForwards() works.
3470
3471 2007-03-10  Geoffrey Garen  <ggaren@apple.com>
3472
3473         Reviewed by Darin Adler.
3474
3475         Fixed <rdar://problem/4587763> PAC file: lock inversion between QT and 
3476         JSCore causes a hang @ www.panoramas.dk
3477         
3478         See JavaScriptCore ChangeLog for details.
3479         
3480         * bindings/objc/WebScriptObject.mm:
3481         (_didExecute): Added helpful ASSERT.
3482         (+[WebScriptObject throwException:]): Added missing JSLock.
3483
3484 2007-03-11  Antti Koivisto  <antti@apple.com>
3485
3486         Reviewed by Hyatt.
3487
3488         Optimize linebox memory consumption:
3489         - move all bitfields to baseclass compacting them
3490         - make InlineTextBox::m_truncation unsigned short and make it relative to m_start
3491         - remove extremely rarely used EllipsisBox pointer from RootInlineBox and instead
3492           use a global hashmap to store it if needed
3493         - use minimum required number of bits to store BidiStatus enum variables in RootInlineBox
3494         - move overflow variables in RootInlineBox to a separate struct that is instantiated
3495           only if any of the variables is set to a value that can't trivially be derived from 
3496           box x, y, width and height
3497           
3498         As a result line box objects shrink:
3499             InlineBox: 44 -> 44 bytes
3500             InlineTextBox: 68 -> 60 bytes
3501             InlineFlowBox: 68 -> 64 bytes
3502             RootInlineBox: 128 -> 88 bytes
3503             
3504         The optimizations possiblity was noticed when debugging http://bugs.webkit.org/show_bug.cgi?id=12833
3505         Bug 12833: REGRESSION: Selecting text in 6.6MB txt file is sluggish as of the Feb 19th nightly
3506         <rdar://problem/5028159>
3507         
3508         On that page the patch saves 11.5MB or some 21% of linebox memory consumption. It also
3509         actually improves selection performance somewhat by improving memory locality.
3510
3511         * rendering/InlineBox.h:
3512         (WebCore::InlineBox::InlineBox):
3513         * rendering/InlineFlowBox.h:
3514         (WebCore::InlineFlowBox::InlineFlowBox):
3515         * rendering/InlineTextBox.cpp:
3516         (WebCore::InlineTextBox::placeEllipsisBox):
3517         (WebCore::InlineTextBox::nodeAtPoint):
3518         (WebCore::InlineTextBox::paint):
3519         (WebCore::InlineTextBox::paintDecoration):
3520         (WebCore::InlineTextBox::paintSpellingOrGrammarMarker):
3521         (WebCore::InlineTextBox::paintMarkedTextUnderline):
3522         * rendering/InlineTextBox.h:
3523         (WebCore::InlineTextBox::InlineTextBox):
3524         * rendering/RootInlineBox.cpp:
3525         (WebCore::throw):
3526         (WebCore::RootInlineBox::Overflow::operator delete):
3527         (WebCore::RootInlineBox::Overflow::destroy):
3528         (WebCore::RootInlineBox::destroy):
3529         (WebCore::RootInlineBox::detachEllipsisBox):
3530         (WebCore::RootInlineBox::clearTruncation):
3531         (WebCore::RootInlineBox::placeEllipsis):
3532         (WebCore::RootInlineBox::paintEllipsisBox):
3533         (WebCore::RootInlineBox::addHighlightOverflow):
3534         (WebCore::RootInlineBox::nodeAtPoint):
3535         (WebCore::RootInlineBox::adjustPosition):
3536         (WebCore::RootInlineBox::selectionTop):
3537         (WebCore::RootInlineBox::setLineBreakInfo):
3538         (WebCore::RootInlineBox::ellipsisBox):
3539         (WebCore::RootInlineBox::setVerticalOverflowPositions):
3540         (WebCore::RootInlineBox::setHorizontalOverflowPositions):
3541         (WebCore::RootInlineBox::setVerticalSelectionPositions):
3542         * rendering/RootInlineBox.h: