8249988089deb1327302055849de91ebd1a5049d
[WebKit-https.git] / WebCore / ChangeLog
1 2006-05-08  Maciej Stachowiak  <mjs@apple.com>
2
3         Reviewed by Tim Hatcher.
4         
5         - refactor things so that WebKit doesn't save a WebResource for every loaded URL,
6         but rather retrieves the data from the WebCore cache as needed.
7         http://bugzilla.opendarwin.org/show_bug.cgi?id=8802
8
9         * bridge/mac/WebCoreFrameBridge.h:
10         * bridge/mac/WebCoreFrameBridge.mm:
11         (-[WebCoreFrameBridge getData:andResponse:forURL:]):
12         (-[WebCoreFrameBridge getAllResourceDatas:andResponses:]):
13         * loader/Cache.cpp:
14         (WebCore::Cache::updateCacheStatus):
15         (WebCore::Cache::requestImage):
16         (WebCore::Cache::requestStyleSheet):
17         (WebCore::Cache::requestScript):
18         (WebCore::Cache::requestXSLStyleSheet):
19         (WebCore::Cache::requestXBLDocument):
20         * loader/Cache.h:
21         * loader/CachedResource.cpp: Added.
22         * loader/CachedResource.h: Added.
23         * loader/CachedResourceClient.h: Added.
24         * loader/CachedResourceClientWalker.cpp: Added.
25         * loader/CachedResourceClientWalker.h: Added.
26         * loader/DocLoader.cpp:
27         (WebCore::DocLoader::setAutoloadImages):
28         (WebCore::DocLoader::removeCachedObject):
29         * loader/DocLoader.h:
30         (WebCore::DocLoader::cachedObject):
31         (WebCore::DocLoader::allCachedObjects):
32
33 2006-05-08  Levi Weintraub  <lweintraub@apple.com>
34
35         Reviewed by justin.
36
37         * editing/TextIterator.cpp:
38         (WebCore::shouldEmitSpaceBeforeAndAfterNode):
39         Returns true when the node should have a leading and trailing space. Currently only
40         used for inline tables. The function shouldEmitNewlinesBeforeAndAfterNode has a
41         fallback for nodes with no RenderObject, but the inline property doesn't really
42         have a meaning without one.
43         (WebCore::TextIterator::handleNonTextNode):
44         Checks shouldEmitSpaceBeforeAndAfterNode and inserts a space if necessary.
45         (WebCore::TextIterator::exitNode):
46         Checks shouldEmitSpaceBeforeAndAfterNode and inserts a space if necessary.
47
48 2006-05-08  Anders Carlsson  <acarlsson@apple.com>
49
50         Try fixing the Win32 build
51         
52         * WebCore.vcproj/WebCore/WebCore.vcproj:
53         Add XPath files to project.
54
55 2006-05-08  Anders Carlsson  <acarlsson@apple.com>
56
57         Reviewed by Darin, Eric and Maciej.
58
59         http://bugzilla.opendarwin.org/show_bug.cgi?id=6638
60         Support Mozilla's XPathEvaluator object.
61         
62         * DerivedSources.make:
63         Generate XPath grammar, and JavaScript wrappers.
64         
65         * WebCore.xcodeproj/project.pbxproj:
66         Add new files to project
67         
68         * bindings/js/kjs_binding.cpp:
69         (KJS::):
70         (KJS::setDOMException):
71         Handle setting XPath exceptions.
72         
73         * bindings/objc/DOM.mm:
74         Just return nil for now when trying to create a wrapper for 
75         XPath namespace nodes.
76
77         * bindings/scripts/CodeGeneratorJS.pm:
78         Add XPath types. Also add a "CanBeConstructed" extended attribute
79         for interfaces that can be constructed directly.
80         
81         * bridge/mac/WebCorePageBridge.mm:
82         (initializeLoggingChannelsIfNecessary):
83         Initialize LogXPath channel.
84         
85         * dom/DOMImplementation.cpp:
86         (WebCore::DOMImplementation::hasFeature):
87         Support "xpath" version "3.0".
88         
89         * dom/Document.cpp:
90         (WebCore::Document::Document):
91         
92         (WebCore::Document::importNode):
93         Ignore XPath namespace nodes.
94         
95         (WebCore::Document::createExpression):
96         (WebCore::Document::createNSResolver):
97         (WebCore::Document::evaluate):
98         New functions which call down to a lazily created XPathEvaluator.
99
100         * dom/Document.h:
101         Add function declarations.
102         
103         * dom/Document.idl:
104         Add XPath methods.
105         
106         * dom/Node.h:
107         (WebCore::Node::):
108         Add XPATH_NAMESPACE_NODE type.
109         
110         * editing/markup.cpp:
111         (WebCore::startMarkup):
112         Ignore XPath namespace nodes.
113         
114         * page/DOMWindow.idl:
115         Add constructors for XPathEvaluator and XPathResult.
116         
117         * platform/Logging.cpp:
118         * platform/Logging.h:
119         Add XPath log channel
120
121         * xpath: Added.
122         * xpath/XPathEvaluator.cpp: Added.
123         (WebCore::XPathEvaluator::createExpression):
124         (WebCore::XPathEvaluator::createNSResolver):
125         (WebCore::XPathEvaluator::evaluate):
126         * xpath/XPathEvaluator.h: Added.
127         (WebCore::):
128         * xpath/XPathEvaluator.idl: Added.
129         * xpath/XPathExpression.cpp: Added.
130         (WebCore::XPathExpression::createExpression):
131         (WebCore::XPathExpression::~XPathExpression):
132         (WebCore::XPathExpression::evaluate):
133         * xpath/XPathExpression.h: Added.
134         * xpath/XPathExpression.idl: Added.
135         * xpath/XPathNSResolver.cpp: Added.
136         (WebCore::XPathNSResolver::XPathNSResolver):
137         (WebCore::XPathNSResolver::lookupNamespaceURI):
138         * xpath/XPathNSResolver.h: Added.
139         * xpath/XPathNSResolver.idl: Added.
140         * xpath/XPathNamespace.cpp: Added.
141         (WebCore::XPathNamespace::XPathNamespace):
142         (WebCore::XPathNamespace::~XPathNamespace):
143         (WebCore::XPathNamespace::ownerDocument):
144         (WebCore::XPathNamespace::ownerElement):
145         (WebCore::XPathNamespace::prefix):
146         (WebCore::XPathNamespace::nodeName):
147         (WebCore::XPathNamespace::nodeValue):
148         (WebCore::XPathNamespace::namespaceURI):
149         (WebCore::XPathNamespace::nodeType):
150         * xpath/XPathNamespace.h: Added.
151         * xpath/XPathResult.cpp: Added.
152         (WebCore::InvalidatingEventListener::InvalidatingEventListener):
153         (WebCore::InvalidatingEventListener::handleEvent):
154         (WebCore::XPathResult::XPathResult):
155         (WebCore::XPathResult::~XPathResult):
156         (WebCore::XPathResult::convertTo):
157         (WebCore::XPathResult::resultType):
158         (WebCore::XPathResult::numberValue):
159         (WebCore::XPathResult::stringValue):
160         (WebCore::XPathResult::booleanValue):
161         (WebCore::XPathResult::singleNodeValue):
162         (WebCore::XPathResult::invalidateIteratorState):
163         (WebCore::XPathResult::invalidIteratorState):
164         (WebCore::XPathResult::snapshotLength):
165         (WebCore::XPathResult::iterateNext):
166         (WebCore::XPathResult::snapshotItem):
167         * xpath/XPathResult.h: Added.
168         (WebCore::XPathResult::):
169         * xpath/XPathResult.idl: Added.
170         * xpath/impl: Added.
171         * xpath/impl/XPathExpressionNode.cpp: Added.
172         (WebCore::XPath::Expression::evaluationContext):
173         (WebCore::XPath::Expression::Expression):
174         (WebCore::XPath::Expression::~Expression):
175         (WebCore::XPath::Expression::evaluate):
176         (WebCore::XPath::Expression::addSubExpression):
177         (WebCore::XPath::Expression::optimize):
178         (WebCore::XPath::Expression::subExprCount):
179         (WebCore::XPath::Expression::subExpr):
180         (WebCore::XPath::Expression::isConstant):
181         * xpath/impl/XPathExpressionNode.h: Added.
182         (WebCore::XPath::EvaluationContext::EvaluationContext):
183         * xpath/impl/XPathFunctions.cpp: Added.
184         (WebCore::XPath::Interval::Interval):
185         (WebCore::XPath::Interval::contains):
186         (WebCore::XPath::Interval::asString):
187         (WebCore::XPath::Function::setArguments):
188         (WebCore::XPath::Function::setName):
189         (WebCore::XPath::Function::arg):
190         (WebCore::XPath::Function::argCount):
191         (WebCore::XPath::Function::name):
192         (WebCore::XPath::FunLast::doEvaluate):
193         (WebCore::XPath::FunLast::isConstant):
194         (WebCore::XPath::FunPosition::doEvaluate):
195         (WebCore::XPath::FunPosition::isConstant):
196         (WebCore::XPath::FunLocalName::isConstant):
197         (WebCore::XPath::FunLocalName::doEvaluate):
198         (WebCore::XPath::FunNamespaceURI::isConstant):
199         (WebCore::XPath::FunNamespaceURI::doEvaluate):
200         (WebCore::XPath::FunName::isConstant):
201         (WebCore::XPath::FunName::doEvaluate):
202         (WebCore::XPath::FunCount::doEvaluate):
203         (WebCore::XPath::FunCount::isConstant):
204         (WebCore::XPath::FunString::doEvaluate):
205         (WebCore::XPath::FunConcat::doEvaluate):
206         (WebCore::XPath::FunStartsWith::doEvaluate):
207         (WebCore::XPath::FunContains::doEvaluate):
208         (WebCore::XPath::FunSubstringBefore::doEvaluate):
209         (WebCore::XPath::FunSubstringAfter::doEvaluate):
210         (WebCore::XPath::FunSubstring::doEvaluate):
211         (WebCore::XPath::FunStringLength::doEvaluate):
212         (WebCore::XPath::FunNormalizeSpace::doEvaluate):
213         (WebCore::XPath::FunTranslate::doEvaluate):
214         (WebCore::XPath::FunBoolean::doEvaluate):
215         (WebCore::XPath::FunNot::doEvaluate):
216         (WebCore::XPath::FunTrue::doEvaluate):
217         (WebCore::XPath::FunTrue::isConstant):
218         (WebCore::XPath::FunLang::doEvaluate):
219         (WebCore::XPath::FunLang::isConstant):
220         (WebCore::XPath::FunFalse::doEvaluate):
221         (WebCore::XPath::FunFalse::isConstant):
222         (WebCore::XPath::FunNumber::doEvaluate):
223         (WebCore::XPath::FunSum::doEvaluate):
224         (WebCore::XPath::FunFloor::doEvaluate):
225         (WebCore::XPath::FunCeiling::doEvaluate):
226         (WebCore::XPath::FunRound::doEvaluate):
227         (WebCore::XPath::FunctionLibrary::self):
228         (WebCore::XPath::FunctionLibrary::FunctionLibrary):
229         (WebCore::XPath::FunctionLibrary::createFunction):
230         * xpath/impl/XPathFunctions.h: Added.
231         * xpath/impl/XPathGrammar.y: Added.
232         * xpath/impl/XPathParser.cpp: Added.
233         (WebCore::XPath::):
234         (WebCore::XPath::Parser::charCat):
235         (WebCore::XPath::Parser::isAxisName):
236         (WebCore::XPath::Parser::isNodeTypeName):
237         (WebCore::XPath::Parser::isOperatorContext):
238         (WebCore::XPath::Parser::skipWS):
239         (WebCore::XPath::Parser::makeTokenAndAdvance):
240         (WebCore::XPath::Parser::makeIntTokenAndAdvance):
241         (WebCore::XPath::Parser::peekAheadHelper):
242         (WebCore::XPath::Parser::peekCurHelper):
243         (WebCore::XPath::Parser::lexString):
244         (WebCore::XPath::Parser::lexNumber):
245         (WebCore::XPath::Parser::lexNCName):
246         (WebCore::XPath::Parser::lexQName):
247         (WebCore::XPath::Parser::nextTokenInternal):
248         (WebCore::XPath::Parser::nextToken):
249         (WebCore::XPath::Parser::Parser):
250         (WebCore::XPath::Parser::reset):
251         (WebCore::XPath::Parser::lex):
252         (WebCore::XPath::Parser::parseStatement):
253         (WebCore::XPath::Parser::registerParseNode):
254         (WebCore::XPath::Parser::unregisterParseNode):
255         (WebCore::XPath::Parser::registerPredicateVector):
256         (WebCore::XPath::Parser::unregisterPredicateVector):
257         (WebCore::XPath::Parser::registerExpressionVector):
258         (WebCore::XPath::Parser::unregisterExpressionVector):
259         (WebCore::XPath::Parser::registerString):
260         (WebCore::XPath::Parser::unregisterString):
261         * xpath/impl/XPathParser.h: Added.
262         (WebCore::XPath::Token::Token):
263         (WebCore::XPath::Parser::):
264         (WebCore::XPath::Parser::current):
265         * xpath/impl/XPathPath.cpp: Added.
266         (WebCore::XPath::Filter::Filter):
267         (WebCore::XPath::Filter::~Filter):
268         (WebCore::XPath::Filter::doEvaluate):
269         (WebCore::XPath::LocationPath::LocationPath):
270         (WebCore::XPath::LocationPath::~LocationPath):
271         (WebCore::XPath::LocationPath::optimize):
272         (WebCore::XPath::LocationPath::doEvaluate):
273         (WebCore::XPath::Path::Path):
274         (WebCore::XPath::Path::~Path):
275         (WebCore::XPath::Path::doEvaluate):
276         * xpath/impl/XPathPath.h: Added.
277         * xpath/impl/XPathPredicate.cpp: Added.
278         (WebCore::XPath::Number::Number):
279         (WebCore::XPath::Number::isConstant):
280         (WebCore::XPath::Number::doEvaluate):
281         (WebCore::XPath::StringExpression::StringExpression):
282         (WebCore::XPath::StringExpression::isConstant):
283         (WebCore::XPath::StringExpression::doEvaluate):
284         (WebCore::XPath::Negative::doEvaluate):
285         (WebCore::XPath::NumericOp::NumericOp):
286         (WebCore::XPath::NumericOp::doEvaluate):
287         (WebCore::XPath::EqTestOp::EqTestOp):
288         (WebCore::XPath::EqTestOp::doEvaluate):
289         (WebCore::XPath::LogicalOp::LogicalOp):
290         (WebCore::XPath::LogicalOp::shortCircuitOn):
291         (WebCore::XPath::LogicalOp::isConstant):
292         (WebCore::XPath::LogicalOp::doEvaluate):
293         (WebCore::XPath::Union::doEvaluate):
294         (WebCore::XPath::Predicate::Predicate):
295         (WebCore::XPath::Predicate::~Predicate):
296         (WebCore::XPath::Predicate::evaluate):
297         (WebCore::XPath::Predicate::optimize):
298         * xpath/impl/XPathPredicate.h: Added.
299         (WebCore::XPath::NumericOp::):
300         (WebCore::XPath::EqTestOp::):
301         (WebCore::XPath::LogicalOp::):
302         * xpath/impl/XPathStep.cpp: Added.
303         (WebCore::XPath::Step::axisAsString):
304         (WebCore::XPath::Step::Step):
305         (WebCore::XPath::Step::~Step):
306         (WebCore::XPath::Step::evaluate):
307         (WebCore::XPath::Step::nodesInAxis):
308         (WebCore::XPath::Step::nodeTestMatches):
309         (WebCore::XPath::Step::optimize):
310         (WebCore::XPath::Step::namespaceFromNodetest):
311         (WebCore::XPath::Step::primaryNodeType):
312         * xpath/impl/XPathStep.h: Added.
313         (WebCore::XPath::Step::):
314         * xpath/impl/XPathUtil.cpp: Added.
315         (WebCore::XPath::isRootDomNode):
316         (WebCore::XPath::stringValue):
317         (WebCore::XPath::isValidContextNode):
318         * xpath/impl/XPathUtil.h: Added.
319         * xpath/impl/XPathValue.cpp: Added.
320         (WebCore::XPath::Value::Value):
321         (WebCore::XPath::Value::type):
322         (WebCore::XPath::Value::isNodeVector):
323         (WebCore::XPath::Value::isBoolean):
324         (WebCore::XPath::Value::isNumber):
325         (WebCore::XPath::Value::isString):
326         (WebCore::XPath::Value::toNodeVector):
327         (WebCore::XPath::Value::toBoolean):
328         (WebCore::XPath::Value::toNumber):
329         (WebCore::XPath::Value::toString):
330         * xpath/impl/XPathValue.h: Added.
331         (WebCore::XPath::Value::):
332         * xpath/impl/XPathVariableReference.cpp: Added.
333         (WebCore::XPath::VariableReference::VariableReference):
334         (WebCore::XPath::VariableReference::isConstant):
335         (WebCore::XPath::VariableReference::doEvaluate):
336         * xpath/impl/XPathVariableReference.h: Added.
337
338 2006-05-08  David Hyatt  <hyatt@apple.com>
339
340         Comprehensive box-sizing fix.  This patch changes all form controls to
341         have the right box-sizing values (text fields and text areas actually only
342         use border-box in quirks mode now, and image buttons never use border-box).
343
344         Tables are supposed to use border-box box-sizing as well, but that's a scary
345         enough change that I'm saving it for a separate patch.
346
347         Reviewed by mjs
348
349         * css/html4.css:
350         * css/quirks.css:
351
352 2006-05-06  Darin Adler  <darin@apple.com>
353         
354         Suggested by Mitz. Reviewed and landed by Maciej.
355         
356         * dom/Document.cpp: (WebCore::Document::formElementsState): Fixed mistake where the
357         vector has an initial size and instead should have an initial capacity. Harmless in
358         a way, but hurts performance.
359         
360 2006-05-07  David Hyatt  <hyatt@apple.com>
361
362         Fix for bugzilla bug 8060.
363
364         Fixed width table cells weren't having their border widths
365         included in the effective width of the column (and thus could end up being
366         too small).
367
368         Reviewed by darin
369
370         Added fast/tables/fixed-cell-growth.html
371
372         * rendering/table_layout.cpp:
373         (WebCore::AutoTableLayout::recalcColumn):
374
375 2006-05-07  Alexey Proskuryakov  <ap@nypop.com>
376
377         Reviewed by Darin.
378
379         - http://bugzilla.opendarwin.org/show_bug.cgi?id=8769
380           TextEncoding::fromUnicode() - support non-BMP characters and convert to NFC
381
382         Tests: 
383         * fast/forms/form-data-encoding.html
384         * fast/forms/form-data-encoding-2.html
385
386         * platform/mac/TextEncodingMac.cpp:
387         (WebCore::TextEncoding::fromUnicode): Normalize the string; handle surrogate pairs.
388
389 2006-05-06  David Hyatt  <hyatt@apple.com>
390
391         Rename WebCoreFont to FontPlatformData and WebTextRenderer to FontData.  Merge them into the
392         headers (uncleanly with ifdefs at the moment, so I can see what I'm working towards).
393
394         Reviewed by mjs
395
396         * ChangeLog:
397         * WebCore.vcproj/WebCore/WebCore.vcproj:
398         * WebCore.xcodeproj/project.pbxproj:
399         * bridge/mac/WebCoreStringTruncator.mm:
400         (stringWidth):
401         (truncateString):
402         (+[WebCoreStringTruncator widthOfString:font:]):
403         * kwq/KWQComboBox.mm:
404         (QComboBox::sizeHint):
405         * kwq/KWQLineEdit.mm:
406         (QLineEdit::sizeForCharacterWidth):
407         * kwq/KWQListBox.mm:
408         (itemTextRenderer):
409         (groupLabelTextRenderer):
410         (QListBox::sizeForNumberOfLines):
411         (-[KWQTableView drawRow:clipRect:]):
412         * platform/Font.cpp:
413         (WebCore::m_wordSpacing):
414         (WebCore::Font::Font):
415         (WebCore::Font::operator=):
416         (WebCore::Font::update):
417         (WebCore::Font::ascent):
418         (WebCore::Font::descent):
419         (WebCore::Font::lineSpacing):
420         (WebCore::Font::xHeight):
421         (WebCore::Font::isFixedPitch):
422         * platform/Font.h:
423         (WebCore::Font::getNSFont):
424         * platform/FontData.h:
425         (WebCore::FontData::ascent):
426         (WebCore::FontData::descent):
427         (WebCore::FontData::lineSpacing):
428         (WebCore::FontData::lineGap):
429         (WebCore::FontData::misspellingLineThickness):
430         (WebCore::FontData::misspellingLinePatternWidth):
431         (WebCore::FontData::misspellingLinePatternGapWidth):
432         * platform/FontDataSet.h: Removed.
433         * platform/FontFallbackList.h: Added.
434         * platform/FontPlatformData.h:
435         * platform/mac/FontData.mm: Added.
436         (WebCore::WebCoreInitializeFont):
437         (WebCore::WebCoreInitializeEmptyTextGeometry):
438         (WebCore::widthForGlyph):
439         (WebCore::overrideLayoutOperation):
440         (WebCore::FontData::~FontData):
441         (WebCore::FontData::xHeight):
442         (WebCore::FontData::drawRun):
443         (WebCore::FontData::floatWidthForRun):
444         (WebCore::FontData::drawLineForCharacters):
445         (WebCore::FontData::selectionRectForRun):
446         (WebCore::FontData::drawHighlightForRun):
447         (WebCore::FontData::drawLineForMisspelling):
448         (WebCore::FontData::pointToOffset):
449         (WebCore::FontData::setAlwaysUseATSU):
450         (WebCore::getSmallCapsRenderer):
451         (WebCore::findSubstituteFont):
452         (WebCore::rendererForAlternateFont):
453         (WebCore::findSubstituteRenderer):
454         (WebCore::computeWidthForSpace):
455         (WebCore::setUpFont):
456         (WebCore::CG_drawHighlight):
457         (WebCore::CG_selectionRect):
458         (WebCore::CG_draw):
459         (WebCore::CG_floatWidthForRun):
460         (WebCore::updateGlyphMapEntry):
461         (WebCore::extendGlyphMap):
462         (WebCore::extendWidthMap):
463         (WebCore::initializeATSUStyle):
464         (WebCore::createATSULayoutParameters):
465         (WebCore::getTextBounds):
466         (WebCore::ATSU_floatWidthForRun):
467         (WebCore::ATSU_drawHighlight):
468         (WebCore::ATSU_selectionRect):
469         (WebCore::ATSU_draw):
470         (WebCore::ATSU_pointToOffset):
471         (WebCore::advanceWidthIteratorOneCharacter):
472         (WebCore::CG_pointToOffset):
473         (WebCore::glyphForCharacter):
474         (WebCore::initializeWidthIterator):
475         (WebCore::advanceWidthIterator):
476         * platform/mac/FontMac.mm:
477         (WebCore::m_font):
478         (WebCore::FontFallbackList::~FontFallbackList):
479         (WebCore::FontFallbackList::platformFont):
480         (WebCore::FontFallbackList::primaryFont):
481         (WebCore::FontFallbackList::determinePitch):
482         (WebCore::FontFallbackList::invalidate):
483         (WebCore::Font::platformFont):
484         (WebCore::Font::selectionRectForText):
485         (WebCore::Font::drawText):
486         (WebCore::Font::drawHighlightForText):
487         (WebCore::Font::drawLineForText):
488         (WebCore::Font::drawLineForMisspelling):
489         (WebCore::Font::misspellingLineThickness):
490         (WebCore::Font::floatWidth):
491         (WebCore::Font::checkSelectionPoint):
492         * platform/mac/WebCoreTextRenderer.mm:
493         (WebCoreDrawTextAtPoint):
494         (WebCoreTextFloatWidth):
495         (WebCoreSetAlwaysUseATSU):
496         * platform/mac/WebTextRenderer.h: Removed.
497         * platform/mac/WebTextRenderer.mm: Removed.
498         * platform/mac/WebTextRendererFactory.h:
499         * platform/mac/WebTextRendererFactory.mm:
500         (-[WebTextRendererFactory isFontFixedPitch:]):
501         (-[WebTextRendererFactory init]):
502         (-[WebTextRendererFactory rendererWithFont:]):
503         (-[WebTextRendererFactory fontWithFamilies:traits:size:]):
504         * platform/win/FontWin.cpp:
505         (WebCore::FontFallbackList::~FontFallbackList):
506         (WebCore::FontFallbackList::determinePitch):
507         (WebCore::FontFallbackList::invalidate):
508         (WebCore::FontFallbackList::primaryFont):
509         (WebCore::Font::floatWidth):
510         (WebCore::Font::drawText):
511         (WebCore::Font::drawHighlightForText):
512         (WebCore::Font::selectionRectForText):
513         (WebCore::Font::checkSelectionPoint):
514
515 2006-05-05  Darin Adler  <darin@apple.com>
516
517         - fix the Windows build
518
519         * platform/win/FontWin.cpp: (WebCore::getFontData):
520
521 2006-05-05  Darin Adler  <darin@apple.com>
522
523         * platform/SegmentedString.h: (WebCore::SegmentedString::advance): Oops!
524         Removed an extra ! that was causing everything to fail.
525
526 2006-05-05  Darin Adler  <darin@apple.com>
527
528         Reviewed by Tim Hatcher.
529
530         - remove a few of the stranger features of QChar on the road to
531           eventually replacing it with an integer type (probably ICU's UChar)
532
533         * platform/DeprecatedString.h: Remove SpecialCharacter, byteOrderMark, null,
534         cell, row, isNull, mirrored, mirroredChar, operator char, >, >=, <, and <=
535         from QChar. Also removed the many unneeded friend declarations. Remove findArg
536         and arg from DeprecatedString.
537
538         * dom/Document.cpp: (WebCore::Document::parseQualifiedName): Cast the type of the
539         buffer before invoking the U16_NEXT function. Turns out this was converting each
540         QChar to a char and back to a UChar, which means it caused a bug with characters
541         that are U+0100 or greater.
542
543         * css/csshelper.cpp: (WebCore::parseURL):
544         * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::constrainValue):
545         * platform/StringImpl.cpp: (WebCore::StringImpl::toCoordsArray):
546         * xml/xmlhttprequest.cpp: (WebCore::getCharset):
547         Add some calls to unicode() since we don't have comparison operators any more.
548
549         * dom/StyledElement.cpp:
550         (WebCore::toHex): Rewrote to just take a UChar parameter.
551         (WebCore::StyledElement::addCSSColor): Call toHex on the character code.
552
553         * bridge/mac/WebCoreFrameBridge.mm:
554         (-[WebCoreFrameBridge smartInsertForString:replacingRange:beforeString:afterString:]):
555         * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplaceSelectionCommand::doApply):
556         * editing/TextIterator.cpp: (WebCore::TextIterator::handleTextBox):
557         * platform/SegmentedString.h:
558         (WebCore::SegmentedString::push):
559         (WebCore::SegmentedString::advance):
560         (WebCore::SegmentedString::escaped):
561         * platform/SegmentedString.cpp:
562         (WebCore::SegmentedString::length):
563         (WebCore::SegmentedString::append):
564         (WebCore::SegmentedString::prepend):
565         (WebCore::SegmentedString::toString):
566         Changed calls to isNull() to instead just use unicode() and check for 0.
567
568         * html/HTMLTokenizer.cpp:
569         (WebCore::HTMLTokenizer::parseEntity): Change callers that used cell and row to
570         just use unicode() instead.
571         (WebCore::HTMLTokenizer::parseTag): Ditto.
572
573         * loader/Decoder.cpp: (Decoder::decode): Changed code that did a type cast to
574         unsigned char to instead call unicode().
575
576         * platform/DeprecatedString.cpp:
577         (KWQStringData::makeAscii): Call latin1() instead of relying on the conversion operator.
578         (DeprecatedString::DeprecatedString): Call unicode() instead of relying on the conversion
579         operator (the character has been tested and is known to be ASCII).
580         (DeprecatedString::at): Use 0 instead of QChar::null.
581         (DeprecatedString::compare): Use unicode() so we can do comparison since we don't have
582         comparison operators any more.
583         (DeprecatedString::find): Call unicode() instead of relying on the conversion
584         operator (the character has been tested and is known to be ASCII).
585         (DeprecatedString::findRev): Ditto.
586         (DeprecatedString::copyLatin1): Call latin1() instead of relying on the conversion operator.
587         (DeprecatedString::lower): Call unicode() instead of relying on the conversion
588         operator (the character has been tested and is known to be ASCII).
589         (DeprecatedString::insert): Ditto.
590         (DeprecatedString::replace): Ditto.
591         (DeprecatedString::fill): Ditto.
592         (DeprecatedString::append): Ditto.
593
594         * html/html_inlineimpl.cpp: (WebCore::HTMLAnchorElement::defaultEventHandler):
595         Eliminate the one use of DeprecatedString::arg.
596
597         - other cleanup
598
599         * kwq/KWQCString.cpp: Remove unneeded "using" directive.
600
601         * html/HTMLElementFactory.cpp:
602         (WebCore::htmlConstructor):
603         (WebCore::headConstructor):
604         (WebCore::bodyConstructor):
605         (WebCore::baseConstructor):
606         (WebCore::linkConstructor):
607         (WebCore::metaConstructor):
608         (WebCore::styleConstructor):
609         (WebCore::titleConstructor):
610         (WebCore::frameConstructor):
611         (WebCore::framesetConstructor):
612         (WebCore::iframeConstructor):
613         (WebCore::formConstructor):
614         (WebCore::buttonConstructor):
615         (WebCore::inputConstructor):
616         (WebCore::isindexConstructor):
617         (WebCore::fieldsetConstructor):
618         (WebCore::labelConstructor):
619         (WebCore::legendConstructor):
620         (WebCore::optgroupConstructor):
621         (WebCore::optionConstructor):
622         (WebCore::selectConstructor):
623         (WebCore::textareaConstructor):
624         (WebCore::dlConstructor):
625         (WebCore::ulConstructor):
626         (WebCore::olConstructor):
627         (WebCore::dirConstructor):
628         (WebCore::menuConstructor):
629         (WebCore::liConstructor):
630         (WebCore::blockquoteConstructor):
631         (WebCore::divConstructor):
632         (WebCore::headingConstructor):
633         (WebCore::hrConstructor):
634         (WebCore::paragraphConstructor):
635         (WebCore::preConstructor):
636         (WebCore::basefontConstructor):
637         (WebCore::fontConstructor):
638         (WebCore::modConstructor):
639         (WebCore::anchorConstructor):
640         (WebCore::imageConstructor):
641         (WebCore::mapConstructor):
642         (WebCore::areaConstructor):
643         (WebCore::canvasConstructor):
644         (WebCore::appletConstructor):
645         (WebCore::embedConstructor):
646         (WebCore::objectConstructor):
647         (WebCore::paramConstructor):
648         (WebCore::scriptConstructor):
649         (WebCore::tableConstructor):
650         (WebCore::tableCaptionConstructor):
651         (WebCore::tableColConstructor):
652         (WebCore::tableRowConstructor):
653         (WebCore::tableCellConstructor):
654         (WebCore::tableSectionConstructor):
655         (WebCore::brConstructor):
656         (WebCore::quoteConstructor):
657         (WebCore::marqueeConstructor):
658         Mark functions static, remove unused parameters, change from docPtr to doc.
659
660 2006-05-05  Alexey Proskuryakov  <ap@nypop.com>
661
662         Reviewed by Maciej.
663
664         - http://bugzilla.opendarwin.org/show_bug.cgi?id=8626
665           Strict mode erroneously triggered by a broken comment
666
667         Test: fast/parser/broken-comments-vs-parsing-mode.html
668
669         * page/Frame.cpp:
670         (WebCore::Frame::endIfNotLoading): Call determineParseMode() if needed.
671
672 2006-05-05  Darin Adler  <darin@apple.com>
673
674         - fix the Windows build (this time for sure)
675
676         * platform/win/TemporaryLinkStubs.cpp:
677         (GraphicsContext::translate): Added.
678         (GraphicsContext::rotate): Ditto.
679         (GraphicsContext::scale): Ditto.
680
681 2006-05-05  Darin Adler  <darin@apple.com>
682
683         - fix the Windows build
684
685         * bridge/win/FrameWin.h: Add Element* parameter to createPlugin.
686         * platform/win/TemporaryLinkStubs.cpp: (FrameWin::createPlugin): Ditto.
687
688 2006-05-05  Darin Adler  <darin@apple.com>
689
690         - get the Windows build a little closer to building again
691
692         * platform/cairo/GraphicsContextCairo.cpp:
693         (WebCore::GraphicsContext::drawRect): Call alpha to check if the color is transparent.
694         Call setColor directly instead of setColorFromPen.
695         (WebCore::GraphicsContext::drawLine): Ditto.
696         (WebCore::GraphicsContext::drawEllipse): Ditto.
697         (WebCore::GraphicsContext::drawArc): Ditto.
698         (WebCore::GraphicsContext::drawConvexPolygon): Ditto.
699         * platform/win/TemporaryLinkStubs.cpp: (JavaAppletWidget::JavaAppletWidget): Updated parameter types.
700
701 2006-05-05  Darin Adler  <darin@apple.com>
702
703         Reviewed by Adele.
704
705         - fixed data structure used to save/restore form element state to remove the
706           O(n^2) algorithm and remove anomalies in how it works
707         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8683
708           REGRESSION: imdb search button has "Submit" overload after going back
709
710         * manual-tests/form-value-restore.html: Added.
711
712         * bridge/mac/WebCoreFrameBridge.mm:
713         (-[WebCoreFrameBridge saveDocumentState]): Rewrote to call the new formElementsState
714         function on the document and also to convert null strings to NSNull instead of empty
715         NSString objects.
716         (-[WebCoreFrameBridge restoreDocumentState]): Ditto, with the setStateForNewFormElements
717         function.
718
719         * dom/Document.h: Added FormElementKey, FormElementKeyHash, and FormElementKeyHashTraits
720         for use in the hash map. Made readyState, inputEncoding, defaultCharset, charset,
721         characterSet, getElementByAccessKey, haveStylesheetsLoaded, usesDescendantRules,
722         usesSiblingRules, inCompatMode, inAlmostStrictMode, inStrictMode, preferredStylesheetSet,
723         selectedStylesheetSet, and getCSSTarget all const member functions. Removed the unused
724         nextState function. Renamed registerMaintainsState and deregisterMaintainsState to
725         registerFormElementWithState and HTMLGenericFormElement and changed them to use form
726         elements rather than arbitrary DOM nodes. Replaced docState with formElementsState and
727         setRestoreState and restoreState with setStateForNewFormElements, hasStateForNewFormElements,
728         and takeStateForFormElement. Replaced m_maintainsState with m_formElementsWithState,
729         m_state with m_stateForNewFormElements. Made m_elementsByAccessKey and m_accessKeyMapValid
730         mutable. Removed unused m_elementNames, m_elementNameAlloc, m_elementNameCount, m_attrNames,
731         m_attrNameAlloc, m_attrNameCount, m_namespaceURIs, m_namespaceURIAlloc, m_namespaceURICount.
732
733         * dom/Document.cpp:
734         (WebCore::Document::Document): Remove initialization of long-obsolete m_elementNames and
735         m_attrNames.
736         (WebCore::Document::~Document): Remove destruction of same.
737         (WebCore::Document::readyState): Made const.
738         (WebCore::Document::inputEncoding): Ditto.
739         (WebCore::Document::defaultCharset): Ditto.
740         (WebCore::Document::getElementByAccessKey): Ditto.
741         (WebCore::Document::preferredStylesheetSet): Ditto.
742         (WebCore::Document::selectedStylesheetSet): Ditto.
743         (WebCore::Document::getCSSTarget): Ditto.
744         (WebCore::Document::formElementsState): Added. Replaces the old docState function.
745         Builds a vector of strings, with 3 strings for each form element containing the
746         name, type, and state value.
747         (WebCore::Document::setStateForNewFormElements): Added. Converts the state vector
748         into a hash map, considering the scheme with 3 strings for form element used above.
749         (WebCore::Document::hasStateForNewFormElements): Added.
750         (WebCore::Document::takeStateForFormElement): Added. Given a name and type, looks
751         up the values in the hash map and "peels off" the last one.
752         (WebCore::FormElementKey::FormElementKey): Added.
753         (WebCore::FormElementKey::~FormElementKey): Added.
754         (WebCore::FormElementKey::operator=): Added.
755         (WebCore::FormElementKey::ref): Added.
756         (WebCore::FormElementKey::deref): Added.
757         (WebCore::FormElementKeyHash::hash): Added.
758         (WebCore::FormElementKeyHashTraits::deletedValue): Added.
759
760         * dom/Element.h: Removed state function.
761         * dom/Node.h: Removed maintainsState, state, and restoreState functions.
762         * dom/Node.cpp: Ditto.
763
764         * dom/QualifiedName.cpp: Reformatted.
765         (WebCore::hashComponents): Removed code to handle buffers that are not multiples
766         of 4 bytes, since a QualifiedName is guaranteed to be; also asserted that fact.
767
768         * html/HTMLParser.cpp:
769         (WebCore::HTMLParser::insertNode): Remove code to restore state; that's now handled
770         by closeRenderer.
771         (WebCore::HTMLParser::popOneBlock): Ditto.
772
773         * html/HTMLFormElement.cpp: Added include of HTMLInputElement.h.
774
775         * html/HTMLGenericFormElement.h: Changed form to be a const member function.
776         Changed type function to return a const AtomicString& instead of a String.
777         Added an override of closeRenderer. Removed state and findMatchingState functions.
778         Added stateValue and restoreState functions. Made m_form, m_disabled, and m_readOnly
779         be private instead of protected. Removed m_inited. Changed booleans to not use bit
780         fields since there are only two of them.
781         * html/HTMLGenericFormElement.cpp: Removed encodedElementName, state, and
782         findMatchingState functions.
783         (WebCore::HTMLGenericFormElement::stateValue): Added. No implementation. This will only be
784         called for subclasses that call registerFormElementWithState, and those will override and
785         implement it.
786         (WebCore::HTMLGenericFormElement::restoreState): Ditto.
787         (WebCore::HTMLGenericFormElement::closeRenderer): Added. Replaces code that was in the
788         HTML parser. Calls takeStateForFormElement, passing in the name and type, and if a
789         state is found, calls restoreState.
790
791         * html/HTMLButtonElement.h: Changed type to return a const AtomicString& instead
792         of a String.
793         * html/HTMLButtonElement.cpp:
794         (WebCore::HTMLButtonElement::type): Return a const AtomicString& instead of a
795         String.
796         (WebCore::HTMLButtonElement::defaultEventHandler): Use form() instead of m_form.
797         (WebCore::HTMLButtonElement::isSuccessfulSubmitButton): Use disabled() instead of
798         m_disabled.
799
800         * html/HTMLInputElement.h: Changed type to return a const AtomicString& instead
801         of a String. Removed maintainsState, state, and restoreState functions, and added
802         new stateValue and restoreState functions. Added m_inited (moved here from the generic
803         form element base class).
804         * html/HTMLInputElement.cpp:
805         (WebCore::HTMLInputElement::init): Call registerFormElementWithState. This was
806         formerly done by the HTML parser.
807         (WebCore::HTMLInputElement::~HTMLInputElement): Call deregisterFormElementWithState
808         by its new name.
809         (WebCore::HTMLInputElement::isKeyboardFocusable): Use form() instead of m_form.
810         (WebCore::HTMLInputElement::setType): Ditto.
811         (WebCore::HTMLInputElement::setInputType): Ditto. Also call inputType() != PASSWORD
812         instead of maintainsState(), since this is the only function that needs to know
813         the rule and it's no longer a function in the base class. Also call register and
814         deregister functions by their new names.
815         (WebCore::HTMLInputElement::type): Changed to return const AtomicString& instead
816         of String.
817         (WebCore::HTMLInputElement::stateValue): Renamed from state and changed to no
818         longer include the name and type, formerly obtained by calling the base class's
819         HTMLGenericFormElement::state, and to no longer modify the value() string by
820         adding a ".", which gets in the way of distinguishing null and empty values
821         and is slower and unnecessary.
822         (WebCore::HTMLInputElement::restoreState):  Changed because it takes a single
823         state and doesn't need to call findMatchingState, and also to no longer remove the last
824         character from the value when restoring state.
825         (WebCore::HTMLInputElement::parseMappedAttribute): Use form() instead of m_form.
826         (WebCore::HTMLInputElement::isSuccessfulSubmitButton): Use disabled() instead of
827         m_disabled.
828         (WebCore::HTMLInputElement::setChecked): Use form() instead of m_form.
829         (WebCore::HTMLInputElement::preDispatchEventHandler): Ditto.
830         (WebCore::HTMLInputElement::defaultEventHandler): Ditto.
831
832         * html/HTMLSelectElement.h: Changed type to return a const AtomicString& instead
833         of a String.
834         * html/HTMLSelectElement.cpp:
835         (WebCore::HTMLSelectElement::HTMLSelectElement): Call registerFormElementWithState.
836         This was formerly done by the HTML parser.
837         (WebCore::HTMLSelectElement::~HTMLSelectElement): Call deregisterFormElementWithState
838         by its new name.
839         (WebCore::HTMLSelectElement::type): Changed to return const AtomicString& instead
840         of String.
841         (WebCore::HTMLSelectElement::stateValue): Renamed from state and changed to no
842         longer include the name and type, formerly obtained by calling the base class's
843         HTMLGenericFormElement::state, and to build the string in a Vector<char> instead of
844         appending characters one at a time to a string.
845         (WebCore::HTMLSelectElement::restoreState):  Changed because it takes a single
846         state and doesn't need to call findMatchingState.
847         (WebCore::HTMLSelectElement::defaultEventHandler): Use form() instead of m_form.
848
849         * html/HTMLTextAreaElement.h: Changed type to return a const AtomicString& instead
850         of a String. Removed maintainsState, state, and restoreState functions, and added
851         new stateValue and restoreState functions.
852         * html/HTMLTextAreaElement.cpp:
853         (WebCore::HTMLTextAreaElement::HTMLTextAreaElement): Call registerFormElementWithState.
854         This was formerly done by the HTML parser. Also use member initialization instead of
855         assignment.
856         (WebCore::HTMLTextAreaElement::~HTMLTextAreaElement): Call deregisterFormElementWithState
857         by its new name.
858         (WebCore::HTMLTextAreaElement::type): Changed to return const AtomicString& instead
859         of String.
860         (WebCore::HTMLTextAreaElement::stateValue): Renamed from state and changed to no
861         longer include the name and type, formerly obtained by calling the base class's
862         HTMLGenericFormElement::state, and to no longer modify the value() string by
863         adding a ".", which is unnecessary.
864         (WebCore::HTMLTextAreaElement::restoreState): Changed because it takes a single
865         state and doesn't need to call findMatchingState, and also to no longer remove the last
866         character from the value when restoring state.
867         (WebCore::HTMLTextAreaElement::updateValue): Changed to const.
868         (WebCore::HTMLTextAreaElement::value): Ditto.
869         (WebCore::HTMLTextAreaElement::defaultValue): Ditto.
870
871         * html/HTMLFieldSetElement.h: Changed type to return a const AtomicString& instead
872         of a String.
873         * html/HTMLFieldSetElement.cpp: (WebCore::HTMLFieldSetElement::type): Ditto.
874         * html/HTMLKeygenElement.h: Ditto.
875         * html/HTMLKeygenElement.cpp: (WebCore::HTMLKeygenElement::type): Ditto.
876         * html/HTMLLegendElement.h: Ditto.
877         * html/HTMLLegendElement.cpp: (WebCore::HTMLLegendElement::type):
878         * html/HTMLOptGroupElement.h: Ditto.
879         * html/HTMLOptGroupElement.cpp: (WebCore::HTMLOptGroupElement::type): Ditto.
880         * html/HTMLOptionElement.h: Ditto.
881         * html/HTMLOptionElement.cpp: (WebCore::HTMLOptionElement::type): Ditto.
882
883         * ksvg2/svg/SVGAnimationElement.cpp: (SVGAnimationElement::closeRenderer):
884         Added missing call to base class.
885
886         * rendering/render_form.h: Removed element() functions that cast to the
887         appropriate derived element class. They do make some bits of code slightly
888         more readable, but they also require including too many headers. Removed
889         the includes of HTMLInputElement.h, HTMLSelectElement.h, HTMLTextAreaElement.h,
890         and KWQLineEdit.h, and added an include of GraphicsTypes.h.
891         * rendering/render_form.cpp:
892         (WebCore::RenderFormElement::updateFromElement): Changed use of element()
893         to instead use node() and cast.
894         (WebCore::RenderFormElement::clicked): Ditto.
895         (WebCore::RenderLineEdit::selectionChanged): Ditto.
896         (WebCore::RenderLineEdit::returnPressed): Ditto.
897         (WebCore::RenderLineEdit::performSearch): Ditto.
898         (WebCore::RenderLineEdit::addSearchResult): Ditto.
899         (WebCore::RenderLineEdit::calcMinMaxWidth): Ditto.
900         (WebCore::RenderLineEdit::setStyle): Ditto.
901         (WebCore::RenderLineEdit::updateFromElement): Ditto.
902         (WebCore::RenderLineEdit::valueChanged): Ditto.
903         (WebCore::RenderFileButton::calcMinMaxWidth): Ditto.
904         (WebCore::RenderFileButton::updateFromElement): Ditto.
905         (WebCore::RenderFileButton::returnPressed): Ditto.
906         (WebCore::RenderFileButton::valueChanged): Ditto.
907         (WebCore::RenderSelect::updateFromElement): Ditto.
908         (WebCore::RenderSelect::layout): Ditto.
909         (WebCore::RenderSelect::valueChanged): Ditto.
910         (WebCore::RenderSelect::selectionChanged): Ditto.
911         (WebCore::RenderSelect::updateSelection): Ditto.
912         (WebCore::RenderTextArea::destroy): Ditto.
913         (WebCore::RenderTextArea::calcMinMaxWidth): Ditto.
914         (WebCore::RenderTextArea::setStyle): Ditto.
915         (WebCore::RenderTextArea::updateFromElement): Ditto.
916         (WebCore::RenderTextArea::valueChanged): Ditto.
917         (WebCore::RenderTextArea::selectionChanged): Ditto.
918         (WebCore::RenderSlider::updateFromElement): Ditto.
919         (WebCore::RenderSlider::valueChanged): Ditto.
920
921 2006-05-05  Matt Gough  <matt@softchaos.com>
922
923         Reviewed by Darin.
924
925         http://bugzilla.opendarwin.org/show_bug.cgi?id=8563
926
927         Test: fast/doctypes/005-case-preserving.html
928
929         The doctype object in the DOM is now usable by client code
930         as opposed to always being exposed as nil. Now also ensures that
931         the 'name' of the component preserves the case of the original html source.
932         (i.e HtMl -> HtMl not HTML)
933
934         * dom/Document.h:
935         Changes comment by docType() to say it may return 0 for html
936         * html/HTMLDocument.cpp:
937         (WebCore::parseDocTypeDeclaration):
938         (WebCore::HTMLDocument::determineParseMode):
939         Preserves the case of the name component
940         (WebCore::HTMLDocument::doctype):removed
941         * html/HTMLDocument.h:
942         (WebCore::HTMLDocument::doctype):removed
943
944 2006-05-05  Rob Buis  <buis@kde.org>
945
946         Reviewed by Darin.
947
948         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8651:
949         [DOMHTMLSelectElement multiple] returns no when the select element is multiple
950
951         Correct the logic errors, which are clearly indicated by the changeset given
952         in the bug report.
953
954         * bindings/objc/DOMHTML.mm:
955         (-[DOMHTMLLinkElement disabled]):
956         (-[DOMHTMLSelectElement disabled]):
957         (-[DOMHTMLSelectElement multiple]):
958         (-[DOMHTMLOptGroupElement disabled]):
959         (-[DOMHTMLOptionElement defaultSelected]):
960         (-[DOMHTMLOptionElement disabled]):
961
962 2006-05-04  Darin Adler  <darin@apple.com>
963
964         Reviewed by Tim Omernick.
965
966         - fix storage leak I introduced yesterday
967
968         * platform/cg/GraphicsContextCG.cpp:
969         (WebCore::setCGFillColor): Added.
970         (WebCore::setCGStrokeColor): Added.
971         (WebCore::GraphicsContext::drawRect): Use setCGFillColor to avoid allocating
972         a CGColorRef object.
973         (WebCore::GraphicsContext::drawLine): Use setCGStrokeColor and setCGFillColor
974         to avoid allocating a CGColorRef object.
975         (WebCore::GraphicsContext::drawEllipse): Ditto.
976         (WebCore::GraphicsContext::drawArc): Ditto.
977         (WebCore::GraphicsContext::drawConvexPolygon): Ditto.
978         (WebCore::GraphicsContext::fillRect): Ditto.
979
980 2006-05-04  Justin Garcia  <justin.garcia@apple.com>
981
982         Reviewed by harrison
983
984         * dom/Node.cpp:
985         (WebCore::Node::rootEditableElement):
986         Restored code to stop at the body tag.  Editing shouldn't be allowed to 
987         happen outside the body, so it needs to be the editable root even if the 
988         html element is contentEditable.
989         * editing/ReplaceSelectionCommand.cpp:
990         (WebCore::ReplaceSelectionCommand::shouldMergeEnd):
991         Now takes in more information so it can be "the decider".
992         (WebCore::ReplaceSelectionCommand::doApply):
993         Merging two paragraphs will destroy the moved one's block styles. Perform 
994         the end merge backward (from content already in the document to just inserted
995         content) if moving forward would move the paragraph that contained the start of 
996         the selection being pasted into, since we always want to preserve that paragraph's 
997         block style.
998         Moving backward in this case is also helpful because otherwise it would be
999         difficult to remember the position where inserted content began (since merging
1000         would remove m_firstNodeInserted).  That position is needed in order to select 
1001         the replacement and to add smart replace whitespace.
1002         (WebCore::ReplaceSelectionCommand::removeEndBRIfNeeded):
1003         If [br, 0] is at the end of a block, the br is not necessarily collapsed
1004         in quirks mode.  [br, 0] needs to also not be at the start of a block.
1005          
1006         * editing/ReplaceSelectionCommand.h:
1007
1008 2006-05-04  Tim Omernick  <timo@apple.com>
1009
1010         Reviewed by Darin.
1011
1012         <rdar://problem/4537606> Give Java WebKit plugin access to its own DOM element
1013
1014         * bridge/mac/WebCoreFrameBridge.h:
1015         Added DOMElement parameter to -viewForJavaAppletWithFrame:attributeNames:attributeValues:baseURL:.
1016
1017         * bridge/JavaAppletWidget.h:
1018         Constructor now takes the applet's element instead of its containing frame.
1019
1020         * bridge/mac/JavaAppletWidget.mm:
1021         (JavaAppletWidget::JavaAppletWidget):
1022         Pass the applet's element to viewForJavaAppletWithFrame:.
1023
1024         * rendering/RenderApplet.cpp:
1025         (WebCore::RenderApplet::createWidgetIfNecessary):
1026         Pass the element along to JavaAppletWidget.
1027
1028 2006-05-04  Tim Omernick  <timo@apple.com>
1029
1030         Reviewed by John Sullivan.
1031
1032         <rdar://problem/4480186> Give WebKit plugins access to their own DOM element
1033
1034         * bridge/mac/WebCoreFrameBridge.h:
1035         Added DOMElement: parameter to -viewForPluginWithURL:attributeNames:attributueValues:MIMEType:
1036
1037         * bridge/mac/FrameMac.h:
1038         * bridge/mac/FrameMac.mm:
1039         (WebCore::FrameMac::createPlugin):
1040         Added "element" parameter; wrap element in DOMElement and pass up to the bridge.
1041
1042         * page/Frame.h:
1043         Added "element" parameter to createPlugin().
1044         * page/Frame.cpp:
1045         (WebCore::Frame::loadPlugin):
1046         Get the plugin's DOM element and pass to createPlugin().
1047
1048 2006-05-04  Eric Seidel  <eseidel@apple.com>
1049
1050         Reviewed by timo.
1051
1052         Add drag & drop support to <input type="file">
1053         http://bugzilla.opendarwin.org/show_bug.cgi?id=8733
1054
1055         Test: manual/input-type-file-drag-drop.html
1056
1057         * kwq/KWQFileButton.mm:
1058         (-[WebFileChooserButton initWithWidget::]):
1059         (-[WebCoreFileButton initWithWidget:]):
1060         (-[WebCoreFileButton drawRect:]):
1061         (-[WebCoreFileButton updateLabel]):
1062         (-[WebCoreFileButton setFilename:]):
1063         (-[WebCoreFileButton changeFilename:]):
1064         (-[WebCoreFileButton chooseFilename:]):
1065         (validFilenameFromPasteboard):
1066         (-[WebCoreFileButton draggingEntered:]):
1067         (-[WebCoreFileButton draggingExited:]):
1068         (-[WebCoreFileButton performDragOperation:]):
1069
1070 2006-05-04  Beth Dakin  <bdakin@apple.com>
1071
1072         Reviewed by Hyatt.
1073
1074         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8732 
1075         Backgrounds with background-size and background-origin do not 
1076         always lay out correctly
1077
1078         * platform/cairo/ImageCairo.cpp:
1079         (WebCore::Image::drawTiled): We no longer need to scale the source 
1080         point since it will now come in with the scale already taken into 
1081         account.
1082         * platform/mac/ImageMac.mm:
1083         (WebCore::Image::drawTiled): Same as above.
1084         * rendering/RenderBox.cpp:
1085         (WebCore::cacluateBackgroundSize): Now calculate the background 
1086         size in a helper method.
1087         (WebCore::RenderBox::paintBackgroundExtended): Calculate the 
1088         background size before calculating cx, cy, cw, ch, sx, and sy so 
1089         that they can all be calculated with the scaled image size taken 
1090         into account.
1091
1092 2006-05-04  David Hyatt  <hyatt@apple.com>
1093
1094         Fix for 8693, crash when reloading PDF. Make sure to clear the truncator's
1095         cached renderer.
1096
1097         Reviewed by beth
1098
1099         * bridge/mac/WebCoreStringTruncator.h:
1100         * bridge/mac/WebCoreStringTruncator.mm:
1101         (+[WebCoreStringTruncator clear]):
1102         * platform/mac/WebTextRendererFactory.mm:
1103         (-[WebTextRendererFactory clearCaches]):
1104
1105 2006-05-03  Darin Adler  <darin@apple.com>
1106
1107         Reviewed by Eric.
1108
1109         - http://bugzilla.opendarwin.org/show_bug.cgi?id=8696
1110           another round of GraphicsContext improvements
1111
1112         * WebCore.xcodeproj/project.pbxproj: Added GraphicsContextCG.cpp.
1113         * html/CanvasRenderingContext2D.cpp:
1114         (WebCore::CanvasRenderingContext2D::scale): Use new GraphicsContext function.
1115         (WebCore::CanvasRenderingContext2D::rotate): Ditto.
1116         (WebCore::CanvasRenderingContext2D::translate): Ditto.
1117         * kwq/KWQComboBox.mm: Added include (not sure if this is needed for this patch,
1118         but it's needed for one of my upcoming ones).
1119
1120         * platform/GraphicsContext.h: Changed fillColor and setFillColor to use Color
1121         instead of RGBA32. Removed setColorFromFillColor and setColorFromPen. Added
1122         scale, rotate, and translate functions.
1123         * platform/GraphicsContext.cpp:
1124         (WebCore::GraphicsContext::setFillColor): Changed to use Color instead of RGBA32.
1125         (WebCore::GraphicsContext::fillColor): Ditto.
1126
1127         * platform/GraphicsTypes.h: Moved HorizontalAlignment here.
1128         * platform/Widget.h: Removed HorizontalAlignment from here.
1129
1130         * platform/cg/GraphicsContextCG.cpp: Added. Started as a copy of GraphicsContextMac.mm.
1131         (WebCore::GraphicsContext::drawRect): Rewrote to not rely on [NSGraphicsContext currentContext].
1132         (WebCore::GraphicsContext::drawLine): Ditto.
1133         (WebCore::GraphicsContext::drawEllipse): Ditto.
1134         (WebCore::GraphicsContext::drawArc): Ditto.
1135         (WebCore::GraphicsContext::drawConvexPolygon): Ditto.
1136         (WebCore::GraphicsContext::fillRect): Ditto.
1137         (WebCore::GraphicsContext::setLineWidth):  Added check of paintingDisabled(). 
1138         (WebCore::GraphicsContext::setMiterLimit): Ditto.
1139         (WebCore::GraphicsContext::setAlpha): Ditto.
1140         (WebCore::GraphicsContext::clearRect): Ditto.
1141         (WebCore::GraphicsContext::strokeRect): Ditto.
1142         (WebCore::GraphicsContext::setLineCap): Ditto.
1143         (WebCore::GraphicsContext::setLineJoin): Ditto.
1144         (WebCore::GraphicsContext::clip): Ditto.
1145         (WebCore::GraphicsContext::scale): Added.
1146         (WebCore::GraphicsContext::rotate): Added.
1147         (WebCore::GraphicsContext::translate): Added.
1148
1149         * platform/mac/GraphicsContextMac.mm: Moved most of this file into GraphicsContextCG.cpp.
1150         (WebCore::GraphicsContext::setCompositeOperation): Added check of paintingDisabled().
1151
1152         * platform/mac/WebCoreSystemInterface.h: Added declarations so this header
1153         stands alone.
1154
1155 2006-05-03  Darin Adler  <darin@apple.com>
1156
1157         Reviewed by Justin.
1158
1159         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8159
1160           REGRESSION: Clicking outside new text field focuses the field
1161
1162         This bug has always been present for "content editable" HTML, but
1163         now affects <input type=text> as well. The problem is with the editing
1164         concept of a "deep equivalent". When computing the deep equivalent,
1165         the code can move from outside an editable area to inside. To fix this,
1166         I removed all use of the "deep equivalent" concept.
1167
1168         * rendering/RenderBlock.cpp: (WebCore::RenderBlock::positionForCoordinates):
1169         Changed argument names from _x and _y to just x and y. When the element
1170         is the editable root, changed things so that clicks that are not within
1171         the element at all return positions before or after the element, rather than
1172         always choosing the closest point within the element. This gets us off on
1173         the right foot, by not choosing a position inside an editable root when you
1174         click outside that editable root. This code handles shadowParentNode as well,
1175         and also calls positionForCoordinates on children rather than calling
1176         positionForRenderer (which I believe is now a function that can be removed).
1177
1178         * editing/VisiblePosition.h: Removed the deepEquivalent function.
1179         * editing/VisiblePosition.cpp:
1180         (WebCore::VisiblePosition::previousVisiblePosition): Removed use of the
1181         deepEquivalent function. Also, to make this function easier to understand
1182         I separated out the case where the start point is "in rendered content"
1183         and the case where it's not into two separate loops.
1184         (WebCore::VisiblePosition::nextVisiblePosition): Ditto.
1185         (WebCore::VisiblePosition::initDeepPosition): Removed use of the deepEquivalent
1186         function. Also added code to make sure that this work never turns a position
1187         outside an editable element into a position inside that editable element, or
1188         vice versa. Reorganized the code a bit.
1189
1190         * dom/Position.cpp:
1191         (WebCore::Position::upstream): Removed use of the deepEquivalent function.
1192         (WebCore::Position::downstream): Ditto.
1193
1194         * editing/htmlediting.cpp:
1195         (WebCore::editingIgnoresContent): Changed to use isReplaced instead of isWidget
1196         and isImage to determine if editing should ignore content.
1197         (WebCore::firstInSpecialElement): Rewrote isFirstVisiblePositionInSpecialElement
1198         to have code to share with positionBeforeContainingSpecialElement. And changed
1199         to allow both the position just before a table and the position just inside a
1200         table to qualify. While this is slightly sloppy, the old code worked because
1201         of the "deep equivalent" technique. This change is needed to get the desired
1202         results even without that technique.
1203         (WebCore::lastInSpecialElement): Ditto.
1204         (WebCore::isFirstVisiblePositionInSpecialElement): Changed to use the new function.
1205         (WebCore::positionBeforeContainingSpecialElement): Ditto.
1206         (WebCore::isLastVisiblePositionInSpecialElement): Ditto.
1207         (WebCore::positionAfterContainingSpecialElement): Ditto.
1208
1209         * dom/Node.cpp: (WebCore::Node::rootEditableElement): Rewrote to remove
1210         special case for body tag.
1211
1212         - other changes
1213
1214         * html/HTMLElement.cpp:
1215         (WebCore::HTMLElement::setOuterHTML): Added a FIXME about the fact
1216         that this won't merge neighboring text nodes the way setOuterText does.
1217         (WebCore::HTMLElement::setInnerText): Added a FIXME about the fact that
1218         this creates a text node even when setting to empty text.
1219         (WebCore::HTMLElement::setOuterText): Ditto.
1220
1221         * editing/DeleteSelectionCommand.cpp: Removed some #if 1 and #if 0.
1222         * editing/ReplaceSelectionCommand.cpp: A little reformatting.
1223         * rendering/render_button.h: Tiny formatting tweak.
1224
1225 2006-05-02  Adele Peterson  <adele@apple.com>
1226
1227         Reviewed by Beth.
1228
1229         Fix for <rdar://problem/4523671> 
1230         REGRESSION (NativeTextField): Auto-complete popup list doesn't appear at the correct location after scrolling page.
1231
1232         * bindings/objc/DOMHTML.mm: (-[DOMHTMLInputElement _rectOnScreen]):
1233         Use the documentView to compute the correct rect for the element when the view is scrolled.
1234
1235 2006-05-02  Justin Garcia  <justin.garcia@apple.com>
1236
1237         Reviewed by harrison
1238         
1239         <http://bugzilla.opendarwin.org/show_bug.cgi?id=8704>
1240         Fix a few end merge bugs
1241         <rdar://problem/4424044>
1242         REGRESSION: Extra line appears when typing
1243
1244         * bridge/mac/WebCoreFrameBridge.mm:
1245         (-[WebCoreFrameBridge smartInsertForString:replacingRange:beforeString:afterString:]): 
1246         Use renamed characterAfter.
1247         * editing/InsertParagraphSeparatorCommand.cpp:
1248         (WebCore::InsertParagraphSeparatorCommand::doApply):
1249         Regenerate a VisiblePosition that became stale during a text node split.
1250         Don't rebalance whitespace after the operation, 1) it has a bug that turns preserved
1251         newlines into nbsps, 2) I think it should only be done during serialization, not after 
1252         every command (since editable regions now always have -webkit-nbsp-mode:space on them).
1253         Use a regular br for the placeholder as I think we can move away from -webkit-block-placeholders.
1254         
1255         * editing/RebalanceWhitespaceCommand.cpp: Added FIXMEs.
1256         * editing/ReplaceSelectionCommand.cpp:
1257         (WebCore::ReplaceSelectionCommand::shouldMergeStart): Removed FIXME.
1258         (WebCore::ReplaceSelectionCommand::shouldMergeEnd): Can now use rendering information.
1259         (WebCore::ReplaceSelectionCommand::doApply):
1260         Call shouldMergeEnd after the insertion so that it can use rendering information.
1261         Don't use positionAfterNode of the last node inserted to mark the position at the end 
1262         of inserted content because canonicalization can send it into content that was already
1263         in the document.
1264         
1265         * editing/ReplaceSelectionCommand.h:
1266         * editing/VisiblePosition.cpp:
1267         (WebCore::VisiblePosition::characterAfter): 
1268         Renamed.  When two candidates are visually equivalent, the rightmost candidate will be 
1269         the one inside the text node where the character will be.
1270         
1271         * editing/VisiblePosition.h:
1272         * editing/htmlediting.cpp:
1273         (WebCore::enclosingTableCell): Added.
1274         (WebCore::enclosingList):
1275         * editing/htmlediting.h:
1276
1277 2006-05-02  David Hyatt  <hyatt@apple.com>
1278
1279         Partial fix for the crash in bugzilla bug 8088.  There's a third crash
1280         even after fixing this though.
1281
1282         Reviewed by darin
1283
1284         * platform/mac/WebTextRenderer.mm:
1285         (WebCore::WidthMap::widths):
1286         (WebCore::extendWidthMap):
1287         * platform/mac/WebTextRendererFactory.mm:
1288         (-[WebTextRendererFactory clearCaches]):
1289
1290 2006-05-02  Steve Falkenburg  <sfalken@apple.com>
1291
1292         Reviewed by eric.
1293
1294         * WebCore.vcproj/WebCore/WebCore.vcproj: defined NDEBUG in release build
1295         * bridge/win/FrameWin.cpp:
1296         (WebCore::FrameWin::FrameWin): turned on javascript.
1297         * kwq/KWQKHTMLSettings.h: 
1298         (KHTMLSettings::KHTMLSettings): initialized settings to 0
1299
1300 2006-05-02  David Hyatt  <hyatt@apple.com>
1301
1302         Make sure to updateLayout on all scrolling functions (in particular when
1303         setting scrollLeft/Top).
1304
1305         Reviewed by eric
1306
1307         fast/overflow/008,html added as a test case.
1308
1309         * dom/Element.cpp:
1310         (WebCore::Element::scrollIntoView):
1311         (WebCore::Element::scrollIntoViewIfNeeded):
1312         (WebCore::Element::setScrollLeft):
1313         (WebCore::Element::setScrollTop):
1314
1315 2006-05-02  Anders Carlsson  <andersca@mac.com>
1316
1317         Reviewed by Dave Hyatt.
1318         
1319         http://bugzilla.opendarwin.org/show_bug.cgi?id=8688
1320         file URLs aren't being serialized correctly when using window.location
1321         
1322         * platform/KURL.cpp:
1323         (KURL::prettyURL):
1324         Append "//" for file URLs.
1325         
1326 2006-05-01  David Hyatt  <hyatt@apple.com>
1327
1328         Convert WebTextRenderer to be a C++ class.  Change the factory so
1329         that it uses pointer-based hashmaps instead of NSMutableDictionaries.
1330         Convert uses of malloc/free to new/delete so that they start using
1331         the fastMalloc/fastFree code.
1332
1333         Reviewed by darin
1334
1335         * bridge/mac/WebCoreStringTruncator.mm:
1336         (stringWidth):
1337         (truncateString):
1338         * kwq/KWQComboBox.mm:
1339         (QComboBox::sizeHint):
1340         * kwq/KWQLineEdit.mm:
1341         (QLineEdit::sizeForCharacterWidth):
1342         * kwq/KWQListBox.mm:
1343         (itemTextRenderer):
1344         (groupLabelTextRenderer):
1345         (QListBox::sizeForNumberOfLines):
1346         (QListBox::clearCachedTextRenderers):
1347         (-[KWQTableView drawRow:clipRect:]):
1348         * platform/FontDataSet.h:
1349         * platform/mac/FontMac.mm:
1350         (WebCore::FontDataSet::~FontDataSet):
1351         (WebCore::FontDataSet::getRenderer):
1352         (WebCore::FontDataSet::invalidate):
1353         (WebCore::Font::ascent):
1354         (WebCore::Font::descent):
1355         (WebCore::Font::lineSpacing):
1356         (WebCore::Font::xHeight):
1357         (WebCore::Font::selectionRectForText):
1358         (WebCore::Font::drawText):
1359         (WebCore::Font::drawHighlightForText):
1360         (WebCore::Font::drawLineForText):
1361         (WebCore::Font::drawLineForMisspelling):
1362         (WebCore::Font::misspellingLineThickness):
1363         (WebCore::Font::floatWidth):
1364         (WebCore::Font::checkSelectionPoint):
1365         * platform/mac/WebCoreTextRenderer.mm:
1366         (WebCoreDrawTextAtPoint):
1367         (WebCoreTextFloatWidth):
1368         (WebCoreSetAlwaysUseATSU):
1369         * platform/mac/WebTextRenderer.h:
1370         (WebCore::WebTextRenderer::ascent):
1371         (WebCore::WebTextRenderer::descent):
1372         (WebCore::WebTextRenderer::lineSpacing):
1373         (WebCore::WebTextRenderer::lineGap):
1374         (WebCore::WebTextRenderer::misspellingLineThickness):
1375         (WebCore::WebTextRenderer::misspellingLinePatternWidth):
1376         (WebCore::WebTextRenderer::misspellingLinePatternGapWidth):
1377         * platform/mac/WebTextRenderer.mm:
1378         (WebCore::WebCoreInitializeFont):
1379         (WebCore::WebCoreInitializeTextRun):
1380         (WebCore::WebCoreInitializeEmptyTextStyle):
1381         (WebCore::WebCoreInitializeEmptyTextGeometry):
1382         (WebCore::widthForGlyph):
1383         (WebCore::overrideLayoutOperation):
1384         (WebCore::m_ATSUMirrors):
1385         (WebCore::WebTextRenderer::~WebTextRenderer):
1386         (WebCore::WebTextRenderer::xHeight):
1387         (WebCore::WebTextRenderer::drawRun):
1388         (WebCore::WebTextRenderer::floatWidthForRun):
1389         (WebCore::WebTextRenderer::drawLineForCharacters):
1390         (WebCore::WebTextRenderer::selectionRectForRun):
1391         (WebCore::WebTextRenderer::drawHighlightForRun):
1392         (WebCore::WebTextRenderer::drawLineForMisspelling):
1393         (WebCore::WebTextRenderer::pointToOffset):
1394         (WebCore::WebTextRenderer::setAlwaysUseATSU):
1395         (WebCore::getSmallCapsRenderer):
1396         (WebCore::findSubstituteFont):
1397         (WebCore::rendererForAlternateFont):
1398         (WebCore::computeWidthForSpace):
1399         (WebCore::setUpFont):
1400         (WebCore::CG_selectionRect):
1401         (WebCore::CG_draw):
1402         (WebCore::updateGlyphMapEntry):
1403         (WebCore::extendGlyphMap):
1404         (WebCore::extendWidthMap):
1405         (WebCore::initializeATSUStyle):
1406         (WebCore::createATSULayoutParameters):
1407         (WebCore::disposeATSULayoutParameters):
1408         (WebCore::addDirectionalOverride):
1409         (WebCore::ATSU_selectionRect):
1410         (WebCore::ATSU_draw):
1411         (WebCore::ATSU_pointToOffset):
1412         (WebCore::freeWidthMap):
1413         (WebCore::freeGlyphMap):
1414         (WebCore::glyphForCharacter):
1415         (WebCore::advanceWidthIterator):
1416         * platform/mac/WebTextRendererFactory.h:
1417         * platform/mac/WebTextRendererFactory.mm:
1418         (-[WebTextRendererFactory clearCaches]):
1419         (-[WebTextRendererFactory init]):
1420         (-[WebTextRendererFactory dealloc]):
1421         (-[WebTextRendererFactory rendererWithFont:]):
1422
1423 2006-05-01  Justin Garcia  <justin.garcia@apple.com>
1424
1425         Reviewed by darin
1426         
1427         <http://bugzilla.opendarwin.org/show_bug.cgi?id=8653>
1428         Remove a use of hasMoreThanOneBlock, which uses info from the test rendering.
1429
1430         * editing/DeleteSelectionCommand.cpp:
1431         (WebCore::DeleteSelectionCommand::initializePositionData):
1432         Removed code that stopped the merge if the end of the selection to delete
1433         was in a fully selected line, which was nonsense.
1434         
1435         (WebCore::DeleteSelectionCommand::mergeParagraphs):
1436         Deletion does a bad job of updating the endpoints of the selection as it removes 
1437         content.  If the endpoints have been flip flipped, bail.
1438         If deletion has removed everything from the block that contained the
1439         start of the selection to delete, we can't create a visible position inside 
1440         that block to serve as a destination for the merge.  So, we insert a placeholder 
1441         at that position to prop the block open to let content in.
1442         
1443         * editing/ReplaceSelectionCommand.cpp:
1444         (WebCore::ReplaceSelectionCommand::doApply):
1445         Added an assert and two early returns for cases where we'll crash.
1446         Removed a use of !fragment.hasMoreThanOneBlock, which uses test rendering info 
1447         and which was wrong.
1448         If we've already inserted content during the start merge, insertionPos will be 
1449         the position just after that content, so inserting new content before insertionPos 
1450         will reverse its order.
1451
1452 2006-05-01  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1453
1454         Reviewed by Darin.
1455
1456         - manual test for http://bugzilla.opendarwin.org/show_bug.cgi?id=8658
1457           Assertion failure in -[WebPluginContainerCheck _isForbiddenFileLoad]
1458           (bridge is null) when clicking QuickTime object with href
1459
1460         * manual-tests/plugin-controller-datasource.html: Added.
1461         * manual-tests/resources/orange.mov: Added.
1462
1463 2006-04-30  Rob Buis  <buis@kde.org>
1464
1465         Reviewed by eseidel.  Landed by eseidel.
1466
1467         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8651:
1468         CGContextSetLineDash: invalid dash array: emmited during WebKit tests
1469
1470         Properly discard invalid stroke-dasharray properties like in
1471         invalid-css.svg.  (Tests updated.)
1472
1473         * ksvg2/css/SVGCSSParser.cpp:
1474         (WebCore::CSSParser::parseSVGStrokeDasharray):
1475
1476 2006-04-28  David Hyatt  <hyatt@apple.com>
1477
1478         Make image buffer sizes in the loader more accurate, since we know we store
1479         buffers with 4 bytes per pixel.  Double sizes to account for this.  Also
1480         deal better with animated GIFs that may have thousands of frames by adding
1481         in a heuristic that will use the data size instead of a single frame RGBA32
1482         buffer size if it's larger.
1483
1484         Reviewed by darin
1485
1486         * loader/Cache.cpp:
1487         * loader/CachedImage.cpp:
1488         (WebCore::CachedImage::data):
1489
1490 2006-04-28  Steve Falkenburg  <sfalken@apple.com>
1491
1492         Reviewed by eric.
1493
1494         No test necessary - fixing Win32 build, turned off C++ exceptions, turned off RTTI
1495
1496         * WebCore.vcproj/WebCore/WebCore.vcproj:
1497         * bridge/win/FrameWin.cpp:
1498         (WebCore::FrameWin::~FrameWin):
1499         * bridge/win/PageWin.cpp:
1500         (WebCore::Page::Page):
1501         * page/Page.h:
1502         * platform/win/TemporaryLinkStubs.cpp:
1503         (FrameWin::saveDocumentState):
1504         (Path::contains):
1505         (Path::boundingRect):
1506
1507 2006-04-28  David Hyatt  <hyatt@apple.com>
1508
1509         Merge WebCoreTextRenderer into WebTextRenderer.  Merge WebCoreTextRendererFactory
1510         into WebTextRendererFactory.  Change all callers to refer to the concrete classes
1511         now.  Change WebCoreTextRenderer.h to be the public API that WebKit uses when
1512         it calls in to WebCore.  Clean up the exports to remove things WebKit no longer
1513         needs.
1514
1515         Reviewed by darin
1516
1517         * WebCore.exp:
1518         * WebCore.xcodeproj/project.pbxproj:
1519         * bridge/mac/WebCoreStringTruncator.mm:
1520         (stringWidth):
1521         (truncateString):
1522         (+[WebCoreStringTruncator widthOfString:font:]):
1523         * kwq/KWQComboBox.mm:
1524         (QComboBox::sizeHint):
1525         * kwq/KWQLineEdit.mm:
1526         (QLineEdit::sizeForCharacterWidth):
1527         * kwq/KWQListBox.mm:
1528         (itemTextRenderer):
1529         (groupLabelTextRenderer):
1530         (QListBox::sizeForNumberOfLines):
1531         (-[KWQTableView drawRow:clipRect:]):
1532         * platform/Font.h:
1533         * platform/FontDataSet.h:
1534         * platform/mac/FontMac.mm:
1535         (WebCore::FontDataSet::getWebCoreFont):
1536         (WebCore::FontDataSet::getRenderer):
1537         (WebCore::FontDataSet::determinePitch):
1538         * platform/mac/WebCoreTextRenderer.h:
1539         * platform/mac/WebCoreTextRendererFactory.mm:
1540         (-[WebCoreTextRendererFactory init]):
1541         * platform/mac/WebTextRenderer.h:
1542         * platform/mac/WebTextRenderer.mm:
1543         * platform/mac/WebTextRendererFactory.h:
1544         * platform/mac/WebTextRendererFactory.mm:
1545         (WebCoreInitializeFont):
1546         (WebCoreInitializeTextRun):
1547         (WebCoreInitializeEmptyTextStyle):
1548         (WebCoreInitializeEmptyTextGeometry):
1549         (-[WebTextRendererFactory clearCaches]):
1550         (+[WebTextRendererFactory createSharedFactory]):
1551         (+[WebTextRendererFactory sharedFactory]):
1552         (-[WebTextRendererFactory init]):
1553
1554 2006-04-28  David Hyatt  <hyatt@apple.com>
1555
1556         Fix for 8586, move WebTextRenderer into WebCore.
1557
1558         Reviewed by darin
1559
1560         * WebCore.exp:
1561         * WebCore.xcodeproj/project.pbxproj:
1562         * bridge/mac/WebCoreStringTruncator.mm:
1563         * platform/mac/WebCoreSystemInterface.h:
1564         * platform/mac/WebCoreSystemInterface.mm:
1565         * platform/mac/WebCoreTextRenderer.h:
1566         * platform/mac/WebCoreTextRendererFactory.mm:
1567         (+[WebCoreTextRendererFactory sharedFactory]):
1568         * platform/mac/WebTextRenderer.h: Added.
1569         * platform/mac/WebTextRenderer.mm: Added.
1570         (widthForGlyph):
1571         (-[WebTextRenderer initWithFont:]):
1572         (destroy):
1573         (-[WebTextRenderer drawLineForCharacters:yOffset:width:color:thickness:]):
1574         (-[WebTextRenderer drawLineForMisspelling:withWidth:]):
1575         (findSubstituteFont):
1576         (setUpFont):
1577         (pathFromFont):
1578         (drawGlyphs):
1579         (CG_draw):
1580         (extendGlyphMap):
1581         (extendWidthMap):
1582         (initializeATSUStyle):
1583         (createATSULayoutParameters):
1584         (getTextBounds):
1585         (addDirectionalOverride):
1586         (ATSU_draw):
1587         (normalizeVoicingMarks):
1588         (advanceWidthIterator):
1589         (fillStyleWithAttributes):
1590         * platform/mac/WebTextRendererFactory.h: Added.
1591         * platform/mac/WebTextRendererFactory.mm: Added.
1592         (getAppDefaultValue):
1593         (getUserDefaultValue):
1594         (getLCDScaleParameters):
1595         (fontsChanged):
1596         (+[WebTextRendererFactory createSharedFactory]):
1597         (-[WebTextRendererFactory isFontFixedPitch:]):
1598         (-[WebTextRendererFactory fontWithFamily:traits:size:]):
1599         (FontCacheKeyCopy):
1600         (-[WebTextRendererFactory cachedFontFromFamily:traits:size:]):
1601
1602 2006-04-28  Eric Seidel  <eseidel@apple.com>
1603
1604         Fix by beth.  Reviewed by darin.  Landed by eseidel.
1605
1606         Make hackish fix to avoid crash in Xcode and Filemaker.
1607         <rdar://problem/4059059> Crash in RenderFlow::detach (XCode Documentation Window)
1608
1609         * bridge/mac/WebCoreFrameBridge.mm:
1610         (-[WebCoreFrameBridge didNotOpenURL:pageCache:]):
1611
1612 2006-04-28  Alexey Proskuryakov  <ap@nypop.com>
1613
1614         Reviewed by hyatt.
1615
1616         - http://bugzilla.opendarwin.org/show_bug.cgi?id=5855
1617           REGRESSION: revert SGML comment parsing fix (comment parsing causes most of usbank.com page to be missing)
1618
1619         * html/HTMLTokenizer.cpp:
1620         (WebCore::HTMLTokenizer::parseComment): Revert one change made for acid2, 
1621         <http://weblogs.mozillazine.org/hyatt/acid6.txt>.
1622
1623 2006-04-28  Darin Adler  <darin@apple.com>
1624
1625         Reviewed by Eric.
1626
1627         - http://bugzilla.opendarwin.org/show_bug.cgi?id=8608
1628           make GraphicsContext more suitable for cross-platform use, step 2
1629
1630         - Changed GraphicsContext to use NSGraphicsContext as little as possible.
1631         - Removed the printing flag from GraphicsContext.
1632         - Changed GraphicsContext to assume the NSGraphicsContext is always flipped,
1633           and got rid of parameters to pass the flipped boolean around.
1634
1635         * WebCore.vcproj/WebCore/WebCore.vcproj: Add GraphicsTypes.h/cpp and remove
1636         CompositeOperator.h/cpp.
1637         * WebCore.xcodeproj/project.pbxproj: Ditto.
1638
1639         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::setDisplaysWithFocusAttributes):
1640         * bridge/mac/WebCoreFrameBridge.mm: (-[WebCoreFrameBridge drawRect:]):
1641         * html/CanvasPattern.cpp: (WebCore::patternCallback):
1642         * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::createDrawingContext):
1643         * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
1644         (WebCore::KRenderingDeviceContextQuartz::createGraphicsContext):
1645         * platform/mac/WidgetMac.mm: (WebCore::Widget::lockDrawingFocus):
1646         Update for changes to GraphicsContext constructor (no flipped or printing boolean).
1647
1648         * html/CanvasRenderingContext2D.h: Added a Path to the context state. Changed the
1649         LineCap and LineJoin types to use the new ones in GraphicsTypes.h instead of defining
1650         types here in this class. Changed m_platformContextStrokeStyleIsPattern and
1651         m_platformContextFillStyleIsPattern to be named m_appliedStrokePattern and
1652         m_appliedFillPattern and moved them outside the __APPLE__ ifdefs. Removed the
1653         platformContext() function. Moved applyStrokePattern and applyFillPattern out of
1654         the __APPLE__ ifdef.
1655
1656         * html/CanvasRenderingContext2D.cpp:
1657         (WebCore::CanvasRenderingContext2D::State::State): Moved the stroke pattern
1658         booleans out of Mac-specific ifdef.
1659         (WebCore::CanvasRenderingContext2D::save): Changed to use GraphicsContext instead
1660         of using CGContext directly.
1661         (WebCore::CanvasRenderingContext2D::restore): Ditto.
1662         (WebCore::CanvasRenderingContext2D::setStrokeStyle): Ditto.
1663         (WebCore::CanvasRenderingContext2D::setFillStyle): Ditto.
1664         (WebCore::CanvasRenderingContext2D::setLineWidth): Ditto.
1665         (WebCore::CanvasRenderingContext2D::lineCap): Ditto.
1666         (WebCore::CanvasRenderingContext2D::setLineCap): Ditto.
1667         (WebCore::CanvasRenderingContext2D::lineJoin): Ditto.
1668         (WebCore::CanvasRenderingContext2D::setLineJoin): Ditto.
1669         (WebCore::CanvasRenderingContext2D::setMiterLimit): Ditto.
1670         (WebCore::CanvasRenderingContext2D::shadowColor): Ditto.
1671         (WebCore::CanvasRenderingContext2D::setGlobalAlpha): Ditto.
1672         (WebCore::CanvasRenderingContext2D::setGlobalCompositeOperation): Ditto.
1673         (WebCore::CanvasRenderingContext2D::scale): Update since platformContext() function
1674         no longer exists.
1675         (WebCore::CanvasRenderingContext2D::rotate): Ditto.
1676         (WebCore::CanvasRenderingContext2D::translate): Ditto.
1677         (WebCore::CanvasRenderingContext2D::beginPath): Changed to use GraphicsContext instead
1678         of using CGContext directly.
1679         (WebCore::CanvasRenderingContext2D::closePath): Ditto.
1680         (WebCore::CanvasRenderingContext2D::moveTo): Ditto.
1681         (WebCore::CanvasRenderingContext2D::lineTo): Ditto.
1682         (WebCore::CanvasRenderingContext2D::quadraticCurveTo): Ditto.
1683         (WebCore::CanvasRenderingContext2D::bezierCurveTo): Ditto.
1684         (WebCore::CanvasRenderingContext2D::arcTo): Ditto.
1685         (WebCore::CanvasRenderingContext2D::arc): Ditto.
1686         (WebCore::CanvasRenderingContext2D::rect): Ditto.
1687         (WebCore::CanvasRenderingContext2D::fill): Changed to use the current path from this class
1688         instead of relying on the CGContext's current path.
1689         (WebCore::CanvasRenderingContext2D::stroke): Ditto.
1690         (WebCore::CanvasRenderingContext2D::clip): Changed to use the current path and use the
1691         GraphicsContext instead of using CGContext directly.
1692         (WebCore::CanvasRenderingContext2D::clearRect): Changed to use GraphicsContext instead
1693         of using CGContext directly.
1694         (WebCore::CanvasRenderingContext2D::fillRect): Update since platformContext() function
1695         no longer exists.
1696         (WebCore::CanvasRenderingContext2D::strokeRect): Ditto.
1697         (WebCore::CanvasRenderingContext2D::setShadow): Ditto.
1698         (WebCore::CanvasRenderingContext2D::applyShadow): Ditto.
1699         (WebCore::CanvasRenderingContext2D::drawImage): Ditto.
1700         (WebCore::CanvasRenderingContext2D::drawImageFromRect): Ditto.
1701         (WebCore::CanvasRenderingContext2D::createPattern): Ditto.
1702         (WebCore::CanvasRenderingContext2D::applyStrokePattern): Made a tiny bit of this function
1703         cross-platform. The bulk is still Mac-specific.
1704         (WebCore::CanvasRenderingContext2D::applyFillPattern): Ditto.
1705
1706         * html/CanvasStyle.h: Changed to use GraphicsContext instead of CGContext. Now the
1707         platform-specific stuff is in the implementation, not the header.
1708         * html/CanvasStyle.cpp:
1709         (WebCore::CanvasStyle::applyStrokeColor): Moved the ifdefs inside the function, getting
1710         us one step closer to platform independence.
1711         (WebCore::CanvasStyle::applyFillColor): Ditto.
1712
1713         * html/html_imageimpl.cpp:
1714         (WebCore::HTMLAreaElement::getRect): Update for changes to the Path class.
1715         (WebCore::HTMLAreaElement::getRegion): Ditto.
1716
1717         * page/Frame.cpp:
1718         (WebCore::Frame::paint): Change to check printing flag on the document, rather than on
1719         the GraphicsContext, since there is no printing flag for GraphicsContext any more.
1720         (WebCore::Frame::adjustPageHeight): Update for change to GraphicsContext constructor.
1721
1722         * platform/GraphicsContext.h: Define a type called PlatformGraphicsContext so the
1723         platform-specific getter and constructor don't have to be ifdef'd. Added clearRect,
1724         strokeRect, setLineWidth, setLineCap, setLineJoin, setMiterLimit, setAlpha, setCompositeOperation,
1725         and clip functions. Removed the isForPrinting parameter from createGraphicsContextPrivate.
1726         * platform/GraphicsContext.cpp:
1727         (WebCore::GraphicsContextPrivate::GraphicsContextPrivate): Removed isForPrinting.
1728         (WebCore::GraphicsContext::createGraphicsContextPrivate): Ditto.
1729         * platform/mac/GraphicsContextMac.mm:
1730         (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
1731         Removed NSGraphicsContext.
1732         (WebCore::GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate):
1733         Ditto.
1734         (WebCore::GraphicsContext::GraphicsContext): Removed constructor that
1735         takes an NSGraphicsContext. Removed the flipText and forPrinting parameters
1736         to the other constructor.
1737         (WebCore::GraphicsContext::savePlatformState): Removed NSGraphicsContext code.
1738         (WebCore::GraphicsContext::restorePlatformState): Ditto.
1739         (WebCore::GraphicsContext::drawRect): Updated assertion to more-precisely
1740         reflect the limitation of the current version of this function.
1741         (WebCore::GraphicsContext::setColorFromFillColor): Ditto.
1742         (WebCore::GraphicsContext::setColorFromPen): Ditto.
1743         (WebCore::GraphicsContext::drawLine): Updated assertion to more-precisely
1744         reflect the limitation of the current version of this function.
1745         (WebCore::setCompositeOperation):
1746         (WebCore::GraphicsContext::fillRect): Ditto.
1747         (WebCore::GraphicsContext::setLineWidth): Added.
1748         (WebCore::GraphicsContext::setMiterLimit): Added.
1749         (WebCore::GraphicsContext::setAlpha): Added.
1750         (WebCore::GraphicsContext::setCompositeOperation): Added.
1751         (WebCore::GraphicsContext::clearRect): Added.
1752         (WebCore::GraphicsContext::strokeRect): Added.
1753         (WebCore::GraphicsContext::setLineCap): Added.
1754         (WebCore::GraphicsContext::setLineJoin): Added.
1755         (WebCore::GraphicsContext::clip): Added.
1756
1757         * platform/CompositeOperator.cpp: Removed.
1758         * platform/CompositeOperator.h: Removed.
1759         * platform/GraphicsTypes.cpp: Added. Includes CompositeOperator, LineCap, and LineJoin.
1760         * platform/GraphicsTypes.h: Added.
1761
1762         * platform/Image.h: Changed include to GraphicsTypes.h from CompositeOperator.h.
1763
1764         * platform/Path.h: Removed constructors that take a Rect and an array of points. Made
1765         the Path mutable. Changed the types for contains and boundingRect to be float-based
1766         instead of int-based. Changed translate to take a FloatSize instead of two integers.
1767         Added clear, moveTo, addLineTo, addQuadCurveTo, addBezierCurveTo, addArcTo, closeSubpath,
1768         addArc, addRect, addEllipse, and platformPath functions. Defined a PlatformPath type
1769         so we don't have to ifdef the header so much.
1770         * platform/cg/PathCG.cpp:
1771         (WebCore::Path::Path): Changed class to always have a mutable path.
1772         (WebCore::Path::operator=): Changed to make a mutable copy.
1773         (WebCore::Path::contains): Changed to take a FloatPoint instead of IntPoint.
1774         (WebCore::Path::translate): Changed to use a FloatSize instead of two ints.
1775         (WebCore::Path::boundingRect): Changed to return a FloatRect.
1776         (WebCore::Path::moveTo): Added.
1777         (WebCore::Path::addLineTo): Added.
1778         (WebCore::Path::addQuadCurveTo): Added.
1779         (WebCore::Path::addBezierCurveTo): Added.
1780         (WebCore::Path::addArcTo): Added.
1781         (WebCore::Path::closeSubpath): Added.
1782         (WebCore::Path::addArc): Added.
1783         (WebCore::Path::addRect): Added.
1784         (WebCore::Path::addEllipse): Added.
1785         (WebCore::Path::clear): Added.
1786
1787         * platform/mac/ImageMac.mm:
1788         (WebCore::fillSolidColorInRect): Changed to take a GraphicsContext instead of
1789         a CGContext.
1790         (WebCore::Image::checkForSolidColor): Changed to use the new setCompositeOperation
1791         in GraphicsContex.
1792         (WebCore::Image::draw): Changed to use the new PDF image and fillSolidColorInRect
1793         function that take GraphicsContext instead of CGContext.
1794         (WebCore::Image::drawTiled): Ditto.
1795
1796         * platform/mac/PDFDocumentImage.h: Made most functions private. Changed to
1797         use GraphicsContext and FloatRect instead of CGContext and NSRect. Also
1798         removed the unused alpha and flipped booleans.
1799         * platform/mac/PDFDocumentImage.mm:
1800         (WebCore::PDFDocumentImage::bounds): Update for change in types.
1801         (WebCore::PDFDocumentImage::adjustCTM): Ditto.
1802         (WebCore::PDFDocumentImage::setCurrentPage): Ditto.
1803         (WebCore::PDFDocumentImage::draw): Ditto.
1804
1805         * platform/win/TemporaryLinkStubs.cpp: Added lots of new stubs.
1806
1807         * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paint): Changed to get
1808         printing boolean from document instead graphics context.
1809         * rendering/RenderBlock.cpp:
1810         (WebCore::RenderBlock::paintChildren): Ditto.
1811         (WebCore::RenderBlock::paintObject): Ditto.
1812         * rendering/RenderFlow.cpp: (WebCore::RenderFlow::paintLines): Ditto.
1813         * rendering/RenderHTMLCanvas.cpp: (WebCore::RenderHTMLCanvas::paint): Ditto.
1814         * rendering/RenderImage.cpp: (WebCore::RenderImage::paint): Ditto.
1815         * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintButton): Ditto.
1816         * rendering/render_list.cpp: (WebCore::RenderListMarker::paint): Ditto.
1817         * rendering/render_replaced.cpp: (WebCore::RenderWidget::paint): Ditto.
1818
1819 2006-04-28  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1820
1821         Reviewed by hyatt, landed by ap.
1822
1823         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6769
1824           REGRESSION: Incomplete repaint when a cell's extra bottom margin grows
1825
1826         Test: fast/repaint/table-extra-bottom-grow.html
1827
1828         * rendering/RenderBlock.cpp:
1829         (WebCore::RenderBlock::overflowRect): Changed to not add the top/left overflow twice and
1830         allow the normal overflow height to overlap with the bottom extra height.
1831         * rendering/RenderTableRow.cpp:
1832         (WebCore::RenderTableRow::layout): Removed the code that resets the extra heights.
1833         * rendering/RenderTableSection.cpp:
1834         (WebCore::RenderTableSection::layoutRows): If the top extra height changed or the
1835         bottom extra height increased, just repaint the entire cell.
1836
1837 2006-04-28  Eric Seidel  <eseidel@apple.com>
1838
1839         Reviewed by andersca.
1840
1841         Remove KCanvasContainerQuartz, pushing all logic into KCanvasContainer.
1842         
1843         No tests affected.
1844
1845         * kcanvas/KCanvasContainer.cpp:
1846         (WebCore::KCanvasContainer::canHaveChildren):
1847         (WebCore::KCanvasContainer::requiresLayer):
1848         (WebCore::KCanvasContainer::lineHeight):
1849         (WebCore::KCanvasContainer::baselinePosition):
1850         (WebCore::KCanvasContainer::calcMinMaxWidth):
1851         (WebCore::KCanvasContainer::layout):
1852         (WebCore::KCanvasContainer::paint):
1853         (WebCore::KCanvasContainer::setViewport):
1854         (WebCore::KCanvasContainer::viewport):
1855         (WebCore::KCanvasContainer::setViewBox):
1856         (WebCore::KCanvasContainer::viewBox):
1857         (WebCore::KCanvasContainer::setAlign):
1858         (WebCore::KCanvasContainer::align):
1859         (WebCore::KCanvasContainer::viewportTransform):
1860         (WebCore::KCanvasContainer::getAbsoluteRepaintRect):
1861         (WebCore::KCanvasContainer::absoluteTransform):
1862         (WebCore::KCanvasContainer::getAspectRatio):
1863         * kcanvas/KCanvasContainer.h:
1864         (WebCore::KCanvasContainer::renderName):
1865         * kcanvas/device/KRenderingDevice.h:
1866         * kcanvas/device/quartz/KCanvasResourcesQuartz.h:
1867         * kcanvas/device/quartz/KCanvasResourcesQuartz.mm:
1868         * kcanvas/device/quartz/KRenderingDeviceQuartz.h:
1869         * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
1870         (WebCore::KRenderingDeviceQuartz::createPaintServer):
1871         * ksvg2/svg/SVGAElement.cpp:
1872         (WebCore::SVGAElement::createRenderer):
1873         * ksvg2/svg/SVGGElement.cpp:
1874         (SVGGElement::createRenderer):
1875         * ksvg2/svg/SVGMarkerElement.cpp:
1876         (WebCore::SVGMarkerElement::createRenderer):
1877         * ksvg2/svg/SVGMaskElement.cpp:
1878         (WebCore::SVGMaskElement::createRenderer):
1879         * ksvg2/svg/SVGPatternElement.cpp:
1880         (WebCore::SVGPatternElement::createRenderer):
1881         * ksvg2/svg/SVGSVGElement.cpp:
1882         (WebCore::SVGSVGElement::createRenderer):
1883         * ksvg2/svg/SVGSwitchElement.cpp:
1884         (WebCore::SVGSwitchElement::createRenderer):
1885         * ksvg2/svg/SVGUseElement.cpp:
1886         (SVGUseElement::createRenderer):
1887
1888 2006-04-27  Eric Seidel  <eseidel@apple.com>
1889
1890         Reviewed by andersca.
1891
1892         Make WebCore accept any */*+xml type as XML.
1893         http://bugzilla.opendarwin.org/show_bug.cgi?id=5998
1894         <rdar://problem/4031511> XmlHttpRequest doesn't allow responses with Content-Type: application/soap+xml
1895
1896         Test: http/tests/xmlhttprequest/supported-xml-content-types.html
1897
1898         * dom/DOMImplementation.cpp:
1899         (WebCore::DOMImplementation::isXMLMIMEType):
1900
1901 2006-04-27  Eric Seidel  <eseidel@apple.com>
1902
1903         * WebCore.vcproj/WebCore/WebCore.vcproj: Fix break from last checkin.
1904
1905 2006-04-27  Geoffrey Garen  <ggaren@apple.com>
1906
1907         Reviewed by Maciej.
1908
1909         - Added global constructor autogeneration for the following,
1910         many of which are required by *.live.com: Node, Element, Range,
1911         CSSRule, CSSValue, CSSPrimitiveValue, CSSStyleDeclaration, Event,
1912         MutationEvent, NodeFilter
1913
1914         It works like so:
1915         
1916         - The autogenerator knows about the "Constructor" data type, which
1917         gets special treatment because it exists purely in the
1918         bindings. It also knows about the "GenerateConstructor" interface
1919         attribute, which does just that.
1920
1921         - The window interface has many Constructor attributes
1922
1923         - The hash table generator swizzles empty tables to tables with one
1924         empty bucket, to prevent crashes in Lookup::findEntry. (The old
1925         generator used to work this way, too.)
1926
1927         - Window object property lookup gets special treatment to allow
1928         shadowing of its built-in global constructor properties. We'll
1929         need to expand this mechanism in the future and make it more
1930         flexible, but it works for now.
1931         
1932         * DerivedSources.make:
1933         * WebCore.vcproj/WebCore/WebCore.vcproj:
1934         * WebCore.xcodeproj/project.pbxproj:
1935         * bindings/js/kjs_css.cpp:
1936         (KJS::toJS):
1937         * bindings/js/kjs_css.h:
1938         * bindings/js/kjs_window.cpp: Removed 'namedFrameGetter' and its use
1939         because they were bogus; added FIXME describing what they were
1940         attempting to do.
1941         (KJS::Window::getValueProperty):
1942         (KJS::Window::getOverridePropertySlot):
1943         (KJS::Window::getOwnPropertySlot):
1944         * bindings/js/kjs_window.h:
1945         (KJS::Window::):
1946         * bindings/scripts/CodeGeneratorJS.pm:
1947         * css/CSSPrimitiveValue.idl:
1948         * css/CSSRule.idl:
1949         * css/CSSStyleDeclaration.idl: Added.
1950         * css/CSSValue.idl:
1951         * dom/Document.idl:
1952         * dom/Element.idl:
1953         * dom/Event.idl:
1954         * dom/MutationEvent.idl:
1955         * dom/Node.idl:
1956         * dom/NodeFilter.idl:
1957         * dom/Range.idl:
1958         * page/DOMWindow.idl:
1959
1960 2006-04-27  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1961
1962         Reviewed by darin
1963         
1964         <http://bugzilla.opendarwin.org/show_bug.cgi?id=8607>
1965         Automate repaint tests
1966
1967         * manual-tests/backgroundSizeRepaint.html: Removed.
1968         * manual-tests/border-repaint-glitch.html: Removed.
1969         * manual-tests/bugzilla-3509.html: Removed.
1970         * manual-tests/bugzilla-5699.html: Removed.
1971         * manual-tests/bugzilla-6278.html: Removed.
1972         * manual-tests/bugzilla-6388.html: Removed.
1973         * manual-tests/bugzilla-6473.html: Removed.
1974         * manual-tests/bugzilla-7235.html: Removed.
1975         * manual-tests/inline-outline-repaint.html: Removed.
1976         * manual-tests/outline-repaint-glitch.html: Removed.
1977         * manual-tests/repaint-resized-overflow.html: Removed.
1978         * manual-tests/table-cell-move.html: Removed.
1979
1980 2006-04-27  Justin Garcia  <justin.garcia@apple.com>
1981
1982         Reviewed by darin
1983         
1984         <http://bugzilla.opendarwin.org/show_bug.cgi?id=8624>
1985         Placeholders aren't always removed during paste
1986         <rdar://problem/4059807>
1987         Seed: Mail: pasting quoted content sometimes adds a phantom newline
1988
1989         * editing/CompositeEditCommand.cpp: Added a FIXME.
1990         * editing/ReplaceSelectionCommand.cpp:
1991         (WebCore::ReplaceSelectionCommand::doApply):
1992         Removed two no-op setEndingSelection calls.
1993         Store away a br at the position where we'll start inserting content in case the 
1994         br a) is made unnecessary by the insertion (it's collapsed away) b) was acting 
1995         as a placeholder and should therefore be displaced by inserted content or c) was
1996         acting as a line break and, as a result of the insertion, is now acting as a 
1997         placeholder.  
1998         Don't only store away brs that have the webkit-block-placeholder class on them.
1999         Any br that does any of the three things just mentioned should be removed.
2000         The linePlaceholder removal was run after the code that makes sure to interpret 
2001         incoming brs strictly, and was negating that work in certain cases.
2002         
2003         (WebCore::ReplaceSelectionCommand::removeEndBRIfNeeded): Described above.
2004         * editing/ReplaceSelectionCommand.h:
2005         * editing/VisiblePosition.cpp:
2006         (WebCore::isEqualIgnoringAffinity): 
2007         Added a workaround for 8622.  We want this function to return true even if one of 
2008         the two visible positions has been incorrectly canonicalized.
2009
2010 2006-04-26  Tim Omernick  <timo@apple.com>
2011
2012         Reviewed by Hyatt.
2013
2014         <rdar://problem/4068375> Flash inserted via innerHTML Fails to Show when CSS Display
2015         Style is Toggled via Javascript
2016
2017         * html/html_objectimpl.cpp:
2018         (WebCore::HTMLObjectElement::setComplete):
2019         Set needWidgetUpdate when finished parsing, even if the object element is not in
2020         a document.  That way, when the element attaches to a document, it will update its
2021         widget (creating the plug-in view if necessary).  This is important when the object
2022         is being inserted via setInnerHTML, since the parsed nodes are not added to the
2023         document until the whole HTML string is parsed.
2024
2025 2006-04-26  Geoffrey Garen  <ggaren@apple.com>
2026
2027         Reviewed by Hyatt.
2028
2029         - Fixed http://bugzilla.opendarwin.org/post_bug.cgi
2030         REGRESSION (r14048): Google calendar not parsing
2031         
2032         * html/HTMLParser.cpp:
2033         (WebCore::HTMLParser::handleError): Rolling out grandparent NULL check
2034         because it caused this regression and there's no test case
2035         justifying it.
2036         
2037 2006-04-26  Justin Garcia  <justin.garcia@apple.com>
2038
2039         Reviewed by hyatt
2040         
2041         <http://bugzilla.opendarwin.org/show_bug.cgi?id=8459>
2042         REGRESSION: Content lost during a delete/merge of whitespace:pre text
2043
2044         * editing/CompositeEditCommand.cpp:
2045         (WebCore::CompositeEditCommand::prune): 
2046         The function would prune a rendered leaf because it assumed that the 
2047         first node passed to it would be a container.
2048         The old code ascended using the DOM tree, and would remove the <b> when
2049         pruning the <div> in <b><div></div>foo</b>.  Now ascends using the render tree.
2050
2051 2006-04-26  Geoffrey Garen  <ggaren@apple.com>
2052
2053         This time for sure. Fixed Windows build too.
2054         
2055         * WebCore.vcproj/WebCore/WebCore.vcproj:
2056         * WebCore.xcodeproj/project.pbxproj:
2057
2058 2006-04-26  Geoffrey Garen  <ggaren@apple.com>
2059
2060         Reviewed by TimO.
2061
2062         Build fix.
2063
2064         * bindings/js/kjs_dom.cpp:
2065         * bindings/js/kjs_domnode.h:
2066
2067 2006-04-26  Geoffrey Garen  <ggaren@apple.com>
2068
2069         Reviewed by OMG DETHBAKIN.
2070
2071         - Start autogenerating Node. This fixes many missing attributes in our
2072         DOM by making prototypes hold their relevant constants as properties.
2073
2074         * DerivedSources.make:
2075         * WebCore.xcodeproj/project.pbxproj:
2076         * bindings/js/kjs_dom.cpp:
2077         (KJS::DOMEventTargetNode::DOMEventTargetNode):
2078         (KJS::toJS):
2079         * bindings/js/kjs_dom.h:
2080         (KJS::DOMEventTargetNode::):
2081         * bindings/js/kjs_domnode.h: Had to break DOMNode into a separate
2082         header to avoid circular dependency in header includes. Gave it an
2083         old-school file name to keep distinguishing beteween old school and
2084         news school files easy.
2085         (KJS::DOMNode::impl):
2086         (KJS::DOMNode::classInfo):
2087         (KJS::DOMNode::):
2088         * bindings/js/kjs_window.cpp:
2089         (KJS::Window::getValueProperty):
2090         * bindings/scripts/CodeGeneratorJS.pm:
2091         * dom/DocumentType.idl:
2092         * dom/Entity.idl:
2093         * dom/Node.idl: Added.
2094         * dom/Notation.idl:
2095         * dom/ProcessingInstruction.idl:
2096
2097 2006-04-26  Geoffrey Garen  <ggaren@apple.com>
2098
2099         Reviewed by Darin.
2100
2101         Committing the project file change jhaygood suggesed in
2102         http://bugzilla.opendarwin.org/show_bug.cgi?id=8044
2103         WebKit Visual Studio 2005 project shouldn't use the SolutionDir
2104         
2105         Instead of his patch, I used the following commands:
2106
2107         sed -e 's/$(SolutionDir)/$(ProjectDir)\\../g' Image\ Viewer/Image\
2108         Viewer.vcproj > Image\ Viewer/Image\ Viewer.vcproj_ && mv Image\
2109         Viewer/Image\ Viewer.vcproj_ Image\ Viewer/Image\ Viewer.vcproj
2110
2111         sed -e 's/$(SolutionDir)/$(ProjectDir)\\../g'
2112         WebCore/WebCore.vcproj > WebCore/WebCore.vcproj_ && mv
2113         WebCore/WebCore.vcproj_ WebCore/WebCore.vcproj
2114
2115         * Viewer.vcproj:
2116         * WebCore.vcproj/WebCore/WebCore.vcproj:
2117
2118 2006-04-25  Justin Garcia  <justin.garcia@apple.com>
2119
2120         Reviewed by harrison
2121
2122         <http://bugzilla.opendarwin.org/show_bug.cgi?id=8583>
2123         Moving paste code around and some small fixes
2124         
2125         Moved code to make it easier to do the start merge after the fact, 
2126         with moveParagraph, instead of in the middle of the paste operation.
2127
2128         * editing/CompositeEditCommand.cpp:
2129         (WebCore::CompositeEditCommand::moveParagraph):
2130         * editing/ReplaceSelectionCommand.cpp:
2131         (WebCore::ReplaceSelectionCommand::ReplaceSelectionCommand):
2132         (WebCore::ReplaceSelectionCommand::shouldMergeStart):
2133         Moved code to make this decision to its own function.  Moved special case
2134         checks to the top.  Added m_forceMergeStart to override the special cases 
2135         because moveParagraph uses ReplaceSelectionCommand and expects a merge.
2136         
2137         (WebCore::ReplaceSelectionCommand::shouldMergeEnd): 
2138         No functional changes, just moved code here.
2139         (WebCore::ReplaceSelectionCommand::doApply):
2140         Do the end merge in the opposite direction.  Merging two paragraphs destroys
2141         the moved one's block level styles, and we prefer to use the styles of the 
2142         one that was in the document, not the one that's being pasted.
2143         
2144         * editing/ReplaceSelectionCommand.h:
2145         * editing/Selection.h:
2146         (WebCore::Selection::visibleStart): Added.
2147         (WebCore::Selection::visibleEnd): Added.
2148         * editing/htmlediting.cpp:
2149         (WebCore::enclosingList): Added.
2150         (WebCore::isMailBlockquote): 
2151         Don't require a renderer so that this can be used on nodes in fragments.
2152         
2153         * editing/htmlediting.h:
2154
2155 2006-04-25  Geoffrey Garen  <ggaren@apple.com>
2156
2157         Reviewed by Maciej.
2158
2159         - Removed special handling of attributes in the DOM. To match
2160         WinIE, we used to make all attributes available as properties of
2161         their elements in the DOM, but that has caused us more
2162         compatibility woes than it has solved, so, after talking with Darin
2163         and Maciej, I'm taking it out. (Firefox does not support it.)
2164
2165         A layout test regression caused by this change led me to do the
2166         following as well:
2167         
2168         - Implemented DOM properties missing on EMBED elements: align, height,
2169         name, width, src, type. Since align, height, name, and width are
2170         common to all plugin elements, I factored them and some other common
2171         functionality out into a new abstract base class, HTMLPlugInElement.
2172
2173         - Removed extraneous attribute-to-style mappings on EMBED elements:
2174         valign, border. Why they were there in the first place is a question
2175         for the ages. Neither FF nor IE supports them.
2176
2177         * bindings/js/kjs_dom.cpp:
2178         (KJS::getRuntimeObject):
2179         * bindings/js/kjs_html.cpp:
2180         (KJS::):
2181         (KJS::JSHTMLElement::classInfo):
2182         (KJS::JSHTMLElement::accessors):
2183         (KJS::JSHTMLElement::embedGetter):
2184         (KJS::JSHTMLElement::embedSetter):
2185         * bindings/js/kjs_html.h:
2186         (KJS::JSHTMLElement::):
2187         * bindings/scripts/CodeGeneratorJS.pm:
2188         * dom/Element.idl:
2189         * html/html_objectimpl.cpp:
2190         (WebCore::HTMLPlugInElement::HTMLPlugInElement):
2191         (WebCore::HTMLPlugInElement::align):
2192         (WebCore::HTMLPlugInElement::setAlign):
2193         (WebCore::HTMLPlugInElement::height):
2194         (WebCore::HTMLPlugInElement::setHeight):
2195         (WebCore::HTMLPlugInElement::name):
2196         (WebCore::HTMLPlugInElement::setName):
2197         (WebCore::HTMLPlugInElement::width):
2198         (WebCore::HTMLPlugInElement::setWidth):
2199         (WebCore::HTMLPlugInElement::mapToEntry):
2200         (WebCore::HTMLPlugInElement::parseMappedAttribute):
2201         (WebCore::HTMLPlugInElement::checkDTD):
2202         (WebCore::HTMLAppletElement::HTMLAppletElement):
2203         (WebCore::HTMLAppletElement::~HTMLAppletElement):
2204         (WebCore::HTMLAppletElement::parseMappedAttribute):
2205         (WebCore::HTMLAppletElement::insertedIntoDocument):
2206         (WebCore::HTMLAppletElement::removedFromDocument):
2207         (WebCore::HTMLAppletElement::getInstance):
2208         (WebCore::HTMLAppletElement::closeRenderer):
2209         (WebCore::HTMLAppletElement::detach):
2210         (WebCore::HTMLEmbedElement::HTMLEmbedElement):
2211         (WebCore::HTMLEmbedElement::~HTMLEmbedElement):
2212         (WebCore::HTMLEmbedElement::getInstance):
2213         (WebCore::HTMLEmbedElement::mapToEntry):
2214         (WebCore::HTMLEmbedElement::parseMappedAttribute):
2215         (WebCore::HTMLEmbedElement::attach):
2216         (WebCore::HTMLEmbedElement::detach):
2217         (WebCore::HTMLEmbedElement::insertedIntoDocument):
2218         (WebCore::HTMLEmbedElement::removedFromDocument):
2219         (WebCore::HTMLEmbedElement::src):
2220         (WebCore::HTMLEmbedElement::setSrc):
2221         (WebCore::HTMLEmbedElement::type):
2222         (WebCore::HTMLEmbedElement::setType):
2223         (WebCore::HTMLObjectElement::HTMLObjectElement):
2224         (WebCore::HTMLObjectElement::~HTMLObjectElement):
2225         (WebCore::HTMLObjectElement::getInstance):
2226         (WebCore::HTMLObjectElement::parseMappedAttribute):
2227         (WebCore::HTMLObjectElement::rendererIsNeeded):
2228         (WebCore::HTMLObjectElement::attach):
2229         (WebCore::HTMLObjectElement::closeRenderer):
2230         (WebCore::HTMLObjectElement::detach):
2231         (WebCore::HTMLObjectElement::insertedIntoDocument):
2232         (WebCore::HTMLObjectElement::removedFromDocument):
2233         (WebCore::HTMLObjectElement::recalcStyle):
2234         * html/html_objectimpl.h:
2235         (WebCore::HTMLPlugInElement::endTagRequirement):
2236         (WebCore::HTMLAppletElement::tagPriority):
2237         (WebCore::HTMLEmbedElement::tagPriority):
2238         (WebCore::HTMLObjectElement::tagPriority):
2239
2240 2006-04-25  Beth Dakin  <bdakin@apple.com>
2241
2242         Reviewed by Maciej.
2243
2244         Fix for <rdar://problem/4518632> getComputedStyle returns 'auto' 
2245         for dimensions like 'margin-left'
2246
2247         * css/CSSComputedStyleDeclaration.cpp:
2248         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): For 
2249         margin and padding, to match Firefox we now go to the renderer to 
2250         get the property value instead of calling valueForLength() on the 
2251         style attribute. valueForLength() will return the string 'auto' if 
2252         that was what was specified in the CSS, or a percentage if it was 
2253         specified as a percent. But to match Firefox, we always want to 
2254         return a pixel value for margin and padding.
2255
2256 2006-04-26  Mitz Pettel  <opendarwin.org@mitzpettel.com>
2257
2258         Reviewed by darin.  Landed by eseidel.
2259
2260         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8452
2261           mangleme(0x58c22e11): Random crashes
2262
2263         Test: fast/frames/empty-cols-attribute.html
2264
2265         * platform/StringImpl.cpp:
2266         (WebCore::StringImpl::toLengthArray): If the string is empty, return 0
2267         but set len to 1. This gives the same behavior you get if you don't specify
2268         the attribute at all, matching WinIE and Firefox. Previously, the empty
2269         string resulted in len being set to 0 (and a memory smasher in
2270         RenderFrameSet::layout()).
2271         * rendering/render_frames.cpp:
2272         (WebCore::RenderFrameSet::layout): Added an assert.
2273
2274 2006-04-26  Oliver Hunt  <ojh16@student.canterbury.ac.nz>
2275
2276         Reviewed by eseidel.  Landed by eseidel.
2277
2278         * WebCore.xcodeproj/project.pbxproj:
2279         * kcanvas/KCanvasFilters.cpp:
2280         (WebCore::operator<<):
2281         * kcanvas/KCanvasFilters.h:
2282         (WebCore::KCComponentTransferFunction::KCComponentTransferFunction):
2283         * kcanvas/device/quartz/KCanvasFilterQuartz.h:
2284         * kcanvas/device/quartz/KCanvasFilterQuartz.mm:
2285         (WebCore::getVectorForChannel):
2286         (WebCore::genImageFromTable):
2287         (WebCore::filterForComponentFunc):
2288         (WebCore::setParametersForComponentFunc):
2289         (WebCore::getFilterForFunc):
2290         (WebCore::KCanvasFEComponentTransferQuartz::getFunctionFilter):
2291         (WebCore::KCanvasFEComponentTransferQuartz::getCIFilter):
2292         * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
2293         (WebCore::KRenderingDeviceQuartz::createFilterEffect):
2294         * kcanvas/device/quartz/filters/WKComponentMergeFilter.cikernel: Added.
2295         * kcanvas/device/quartz/filters/WKComponentMergeFilter.h: Added.
2296         * kcanvas/device/quartz/filters/WKComponentMergeFilter.m: Added.
2297         (+[WKComponentMergeFilter initialize]):
2298         (+[WKComponentMergeFilter filterWithName:]):
2299         (-[WKComponentMergeFilter init]):
2300         (-[WKComponentMergeFilter outputImage]):
2301         * kcanvas/device/quartz/filters/WKDiscreteTransferFilter.cikernel: Added.
2302         * kcanvas/device/quartz/filters/WKDiscreteTransferFilter.h: Added.
2303         * kcanvas/device/quartz/filters/WKDiscreteTransferFilter.m: Added.
2304         (+[WKDiscreteTransferFilter initialize]):
2305         (+[WKDiscreteTransferFilter filterWithName:]):
2306         (-[WKDiscreteTransferFilter init]):
2307         (-[WKDiscreteTransferFilter outputImage]):
2308         * kcanvas/device/quartz/filters/WKGammaTransferFilter.cikernel: Added.
2309         * kcanvas/device/quartz/filters/WKGammaTransferFilter.h: Added.
2310         * kcanvas/device/quartz/filters/WKGammaTransferFilter.m: Added.
2311         (+[WKGammaTransferFilter initialize]):
2312         (+[WKGammaTransferFilter filterWithName:]):
2313         (-[WKGammaTransferFilter init]):
2314         (-[WKGammaTransferFilter outputImage]):
2315         * kcanvas/device/quartz/filters/WKIdentityTransferFilter.h: Added.
2316         * kcanvas/device/quartz/filters/WKIdentityTransferFilter.m: Added.
2317         (+[WKIdentityTransferFilter initialize]):
2318         (+[WKIdentityTransferFilter filterWithName:]):
2319         (-[WKIdentityTransferFilter init]):
2320         (-[WKIdentityTransferFilter outputImage]):
2321         * kcanvas/device/quartz/filters/WKLinearTransferFilter.cikernel: Added.
2322         * kcanvas/device/quartz/filters/WKLinearTransferFilter.h: Added.
2323         * kcanvas/device/quartz/filters/WKLinearTransferFilter.m: Added.
2324         (+[WKLinearTransferFilter initialize]):
2325         (+[WKLinearTransferFilter filterWithName:]):
2326         (-[WKLinearTransferFilter init]):
2327         (-[WKLinearTransferFilter outputImage]):
2328         * kcanvas/device/quartz/filters/WKTableTransferFilter.cikernel: Added.
2329         * kcanvas/device/quartz/filters/WKTableTransferFilter.h: Added.
2330         * kcanvas/device/quartz/filters/WKTableTransferFilter.m: Added.
2331         (+[WKTableTransferFilter initialize]):
2332         (+[WKTableTransferFilter filterWithName:]):
2333         (-[WKTableTransferFilter init]):
2334         (-[WKTableTransferFilter outputImage]):
2335         * ksvg2/svg/SVGComponentTransferFunctionElement.cpp:
2336         (SVGComponentTransferFunctionElement::parseMappedAttribute):
2337         (SVGComponentTransferFunctionElement::transferFunction):
2338
2339 2006-04-25  Eric Seidel  <eseidel@apple.com>
2340
2341         Reviewed by ggaren.
2342
2343         Make trunk match the branch.  Now nodes are fully removed
2344         from the tree before calling detach.  There is (thankfully) no
2345         good way to test this, as no one should depend on this behavior.
2346         This change was made are part of fixing:
2347         <rdar://problem/4427024> repro crash on www.formassembly.com in khtml::RenderBlock::addChildToFlow
2348         <rdar://problem/4233435> CrashTracer: 2698 crashes in Safari at com.apple.WebCore: khtml::RenderBlock::addChildToFlow + 156
2349         on the branch.
2350
2351         * dom/ContainerNode.cpp:
2352         (WebCore::ContainerNode::removeChildren):
2353
2354 2006-04-25  Maciej Stachowiak  <mjs@apple.com>
2355
2356         Reviewed by Adele.
2357
2358         - don't have a fini method, since trying to call it will actually call the subclass method
2359         and mess up the bridge count.
2360
2361         * bridge/mac/WebCoreFrameBridge.mm:
2362         (-[WebCoreFrameBridge dealloc]):
2363         (-[WebCoreFrameBridge finalize]):
2364
2365 2006-04-25  Steve Falkenburg  <sfalkenburg@apple.com>
2366
2367         Reviewed by eseidel.
2368
2369         No test case needed
2370
2371         * platform/win/TemporaryLinkStubs.cpp:
2372         (KWQFileButton::setFrameGeometry):
2373
2374 2006-04-25  Eric Seidel  <eseidel@apple.com>
2375
2376         Reviewed by mjs.
2377
2378         Fix reproducible crash in html parser code.
2379         http://bugzilla.opendarwin.org/show_bug.cgi?id=7137
2380
2381         Test: fast/parser/remove-current-node-parent.html
2382
2383         * html/HTMLParser.cpp:
2384         (WebCore::HTMLParser::handleError):
2385
2386 2006-04-25  Maciej Stachowiak  <mjs@apple.com>
2387
2388         Reviewed by Eric.
2389
2390         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=8575
2391         New KWQFileButton leaks reported by buildbot
2392
2393         * kwq/KWQFileButton.mm:
2394         (KWQFileButton::KWQFileButton): Add a missing release
2395
2396 2006-04-24  David Hyatt  <hyatt@apple.com>
2397
2398         Fix for 8336, focus ring redrawing on top of itself.  Make sure
2399         not to include empty rects when doing the focus ring drawing, since
2400         that results in a draw with no clip set.
2401
2402         Reviewed by adele
2403
2404         * platform/mac/GraphicsContextMac.mm:
2405         (WebCore::GraphicsContext::drawFocusRing):
2406
2407 2006-04-24  Eric Seidel  <eseidel@apple.com>
2408
2409         Reviewed by ggaren.
2410
2411         Fix for 5th worst unresolved crasher:
2412         <rdar://problem/4129744> [REGRESSION]CrashTracer: ..400 crashes at com.apple.WebCore: DOM::NodeImpl::createRendererIfNeeded + 44
2413
2414         Test: fast/dom/remove-style-element.html
2415
2416         * dom/ContainerNode.cpp:
2417         (WebCore::ContainerNode::removeChildren):
2418
2419 2006-04-24  Eric Seidel  <eseidel@apple.com>
2420
2421         Reviewed by mjs.
2422
2423         Speculative fix for our 7th worst crasher.
2424         Also added ASSERTs to help us better understand the issue.
2425         <rdar://problem/4153404> CrashTracer: 2412 crashes in Safari at com.apple.WebCore: khtml::RenderStyle::RenderStyle[unified] + 44
2426
2427         * dom/Document.cpp:
2428         (WebCore::Document::recalcStyle):
2429         (WebCore::Document::setInPageCache):
2430         * dom/Document.h:
2431         * dom/Element.cpp:
2432         (WebCore::Element::recalcStyle):
2433
2434 2006-04-24  Adele Peterson  <adele@apple.com>
2435
2436         Reviewed by Hyatt.
2437
2438         Fix for <rdar://problem/4503438> REGRESSION (NativeTextField): Can't insert caret when 
2439         selection is active in field (Business/Unit)
2440
2441         * css/html4.css: Added -webkit-user-select:text for input elements.
2442
2443 2006-04-24  Maciej Stachowiak  <mjs@apple.com>
2444
2445         Build fix:
2446         
2447         - move some prematurely moved code back
2448
2449         * bridge/mac/WebCoreFrameBridge.h:
2450         * bridge/mac/WebCoreFrameBridge.mm:
2451         (-[WebCoreFrameBridge fini]):
2452
2453 2006-04-24  Maciej Stachowiak  <mjs@apple.com>
2454
2455         Reviewed by Darin.
2456
2457         - move more code from WebFrameBridge to WebCoreFrameBridge
2458
2459         * bridge/mac/WebCoreFrameBridge.h:
2460         * bridge/mac/WebCoreFrameBridge.mm:
2461         (-[WebCoreFrameBridge domain]):
2462         (-[WebCoreFrameBridge canTargetLoadInFrame:]):
2463         (-[WebCoreFrameBridge fini]):
2464         (-[WebCoreFrameBridge dealloc]):
2465         (-[WebCoreFrameBridge finalize]):
2466         (_getPreSmartSet):
2467         (_getPostSmartSet):
2468         (-[WebCoreFrameBridge isCharacterSmartReplaceExempt:isPreviousCharacter:]):
2469         (-[WebCoreFrameBridge _retrieveKeyboardUIModeFromPreferences:]):
2470         (-[WebCoreFrameBridge keyboardUIMode]):
2471
2472 2006-04-24  Adele Peterson  <adele@apple.com>
2473
2474         Reviewed by Tim O.
2475
2476         Fix to send textFieldDidBeginEditing on the first editing change instead of on focus.
2477         This matches our old behavior.
2478
2479         * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::dispatchFocusEvent):
2480         * rendering/RenderTextField.cpp: (WebCore::RenderTextField::subtreeHasChanged):
2481
2482 2006-04-24  Beth Dakin  <bdakin@apple.com>
2483
2484         Reviewed by Eric.
2485
2486         Fix for <rdar://problem/4513383> REGRESSION: Crash in 
2487         WebCore::shouldEmitTabBeforeNode() when iterating through document 
2488         text
2489
2490         * editing/TextIterator.cpp:
2491         (WebCore::shouldEmitTabBeforeNode): Need to nil-check the renderer.
2492
2493 2006-04-23  Geoffrey Garen  <ggaren@apple.com>
2494
2495         Reviewed by Maciej.
2496
2497         * bindings/scripts/CodeGeneratorJS.pm: Removed confusing 'JS' prefix
2498         from string descriptions of DOM prototypes, so the prototype for, e.g.,
2499         Document serializes as 'Document,' not 'JSDocument.'
2500
2501 2006-04-23  Geoffrey Garen  <ggaren@apple.com>
2502
2503         Reviewed by Darin.
2504
2505         - Took the larger snippets of C++ in the code generator and broke
2506         them into HERE documents in the hopes of improving readability.
2507         
2508         * bindings/scripts/CodeGeneratorJS.pm: I indented variable names
2509         level with their corresponding HERE documents to clearly
2510         "sandwich" the HERE documents between opening and closing EOF
2511         statements.
2512
2513 2006-04-23  Maciej Stachowiak  <mjs@apple.com>
2514
2515         Reviewed by Darin.
2516         
2517         - push WebFileButton and WebStringTruncator code down to WebCore
2518         http://bugzilla.opendarwin.org/show_bug.cgi?id=8552
2519
2520         * WebCore.exp:
2521         * WebCore.xcodeproj/project.pbxproj:
2522         * bridge/mac/WebCoreFrameBridge.h:
2523         * bridge/mac/WebCoreStringTruncator.h: Added.
2524         * bridge/mac/WebCoreStringTruncator.mm: Added.
2525         (stringWidth):
2526         (truncateString):
2527         (+[WebCoreStringTruncator widthOfString:font:]):
2528         * bridge/mac/WebCoreViewFactory.h:
2529         * kwq/KWQFileButton.h:
2530         * kwq/KWQFileButton.mm:
2531         (-[WebFileChooserButton initWithWidget::]):
2532         (-[WebCoreFileButton positionButton]):
2533         (-[WebCoreFileButton initWithWidget:]):
2534         (-[WebCoreFileButton initWithFrame:]):
2535         (-[WebCoreFileButton dealloc]):
2536         (-[WebCoreFileButton isFlipped]):
2537         (-[WebCoreFileButton drawRect:]):
2538         (-[WebCoreFileButton updateLabel]):
2539         (-[WebCoreFileButton setFilename:]):
2540         (-[WebCoreFileButton filename]):
2541         (-[WebCoreFileButton setFrameSize:]):
2542         (-[WebCoreFileButton bestVisualFrameSizeForCharacterCount:]):
2543         (-[WebCoreFileButton visualFrame]):
2544         (-[WebCoreFileButton setVisualFrame:]):
2545         (-[WebCoreFileButton baseline]):
2546         (-[WebCoreFileButton beginSheet]):
2547         (-[WebCoreFileButton chooseFilename:]):
2548         (-[WebCoreFileButton cancel]):
2549         (-[WebCoreFileButton chooseButtonPressed:]):
2550         (-[WebCoreFileButton mouseDown:]):
2551         (-[WebCoreFileButton acceptsFirstResponder]):
2552         (-[WebCoreFileButton becomeFirstResponder]):
2553         (-[WebCoreFileButton nextKeyView]):
2554         (-[WebCoreFileButton previousKeyView]):
2555         (-[WebCoreFileButton nextValidKeyView]):
2556         (-[WebCoreFileButton previousValidKeyView]):
2557         (-[WebCoreFileButton performClick]):
2558         (-[WebFileChooserButton initWithWidget:]):
2559         (-[WebFileChooserButton nextValidKeyView]):
2560         (-[WebFileChooserButton previousValidKeyView]):
2561         (-[WebFileChooserButton resignFirstResponder]):
2562         (KWQFileButton::KWQFileButton):
2563         (KWQFileButton::setFilename):
2564         (KWQFileButton::click):
2565         (KWQFileButton::sizeForCharacterWidth):
2566         (KWQFileButton::frameGeometry):
2567         (KWQFileButton::setFrameGeometry):
2568         (KWQFileButton::baselinePosition):
2569         (KWQFileButton::filenameChanged):
2570
2571 2006-04-23  Maciej Stachowiak  <mjs@apple.com>
2572
2573         Reviewed by Eric.
2574
2575         - remove WebCoreCookieAdapter, instead make mac implementation of
2576         CookieJar use Foundation directly.
2577
2578         * WebCore.exp:
2579         * WebCore.xcodeproj/project.pbxproj:
2580         * platform/mac/CookieJar.mm:
2581         (WebCore::cookies):
2582         (WebCore::setCookies):
2583         (WebCore::cookiesEnabled):
2584         * platform/mac/WebCoreCookieAdapter.h: Removed.
2585         * platform/mac/WebCoreCookieAdapter.m: Removed.
2586
2587 2006-04-21  Rob Buis  <buis@kde.org>
2588
2589         Reviewed by hyatt.  Landed by eseidel.
2590
2591         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8170:
2592         SVG CSS property values with extra items do not get treated
2593         as invalid (they should)
2594
2595         Fixes the handling of invalid svg css properties similar
2596         to how invalid html css properties are handled, ie. discard
2597         the property if there are more values in the value list than
2598         expected.
2599
2600         Test: svg/custom/invalid-css.svg
2601
2602         * ksvg2/css/SVGCSSParser.cpp:
2603         (WebCore::CSSParser::parseSVGValue):
2604
2605 2006-04-23  Michael Emmel  <mike.emmel@gmail.com>
2606
2607         Reviewed by mjs.  Landed by eseidel.
2608
2609         http://bugzilla.opendarwin.org/show_bug.cgi?id=8517
2610         No test necessary, no functional change.
2611
2612         * DerivedSources.make: use VPATH more consistently.
2613
2614 2006-04-23  Jon Shier  <jshier@iastate.edu>
2615         
2616         Reviewed by ggaren.  Landed by eseidel.
2617         
2618         - Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8511
2619         onerror JS property does not register listener properly
2620
2621         Test: fast/dom/onerror-img.html       
2622  
2623         * bindings/js/kjs_dom.cpp:  
2624         (KJS::DOMEventTargetNode::getValueProperty): changed khtmlErrorEvent to errorEvent.
2625         (KJS::DOMEventTargetNode::putValueProperty): ditto.
2626         * bindings/js/kjs_window.cpp:
2627         (KJS::Window::getValueProperty): ditto.
2628         (KJS::Window::put):
2629         * dom/EventNames.h: Removed khtmlError macro.
2630         
2631 2006-04-23  Eric Seidel  <eseidel@apple.com>
2632
2633         Reviewed by hyatt.
2634
2635         Reproducible crasher with <li value=1234567890 type=A>
2636         http://bugzilla.opendarwin.org/show_bug.cgi?id=8542
2637
2638         Fixed our alphabetical list generation to match WinIE (not FireFox)
2639         Previously our alphabetical lists were completely wrong past 26 items.
2640
2641         Tests:
2642         * fast/lists/alpha-list-wrap.html
2643         * fast/lists/li-style-alpha-huge-value-crash.html
2644
2645         * rendering/render_list.cpp:
2646         (WebCore::toLetterString):
2647         (WebCore::toHebrew):
2648         (WebCore::RenderListMarker::calcMinMaxWidth):
2649
2650 2006-04-22  Geoffrey Garen  <ggaren@apple.com>
2651
2652         Reviewed by Darin.
2653
2654         - Finished autogeneration of Element
2655
2656         * bindings/js/kjs_dom.cpp: Removed DOMElement class
2657         * bindings/js/kjs_dom.h: ditto
2658         * bindings/scripts/CodeGeneratorJS.pm: added support for special
2659         attribute lookup that elements do
2660         * dom/Element.idl: added new attribute, 
2661         "IncludeAttributesInPropertyLookup," which tells the code generator 
2662         to include HTML element attributes in property lookup
2663
2664 2006-04-22  Michael Emmel  <mike.emmel@gmail.com>
2665
2666         Reviewed by Maciej.
2667
2668         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8529
2669           Extra Qaulification in header
2670         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8530
2671           Missing assert.h include
2672
2673         * rendering/RenderObject.h: Removed erroneous RenderObject::
2674         prefix from a member function name.
2675         * rendering/RenderText.h: Removed erroneous RenderText::
2676         prefix from a member function name.
2677
2678         * platform/Arena.cpp: Added <assert.h> to list of includes.
2679         * platform/KURL.cpp: Ditto.
2680         * platform/StringImpl.cpp: Ditto.
2681         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp: Ditto.
2682         * platform/image-decoders/png/PNGImageDecoder.cpp: Ditto.
2683
2684 2006-04-22  Darin Adler  <darin@apple.com>
2685
2686         * doc: Added.
2687
2688 2006-04-22  Maciej Stachowiak  <mjs@apple.com>
2689
2690         Reviewed by Eric.
2691
2692         - push down a bunch of WebCoreFrameBridge code to C++ (plus some reformatting)
2693
2694         * bridge/mac/WebCoreFrameBridge.mm:
2695         (-[WebCoreFrameBridge isDescendantOfFrame:]):
2696         (-[WebCoreFrameBridge traverseNextFrameStayWithin:]):
2697         (-[WebCoreFrameBridge nextFrameWithWrap:]):
2698         (-[WebCoreFrameBridge previousFrameWithWrap:]):
2699         (+[WebCoreFrameBridge bridgeForDOMDocument:]):
2700         (-[WebCoreFrameBridge parent]):
2701         (-[WebCoreFrameBridge addData:]):
2702         (-[WebCoreFrameBridge didNotOpenURL:pageCache:]):
2703         (-[WebCoreFrameBridge restoreDocumentState]):
2704         (-[WebCoreFrameBridge _stringWithDocumentTypeStringAndMarkupString:]):
2705         (-[WebCoreFrameBridge nodesFromList:]):
2706         (-[WebCoreFrameBridge markupStringFromNode:nodes:]):
2707         (-[WebCoreFrameBridge markupStringFromRange:nodes:]):
2708         (-[WebCoreFrameBridge rangeByExpandingSelectionWithGranularity:]):
2709         (-[WebCoreFrameBridge rangeByAlteringCurrentSelection:direction:granularity:]):
2710         (-[WebCoreFrameBridge alterCurrentSelection:direction:granularity:]):
2711         (-[WebCoreFrameBridge rangeByAlteringCurrentSelection:verticalDistance:]):
2712         (-[WebCoreFrameBridge alterCurrentSelection:verticalDistance:]):
2713         (-[WebCoreFrameBridge replaceMarkedTextWithText:]):
2714         (-[WebCoreFrameBridge replaceSelectionWithFragment:selectReplacement:smartReplace:matchStyle:]):
2715         (-[WebCoreFrameBridge increaseSelectionListLevel]):
2716         (-[WebCoreFrameBridge decreaseSelectionListLevel]):
2717         (-[WebCoreFrameBridge insertLineBreak]):
2718         (-[WebCoreFrameBridge insertParagraphSeparator]):
2719         (-[WebCoreFrameBridge insertParagraphSeparatorInQuotedContent]):
2720         (-[WebCoreFrameBridge insertText:selectInsertedText:]):
2721         (-[WebCoreFrameBridge deleteSelectionWithSmartDelete:]):
2722         (-[WebCoreFrameBridge ensureSelectionVisible]):
2723         (-[WebCoreFrameBridge RenderObject::nodeInfoAtPoint:allowShadowContent:]):
2724         * page/Frame.cpp:
2725         (WebCore::Frame::nodeInfoAtPoint):
2726         (WebCore::Frame::hasSelection):
2727         (WebCore::Frame::documentTypeString):
2728         * page/Frame.h:
2729         * page/FrameTree.cpp:
2730         (WebCore::FrameTree::traverseNextWithWrap):
2731         (WebCore::FrameTree::traversePreviousWithWrap):
2732         (WebCore::FrameTree::deepLastChild):
2733         * page/FrameTree.h:
2734
2735 2006-04-22  Beth Dakin  <bdakin@apple.com>
2736
2737         Reviewed by Hyatt.
2738
2739         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=6141 
2740         DOMCSSPrimitiveValue is always returning values in pixels when 
2741         using getComputedStyle:
2742
2743         getFloatValue() took a unit type as a parameter, ignored it, and 
2744         returned m_value.num. This patch writes a second version of the 
2745         function that actually converts m_value.num to the specified unites 
2746         before returning it. Where a conversion is not required, I removed 
2747         the unit type from the caller so that it would go directly to the 
2748         inline version of the function.
2749
2750         * css/css_valueimpl.cpp:
2751         (WebCore::CSSPrimitiveValue::computeLengthFloat): Remove type 
2752         parameter since a conversion is not needed.
2753         (WebCore::scaleFactorForConversion): Helper function for 
2754         conversion.
2755         (WebCore::CSSPrimitiveValue::getFloatValue): This version of 
2756         getFloatValue() takes a unit type parameter and converts 
2757         m_value.num.
2758         * css/css_valueimpl.h:
2759         (WebCore::CSSPrimitiveValue::getFloatValue): This version does not 
2760         take a parameter and just returns m_value.num.
2761         * css/cssparser.cpp:
2762         (WebCore::BorderImageParseContext::commitBorderImage): Remove type 
2763         parameter since a conversion is not needed.
2764         * css/cssstyleselector.cpp:
2765         (WebCore::convertToLength): Same.
2766         (WebCore::CSSStyleSelector::applyProperty): Same.
2767         (WebCore::CSSStyleSelector::mapBackgroundSize): Same.
2768         (WebCore::CSSStyleSelector::mapBackgroundXPosition): Same.
2769         (WebCore::CSSStyleSelector::mapBackgroundYPosition): Same.
2770         * editing/ApplyStyleCommand.cpp:
2771         (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange): Same.
2772         * ksvg2/css/SVGCSSStyleSelector.cpp:
2773         (WebCore::CSSStyleSelector::applySVGProperty): Same.
2774         * ksvg2/misc/KCanvasRenderingStyle.cpp:
2775         (WebCore::KSVGPainterFactory::cssPrimitiveToLength): Same.
2776
2777 2006-04-21  Geoffrey Garen  <ggaren@apple.com>
2778
2779         Reviewed by John.
2780
2781         - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=8509
2782         javascript:document.importNode(null)
2783         
2784         * dom/Document.cpp:
2785         (WebCore::Document::importNode): Throw an error if the node is null.
2786         This happens when the object provided in the JavaScript call is not
2787         a node.
2788         (WebCore::Document::adoptNode): Set the DOM exception code in all error
2789         cases instead of just a few, because that's what the spec requires.
2790
2791 2006-04-21  Geoffrey Garen  <ggaren@apple.com>
2792
2793         Reviewed by John.
2794
2795         - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=8510
2796         submit event doesn't bubble - it's supposed to.
2797
2798         * html/HTMLElement.cpp:
2799         (WebCore::HTMLElement::parseMappedAttribute): Added recognition for the
2800         onsubmit attribute, so elements can use it
2801         * html/HTMLFormElement.cpp:
2802         (WebCore::HTMLFormElement::prepareSubmit): Changed bubbling attribute
2803         to 'true'
2804
2805 2006-04-21  Geoffrey Garen  <ggaren@apple.com>
2806
2807         Reviewed by TimO.
2808
2809         - Fixed: error event does not bubble
2810
2811         I discovered this bug while working on the "submit event does not
2812         bubble" bug. The DOM spec says the event should bubble, and that's how
2813         it works in Firefox.
2814
2815         The DOM Spec also says that the error event is "valid for
2816         OBJECT elements, BODY elements, and FRAMESET element." But it doesn't
2817         say "valid ONLY." Firefox supports it on all elements and web
2818         developers tend to think it will work for things like <img> and
2819         <script>, so I went whole hog here.
2820
2821         * html/HTMLElement.cpp:
2822         (WebCore::HTMLElement::parseMappedAttribute): Make onerror a mapped
2823         attribute for all elements, so containing elements can register for
2824         the event.
2825         * html/HTMLTokenizer.cpp:
2826         (WebCore::HTMLTokenizer::notifyFinished): make onerror bubble
2827         * html/html_headimpl.cpp:
2828         (WebCore::HTMLScriptElement::parseMappedAttribute): Remove special
2829         case for onerror because HTMLElement will take care of it
2830         (WebCore::HTMLScriptElement::notifyFinished): make onerror bubble
2831         * html/html_imageimpl.cpp:
2832         (WebCore::HTMLImageElement::parseMappedAttribute): Remove special
2833         case for onerror because HTMLElement will take care of it
2834
2835 2006-04-21  Adele Peterson  <adele@apple.com>
2836
2837         Test for: http://bugzilla.opendarwin.org/show_bug.cgi?id=8181
2838         REGRESSION: After tabbing in page's field, attempting to tab from Google toolbar search to page fails on first try
2839
2840         * manual-tests/tabbing-input-google.html: Added.
2841
2842 2006-04-21  Kevin M. Ollivier  <kevino@theolliviers.com>
2843
2844         Reviewed by Darin.
2845
2846         - http://bugzilla.opendarwin.org/show_bug.cgi?id=8507
2847           Compilation fixes for building on gcc 4.0.2, and without precomp headers
2848
2849         * platform/Cursor.h: Created a fallback case that typedefs PlatformCursor
2850         to void * if it isn't defined to anything else. (Useful to help get new ports
2851         initially compiling.)
2852         
2853         * bindings/js/kjs_window.cpp:
2854         * rendering/RenderTextField.cpp:
2855         * rendering/RenderBox.cpp:
2856         Add missing headers to resolve issues when compiling without precompiled
2857         headers.
2858         
2859         * rendering/RenderText.h: Declare the InlineTextBox class before 
2860         friend declaration to resolve compilation issues with gcc 4.0.2.
2861         
2862 2006-04-21  Adele Peterson  <adele@apple.com>
2863
2864         Reviewed by Darin.
2865
2866         Fix for: http://bugzilla.opendarwin.org/show_bug.cgi?id=8213
2867         REGRESSION: Can't tab out of text field if iframe comes after it
2868
2869         Test: fast/forms/tabbing-input-iframe.html
2870
2871         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::nextKeyViewInFrame):
2872           If the next focusable node is a RenderWidget without a view, then continue in the loop.  We used to break out in this case. 
2873           I also made some formatting changes and reorganized the function to make it easier to read.
2874
2875 2006-04-21  Adele Peterson  <adele@apple.com>
2876
2877         Reviewed by Beth.
2878
2879         Fix for: http://bugzilla.opendarwin.org/show_bug.cgi?id=8496
2880         REGRESSION: Dragging to select text around a text field causes the text field to scroll.
2881
2882         Test: manual-tests/text-field-autoscroll.html
2883
2884         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::handleMouseMoveEvent): Start the frame's autoscroll timer
2885         even when we're calling over the bridge to handle the autoscroll.
2886         * page/Frame.cpp: (WebCore::Frame::stopAutoscrollTimer): Clear out pointer to layer.
2887
2888 2006-04-21  Geoffrey Garen  <ggaren@apple.com>
2889
2890         - And again.
2891
2892         * WebCore.vcproj/WebCore/WebCore.vcproj:
2893
2894 2006-04-21  Geoffrey Garen  <ggaren@apple.com>
2895
2896         - Futile attempt to fix Windows build.
2897         
2898         * WebCore.vcproj/WebCore/WebCore.vcproj:
2899
2900 2006-04-20  Geoffrey Garen  <ggaren@apple.com>
2901
2902         Reviewed by Maciej.
2903
2904         - Added autogeneration of JS bindings for CSSRule, CSSValue,
2905         Event, and NodeFilter.  
2906
2907         - Made related prototype objects hold the relevant constants, to
2908         match Mozilla and the DOM 2 spec. (Previously, only the related
2909         constructor objects held those constants, in accordance with the
2910         DOM 3 spec.)
2911
2912         - Fixed up remaining Windows build issues.
2913
2914         * DerivedSources.make: Added new autogenerated files
2915         * WebCore.xcodeproj/project.pbxproj: ditto
2916         * bindings/js/kjs_css.cpp:
2917         (KJS::DOMCSSRule::classInfo):
2918         (KJS::DOMCSSRule::getOwnPropertySlot): scope call to classInfo()
2919         because it's virtual and DOMCSSRule has a derrived class now.
2920         (KJS::DOMCSSRule::put): ditto
2921         (KJS::DOMCSSRuleFunc::callAsFunction):
2922         (KJS::toJS):
2923         * bindings/js/kjs_css.h:
2924         * bindings/js/kjs_events.cpp:
2925         (KJS::toJS):
2926         * bindings/js/kjs_events.h:
2927         * bindings/js/kjs_html.cpp:
2928         (KJS::OptionConstructorImp::OptionConstructorImp):
2929         * bindings/js/kjs_traversal.cpp:
2930         (KJS::toJS):
2931         * bindings/js/kjs_traversal.h:
2932         * bindings/js/kjs_window.cpp: 
2933         (KJS::Window::getValueProperty): added CSSValue global object
2934         * bindings/js/kjs_window.h:
2935         (KJS::Window::):
2936         * bindings/scripts/CodeGeneratorJS.pm: Changed generator to write
2937         constants to prototype objects (previously only wrote constants to
2938         constructor objects)
2939         * css/CSSPrimitiveValue.idl: Removed LegacyParent since CSSValue now
2940         exists in IDL
2941         * css/CSSRule.idl: Added.
2942         * css/CSSValue.idl: Added.
2943         * css/css_ruleimpl.h:
2944         (WebCore::CSSRule::):
2945         * css/css_valueimpl.h:
2946         * dom/Event.idl: Added.
2947         * dom/MutationEvent.idl: Removed LegacyParent since Event now exists
2948         in IDL
2949         * dom/NodeFilter.idl: Added.
2950         * dom/UIEvent.idl: Removed LegacyParent since event now exists in IDL
2951         * dom/dom2_eventsimpl.h:
2952         (WebCore::Event::):
2953
2954 2006-04-21  Darin Adler  <darin@apple.com>
2955
2956         - one more attempt to fix Windows build
2957
2958         * platform/cairo/GraphicsContextCairo.cpp:
2959         (WebCore::GraphicsContext::fillRect): Update to use Color and match
2960         the similar function on GraphicsContextMac.
2961
2962 2006-04-21  Beth Dakin  <bdakin@apple.com>
2963
2964         Reviewed by Hyatt.
2965
2966         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8495 
2967         REGRESSION: Sidebar on cnn.com is hosed
2968
2969         * platform/mac/ImageMac.mm:
2970         (WebCore::Image::drawTiled): Use the size of the destination rect, 
2971         not the oneTileRect in the no-pattern case.
2972         * rendering/RenderBox.cpp:
2973         (WebCore::RenderBox::paintBackgroundExtended): Initialize 
2974         scaledWidth and scaledHeight to the appropriate value (was wrong in 
2975         scroll case), adjust position at appropriate times, and take out 
2976         no-repeat clause for now since we don't have enough test cases yet 
2977         to be sure we won't cause massive regressions. 
2978
2979 2006-04-21  Darin Adler  <darin@apple.com>
2980
2981         - attempt to fix Windows build after my last check-in
2982
2983         * WebCore.vcproj/Image Viewer/ImageView.cpp: Changed calls to use the
2984         new IntRect-based API.
2985
2986         * html/CanvasPattern.cpp: (WebCore::CanvasPattern::CanvasPattern):
2987         Put appropriate ifdefs around the m_platformImage initializer.
2988
2989         * page/Frame.cpp: Make Frame::adjustPageHeight Mac-OS-X-only for now
2990         since it's used for printing and we don't have printing going on any
2991         other platforms yet.
2992
2993         * platform/cairo/GraphicsContextCairo.cpp: Take out constructor that
2994         takes only the "for printing" boolean for now.
2995
2996         * platform/cairo/ImageCairo.cpp: Include the GraphicsContext.h header.
2997
2998         * platform/win/TemporaryLinkStubs.cpp: (GraphicsContext::setShadow):
2999         Fix up this stub and remove the GraphicsContext empty constructor stub.
3000
3001 2006-04-21  Darin Adler  <darin@apple.com>
3002
3003         - fix build
3004
3005         * WebCore.xcodeproj/project.pbxproj: Replaced absolute path on my system
3006         with a build-result-relative path; also removed some source files from the
3007         list of resources to install!
3008
3009 2006-04-20  Darin Adler  <darin@apple.com>
3010
3011         Reviewed by Hyatt.
3012
3013         - make <canvas> element and related API behave more like the draft of
3014           the WhatWG Web Application specification, checking parameter validity
3015           and raising exceptions
3016         - changed HTMLCanvasElement bindings to be auto-generated, fixing all
3017           issues so we can generate bindings for classes drived from HTMLElement
3018         - change GraphicsContext API to use IntRect/Point/Size in more cases
3019         - change GraphicsContext so it is closer to truly wrapping a graphics
3020           context rather than representing the current NSGraphicsContext; there
3021           are still some things like text and rectangle fills that are tied to
3022           NSGraphicsContext, but we're most of the way there
3023         - removed Brush class since it just amounted to a color, using an RGBA32
3024           instead where we used to use a Brush
3025
3026         * DerivedSources.make: Added JSHTMLCanvasElement.h.
3027         * WebCore.xcodeproj/project.pbxproj: Added new files.
3028
3029         * bindings/js/JSCanvasRenderingContext2DBase.h: Added toJS.
3030         * bindings/js/JSCanvasRenderingContext2DBase.cpp:
3031         (WebCore::JSCanvasRenderingContext2DBaseProtoFunc::callAsFunction):
3032         Added exception code handling for strokeRect, drawImage, and createPattern.
3033         Added version of createPattern that takes a canvas. Use TYPE_MISMATCH_ERR
3034         instead of JavaScript TypeError when parameter is neither an image or canvas
3035         element. Adapt for new HTMLCanvasElement binding.
3036         (WebCore::toJS): Added. Converts context object to JS wrapper.
3037
3038         * bindings/js/JSHTMLElementWrapperFactory.h: Added.
3039         * bindings/js/JSHTMLElementWrapperFactory.cpp: Added. Creates a JavaScript
3040         wrapper for an arbitrary HTML element. Better than putting this all in the
3041         DOM node class toJS function.
3042
3043         * bindings/js/JSXMLSerializer.cpp: Tweaked to make it build.
3044         * bindings/js/kjs_dom.cpp: (KJS::toJS): Changed to call the
3045         JSHTMLElementWrapperFactory function createJSWrapper, instead
3046         of always creating a JSHTMLElement.
3047
3048         * bindings/js/kjs_html.h: Removed canvas-related stuff. Added HTMLElement
3049         prototype.
3050         * bindings/js/kjs_html.cpp:
3051         (KJS::JSHTMLElement::classInfo): Removed canvas element.
3052         (KJS::JSHTMLElement::accessors): Ditto.
3053         (KJS::JSHTMLElementProtoFunc::callAsFunction): Added, to help the auto-binding
3054         machiner cope with HTMLElement.
3055         (KJS::HTMLElementFunction::callAsFunction): Removed canvas element.
3056
3057         * bindings/scripts/CodeGeneratorJS.pm: Added types needed for HTMLCanvasElement.
3058
3059         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::setDisplaysWithFocusAttributes):
3060         Changed to create a GraphicsContext with the new constructor that takes
3061         a CGContextRef.
3062         * bridge/mac/WebCoreFrameBridge.mm: (-[WebCoreFrameBridge drawRect:]):
3063         Changed to create a GraphicsContext with the new constructor that takes
3064         a NSGraphicsContext.
3065         * page/Frame.cpp: (WebCore::Frame::adjustPageHeight): Changed to create a
3066         GraphicsContext with the new constructor that takes a CGContextRef.
3067
3068         * editing/SelectionController.cpp: (WebCore::SelectionController::paintCaret):
3069         Eliminated a use of obsolete class Brush.
3070
3071         * html/CanvasPattern.h:
3072         * html/CanvasPattern.cpp:
3073         (WebCore::CanvasPattern::parseRepetitionType): Added. Parses a repetition
3074         type. Different from the old logic in that it is case-sensitive and rejects
3075         anything other than null, empty string, or the four repeat types.
3076         (WebCore::CanvasPattern::CanvasPattern): Added constructor that takes
3077         a CGImageRef. Changed constructor to take two booleans instead of the repetition
3078         type string. It's the caller's responsibility to parse the string.
3079         (WebCore::CanvasPattern::~CanvasPattern): Release the CGImage.
3080         (WebCore::patternCallback): Handle the CGImage case. Also changed the code
3081         to create a GraphicsContext as needed and call the image drawing code with that.
3082         (WebCore::CanvasPattern::createPattern): Handle both the image element case and
3083         the canvas element case.
3084         
3085         * html/CanvasRenderingContext2D.h:
3086         * html/CanvasRenderingContext2D.cpp:
3087         (WebCore::CanvasRenderingContext2D::State::State): Change line cap, line join,
3088         and global composite to store enum values instead of strings.
3089         (WebCore::CanvasRenderingContext2D::setLineWidth): Do nothing if width is NaN
3090         or <= 0.
3091         (WebCore::CanvasRenderingContext2D::lineCap): Return a string based on a
3092         stored enum, rather than returning a stored string.
3093         (WebCore::CanvasRenderingContext2D::setLineCap): Do nothing if the string is
3094         not one of the standard line cap types. Also case sensitive and stores enum
3095         rather than the string.
3096         (WebCore::CanvasRenderingContext2D::lineJoin): Return a string based on a
3097         stored enum, rather than returning a stored string.
3098         (WebCore::CanvasRenderingContext2D::setLineJoin): Do nothing if the string is
3099         not one of the standard line join types. Also case sensitive and stores enum
3100         rather than the string.
3101         (WebCore::CanvasRenderingContext2D::setMiterLimit): Do nothing if limit is NaN
3102         or <= 0.
3103         (WebCore::CanvasRenderingContext2D::setGlobalAlpha): Do nothing if alpha is NaN
3104         or < 0 or > 1.
3105         (WebCore::CanvasRenderingContext2D::globalCompositeOperation): Return a string
3106         based on a stored enum, rather than returning a stored string.
3107         (WebCore::CanvasRenderingContext2D::setGlobalCompositeOperation): Do nothing if
3108         the string is not one of the standard compositing modes. Also case sensitive and
3109         stores enum rather than the string.
3110         (WebCore::CanvasRenderingContext2D::arcTo): Generate INDEX_SIZE_ERR exception
3111         if radius is NaN or <= 0.
3112         (WebCore::CanvasRenderingContext2D::arc): Ditto.
3113         (WebCore::CanvasRenderingContext2D::rect): Generate INDEX_SIZE_ERR exception
3114         if width or height is NaN or <= 0.
3115         (WebCore::CanvasRenderingContext2D::clearRect): Ditto.
3116         (WebCore::CanvasRenderingContext2D::fillRect): Ditto.
3117         (WebCore::CanvasRenderingContext2D::strokeRect): Ditto, same for line width.
3118         Changed the case where the line width is not specified to share code with the
3119         case where it is.
3120         (WebCore::size): Renamed from imageSize, since C++ overloads based on parameter
3121         types anyway.
3122         (WebCore::CanvasRenderingContext2D::drawImage): Generate INDEX_SIZE_ERR exception
3123         if the source rect is not entirely inside the image rect, or if the width or height
3124         of either the source or destination rect is NaN or <= 0. Changed image drawing
3125         code to be platform-independent for the image element case, but not yet for the
3126         canvas case.
3127         (WebCore::CanvasRenderingContext2D::drawImageFromRect): Change code to parse the
3128         composite operation to use the new code shared with Image.
3129         (WebCore::CanvasRenderingContext2D::createPattern): Added code to parse the
3130         repetition type separately before creating the pattern. Added an overload for
3131         canvas elements.
3132         (WebCore::CanvasRenderingContext2D::drawingContext): Changed to return a
3133         GraphicsContext*.
3134         (WebCore::CanvasRenderingContext2D::platformContext): Added. Now does what
3135         drawingContext used to do.
3136
3137         * html/CanvasRenderingContext2D.idl: Added exception declarations as needed
3138         for changes above.
3139
3140         * html/HTMLCanvasElement.h:
3141         * html/HTMLCanvasElement.cpp:
3142         (WebCore::HTMLCanvasElement::HTMLCanvasElement): Changed m_drawingContext
3143         to be a GraphicsContext instead of a CGContextRef.
3144         (WebCore::HTMLCanvasElement::~HTMLCanvasElement): Ditto.
3145         (WebCore::HTMLCanvasElement::getContext): Removed special cases for null
3146         and empty string. Only give a 2D graphics context if the string is "2d".
3147         (WebCore::HTMLCanvasElement::reset): Updated for change to GraphicsContext
3148         from CGContextRef.
3149         (WebCore::HTMLCanvasElement::paint): Ditto.
3150         (WebCore::HTMLCanvasElement::createDrawingContext): Changed to create a
3151         GraphicsContext* instead of a CGContextRef.
3152         (WebCore::HTMLCanvasElement::drawingContext): Changed to return a
3153         GraphicsContext* instead of a CGContextRef.
3154         (WebCore::HTMLCanvasElement::createPlatformImage): Updated for changes above.
3155
3156         * html/HTMLCanvasElement.idl: Added.
3157
3158         * html/HTMLParser.h:
3159         * html/HTMLParser.cpp:
3160         (WebCore::HTMLParser::canvasCreateErrorCheck): Added. An attempt to implement the
3161         fallback behavior for canvas elements when JavaScript is off.
3162         (WebCore::HTMLParser::getNode): Sorted list of functions. Added case for canvas.
3163
3164         * html/html_imageimpl.h:
3165         * html/html_imageimpl.cpp:
3166         (WebCore::HTMLImageElement::HTMLImageElement): Changed m_compositeOperator to be
3167         an enum instead of a string.
3168         (WebCore::HTMLImageElement::parseMappedAttribute): Parse the enum here.
3169
3170         * kcanvas/KCanvasResources.h:
3171         * kcanvas/KCanvasResources.cpp: (WebCore::KCanvasMarker::draw): Changed to take a
3172         GraphicsContext parameter.
3173
3174         * kcanvas/RenderPath.h: Added GraphicsContext parameter to drawMarkersIfNeeded.
3175
3176         * kcanvas/RenderPath.cpp: (WebCore::RenderPath::paint):
3177         * kcanvas/RenderSVGImage.cpp: (WebCore::RenderSVGImage::paint):
3178         * kcanvas/RenderSVGText.cpp: (WebCore::RenderSVGText::paint):
3179         Changed to generate and use an appropriate GraphicsContext.
3180
3181         * kcanvas/device/quartz/KCanvasItemQuartz.h: Added GraphicsContext parameter to
3182         drawMarkersIfNeeded.
3183         * kcanvas/device/quartz/KCanvasItemQuartz.mm:
3184         (WebCore::DrawMarkersData::DrawMarkersData): Added GraphicsContext*.
3185         (WebCore::drawMarkerWithData): Pass along a GraphicsContext*.
3186         (WebCore::drawStartAndMidMarkers): Ditto.
3187         (WebCore::KCanvasItemQuartz::drawMarkersIfNeeded): Pass a long a GraphicsContext*.
3188
3189         * kcanvas/device/KRenderingDevice.h: Added a pure virtual createGraphicsContext
3190         to bridge back to a GraphicsContext. Long term that class will replace this one.
3191         * kcanvas/device/quartz/KRenderingDeviceQuartz.h:
3192         * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
3193         (WebCore::KRenderingDeviceContextQuartz::createGraphicsContext): Added.
3194
3195         * ksvg2/svg/SVGMaskElement.cpp: (WebCore::SVGMaskElement::drawMaskerContent):
3196         Create and pass a GraphicsContext -- old code used the default constructor for
3197         GraphicsContext which meant "current context", and that no longer exists.
3198         * ksvg2/svg/SVGPatternElement.cpp:
3199         (WebCore::SVGPatternElement::drawPatternContentIntoTile): Ditto.
3200
3201         * platform/Brush.h: Removed.
3202         * platform/CompositeOperator.h: Added.
3203         * platform/CompositeOperator.cpp: Added.
3204
3205         * platform/Font.h: Changed calls to use IntPoint instead of pairs of ints.
3206         Also removed the const from all the uses of GraphicsContext*.
3207
3208         * platform/GraphicsContext.h: Eliminated default constructor and constructor
3209         that takes only a boolean. Replaced with constructors that take platform
3210         graphics contexts only. Replaced brush-related calls with fill color calls.
3211         Replaced use of Brush with use of Color. Changed Image::CompositeOperator to
3212         just plain CompositeOperator. Changed tuples of ints into IntRect and IntPoint.
3213         Moved setFocusRingClip and clearFocusRingClip out of ifdefs. Removed unused
3214         getCompositeOperation and string-based setCompositeOperation. Moved
3215         currentCGContext and the other setCompositeOperation out of the GraphicsContext
3216         class and made them global functions. Fixed platformContext so it won't always
3217         return the CGContextRef of the current NSGraphicsContext. Instead, it will
3218         return the appropriate CGContextRef for the GraphicsContext. This eliminates
3219         the need to use void* for the image-drawing functions.
3220
3221         * platform/GraphicsContext.cpp:
3222         (WebCore::GraphicsContextState::GraphicsContextState): Replaced Brush with
3223         an RGBA fill color.
3224         (WebCore::GraphicsContext::setFillColor): Renamed from setBrush.
3225         (WebCore::GraphicsContext::fillColor): Renamed from brush.
3226         (WebCore::GraphicsContext::drawImage): Changed to use IntRect.
3227         (WebCore::GraphicsContext::drawTiledImage): Moved here from GraphicsContextMac.mm.
3228         (WebCore::GraphicsContext::drawText): Changed to use IntPoint.
3229         (WebCore::GraphicsContext::drawHighlightForText): Ditto.
3230         (WebCore::GraphicsContext::drawLineForText): Ditto.
3231         (WebCore::GraphicsContext::drawLineForMisspelling): Ditto.
3232
3233         * platform/Image.h: Removed CompositeOperator and related functions.
3234         Removed void* context parameters from draw functions.
3235
3236         * platform/Image.cpp: Removed compositeOperatorFromString.
3237
3238         * platform/Widget.h: Added a GraphicsContext* return value from lockDrawingFocus
3239         that you pass back to unlockDrawingFocus (for deletion).
3240
3241         * platform/mac/FontMac.mm:
3242         (WebCore::Font::selectionRectForText): Changed parameter to point and removed
3243         const on GraphicsContext* parameter.
3244         (WebCore::Font::drawText): Ditto.
3245         (WebCore::Font::drawHighlightForText): Ditto.
3246         (WebCore::Font::drawLineForText): Ditto.
3247         (WebCore::Font::drawLineForMisspelling): Ditto.
3248         (WebCore::Font::misspellingLineThickness): Removed const.
3249
3250         * platform/mac/GraphicsContextMac.mm:
3251         (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
3252         Added fields to store a CGContextRef and an NSGraphicsContext.
3253         (WebCore::GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate):
3254         Release both the CGContextRef and the NSGraphicsContext.
3255         (WebCore::GraphicsContext::GraphicsContext): Implement to set up both the
3256         CGContextRef and the NSGraphicsContext in one case, and only the CGContextRef
3257         in the other.
3258         (WebCore::GraphicsContext::savePlatformState): Implement for the CGContext-only
3259         case.
3260         (WebCore::GraphicsContext::restorePlatformState): Ditto.
3261         (WebCore::GraphicsContext::drawRect): Assert that the NS context is present
3262         and 
3263         (WebCore::GraphicsContext::setColorFromFillColor): Renamed from
3264         setColorFromBrush.
3265         (WebCore::GraphicsContext::setColorFromPen): Added assertion.
3266         (WebCore::GraphicsContext::drawLine): Added assertion.
3267         (WebCore::GraphicsContext::drawEllipse): Get CGContext from the platformContext
3268         function instead of currentCGContext, and changed to use fillColor.
3269         (WebCore::GraphicsContext::drawArc): Ditto.
3270         (WebCore::GraphicsContext::drawConvexPolygon): Ditto.
3271         (WebCore::setCompositeOperation): Changed to global function and also changed
3272         to do the work here -- no need to use WebCoreImageRendererFactory.
3273         (WebCore::GraphicsContext::drawImage): Move most of this into GraphicsContext.cpp.
3274         Remove the void* context parameter. Changed to take rects instead of separate coordinates.
3275         (WebCore::GraphicsContext::fillRect): Changed to take color instead of Brush.
3276         (WebCore::GraphicsContext::addClip): Added assertion.
3277         (WebCore::GraphicsContext::addRoundedRectClip): Get CGContextRef from the platformContext
3278         function instead of currentCGContext.
3279         (WebCore::GraphicsContext::createRenderingDeviceContext): Ditto.
3280         (WebCore::GraphicsContext::beginTransparencyLayer): Ditto.
3281         (WebCore::GraphicsContext::endTransparencyLayer): Ditto.
3282         (WebCore::GraphicsContext::setShadow): Change to take size instead of x,y. Also get
3283         CGCOntextRef from the platformContext function instead of currentCGContext.
3284         (WebCore::GraphicsContext::clearShadow): Get CGContextRef from the platformContext
3285         function instead of currentCGContext.
3286         (WebCore::GraphicsContext::platformContext): Added. Returns m_data->m_cgContext.
3287
3288         * platform/mac/ImageMac.mm:
3289         (WebCore::fillSolidColorInRect): Updated for change in CompositeOperator type.
3290         (WebCore::Image::checkForSolidColor): Ditto.
3291         (WebCore::Image::draw): Removed void* context parameter and replaced it with
3292         a GraphicsContext* parameter. Renamed from drawInRect.
3293         (WebCore::Image::drawTiled): Ditto. Renamed from tileInRect and scaleAndTileInRect.
3294
3295         * platform/mac/PDFDocumentImage.h: Updated for change in CompositeOperator type.
3296         * platform/mac/PDFDocumentImage.mm: (WebCore::PDFDocumentImage::draw): Ditto.
3297
3298         * platform/mac/WidgetMac.mm:
3299         (WebCore::Widget::lockDrawingFocus): Changed to return a GraphicsContext*.
3300         (WebCore::Widget::unlockDrawingFocus): Changed to take a GraphicsContext*.
3301
3302         * rendering/InlineTextBox.cpp:
3303         (WebCore::InlineTextBox::selectionRect): Changed to pass IntPoint.
3304         (WebCore::InlineTextBox::paint): Changed to pass IntSize.
3305         (WebCore::InlineTextBox::paintSelection): More of the same.
3306         (WebCore::InlineTextBox::paintMarkedTextBackground): Ditto.
3307         (WebCore::InlineTextBox::paintDecoration): Ditto.
3308         (WebCore::InlineTextBox::paintSpellingMarker): Ditto.
3309         (WebCore::InlineTextBox::paintTextMatchMarker): Ditto.
3310         (WebCore::InlineTextBox::paintMarkedTextUnderline): Ditto.
3311         (WebCore::InlineTextBox::positionForOffset): Ditto.
3312         * rendering/RenderBlock.cpp:
3313         (WebCore::RenderBlock::fillHorizontalSelectionGap): Ditto.
3314         (WebCore::RenderBlock::fillVerticalSelectionGap): Ditto.
3315         (WebCore::RenderBlock::fillLeftSelectionGap): Ditto.
3316         (WebCore::RenderBlock::fillRightSelectionGap): Ditto.
3317         * rendering/RenderBox.cpp:
3318         (WebCore::RenderBox::paintBackgroundExtended): Ditto.
3319         (WebCore::RenderBox::outlineBox): Ditto.
3320         * rendering/RenderImage.cpp:
3321         (WebCore::RenderImage::paint): Ditto.
3322         * rendering/RenderLayer.cpp:
3323         (WebCore::setClip): Take out ifdefs. We'll do that inside GraphicsContext instead.
3324         (WebCore::restoreClip): Ditto.
3325         * rendering/RenderObject.cpp:
3326         (WebCore::RenderObject::drawBorder): More of the same.
3327         (WebCore::RenderObject::paintBorderImage): Ditto.
3328         * rendering/render_line.cpp:
3329         (WebCore::InlineFlowBox::paintDecorations): Ditto.
3330         (WebCore::EllipsisBox::paint): Ditto.
3331         * rendering/render_list.cpp:
3332         (WebCore::RenderListMarker::paint): Ditto.
3333
3334         * rendering/render_frames.cpp: (WebCore::RenderFrameSet::userResize): Set up a graphics
3335         context by calling lockDrawingFocus. Also changed a color here to be a constant.
3336
3337         * platform/cairo/GraphicsContextCairo.cpp:
3338         (WebCore::GraphicsContext::drawImage): Update for parameter type changes.
3339         (WebCore::GraphicsContext::drawScaledAndTiledImage):
3340         (WebCore::GraphicsContext::setFocusRingClip):
3341         (WebCore::GraphicsContext::clearFocusRingClip):
3342         * platform/cairo/ImageCairo.cpp:
3343         (WebCore::setCompositingOperation):
3344         (WebCore::Image::tileInRect):
3345         (WebCore::Image::scaleAndTileInRect):
3346
3347 2006-04-20  Mitz Pettel  <opendarwin.org@mitzpettel.com>
3348
3349         Reviewed by Darin.
3350
3351         WebCore part of:
3352         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8276
3353           REGRESSION (NativeTextField): Pasting a Finder item into a text field results in
3354             a file: URL being pasted instead of just the file name
3355         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8283
3356           REGRESSION: File's path doesn't appear after dragging file into input field
3357
3358         * bridge/mac/WebCoreFrameBridge.h:
3359         * bridge/mac/WebCoreFrameBridge.mm:
3360         (-[WebCoreFrameBridge isDragCaretRichlyEditable]): Added.
3361         * manual-tests/plain-text-paste.html: Added.
3362         * manual-tests/resources/plain-text-paste: Added.
3363         * manual-tests/resources/plain-text-paste/1.textClipping: Added.
3364         * manual-tests/resources/plain-text-paste/2.textClipping: Added.
3365         * manual-tests/resources/plain-text-paste/3.gif: Added.
3366         * manual-tests/resources/plain-text-paste/4.txt: Added.
3367         * manual-tests/resources/plain-text-paste/5.webloc: Added.
3368
3369 2006-04-20  Darin Adler  <darin@apple.com>
3370
3371         Reviewed by Adele.
3372
3373         - WebCore part of http://bugzilla.opendarwin.org/show_bug.cgi?id=8505
3374           eliminate WebCoreGraphics bridge, demonstrate new SystemInterface technique
3375
3376         * platform/mac/WebCoreGraphicsBridge.h: Removed.
3377         * platform/mac/WebCoreGraphicsBridge.m: Removed.
3378         * platform/mac/WebCoreSystemInterface.h: Added.
3379         * platform/mac/WebCoreSystemInterface.mm: Added.
3380
3381         * WebCore.exp: Add new SystemInterface globals, remove WebCoreGraphicsBridge.
3382
3383         * WebCore.xcodeproj/project.pbxproj: Updated for removed and added files.
3384         Sorted files.
3385
3386         * bridge/mac/FrameMac.mm: Removed unneeded include of WebCoreGraphicsBridge.h.
3387
3388         * platform/mac/ClipboardMac.mm: (WebCore::ClipboardMac::setDragImage):
3389         Moved code from WebGraphicsBridge here, using WebCoreSystemInterface so we can
3390         call wkSetDragImage.
3391
3392         * platform/mac/GraphicsContextMac.mm: (WebCore::GraphicsContext::drawFocusRing):
3393         Moved code from WebGraphicsBridge here, using WebCoreSystemInterface so we can
3394         call wkDrawFocusRing.
3395
3396         * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintTextField):
3397         Call wkDrawBezeledTextFieldCell from WebCoreSystemInterface instead of using
3398         WebGraphicsBridge to do the same thing.
3399
3400 2006-04-20  Adele Peterson  <adele@apple.com>
3401
3402         Reviewed by Hyatt.
3403
3404         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8273
3405         REGRESSION: Read only input text field renders at the wrong height when value attribute is not present
3406
3407         Test: fast/forms/input-readonly-empty.html
3408
3409         * rendering/RenderBlock.h: Added hasLineIfEmpty.
3410         * rendering/RenderBlock.cpp:
3411         (WebCore::RenderBlock::hasLineIfEmpty): Added.  Checks for rootEditableElement as well as 
3412          a shadowNode who has an input element as a parent.
3413         (WebCore::RenderBlock::getBaselineOfLastLineBox): Calls hasLineIfEmpty instead of just checking for the rootEditableElement.
3414         * rendering/bidi.cpp: (WebCore::RenderBlock::layoutInlineChildren): ditto.
3415
3416 2006-04-20  Darin Adler  <darin@apple.com>
3417
3418         Reviewed by Timothy.
3419
3420         Removed TO_NODE_OFFSET and TO_NODE_ADDRESS macros. These can just be done inline with pointer math.
3421
3422         * platform/DeprecatedString.cpp:
3423         (allocateNode):
3424         (freeHandle):
3425
3426 2006-04-19  Adele Peterson  <adele@apple.com>
3427
3428         Rubber-stamped by Darin.
3429
3430         Removed optimizations recently added in setInnerHTML and setInnerText.  The setInnerHTML change broke a first-letter style test.
3431         The setInnerText change caused an empty text node to get added when setting inner text to an empty string.  The bug that this
3432         change went in with remains fixed.
3433
3434         * html/HTMLElement.cpp:
3435         (WebCore::HTMLElement::setInnerHTML):
3436         (WebCore::HTMLElement::setInnerText):
3437
3438 2006-04-19  Mitz Pettel  <opendarwin.org@mitzpettel.com>
3439
3440         Reviewed by Haytt.
3441
3442         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6770
3443           REGRESSION: Incomplete repaint when block with clipping grows
3444
3445         * manual-tests/repaint-resized-overflow.html: Added.
3446         * rendering/RenderLayer.cpp:
3447         (WebCore::RenderLayer::RenderLayer):
3448         (WebCore::RenderLayer::computeRepaintRects): Set the m_repaintOverflowOnResize
3449         flag to true if our object itself needs layout or if we're an overflow
3450         and have a normal child that needs layout, in which case if we end up
3451         resizing it will be because of the child, and that child might have not repainted
3452         itself correctly during its own layout.
3453         (WebCore::RenderLayer::updateLayerPositions): Do a full repaint if
3454         m_repaintOverflowOnResize is set and we resized but didn't move.
3455         * rendering/RenderLayer.h:
3456
3457 2006-04-19  Mitz Pettel  <opendarwin.org@mitzpettel.com>
3458
3459         Reviewed by Hyatt.
3460
3461         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8352
3462           CSS text-shadow does not repaint completely when changed
3463
3464         * manual-tests/dynamic-shadow.html: Added.
3465         * rendering/render_style.cpp:
3466         (WebCore::RenderStyle::diff): Changed to return Layout when text-shadow
3467         changes.
3468
3469 2006-04-19  Adele Peterson  <adele@apple.com>
3470
3471         Reviewed by Darin.
3472
3473         Added readOnly methods for HTMLInputElement and HTMLTextAreaElement so the DOM bindings can call
3474         a method with the same name.  This will make it easier to autogenerate the DOM bindings in the future.
3475  
3476         * html/HTMLInputElement.h: (WebCore::HTMLInputElement::readOnly): Added. Calls isReadOnlyControl.
3477         * html/HTMLTextAreaElement.h: (WebCore::HTMLTextAreaElement::readOnly): ditto.
3478         * bindings/js/kjs_html.cpp:
3479         (KJS::JSHTMLElement::inputGetter): Calls readOnly instead of isReadOnlyControl.
3480         (KJS::JSHTMLElement::textAreaGetter): ditto.
3481         * bindings/objc/DOMHTML.mm:
3482         (-[DOMHTMLInputElement readOnly]): ditto.
3483         (-[DOMHTMLTextAreaElement readOnly]): Calls readOnly instead of getting the attribute directly.
3484         (-[DOMHTMLTextAreaElement setReadOnly:]): Calls setReadOnly instead of setting the attribute directly.
3485
3486 2006-04-19  Adele Peterson  <adele@apple.com>
3487
3488         Reviewed by Hyatt.
3489
3490         Fix for: http://bugzilla.opendarwin.org/show_bug.cgi?id=8297
3491         REGRESSION: Input element extends outside of DIV element at http://www.macdock.com/
3492
3493         * platform/Font.h: Added runRounding parameter to floatWidth.
3494         * platform/mac/FontMac.mm: (WebCore::Font::floatWidth): ditto.
3495         * platform/win/FontWin.cpp: (WebCore::Font::floatWidth): ditto.
3496         * rendering/RenderTextField.cpp: (WebCore::RenderTextField::calcMinMaxWidth):
3497           Use new floatWidth parameter to turn off run rounding.
3498
3499 2006-04-19  Adele Peterson  <adele@apple.com>
3500
3501         Reviewed by Beth.
3502
3503         Fix for Windows build.
3504
3505         * rendering/RenderThemeWin.cpp: (WebCore::RenderThemeWin::determineState):
3506         Use isReadOnlyControl instead of isReadOnly.
3507
3508  2006-04-19  Adele Peterson  <adele@apple.com>
3509  
3510          Reviewed by Beth.
3511  
3512          Fix to make readonly text fields have dimmed borders to match AppKit behavior.
3513  
3514          Test: fast/forms/input-readonly-dimmed.html
3515  
3516          * dom/Node.h: (WebCore::Node::isReadOnlyControl): Changed from const version of isReadOnly.
3517          * dom/Node.cpp:
3518          (WebCore::Node::isReadOnlyNode): Changed from isReadOnly.
3519          (WebCore::Node::setNodeValue): Uses isReadOnlyNode instead of isReadOnly.
3520          (WebCore::Node::checkSetPrefix): ditto.
3521          (WebCore::Node::checkAddChild): ditto.
3522          * dom/Attr.cpp: (WebCore::Attr::setValue): ditto.
3523          * dom/CharacterData.cpp:
3524          (WebCore::CharacterData::setData): ditto.
3525          (WebCore::CharacterData::appendData): ditto.
3526          (WebCore::CharacterData::checkCharDataOperation): ditto.
3527          * dom/ContainerNode.cpp: (WebCore::ContainerNode::removeChild): ditto.
3528          * dom/Element.cpp: (WebCore::Element::setAttribute): ditto.
3529          * dom/NamedAttrMap.cpp:
3530          (WebCore::NamedAttrMap::setNamedItem): ditto.
3531          (WebCore::NamedAttrMap::removeNamedItem): ditto.
3532          * dom/NamedAttrMap.h: (WebCore::NamedAttrMap::isReadOnlyNode): ditto.
3533          * dom/NamedNodeMap.h: (WebCore::NamedNodeMap::isReadOnlyNode): ditto.
3534          * dom/Range.cpp:
3535          (WebCore::Range::checkDeleteExtract): ditto.
3536          (WebCore::Range::containedByReadOnly): ditto.
3537          * dom/Text.cpp: (WebCore::Text::splitText): ditto.
3538          * dom/dom_xmlimpl.cpp: (WebCore::ProcessingInstruction::setData): ditto.
3539  
3540          * bindings/js/kjs_html.cpp:
3541          (KJS::JSHTMLElement::inputGetter): Uses isReadOnlyControl instead of isReadOnly.
3542          (KJS::JSHTMLElement::textAreaGetter): ditto.
3543          * bindings/objc/DOMHTML.mm: (-[DOMHTMLInputElement readOnly]): ditto.
3544          * rendering/render_form.cpp:
3545          (WebCore::RenderLineEdit::updateFromElement): ditto.
3546          (WebCore::RenderTextArea::updateFromElement): ditto.
3547          * rendering/RenderTextField.cpp:
3548          (WebCore::RenderTextField::createDivStyle): ditto.
3549          (WebCore::RenderTextField::updateFromElement): ditto.
3550  
3551          * html/HTMLGenericFormElement.cpp: (WebCore::HTMLGenericFormElement::parseMappedAttribute): 
3552            When readonly attribute changes, update the theme so the control will repaint.
3553          * html/HTMLGenericFormElement.h: (WebCore::HTMLGenericFormElement::isReadOnlyControl): Renamed from readOnly.
3554          * html/HTMLInputElement.h: Removed isReadOnly, since isReadOnlyControl now exists on HTMLGenericFormElement.
3555          * rendering/RenderTheme.cpp: (WebCore::RenderTheme::isReadOnlyControl): Renamed from isReadOnly.
3556          * rendering/RenderTheme.h: (WebCore::): Added ReadOnlyState to ControlState enum.
3557          * rendering/RenderThemeMac.h: Removed NSTextFieldCell since it was only being used to store the enabled state.
3558            Removed setTextFieldState since it was updating the enabled state of the cell, which is only used in one place.
3559          * rendering/RenderThemeMac.mm:
3560          (WebCore::RenderThemeMac::RenderThemeMac): No longer initialized the NSTextFieldCell.
3561          (WebCore::RenderThemeMac::adjustRepaintRect): No longer calls setTextFieldState.
3562          (WebCore::RenderThemeMac::paintTextField): Uses the enabled state and the readonly state to determine whether to draw
3563           a dimmed version of the aqua border.
3564  
3565 2006-04-19  Beth Dakin  <bdakin@apple.com>
3566
3567         Reviewed by Hyatt.
3568
3569         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8467 Block 
3570         with percentage background-size doesn't repaint properly when it 
3571         grows
3572
3573         * manual-tests/backgroundSizeRepaint.html: Added.
3574         * manual-tests/resources/apple.jpg: Added.
3575         * rendering/RenderObject.cpp:
3576         (WebCore::RenderObject::mustRepaintBackgroundOrBorder): We must 
3577         return true if we have a percentage background-size.
3578
3579 2006-04-19  David Hyatt  <hyatt@apple.com>
3580
3581         Fix for a regression in the new text fields.  Don't allow the repaint
3582         rect created by dynamic line layout changes to spill out of an overflow
3583         area's clip region.
3584
3585         (There is no test, since we have no way of testing cases where we repaint
3586          too much rather than too little.)
3587
3588         Reviewed by darin
3589
3590         * rendering/bidi.cpp:
3591         (WebCore::RenderBlock::layoutInlineChildren):
3592
3593 2006-04-19  Mitz Pettel  <opendarwin.org@mitzpettel.com>
3594
3595         Fix for bug 8449, incomplete repaint of table cell that moved.  This
3596         fix also solves some of the textfield repainting problems (e.g., on
3597         google.com and lxr.mozilla.org).
3598
3599         Reviewed by hyatt
3600
3601         * manual-tests/table-cell-move.html: Added.
3602         * rendering/RenderCanvas.cpp:
3603         (WebCore::RenderCanvas::repaintViewRectangle):
3604         * rendering/RenderTableSection.cpp:
3605         (WebCore::RenderTableSection::layoutRows):
3606
3607 2006-04-19  Mitz Pettel  <opendarwin.org@mitzpettel.com>
3608
3609         Reviewed by Eric, landed by ap.
3610
3611         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8469
3612           CRASH: WebCore::CSSParser::parseDashboardRegions when attr() is passed
3613
3614         Test: fast/css/dashboard-regions-attr-crash.html
3615
3616         * css/cssparser.cpp:
3617         (WebCore::CSSParser::parseDashboardRegions): Added null check for args.
3618
3619 2006-04-18  Rob Buis  <buis@kde.org>
3620
3621         Reviewed by eseidel & darin.  Landed by eseidel.
3622
3623         No automated tests possible (from javascript).
3624
3625         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=6664:
3626         Inspector does not highlight SVG elements properly
3627
3628         Make sure RenderObject::absoluteBoundingBoxRect works for
3629         svg specific render objects by overriding absoluteRects.
3630         This fixes highlighting in the Inspector of svg shapes, paths,
3631         images and text.
3632
3633         * kcanvas/RenderPath.cpp:
3634         (WebCore::RenderPath::absoluteRects):
3635         * kcanvas/RenderPath.h:
3636         * kcanvas/RenderSVGImage.cpp:
3637         (WebCore::RenderSVGImage::getAbsoluteRepaintRect):
3638         (WebCore::RenderSVGImage::absoluteRects):
3639         * kcanvas/RenderSVGImage.h:
3640         * kcanvas/RenderSVGText.cpp:
3641         (WebCore::RenderSVGText::absoluteRects):
3642         * kcanvas/RenderSVGText.h:
3643
3644 2006-04-17  Rob Buis  <buis@kde.org>
3645
3646         Reviewed by eseidel.  Landed by eseidel.
3647
3648         Test: svg/custom/tref-update.svg
3649
3650         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=6427:
3651         <tref> element not implemented
3652
3653         Implementation of <tref> element.
3654
3655         * WebCore.xcodeproj/project.pbxproj:
3656         * ksvg2/svg/SVGTRefElement.cpp: Added.
3657         (SVGTRefElement::SVGTRefElement):
3658         (SVGTRefElement::~SVGTRefElement):
3659         (SVGTRefElement::parseMappedAttribute):
3660         (SVGTRefElement::closeRenderer):
3661         (SVGTRefElement::childShouldCreateRenderer):
3662         (SVGTRefElement::createRenderer):
3663         * ksvg2/svg/SVGTRefElement.h: Added.
3664         (WebCore::SVGTRefElement::rendererIsNeeded):
3665         * ksvg2/svg/SVGTSpanElement.cpp:
3666         (SVGTSpanElement::childShouldCreateRenderer):
3667         * ksvg2/svg/SVGTextElement.cpp:
3668         (WebCore::SVGTextElement::childShouldCreateRenderer):
3669         * ksvg2/svg/svgtags.in:
3670
3671 2006-04-18  Darin Adler  <darin@apple.com>
3672
3673         * rendering/render_form.cpp: (WebCore::RenderSelect::updateFromElement):
3674         Roll out accidentally-landed change for bug 8398.
3675
3676 2006-04-18  Beth Dakin  <bdakin@apple.com>
3677
3678         Reviewed by Darin.
3679
3680         Fix for a leak exposed by background-size and detected by the 
3681         layout tests.
3682
3683         * css/css_valueimpl.cpp:
3684         (WebCore::CSSPrimitiveValue::cleanup): We must deref pairs.
3685
3686 2006-04-18  Beth Dakin  <bdakin@apple.com>
3687
3688         Reviewed by Eric.
3689
3690         Build fix for Windows. Just a few typos from background-size patch.
3691
3692         * platform/cairo/GraphicsContextCairo.cpp:
3693         (WebCore::GraphicsContext::drawTiledImage):
3694         * platform/cairo/ImageCairo.cpp:
3695         (WebCore::Image::tileInRect):
3696
3697 2006-04-18  Beth Dakin  <bdakin@apple.com>
3698
3699         Reviewed by Hyatt.
3700
3701         Implementation of CSS3 background-size property. See 
3702         http://bugzilla.opendarwin.org/show_bug.cgi?id=8353 for details.
3703
3704         * Viewer/ImageView.cpp: Adjust parameters to drawTiledImage()
3705         * css/CSSComputedStyleDeclaration.cpp: Add background-size
3706         * css/CSSPropertyNames.in: Same.
3707         * css/css_valueimpl.h: Add a constructor for Pair that takes the 
3708         two halves of the pair.
3709         * css/cssparser.cpp: Parse background-size. Still need to take care 
3710         of parsing the shorthand.
3711         * css/cssparser.h: Same.
3712         * css/cssstyleselector.cpp: Address background-size.
3713         * css/cssstyleselector.h: Same.
3714         * platform/GraphicsContext.h: drawTiledImage() now takes the 
3715         tileSize so that it can appropriately scale.
3716         * platform/Image.h: Same as above, but for tileInRect()
3717         * platform/cairo/GraphicsContextCairo.cpp:
3718         (WebCore::GraphicsContext::drawTiledImage):
3719         * platform/cairo/ImageCairo.cpp:
3720         (WebCore::Image::tileInRect): Take care of scaling image in 
3721         necessary in Cairo.
3722         * platform/mac/GraphicsContextMac.mm:
3723         (WebCore::GraphicsContext::drawTiledImage): 
3724         * platform/mac/ImageMac.mm:
3725         (WebCore::Image::tileInRect): Take care of scaling image if 
3726         necessary in CG.
3727         * rendering/RenderBox.cpp:
3728         (WebCore::RenderBox::paintBackgroundExtended): Compute appropriate 
3729         scale if background-size is set. If no-repeat is set, just call 
3730         drawImage() directly.
3731         * rendering/render_style.cpp: Add background-size to the style.
3732         (WebCore::m_next):
3733         (WebCore::BackgroundLayer::BackgroundLayer):
3734         (WebCore::BackgroundLayer::operator=):
3735         (WebCore::BackgroundLayer::operator==):
3736         (WebCore::BackgroundLayer::fillUnsetProperties):
3737         (WebCore::BackgroundLayer::cullEmptyLayers):
3738         * rendering/render_style.h: Same.
3739         (WebCore::BackgroundLayer::backgroundSize):
3740         (WebCore::BackgroundLayer::isBackgroundSizeSet):
3741         (WebCore::BackgroundLayer::setBackgroundSize):
3742         (WebCore::BackgroundLayer::clearBackgroundSize):
3743         (WebCore::RenderStyle::backgroundSize):
3744         (WebCore::RenderStyle::initialBackgroundSize):
3745
3746 2006-04-17  Justin Garcia  <justin.garcia@apple.com>
3747
3748         Reviewed by harrison
3749
3750         * editing/CompositeEditCommand.cpp:
3751         (WebCore::CompositeEditCommand::moveParagraph): The placeholder that's inserted 
3752         to keep content from collapsing due to pruning was inserted at the position after 
3753         the moved paragraph.  That's only appropriate when moving the paragraph backward 
3754         into the previous paragraph.
3755         
3756         * editing/ReplaceSelectionCommand.cpp:
3757         (WebCore::ReplaceSelectionCommand::doApply): The last paragraph of the incoming
3758         fragment should be merged with the paragraph after the end of the selection being pasted
3759         into even if the incoming fragment has only one block.   This fixes a bug and gets
3760         rid of a use of the info gathered during the test insertion.
3761
3762 2006-04-17  Adele Peterson  <adele@apple.com>
3763
3764         Reviewed by Darin.
3765
3766         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8407
3767         REGRESSION (NativeTextField): Leading and trailing spaces trimmed from text field value attribute
3768
3769         Test: fast/forms/input-spaces.html
3770
3771         * rendering/RenderTextField.cpp: (WebCore::RenderTextField::createDivStyle): 
3772         Use white-space:pre for the inner div to avoid collapsing spaces in the text field.
3773
3774 2006-04-18  Mitz Pettel  <opendarwin.org@mitzpettel.com>
3775
3776         Reviewed by Darin.
3777
3778         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8437
3779           iExploder(#293): Crash in StringImpl::hash()
3780
3781         * manual-tests/applet-param-no-name.html: Added.
3782         * rendering/RenderApplet.cpp:
3783         (WebCore::RenderApplet::createWidgetIfNecessary): Skip param elements with
3784         empty name.
3785
3786 2006-04-18  Darin Adler  <darin@apple.com>
3787
3788         - try to fix the Windows build
3789
3790         * platform/cairo/GraphicsContextCairo.cpp: (WebCore::setColor):
3791         Update for changes to getRGBA.
3792
3793 2006-04-17  Alexey Proskuryakov  <ap@nypop.com>
3794
3795         Reviewed by Darin.
3796
3797         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8440
3798         iExploder(#3327): Crash in StringImpl::initWithQChar()
3799
3800         Test: fast/parser/number-sign-in-map-name.html
3801
3802         * html/html_imageimpl.cpp:
3803         (WebCore::HTMLMapElement::parseMappedAttribute): Fixed handling of names starting with a '#'.
3804
3805 2006-04-17  Adele Peterson  <adele@apple.com>
3806
3807         Reviewed by Darin.
3808
3809         Fix for: http://bugzilla.opendarwin.org/show_bug.cgi?id=8269
3810         REGRESSION: disabled text field does not display greyed-out text
3811
3812         * rendering/RenderTextField.cpp: (WebCore::RenderTextField::createDivStyle): 
3813         For disabled text fields, lighten or darken text color based on background color.
3814         Tries to get as close as possible to logic in AppKit for old text fields.
3815         * platform/Color.h: Removed hsv and setHsv since they were just used within Color.cpp.
3816         * platform/Color.cpp:
3817         (WebCore::parseHexColor): Cleanup.
3818         (WebCore::differenceSquared): Added. Returns the difference squared of two colors.
3819         (WebCore::convertRGBToHSV): Added static function. Replaces hsv and setHSV, and fixes bug in old implementation of the algorithm.
3820         (WebCore::convertHSVToRGB): ditto.
3821         (WebCore::Color::light): No longer takes in a factor, since all callers use the same factor.  Uses new conversion functions.
3822         (WebCore::Color::dark): ditto.
3823         * rendering/InlineTextBox.cpp: Removed simpleDifferenceBetweenColors.
3824         (WebCore::correctedTextColor):  Uses differenceSquared instead of simpleDifferenceBetweenColors.
3825
3826 2006-04-17  David Hyatt  <hyatt@apple.com>
3827
3828         Fix for bug 8270, text highlights outside of textfield when it shouldn't.
3829
3830         Reviewed by darin
3831
3832         Added fast/forms/input-double-click-selection-gap-bug.html
3833
3834         * rendering/RenderBlock.cpp:
3835         (WebCore::RenderBlock::fillInlineSelectionGaps):
3836
3837 2006-04-17  David Hyatt  <hyatt@apple.com>
3838
3839         Fix for bug 8848, caret off by 1 pixel on numerous pixel tests.
3840
3841         Reviewed by darin
3842
3843         * rendering/InlineTextBox.cpp:
3844         (WebCore::InlineTextBox::positionForOffset):
3845         * rendering/RenderText.cpp:
3846         (WebCore::RenderText::caretRect):
3847
3848 2006-04-17  Timothy Hatcher  <timothy@apple.com>
3849
3850         Reviewed by Darin.
3851
3852         <rdar://problem/4506601> TOT WebCore fails to build ppc64
3853
3854         Switch many CG calls to use CGFloat for colors and gradients
3855
3856         * bindings/objc/DOMCSS.mm:
3857         (-[DOMRGBColor dealloc]): cast _internal to uintptr_t
3858         (-[DOMRGBColor finalize]): cast _internal to uintptr_t
3859         (-[DOMRGBColor red]): cast _internal to uintptr_t
3860         (-[DOMRGBColor green]): cast _internal to uintptr_t
3861         (-[DOMRGBColor blue]): cast _internal to uintptr_t
3862         (-[DOMRGBColor alpha]): cast _internal to uintptr_t
3863         (-[DOMRGBColor _color]): cast _internal to uintptr_t
3864         * bridge/mac/FrameMac.mm:
3865         (WebCore::regExpForLabels): use CFIndex as the type returned from indexOfObject:
3866         * bridge/mac/WebCoreFrameBridge.mm:
3867         (-[WebCoreFrameBridge baseWritingDirectionForSelectionStart]): workaround for <rdar://problem/4509035>
3868         * config.h: define CGFloat if it isn't defined already
3869         * html/CanvasGradient.cpp:
3870         (WebCore::CanvasGradient::addColorStop):
3871         (WebCore::gradientCallback):
3872         (WebCore::CanvasGradient::platformShading):
3873         * html/CanvasRenderingContext2D.cpp:
3874         (WebCore::CanvasRenderingContext2D::setShadow):
3875         (WebCore::CanvasRenderingContext2D::applyShadow):
3876         (WebCore::CanvasRenderingContext2D::applyStrokePattern):
3877         (WebCore::CanvasRenderingContext2D::applyFillPattern):
3878         * html/CanvasStyle.cpp:
3879         (WebCore::CanvasStyle::applyStrokeColor):
3880         (WebCore::CanvasStyle::applyFillColor):
3881         * kcanvas/device/quartz/KCanvasFilterQuartz.mm:
3882         (WebCore::alphaImageForImage):
3883         (WebCore::KCanvasFEColorMatrixQuartz::getCIFilter):
3884         * kcanvas/device/quartz/KCanvasMaskerQuartz.mm:
3885         (WebCore::applyLuminanceToAlphaFilter):
3886         (WebCore::applyExpandAlphatoGrayscaleFilter):
3887         (WebCore::transformImageIntoGrayscaleMask):
3888         * kcanvas/device/quartz/KCanvasPathQuartz.mm:
3889         (WebCore::scratchContext):
3890         * kcanvas/device/quartz/KRenderingPaintServerGradientQuartz.mm:
3891         (WebCore::cgGradientCallback):
3892         (WebCore::CGShadingRefForLinearGradient):
3893         (WebCore::CGShadingRefForRadialGradient):
3894         (WebCore::KRenderingPaintServerGradientQuartz::updateQuartzGradientStopsCache):
3895         * kcanvas/device/quartz/KRenderingPaintServerQuartz.h:
3896         (WebCore::):
3897         * kcanvas/device/quartz/KRenderingPaintServerQuartz.mm:
3898         (WebCore::KRenderingPaintServerPatternQuartz::setup):
3899         * kcanvas/device/quartz/QuartzSupport.mm:
3900         (WebCore::applyStrokeStyleToContext):
3901         * kwq/WebCoreAXObject.mm:
3902         (CreateCGColorIfDifferent):
3903         * platform/Color.cpp:
3904         (WebCore::Color::getRGBA): new name, was getRgbaF. getRGBA uses float and has a double overload
3905         * platform/Color.h:
3906         * platform/mac/ClipboardMac.h: no need to define NSDragOperation
3907         * platform/mac/ColorMac.mm:
3908         (+[WebCoreControlTintObserver WebCore]):
3909         * platform/mac/GraphicsContextMac.mm:
3910         (WebCore::GraphicsContext::drawLine):
3911         * platform/mac/ImageMac.mm:
3912         (WebCore::Image::checkForSolidColor):
3913         (WebCore::Image::tileInRect):
3914         (WebCore::Image::scaleAndTileInRect):
3915         * platform/mac/TextEncodingMac.cpp:
3916         (WebCore::TextEncoding::fromUnicode):
3917
3918 2006-04-17  Justin Garcia  <justin.garcia@apple.com>
3919
3920         Reviewed by darin
3921         
3922         <http://bugzilla.opendarwin.org/show_bug.cgi?id=8402>
3923         Fix interchange newline handling and avoid use of test rendering info
3924
3925         * editing/ReplaceSelectionCommand.cpp:
3926         (WebCore::ReplaceSelectionCommand::doApply):
3927         Fixed bugs in handling of interchange newlines at the end of incoming 
3928         fragments.  Removed the use of !fragment.isBlockFlow since it isn't 
3929         correct and relies on information gathered during the test insertion, which 
3930         we're trying to get rid of. 
3931         * editing/VisiblePosition.h:
3932         (WebCore::VisiblePosition::rootEditableElement): Added for convenience.
3933
3934 2006-04-16  Mitz Pettel  <opendarwin.org@mitzpettel.com>
3935
3936         Reviewed by Darin.
3937
3938         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8408
3939           Paint the highlight behind selected list markers
3940
3941         Test: fast/lists/markers-in-selection.html
3942
3943         * rendering/RenderObject.h: Added selectionColorImageOverlayAlpha constant -
3944         the maximum opacity of the selection color when painted over images.
3945         * rendering/render_list.cpp:
3946         (WebCore::RenderListMarker::RenderListMarker):
3947         (WebCore::RenderListMarker::paint): Paint the selection highlight
3948         if selected: over the marker for image markers, under the marker for all other
3949         markers.
3950         (WebCore::RenderListMarker::setSelectionState): Added.
3951         (WebCore::RenderListMarker::selectionRect): Added.
3952         (WebCore::RenderListMarker::selectionColor): Added. Ensures that the selection
3953         color is transparent for image markers.
3954         * rendering/render_list.h:
3955         (WebCore::RenderListMarker::selectionState):
3956         (WebCore::RenderListMarker::canBeSelectionLeaf):
3957         * rendering/render_replaced.cpp
3958         (WebCore::RenderReplaced::selectionColor): Changed to use the selectionColorImageOverlayAlpha
3959         constant.
3960
3961 2006-04-16  Mitz Pettel  <opendarwin.org@mitzpettel.com>
3962
3963         Reviewed by Darin.
3964
3965         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8420
3966           iExploder(#12): Assertion failure in RenderContainer::removeChildNode
3967
3968         Test: fast/forms/button-inner-block-reuse.html
3969
3970         Buttons have a distinguished anonymous child that holds all their other
3971         descendants. Descendants ended up in a sibling anonymous block as the
3972         initial anonymous child was being reused to hold the initial part of an
3973         inline that got split.
3974
3975         * rendering/RenderInline.cpp:
3976         (WebCore::RenderInline::splitFlow): Check if the anonymous block's parent
3977         allows us to reuse it.
3978         * rendering/RenderObject.h:
3979         (WebCore::RenderObject::allowsReusingAnonymousChild): Added. Returns true.
3980         * rendering/render_button.h:
3981         (WebCore::RenderButton::allowsReusingAnonymousChild): Added. Returns false.
3982
3983 2006-04-16  Mitz Pettel  <opendarwin.org@mitzpettel.com>
3984
3985         Reviewed by Justin.
3986
3987         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8394
3988           Editable region does not accept dropped text if there is no selection
3989
3990         Test: editing/pasteboard/drop-text-without-selection.html
3991
3992         * bridge/mac/WebCoreFrameBridge.mm:
3993         (-[WebCoreFrameBridge documentFragmentWithText:]): Changed to allow
3994         creating a fragment regardless of the selection.
3995
3996 2006-04-16  Mitz Pettel  <opendarwin.org@mitzpettel.com>
3997
3998         Reviewed by Darin.
3999
4000         - WebCore part of fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8324
4001           REGRESSION: textarea :focus not applied immediately
4002
4003         * bridge/mac/WebCoreFrameBridge.h:
4004         * kwq/KWQComboBox.mm:
4005         (-[KWQPopUpButton becomeFirstResponder]): Added call to formControlIsBecomingFirstResponder:.
4006         (-[KWQPopUpButton resignFirstResponder]): Cleaned up.
4007         * kwq/KWQListBox.mm: Ditto.
4008         (-[KWQTableView becomeFirstResponder]):
4009         (-[KWQTableView resignFirstResponder]):
4010         * kwq/KWQSlider.mm:
4011         (-[KWQSlider becomeFirstResponder]): Added call to formControlIsBecomingFirstResponder: and
4012         cleaned up.
4013         (-[KWQSlider resignFirstResponder]): Cleaned up.
4014         * platform/mac/WebCoreTextArea.mm:
4015         (-[WebCoreTextView becomeFirstResponder]): Added call to formControlIsBecomingFirstResponder:.
4016         (-[WebCoreTextView resignFirstResponder]): Cleaned up.
4017         * platform/mac/WebCoreTextField.mm:
4018         (-[KWQTextFieldController setHasFocus:]): Added call to formControlIsBecomingFirstResponder:.
4019         * manual-tests/textarea-focus.html: Added.
4020
4021 2006-04-16  Darin Adler  <darin@apple.com>
4022
4023         Reviewed by Adele and Justin.
4024
4025         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8298
4026           REGRESSION: Crash occurs when attempting to drag selection into
4027           Depart/Return input fields at http://www.travelocity.com/
4028         - remove the mutation event listener that's installed all the time,
4029           since it slows things down a bit
4030
4031         Calling SelectionController::nodeWillBeRemoved from Document::notifyBeforeNodeRemoval
4032         fixes the crash, which was happening because the call that was removing the text
4033         node, removeChildren, does not send a "node removed" mutation event (it sends a
4034         "subtree modified" mutation event instead). So this change alone fixes the crash.
4035
4036         But I also changed setInnerText to not blow away the text node each time the value
4037         is changed, and that makes the test case behave even better -- you don't even lose
4038         the selection; it works as it did with the NSTextField-based text field.
4039
4040         * manual-tests/input-empty-on-focus.html: Added.
4041
4042         * page/Frame.h: Tweaked a few comments and functions related to selection.
4043         * page/Frame.cpp: (WebCore::Frame::dragCaret): Made non-const.
4044
4045         * dom/Document.cpp: (WebCore::Document::notifyBeforeNodeRemoval):
4046         Call nodeWillBeRemoved on the two selection controllers before removing
4047         a node from the document.
4048
4049         * editing/SelectionController.h: Tweak formatting. Remove MutationListener
4050         class and m_mutationListener field.
4051         * editing/SelectionController.cpp:
4052         (WebCore::SelectionController::SelectionController): Remove code to set up
4053         the mutation event listener.
4054         (WebCore::SelectionController::setSelection): Remove code to maintain the
4055         mutation event listener.
4056
4057         * html/HTMLElement.cpp:
4058         (WebCore::HTMLElement::setInnerHTML): In cases where the container has only a
4059         single child use replaceChild, and in cases where the HTML being inserted
4060         also has only a single child and both are text nodes use setData. It's common
4061         to use setInnerHTML to set something that's just text.
4062         (WebCore::HTMLElement::setInnerText): Same as above, but simpler since the
4063         thing we're replacing with is always text.
4064
4065 2006-04-16  Kevin Ollivier  <kevino@theolliviers.com>
4066
4067         Reviewed by Darin.
4068
4069         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8417
4070           make-css-file-arrays.pl hangs when run on Linux
4071
4072         * css/make-css-file-arrays.pl: Remove the "-" parameter from the invocation of cpp,
4073         which means "send output to stdout". It's optional on Mac OS X, and is causing a
4074         hang on Linux.
4075         * rendering/RenderArena.cpp: Added a missing include of <assert.h>.
4076
4077 2006-04-15  Darin Adler  <darin@apple.com>
4078
4079         - removed references to a couple files that are obsolete
4080           but were still in the Windows project file
4081
4082         * WebCore.vcproj/WebCore/WebCore.vcproj: Remove kjs_views.h and .cpp.
4083
4084 2006-04-15  Mitz Pettel &