2008-03-26 Mark Rowe <mrowe@apple.com>
[WebKit-https.git] / WebCore / ChangeLog
1 2008-03-26  Mark Rowe  <mrowe@apple.com>
2
3         Reviewed by David Hyatt.
4
5         Make the Ahem font antialias correctly on Acid3 on Tiger.
6
7         * WebCore.Tiger.exp:
8         * platform/graphics/mac/SimpleFontDataMac.mm:
9         (WebCore::SimpleFontData::platformInit):
10         * platform/mac/WebCoreSystemInterface.h:
11         * platform/mac/WebCoreSystemInterface.mm:
12
13 2008-03-26  Simon Hausmann  <hausmann@webkit.org>
14
15         Attempt to fix the Qt build.
16
17         * platform/text/qt/TextCodecQt.cpp: Adjust function signature.
18         (WebCore::TextCodecQt::decode):
19         * platform/text/qt/TextCodecQt.h: Ditto.
20
21 2008-03-26  Dan Bernstein  <mitz@apple.com>
22
23         Reviewed by Anders Carlsson.
24
25         - fix http://bugs.webkit.org/show_bug.cgi?id=18104
26           REGRESSION: LEAK: 2 InlineBox in editing/inserting/12882.html
27
28         * rendering/bidi.cpp:
29         (WebCore::RenderBlock::layoutInlineChildren): When deciding to ditch
30         old clean lines (due to changed or newly-added floats), keep the
31         reference to those lines so they can be properly deleted in the end,
32         and use a separate flag to signal that no matching should be attempted.
33
34 2008-03-26  Mark Rowe  <mrowe@apple.com>
35
36         Speculative Windows build fix.
37
38         * platform/graphics/win/SimpleFontDataCGWin.cpp:
39
40 2008-03-25  Steve Falkenburg  <sfalken@apple.com>
41
42         Turn on link-time-codegen in html and rendering related files.
43
44         Reviewed by Oliver.
45
46         * WebCore.vcproj/WebCore.vcproj:
47
48 2008-03-26  Maciej Stachowiak  <mjs@apple.com>
49
50         Reviewed by Darin.
51
52         - fixed "SVG multichar glyph matching matches longest instead of first (affects Acid3 test 79)"
53         http://bugs.webkit.org/show_bug.cgi?id=18118
54
55         * svg/SVGFont.cpp:
56         (WebCore::SVGTextRunWalker::walk):
57         * svg/SVGFontElement.cpp:
58         (WebCore::SVGFontElement::SVGFontElement):
59         (WebCore::SVGFontElement::addGlyphToCache):
60         (WebCore::SVGFontElement::removeGlyphFromCache):
61         (WebCore::SVGFontElement::ensureGlyphCache):
62         (WebCore::SVGFontElement::getGlyphIdentifiersForString):
63         * svg/SVGFontElement.h:
64         * svg/SVGGlyphElement.h:
65         (WebCore::SVGGlyphIdentifier::SVGGlyphIdentifier):
66         * svg/SVGGlyphMap.h: Added. New radix tree based glyph map.
67         (WebCore::GlyphMapNode::GlyphMapNode):
68         (WebCore::SVGGlyphMap::SVGGlyphMap):
69         (WebCore::SVGGlyphMap::add):
70         (WebCore::SVGGlyphMap::compareGlyphPriority):
71         (WebCore::SVGGlyphMap::get):
72         (WebCore::SVGGlyphMap::clear):
73
74 2008-03-26  David Hyatt  <hyatt@apple.com>
75
76         Fix build bustage on Tiger.  Tiger will not have the bug fix.
77
78         * platform/graphics/mac/SimpleFontDataMac.mm:
79         (WebCore::SimpleFontData::platformInit):
80         * platform/graphics/win/SimpleFontDataCGWin.cpp:
81         (WebCore::SimpleFontData::platformInit):
82
83 2008-03-26  David Hyatt  <hyatt@apple.com>
84
85         Make the Ahem font antialias correctly on Acid3.
86
87         Reviewed by Dan
88
89         * platform/graphics/SimpleFontData.h:
90         * platform/graphics/mac/FontMac.mm:
91         (WebCore::Font::drawGlyphs):
92         * platform/graphics/mac/SimpleFontDataMac.mm:
93         (WebCore::SimpleFontData::platformInit):
94         * platform/graphics/win/FontCGWin.cpp:
95         (WebCore::Font::drawGlyphs):
96         * platform/graphics/win/SimpleFontDataCGWin.cpp:
97         (WebCore::SimpleFontData::platformInit):
98
99 2008-03-26  Mark Rowe  <mrowe@apple.com>
100
101         Fix the Mac build.
102
103         * WebCore.xcodeproj/project.pbxproj:  Copy the newly generated header into the right place.
104
105 2008-03-26  Adam Roben  <aroben@apple.com>
106
107         Fix Bug 17768: REGRESSION (r30146): Inspector no longer shows elements
108         properties
109
110         <http://bugs.webkit.org/show_bug.cgi?id=17768>
111
112         We were throwing an exception from Object.describe because of some
113         undefined variables.
114
115         Reviewed by Tim Hatcher.
116
117         * page/inspector/utilities.js:
118         (Object.describe): Reinstate the type1 and type2 variables that were
119         removed in r30146. They're still used when formatting a function.
120
121 2008-03-26  Eric Seidel  <eric@webkit.org>
122
123         Reviewed by darin.
124
125         Forgot to add braces darin asked for during review.
126
127         * dom/XMLTokenizer.cpp:
128         (WebCore::XMLTokenizer::write):
129
130 2008-03-26  Eric Seidel  <eric@webkit.org>
131
132         Reviewed by darin.
133
134         Fix, makes us pass Test 70
135         XML documents should be strict about encoding checks
136         http://bugs.webkit.org/show_bug.cgi?id=17079
137
138         Test: fast/encoding/invalid-xml.html
139
140         * WebCore.base.exp:
141         * dom/XMLTokenizer.cpp:
142         (WebCore::XMLTokenizer::write):
143         * loader/CachedFont.cpp:
144         (WebCore::CachedFont::ensureSVGFontData):
145         * loader/TextResourceDecoder.cpp:
146         (WebCore::TextResourceDecoder::TextResourceDecoder):
147         (WebCore::TextResourceDecoder::decode):
148         * loader/TextResourceDecoder.h:
149         * platform/text/TextCodec.h:
150         (WebCore::TextCodec::decode):
151         * platform/text/TextCodecICU.cpp:
152         (WebCore::TextCodecICU::decodeToBuffer):
153         (WebCore::ErrorCallbackSetter::ErrorCallbackSetter):
154         (WebCore::ErrorCallbackSetter::~ErrorCallbackSetter):
155         (WebCore::TextCodecICU::decode):
156         * platform/text/TextCodecICU.h:
157         * platform/text/TextCodecLatin1.cpp:
158         * platform/text/TextCodecLatin1.h:
159         * platform/text/TextCodecUTF16.cpp:
160         * platform/text/TextCodecUTF16.h:
161         * platform/text/TextCodecUserDefined.cpp:
162         * platform/text/TextCodecUserDefined.h:
163         * platform/text/TextDecoder.cpp:
164         (WebCore::TextDecoder::checkForBOM):
165         * platform/text/TextDecoder.h:
166         (WebCore::TextDecoder::decode):
167         * platform/text/TextEncoding.cpp:
168         (WebCore::TextEncoding::decode):
169         * platform/text/TextEncoding.h:
170         (WebCore::TextEncoding::decode):
171         * platform/text/mac/TextCodecMac.cpp:
172         (WebCore::TextCodecMac::decode):
173         * platform/text/mac/TextCodecMac.h:
174
175 2008-03-26  Antti Koivisto  <antti@apple.com>
176
177         Reviewed by Adam.
178
179         Add ElementTimeControl interface to SVGAnimationElement.
180         Passes Acid3 test 75.
181
182         * DerivedSources.make:
183         * WebCore.pro:
184         * WebCore.vcproj/WebCore.vcproj:
185         * WebCore.xcodeproj/project.pbxproj:
186         * bindings/scripts/CodeGeneratorObjC.pm:
187         * svg/ElementTimeControl.h: Added.
188         (WebCore::ElementTimeControl::~ElementTimeControl):
189         * svg/ElementTimeControl.idl: Added.
190         * svg/SVGAnimationElement.cpp:
191         (WebCore::SVGAnimationElement::beginElement):
192         (WebCore::SVGAnimationElement::beginElementAt):
193         (WebCore::SVGAnimationElement::endElement):
194         (WebCore::SVGAnimationElement::endElementAt):
195         * svg/SVGAnimationElement.h:
196         * svg/SVGAnimationElement.idl:
197
198 2008-03-26  Kevin McCullough  <kmccullough@apple.com>
199
200         - LayoutTest fix.  Null check.
201
202         * xml/XMLHttpRequest.cpp:
203         (WebCore::XMLHttpRequest::send):
204
205 2008-03-26  Dan Bernstein  <mitz@apple.com>
206
207         Reviewed by Darin Adler.
208
209         - fix http://bugs.webkit.org/show_bug.cgi?id=17994
210           REGRESSION (523-525+) View not updated when changing CSS size via JavaScript
211         - fix http://bugs.webkit.org/show_bug.cgi?id=18063
212           REGRESSION (r31250): Small bug that just cropped up in WebKit r31275
213
214         Tests: fast/repaint/subtree-root-clip.html
215                fast/repaint/subtree-root-clip-2.html
216                fast/repaint/subtree-root-clip-3.html
217
218         * rendering/LayoutState.cpp:
219         (WebCore::LayoutState::LayoutState): Changed to not set an initial clip.
220         Since the root is clipping, there is no need to set a clip, and setting
221         the clip based on the container was wrong because often the root was
222         not included in the container's overflow rect because it had its own
223         layer.
224         * rendering/RenderBox.cpp:
225         (WebCore::RenderBox::absolutePosition): Removed code that added table
226         cell's extra top offset only in the slow (recursive) code path.
227         * rendering/RenderTableCell.cpp:
228         (WebCore::RenderTableCell::absolutePosition): Added code to add the
229         extra top offset in both code paths.
230
231 2008-03-26  Simon Hausmann  <hausmann@webkit.org>
232
233         Fix the Qt build.
234
235         * platform/graphics/qt/FontQt.cpp:
236         (WebCore::Font::floatWidth):
237
238 2008-03-24  Maciej Stachowiak  <mjs@apple.com>
239
240         Reviewed by Eric.
241
242         - fixed "SVGTextElement.getStartPositionOfChar does not correctly account for multichar glyphs"
243         http://bugs.webkit.org/show_bug.cgi?id=18046
244
245         * platform/graphics/Font.cpp:
246         (WebCore::Font::floatWidth): Allow expressing a run that has extra "context" characters beyond the end,
247         and reporting of how many characters were actually consumed, to support multichar glyphs in SVG fonts.
248         * platform/graphics/Font.h:
249         * rendering/SVGInlineTextBox.cpp:
250         (WebCore::SVGInlineTextBox::calculateGlyphWidth): Pass along extra chars in argument and chars consumed out
251         argument.
252         (WebCore::SVGInlineTextBox::calculateGlyphHeight): Pass along extra chars in argument.
253         (WebCore::SVGInlineTextBox::calculateGlyphBoundaries): Add boilerplate; may not handle multichar glyphs
254         right but I don't know what effects this would have.
255         * rendering/SVGInlineTextBox.h:
256         * rendering/SVGRootInlineBox.cpp:
257         (WebCore::cummulatedWidthOrHeightOfTextChunk): Add boilerplate; may not handle multichar glyphs right
258         but again I am not sure what effect this would have.
259         (WebCore::SVGRootInlineBox::buildLayoutInformationForTextBox): Account for multichar glyphs - let glyph
260         selection consider extra chars, and account for the fact that a glyph may have consumed multiple chars.
261         * rendering/SVGRootInlineBox.h:
262         * svg/SVGFont.cpp:
263         (WebCore::SVGTextRunWalker::walk): This is the place where glyph selection happens, so this is where
264         we accout for multichar glyphs (both looking at extra chars past the end of the run, and reporting how
265         many chars were consumed).
266         (WebCore::floatWidthOfSubStringUsingSVGFont): Pass aforementioned info through the layers.
267         (WebCore::Font::floatWidthUsingSVGFont): ditto
268         (WebCore::Font::drawTextUsingSVGFont): ditto
269         (WebCore::Font::selectionRectForTextUsingSVGFont): ditto
270         * svg/SVGTextContentElement.cpp:
271         (WebCore::cummulatedCharacterRangeLength): ditto
272         (WebCore::SVGInlineTextBoxQueryWalker::chunkPortionCallback): ditto
273
274 2008-03-25  Beth Dakin  <bdakin@apple.com>
275
276         Reviewed by Oliver.
277
278         Fix for <rdar://problem/5811826> CSSValueList::item() does not 
279         range-check index
280
281         Check bounds before accessing the item to avoid a crash. 
282         itemWithoutBoundsCheck() is still inlined and not bounds-checked to 
283         avoid slowing down our internal callers of item().
284         * css/CSSValueList.cpp:
285         (WebCore::CSSValueList::item):
286         * css/CSSValueList.h:
287         (WebCore::CSSValueList::itemWithoutBoundsCheck):
288
289         Call itemWithoutBoundsCheck() to avoid slowing down these internal 
290         callers.
291         * css/CSSFontSelector.cpp:
292         (WebCore::CSSFontSelector::addFontFaceRule):
293         * css/CSSMutableStyleDeclaration.cpp:
294         (WebCore::CSSMutableStyleDeclaration::getLayeredShorthandValue):
295         * css/CSSStyleSelector.cpp:
296         (WebCore::applyCounterList):
297         (WebCore::CSSStyleSelector::applyProperty):
298         * css/MediaQueryEvaluator.cpp:
299         (WebCore::parseAspectRatio):
300         * svg/SVGFontFaceElement.cpp:
301         (WebCore::SVGFontFaceElement::rebuildFontFace):
302         * svg/graphics/SVGPaintServer.cpp:
303         (WebCore::dashArrayFromRenderingStyle):
304
305 2008-03-25  Antti Koivisto  <antti@apple.com>
306
307         Reviewed by Oliver.
308
309         Fix http://bugs.webkit.org/show_bug.cgi?id=18082
310         REGRESSION (r31287): GMail does not work if user stylesheet is set
311         
312         Oops, my cache refactoring patch was missing these rather essential lines for
313         user stylesheets. They would get reloaded repeatedly.
314
315         * loader/Cache.cpp:
316         (WebCore::Cache::requestUserCSSStyleSheet):
317
318 2008-03-25  Matt Lilek  <webkit@mattlilek.com>
319
320         Rubber stamped by Adam
321
322         Roll out r31300 since it causes assertion failures on page load.
323         See http://bugs.webkit.org/show_bug.cgi?id=18093
324
325         * page/InspectorController.cpp:
326         (WebCore::InspectorController::didFinishLoading):
327         (WebCore::InspectorController::didFailLoading):
328
329 2008-03-25  Darin Adler  <darin@apple.com>
330
331         Reviewed by Anders.
332
333         - fix http://bugs.webkit.org/show_bug.cgi?id=17252
334           Acid3 test removing Nodes during NodeIterator walk fails (affects Acid3 test 2)
335
336         Test: traversal/acid3-test-2.html
337
338         * bindings/js/JSNodeIteratorCustom.cpp:
339         (WebCore::JSNodeIterator::nextNode): Update since result is PassRefPtr.
340         (WebCore::JSNodeIterator::previousNode): Ditto.
341         * dom/NodeIterator.cpp:
342         (WebCore::NodeIterator::nextNode): Changed result to PassRefPtr. Added code to
343         track both the current candidate (which needs to move along to the next node
344         if current node is deleted) and the current provisional result (passed to acceptNode,
345         and needs to be returned even if it's deleted).
346         (WebCore::NodeIterator::previousNode): Ditto.
347         (WebCore::NodeIterator::nodeWillBeRemoved): Call updateForNodeRemoval for
348         m_candidateNode as well as m_referenceNode.
349         * dom/NodeIterator.h: Use PassRefPtr for return values.
350
351 2008-03-25  Brady Eidson  <beidson@apple.com>
352
353         Reviewed by Anders
354
355         Add the ability to transform a CString into a SharedBuffer to avoid copying data
356         This is valuable to avoid copying a block of data for an upcoming patch
357
358         * platform/SharedBuffer.cpp:
359         (WebCore::SharedBuffer::adoptVector):
360         * platform/SharedBuffer.h:
361
362         * platform/text/CString.cpp:
363         (WebCore::CString::releaseBuffer):
364         * platform/text/CString.h:
365         (WebCore::CStringBuffer::releaseBuffer):
366
367 2008-03-25  Brady Eidson  <beidson@apple.com>
368
369         Attempt to fix .bkl build systems after recent archive additions
370
371         * webcore-base.bkl:
372
373 2008-03-25  Kevin McCullough  <kmccullough@apple.com>
374
375         Reviewed by Adam.
376
377         - Cleaned up the needless use of RefPtrs, which we may someday no longer use for
378         InspectorResources.
379
380         * page/InspectorController.cpp:
381         (WebCore::InspectorController::didFinishLoading):
382         (WebCore::InspectorController::didFailLoading):
383
384 2008-03-25  Kevin McCullough  <kmccullough@apple.com>
385
386         Reviewed by Adam.
387
388         - Added a null check
389
390         * xml/XMLHttpRequest.cpp: Null check
391         (WebCore::XMLHttpRequest::send):
392
393 2008-03-25  Kevin McCullough  <kmccullough@apple.com>
394
395         Reviewed by Tim.
396
397         -<rdar://problem/5712804> XMLHttpRequests do not show response contents, preview images (14313)
398         -<rdar://problem/5712931> XMLHttpRequests should be shown separately and grouped (14315)
399         -<rdar://problem/5732836> XMLHttpRequest: Inspector should show network activity/XHR in Console (17233)
400         - XMLHttpRequestResources now identify themselves to the inspector which caches the data related to
401         the request since no one else caches it.  However this is just the plumbing and the Inspector's UI
402         has not been changed to show XHR resources yet. 
403
404         * page/InspectorController.cpp: Add ability to set XHR data on an InspectorResource.
405         (WebCore::XMLHttpRequestResource::XMLHttpRequestResource):
406         (WebCore::XMLHttpRequestResource::data):
407         (WebCore::XMLHttpRequestResource::encoding):
408         (WebCore::InspectorResource::): Add new type.
409         (WebCore::InspectorResource::~InspectorResource): No longer virtual since we are not using inheritance.
410         (WebCore::InspectorResource::type): Ditto.
411         (WebCore::InspectorResource::setXMLHttpRequestResource):
412         (WebCore::InspectorResource::isXHR):
413         (WebCore::InspectorResource::xmlHttpRequestData):
414         (WebCore::InspectorResource::xmlHttpRequestEncoding):
415         (WebCore::InspectorResource::InspectorResource):
416         (WebCore::addSourceToFrame):
417         (WebCore::InspectorController::resourceRetrievedByXMLHttpRequest):
418         * page/InspectorController.h: Add accessor for setting the XHR data.
419         * page/inspector/Resource.js: Keep the XHR resource types in sync with the Inspector Controller.
420         * xml/XMLHttpRequest.cpp: Give the InspectorController the XHR information to cache.
421         (WebCore::XMLHttpRequest::send):
422
423 2008-03-25  Adam Roben  <aroben@apple.com>
424
425         Add an UnusedParam.h forwarding header for use by testapi
426
427         Reviewed by Steve Falkenburg.
428
429         * ForwardingHeaders/wtf/UnusedParam.h: Added.
430
431 2008-03-25  Brady Eidson  <beidson@apple.com>
432
433         Reviewed by Adam Roben
434
435         <rdar://problem/5819308> - View Source is empty when view webarchives
436
437         * WebCore.base.exp:
438         * loader/DocumentLoader.cpp:
439         (WebCore::DocumentLoader::setParsedArchiveData):
440         (WebCore::DocumentLoader::parsedArchiveData):
441         * loader/DocumentLoader.h:
442
443         * loader/FrameLoader.cpp:
444         (WebCore::FrameLoader::finishedLoadingDocument): Set the archive's MainResource data as the parsedArchiveData
445           in the DocumentLoader
446
447 2008-03-25  Eric Seidel  <eric@webkit.org>
448
449         Reviewed by Oliver.
450
451         Speculative crash fix for Acid3 crasher.
452         I couldn't figure out how to make a test case for this?
453         Suggestions welcome.
454
455         * css/CSSFontSelector.cpp: null check document->renderer()
456
457 2008-03-25  Antti Koivisto  <antti@apple.com>
458
459         Reviewed by Geoff Garen.
460
461         Some memory cache cleanups:
462         - Separate CachedResource loading from construction, initiate load using a separate load() method.
463         - Add special case function to Cache for loading user stylesheets. This allows removal
464           of a bunch of parameters from several methods and CachedResource constructors.
465         - Construct CachedResources with m_inCache set to false which is quite a bit more logical as they
466           are not yet in the cache at that point.
467         - Pass encoding around as const String& instead of const String*.
468
469         * css/CSSImageValue.cpp:
470         (WebCore::CSSImageValue::image):
471         * html/HTMLImageLoader.cpp:
472         (WebCore::HTMLImageLoader::updateFromElement):
473         * loader/Cache.cpp:
474         (WebCore::createResource):
475         (WebCore::Cache::requestResource):
476         (WebCore::Cache::requestUserCSSStyleSheet):
477         (WebCore::Cache::remove):
478         * loader/Cache.h:
479         * loader/CachedCSSStyleSheet.cpp:
480         (WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet):
481         * loader/CachedCSSStyleSheet.h:
482         * loader/CachedFont.cpp:
483         (WebCore::CachedFont::CachedFont):
484         (WebCore::CachedFont::load):
485         (WebCore::CachedFont::ref):
486         * loader/CachedFont.h:
487         * loader/CachedImage.cpp:
488         (WebCore::CachedImage::CachedImage):
489         (WebCore::CachedImage::load):
490         * loader/CachedImage.h:
491         * loader/CachedResource.cpp:
492         (WebCore::CachedResource::CachedResource):
493         (WebCore::CachedResource::~CachedResource):
494         (WebCore::CachedResource::load):
495         * loader/CachedResource.h:
496         (WebCore::CachedResource::load):
497         * loader/CachedScript.cpp:
498         (WebCore::CachedScript::CachedScript):
499         * loader/CachedScript.h:
500         * loader/CachedXBLDocument.cpp:
501         (WebCore::CachedXBLDocument::CachedXBLDocument):
502         * loader/CachedXBLDocument.h:
503         * loader/CachedXSLStyleSheet.cpp:
504         (WebCore::CachedXSLStyleSheet::CachedXSLStyleSheet):
505         * loader/CachedXSLStyleSheet.h:
506         * loader/DocLoader.cpp:
507         (WebCore::DocLoader::requestImage):
508         (WebCore::DocLoader::requestFont):
509         (WebCore::DocLoader::requestCSSStyleSheet):
510         (WebCore::DocLoader::requestUserCSSStyleSheet):
511         (WebCore::DocLoader::requestScript):
512         (WebCore::DocLoader::requestXSLStyleSheet):
513         (WebCore::DocLoader::requestXBLDocument):
514         (WebCore::DocLoader::requestResource):
515         (WebCore::DocLoader::preload):
516         * loader/DocLoader.h:
517
518 2008-03-25  Darin Adler  <darin@apple.com>
519
520         Reviewed by Anders.
521
522         - avoid converting UString to String and then later to AtomicString
523
524         1% speedup on Acid3 test 26
525
526         This is inefficient for the case where there's already an AtomicString.
527         By first creating and destroying a String we waste time.
528
529         * bindings/scripts/CodeGeneratorJS.pm: Use const UString& for string
530         arguments rather than using String; this uses the object as it's produced
531         from toString rather than creating a new temporary object that might not
532         be of the right type. The type conversion happens at the callsite instead.
533         Also eliminate the ability to use the type AtomicString from IDL.
534
535         * dom/KeyboardEvent.idl: AtomicString -> DOMString.
536         * dom/MouseEvent.idl: Ditto.
537         * dom/MutationEvent.idl: Ditto.
538         * dom/UIEvent.idl: Ditto.
539         * svg/SVGStyleElement.idl: Ditto.
540
541 2008-03-25  Brady Eidson  <beidson@apple.com>
542
543         Build fix for non-CoreFoundation platforms
544
545         * loader/archive/ArchiveFactory.cpp:
546
547 2008-03-25  Brady Eidson  <beidson@apple.com>
548
549         Reviewed by Darin
550
551         Remove newly obsolete FrameLoaderClient methods
552
553         * loader/FrameLoaderClient.h:
554         * svg/graphics/SVGImageEmptyClients.h:
555         (WebCore::SVGEmptyFrameLoaderClient::setMainDocumentError):
556         (WebCore::SVGEmptyFrameLoaderClient::finishedLoading):
557
558 2008-03-25  Brady Eidson  <beidson@apple.com>
559
560         Reviewed by Darin
561
562         <rdar://problem/4516169> - Support WebArchives on Windows
563         And pave the way for many future WebArchive bug fixes and enhancements
564
565         This patch accomplishes two main goals:
566         1 - Consolidates much of the spread out WebKitMac archive code into one place in WebCore.  This allows for cleaner refactoring 
567             in the future as well as adding more archive formats with ease.
568         2 - Hooks up WebArchive support on Windows.  Safari-style .webarchive files are nothing more than property lists readable by
569             CoreFoundation.  While there are still some outstanding issues, including an NSKeyedArchiver chunk of data for the 
570             ResourceResponse for each resource, this patch manually parses through the property list on CoreFoundation platforms and
571             gets many archives loading on Windows
572
573         My goal for this first cut was zero behavior change.  As such, I went for a direct port of the WebKitMac code.  There will be
574         opportunities for redesign and refactoring as followups.
575
576         * WebCore.base.exp:
577
578         * loader/DocumentLoader.cpp:
579         (WebCore::DocumentLoader::setupForReplaceByMIMEType): Ported from WebKitMac, WebDataSource
580         (WebCore::DocumentLoader::addAllArchiveResources):
581         (WebCore::DocumentLoader::addArchiveResource):
582         (WebCore::DocumentLoader::archiveResourceForURL):
583         (WebCore::DocumentLoader::popArchiveForSubframe):
584         (WebCore::DocumentLoader::clearArchiveResources):
585         * loader/DocumentLoader.h:
586
587         * loader/FrameLoader.cpp: Moved WebFrameLoaderClient and WebFrame code down into their more appropriate FrameLoader home
588         (WebCore::FrameLoader::FrameLoader):
589         (WebCore::FrameLoader::setDefersLoading):
590         (WebCore::FrameLoader::deliverArchivedResourcesAfterDelay):
591         (WebCore::FrameLoader::archiveResourceDeliveryTimerFired):
592         (WebCore::FrameLoader::loadURLIntoChildFrame):
593         (WebCore::FrameLoader::loadArchive):
594         (WebCore::FrameLoader::scheduleArchiveLoad):
595         (WebCore::FrameLoader::stopAllLoaders):
596         (WebCore::FrameLoader::cancelPendingArchiveLoad):
597         (WebCore::FrameLoader::isArchiveLoadPending):
598         (WebCore::FrameLoader::finishedLoadingDocument):
599         * loader/FrameLoader.h:
600
601         * loader/ResourceLoader.cpp:
602         (WebCore::ResourceLoader::load):
603
604         * loader/archive/Archive.h: Generic "Archive of web resources" class that is only useful when subclassed.  
605             Contains a MainResource, subresources, and Archives for subframes
606         (WebCore::Archive::mainResource):
607         (WebCore::Archive::subresources):
608         (WebCore::Archive::subframeArchives):
609         (WebCore::Archive::setMainResource):
610         (WebCore::Archive::addSubresource):
611         (WebCore::Archive::addSubframeArchive):
612
613         * loader/archive/ArchiveFactory.cpp: A class that will take raw archive data and the MIMEtype, and create the
614             appropriate Archive class for it.  Additionally it handles registering the known MIMEtypes for all known archive formats
615         (WebCore::archiveFactoryCreate):
616         (WebCore::archiveMIMETypes):
617         (WebCore::ArchiveFactory::isArchiveMimeType):
618         (WebCore::ArchiveFactory::create):
619         (WebCore::ArchiveFactory::registerKnownArchiveMIMETypes):
620         * loader/archive/ArchiveFactory.h:
621
622         * loader/archive/ArchiveResource.cpp: Analog to "WebResource" in WebKitMac.  Contains the data and other important
623             attributes of an archived resource
624         (WebCore::ArchiveResource::create):
625         (WebCore::ArchiveResource::ArchiveResource):
626         (WebCore::ArchiveResource::response):
627         * loader/archive/ArchiveResource.h:
628         (WebCore::ArchiveResource::data):
629         (WebCore::ArchiveResource::url):
630         (WebCore::ArchiveResource::mimeType):
631         (WebCore::ArchiveResource::textEncoding):
632         (WebCore::ArchiveResource::frameName):
633         (WebCore::ArchiveResource::ignoreWhenUnarchiving):
634         (WebCore::ArchiveResource::shouldIgnoreWhenUnarchiving):
635
636         * loader/archive/ArchiveResourceCollection.cpp: Analog of "WebUnarchivingState" in WebKitMac.  Contains a hash of
637             all the resources for every frame in an archive, and contains the archives for each subframe needed to load a multi-frame archive
638         (WebCore::ArchiveResourceCollection::ArchiveResourceCollection):
639         (WebCore::ArchiveResourceCollection::addAllResources):
640         (WebCore::ArchiveResourceCollection::addResource):
641         (WebCore::ArchiveResourceCollection::archiveResourceForURL):
642         (WebCore::ArchiveResourceCollection::popSubframeArchive):
643         * loader/archive/ArchiveResourceCollection.h:
644
645         * loader/archive/cf/LegacyWebArchive.cpp: Subclass of Archive specifically for Webkit's Objective-C based ".webarchive" format.
646             Mostly a collection of static methods involved in parsing and serializing a WebKit-style .webarchive.  Is mostly supported
647             for any CF platform.
648         (WebCore::createPropertyListRepresentationFromResource):
649         (WebCore::createPropertyListRep):
650         (WebCore::createResourceResponseFromPropertyListData):
651         (WebCore::createResource):
652         (WebCore::LegacyWebArchive::create):
653         (WebCore::LegacyWebArchive::LegacyWebArchive):
654         (WebCore::LegacyWebArchive::init):
655         (WebCore::LegacyWebArchive::extract):
656         (WebCore::LegacyWebArchive::rawDataRepresentation):
657         (WebCore::createResourceResponseFromMacArchivedData):
658         (WebCore::propertyListDataFromResourceResponse):
659         * loader/archive/cf/LegacyWebArchive.h:
660         * loader/archive/cf/LegacyWebArchiveMac.mm:
661         (WebCore::createResourceResponseFromMacArchivedData):
662         (WebCore::propertyListDataFromResourceResponse):
663
664         * platform/network/mac/ResourceRequest.h:
665         * platform/network/mac/ResourceRequestMac.mm:
666         (WebCore::ResourceRequest::applyWebArchiveHackForMail): Tweak the resource request for Mac clients when loading WebArchives
667
668 2008-03-25  David Hyatt  <hyatt@apple.com>
669
670         Cut and paste error in the zoom code.  A width() should have been a height().  Regression tests caught this.
671
672         * page/DOMWindow.cpp:
673         (WebCore::DOMWindow::innerHeight):
674
675 2008-03-24  Darin Adler  <darin@apple.com>
676
677         - try to fix broken Wx build
678
679         * platform/wx/TemporaryLinkStubs.cpp:
680         (GraphicsContext::setPlatformShadow):
681         (GraphicsContext::clearPlatformShadow):
682
683 2008-03-24  Darin Adler  <darin@apple.com>
684
685         Reviewed by Sam.
686
687         - use AtomicString more consistently for attribute values
688
689         1% speedup on Acid3 test 26
690
691         * dom/Element.cpp:
692         (WebCore::Element::setAttribute): Changed value argument to AtomicString.
693         Also fixed call to lower() to only be done if the name isn't already lowercase.
694         Also took out one unneeded condition in a cascade of if statements.
695         (WebCore::Element::createAttribute): Ditto.
696         (WebCore::Element::setAttributeNS): Ditto.
697         * dom/Element.h: Ditto.
698         * dom/StyledElement.cpp:
699         (WebCore::StyledElement::createAttribute): Ditto.
700         * dom/StyledElement.h: Ditto.
701
702 2008-03-24  Darin Adler  <darin@apple.com>
703
704         Reviewed by Sam.
705
706         - get rid of extra level of function call in toJS functions for Node
707
708         0.6% speedup on Acid3 test 26
709
710         * bindings/js/JSNodeCustom.cpp:
711         (WebCore::toJS): Take a raw pointer, not a PassRefPtr, like other toJS functions.
712
713         * bindings/scripts/CodeGeneratorJS.pm: Add an inlined toJS for EventTargetNode*
714         to avoid ambiguity that otherwise exists between the toJS for EventTarget* and
715         for Node*.
716
717 2008-03-24  Darin Adler  <darin@apple.com>
718
719         Reviewed by Hyatt.
720
721         - add fast path to isValidName that does not use advanced Unicode functions
722
723         2% speedup on Acid3 test 26
724
725         * dom/Document.cpp:
726         (WebCore::isValidNameNonASCII): Added. Contains the old isValidName function.
727         (WebCore::isValidNameASCII): Added. Contains a simpler function that returns
728         true for most valid names that are also all ASCII.
729         (WebCore::Document::isValidName): Changed to call both of the above functions.
730         The common case is that isValidNameASCII returns true so isValidNameNonASCII
731         is never called.
732
733 2008-03-24  David Hyatt  <hyatt@apple.com>
734
735         Fix for bug 18052, window properties need to respect zoom factor.
736
737         Reviewed by Beth
738
739         * page/DOMWindow.cpp:
740         (WebCore::DOMWindow::innerHeight):
741         (WebCore::DOMWindow::innerWidth):
742         (WebCore::DOMWindow::scrollX):
743         (WebCore::DOMWindow::scrollY):
744         (WebCore::DOMWindow::scrollTo):
745         * page/FrameView.cpp:
746         (WebCore::FrameViewPrivate::reset):
747         (WebCore::FrameView::layout):
748         (WebCore::FrameView::performPostLayoutTasks):
749
750 2008-03-24  Sam Weinig  <sam@webkit.org>
751
752         Reviewed by Darin Adler.
753
754         Fix http://bugs.webkit.org/show_bug.cgi?id=18048
755         The "thisObject" parameter to JSEvaluateScript is not used properly
756
757         * bindings/js/kjs_proxy.cpp:
758         (WebCore::KJSProxy::evaluate): No need to pass a thisObject since we want the global object to be used.
759         * bridge/jni/jni_jsobject.mm:
760         (JavaJSObject::eval): To avoid any change to this function, don't pass a thisObject to keep the same
761         behavior.
762
763 2008-03-24  Brady Eidson  <beidson@apple.com>
764
765         Reviewed by Darin's rubberstamp
766
767         Land a load of empty files for upcoming work to make sure I'm not breaking any platform's build
768
769         * GNUmakefile.am:
770         * WebCore.pro:
771         * WebCore.vcproj/WebCore.vcproj:
772         * WebCore.xcodeproj/project.pbxproj:
773         * WebCoreSources.bkl:
774         * loader/archive: Added.
775         * loader/archive/Archive.h: Added.
776         * loader/archive/ArchiveFactory.cpp: Added.
777         * loader/archive/ArchiveFactory.h: Added.
778         * loader/archive/ArchiveResource.cpp: Added.
779         * loader/archive/ArchiveResource.h: Added.
780         * loader/archive/ArchiveResourceCollection.cpp: Added.
781         * loader/archive/ArchiveResourceCollection.h: Added.
782         * loader/archive/cf: Added.
783         * loader/archive/cf/LegacyWebArchive.cpp: Added.
784         * loader/archive/cf/LegacyWebArchive.h: Added.
785         * loader/archive/cf/LegacyWebArchiveMac.mm: Added.
786
787 2008-03-24  David Hyatt  <hyatt@apple.com>
788
789         Fix for bug 18009. Make sure the IE offset/client/scroll*** extensions respect full page zoom.
790
791         Reviewed by Beth
792
793         * dom/Element.cpp:
794         (WebCore::localZoomForRenderer):
795         (WebCore::adjustForLocalZoom):
796         (WebCore::adjustForAbsoluteZoom):
797         (WebCore::Element::offsetLeft):
798         (WebCore::Element::offsetTop):
799         (WebCore::Element::offsetWidth):
800         (WebCore::Element::offsetHeight):
801         (WebCore::Element::clientLeft):
802         (WebCore::Element::clientTop):
803         (WebCore::Element::clientWidth):
804         (WebCore::Element::clientHeight):
805         (WebCore::Element::scrollLeft):
806         (WebCore::Element::scrollTop):
807         (WebCore::Element::setScrollLeft):
808         (WebCore::Element::setScrollTop):
809         (WebCore::Element::scrollWidth):
810         (WebCore::Element::scrollHeight):
811         * rendering/RenderBox.cpp:
812         (WebCore::RenderBox::setStyle):
813         * rendering/RenderObject.cpp:
814         (WebCore::RenderObject::offsetParent):
815         * rendering/RenderObject.h:
816
817 2008-03-24  Brady Eidson  <beidson@apple.com>
818
819         Reviewed by Darin
820
821         Some style cleanup and add a logging channel for upcoming work
822
823         * platform/Logging.cpp:
824         * platform/Logging.h:
825
826         * platform/MIMETypeRegistry.cpp:
827         (WebCore::initializeSupportedImageMIMETypes):
828         (WebCore::initializeSupportedNonImageMimeTypes):
829
830 2008-03-24  Dan Bernstein  <mitz@apple.com>
831
832         Reviewed by Sam Weinig.
833
834         - fix <rdar://problem/5812292> CrashTracer: [REGRESSION] 60 crashes in Safari at com.apple.WebCore: WebCore::RenderObject::repaintRectangle + 47
835
836         Test: fast/repaint/renderer-destruction-by-invalidateSelection-crash.html
837
838         * page/FrameView.cpp:
839         (WebCore::FrameViewPrivate::reset): Removed repaintRects code.
840         (WebCore::FrameView::layout): Ditto.
841         (WebCore::FrameView::addRepaintInfo): Removed.
842
843         * page/FrameView.h: Removed addRepaintInfo().
844
845         * rendering/RenderBlock.cpp:
846         (WebCore::RenderBlock::layoutBlock): Changed to call repaintRectangle
847         instead of FrameView::addRepaintInfo().
848         * rendering/RenderTable.cpp:
849         (WebCore::RenderTable::layout): Ditto.
850
851 2008-03-24  Alp Toker  <alp@atoker.com>
852
853         GTK+/soup http backend build fix for breakage introduced in r31141.
854         Fix suggested by Xan.
855
856         * platform/network/ResourceHandle.h:
857
858 2008-03-24  Dan Bernstein  <mitz@apple.com>
859
860         Reviewed by Sam Weinig.
861
862         - fix <rdar://problem/5792582> CSS opacity does not work with GDI text
863         - fix <rdar://problem/5792619> non-opaque CSS colors do not work with GDI text (RGBA, HSLA)
864         - fix <rdar://problem/5792624> GDI text can't be stroked/filled independently
865         - make text-shadow work with GDI text
866         - make -webkit-background-clip: text work with GDI text
867
868         * platform/graphics/GraphicsContext.cpp:
869         (WebCore::GraphicsContext::setShadow): Made this a shared method that
870         updates the state and calls the platform-specific method.
871         (WebCore::GraphicsContext::clearShadow): Ditto.
872         (WebCore::GraphicsContext::getShadow): Added.
873
874         * platform/graphics/GraphicsContext.h:
875         (WebCore::GraphicsContext::WindowsBitmap): Added this class that
876         represents a bitmap with a Windows device context that GDI can draw into.
877
878         * platform/graphics/GraphicsContextPrivate.h:
879         (WebCore::GraphicsContextState::GraphicsContextState): Added the shadow
880         parameters to the graphics state.
881
882         * platform/graphics/cairo/GraphicsContextCairo.cpp:
883         (WebCore::GraphicsContext::setPlatformShadow): Renamed the platform-
884         specific implementation to this.
885         (WebCore::GraphicsContext::clearPlatformShadow): Renamed the platform-
886         specific implementation to this.
887
888         * platform/graphics/cg/GraphicsContextCG.cpp:
889         (WebCore::GraphicsContext::setPlatformShadow): Renamed the platform-
890         specific implementation to this.
891         (WebCore::GraphicsContext::clearPlatformShadow): Renamed the platform-
892         specific implementation to this.
893
894         * platform/graphics/qt/GraphicsContextQt.cpp:
895         (WebCore::GraphicsContext::setPlatformShadow): Renamed the platform-
896         specific implementation to this.
897         (WebCore::GraphicsContext::clearPlatformShadow): Renamed the platform-
898         specific implementation to this.
899
900         * platform/graphics/win/FontCGWin.cpp:
901         (WebCore::toCGFloat): Added. Converts a Windows FIXED.
902         (WebCore::createPathForGlyph): Added. Retrieves a glyph's hinted
903         outline from GDI and creates a CGPath containing it.
904         (WebCore::Font::drawGlyphs): Added two code paths in the GDI case.
905         The existing code path, which uses GDI to draw text directly to the
906         graphics context, is used for opaque-colored, non-transformed,
907         non-stroked, non-shadowed text in a GDI-backed graphics context that is
908         not in a transparency layer.
909         An additional code path is used for non-stroked text in all other cases.
910         It uses GDI to draw black text into an all-white Windows bitmap, then
911         uses the green channel as a mask to create a bitmap with the desired
912         fill color and alpha. The bitmap is then drawn into the graphics
913         context, at which time transparency layers, transforms and shadows are
914         handled properly.
915         A third code path is used for stroked text. It constructs a path from
916         hinted glyph outlines retrieved from GDI and strokes (and optionally
917         fills) it.
918
919         * platform/graphics/win/GraphicsContextCGWin.cpp:
920         (WebCore::GraphicsContext::getWindowsContext): Added a mayCreateBitmap
921         parameter. When false, prevents this method from creating a Windows
922         device context if the graphics context does not already have one.
923         (WebCore::GraphicsContext::releaseWindowsContext): Added a
924         mayCreateBitmap parameter to match getWindowsContext().
925         (WebCore::GraphicsContext::WindowsBitmap::WindowsBitmap):
926         (WebCore::GraphicsContext::WindowsBitmap::~WindowsBitmap):
927         (WebCore::GraphicsContext::createWindowsBitmap): Added.
928         (WebCore::GraphicsContext::drawWindowsBitmap): Added. Draws the bitmap
929         as a non-alpha-premultiplied image.
930
931 2008-03-24  Kevin McCullough <kmccullough@apple.com>
932
933           - Fixed Changelog
934
935 2008-03-24  Marco Barisione  <marco.barisione@collabora.co.uk>
936
937         Reviewed by Alp Toker.
938
939         http://bugs.webkit.org/show_bug.cgi?id=17845
940         [GTK] combo box menu displayed in the wrong position
941
942         * platform/gtk/PopupMenuGtk.cpp:
943         (WebCore::PopupMenu::show): Change the popup menu vertical position so
944         that the active item is over the combo box.
945         (WebCore::PopupMenu::menuPositionFunction): use the "push in" style
946         like native GTK+ combo boxes to handle menus that don't fit in the
947         screen.
948
949 2008-03-24  Adam Roben  <aroben@apple.com>
950
951         * WebCore.vcproj/WebCore.vcproj: Add files from WebCore/page/inspector
952         to the project.
953
954 2008-03-24  Alexey Proskuryakov  <ap@webkit.org>
955
956         Build fix.
957
958         * WebCore.xcodeproj/project.pbxproj: Added DOMSVGAltGlyphElement.h and
959         DOMSVGAltGlyphElementInternal.h to Copy Generated Headers phase.
960
961 2008-03-24  Eric Seidel  <eric@webkit.org>
962
963         Build fix, no review.
964
965         Fix project paths to be group relative instead of project relative
966
967         * WebCore.xcodeproj/project.pbxproj:
968
969 2008-03-23  Maciej Stachowiak  <mjs@apple.com>
970
971         Reviewed by Eric.
972
973         - fixed "SVGTextElement.getNumberOfChars is broken for altGlyph (affects Acid3 test 79)"
974         http://bugs.webkit.org/show_bug.cgi?id=17062
975
976         * svg/SVGAltGlyphElement.cpp: Added. Implementation for new element.
977         (WebCore::SVGAltGlyphElement::SVGAltGlyphElement):
978         (WebCore::SVGAltGlyphElement::~SVGAltGlyphElement):
979         (WebCore::SVGAltGlyphElement::setGlyphRef):
980         (WebCore::SVGAltGlyphElement::glyphRef):
981         (WebCore::SVGAltGlyphElement::setFormat):
982         (WebCore::SVGAltGlyphElement::format):
983         (WebCore::SVGAltGlyphElement::childShouldCreateRenderer):
984         (WebCore::SVGAltGlyphElement::createRenderer): For now, this just renders as a tspan,
985         which is right for everything besides the alternate glyph substitution itself.
986         * svg/SVGAltGlyphElement.h: Added. Header for new element.
987         (WebCore::SVGAltGlyphElement::contextElement):
988         * svg/SVGAltGlyphElement.idl: Added. Interface for new element.
989         * svg/SVGTSpanElement.cpp:
990         (WebCore::SVGTSpanElement::childShouldCreateRenderer): Allow altGlyph to render here.
991         * svg/SVGTextElement.cpp:
992         (WebCore::SVGTextElement::childShouldCreateRenderer): ditto
993         * svg/SVGTextPathElement.cpp:
994         (WebCore::SVGTextPathElement::childShouldCreateRenderer): ditto
995         * svg/svgtags.in: Add altGlyph
996         * DerivedSources.make: Add new files
997         * GNUmakefile.am: ditto
998         * WebCore.SVG.exp: Add new ObjC DOM class
999         * WebCore.pro: Add new files
1000         * WebCore.vcproj/WebCore.vcproj: ditto
1001         * WebCore.xcodeproj/project.pbxproj: ditto
1002         * bindings/js/JSSVGElementWrapperFactory.cpp: Handle altGlyph
1003         * bindings/objc/DOM.mm:
1004         (WebCore::createElementClassMap): ditto
1005         * bindings/objc/DOMInternal.h: Include altGlyph header
1006         * bindings/objc/DOMSVG.h: Include altGlyph header
1007
1008 2008-03-23  Robert Blaut  <webkit@blaut.biz>
1009
1010         Reviewed by eseidel.  Landed by eseidel.
1011
1012         Bug 17685: [~=] attribute selector failing to match empty string
1013         <http://bugs.webkit.org/show_bug.cgi?id=17685>
1014
1015         Test: fast/css/attribute-selector-empty-value.html
1016
1017         * css/CSSStyleSelector.cpp:
1018         (WebCore::CSSStyleSelector::checkOneSelector):
1019
1020 2008-03-22  Marco Barisione  <marco.barisione@collabora.co.uk>
1021
1022         Reviewed by Darin Adler.
1023
1024         http://bugs.webkit.org/show_bug.cgi?id=16339
1025         Frame scrollbar positions are not updated on page scroll
1026
1027         Widget::geometryChanged() was called instead of
1028         ScrollViewScrollbar::geometryChanged() because of a missing const.
1029
1030         * platform/gtk/ScrollViewGtk.cpp:
1031         (WebCore::ScrollViewScrollbar::geometryChanged): add the missing
1032         const.
1033
1034 2008-03-22  Rodney Dawes  <dobey@wayofthemonkey.com>
1035
1036         Reviewed by Mark Rowe.
1037
1038         Bug 17974: REGRESSION: npfunctions.h should not import npruntime_internal.h
1039         <http://bugs.webkit.org/show_bug.cgi?id=17974>
1040         <rdar://problem/5782310>
1041
1042         Include npapi.h and npruntime.h directly in npfunctions.h.
1043         Add npfunctions.h and npapi.h to npruntime_internal.h.
1044         Replace includes of npfunctions.h with npruntime_internal.h.
1045
1046         * bridge/npruntime_internal.h:
1047         * plugins/PluginPackage.h:
1048         * plugins/PluginStream.h:
1049         * plugins/npapi.cpp:
1050         * plugins/npfunctions.h:
1051
1052 2008-03-22  Mark Rowe  <mrowe@apple.com>
1053
1054         Qt build fix.
1055
1056         * bridge/qt/qt_runtime.cpp:
1057         (KJS::Bindings::valueRealType):
1058
1059 2008-03-22  Eric Seidel  <eric@webkit.org>
1060
1061         Reviewed by mjs.
1062
1063         Unify handling of NAMESPACE_ERR and fix Acid3 test 25
1064         http://bugs.webkit.org/show_bug.cgi?id=16693
1065
1066         Test: fast/dom/DOMImplementation/createDocumentType-err.html
1067
1068         * dom/DOMImplementation.cpp:
1069         (WebCore::DOMImplementation::createDocumentType):
1070         (WebCore::DOMImplementation::createDocument):
1071         * dom/DOMImplementation.idl:
1072         * dom/Document.cpp:
1073         (WebCore::Document::hasPrefixNamespaceMismatch):
1074         (WebCore::Document::createElementNS):
1075         (WebCore::Document::parseQualifiedName):
1076         (WebCore::Document::createAttributeNS):
1077         * dom/Document.h:
1078         * dom/Element.cpp:
1079         (WebCore::Element::setAttributeNS):
1080         * editing/FormatBlockCommand.cpp:
1081         (WebCore::FormatBlockCommand::doApply):
1082
1083 2008-03-22  Eric Seidel  <eric@webkit.org>
1084
1085         Reviewed by mjs.
1086
1087         Fix createElementNS to throw exceptions for invalid qualified names
1088         Fixes Acid3 sub-test 23
1089         http://bugs.webkit.org/show_bug.cgi?id=16833
1090
1091         Tests: fast/dom/Document/createAttributeNS-namespace-err.html
1092                fast/dom/Document/createElementNS-namespace-err.html
1093
1094         * dom/Document.cpp:
1095         (WebCore::Document::createElement):
1096         (WebCore::hasNamespaceError):
1097         (WebCore::Document::createElementNS):
1098         (WebCore::Document::createAttributeNS):
1099         * dom/Document.idl:
1100
1101 2008-03-21  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
1102
1103         Reviewed by Oliver Hunt.
1104
1105         Bug 13693: REGRESSION (r13615): Acid2 Test Eyes render improperly after a page refresh
1106         <http://bugs.webkit.org/show_bug.cgi?id=13693>
1107
1108         Do not create bogus history items for unloaded <object> elements, because they
1109         cause fallback content to be ignored on reload.
1110
1111         * loader/FrameLoader.cpp:
1112         (WebCore::FrameLoader::createHistoryItemTree):
1113
1114 2008-03-21  Dan Bernstein  <mitz@apple.com>
1115
1116         Reviewed by Oliver Hunt.
1117
1118         - fix http://bugs.webkit.org/show_bug.cgi?id=17988
1119           REGRESSION (r31114-31132): Crash in InlineBox::isDirty() opening chowhound.com
1120
1121         Test: fast/css-generated-content/empty-content-with-float-crash.html
1122
1123         * rendering/bidi.cpp:
1124         (WebCore::RenderBlock::layoutInlineChildren): Added a null check for
1125         the case where the block contains no in-flow elements but still lays
1126         out as a line flow, which can happen as a result of empty generated
1127         content.
1128
1129 2008-03-21  Sam Weinig  <sam@webkit.org>
1130
1131         Reviewed by Oliver Hunt.
1132
1133         Fix <rdar://problem/5788451>
1134         toDataURL not implemented for Windows (need mapping of MIME type to UTI)
1135
1136         Hard code support for just PNG's on windows, the minimum the spec requires.
1137
1138         * platform/MIMETypeRegistry.cpp:
1139         (WebCore::initializeSupportedImageMIMETypesForEncoding):
1140         * platform/graphics/cg/ImageBufferCG.cpp:
1141         (WebCore::utiFromMIMEType):
1142         (WebCore::ImageBuffer::toDataURL):
1143
1144 2008-03-21  Matt Lilek  <webkit@mattlilek.com>
1145
1146         Not reviewed, Mac build fix.
1147
1148         * bindings/objc/WebScriptObject.mm:
1149         (+[WebScriptObject _convertValueToObjcValue:originRootObject:rootObject:]):
1150         * bridge/jni/jni_utility.cpp:
1151         (KJS::Bindings::convertValueToJValue):
1152         * bridge/objc/objc_runtime.mm:
1153         (ObjcFallbackObjectImp::callAsFunction):
1154
1155 2008-03-21  Adam Roben  <aroben@apple.com>
1156
1157         Attempt to fix the Mac build
1158
1159         * bindings/objc/DOMUtility.mm:
1160         (KJS::createDOMWrapper):
1161
1162 2008-03-21  Adam Roben  <aroben@apple.com>
1163
1164         Rename static info members to s_info
1165
1166         This avoids conflicts with custom "info" methods, such as the one that
1167         will soon be added to Console.
1168
1169         Reviewed by Ada Chan and Sam Weinig.
1170
1171 2008-03-21  David Hyatt  <hyatt@apple.com>
1172
1173         <rdar://problem/5808863> Zooming should not let non-zero border width become zero
1174
1175         Make sure zoomed values that begin >= 1 are not allowed to fall below 1.
1176
1177         Reviewed by adele
1178
1179         * css/CSSPrimitiveValue.cpp:
1180         (WebCore::CSSPrimitiveValue::computeLengthDouble):
1181         * loader/CachedImage.cpp:
1182         (WebCore::CachedImage::imageSize):
1183         (WebCore::CachedImage::imageRect):
1184
1185 2008-03-21  Kevin McCullough  <kmccullough@apple.com>
1186
1187         Reviewed by Sam.
1188
1189         -<rdar://problem/5712804> XMLHttpRequests do not show response contents, preview images (14313)
1190         -<rdar://problem/5712931> XMLHttpRequests should be shown separately and grouped (14315)
1191         -<rdar://problem/5732836> XMLHttpRequest: Inspector should show network activity/XHR in Console (17233)
1192         - Instrument the InspectorController to cache XHR resrouces since they are not cached by WebCore.
1193         The resources will be kept in the same map as all other resources so they will have the exact
1194         same lifecycle. 
1195
1196         * ChangeLog:
1197         * page/InspectorController.cpp:
1198         (WebCore::InspectorCachedXMLHttpRequestResource::type):
1199         (WebCore::InspectorCachedXMLHttpRequestResource::setType):
1200         (WebCore::InspectorCachedXMLHttpRequestResource::data):
1201         (WebCore::InspectorCachedXMLHttpRequestResource::setData):
1202         (WebCore::InspectorCachedXMLHttpRequestResource::encoding):
1203         (WebCore::InspectorCachedXMLHttpRequestResource::setEncoding):
1204         (WebCore::InspectorCachedXMLHttpRequestResource::create):
1205         (WebCore::InspectorCachedXMLHttpRequestResource::InspectorCachedXMLHttpRequestResource):
1206
1207 2008-03-21  Rodney Dawes  <dobey@wayofthemonkey.com>
1208
1209         Reviewed by Holger.
1210
1211         http://bugs.webkit.org/show_bug.cgi?id=17981
1212
1213         Remove WebCore/ForwardingHeaders from cppflags as it is not needed,
1214         and causes build problems with GTK+.
1215
1216         * GNUmakefile.am:
1217
1218 2008-03-21  Dan Bernstein  <mitz@apple.com>
1219
1220         Reviewed by Adele Peterson.
1221
1222         - fix http://bugs.webkit.org/show_bug.cgi?id=17966
1223           REGRESSION (r31114-r31132): Clearing via br behaves unpredictably
1224
1225         Test: fast/block/float/br-with-clear.html
1226
1227         * rendering/bidi.cpp:
1228         (WebCore::RenderBlock::layoutInlineChildren): Fixed the logic for the
1229         very special case of an all-lines-clean block that ends with a float-
1230         clearing <br> by looking for the <br> at the end of the line rather
1231         than at its beginning.
1232
1233 2008-03-21  Adam Roben  <aroben@apple.com>
1234
1235         Don't allow any newly-scheduled plugin requests to be serviced when JS is paused
1236
1237         This is a followup to r31199.
1238
1239         Reviewed by Tim Hatcher.
1240
1241         * plugins/PluginView.cpp:
1242         (WebCore::PluginView::requestTimerFired): Added an assertion that JS
1243         is not paused.
1244         (WebCore::PluginView::scheduleRequest): Don't start the request timer
1245         if JS is paused. This is the bug fix.
1246         (WebCore::PluginView::setJavaScriptPaused): Replaced the use of
1247         m_requestTimerWasActive with a check to see if we have any pending
1248         requests. m_requestTimerWasActive would not be accurate if a new
1249         request had been scheduled while JS was paused.
1250         (WebCore::PluginView::PluginView): Removed initialization of
1251         m_requestTimerWasActive.
1252         * plugins/PluginView.h: Removed m_requestTimerWasActive.
1253
1254 2008-03-20  Dan Bernstein  <mitz@apple.com>
1255
1256         Reviewed by Anders Carlsson.
1257
1258         - fix an assertion failure due to a line being marked dirty during
1259           computeVerticalPositionsForLine() due to temporary box destruction
1260
1261         Test: fast/inline/clean-after-removing-temp-boxes.html
1262
1263         * rendering/RenderText.cpp:
1264         (WebCore::RenderText::setTextWithOffset): Added code to dirty lines
1265         when this method is called on an empty text node, which has no line
1266         boxes.
1267         * rendering/bidi.cpp:
1268         (WebCore::RenderBlock::computeVerticalPositionsForLine): Mark the line
1269         clean in the end.
1270
1271 2008-03-20  Anders Carlsson  <andersca@apple.com>
1272
1273         Reviewed by Maciej.
1274
1275         Make some member variables private.
1276         
1277         * loader/ResourceLoader.cpp:
1278         (WebCore::ResourceLoader::ResourceLoader):
1279         * loader/ResourceLoader.h:
1280
1281 2008-03-20  Anders Carlsson  <andersca@apple.com>
1282
1283         Reviewed by Maciej.
1284
1285         Get rid of m_originalURL in ResourceLoader.
1286
1287         * loader/ResourceLoader.cpp:
1288         (WebCore::ResourceLoader::load):
1289         Don't store m_originalURL.
1290         
1291         * loader/ResourceLoader.h:
1292         * loader/SubresourceLoader.cpp:
1293         (WebCore::SubresourceLoader::willSendRequest):
1294         Use the url of the current request instead of the original URL.
1295
1296 2008-03-20  Anders Carlsson  <andersca@apple.com>
1297
1298         Reviewed by Maciej.
1299
1300         Small loader cleanups.
1301         
1302         * loader/MainResourceLoader.cpp:
1303         (WebCore::MainResourceLoader::willSendRequest):
1304         No need to call setRequest here, ResourceLoader::willSendRequest takes care of that. 
1305         Also, there is no need to check that newRequest is null here, because we assert earlier that it is not.
1306         
1307         * loader/ResourceLoader.h:
1308         Get rid of setRequest, it is no longer needed.
1309
1310 2008-03-20  Anders Carlsson  <andersca@apple.com>
1311
1312         Get rid of a couple of unnecessary class declarations.
1313         
1314         * loader/SubresourceLoader.h:
1315
1316 2008-03-20  David Hyatt  <hyatt@apple.com>
1317
1318         Add a new value to background-clip, "text", that allows backgrounds to be clipped to foreground text (and
1319         associated text decorations like shadows and underlines).
1320
1321         Reviewed by Beth
1322
1323         * css/CSSParser.cpp:
1324         (WebCore::CSSParser::parseBackgroundProperty):
1325         * css/CSSPrimitiveValueMappings.h:
1326         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1327         (WebCore::CSSPrimitiveValue::operator EBackgroundBox):
1328         * platform/graphics/GraphicsContext.cpp:
1329         (WebCore::GraphicsContext::clipToImageBuffer):
1330         * platform/graphics/GraphicsContext.h:
1331         * platform/graphics/cg/GraphicsContextCG.cpp:
1332         (WebCore::GraphicsContext::clipToImageBuffer):
1333         * rendering/InlineBox.cpp:
1334         (WebCore::InlineBox::paint):
1335         * rendering/InlineFlowBox.cpp:
1336         (WebCore::InlineFlowBox::paintBackgrounds):
1337         (WebCore::InlineFlowBox::paintBackground):
1338         (WebCore::InlineFlowBox::paintBoxDecorations):
1339         * rendering/InlineFlowBox.h:
1340         * rendering/InlineTextBox.cpp:
1341         (WebCore::InlineTextBox::paint):
1342         * rendering/RenderBlock.cpp:
1343         (WebCore::RenderBlock::paintColumns):
1344         (WebCore::RenderBlock::paintObject):
1345         (WebCore::RenderBlock::paintFloats):
1346         * rendering/RenderBlock.h:
1347         * rendering/RenderBox.cpp:
1348         (WebCore::RenderBox::paintRootBoxDecorations):
1349         (WebCore::RenderBox::paintBoxDecorations):
1350         (WebCore::RenderBox::paintBackgrounds):
1351         (WebCore::RenderBox::paintBackground):
1352         (WebCore::RenderBox::paintBackgroundExtended):
1353         * rendering/RenderBox.h:
1354         * rendering/RenderFieldset.cpp:
1355         (WebCore::RenderFieldset::paintBoxDecorations):
1356         * rendering/RenderFlow.cpp:
1357         (WebCore::RenderFlow::paintLines):
1358         * rendering/RenderObject.h:
1359         (WebCore::):
1360         (WebCore::RenderObject::paintBackgroundExtended):
1361         * rendering/RenderStyle.h:
1362         (WebCore::):
1363         * rendering/RenderTable.cpp:
1364         (WebCore::RenderTable::paintBoxDecorations):
1365         * rendering/RenderTableCell.cpp:
1366         (WebCore::RenderTableCell::paintBackgroundsBehindCell):
1367
1368 2008-03-20  Adam Roben  <aroben@apple.com>
1369
1370         Allow pausing/blocking of JS execution by plugins
1371
1372         Part of Bug 17133: Should support pausing JavaScript execution without
1373         hanging the process
1374
1375         <http://bugs.webkit.org/show_bug.cgi?id=17133>
1376         <rdar://problem/5719551>
1377
1378         This patch doesn't affect Mac, which doesn't use the shared PluginView
1379         code.
1380
1381         Note that this patch doesn't prevent plugins from executing JS via an
1382         NPObject they've already gotten hold of. It just blocks obtaining new
1383         NPObjects and pauses any requests to evaluate javascript: URIs. This
1384         is probably good enough for now because most plugins seem to always
1385         obtain the Window object each time they want to execute JS.
1386
1387         Reviewed by Tim Hatcher.
1388
1389         * plugins/PluginView.cpp:
1390         (WebCore::PluginView::getValue): Return an error if JS is paused.
1391         (WebCore::PluginView::setJavaScriptPaused): Stop the request timer if
1392         we're pausing, and resume it if we're unpausing.
1393         (WebCore::PluginView::PluginView): Initialize new members.
1394         * plugins/PluginView.h:
1395
1396 2008-03-20  Adam Roben  <aroben@apple.com>
1397
1398         Allow pausing of callOnMainThread callbacks
1399
1400         Part of Bug 17133: Should support pausing JavaScript execution without
1401         hanging the process
1402
1403         <http://bugs.webkit.org/show_bug.cgi?id=17133>
1404         <rdar://problem/5719551>
1405
1406         Reviewed by Tim Hatcher.
1407
1408         * platform/MainThread.cpp:
1409         (WebCore::dispatchFunctionsFromMainThread): If callbacks are paused,
1410         don't dispatch the functions.
1411         (WebCore::setMainThreadCallbacksPaused): Added. If we're being
1412         unpaused, call scheduleDispatchFunctionsOnMainThread so that any
1413         queued callbacks will get dispatched in the near future.
1414         * platform/MainThread.h:
1415
1416 2008-03-20  Adam Roben  <aroben@apple.com>
1417
1418         Allow blocking of JS event handlers/javascript: URIs per-Frame
1419
1420         Part of Bug 17133: Should support pausing JavaScript execution without
1421         hanging the process
1422
1423         <http://bugs.webkit.org/show_bug.cgi?id=17133>
1424         <rdar://problem/5719551>
1425
1426         Two new methods are added to KJSProxy: setPaused and isPaused. When
1427         setPaused(true) is called, JS event handlers are blocked and
1428         javascript: URIs will not be evaluated.
1429
1430         Reviewed by Tim Hatcher.
1431
1432         * bindings/js/kjs_events.cpp:
1433         (WebCore::JSAbstractEventListener::handleEvent):
1434           - Removed some old KJS_DEBUGGER code
1435           - Don't run the handler if the KJSProxy is paused.
1436         * bindings/js/kjs_proxy.cpp:
1437         (WebCore::KJSProxy::KJSProxy): Initialize new member.
1438         * bindings/js/kjs_proxy.h: Added new methods.
1439         * loader/FrameLoader.cpp:
1440         (WebCore::FrameLoader::executeScript): Don't execute the script if the
1441         KJSProxy is paused.
1442
1443 2008-03-20  Jon Honeycutt  <jhoneycutt@apple.com>
1444
1445         Reviewed by Anders.
1446
1447         Fix Windows warning / leak: warning C4150: deletion of pointer to
1448         incomplete type 'WebCore::PluginRequest'; no destructor called
1449
1450         * plugins/PluginView.cpp: Move PluginRequest class to PluginView.h so
1451         Windows PluginView destructor can use WTF::deleteAllValues to clean up
1452         m_requests.
1453         * plugins/PluginView.h:
1454         (WebCore::PluginRequest::PluginRequest):
1455         (WebCore::PluginRequest::frameLoadRequest):
1456         (WebCore::PluginRequest::notifyData):
1457         (WebCore::PluginRequest::sendNotification):
1458         (WebCore::PluginRequest::shouldAllowPopups):
1459
1460 2008-03-20  Mark Rowe  <mrowe@apple.com>
1461
1462         Reviewed by Sam Weinig.
1463
1464         Ensure that the defines in FEATURE_DEFINES are sorted so that they will match the default settings of build-webkit.
1465         This will prevent the world from being rebuilt if you happen to switch between building in Xcode and with build-webkit on the
1466         command-line.
1467
1468         * Configurations/WebCore.xcconfig:
1469
1470 2008-03-20  Jon Honeycutt  <jhoneycutt@apple.com>
1471
1472         Reviewed by Anders.
1473
1474         <rdar://problem/5809600> REGRESSION:
1475         http/tests/plugins/cross-frame-object-access.html hangs Windows Layout
1476         Tests
1477
1478         r30897 changed the way we conditionalize this feature.
1479
1480         * plugins/PluginView.cpp:
1481         (WebCore::PluginView::getValue): Test ENABLE(NETSCAPE_PLUGIN_API)
1482         instead of USE(NPOBJECT).
1483         (WebCore::PluginView::bindingInstance): Same.
1484
1485 2008-03-20  Adam Roben  <aroben@apple.com>
1486
1487         Highlight nodes when you hover over them in the Console
1488
1489         Part of Bug 16532: Inspector should highlight nodes in page when
1490         hovering over nodes in Inspector's interface
1491
1492         <http://bugs.webkit.org/show_bug.cgi?id=16532>
1493         <rdar://problem/5712896>
1494
1495         Reviewed by Tim Hatcher.
1496
1497         * page/inspector/ConsolePanel.js:
1498         (WebInspector.ConsolePanel._formatnode): Add mouseover/mouseout event
1499         listeners to highlight the node and clear the highlight.
1500
1501 2008-03-20  Adam Roben  <aroben@apple.com>
1502
1503         Highlight nodes in the page when you hover over their DOM breadcrumbs
1504
1505         Part of Bug 16532: Inspector should highlight nodes in page when
1506         hovering over nodes in Inspector's interface
1507
1508         <http://bugs.webkit.org/show_bug.cgi?id=16532>
1509         <rdar://problem/5712896>
1510
1511         Reviewed by Tim Hatcher.
1512
1513         * page/inspector/DocumentPanel.js:
1514         (WebInspector.DocumentPanel): Add an mouseout event listener to the
1515         breadcrumbs element to clear the highlighted node.
1516         (WebInspector.DocumentPanel.updateBreadcrumbs): Change the mouseover
1517         event listener to highlight the node represented by the hovered
1518         breadcrumb.
1519
1520 2008-03-20  Adam Roben  <aroben@apple.com>
1521
1522         Highlight nodes in the page when you hover over them in the DOM tree
1523
1524         Part of Bug 16532: Inspector should highlight nodes in page when
1525         hovering over nodes in Inspector's interface
1526
1527         <http://bugs.webkit.org/show_bug.cgi?id=16532>
1528         <rdar://problem/5712896>
1529
1530         The inspected node is no longer highlighted (unless, of course, you
1531         hover over it).
1532
1533         Reviewed by Tim Hatcher.
1534
1535         * page/inspector/DocumentPanel.js:
1536         (WebInspector.DocumentPanel):
1537           - Don't highlight the focused node when the DOM tree is shown
1538           - Added mousemove/mouseout event listeners to set/clear the
1539             highlighted node. These are added to the root of the DOM tree
1540             instead of to each individual list item to avoid flashing as the
1541             mouse moves between nodes.
1542         (WebInspector.DocumentPanel.set focusedDOMNode): Don't highlight the
1543         focused node.
1544         (WebInspector.DocumentPanel._onmousemove): Highlight the node under
1545         the mouse.
1546
1547 2008-03-20  Adam Roben  <aroben@apple.com>
1548
1549         Show nodes' content/padding/border/margin boxes in the node highlight
1550
1551         Part of Bug 17221: Node highlight should show node metrics
1552
1553         <http://bugs.webkit.org/show_bug.cgi?id=17221>
1554         <rdar://problem/5732822>
1555
1556         Outstanding issues:
1557           1) We don't show padding/border/margins for inlines
1558           2) We don't show any numeric metrics, we just draw the boxes
1559           3) We'll probably want to tweak the look of the highlight some, at
1560              least to make the boxes better distinguishable
1561
1562         Reviewed by Tim Hatcher.
1563
1564         * page/InspectorController.cpp:
1565         (WebCore::drawOutlinedRect): Added. Just draws a single rect.
1566         (WebCore::drawHighlightForBoxes): Added. Takes the rects we calculated
1567         for the node and draws the highlight.
1568         (WebCore::InspectorController::drawNodeHighlight): Calculates the
1569         content/padding/border/margin boxes for blocks and passes them off to
1570         drawHighlightForBoxes. The behavior for inlines is for now unchanged.
1571
1572 2008-03-20  Adam Roben  <aroben@apple.com>
1573
1574         Fix RenderContainer's override of addLineBoxRects to match RenderObject's
1575
1576         RenderContainer::addLineBoxRects was never getting called because its
1577         parameters didn't match those of RenderObject::addLineBoxRects.
1578
1579         Reviewed by Mitz Pettel.
1580
1581         No test possible.
1582
1583         * rendering/RenderContainer.cpp: Added an optional bool
1584         useSelectionHeight parameter to match RenderObject's method.
1585         * rendering/RenderContainer.h: Ditto.
1586
1587 2008-03-20  Marco Barisione  <marco.barisione@collabora.co.uk>
1588
1589         Reviewed by Alp Toker.
1590
1591         http://bugs.webkit.org/show_bug.cgi?id=17946
1592         [GTK] Widgets are not clipped
1593
1594         * platform/gtk/RenderThemeGtk.cpp:
1595         (WebCore::paintMozWidget): pass the clipping rectangle to
1596         moz_gtk_widget_paint() instead of just the widget rectangle.
1597
1598 2008-03-20  David Hyatt  <hyatt@apple.com>
1599
1600         Fix for http://bugs.webkit.org/show_bug.cgi?id=9279
1601
1602         Make :hover work with the adjacent sibling selector.  This fix makes all forms of dynamic changes
1603         (class name changes, :hover, :focus, etc.) work properly when used with the + selector.
1604
1605         Reviewed by weinig
1606
1607         Added fast/css/dynamic-sibling-selector.html
1608
1609         * dom/Element.cpp:
1610         (WebCore::Element::recalcStyle):
1611
1612 2008-03-20  Aaron Golden  <aegolden@gmail.com>
1613
1614         Reviewed by Darin and David Kilzer.
1615
1616         Addresses <http://bugs.webkit.org/show_bug.cgi?id=15263>, which caused certain marquees to not display.
1617
1618         Test: fast/html/marquee-scroll.html
1619
1620         * html/HTMLMarqueeElement.cpp:
1621         (WebCore::HTMLMarqueeElement::parseMappedAttribute):
1622
1623 2008-03-20  Adam Roben  <aroben@apple.com>
1624
1625         Export InspectorController::drawNodeHighlight
1626
1627         Reviewed by Tim Hatcher.
1628
1629         * WebCore.base.exp: Also sorted this file.
1630
1631 2008-03-19  Stephanie Lewis  <slewis@apple.com>
1632
1633         Rubber-stamped by Anders.
1634
1635         Fix Windows Build
1636
1637         * platform/cf/SharedBufferCF.cpp:
1638         (WebCore::SharedBuffer::createCFData):
1639
1640 2008-03-19  Stephanie Lewis <slewis@apple.com>
1641
1642         Rubber-stamped by Anders.
1643
1644         Fix Windows Build
1645
1646         * platform/SharedBuffer.h:
1647
1648 2008-03-19  Justin Garcia  <justin.garcia@apple.com>
1649
1650         Reviewed by Oliver.
1651         
1652         <rdar://problem/5780697> Copying content with CSS property values that are percentages can cause fidelity issues
1653          
1654         Elements with height: x%; overflow: visible; overlap what's below them when they are copied from
1655         a document in quirksmode and pasted into to one in standards mode.  This fix uses the computed 
1656         the value for a property if its value is a percentage.
1657         
1658         * css/CSSMutableStyleDeclaration.cpp:
1659         (WebCore::CSSMutableStyleDeclaration::addParsedProperty): Added so that we don't have to use
1660         setProperty from appendStartMarkup.  We already have a parsed property value, so we shouldn't
1661         use setProperty, since it takes in a String.  If we did, we would have to call CSSValue::cssText()
1662         for a String only to re-parse it in setProperty.  This wasn't extremely important now, but it will 
1663         be as we compute more properties to fix the rest of the copy/paste fidelity bugs.
1664         * css/CSSMutableStyleDeclaration.h:
1665         * editing/markup.cpp:
1666         (WebCore::appendStartMarkup): Compute values for properties that have percentage values.  We could
1667         perhaps narrow this special case to only include properties that are effected by quirksmode.
1668
1669 2008-03-19  Sam Weinig  <sam@webkit.org>
1670
1671         Reviewed by Anders Carlsson.
1672
1673         Fix for <rdar://problem/5785694>
1674         Crash occurs at KJS::Collector::collect() when loading web clip widgets with a PAC file
1675
1676         Make the activeExecStates stack per JSGlobalObject instead of static to ensure
1677         thread safety.
1678
1679         * bindings/objc/WebScriptObject.mm:
1680         (+[WebScriptObject throwException:]): Change to throw an exception on the current
1681         GlobalObject instead of the top of the static activeExecStates stack.
1682         (-[WebScriptObject setException:]): Change to use the top of the rootObjects GlobalObject
1683         instead of the top of the static activeExecStates stack.
1684
1685         * bridge/c/c_instance.cpp:
1686         * bridge/c/c_instance.h:
1687         * bridge/jni/jni_instance.cpp:
1688         (JavaInstance::virtualBegin):
1689         (JavaInstance::virtualEnd):
1690         * bridge/jni/jni_instance.h:
1691         * bridge/objc/objc_instance.h:
1692         * bridge/objc/objc_instance.mm:
1693         (ObjcInstance::~ObjcInstance):
1694         (ObjcInstance::virtualBegin):
1695         (ObjcInstance::virtualEnd):
1696         * bridge/runtime.cpp:
1697         (KJS::Bindings::Instance::setDidExecuteFunction):
1698         (KJS::Bindings::Instance::didExecuteFunction):
1699         (KJS::Bindings::Instance::setCurrentGlobalObject): Added.
1700         (KJS::Bindings::Instance::currentGlobalObject): Added.
1701         (KJS::Bindings::Instance::begin):
1702         (KJS::Bindings::Instance::end):
1703         * bridge/runtime.h:
1704         (KJS::Bindings::Instance::virtualBegin): Renamed from begin().
1705         (KJS::Bindings::Instance::virtualEnd): Renamed from end().
1706         We now store the currently active globalObject everytime we cross the runtime
1707         object boundary.  To do this, we take advantage of the existing begin/end
1708         methods that are called when crossing this boundary, making begin set the current
1709         globalObject and then call the old begin, now called virtualBegin.
1710
1711 2008-03-19  Brady Eidson  <beidson@apple.com>
1712
1713         Reviewed by Anders
1714
1715         Change SharedBuffer so the wrapping platform data aspect can be shared with all CoreFoundation platforms
1716         (Mac and Windows instead of just Mac)
1717
1718         * WebCore.vcproj/WebCore.vcproj: Add SharedBufferCF.cpp
1719         * WebCore.xcodeproj/project.pbxproj: Ditto
1720
1721         * platform/SharedBuffer.cpp:
1722         * platform/SharedBuffer.h: Change the private c'tor from NSData to CFDataRef, other PLATFORM tweaks
1723
1724         * platform/cf/SharedBufferCF.cpp: Added.
1725         (WebCore::SharedBuffer::SharedBuffer):
1726         (WebCore::SharedBuffer::createCFData): Non-Mac version of createCFData
1727         (WebCore::SharedBuffer::hasPlatformData):
1728         (WebCore::SharedBuffer::platformData):
1729         (WebCore::SharedBuffer::platformDataSize):
1730         (WebCore::SharedBuffer::maybeTransferPlatformData):
1731         (WebCore::SharedBuffer::clearPlatformData):
1732
1733         * platform/mac/SharedBufferMac.mm:
1734         (WebCore::SharedBuffer::wrapNSData): Use the CFDataRef constructor via toll-free bridging
1735         (WebCore::SharedBuffer::createCFData): Mac-specific version of createCFData
1736
1737 2008-03-19  Oliver Hunt  <oliver@apple.com>
1738
1739         Reviewed by Antti.
1740
1741         Bug 17954: Canvas arc() with radius of 0 throws exception
1742         http://bugs.webkit.org/show_bug.cgi?id=17954
1743
1744         Simple fix -- use >= instead of > when validating the radius.
1745
1746         * html/CanvasRenderingContext2D.cpp:
1747         (WebCore::CanvasRenderingContext2D::arc):
1748
1749 2008-03-19  Justin Garcia  <justin.garcia@apple.com>
1750
1751         Reviewed by Oliver.
1752
1753         <rdar://problem/5794920> Acid3: Assertion failure in VisiblePosition::previous when clicking on results (17004)
1754         
1755         The position inside an empty inline-block was a candidate, but upstream and downstream
1756         would move across it without stopping.  This confused canonicalPosition, since no more
1757         than two candidates should have the same upstream/downstream (be visually equivalent).
1758         
1759         Code was added intentionally in isCandidate to make VisiblePositions inside empty 
1760         inline-blocks, so we need to make upstream/downstream understand that.
1761
1762         * dom/Position.cpp:
1763         (WebCore::endsOfNodeAreVisuallyDistinctPositions): upstream and downstream used to only
1764         stop when entering or leaving a non-inline element (referred to as a "block").  We must also 
1765         avoid entering or leaving an empty inline-block.  This will allow a VisiblePosition there, to 
1766         match up with what the code in isCandidate intended.
1767         (WebCore::enclosingVisualBoundary): Removed enclosingBlock and replaced it with this.
1768         (WebCore::Position::upstream): Added better comments, called the new functions.
1769         (WebCore::Position::downstream): Ditto.
1770         * dom/Position.h:
1771
1772 2008-03-19  Dan Bernstein  <mitz@apple.com>
1773
1774         Rubber-stamped by John Sullivan.
1775
1776         - change CSS property and value keyword constants from all-caps with
1777           underscores to intra-caps.
1778
1779         * css/makeprop.pl:
1780         * css/makevalues.pl:
1781         * All files using the constants
1782
1783 2008-03-19  Adam Roben  <aroben@apple.com>
1784
1785         Make clicking anywhere in a row in the DOM tree select that row's node
1786
1787         We now have mousedown and dblclick event listeners on the root of the
1788         tree that forward the event to the node on the row the mouse is over.
1789
1790         Reviewed by Tim Hatcher.
1791
1792         * page/inspector/DocumentPanel.js:
1793         (WebInspector.DocumentPanel): Added a dblclick and mousedown event
1794         listeners to the root of the tree.
1795         (WebInspector.DocumentPanel._treeElementFromEvent): Added. Finds the
1796         tree element for the row underneath the mouse.
1797         (WebInspector.DocumentPanel._ondblclick): Added. Sends the dblclick
1798         event on to the tree element in the current row.
1799         (WebInspector.DocumentPanel._onmousedown): Added. Selects the tree
1800         element in the current row.
1801         * page/inspector/treeoutline.js:
1802         (TreeOutline.treeElementFromPoint): Added.
1803         (TreeElement.treeElementSelected): Changed to call
1804         TreeElement.isEventWithinDisclosureTriangle, and added an early return.
1805         (TreeElement.treeElementToggled): Ditto.
1806         (TreeElement.isEventWithinDisclosureTriangle): Added.
1807         * page/inspector/utilities.js:
1808         (Node.enclosingNodeOrSelfWithNodeNameInArray): Added.
1809         (Node.enclosingNodeOrSelfWithNodeName): Now just calls
1810         enclosingNodeOrSelfWithNodeNameInArray.
1811         (Elemnt.get totalOffsetLeft): Added.
1812         (Elemnt.get totalOffsetTop): Added.
1813
1814 2008-03-19  Dan Bernstein  <mitz@apple.com>
1815
1816         Reviewed by Sam Weinig.
1817
1818         - fix assertion failure in RenderBlock::determineStartPosition() at http://www.wired.com/techbiz/it/magazine/16-04/bz_apple
1819
1820         Test: fast/repaint/line-flow-with-floats-10.html
1821
1822         * rendering/bidi.cpp:
1823         (WebCore::RenderBlock::determineStartPosition): Removed bogus assertion.
1824         If the float's top margin has changed and it has not been repositioned
1825         yet, we do not have its new y position.
1826
1827 2008-03-19  David Hyatt  <hyatt@apple.com>
1828
1829         New implementation of full page zoom.  Because of how much doesn't transform when zooming, and because
1830         of the need to obey viewport constraints, I decided to take a completely different approach.  Now CSS
1831         lengths and intrinsic sizes are simply adjusted by the zoom factor.  This approach works much better and
1832         avoids pixel cracks more than the old approach.   In addition widgets "just work", namely plugins zoom
1833         and scrollbars do not.
1834
1835         This patch also implements the IE zoom CSS property.  This property allows fine-grained control over
1836         zooming at the element level.  It takes values of normal | <number> | <percentage> to match WinIE.  In
1837         addition, in the vein of text-size-adjust for text zooming, I have extended the zoom property with an
1838         extra value, reset.  The reset keyword can be used to prevent a section of the page from scaling at all
1839         when a zoom is applied.
1840
1841         Reviewed by olliej
1842
1843         * css/CSSComputedStyleDeclaration.cpp:
1844         (WebCore::):
1845         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
1846         Support the new 'zoom' property for getComputedStyle.
1847
1848         * css/CSSParser.cpp:
1849         (WebCore::CSSParser::parseValue):
1850         Code that parses the 'zoom' property.
1851
1852         * css/CSSPrimitiveValue.cpp:
1853         (WebCore::CSSPrimitiveValue::computeLengthInt):
1854         (WebCore::CSSPrimitiveValue::computeLengthIntForLength):
1855         (WebCore::CSSPrimitiveValue::computeLengthShort):
1856         (WebCore::CSSPrimitiveValue::computeLengthFloat):
1857         (WebCore::CSSPrimitiveValue::computeLengthDouble):
1858         * css/CSSPrimitiveValue.h:
1859         Extend all of the computeLength methods to take a multiplier so that lengths can be adjusted by the
1860         zoom factor.
1861
1862         * css/CSSPropertyNames.in:
1863         Add the new zoom property to the list of properties we understand.
1864
1865         * css/CSSStyleSelector.cpp:
1866         (WebCore::CSSStyleSelector::applyDeclarations):
1867         (WebCore::CSSStyleSelector::applyProperty):
1868         (WebCore::CSSStyleSelector::mapBackgroundSize):
1869         (WebCore::CSSStyleSelector::mapBackgroundXPosition):
1870         (WebCore::CSSStyleSelector::mapBackgroundYPosition):
1871         (WebCore::CSSStyleSelector::getComputedSizeFromSpecifiedSize):
1872         * css/CSSStyleSelector.h:
1873         (WebCore::CSSStyleSelector::setStyle):
1874         Pass in the zoom factor when computing all lengths in CSS.
1875
1876         * css/CSSValueKeywords.in:
1877         Add support for the 'reset' keyword of the zoom property.
1878
1879         * dom/Document.cpp:
1880         (WebCore::Document::recalcStyle):
1881         Set the 'zoom' CSS property on the RenderView.  This is how we implement full page zoom.
1882
1883         * html/CanvasRenderingContext2D.cpp:
1884         (WebCore::size):
1885         Make sure the back end canvas size ignores zooming when rendering images.
1886
1887         * html/HTMLImageElement.cpp:
1888         (WebCore::HTMLImageElement::width):
1889         (WebCore::HTMLImageElement::height):
1890         (WebCore::HTMLImageElement::naturalWidth):
1891         (WebCore::HTMLImageElement::naturalHeight):
1892         Use the unzoomed width/height if we have no style information in HTMLImageElement.cpp.
1893
1894         * loader/CachedImage.cpp:
1895         (WebCore::CachedImage::ref):
1896         (WebCore::CachedImage::imageSize):
1897         (WebCore::CachedImage::imageRect):
1898         * loader/CachedImage.h:
1899         (WebCore::CachedImage::canRender):
1900         Force access to the CachedImage metrics to take a multiplier so that people have to think about
1901         the zoom factor.  The "intrinsic size" of the image then takes that into account.
1902
1903         * loader/ImageDocument.cpp:
1904         (WebCore::ImageTokenizer::finish):
1905         (WebCore::ImageDocument::scale):
1906         (WebCore::ImageDocument::resizeImageToFit):
1907         (WebCore::ImageDocument::imageChanged):
1908         (WebCore::ImageDocument::restoreImageSize):
1909         (WebCore::ImageDocument::imageFitsInWindow):
1910         Make sure image documents respect the zoom.
1911
1912         * page/AnimationController.cpp:
1913         (WebCore::ImplicitAnimation::animate):
1914         Make the 'zoom' CSS property work with CSS transitions.
1915
1916         * page/Frame.h:
1917         (WebCore::Frame::pageZoomFactor):
1918         (WebCore::Frame::textZoomFactor):
1919         Add accessors for obtaining the pageZoom vs. textZoom.
1920
1921         * page/FrameView.cpp:
1922         (WebCore::FrameView::adjustViewSize):
1923         Remove the old zoom implementation that used transforms.
1924
1925         * page/mac/WebCoreAXObject.mm:
1926         (-[WebCoreAXObject accessibilityIsIgnored]):
1927         Pass in the zoom factor.
1928
1929         * rendering/InlineFlowBox.cpp:
1930         (WebCore::InlineFlowBox::paintBackground):
1931         (WebCore::InlineFlowBox::paintBoxDecorations):
1932         Pass in the zoom factor when testing for size.
1933
1934         * rendering/RenderBox.cpp:
1935         (WebCore::RenderBox::calculateBackgroundSize):
1936         (WebCore::RenderBox::imageChanged):
1937         (WebCore::RenderBox::paintBackgroundExtended):
1938         (WebCore::RenderBox::calcHeight):
1939         * rendering/RenderFrameSet.cpp:
1940         (WebCore::RenderFrameSet::layout):
1941         * rendering/RenderHTMLCanvas.cpp:
1942         (WebCore::RenderHTMLCanvas::canvasSizeChanged):
1943         * rendering/RenderHTMLCanvas.h:
1944         (WebCore::RenderHTMLCanvas::renderName):
1945         (WebCore::RenderHTMLCanvas::intrinsicSizeChanged):
1946         * rendering/RenderImage.cpp:
1947         (WebCore::RenderImage::setImageSizeForAltText):
1948         (WebCore::RenderImage::imageChanged):
1949         (WebCore::RenderImage::calcReplacedWidth):
1950         (WebCore::RenderImage::calcReplacedHeight):
1951         * rendering/RenderImage.h:
1952         (WebCore::RenderImage::intrinsicSizeChanged):
1953         * rendering/RenderListMarker.cpp:
1954         (WebCore::RenderListMarker::layout):
1955         (WebCore::RenderListMarker::imageChanged):
1956         (WebCore::RenderListMarker::getRelativeMarkerRect):
1957         * rendering/RenderObject.cpp:
1958         (WebCore::RenderObject::mustRepaintBackgroundOrBorder):
1959         (WebCore::RenderObject::paintBorder):
1960         Pass in the zoom factor when testing for size.
1961
1962         * rendering/RenderReplaced.cpp:
1963         (WebCore::RenderReplaced::RenderReplaced):
1964         (WebCore::RenderReplaced::setStyle):
1965         (WebCore::RenderReplaced::intrinsicSizeChanged):
1966         * rendering/RenderReplaced.h:
1967         Added a new call when the zoom factor changes, intrinsicSizeChanged().  Replaced element subclasses
1968         respond to this via overrides.
1969
1970         * rendering/RenderStyle.cpp:
1971         (WebCore::StyleVisualData::StyleVisualData):
1972         (WebCore::StyleInheritedData::StyleInheritedData):
1973         (WebCore::StyleInheritedData::operator==):
1974         (WebCore::RenderStyle::diff):
1975         * rendering/RenderStyle.h:
1976         (WebCore::StyleVisualData::operator==):
1977         (WebCore::RenderStyle::zoom):
1978         (WebCore::RenderStyle::zoomInEffect):
1979         (WebCore::RenderStyle::setZoom):
1980         (WebCore::RenderStyle::setZoomInEffect):
1981         (WebCore::RenderStyle::initialZoom):
1982         Support for 'zoom' in the RenderStyle.  "zoomInEffect" represents the computed zoom taking into account
1983         all the zooms specified on ancestors.
1984
1985         * rendering/RenderTableCol.cpp:
1986         (WebCore::RenderTableCol::imageChanged):
1987         * rendering/RenderTableRow.cpp:
1988         (WebCore::RenderTableRow::imageChanged):
1989         * rendering/RenderTableSection.cpp:
1990         (WebCore::RenderTableSection::imageChanged):
1991         * rendering/RenderVideo.h:
1992         (WebCore::RenderVideo::intrinsicSizeChanged):
1993         Pass in the zoom factor.
1994
1995         * rendering/RenderView.cpp:
1996         (WebCore::RenderView::calcHeight):
1997         (WebCore::RenderView::calcWidth):
1998         (WebCore::RenderView::layout):
1999         (WebCore::RenderView::viewHeight):
2000         (WebCore::RenderView::viewWidth):
2001         * rendering/RenderView.h:
2002         (WebCore::RenderView::zoomFactor):
2003         Back out the old implementation.
2004
2005 2008-03-19  Adam Roben  <aroben@apple.com>
2006
2007         Rename firstParent* methods to enclosingNode*
2008
2009         Rubberstamped by John Sullivan.
2010
2011         * page/inspector/ConsolePanel.js:
2012         * page/inspector/DocumentPanel.js:
2013         * page/inspector/NetworkPanel.js:
2014         * page/inspector/inspector.js:
2015         * page/inspector/utilities.js:
2016
2017 2008-03-19  Dan Bernstein  <mitz@apple.com>
2018
2019         Reviewed by John Sullivan.
2020
2021         - fix <rdar://problem/5805070> CrashTracer: [USER] 33 crashes in Safari at com.apple.WebCore: WebCore::FrameView::layout + 431
2022
2023         Test: fast/dynamic/subtree-parent-static-y.html
2024
2025         * rendering/RenderObject.cpp:
2026         (WebCore::RenderObject::markContainingBlocksForLayout): Avoid calling
2027         this method on the parent if the parent is the new layout subtree root,
2028         which would result in marking all the way to the top, when it should
2029         actually do nothing.
2030
2031 2008-03-19  Mark Rowe  <mrowe@apple.com>
2032
2033         Reviewed by Oliver Hunt.
2034
2035         Use WTF::Unicode abstraction rather than using ICU functions directly.
2036
2037         * html/PreloadScanner.cpp:
2038         (WebCore::PreloadScanner::tokenize):
2039
2040 2008-03-19  Mark Rowe  <mrowe@apple.com>
2041
2042         Attempt to fix the Gtk build.
2043
2044         * platform/network/curl/ResourceHandleCurl.cpp:
2045         (WebCore::ResourceHandle::setHostAllowsAnyHTTPSCertificate):
2046
2047 2008-03-18  Darin Adler  <darin@apple.com>
2048
2049         Reviewed by Maciej.
2050
2051         - Speed up JavaScript built-in properties by changing the
2052           hash table to take advantage of the identifier objects
2053
2054         5% speedup for Acid3 test 26
2055
2056         * bindings/js/JSDOMWindowBase.cpp:
2057         (WebCore::JSDOMWindowBase::getOwnPropertySlot): Update for change to HashTable.
2058         (WebCore::JSDOMWindowBase::put): Ditto.
2059         * bindings/js/JSDOMWindowCustom.cpp:
2060         (WebCore::JSDOMWindow::customGetOwnPropertySlot): Ditto.
2061         * bindings/js/JSHTMLInputElementBase.cpp:
2062         (WebCore::JSHTMLInputElementBase::getOwnPropertySlot): Ditto.
2063         * bindings/js/JSHistoryCustom.cpp:
2064         (WebCore::JSHistory::customGetOwnPropertySlot): Ditto.
2065         * bindings/js/JSLocation.cpp:
2066         (WebCore::JSLocation::customGetOwnPropertySlot): Ditto.
2067         (WebCore::JSLocation::put): Ditto.
2068         * bindings/js/kjs_binding.cpp:
2069         (WebCore::nonCachingStaticFunctionGetter): Ditto.
2070
2071         * bindings/scripts/CodeGeneratorJS.pm: Same changes as in the
2072         create_hash_table script.
2073
2074 2008-03-18  Matt Lilek  <webkit@mattlilek.com>
2075
2076         Fix the Gtk build for real this time.
2077
2078         * platform/network/curl/AuthenticationChallenge.h:
2079
2080 2008-03-18  Sam Weinig  <sam@webkit.org>
2081
2082         Reviewed by Anders Carlsson.
2083
2084         Fix for http://bugs.webkit.org/show_bug.cgi?id=17057
2085         REGRESSION: Frequent random crashes in WebCore::JSNodeList::indexGetter
2086         <rdar://problem/5725058>
2087
2088         Tests: fast/dom/NodeList/5725058-crash-scenario-1.html
2089                fast/dom/NodeList/5725058-crash-scenario-2.html
2090                fast/dom/NodeList/5725058-crash-scenario-3.html
2091
2092         * dom/ChildNodeList.cpp: 
2093         (WebCore::ChildNodeList::ChildNodeList):
2094         * dom/ChildNodeList.h:
2095         Remove rootNodeChildrenChanged() method and fix the constructor to not 
2096         pass in a needsNotifications argument to DynamicNodeList, as it no longer
2097         takes one.
2098
2099         * dom/ClassNodeList.cpp:
2100         (WebCore::ClassNodeList::ClassNodeList):
2101         Don't pass the needsNotifications argument to DynamicNodeList.
2102
2103         * dom/ContainerNode.cpp:
2104         (WebCore::ContainerNode::childrenChanged):
2105         Rename call to hasNodeLists() to hasNodeListCaches().
2106
2107         * dom/Document.cpp:
2108         (WebCore::Document::Document):
2109         (WebCore::Document::~Document): Zero out the m_document variable to signify
2110         to destructors down the destruction chain that this is a Document type node
2111         being destructed, and thus, accessing document() is prohibited.
2112         * dom/Document.h:
2113         (WebCore::Document::addNodeListCache): Renamed from addNodeList.
2114         (WebCore::Document::removeNodeListCache): Renamed from removeNodeList, adds assertion.
2115         (WebCore::Document::hasNodeListCaches): Renamed from hasNodeListCaches.
2116         Rename m_numNodeLists to m_numNodeListCaches.
2117
2118         * dom/DynamicNodeList.cpp:
2119         (WebCore::DynamicNodeList::DynamicNodeList):
2120         (WebCore::DynamicNodeList::~DynamicNodeList):
2121         (WebCore::DynamicNodeList::invalidateCache):
2122         (WebCore::DynamicNodeList::Caches::Caches):
2123         * dom/DynamicNodeList.h:
2124         (WebCore::DynamicNodeList::hasOwnCaches):
2125         Remove the needsNotifications concept from DynamicNodeList, instead, manually
2126         invalidate the cache for lists that own their own cache.
2127
2128         * dom/NameNodeList.cpp:
2129         (WebCore::NameNodeList::NameNodeList):
2130         * dom/NameNodeList.h:
2131         Remove rootNodeAttributeChanged() method and fix the constructor to not 
2132         pass in a needsNotifications argument to DynamicNodeList, as it no longer
2133         takes one.
2134
2135         * dom/Node.cpp:
2136         (WebCore::Node::~Node): Decrement the document's nodeListCache count
2137         if we had a NodeListsNodeData cache and this is not the Document being
2138         destructor, as tagged by a null m_document.
2139         (WebCore::Node::childNodes): Increment the document's nodeListCache count 
2140         if we need create the NodeListsNodeData.
2141         (WebCore::Node::registerDynamicNodeList): Increment the document's nodeListCache count 
2142         if we need create the NodeListsNodeData.  Change to invalidate all the caches, instead 
2143         of just the ChildNodeList, if document has had no NodeListCaches.
2144         (WebCore::Node::unregisterDynamicNodeList): Change to remove the cache from the m_listsWithCaches
2145         set if it is owned by the NodeList and clear the m_nodeLists if it is empty.
2146         (WebCore::Node::notifyLocalNodeListsAttributeChanged): Move logic to 
2147         NodeListsNodeData::invalidateAttributeCaches and clear the cache pointer if it is empty.
2148         (WebCore::Node::notifyLocalNodeListsChildrenChanged): Move logic to 
2149         NodeListsNodeData::invalidateCaches and clear the cache pointer if it is empty.
2150         (WebCore::Node::notifyNodeListsChildrenChanged): Cleanup.
2151         (WebCore::Node::getElementsByName): Increment the document's nodeListCache count 
2152         if we need create the NodeListsNodeData.
2153         (WebCore::Node::getElementsByClassName): Increment the document's nodeListCache count 
2154         if we need create the NodeListsNodeData.
2155
2156         (WebCore::NodeListsNodeData::invalidateCaches): Added.
2157         (WebCore::NodeListsNodeData::invalidateAttributeCaches): Added.
2158         (WebCore::NodeListsNodeData::isEmpty): Added.
2159
2160         * dom/TagNodeList.cpp:
2161         (WebCore::TagNodeList::TagNodeList):
2162         Don't pass the needsNotifications argument to DynamicNodeList.
2163
2164 2008-03-18  Matt Lilek  <webkit@mattlilek.com>
2165
2166         Not reviewed, build fix.
2167
2168         * platform/network/curl/AuthenticationChallenge.h:
2169
2170 2008-03-18  Brent Fulgham  <bfulgham@gmail.com>
2171
2172         Reviewed by Adam Roben.
2173
2174         Provide some stub implementations for things that WebKit
2175         uses for performing authentication/challenge activities.  This
2176         is in support of http://bugs.webkit.org/show_bug.cgi?id=17837
2177
2178         * platform/network/ResourceHandle.h:
2179         * platform/network/curl/AuthenticationChallenge.h:
2180         (WebCore::AuthenticationChallenge::AuthenticationChallenge):
2181         (WebCore::AuthenticationChallenge::sourceHandle):
2182
2183 2008-03-18  Eric Seidel  <eric@webkit.org>
2184
2185         Reviewed by Oliver.
2186
2187         Fix SVGImage crash seen once, and obvious via code inspection.
2188         
2189         I was not able to find a test case for this.
2190
2191         * svg/graphics/SVGImage.cpp:
2192         (WebCore::SVGImage::setContainerSize):
2193         (WebCore::SVGImage::usesContainerSize):
2194         (WebCore::SVGImage::hasRelativeWidth):
2195         (WebCore::SVGImage::hasRelativeHeight):
2196
2197 2008-03-18  Rodney Dawes  <dobey@wayofthemonkey.com>
2198
2199         Fix Qt build after r31123.
2200
2201         Add PluginView methods to TemporaryLinkStubs.
2202
2203         * platform/qt/TemporaryLinkStubs.cpp:
2204
2205 2008-03-18  Sam Weinig  <sam@webkit.org>
2206
2207         Reviewed by Darin Adler.
2208
2209         - Speed up JavaScript prototype and constructor object creation
2210           using a static Identifier in the self() methods to avoid the
2211           cost of creating one from a c-string each time.
2212
2213         5% speedup for Acid3 test 26
2214
2215         * bindings/scripts/CodeGeneratorJS.pm:
2216
2217 2008-03-18  Antti Koivisto  <antti@apple.com>
2218
2219         Reviewed by Mark Rowe.
2220
2221         Enable preloading for other platforms besides Mac.
2222
2223         * GNUmakefile.am:
2224         * WebCore.pro:
2225         * WebCore.vcproj/WebCore.vcproj:
2226         * WebCoreSources.bkl:
2227         * html/HTMLTokenizer.cpp:
2228         * html/HTMLTokenizer.h:
2229         * html/PreloadScanner.cpp:
2230         (WebCore::PreloadScanner::tokenize):
2231
2232 2008-03-18  Dan Bernstein  <mitz@apple.com>
2233
2234         Reviewed by Adele Peterson.
2235
2236         - fix <rdar://problem/5805127> REGRESSION (r31116): Assertion failure (floatIndex < floats.size()) in RenderBlock::determineStartPosition() at digg.com
2237
2238         Test: fast/dynamic/floating-to-positioned.html
2239
2240         * rendering/RenderObject.cpp:
2241         (WebCore::RenderObject::setStyle): Added code to remove a float from
2242         object lists if its position property changes to something other than
2243         static, since then it ceases to be a float.
2244
2245 2008-03-18  Adam Roben  <aroben@apple.com>
2246
2247         Windows build fix after r31123
2248
2249         * plugins/win/PluginViewWin.cpp: Add back MozillaUserAgent.
2250
2251 2008-03-18  Dan Bernstein  <mitz@apple.com>
2252
2253         Reviewed by Darin Adler.
2254
2255         - eliminate RenderFlow::m_clear
2256
2257         * rendering/RenderBlock.cpp:
2258         (WebCore::RenderBlock::layoutBlock): Removed code to set m_clear.
2259         (WebCore::RenderBlock::newLine): Added a 'clear' parameter.
2260         * rendering/RenderBlock.h:
2261         * rendering/RenderFlow.h:
2262         (WebCore::RenderFlow::RenderFlow): Removed initialization of m_clear.
2263         * rendering/bidi.cpp:
2264         (WebCore::RenderBlock::layoutInlineChildren): Added a local 'clear'
2265         variable, passing a pointer to it to findNextLineBreak() and its value
2266         to newLine(). 
2267         (WebCore::RenderBlock::findNextLineBreak): Added a 'clear' parameter,
2268         which this method adjusts when it encounters a <br>.
2269
2270 2008-03-18  Simon Hausmann  <hausmann@webkit.org>
2271
2272         Reviewed by Holger.
2273
2274         Fix the Qt build and clean up the invoke mechanism for dispatching
2275         functions in the main thread by using QMetaObject::invokeMethod
2276         instead of posting a null event.
2277
2278         * platform/qt/MainThreadQt.cpp:
2279
2280 2008-03-18  Rodney Dawes  <dobey@wayofthemonkey.com>
2281
2282         Fix Mac build from commit of r31123.
2283
2284         Add a typedef for NSView* to PlatformWidget, remove duplicate PluginMessageThrottlerWin definition.
2285
2286         * platform/Widget.h:
2287         * WebCore.vcproj/WebCore.vcproj:
2288
2289 2008-03-18  Rodney Dawes  <dobey@wayofthemonkey.com>
2290
2291         Reviewed by Jon Honeycutt.
2292
2293         Add PluginView.cpp and npapi.cpp to build files.
2294         Copy win/PluginViewWin.cpp to PluginView.cpp for shared code.
2295         Split Windows specific code out of PluginView.cpp.
2296         Add #if USE(NPOBJECT) around dependant code.
2297         Use npruntime_internal.h instead of npapi.h.
2298         Add PlatformWidget typedef to Widget.h.
2299         Update WidgetGtk.cpp for the PlatformWidget usage.
2300         Add needed methods to TemporaryLinkStubs for GTK+ port.
2301
2302         * GNUmakefile.am:
2303         * WebCore.pro:
2304         * WebCoreSources.bkl:
2305         * WebCore.vcproj/WebCore.vcproj:
2306         * plugins/win/PluginViewWin.cpp:
2307         * plugins/PluginView.cpp:
2308         * plugins/PluginView.h:
2309         * plugins/npapi.cpp:
2310         * platform/Widget.h:
2311         * platform/gtk/WidgetGtk.cpp:
2312         * platform/gtk/TemporaryLinkStubs.cpp:
2313
2314 2008-03-17  Darin Adler  <darin@apple.com>
2315
2316         Reviewed by Maciej.
2317
2318         - speed up document property fetching (eliminate the AtomicString
2319           objects made during document property lookup)
2320
2321         3% speedup for Acid3 test 26
2322
2323         * bindings/js/JSDOMWindowBase.cpp:
2324         (WebCore::JSDOMWindowBase::getOwnPropertySlot): Use AtomicString::find to
2325         locate the AtomicString, only if already present. Also call the new faster
2326         versions of the hasNamedItem and hasElementWithId functions that don't
2327         ref/deref the AtomicStringImpl, get inlined, etc.
2328         * bindings/js/JSHTMLDocumentCustom.cpp:
2329         (WebCore::JSHTMLDocument::canGetItemsForName): Ditto.
2330         (WebCore::writeHelper): Use a Vector instead of a String to build up
2331         the string to avoid the bad performance of string append.
2332
2333         * dom/Document.cpp: Tweaked code and comments a bit. Nothing substantive.
2334         * dom/Document.h: Added new hasElementWithId function that's faster than
2335         getElementById because it doesn't ref/deref the AtomicStringImpl*, gets
2336         inlined, doesn't have to handle the 0 case, and doesn't try to return the
2337         element pointer (just a boolean).
2338
2339         * html/HTMLAppletElement.cpp:
2340         (WebCore::HTMLAppletElement::parseMappedAttribute): Use AtomicString
2341         consistently. Also renamed the data member for clarity.
2342         (WebCore::HTMLAppletElement::insertedIntoDocument): Ditto.
2343         (WebCore::HTMLAppletElement::removedFromDocument): Ditto.
2344         * html/HTMLAppletElement.h: Ditto.
2345
2346         * html/HTMLDocument.cpp:
2347         (WebCore::addItemToMap): Use AtomicString instead of String.
2348         (WebCore::removeItemFromMap): Ditto.
2349         (WebCore::HTMLDocument::addNamedItem): Updated for member name change.
2350         (WebCore::HTMLDocument::removeNamedItem): Ditto.
2351         (WebCore::HTMLDocument::addExtraNamedItem): Ditto.
2352         (WebCore::HTMLDocument::removeExtraNamedItem): Ditto.
2353         (WebCore::HTMLDocument::clear): Added. Moved code here from the JavaScript
2354         bindings. If we're going to have an empty placeholder function, there's no
2355         reason to have it in the bindings instead of here.
2356         * html/HTMLDocument.h: Added clear. Changed the named item function
2357         arguments to AtomicString insted of String. Changed the NameCountMap to
2358         use AtomicStringImpl* instead of StringImpl*. Renamed the data members
2359         to add a m_ prefix and remove the needless doc prefix. Added hasNamedItem
2360         and hasExtraNamedItem functions that are inlined and faster than the old
2361         idiom because they doesn't ref/deref the AtomicStringImpl*, get inlined,
2362         and don't have to handle the 0 case.
2363         * html/HTMLDocument.idl: Removed the [Custom] attribute on clear and took
2364         it out of the JavaScript-specific section.
2365
2366         * html/HTMLEmbedElement.cpp:
2367         (WebCore::HTMLEmbedElement::parseMappedAttribute): Use AtomicString
2368         consistently. Also renamed the data member for clarity.
2369         (WebCore::HTMLEmbedElement::insertedIntoDocument): Ditto.
2370         (WebCore::HTMLEmbedElement::removedFromDocument): Ditto.
2371         * html/HTMLFormElement.cpp:
2372         (WebCore::HTMLFormElement::insertedIntoDocument): Ditto.
2373         (WebCore::HTMLFormElement::removedFromDocument): Ditto.
2374         (WebCore::HTMLFormElement::parseMappedAttribute): Ditto.
2375         * html/HTMLFormElement.h: Ditto.
2376
2377         * html/HTMLFrameElementBase.cpp:
2378         (WebCore::HTMLFrameElementBase::openURL): Renamed m_name to m_frameName for
2379         clarity, since the frame name is not the same as the name attribute.
2380         (WebCore::HTMLFrameElementBase::parseMappedAttribute): Ditto.
2381         (WebCore::HTMLFrameElementBase::setNameAndOpenURL): Ditto.
2382         * html/HTMLFrameElementBase.h: Ditto.
2383
2384         * html/HTMLIFrameElement.cpp:
2385         (WebCore::HTMLIFrameElement::parseMappedAttribute): Use AtomicString
2386         consistently. Also renamed the data member for clarity.
2387         (WebCore::HTMLIFrameElement::insertedIntoDocument): Ditto.
2388         (WebCore::HTMLIFrameElement::removedFromDocument): Ditto.
2389         * html/HTMLIFrameElement.h: Ditto.
2390         * html/HTMLImageElement.cpp:
2391         (WebCore::HTMLImageElement::parseMappedAttribute): Ditto.
2392         (WebCore::HTMLImageElement::insertedIntoDocument): Ditto.
2393         (WebCore::HTMLImageElement::removedFromDocument): Ditto.
2394         * html/HTMLImageElement.h: Ditto.
2395         * html/HTMLObjectElement.cpp:
2396         (WebCore::HTMLObjectElement::parseMappedAttribute): Ditto.
2397         (WebCore::HTMLObjectElement::insertedIntoDocument): Ditto.
2398         (WebCore::HTMLObjectElement::removedFromDocument): Ditto.
2399         (WebCore::HTMLObjectElement::updateDocNamedItem): Ditto.
2400         * html/HTMLObjectElement.h: Ditto.
2401
2402         * html/HTMLParamElement.cpp:
2403         (WebCore::HTMLParamElement::isURLAttribute): Use equalIgnoringCase instead
2404         of callling lower().
2405
2406         * html/HTMLPlugInElement.h: Changed the type of m_name. The code that
2407         uses this is in HTMLAppletElement, HTMLEmbedElement, and HTMLObjectElement.
2408
2409         * platform/text/AtomicString.cpp:
2410         (WebCore::equal): Moved to an inline so we can share this code between a
2411         few different functions. It could move to a header too if we want to use
2412         it elsewhere.
2413         (WebCore::UCharBufferTranslator::equal): Change to use inline.
2414         (WebCore::HashAndCharactersTranslator::hash): Added.
2415         (WebCore::HashAndCharactersTranslator::equal): Added.
2416         (WebCore::HashAndCharactersTranslator::translate): Added.
2417         (WebCore::AtomicString::add): Improved the Identifier and UString overloads
2418         to use the already-computed hash code instead of rehashing the string.
2419         (WebCore::AtomicString::find): Added.
2420         * platform/text/AtomicString.h: Added a find function so we can avoid
2421         allocating memory just to look up a string in an atomic string set or map.
2422
2423         * platform/text/StringImpl.h: Added declarations needed for the
2424         AtomicString changes.
2425
2426 2008-03-17  Timothy Hatcher  <timothy@apple.com>
2427
2428         Reviewed by Mark Rowe.
2429
2430         Bug 17908: Various bugs in the Console completion code
2431         http://bugs.webkit.org/show_bug.cgi?id=17908
2432
2433         * page/inspector/ConsolePanel.js:
2434         (WebInspector.ConsolePanel.complete): Moved the code that checked for the caret being at the end
2435         of the prompt into the _caretAtEndOfPrompt helper function.
2436         (WebInspector.ConsolePanel.messagesSelectStart): Clear and redo the auto complete when the selection changes.
2437         (WebInspector.ConsolePanel._caretInsidePrompt): Fixed a logic error that always caused a false result.
2438         (WebInspector.ConsolePanel._caretAtEndOfPrompt): Added. Tests if the selection is a caret at the
2439         end of the prompt.
2440         (WebInspector.ConsolePanel._moveCaretToEndOfPrompt): Changed the offset to use the childNodes length.
2441         This makes sure the caret is at the end when there are multiple text nodes in the prompt.
2442
2443 2008-03-17  Dan Bernstein  <mitz@apple.com>
2444
2445         Rubber-stamped by Dave Hyatt.
2446
2447         - FloatingObject cleanup
2448
2449         Renamed FloatingObject's data members as follows: node -> m_renderer,
2450         startY -> m_top, endY -> m_bottom, left -> m_left, width -> m_width,
2451         and noPaint -> !m_shouldPaint, reversing the meaning of the flag.
2452
2453         Also addressed the FIXME in RenderBlock::containsFloat().
2454
2455         * rendering/RenderBlock.cpp:
2456         (WebCore::RenderBlock::repaintOverhangingFloats):
2457         (WebCore::RenderBlock::paintFloats):
2458         (WebCore::RenderBlock::insertFloatingObject):
2459         (WebCore::RenderBlock::removeFloatingObject):
2460         (WebCore::RenderBlock::positionNewFloats):
2461         (WebCore::RenderBlock::leftRelOffset):
2462         (WebCore::RenderBlock::rightRelOffset):
2463         (WebCore::RenderBlock::nextFloatBottomBelow):
2464         (WebCore::RenderBlock::floatBottom):
2465         (WebCore::RenderBlock::floatRect):
2466         (WebCore::RenderBlock::lowestPosition):
2467         (WebCore::RenderBlock::rightmostPosition):
2468         (WebCore::RenderBlock::leftmostPosition):
2469         (WebCore::RenderBlock::leftBottom):
2470         (WebCore::RenderBlock::rightBottom):
2471         (WebCore::RenderBlock::clearFloats):
2472         (WebCore::RenderBlock::addOverhangingFloats):
2473         (WebCore::RenderBlock::addIntrudingFloats):
2474         (WebCore::RenderBlock::containsFloat): Changed to return false if the
2475         floats lists exists but is empty, since line layout code no longer
2476         relies on the buggy behavior.
2477         (WebCore::RenderBlock::nodeAtPoint):
2478         (WebCore::RenderBlock::adjustForBorderFit):
2479         * rendering/RenderBlock.h:
2480         (WebCore::RenderBlock::containsFloats):
2481         (WebCore::RenderBlock::FloatingObject::FloatingObject):
2482         * rendering/bidi.cpp:
2483         (WebCore::RenderBlock::layoutInlineChildren):
2484         (WebCore::RenderBlock::matchedEndLine):
2485
2486 2008-03-17  Dan Bernstein  <mitz@apple.com>
2487
2488         Reviewed by Dave Hyatt.
2489
2490         - allow incremental relayout of blocks that contain floats
2491
2492         Tests: fast/repaint/line-flow-with-floats-[1-9].html
2493
2494         * rendering/RenderBlock.cpp:
2495         (WebCore::RenderBlock::clearFloatsIfNeeded): Cleaned up by moving most
2496         of the function body out of an if statement which was replaced with an
2497         early return.
2498         (WebCore::RenderBlock::insertFloatingObject): Cleaned up by moving most
2499         of the function body out of an if statement and moving the ASSERT, which
2500         is a crash in release builds, to the beginning. Made this function set
2501         the m_isDescendant flag of floating objects it creates.
2502         (WebCore::RenderBlock::removeFloatingObject): Added a call to
2503         markLinesDirtyInVerticalRange() when removing a float from a block with
2504         inline children.
2505         (WebCore::RenderBlock::markLinesDirtyInVerticalRange): Added. Marks the
2506         lines in the given range as dirty.
2507         (WebCore::RenderBlock::clearFloats): Added code to detect changes to
2508         the geometry of floats intruding into this block from other blocks and
2509         mark any lines whose available width has changed as a result as dirty.
2510
2511         * rendering/RenderBlock.h:
2512         (WebCore::RenderBlock::FloatWithRect::FloatWithRect): Added a structure
2513         to cache a float with its position and size.
2514         (WebCore::RenderBlock::FloatingObject::FloatingObject): Added an
2515         m_isDescendant flag, used by clearFloats() to distinguish between floats
2516         entering the block from outside and floats internal to the block.
2517
2518         * rendering/RootInlineBox.h:
2519         (WebCore::RootInlineBox::floats): Added.
2520         (WebCore::RootInlineBox::floatsPtr): Added.
2521         (WebCore::RootInlineBox::Overflow::Overflow): Added a data member to
2522         hold the floats originating on the line.
2523
2524         * rendering/bidi.cpp:
2525         (WebCore::RenderBlock::layoutInlineChildren): Made the existence of
2526         floats not force a full layout. Changed to cache the geometry of floats
2527         in the block and detect changes to it. If a float's size or position
2528         changes, all lines from that point on are treated as dirty. An exception
2529         is a change in the dimensions of a float on an otherwise-clean line,
2530         which only dirties lines potentially affected by the change (see
2531         determineStartPosition()). Added code to update each RootInlineBox's
2532         set of floats as lines are laid out. Added code to shift floats
2533         belonging to clean lines in the end along with the lines.
2534         (WebCore::RenderBlock::determineStartPosition): Made this function look
2535         for changes to floats' dimensions and mark lines as dirty accordingly.
2536         Also look for new floats and if found, cause a full layout. Added code
2537         to re-add floats belonging to clean lines.
2538         (WebCore::RenderBlock::matchedEndLine): Added checking that the clean
2539         lines in the end can be shifted vertically as needed, i.e. that the
2540         available width along the way is uniform.
2541
2542 2008-03-17  Eric Seidel  <eric@webkit.org>
2543
2544         Reviewed by darin.
2545
2546         Fix _NPN_IntFromIdentifier (and export the symbol for use!)
2547
2548         Test: plugins/netscape-identifier-conversion.html
2549
2550         * WebCore.NPAPI.exp:
2551         * bridge/npruntime.cpp:
2552         (_NPN_IntFromIdentifier):
2553
2554 2008-03-17  Sam Weinig  <sam@webkit.org>
2555
2556         Reviewed by Dan Bernstein.
2557
2558         Add HTMLCollection constructor to the Window object. (Omission noticed by Harri Porten)
2559
2560         * page/DOMWindow.idl: 
2561
2562 2008-03-17  Holger Hans Peter Freyther  <zecke@selfish.org>
2563
2564         Unreviewed Gtk+ build fix.
2565
2566         * platform/gtk/ScrollViewGtk.cpp: remove const
2567
2568 2008-03-17  Julien Chaffraix  <julien.chaffraix@gmail.com>
2569
2570         Reviewed by Holger.
2571
2572         <http://bugs.webkit.org/show_bug.cgi?id=17754>
2573
2574         - Implement ResourceHandle::loadResourceSynchronously to dispatch synchronous
2575           requests.
2576
2577         - Implement WebCoreSynchronousLoader, the ResourceHandleClient which holds
2578           the network data, response and error for us during the transfert.
2579
2580         * platform/network/ResourceHandleInternal.h: Remove trailing white space.
2581         * platform/network/curl/ResourceHandleCurl.cpp: Add WebCoreSynchronousLoader
2582         (WebCore::WebCoreSynchronousLoader::resourceResponse):
2583         (WebCore::WebCoreSynchronousLoader::resourceError):
2584         (WebCore::WebCoreSynchronousLoader::data):
2585         (WebCore::WebCoreSynchronousLoader::WebCoreSynchronousLoader):
2586         (WebCore::WebCoreSynchronousLoader::didReceiveResponse):
2587         (WebCore::WebCoreSynchronousLoader::didReceiveData):
2588         (WebCore::WebCoreSynchronousLoader::didFinishLoading):
2589         (WebCore::WebCoreSynchronousLoader::didFail):
2590         (WebCore::ResourceHandle::loadResourceSynchronously): Implement method
2591         using WebCoreSynchronousLoader.
2592
2593         * platform/network/curl/ResourceHandleManager.cpp:
2594         (WebCore::ResourceHandleManager::dispatchSynchronousJob):
2595         (WebCore::ResourceHandleManager::startJob):
2596         (WebCore::ResourceHandleManager::initializeHandle): Handle initialization
2597         method used both for synchronous and asynchronous job.
2598
2599         * platform/network/curl/ResourceHandleManager.h:
2600
2601 2008-03-17  Darin Adler  <darin@apple.com>
2602
2603         - try to fix GTK build
2604
2605         * platform/ScrollView.h: Make setGtkAdjustments adjustment.
2606         And non-virtual (why was it virtual?).
2607
2608 2008-03-17  Rodney Dawes  <dobey@wayofthemonkey.com>
2609
2610         Fix Bug 17898: Split PluginMessageThrottlerWin into its own files
2611
2612         <http://bugs.webkit.org/show_bug.cgi?id=17898>
2613
2614         Move the PluginMessageThrottlerWin class into its own files, in
2615         preparation for refactoring PluginView code to be shared.
2616
2617         Reviewed and tweaked by Adam Roben.
2618
2619         * WebCore.vcproj/WebCore.vcproj:
2620         * plugins/PluginView.h:
2621         * plugins/win/PluginMessageThrottlerWin.cpp: Added.
2622         * plugins/win/PluginMessageThrottlerWin.h: Added.
2623         * plugins/win/PluginViewWin.cpp:
2624
2625 2008-03-17  Adam Roben  <aroben@apple.com>
2626
2627         More Windows build fixes after r31098
2628
2629         * platform/ScrollView.h: Make some more methods public.
2630
2631 2008-03-17  Adam Roben  <aroben@apple.com>
2632
2633         Windows and Qt build fixes after r31098
2634
2635         * platform/ScrollView.h: Mark methods public that still need to be so.
2636
2637 2008-03-16  Timothy Hatcher  <timothy@apple.com>
2638
2639         Reviewed by Darin Adler.
2640
2641         Bug 17883: Console completion should support bracket notation
2642         http://bugs.webkit.org/show_bug.cgi?id=17883
2643
2644         Also fixes a bug where the Inspector's window object was used instead of the
2645         inspected window object.
2646
2647         * page/inspector/ConsolePanel.js:
2648         (WebInspector.ConsolePanel.complete): Add a comment about the _backwardsRange call.
2649         (WebInspector.ConsolePanel.completions): Add a comment about the _backwardsRange call.
2650         Check the last character of the expression for a dot or bracket. Fallback
2651         to the InspectorController.inspectedWindow() instead of window, this was a bad bug.
2652         If the expression caused an exception, just consider the prefix a window property.
2653         When bracket notation is used remember what quote was used and compared property names
2654         with that quote surrounding it. Also escape the property name for the quote and backslash.
2655
2656 2008-03-17  Robert Blaut  <webkit@blaut.biz>
2657
2658         Reviewed by Darin.
2659
2660         Fix for bug http://bugs.webkit.org/show_bug.cgi?id=17696
2661         Set default margin-bottom for form element in quirk mode
2662         and be compatible with Gecko.
2663
2664         Tests: fast/css/margin-bottom-form-element-quirk.html
2665                fast/css/margin-bottom-form-element-strict.html
2666
2667         * css/html4.css:
2668         * css/quirks.css:
2669
2670 2008-03-17  Antti Koivisto  <antti@apple.com>
2671
2672         Reviewed by Darin.
2673
2674         Speculative fix for http://bugs.webkit.org/show_bug.cgi?id=17878
2675         Bug 17878: REGRESSION: Acid3 sometimes crashes Webkit under WebCore::Loader::Host::cancelRequests
2676         
2677         I can't reproduce the crash or make a test case for this one but I'm pretty sure this
2678         is the problem. Essentially the same bug as http://bugs.webkit.org/show_bug.cgi?id=17862
2679         except in didFail() instead of didFinishLoading().
2680
2681         * loader/loader.cpp:
2682         (WebCore::Loader::Host::didFail):
2683
2684 2008-03-17  Jan Michael Alonzo  <jmalonzo@unpluggable.com>
2685
2686         Reviewed and tweaked by Darin.
2687
2688         http://bugs.webkit.org/show_bug.cgi?id=17172
2689         Refactor platform checks in ScrollView.h
2690
2691         * platform/ScrollView.h: Change #ifs around.
2692
2693 2008-03-17  Yuzhu Shen  <yuzhu.shen@gmail.com>
2694
2695         Reviewed by Darin.
2696
2697         Fix the bug: http://bugs.webkit.org/show_bug.cgi?id=17760
2698         It is necessary to load the image even when src="".
2699
2700         Test: fast/images/load-img-with-empty-src.html
2701
2702         * html/HTMLImageLoader.cpp:
2703         (WebCore::HTMLImageLoader::updateFromElement): isNull rather than isEmpty.
2704
2705 2008-03-17  Rodney Dawes  <dobey@wayofthemonkey.com>
2706
2707         Fix GTK+ build from r31094.
2708
2709         * plugins/gtk/PluginDatabaseGtk.cpp:
2710         (PluginDatabase::getPluginsInPaths):
2711
2712 2008-03-17  Adam Roben  <aroben@apple.com>
2713
2714         Fix Bug 17876: REGRESSION (r31060): Attempting to visit Ofcom page causes crash
2715
2716         <http://bugs.webkit.org/show_bug.cgi?id=17876>
2717
2718         Reviewed by John.
2719
2720         Test: fast/dom/remove-named-attribute-crash.html
2721
2722         * dom/NamedAttrMap.cpp:
2723         (WebCore::NamedAttrMap::removeAttribute): Store the Attribute we're
2724         going to remove from the m_attributes Vector in a RefPtr so it doesn't
2725         get deleted when it is removed from the Vector.
2726
2727 2008-03-17  Rodney Dawes  <dobey@wayofthemonkey.com>
2728
2729         Reviewed by Adam Roben.
2730
2731         Implement PluginDatabase for GTK+ with PluginDatabaseGtk.cpp.
2732         Remove implemented methods from TemporaryLinkStubs.
2733
2734         * GNUmakefile.am:
2735         * plugins/gtk:
2736         * plugins/gtk/PluginDatabaseGtk.cpp:
2737         * platform/gtk/TemporaryLinkStubs.cpp:
2738
2739 2008-03-17  Simon Hausmann  <hausmann@webkit.org>
2740
2741         Fix the Qt build.
2742
2743         * platform/text/qt/TextCodecQt.cpp:
2744         (WebCore::TextCodecQt::encode):
2745         * platform/text/qt/TextCodecQt.h:
2746
2747 2008-03-16  Maciej Stachowiak  <mjs@apple.com>
2748
2749         Not reviewed, just fixing an incomplete comment from the last commit.
2750
2751         * dom/Range.cpp:
2752         (WebCore::Range::surroundContents):
2753
2754 2008-03-16  Maciej Stachowiak  <mjs@apple.com>
2755
2756         Reviewed by Darin.
2757
2758         - fixed "Acid3 expects different exceptions for surroundContents calls involving comment nodes (affects Acid3 test 11)"
2759         http://bugs.webkit.org/show_bug.cgi?id=17509
2760         
2761         This gets us to 92/100
2762
2763         * dom/Range.cpp:
2764         (WebCore::Range::surroundContents): Check for
2765         HIERARCHY_REQUEST_ERR before BAD_BOUNDARYPOINTS_ERR, since Acid3
2766         expects exceptional conditions to be tested in the order that the
2767         spec lists them. Also, adjust the HIERARCHY_REQUEST_ERR check. If
2768         the start point of the range is in a comment node, the node that
2769         would be the parent of a partial replacement is actually the
2770         comment node's parent (since comment nodes have character
2771         indices), so we should do the HIERARCHY_REQUEST_ERR check based on
2772         the parent of the comment node, as for text nodes, even though it
2773         will fail later with a different exception because it is not
2774         allowed to surround a partially selected non-text node.
2775
2776 2008-03-16  Marvin Decker  <marv.decker@gmail.com>
2777
2778         Reviewed by Darin.
2779
2780         Fix bug 15119: URL query characters that are unencodable in the
2781         request's character set should be converted to XML entities with
2782         non-alphanumeric characters escaped.
2783
2784         Test: http/tests/uri/escaped-entity.html
2785
2786         * html/FormDataList.cpp:
2787         (WebCore::FormDataList::appendString):
2788         * html/HTMLFormElement.cpp:
2789         (WebCore::HTMLFormElement::formData):
2790         * platform/KURL.cpp:
2791         (WebCore::encodeRelativeString):
2792         * platform/text/String.cpp:
2793         (WebCore::String::latin1):
2794         (WebCore::String::utf8):
2795         * platform/text/TextCodec.cpp:
2796         (WebCore::TextCodec::unencodableCharReplacement):
2797         * platform/text/TextCodec.h:
2798         (WebCore::):
2799         * platform/text/TextCodecICU.cpp:
2800         (WebCore::urlEscapedEntityCallback):
2801         (WebCore::gbkUrlEscapedEntityCallack):
2802         (WebCore::TextCodecICU::encode):
2803         * platform/text/TextCodecICU.h:
2804         (WebCore::TextCodecICU::setNeedsGBKFallbacks):
2805         * platform/text/TextCodecLatin1.cpp:
2806         (WebCore::encodeComplexWindowsLatin1):
2807         (WebCore::TextCodecLatin1::encode):
2808         * platform/text/TextCodecLatin1.h:
2809         * platform/text/TextCodecUTF16.cpp:
2810         (WebCore::TextCodecUTF16::encode):
2811         * platform/text/TextCodecUTF16.h:
2812         * platform/text/TextCodecUserDefined.cpp:
2813         (WebCore::encodeComplexUserDefined):
2814         (WebCore::TextCodecUserDefined::encode):
2815         * platform/text/TextCodecUserDefined.h:
2816         * platform/text/TextEncoding.cpp:
2817         (WebCore::TextEncoding::encode):
2818         * platform/text/TextEncoding.h:
2819         * platform/text/mac/TextCodecMac.cpp:
2820         (WebCore::TextCodecMac::encode):
2821         * platform/text/mac/TextCodecMac.h:
2822         * xml/XMLHttpRequest.cpp:
2823         (WebCore::XMLHttpRequest::send):
2824
2825 2008-03-16  Kevin Ollivier  <kevino@theolliviers.com>
2826
2827         Rubber stamped by Darin.
2828
2829         Add set-webkit-configuration support for wx port, and centralize
2830         build dir location setting.
2831
2832         http://bugs.webkit.org/show_bug.cgi?id=17790
2833
2834         * webcore-base.bkl:
2835
2836 2008-03-16  Darin Adler  <darin@apple.com>
2837
2838         Reviewed by Mark Rowe.
2839
2840         - http://bugs.webkit.org/show_bug.cgi?id=17881
2841           a little cleanup for HTMLTextAreaElement
2842
2843         Tests: fast/forms/textarea-default-value-leading-newline.html
2844                fast/forms/textarea-linewrap-dynamic.html
2845
2846         * html/HTMLTextAreaElement.cpp:
2847         (WebCore::HTMLTextAreaElement::HTMLTextAreaElement): Tweaked names/
2848         (WebCore::HTMLTextAreaElement::selectionStart): Ditto, also use early return
2849         and check for < 0 rather than -1 specifically.
2850         (WebCore::HTMLTextAreaElement::selectionEnd): Ditto.
2851         (WebCore::HTMLTextAreaElement::setSelectionStart): Early return.
2852         (WebCore::HTMLTextAreaElement::setSelectionEnd): Ditto.
2853         (WebCore::HTMLTextAreaElement::select): Ditto.
2854         (WebCore::HTMLTextAreaElement::setSelectionRange): Ditto.
2855         (WebCore::HTMLTextAreaElement::parseMappedAttribute): Changed value parsing
2856         to treat unknown values as meaning "default" rather than "leave value as-is".
2857         Only call setNeedsLayoutAndPrefWidthsRecalc when mode changed.
2858         (WebCore::HTMLTextAreaElement::createRenderer): Removed name of unused argument.
2859         (WebCore::HTMLTextAreaElement::appendFormData): Updated for name changes.
2860         (WebCore::HTMLTextAreaElement::isKeyboardFocusable): Got rid of unnneeded explicit
2861         class name in isFocusable call.
2862         (WebCore::HTMLTextAreaElement::isMouseFocusable): Ditto.
2863         (WebCore::HTMLTextAreaElement::updateFocusAppearance): Tweaked formatting.
2864         (WebCore::HTMLTextAreaElement::defaultEventHandler): Ditto.
2865         (WebCore::HTMLTextAreaElement::updateValue): Early return.
2866         (WebCore::HTMLTextAreaElement::setValue): Got rid of intermediate value to
2867         eliminate on small refcount churn.
2868         (WebCore::HTMLTextAreaElement::defaultValue): Got rid of unneeded redundant
2869         string length checks, since String already checks all indexing and returns 0.
2870         (WebCore::HTMLTextAreaElement::setDefaultValue): Added code to normalize
2871         line endings and add a leading line ending to fix cases where the first
2872         character is a newline.
2873         (WebCore::HTMLTextAreaElement::accessKeyAction): Removed name of unused arg.
2874         (WebCore::HTMLTextAreaElement::accessKey): Changed return value to avoid
2875         refcount churn.
2876         (WebCore::HTMLTextAreaElement::selection): Updated names and use < 0 instead
2877         of -1 specifically.
2878
2879         * html/HTMLTextAreaElement.h: Replaced wrap function with more-specific
2880         shouldWrapText one. Changed return value of accessKey. Made WrapMethod enum
2881         provate and renamed the values. Renamed cachedSelStart and cachedSelEnd to
2882         m_cachedSelectionStart and m_cachedSelectionEnd.
2883
2884         * rendering/RenderTextControl.cpp:
2885         (WebCore::RenderTextControl::createInnerTextStyle): Updated for change to
2886         HTMLTextAreaElement wrap function.
2887
2888 2008-03-16  Antti Koivisto  <antti@apple.com>
2889
2890         Reviewed by Mitz.
2891
2892         Fix http/tests/security/frame-loading-via-document-write.html
2893         which was broken by the preload patch.
2894         
2895         Don't print error message when preload fails local file security check.
2896         Some minor refactoring.
2897
2898         * html/PreloadScanner.cpp:
2899         (WebCore::PreloadScanner::emitTag):
2900         (WebCore::PreloadScanner::emitCSSRule):
2901         * loader/Cache.cpp:
2902         (WebCore::Cache::requestResource):
2903         * loader/Cache.h:
2904         * loader/DocLoader.cpp:
2905         (WebCore::DocLoader::requestResource):
2906         (WebCore::DocLoader::preload):
2907         (WebCore::DocLoader::printPreloadStats):
2908         * loader/DocLoader.h:
2909
2910 2008-03-16  Antti Koivisto  <antti@apple.com>
2911
2912         Reviewed by Darin.
2913         
2914         Fix http://bugs.webkit.org/show_bug.cgi?id=17862
2915         REGRESSION (r31038): Reproducible crash under DocLoader::checkForReload() at marware.com
2916         
2917         This was a memory smasher introduced by the preloading patch. 
2918         If a script resource was marked uncacheable, early deletion of the 
2919         Request object would cause deletion of the CachedResource too if
2920         it was referred more than once in a single document.
2921
2922         Test: http/tests/misc/uncacheable-script-repeated.html
2923
2924         * loader/loader.cpp:
2925         (WebCore::Loader::Host::servePendingRequests):
2926         (WebCore::Loader::Host::didFinishLoading):
2927
2928 2008-03-16  Yuzhu Shen  <yuzhu.shen@gmail.com>
2929
2930         Reviewed by Darin.
2931
2932         Fix bug http://bugs.webkit.org/show_bug.cgi?id=17714
2933         <img href="#"> should go to top of the page.
2934
2935         Test: fast/html/empty-fragment-id-goto-top.html
2936
2937         * loader/FrameLoader.cpp:
2938         (WebCore::FrameLoader::gotoAnchor):
2939
2940 2008-03-16  Thiago Macieira  <thiago.macieira@trolltech.com>
2941
2942         Reviewed by Darin.
2943
2944         Don't use RefPtr in classes you haven't seen the implementation of.
2945
2946         Forward-declaration and declaration of RefPtr<Foo> is ok. But you
2947         cannot *use* said objects until Foo is defined. This is true even for
2948         initialisation with a 0.
2949
2950         Seems the HP aCC compiler is more strict here than gcc.
2951
2952         * editing/SplitTextNodeCommand.h:
2953         * page/FrameTree.h:
2954         * xml/XPathExpressionNode.h:
2955
2956 2008-03-16  Darin Adler  <darin@apple.com>
2957
2958         Reviewed by Mitz.
2959
2960         - fix http://bugs.webkit.org/show_bug.cgi?id=14941
2961           <rdar://problem/5404093> textarea value from JavaScript includes extra newline
2962
2963         Test: fast/forms/textarea-trailing-newline.html
2964
2965         * rendering/RenderTextControl.cpp:
2966         (WebCore::RenderTextControl::finishText): Added code to strip the trailing
2967         newline. It's possible there are some obscure cases where this is not wanted,
2968         but I couldn't find any. If someone finds a case where this is bad, we can
2969         make the code conditional.
2970
2971 2008-03-16  Darin Adler  <darin@apple.com>
2972
2973         Reviewed by Mitz.
2974
2975         - fix http://bugs.webkit.org/show_bug.cgi?id=17876
2976           Attempting to visit Ofcom page causes crash
2977
2978         This is causing intermittent crashes on some existing test cases on the buildbot
2979         too; I don't have a 100% test case right now, but it should be easy to add one later
2980         and this does fix a crash in a test we already have.
2981
2982         * dom/CharacterData.cpp:
2983         (WebCore::CharacterData::CharacterData): Initialize m_data to the empty string,
2984         not the null string. The class assumes the string can never being null.
2985         (WebCore::CharacterData::setData): If asked to set the data to the null string,
2986         set it to the empty string instead. This matches what the (non-empty) constructor
2987         has always done.
2988
2989 2008-03-15  Timothy Hatcher  <timothy@apple.com>
2990
2991         Reviewed by Adam Roben.
2992
2993         Bug 17870: Web Inspector console should feel more like a terminal
2994         http://bugs.webkit.org/show_bug.cgi?id=17870
2995
2996         Bug 14390: Console input area should be more noticeable
2997         http://bugs.webkit.org/show_bug.cgi?id=14390
2998         <rdar://5712831>
2999
3000         Bug 17237: Inspector should tab-complete object properties in the Console
3001         http://bugs.webkit.org/show_bug.cgi?id=17237
3002         <rdar://5732842>
3003
3004         Adds tab completion, auto completion and a blended input prompt.
3005         The prompt is also focused when the console is shown.
3006            Implements a new look, that will be part of the UI refresh.
3007
3008         * page/inspector/ConsolePanel.js: 
3009         (WebInspector.ConsolePanel): Renamed a few properties.
3010         (WebInspector.ConsolePanel.get/set promptText): Property to set
3011         and get the current prompt text. Does not affect command history.
3012         (WebInspector.ConsolePanel.show): Make the prompt focus on show.
3013         (WebInspector.ConsolePanel.acceptAutoComplete): Accepts any
3014         pending auto complete text.
3015         (WebInspector.ConsolePanel.clearAutoComplete): Cancels any pending
3016         auto complete text.
3017         (WebInspector.ConsolePanel.autoCompleteSoon): Sets a timeout to auto
3018         complete in 250 ms, only if there isn't a pending auto complete.
3019         (WebInspector.ConsolePanel.complete): 
3020         (WebInspector.ConsolePanel.completions): Generate a list of possible
3021         completions based on the prefix and the previous expression ranges.
3022         (WebInspector.ConsolePanel._backwardsRange): Helper to scan backwards
3023         from a node and offset to find a start node and offset of the first
3024         character found in the characters string.
3025         (WebInspector.ConsolePanel._evalInInspectedWindow): Helper to eval in the
3026         inspected window.
3027         (WebInspector.ConsolePanel._caretInsidePrompt): Returns true if the selection
3028         is collapsed and is inside the prompt element.
3029         (WebInspector.ConsolePanel._moveCaretToEndOfPrompt): Moves the selection
3030         to the end of the prompt.
3031         (WebInspector.ConsolePanel._onTabPressed): Calls complete on
3032         tab press.
3033         (WebInspector.ConsolePanel._onEnterPressed): Call clearAutoComplete so the
3034         autocompletion text is not evaluated.
3035
3036         * page/inspector/Images/errorIcon.png: New image.
3037         * page/inspector/Images/userInputIcon.png: Added.
3038         * page/inspector/Images/userInputPreviousIcon.png: Added.
3039         * page/inspector/Images/warningIcon.png: New image.
3040         * page/inspector/inspector.css: New refreshed UI.
3041
3042 2008-03-15  Mark Mentovai  <mark@moxienet.com>
3043
3044         Reviewed and landed by Darin.
3045
3046         - http://bugs.webkit.org/show_bug.cgi?id=17833
3047           use file extensions instead of explicit file types in WebCore's Xcode project
3048
3049         * WebCore.xcodeproj/project.pbxproj: Remove unnecessary
3050           uses of explicitFileType, preferring lastKnownFileType ("File Type:
3051           Default for File" in Xcode's File Info's General tab).  Files below
3052           that relied on an explicit file type setting other than what would
3053           be implied by their extensions have been renamed to have correct
3054           extensions.
3055         * bridge/jni/jni_jsobject.cpp: Removed.
3056         * bridge/jni/jni_jsobject.mm: Copied from bridge/jni/jni_jsobject.cpp.
3057         * loader/mac/LoaderNSURLExtras.m: Removed.
3058         * loader/mac/LoaderNSURLExtras.mm: Copied from loader/mac/LoaderNSURLExtras.m.
3059         * platform/mac/SharedTimerMac.cpp: Removed.
3060         * platform/mac/SharedTimerMac.mm: Copied from platform/mac/SharedTimerMac.cpp.
3061
3062 2008-03-15  Darin Adler  <darin@apple.com>
3063
3064         Reviewed by Sam.
3065
3066         - fix http://bugs.webkit.org/show_bug.cgi?id=11997
3067           Ranges are not fixed after mutation (affects Acid3 test 13)
3068
3069         Test: fast/dom/Range/mutation.html
3070
3071         * WebCore.xcodeproj/project.pbxproj: Added NodeWithIndex.h, NodeWithIndexAfter.h,
3072         and NodeWithIndexBefore.h.
3073
3074         * dom/CharacterData.cpp:
3075         (WebCore::CharacterData::setData): Replaced call to Document::removeMarkers
3076         with call to Document::textRemoved.
3077         (WebCore::CharacterData::insertData): Replaced call to Document::shiftMarkers
3078         with call to Document::textInserted.
3079         (WebCore::CharacterData::deleteData): Replaced call to Document::removeMarkers
3080         and Document::shiftMarkers with call to Document::textRemoved.
3081         (WebCore::CharacterData::replaceData): Replaced call to Document::removeMarkers
3082         and Document::shiftMarkers with call to Document::textRemoved and
3083         Document::textInserted.
3084         (WebCore::CharacterData::containsOnlyWhitespace): Tweaked a bit.
3085
3086         * dom/ContainerNode.cpp:
3087         (WebCore::ContainerNode::childrenChanged): Added a call to
3088         Document::nodeChildrenChanged when the nmber of children was changed (and not
3089         by the parser).
3090         (WebCore::dispatchChildRemovalEvents): Updated for name change.
3091
3092         * dom/Document.cpp:
3093         (WebCore::Document::~Document): Assert that all ranges are gone.
3094         (WebCore::Document::nodeChildrenChanged): Added. Calls nodeChildrenChanged on
3095         all ranges.
3096         (WebCore::Document::nodeWillBeRemoved): Renamed from notifyBeforeNodeRemoval.
3097         Added code to call nodeWillBeRemoved on all ranges.
3098         (WebCore::Document::textInserted): Added. Calls textInserted on all ranges and
3099         also calls shiftMarkers.
3100         (WebCore::Document::textRemoved): Added. Calls textRemoved on all ranges and also
3101         calls removeMarkers and shiftMarkers.
3102         (WebCore::Document::textNodesMerged): Added. Calls textNodesMerged on all ranges.
3103         (WebCore::Document::textNodeSplit): Added. Calls textNodeSplit on all ranges.
3104         (WebCore::Document::attachRange): Added. Adds range to the HashSet of all ranges
3105         for this document.
3106         (WebCore::Document::detachRange): Added. Removes range from the HashSet.
3107         * dom/Document.h: Added the new functions and the data member.
3108
3109         * dom/Element.cpp:
3110         (WebCore::Element::normalizeAttributes): Added. Contains the part of the
3111         normalize function that's specific to Element. Better encapsulation to have it
3112         here rather than in Node::normalize.
3113         * dom/Element.h: Added the new function.
3114
3115         * dom/Node.cpp:
3116         (WebCore::Node::normalize): Rewrote so it's no longer recursive. Also added
3117         a call to textNodesMerged after each pair of nodes is merged but before the
3118         second node is removed.
3119         (WebCore::Node::traverseNextNodePostOrder): Added. Helper function used by
3120         normalize, but also useful elsewhere.
3121         * dom/Node.h: Added the new function.
3122
3123         * dom/NodeIterator.cpp:
3124         (WebCore::NodeIterator::nodeWillBeRemoved): Renamed from notifyBeforeNodeRemoval.
3125         * dom/NodeIterator.h: Ditto.
3126
3127         * dom/ProcessingInstruction.cpp:
3128         (WebCore::ProcessingInstruction::setData): Call textRemoved.
3129
3130         * dom/Range.cpp:
3131         (WebCore::NodeWithIndex::index): Added. Computes and stores index.
3132         (WebCore::NodeWithIndexBefore::indexBefore): Added. Computes and stores index.
3133         (WebCore::NodeWithIndexAfter::indexAfter): Added. Computes and stores index.
3134         (WebCore::Range::Range): Call attachRange.
3135         (WebCore::Range::~Range): Call detachRange unless the range is already detached.
3136         (WebCore::Range::commonAncestorContainer): Removed check for WRONG_DOCUMENT_ERR.
3137         It's no longer possible to create a range where the two containers are non-zero
3138         and have no common ancestor.
3139         (WebCore::Range::isPointInRange): Rewrote expression to be more readable.
3140         (WebCore::Range::compareNode): Changed local variable to use int for consistency.
3141         (WebCore::Range::compareBoundaryPoints): Replaced ASSERT with ASSERT_NOT_REACHED.
3142         (WebCore::Range::deleteContents): Removed check for INVALID_STATE_ERR and
3143         initialization of ec to 0; both are now inside checkDeleteExtract.
3144         (WebCore::Range::intersectsNode): Changed local variable to use int for consistency.
3145         Also changed comparison to use < 0 and >= 0 rather than checking explicitly for 1
3146         and -1.
3147         (WebCore::Range::processContents): Changed code to not get the nodeType multiple
3148         times on the same node, and tweaked formatting. Removed code to update the range
3149         on deletion, because the normal delete logic will take care of that now.
3150         (WebCore::Range::extractContents): Removed check for INVALID_STATE_ERR and
3151         initialization of ec to 0; both are now inside checkDeleteExtract.
3152         (WebCore::Range::insertNode): Changed local variable to use int for consistency.
3153         (WebCore::Range::toString): Changed variable name to pastLast.
3154         (WebCore::Range::detach): Call detachRange.
3155         (WebCore::Range::checkDeleteExtract): Added check for detached range and code to
3156         set ec to 0; moved here from the two callers. Also changed variable name to pastLast.
3157         (WebCore::endpointNodeChildrenChanged): Added.
3158         (WebCore::Range::nodeChildrenChanged): Added.
3159         (WebCore::endpointNodeWillBeRemoved): Added.
3160         (WebCore::Range::nodeWillBeRemoved): Added.
3161         (WebCore::endpointTextInserted): Added.
3162         (WebCore::Range::textInserted): Added.
3163         (WebCore::endpointTextRemoved): Added.
3164         (WebCore::Range::textRemoved): Added.
3165         (WebCore::endpointTextNodesMerged): Added.
3166         (WebCore::Range::textNodesMerged): Added.
3167         (WebCore::endpointTextNodesSplit): Added.
3168         (WebCore::Range::textNodeSplit): Added.
3169
3170         * dom/Range.h: Added new member functions.
3171
3172         * dom/NodeWithIndex.h: Added. Makes it so we won't find the index for the same
3173         node more than once.
3174         * dom/NodeWithIndexAfter.h: Added. Similar to NodeWithIndex but gives the index after a
3175         node and treats a node pointer of 0 as meaning "before first node in parent container".
3176         * dom/NodeWithIndexBefore.h: Added.  Similar to NodeWithIndex but treats a node pointer of 0
3177         as meaning "after last node in parent container".
3178
3179         * dom/Text.cpp:
3180         (WebCore::Text::splitText): Call textNodeSplit.
3181
3182         * editing/ApplyStyleCommand.cpp:
3183         (WebCore::ApplyStyleCommand::applyInlineStyle): Changed variable name to pastLast.
3184
3185 2008-03-15  Julien Chaffraix  <julien.chaffraix@gmail.com>
3186
3187         Reviewed by Holger.
3188
3189         [CURL] Crash below ResourceHandleManager::setupPOST when job->request().httpBody() is NULL
3190         http://bugs.webkit.org/show_bug.cgi?id=16906
3191
3192         Add null checks for httpBody() to match other ports.
3193
3194         Test: http/tests/xmlhttprequest/xmlhttprequest-post-crash.html
3195
3196         * platform/network/curl/ResourceHandleManager.cpp:
3197         (WebCore::readCallback): Add null check.
3198         (WebCore::ResourceHandleManager::setupPOST): Ditto.
3199
3200 2008-03-14  Steve Falkenburg  <sfalken@apple.com>
3201
3202         PGO build fixes.
3203
3204         * WebCore.vcproj/WebCore.vcproj:
3205
3206 2008-03-14  Anders Carlsson  <andersca@apple.com>
3207
3208         Reviewed by Sam.
3209
3210         <rdar://problem/5794989>
3211         https://bugs.webkit.org/show_bug.cgi?id=17792
3212         REGRESSION (Safari 3.0.4-3.1): Ordering tickets from Sweden's biggest train operator doesn't work
3213
3214         Pass the frame loader that should be used for looking up the frame name to FrameLoader::createWindow
3215         so that somewindow.open calls where the active window and 'somewindow' differ return the correct frame.
3216         
3217         * bindings/js/JSDOMWindowBase.cpp:
3218         (WebCore::createWindow):
3219         * loader/FrameLoader.cpp:
3220         (WebCore::FrameLoader::createWindow):
3221         * loader/FrameLoader.h:
3222
3223 2008-03-14  Dan Bernstein  <mitz@apple.com>
3224
3225         Reviewed by Mark Rowe.
3226
3227         - fix <rdar://problem/5797836> shadow offsets are smaller than specified
3228
3229         * platform/graphics/cg/GraphicsContextCG.cpp:
3230         (WebCore::GraphicsContext::setShadow): Made the workaround for
3231         <rdar://problem/5539388> unconditional.
3232
3233 2008-03-14  Adam Roben  <aroben@apple.com>
3234
3235         Fix it right this time
3236
3237         * platform/MainThread.cpp: Cast to unsigned so we can use %u in the
3238         format string.
3239         * platform/mac/MainThreadMac.mm:
3240
3241 2008-03-14  Adam Roben  <aroben@apple.com>
3242
3243         Mac build fix
3244
3245         * platform/mac/MainThreadMac.mm: Corrected a typo.
3246
3247 2008-03-14  Dan Bernstein  <mitz@apple.com>
3248
3249         Reviewed by Darin Adler.
3250
3251         - fix http://bugs.webkit.org/show_bug.cgi?id=17834
3252           REGRESSION: floated first-letter does not work when included in table
3253
3254         Test: fast/css/first-letter-float.html
3255
3256         * rendering/RenderBlock.cpp:
3257         (WebCore::RenderBlock::updateFirstLetter): Changed the search for the
3258         first text node to stop at a float if that float is an existing first-
3259         letter.
3260
3261 2008-03-14  Sam Weinig  <sam@webkit.org>
3262
3263         Fix Mac build
3264
3265         * WebCore.xcodeproj/project.pbxproj:
3266
3267 2008-03-13  Adam Roben  <aroben@apple.com>
3268
3269         Make most of callOnMainThread's implementation be cross-platform
3270
3271         I took the non-platform-specific parts of MainThreadWin.cpp and moved
3272         them to a new MainThread.cpp. Each platform is now responsible for
3273         implementing one function, scheduleDispatchFunctionsOnMainThread,
3274         which is supposed to set things up so that
3275         dispatchFunctionsFromMainThread gets called from the main thread in
3276         the near future.
3277
3278         Reviewed by Alexey.
3279
3280         * GNUmakefile.am: Added MainThread.cpp to the project.
3281         * WebCore.pro: Ditto.
3282         * WebCore.vcproj/WebCore.vcproj: Ditto.
3283         * WebCore.xcodeproj/project.pbxproj: Ditto.
3284         * WebCoreSources.bkl: Ditto.
3285         * platform/MainThread.cpp:
3286           - Copied from WebCore/platform/win/MainThreadWin.cpp.
3287           - Removed the Windows-specific parts.
3288         (WebCore::callOnMainThread): Changed to call
3289         scheduleDispatchFunctionsOnMainThread instead of PostMessage.
3290         * platform/gtk/MainThreadGtk.cpp:
3291         (WebCore::timeoutFired): Renamed from callFunctionOnMainThread. Now
3292         just calls dispatchFunctionsFromMainThread.
3293         (WebCore::scheduleDispatchFunctionsOnMainThread): Added. Calls through
3294         to g_timeout_add.
3295         * platform/mac/MainThreadMac.mm: Renamed WebCoreFunctionWrapper to
3296         WebCoreMainThreadCaller.
3297         (-[WebCoreMainThreadCaller call]): Calls through to
3298         dispatchFunctionsFromMainThread.
3299         (WebCore::scheduleDispatchFunctionsOnMainThread): Makes a new
3300         WebCoreMainThreadCaller and calls performSelectorOnMainThread on it.
3301         * platform/qt/MainThreadQt.cpp: Removed PerformFunctionEvent.
3302         (WebCore::MainThreadInvoker::event): Chagned to call through to
3303         dispatchFunctionsFromMainThread.
3304         (WebCore::scheduleDispatchFunctionsOnMainThread): Sends an empty event
3305         to the MainThreadInvoker.
3306         * platform/win/MainThreadWin.cpp:
3307           - Removed the non-Windows-specific parts.
3308           - Removed some unnecessary initialization of static variables to 0.
3309         (WebCore::ThreadingWindowWndProc): Changed to call
3310         dispatchFunctionsFromMainThread.
3311         (WebCore::scheduleDispatchFunctionsOnMainThread): Calls through to
3312         PostMessage.
3313         * platform/wx/MainThreadWx.cpp:
3314         (WebCore::scheduleDispatchFunctionsOnMainThread): Added.
3315
3316 2008-03-14  Beth Dakin  <bdakin@apple.com>
3317
3318         Reviewed by Geoff.
3319
3320         Fix for <rdar://problem/5728171> Potential PLT speedup: don't 
3321         realloc every time inside NamedAttrMap::addAttribute
3322
3323         The speed-up for this turned out to be so small that it is mostly 
3324         imperceptible. It is likely that it is a tiny boost, though, and 
3325         the new code is much cleaner.
3326
3327         * dom/Element.cpp:
3328         (WebCore::Element::setAttributeMap): attrs is now called 
3329         m_attributes
3330         * dom/NamedAttrMap.cpp: The array attrs is now the Vector of 
3331         RefPtrs called m_attributes, and there is no longer any need for 
3332         the len member variable. 
3333         (WebCore::NamedAttrMap::NamedAttrMap): 
3334         (WebCore::NamedAttrMap::item):
3335         (WebCore::NamedAttrMap::getAttributeItem):
3336         (WebCore::NamedAttrMap::clearAttributes):
3337         (WebCore::NamedAttrMap::operator=):
3338         (WebCore::NamedAttrMap::addAttribute):
3339         (WebCore::NamedAttrMap::removeAttribute):
3340         (WebCore::NamedAttrMap::mapsEquivalent):
3341         * dom/NamedAttrMap.h: Same.
3342         (WebCore::NamedAttrMap::length):
3343         (WebCore::NamedAttrMap::attributeItem):
3344         (WebCore::NamedAttrMap::shrinkToLength):
3345         (WebCore::NamedAttrMap::reserveCapacity):
3346         * html/HTMLTokenizer.cpp: One of the benefits of the old array was 
3347         that it never took up more memory than it needed to. So the 
3348         tokenizer utilizes new member functions on NamedAttrMap 
3349         (shrinkToLength and reserveCapacity) to try to keep memory usage at 
3350         a minimum. 
3351         (WebCore::Token::addAttribute):
3352         (WebCore::HTMLTokenizer::processToken):
3353
3354 2008-03-14  David D. Kilzer  <ddkilzer@apple.com>
3355
3356         BUILD FIX when ENABLE(MAC_JAVA_BRIDGE) set to 0.
3357
3358         * page/mac/FrameMac.mm: Move up #if ENABLE(MAC_JAVA_BRIDGE) guard
3359         to comment out unused code.
3360
3361 2008-03-14  David D. Kilzer  <ddkilzer@apple.com>
3362
3363         Unify concept of enabling the Mac Java bridge.
3364
3365         Reviewed by Darin and Anders.
3366
3367         No test cases added since there is no change in functionality.
3368
3369         * DerivedSources.make: Added check for ENABLE_MAC_JAVA_BRIDGE macro.
3370         If defined as "1", add WebCore.JNI.exp to WEBCORE_EXPORT_DEPENDENCIES.
3371         * WebCore.JNI.exp: Added.
3372         * WebCore.base.exp: Moved exported JNI methods to WebCore.JNI.exp.
3373
3374         * bridge/jni/jni_class.cpp: Added #if ENABLE(MAC_JAVA_BRIDGE) guard.
3375         * bridge/jni/jni_class.h: Ditto.
3376         * bridge/jni/jni_instance.cpp: Ditto.
3377         * bridge/jni/jni_instance.h: Ditto.
3378         * bridge/jni/jni_jsobject.cpp: Ditto.
3379         * bridge/jni/jni_jsobject.h: Ditto.
3380         * bridge/jni/jni_objc.mm: Ditto.
3381         * bridge/jni/jni_runtime.cpp: Ditto.
3382         * bridge/jni/jni_runtime.h: Ditto.
3383         * bridge/jni/jni_utility.cpp: Ditto.
3384         * bridge/jni/jni_utility.h: Ditto.
3385
3386         * bridge/runtime.cpp: Removed unused #include statements.
3387         * bridge/runtime.h:
3388         (KJS::Bindings::Instance::BindingLanguage): Added #if ENABLE(MAC_JAVA_BRIDGE)
3389         guard for JavaLanguage enum.  Also added #if PLATFORM(MAC) guard for
3390         ObjectiveCLanguage enum to match corresponding code in runtime.cpp.
3391
3392         * config.h: Removed definition of HAVE_JNI.
3393
3394         * loader/FrameLoaderClient.h:
3395         (WebCore::FrameLoaderClient::javaApplet): Added #if ENABLE(MAC_JAVA_BRIDGE) guard.
3396         * page/Frame.cpp:
3397         (WebCore::Frame::Frame): Ditto.
3398         * page/Frame.h:
3399         (WebCore::Frame::initJavaJSBindings): Ditto.
3400         * page/mac/FrameMac.mm:
3401         (WebCore::Frame::createScriptInstanceForWidget): Ditto.
3402         (WebCore::Frame::initJavaJSBindings): Ditto.
3403
3404 2008-03-13  Darin Adler  <darin@apple.com>
3405
3406         * html/PreloadScanner.h: Corrected license.
3407         * html/PreloadScanner.cpp: Corrected license.
3408
3409 2008-03-13  Mark Mentovai  <mark@moxienet.com>
3410
3411         Reviewed by darin.  Landed by eseidel.
3412
3413         * platform/FloatConversion.h: Include a header to get CoreGraphics
3414         types when using CoreGraphics types.
3415
3416 2008-03-13  Mark Mentovai  <mark@moxienet.com>
3417
3418         Reviewed by eseidel.  Landed by eseidel.
3419
3420         * WebCore.xcodeproj/project.pbxproj:
3421         * css/CSSParser.cpp:
3422         * css/makeprop.pl:
3423         Move CSSPropertyNames.c to CSSPropertyNames.cpp
3424
3425 2008-03-13  Mark Mentovai  <mark@moxienet.com>
3426
3427         Reviewed by eseidel.  Landed by eseidel.
3428
3429         * platform/Arena.h: Use statement1;statement2 instead of
3430         (statement1,statement2) in CLEAR_UNUSED.
3431
3432 2008-03-13  Tommi Komulainen  <tommi.komulainen@iki.fi>
3433
3434         Reviewed by Alp Toker.
3435
3436         http://bugs.webkit.org/show_bug.cgi?id=17821
3437         [SOUP] POST requests are empty
3438
3439         Send the HTTP request body as well.
3440
3441         * platform/network/soup/ResourceHandleSoup.cpp:
3442         (WebCore::ResourceHandle::start):
3443
3444 2008-03-13  Dan Bernstein  <mitz@apple.com>
3445
3446         Reviewed by Dave Hyatt.
3447
3448         - fix http://bugs.webkit.org/show_bug.cgi?id=17819
3449           Border-collapse: collapse later cell wins on PC, earlier cell on Mac
3450
3451         Test: fast/table/border-collapsing/equal-precedence-resolution.html
3452
3453         * rendering/RenderTableCell.cpp:
3454         (WebCore::RenderTableCell::collapsedLeftBorder): When calling
3455         compareBorders() with borders that may have the same precedence, made
3456         sure to pass the border belonging to the earlier (in document order)
3457         element first, since compareBorders() prefers the first argument when
3458         there is a tie.
3459         (WebCore::RenderTableCell::collapsedRightBorder): Ditto.
3460         (WebCore::RenderTableCell::collapsedTopBorder): Ditto.
3461
3462 2008-03-13  Adam Roben  <aroben@apple.com>
3463
3464         wx build fix and Windows leak fix after r31034
3465
3466         * platform/graphics/wx/ImageWx.cpp:
3467         (WebCore::Image::loadPlatformResource): Use SharedBuffer::create.
3468         * platform/win/SharedBufferWin.cpp:
3469         (WebCore::SharedBuffer::createWithContentsOfFile): Ditto (we were
3470         leaking the SharedBuffer here before).
3471
3472 2008-03-13  Antti Koivisto  <antti@apple.com>
3473
3474         Reviewed by Eric.
3475
3476         Correct a few issues spotted by Mike Belshe. 
3477
3478         * html/PreloadScanner.cpp:
3479         (WebCore::PreloadScanner::tokenize):
3480         * loader/loader.cpp:
3481         (WebCore::Loader::cancelRequests):
3482
3483 2008-03-13  Rodney Dawes  <dobey@wayofthemonkey.com>
3484
3485         Fix GTK+ build for SharedBuffer changes.
3486
3487         * platform/graphics/gtk/ImageGtk.cpp:
3488         (Image::loadPlatformResource):
3489
3490 2008-03-13  Steve Falkenburg  <sfalken@apple.com>
3491
3492         More PGO build fixes.
3493
3494         * WebCorePrefix.cpp:
3495
3496 2008-03-13  Antti Koivisto  <antti@apple.com>
3497
3498         Reviewed by Darin.
3499         
3500         Make page loads go fast.
3501         
3502         http://bugs.webkit.org/show_bug.cgi?id=17480
3503
3504         - Implement speculative preloading. When a script load blocks the main parser, use a side 
3505           parser to pick up more resources.
3506         - Implement per-host load queues, prioritize scripts and stylesheets over images.
3507         
3508         Depending on content and network latency this may speed things up quite a bit.
3509
3510         * WebCore.xcodeproj/project.pbxproj:
3511         * dom/Document.cpp:
3512         (WebCore::Document::implicitClose):
3513         Clear the preloads after laoding completes.
3514         
3515         * html/HTMLLinkElement.cpp:
3516         (WebCore::HTMLLinkElement::parseMappedAttribute):
3517         (WebCore::HTMLLinkElement::tokenizeRelAttribute):
3518         * html/HTMLLinkElement.h:
3519         Make tokenizeRelAttribute() public static so it can be used from elsewhere.
3520         Eliminate a pointless bitfield so I can get references.
3521         
3522         * html/HTMLTokenizer.cpp:
3523         (WebCore::HTMLTokenizer::scriptHandler):
3524         (WebCore::HTMLTokenizer::scriptExecution):
3525         (WebCore::HTMLTokenizer::write):
3526         * html/HTMLTokenizer.h:
3527         Spin up the preload scanner whenever a script load blocks the parser. One scanner tracks the end of 
3528         the document while temporary ones are created as needed to scan document.write() output.
3529         
3530         * html/PreloadScanner.cpp: Added.
3531         (WebCore::PreloadScanner::PreloadScanner):
3532         (WebCore::PreloadScanner::~PreloadScanner):
3533         (WebCore::PreloadScanner::begin):
3534         (WebCore::PreloadScanner::end):
3535         (WebCore::PreloadScanner::reset):
3536         (WebCore::PreloadScanner::write):
3537         (WebCore::isWhitespace):
3538         (WebCore::PreloadScanner::clearLastCharacters):
3539         (WebCore::PreloadScanner::rememberCharacter):
3540         (WebCore::PreloadScanner::lastCharactersMatch):
3541         (WebCore::legalEntityFor):
3542         (WebCore::PreloadScanner::consumeEntity):
3543         (WebCore::PreloadScanner::tokenize):
3544         (WebCore::PreloadScanner::processAttribute):
3545         (WebCore::PreloadScanner::emitCharacter):
3546         (WebCore::PreloadScanner::tokenizeCSS):
3547         (WebCore::PreloadScanner::emitTag):
3548         (WebCore::PreloadScanner::emitCSSRule):
3549         * html/PreloadScanner.h: Added.
3550         (WebCore::PreloadScanner::inProgress):
3551         (WebCore::PreloadScanner::):
3552         HTML5 tokenization plus some glue code. Fake CSS parsing thrown in just for fun.
3553         
3554         * loader/Cache.cpp:
3555         (WebCore::Cache::pruneDeadResources):
3556         Preloads have zero refcount, avoid kicking them out too early.
3557         
3558         * loader/CachedResource.cpp:
3559         (WebCore::CachedResource::CachedResource):
3560         (WebCore::CachedResource::ref):
3561         * loader/CachedResource.h:
3562         (WebCore::CachedR