1 2006-05-09 Alexey Proskuryakov <ap@nypop.com>
5 - http://bugzilla.opendarwin.org/show_bug.cgi?id=8769
6 TextEncoding::fromUnicode() - support non-BMP characters and convert to NFC
8 Fix the ICU code path, too (currently unused on the Mac).
10 * platform/TextEncoding.cpp:
11 (WebCore::TextEncoding::fromUnicode): Normalize the string.
13 2006-05-08 Maciej Stachowiak <mjs@apple.com>
15 Reviewed by Tim Hatcher.
17 - refactor things so that WebKit doesn't save a WebResource for every loaded URL,
18 but rather retrieves the data from the WebCore cache as needed.
19 http://bugzilla.opendarwin.org/show_bug.cgi?id=8802
21 * bridge/mac/WebCoreFrameBridge.h:
22 * bridge/mac/WebCoreFrameBridge.mm:
23 (-[WebCoreFrameBridge getData:andResponse:forURL:]):
24 (-[WebCoreFrameBridge getAllResourceDatas:andResponses:]):
26 (WebCore::Cache::updateCacheStatus):
27 (WebCore::Cache::requestImage):
28 (WebCore::Cache::requestStyleSheet):
29 (WebCore::Cache::requestScript):
30 (WebCore::Cache::requestXSLStyleSheet):
31 (WebCore::Cache::requestXBLDocument):
33 * loader/CachedResource.cpp: Added.
34 * loader/CachedResource.h: Added.
35 * loader/CachedResourceClient.h: Added.
36 * loader/CachedResourceClientWalker.cpp: Added.
37 * loader/CachedResourceClientWalker.h: Added.
38 * loader/DocLoader.cpp:
39 (WebCore::DocLoader::setAutoloadImages):
40 (WebCore::DocLoader::removeCachedObject):
42 (WebCore::DocLoader::cachedObject):
43 (WebCore::DocLoader::allCachedObjects):
45 2006-05-08 Levi Weintraub <lweintraub@apple.com>
49 * editing/TextIterator.cpp:
50 (WebCore::shouldEmitSpaceBeforeAndAfterNode):
51 Returns true when the node should have a leading and trailing space. Currently only
52 used for inline tables. The function shouldEmitNewlinesBeforeAndAfterNode has a
53 fallback for nodes with no RenderObject, but the inline property doesn't really
54 have a meaning without one.
55 (WebCore::TextIterator::handleNonTextNode):
56 Checks shouldEmitSpaceBeforeAndAfterNode and inserts a space if necessary.
57 (WebCore::TextIterator::exitNode):
58 Checks shouldEmitSpaceBeforeAndAfterNode and inserts a space if necessary.
60 2006-05-08 Anders Carlsson <acarlsson@apple.com>
62 Try fixing the Win32 build
64 * WebCore.vcproj/WebCore/WebCore.vcproj:
65 Add XPath files to project.
67 2006-05-08 Anders Carlsson <acarlsson@apple.com>
69 Reviewed by Darin, Eric and Maciej.
71 http://bugzilla.opendarwin.org/show_bug.cgi?id=6638
72 Support Mozilla's XPathEvaluator object.
74 * DerivedSources.make:
75 Generate XPath grammar, and JavaScript wrappers.
77 * WebCore.xcodeproj/project.pbxproj:
78 Add new files to project
80 * bindings/js/kjs_binding.cpp:
82 (KJS::setDOMException):
83 Handle setting XPath exceptions.
85 * bindings/objc/DOM.mm:
86 Just return nil for now when trying to create a wrapper for
87 XPath namespace nodes.
89 * bindings/scripts/CodeGeneratorJS.pm:
90 Add XPath types. Also add a "CanBeConstructed" extended attribute
91 for interfaces that can be constructed directly.
93 * bridge/mac/WebCorePageBridge.mm:
94 (initializeLoggingChannelsIfNecessary):
95 Initialize LogXPath channel.
97 * dom/DOMImplementation.cpp:
98 (WebCore::DOMImplementation::hasFeature):
99 Support "xpath" version "3.0".
102 (WebCore::Document::Document):
104 (WebCore::Document::importNode):
105 Ignore XPath namespace nodes.
107 (WebCore::Document::createExpression):
108 (WebCore::Document::createNSResolver):
109 (WebCore::Document::evaluate):
110 New functions which call down to a lazily created XPathEvaluator.
113 Add function declarations.
120 Add XPATH_NAMESPACE_NODE type.
122 * editing/markup.cpp:
123 (WebCore::startMarkup):
124 Ignore XPath namespace nodes.
126 * page/DOMWindow.idl:
127 Add constructors for XPathEvaluator and XPathResult.
129 * platform/Logging.cpp:
130 * platform/Logging.h:
131 Add XPath log channel
134 * xpath/XPathEvaluator.cpp: Added.
135 (WebCore::XPathEvaluator::createExpression):
136 (WebCore::XPathEvaluator::createNSResolver):
137 (WebCore::XPathEvaluator::evaluate):
138 * xpath/XPathEvaluator.h: Added.
140 * xpath/XPathEvaluator.idl: Added.
141 * xpath/XPathExpression.cpp: Added.
142 (WebCore::XPathExpression::createExpression):
143 (WebCore::XPathExpression::~XPathExpression):
144 (WebCore::XPathExpression::evaluate):
145 * xpath/XPathExpression.h: Added.
146 * xpath/XPathExpression.idl: Added.
147 * xpath/XPathNSResolver.cpp: Added.
148 (WebCore::XPathNSResolver::XPathNSResolver):
149 (WebCore::XPathNSResolver::lookupNamespaceURI):
150 * xpath/XPathNSResolver.h: Added.
151 * xpath/XPathNSResolver.idl: Added.
152 * xpath/XPathNamespace.cpp: Added.
153 (WebCore::XPathNamespace::XPathNamespace):
154 (WebCore::XPathNamespace::~XPathNamespace):
155 (WebCore::XPathNamespace::ownerDocument):
156 (WebCore::XPathNamespace::ownerElement):
157 (WebCore::XPathNamespace::prefix):
158 (WebCore::XPathNamespace::nodeName):
159 (WebCore::XPathNamespace::nodeValue):
160 (WebCore::XPathNamespace::namespaceURI):
161 (WebCore::XPathNamespace::nodeType):
162 * xpath/XPathNamespace.h: Added.
163 * xpath/XPathResult.cpp: Added.
164 (WebCore::InvalidatingEventListener::InvalidatingEventListener):
165 (WebCore::InvalidatingEventListener::handleEvent):
166 (WebCore::XPathResult::XPathResult):
167 (WebCore::XPathResult::~XPathResult):
168 (WebCore::XPathResult::convertTo):
169 (WebCore::XPathResult::resultType):
170 (WebCore::XPathResult::numberValue):
171 (WebCore::XPathResult::stringValue):
172 (WebCore::XPathResult::booleanValue):
173 (WebCore::XPathResult::singleNodeValue):
174 (WebCore::XPathResult::invalidateIteratorState):
175 (WebCore::XPathResult::invalidIteratorState):
176 (WebCore::XPathResult::snapshotLength):
177 (WebCore::XPathResult::iterateNext):
178 (WebCore::XPathResult::snapshotItem):
179 * xpath/XPathResult.h: Added.
180 (WebCore::XPathResult::):
181 * xpath/XPathResult.idl: Added.
183 * xpath/impl/XPathExpressionNode.cpp: Added.
184 (WebCore::XPath::Expression::evaluationContext):
185 (WebCore::XPath::Expression::Expression):
186 (WebCore::XPath::Expression::~Expression):
187 (WebCore::XPath::Expression::evaluate):
188 (WebCore::XPath::Expression::addSubExpression):
189 (WebCore::XPath::Expression::optimize):
190 (WebCore::XPath::Expression::subExprCount):
191 (WebCore::XPath::Expression::subExpr):
192 (WebCore::XPath::Expression::isConstant):
193 * xpath/impl/XPathExpressionNode.h: Added.
194 (WebCore::XPath::EvaluationContext::EvaluationContext):
195 * xpath/impl/XPathFunctions.cpp: Added.
196 (WebCore::XPath::Interval::Interval):
197 (WebCore::XPath::Interval::contains):
198 (WebCore::XPath::Interval::asString):
199 (WebCore::XPath::Function::setArguments):
200 (WebCore::XPath::Function::setName):
201 (WebCore::XPath::Function::arg):
202 (WebCore::XPath::Function::argCount):
203 (WebCore::XPath::Function::name):
204 (WebCore::XPath::FunLast::doEvaluate):
205 (WebCore::XPath::FunLast::isConstant):
206 (WebCore::XPath::FunPosition::doEvaluate):
207 (WebCore::XPath::FunPosition::isConstant):
208 (WebCore::XPath::FunLocalName::isConstant):
209 (WebCore::XPath::FunLocalName::doEvaluate):
210 (WebCore::XPath::FunNamespaceURI::isConstant):
211 (WebCore::XPath::FunNamespaceURI::doEvaluate):
212 (WebCore::XPath::FunName::isConstant):
213 (WebCore::XPath::FunName::doEvaluate):
214 (WebCore::XPath::FunCount::doEvaluate):
215 (WebCore::XPath::FunCount::isConstant):
216 (WebCore::XPath::FunString::doEvaluate):
217 (WebCore::XPath::FunConcat::doEvaluate):
218 (WebCore::XPath::FunStartsWith::doEvaluate):
219 (WebCore::XPath::FunContains::doEvaluate):
220 (WebCore::XPath::FunSubstringBefore::doEvaluate):
221 (WebCore::XPath::FunSubstringAfter::doEvaluate):
222 (WebCore::XPath::FunSubstring::doEvaluate):
223 (WebCore::XPath::FunStringLength::doEvaluate):
224 (WebCore::XPath::FunNormalizeSpace::doEvaluate):
225 (WebCore::XPath::FunTranslate::doEvaluate):
226 (WebCore::XPath::FunBoolean::doEvaluate):
227 (WebCore::XPath::FunNot::doEvaluate):
228 (WebCore::XPath::FunTrue::doEvaluate):
229 (WebCore::XPath::FunTrue::isConstant):
230 (WebCore::XPath::FunLang::doEvaluate):
231 (WebCore::XPath::FunLang::isConstant):
232 (WebCore::XPath::FunFalse::doEvaluate):
233 (WebCore::XPath::FunFalse::isConstant):
234 (WebCore::XPath::FunNumber::doEvaluate):
235 (WebCore::XPath::FunSum::doEvaluate):
236 (WebCore::XPath::FunFloor::doEvaluate):
237 (WebCore::XPath::FunCeiling::doEvaluate):
238 (WebCore::XPath::FunRound::doEvaluate):
239 (WebCore::XPath::FunctionLibrary::self):
240 (WebCore::XPath::FunctionLibrary::FunctionLibrary):
241 (WebCore::XPath::FunctionLibrary::createFunction):
242 * xpath/impl/XPathFunctions.h: Added.
243 * xpath/impl/XPathGrammar.y: Added.
244 * xpath/impl/XPathParser.cpp: Added.
246 (WebCore::XPath::Parser::charCat):
247 (WebCore::XPath::Parser::isAxisName):
248 (WebCore::XPath::Parser::isNodeTypeName):
249 (WebCore::XPath::Parser::isOperatorContext):
250 (WebCore::XPath::Parser::skipWS):
251 (WebCore::XPath::Parser::makeTokenAndAdvance):
252 (WebCore::XPath::Parser::makeIntTokenAndAdvance):
253 (WebCore::XPath::Parser::peekAheadHelper):
254 (WebCore::XPath::Parser::peekCurHelper):
255 (WebCore::XPath::Parser::lexString):
256 (WebCore::XPath::Parser::lexNumber):
257 (WebCore::XPath::Parser::lexNCName):
258 (WebCore::XPath::Parser::lexQName):
259 (WebCore::XPath::Parser::nextTokenInternal):
260 (WebCore::XPath::Parser::nextToken):
261 (WebCore::XPath::Parser::Parser):
262 (WebCore::XPath::Parser::reset):
263 (WebCore::XPath::Parser::lex):
264 (WebCore::XPath::Parser::parseStatement):
265 (WebCore::XPath::Parser::registerParseNode):
266 (WebCore::XPath::Parser::unregisterParseNode):
267 (WebCore::XPath::Parser::registerPredicateVector):
268 (WebCore::XPath::Parser::unregisterPredicateVector):
269 (WebCore::XPath::Parser::registerExpressionVector):
270 (WebCore::XPath::Parser::unregisterExpressionVector):
271 (WebCore::XPath::Parser::registerString):
272 (WebCore::XPath::Parser::unregisterString):
273 * xpath/impl/XPathParser.h: Added.
274 (WebCore::XPath::Token::Token):
275 (WebCore::XPath::Parser::):
276 (WebCore::XPath::Parser::current):
277 * xpath/impl/XPathPath.cpp: Added.
278 (WebCore::XPath::Filter::Filter):
279 (WebCore::XPath::Filter::~Filter):
280 (WebCore::XPath::Filter::doEvaluate):
281 (WebCore::XPath::LocationPath::LocationPath):
282 (WebCore::XPath::LocationPath::~LocationPath):
283 (WebCore::XPath::LocationPath::optimize):
284 (WebCore::XPath::LocationPath::doEvaluate):
285 (WebCore::XPath::Path::Path):
286 (WebCore::XPath::Path::~Path):
287 (WebCore::XPath::Path::doEvaluate):
288 * xpath/impl/XPathPath.h: Added.
289 * xpath/impl/XPathPredicate.cpp: Added.
290 (WebCore::XPath::Number::Number):
291 (WebCore::XPath::Number::isConstant):
292 (WebCore::XPath::Number::doEvaluate):
293 (WebCore::XPath::StringExpression::StringExpression):
294 (WebCore::XPath::StringExpression::isConstant):
295 (WebCore::XPath::StringExpression::doEvaluate):
296 (WebCore::XPath::Negative::doEvaluate):
297 (WebCore::XPath::NumericOp::NumericOp):
298 (WebCore::XPath::NumericOp::doEvaluate):
299 (WebCore::XPath::EqTestOp::EqTestOp):
300 (WebCore::XPath::EqTestOp::doEvaluate):
301 (WebCore::XPath::LogicalOp::LogicalOp):
302 (WebCore::XPath::LogicalOp::shortCircuitOn):
303 (WebCore::XPath::LogicalOp::isConstant):
304 (WebCore::XPath::LogicalOp::doEvaluate):
305 (WebCore::XPath::Union::doEvaluate):
306 (WebCore::XPath::Predicate::Predicate):
307 (WebCore::XPath::Predicate::~Predicate):
308 (WebCore::XPath::Predicate::evaluate):
309 (WebCore::XPath::Predicate::optimize):
310 * xpath/impl/XPathPredicate.h: Added.
311 (WebCore::XPath::NumericOp::):
312 (WebCore::XPath::EqTestOp::):
313 (WebCore::XPath::LogicalOp::):
314 * xpath/impl/XPathStep.cpp: Added.
315 (WebCore::XPath::Step::axisAsString):
316 (WebCore::XPath::Step::Step):
317 (WebCore::XPath::Step::~Step):
318 (WebCore::XPath::Step::evaluate):
319 (WebCore::XPath::Step::nodesInAxis):
320 (WebCore::XPath::Step::nodeTestMatches):
321 (WebCore::XPath::Step::optimize):
322 (WebCore::XPath::Step::namespaceFromNodetest):
323 (WebCore::XPath::Step::primaryNodeType):
324 * xpath/impl/XPathStep.h: Added.
325 (WebCore::XPath::Step::):
326 * xpath/impl/XPathUtil.cpp: Added.
327 (WebCore::XPath::isRootDomNode):
328 (WebCore::XPath::stringValue):
329 (WebCore::XPath::isValidContextNode):
330 * xpath/impl/XPathUtil.h: Added.
331 * xpath/impl/XPathValue.cpp: Added.
332 (WebCore::XPath::Value::Value):
333 (WebCore::XPath::Value::type):
334 (WebCore::XPath::Value::isNodeVector):
335 (WebCore::XPath::Value::isBoolean):
336 (WebCore::XPath::Value::isNumber):
337 (WebCore::XPath::Value::isString):
338 (WebCore::XPath::Value::toNodeVector):
339 (WebCore::XPath::Value::toBoolean):
340 (WebCore::XPath::Value::toNumber):
341 (WebCore::XPath::Value::toString):
342 * xpath/impl/XPathValue.h: Added.
343 (WebCore::XPath::Value::):
344 * xpath/impl/XPathVariableReference.cpp: Added.
345 (WebCore::XPath::VariableReference::VariableReference):
346 (WebCore::XPath::VariableReference::isConstant):
347 (WebCore::XPath::VariableReference::doEvaluate):
348 * xpath/impl/XPathVariableReference.h: Added.
350 2006-05-08 David Hyatt <hyatt@apple.com>
352 Comprehensive box-sizing fix. This patch changes all form controls to
353 have the right box-sizing values (text fields and text areas actually only
354 use border-box in quirks mode now, and image buttons never use border-box).
356 Tables are supposed to use border-box box-sizing as well, but that's a scary
357 enough change that I'm saving it for a separate patch.
364 2006-05-06 Darin Adler <darin@apple.com>
366 Suggested by Mitz. Reviewed and landed by Maciej.
368 * dom/Document.cpp: (WebCore::Document::formElementsState): Fixed mistake where the
369 vector has an initial size and instead should have an initial capacity. Harmless in
370 a way, but hurts performance.
372 2006-05-07 David Hyatt <hyatt@apple.com>
374 Fix for bugzilla bug 8060.
376 Fixed width table cells weren't having their border widths
377 included in the effective width of the column (and thus could end up being
382 Added fast/tables/fixed-cell-growth.html
384 * rendering/table_layout.cpp:
385 (WebCore::AutoTableLayout::recalcColumn):
387 2006-05-07 Alexey Proskuryakov <ap@nypop.com>
391 - http://bugzilla.opendarwin.org/show_bug.cgi?id=8769
392 TextEncoding::fromUnicode() - support non-BMP characters and convert to NFC
395 * fast/forms/form-data-encoding.html
396 * fast/forms/form-data-encoding-2.html
398 * platform/mac/TextEncodingMac.cpp:
399 (WebCore::TextEncoding::fromUnicode): Normalize the string; handle surrogate pairs.
401 2006-05-06 David Hyatt <hyatt@apple.com>
403 Rename WebCoreFont to FontPlatformData and WebTextRenderer to FontData. Merge them into the
404 headers (uncleanly with ifdefs at the moment, so I can see what I'm working towards).
409 * WebCore.vcproj/WebCore/WebCore.vcproj:
410 * WebCore.xcodeproj/project.pbxproj:
411 * bridge/mac/WebCoreStringTruncator.mm:
414 (+[WebCoreStringTruncator widthOfString:font:]):
415 * kwq/KWQComboBox.mm:
416 (QComboBox::sizeHint):
417 * kwq/KWQLineEdit.mm:
418 (QLineEdit::sizeForCharacterWidth):
421 (groupLabelTextRenderer):
422 (QListBox::sizeForNumberOfLines):
423 (-[KWQTableView drawRow:clipRect:]):
425 (WebCore::m_wordSpacing):
426 (WebCore::Font::Font):
427 (WebCore::Font::operator=):
428 (WebCore::Font::update):
429 (WebCore::Font::ascent):
430 (WebCore::Font::descent):
431 (WebCore::Font::lineSpacing):
432 (WebCore::Font::xHeight):
433 (WebCore::Font::isFixedPitch):
435 (WebCore::Font::getNSFont):
436 * platform/FontData.h:
437 (WebCore::FontData::ascent):
438 (WebCore::FontData::descent):
439 (WebCore::FontData::lineSpacing):
440 (WebCore::FontData::lineGap):
441 (WebCore::FontData::misspellingLineThickness):
442 (WebCore::FontData::misspellingLinePatternWidth):
443 (WebCore::FontData::misspellingLinePatternGapWidth):
444 * platform/FontDataSet.h: Removed.
445 * platform/FontFallbackList.h: Added.
446 * platform/FontPlatformData.h:
447 * platform/mac/FontData.mm: Added.
448 (WebCore::WebCoreInitializeFont):
449 (WebCore::WebCoreInitializeEmptyTextGeometry):
450 (WebCore::widthForGlyph):
451 (WebCore::overrideLayoutOperation):
452 (WebCore::FontData::~FontData):
453 (WebCore::FontData::xHeight):
454 (WebCore::FontData::drawRun):
455 (WebCore::FontData::floatWidthForRun):
456 (WebCore::FontData::drawLineForCharacters):
457 (WebCore::FontData::selectionRectForRun):
458 (WebCore::FontData::drawHighlightForRun):
459 (WebCore::FontData::drawLineForMisspelling):
460 (WebCore::FontData::pointToOffset):
461 (WebCore::FontData::setAlwaysUseATSU):
462 (WebCore::getSmallCapsRenderer):
463 (WebCore::findSubstituteFont):
464 (WebCore::rendererForAlternateFont):
465 (WebCore::findSubstituteRenderer):
466 (WebCore::computeWidthForSpace):
467 (WebCore::setUpFont):
468 (WebCore::CG_drawHighlight):
469 (WebCore::CG_selectionRect):
471 (WebCore::CG_floatWidthForRun):
472 (WebCore::updateGlyphMapEntry):
473 (WebCore::extendGlyphMap):
474 (WebCore::extendWidthMap):
475 (WebCore::initializeATSUStyle):
476 (WebCore::createATSULayoutParameters):
477 (WebCore::getTextBounds):
478 (WebCore::ATSU_floatWidthForRun):
479 (WebCore::ATSU_drawHighlight):
480 (WebCore::ATSU_selectionRect):
481 (WebCore::ATSU_draw):
482 (WebCore::ATSU_pointToOffset):
483 (WebCore::advanceWidthIteratorOneCharacter):
484 (WebCore::CG_pointToOffset):
485 (WebCore::glyphForCharacter):
486 (WebCore::initializeWidthIterator):
487 (WebCore::advanceWidthIterator):
488 * platform/mac/FontMac.mm:
490 (WebCore::FontFallbackList::~FontFallbackList):
491 (WebCore::FontFallbackList::platformFont):
492 (WebCore::FontFallbackList::primaryFont):
493 (WebCore::FontFallbackList::determinePitch):
494 (WebCore::FontFallbackList::invalidate):
495 (WebCore::Font::platformFont):
496 (WebCore::Font::selectionRectForText):
497 (WebCore::Font::drawText):
498 (WebCore::Font::drawHighlightForText):
499 (WebCore::Font::drawLineForText):
500 (WebCore::Font::drawLineForMisspelling):
501 (WebCore::Font::misspellingLineThickness):
502 (WebCore::Font::floatWidth):
503 (WebCore::Font::checkSelectionPoint):
504 * platform/mac/WebCoreTextRenderer.mm:
505 (WebCoreDrawTextAtPoint):
506 (WebCoreTextFloatWidth):
507 (WebCoreSetAlwaysUseATSU):
508 * platform/mac/WebTextRenderer.h: Removed.
509 * platform/mac/WebTextRenderer.mm: Removed.
510 * platform/mac/WebTextRendererFactory.h:
511 * platform/mac/WebTextRendererFactory.mm:
512 (-[WebTextRendererFactory isFontFixedPitch:]):
513 (-[WebTextRendererFactory init]):
514 (-[WebTextRendererFactory rendererWithFont:]):
515 (-[WebTextRendererFactory fontWithFamilies:traits:size:]):
516 * platform/win/FontWin.cpp:
517 (WebCore::FontFallbackList::~FontFallbackList):
518 (WebCore::FontFallbackList::determinePitch):
519 (WebCore::FontFallbackList::invalidate):
520 (WebCore::FontFallbackList::primaryFont):
521 (WebCore::Font::floatWidth):
522 (WebCore::Font::drawText):
523 (WebCore::Font::drawHighlightForText):
524 (WebCore::Font::selectionRectForText):
525 (WebCore::Font::checkSelectionPoint):
527 2006-05-05 Darin Adler <darin@apple.com>
529 - fix the Windows build
531 * platform/win/FontWin.cpp: (WebCore::getFontData):
533 2006-05-05 Darin Adler <darin@apple.com>
535 * platform/SegmentedString.h: (WebCore::SegmentedString::advance): Oops!
536 Removed an extra ! that was causing everything to fail.
538 2006-05-05 Darin Adler <darin@apple.com>
540 Reviewed by Tim Hatcher.
542 - remove a few of the stranger features of QChar on the road to
543 eventually replacing it with an integer type (probably ICU's UChar)
545 * platform/DeprecatedString.h: Remove SpecialCharacter, byteOrderMark, null,
546 cell, row, isNull, mirrored, mirroredChar, operator char, >, >=, <, and <=
547 from QChar. Also removed the many unneeded friend declarations. Remove findArg
548 and arg from DeprecatedString.
550 * dom/Document.cpp: (WebCore::Document::parseQualifiedName): Cast the type of the
551 buffer before invoking the U16_NEXT function. Turns out this was converting each
552 QChar to a char and back to a UChar, which means it caused a bug with characters
553 that are U+0100 or greater.
555 * css/csshelper.cpp: (WebCore::parseURL):
556 * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::constrainValue):
557 * platform/StringImpl.cpp: (WebCore::StringImpl::toCoordsArray):
558 * xml/xmlhttprequest.cpp: (WebCore::getCharset):
559 Add some calls to unicode() since we don't have comparison operators any more.
561 * dom/StyledElement.cpp:
562 (WebCore::toHex): Rewrote to just take a UChar parameter.
563 (WebCore::StyledElement::addCSSColor): Call toHex on the character code.
565 * bridge/mac/WebCoreFrameBridge.mm:
566 (-[WebCoreFrameBridge smartInsertForString:replacingRange:beforeString:afterString:]):
567 * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplaceSelectionCommand::doApply):
568 * editing/TextIterator.cpp: (WebCore::TextIterator::handleTextBox):
569 * platform/SegmentedString.h:
570 (WebCore::SegmentedString::push):
571 (WebCore::SegmentedString::advance):
572 (WebCore::SegmentedString::escaped):
573 * platform/SegmentedString.cpp:
574 (WebCore::SegmentedString::length):
575 (WebCore::SegmentedString::append):
576 (WebCore::SegmentedString::prepend):
577 (WebCore::SegmentedString::toString):
578 Changed calls to isNull() to instead just use unicode() and check for 0.
580 * html/HTMLTokenizer.cpp:
581 (WebCore::HTMLTokenizer::parseEntity): Change callers that used cell and row to
582 just use unicode() instead.
583 (WebCore::HTMLTokenizer::parseTag): Ditto.
585 * loader/Decoder.cpp: (Decoder::decode): Changed code that did a type cast to
586 unsigned char to instead call unicode().
588 * platform/DeprecatedString.cpp:
589 (KWQStringData::makeAscii): Call latin1() instead of relying on the conversion operator.
590 (DeprecatedString::DeprecatedString): Call unicode() instead of relying on the conversion
591 operator (the character has been tested and is known to be ASCII).
592 (DeprecatedString::at): Use 0 instead of QChar::null.
593 (DeprecatedString::compare): Use unicode() so we can do comparison since we don't have
594 comparison operators any more.
595 (DeprecatedString::find): Call unicode() instead of relying on the conversion
596 operator (the character has been tested and is known to be ASCII).
597 (DeprecatedString::findRev): Ditto.
598 (DeprecatedString::copyLatin1): Call latin1() instead of relying on the conversion operator.
599 (DeprecatedString::lower): Call unicode() instead of relying on the conversion
600 operator (the character has been tested and is known to be ASCII).
601 (DeprecatedString::insert): Ditto.
602 (DeprecatedString::replace): Ditto.
603 (DeprecatedString::fill): Ditto.
604 (DeprecatedString::append): Ditto.
606 * html/html_inlineimpl.cpp: (WebCore::HTMLAnchorElement::defaultEventHandler):
607 Eliminate the one use of DeprecatedString::arg.
611 * kwq/KWQCString.cpp: Remove unneeded "using" directive.
613 * html/HTMLElementFactory.cpp:
614 (WebCore::htmlConstructor):
615 (WebCore::headConstructor):
616 (WebCore::bodyConstructor):
617 (WebCore::baseConstructor):
618 (WebCore::linkConstructor):
619 (WebCore::metaConstructor):
620 (WebCore::styleConstructor):
621 (WebCore::titleConstructor):
622 (WebCore::frameConstructor):
623 (WebCore::framesetConstructor):
624 (WebCore::iframeConstructor):
625 (WebCore::formConstructor):
626 (WebCore::buttonConstructor):
627 (WebCore::inputConstructor):
628 (WebCore::isindexConstructor):
629 (WebCore::fieldsetConstructor):
630 (WebCore::labelConstructor):
631 (WebCore::legendConstructor):
632 (WebCore::optgroupConstructor):
633 (WebCore::optionConstructor):
634 (WebCore::selectConstructor):
635 (WebCore::textareaConstructor):
636 (WebCore::dlConstructor):
637 (WebCore::ulConstructor):
638 (WebCore::olConstructor):
639 (WebCore::dirConstructor):
640 (WebCore::menuConstructor):
641 (WebCore::liConstructor):
642 (WebCore::blockquoteConstructor):
643 (WebCore::divConstructor):
644 (WebCore::headingConstructor):
645 (WebCore::hrConstructor):
646 (WebCore::paragraphConstructor):
647 (WebCore::preConstructor):
648 (WebCore::basefontConstructor):
649 (WebCore::fontConstructor):
650 (WebCore::modConstructor):
651 (WebCore::anchorConstructor):
652 (WebCore::imageConstructor):
653 (WebCore::mapConstructor):
654 (WebCore::areaConstructor):
655 (WebCore::canvasConstructor):
656 (WebCore::appletConstructor):
657 (WebCore::embedConstructor):
658 (WebCore::objectConstructor):
659 (WebCore::paramConstructor):
660 (WebCore::scriptConstructor):
661 (WebCore::tableConstructor):
662 (WebCore::tableCaptionConstructor):
663 (WebCore::tableColConstructor):
664 (WebCore::tableRowConstructor):
665 (WebCore::tableCellConstructor):
666 (WebCore::tableSectionConstructor):
667 (WebCore::brConstructor):
668 (WebCore::quoteConstructor):
669 (WebCore::marqueeConstructor):
670 Mark functions static, remove unused parameters, change from docPtr to doc.
672 2006-05-05 Alexey Proskuryakov <ap@nypop.com>
676 - http://bugzilla.opendarwin.org/show_bug.cgi?id=8626
677 Strict mode erroneously triggered by a broken comment
679 Test: fast/parser/broken-comments-vs-parsing-mode.html
682 (WebCore::Frame::endIfNotLoading): Call determineParseMode() if needed.
684 2006-05-05 Darin Adler <darin@apple.com>
686 - fix the Windows build (this time for sure)
688 * platform/win/TemporaryLinkStubs.cpp:
689 (GraphicsContext::translate): Added.
690 (GraphicsContext::rotate): Ditto.
691 (GraphicsContext::scale): Ditto.
693 2006-05-05 Darin Adler <darin@apple.com>
695 - fix the Windows build
697 * bridge/win/FrameWin.h: Add Element* parameter to createPlugin.
698 * platform/win/TemporaryLinkStubs.cpp: (FrameWin::createPlugin): Ditto.
700 2006-05-05 Darin Adler <darin@apple.com>
702 - get the Windows build a little closer to building again
704 * platform/cairo/GraphicsContextCairo.cpp:
705 (WebCore::GraphicsContext::drawRect): Call alpha to check if the color is transparent.
706 Call setColor directly instead of setColorFromPen.
707 (WebCore::GraphicsContext::drawLine): Ditto.
708 (WebCore::GraphicsContext::drawEllipse): Ditto.
709 (WebCore::GraphicsContext::drawArc): Ditto.
710 (WebCore::GraphicsContext::drawConvexPolygon): Ditto.
711 * platform/win/TemporaryLinkStubs.cpp: (JavaAppletWidget::JavaAppletWidget): Updated parameter types.
713 2006-05-05 Darin Adler <darin@apple.com>
717 - fixed data structure used to save/restore form element state to remove the
718 O(n^2) algorithm and remove anomalies in how it works
719 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8683
720 REGRESSION: imdb search button has "Submit" overload after going back
722 * manual-tests/form-value-restore.html: Added.
724 * bridge/mac/WebCoreFrameBridge.mm:
725 (-[WebCoreFrameBridge saveDocumentState]): Rewrote to call the new formElementsState
726 function on the document and also to convert null strings to NSNull instead of empty
728 (-[WebCoreFrameBridge restoreDocumentState]): Ditto, with the setStateForNewFormElements
731 * dom/Document.h: Added FormElementKey, FormElementKeyHash, and FormElementKeyHashTraits
732 for use in the hash map. Made readyState, inputEncoding, defaultCharset, charset,
733 characterSet, getElementByAccessKey, haveStylesheetsLoaded, usesDescendantRules,
734 usesSiblingRules, inCompatMode, inAlmostStrictMode, inStrictMode, preferredStylesheetSet,
735 selectedStylesheetSet, and getCSSTarget all const member functions. Removed the unused
736 nextState function. Renamed registerMaintainsState and deregisterMaintainsState to
737 registerFormElementWithState and HTMLGenericFormElement and changed them to use form
738 elements rather than arbitrary DOM nodes. Replaced docState with formElementsState and
739 setRestoreState and restoreState with setStateForNewFormElements, hasStateForNewFormElements,
740 and takeStateForFormElement. Replaced m_maintainsState with m_formElementsWithState,
741 m_state with m_stateForNewFormElements. Made m_elementsByAccessKey and m_accessKeyMapValid
742 mutable. Removed unused m_elementNames, m_elementNameAlloc, m_elementNameCount, m_attrNames,
743 m_attrNameAlloc, m_attrNameCount, m_namespaceURIs, m_namespaceURIAlloc, m_namespaceURICount.
746 (WebCore::Document::Document): Remove initialization of long-obsolete m_elementNames and
748 (WebCore::Document::~Document): Remove destruction of same.
749 (WebCore::Document::readyState): Made const.
750 (WebCore::Document::inputEncoding): Ditto.
751 (WebCore::Document::defaultCharset): Ditto.
752 (WebCore::Document::getElementByAccessKey): Ditto.
753 (WebCore::Document::preferredStylesheetSet): Ditto.
754 (WebCore::Document::selectedStylesheetSet): Ditto.
755 (WebCore::Document::getCSSTarget): Ditto.
756 (WebCore::Document::formElementsState): Added. Replaces the old docState function.
757 Builds a vector of strings, with 3 strings for each form element containing the
758 name, type, and state value.
759 (WebCore::Document::setStateForNewFormElements): Added. Converts the state vector
760 into a hash map, considering the scheme with 3 strings for form element used above.
761 (WebCore::Document::hasStateForNewFormElements): Added.
762 (WebCore::Document::takeStateForFormElement): Added. Given a name and type, looks
763 up the values in the hash map and "peels off" the last one.
764 (WebCore::FormElementKey::FormElementKey): Added.
765 (WebCore::FormElementKey::~FormElementKey): Added.
766 (WebCore::FormElementKey::operator=): Added.
767 (WebCore::FormElementKey::ref): Added.
768 (WebCore::FormElementKey::deref): Added.
769 (WebCore::FormElementKeyHash::hash): Added.
770 (WebCore::FormElementKeyHashTraits::deletedValue): Added.
772 * dom/Element.h: Removed state function.
773 * dom/Node.h: Removed maintainsState, state, and restoreState functions.
774 * dom/Node.cpp: Ditto.
776 * dom/QualifiedName.cpp: Reformatted.
777 (WebCore::hashComponents): Removed code to handle buffers that are not multiples
778 of 4 bytes, since a QualifiedName is guaranteed to be; also asserted that fact.
780 * html/HTMLParser.cpp:
781 (WebCore::HTMLParser::insertNode): Remove code to restore state; that's now handled
783 (WebCore::HTMLParser::popOneBlock): Ditto.
785 * html/HTMLFormElement.cpp: Added include of HTMLInputElement.h.
787 * html/HTMLGenericFormElement.h: Changed form to be a const member function.
788 Changed type function to return a const AtomicString& instead of a String.
789 Added an override of closeRenderer. Removed state and findMatchingState functions.
790 Added stateValue and restoreState functions. Made m_form, m_disabled, and m_readOnly
791 be private instead of protected. Removed m_inited. Changed booleans to not use bit
792 fields since there are only two of them.
793 * html/HTMLGenericFormElement.cpp: Removed encodedElementName, state, and
794 findMatchingState functions.
795 (WebCore::HTMLGenericFormElement::stateValue): Added. No implementation. This will only be
796 called for subclasses that call registerFormElementWithState, and those will override and
798 (WebCore::HTMLGenericFormElement::restoreState): Ditto.
799 (WebCore::HTMLGenericFormElement::closeRenderer): Added. Replaces code that was in the
800 HTML parser. Calls takeStateForFormElement, passing in the name and type, and if a
801 state is found, calls restoreState.
803 * html/HTMLButtonElement.h: Changed type to return a const AtomicString& instead
805 * html/HTMLButtonElement.cpp:
806 (WebCore::HTMLButtonElement::type): Return a const AtomicString& instead of a
808 (WebCore::HTMLButtonElement::defaultEventHandler): Use form() instead of m_form.
809 (WebCore::HTMLButtonElement::isSuccessfulSubmitButton): Use disabled() instead of
812 * html/HTMLInputElement.h: Changed type to return a const AtomicString& instead
813 of a String. Removed maintainsState, state, and restoreState functions, and added
814 new stateValue and restoreState functions. Added m_inited (moved here from the generic
815 form element base class).
816 * html/HTMLInputElement.cpp:
817 (WebCore::HTMLInputElement::init): Call registerFormElementWithState. This was
818 formerly done by the HTML parser.
819 (WebCore::HTMLInputElement::~HTMLInputElement): Call deregisterFormElementWithState
821 (WebCore::HTMLInputElement::isKeyboardFocusable): Use form() instead of m_form.
822 (WebCore::HTMLInputElement::setType): Ditto.
823 (WebCore::HTMLInputElement::setInputType): Ditto. Also call inputType() != PASSWORD
824 instead of maintainsState(), since this is the only function that needs to know
825 the rule and it's no longer a function in the base class. Also call register and
826 deregister functions by their new names.
827 (WebCore::HTMLInputElement::type): Changed to return const AtomicString& instead
829 (WebCore::HTMLInputElement::stateValue): Renamed from state and changed to no
830 longer include the name and type, formerly obtained by calling the base class's
831 HTMLGenericFormElement::state, and to no longer modify the value() string by
832 adding a ".", which gets in the way of distinguishing null and empty values
833 and is slower and unnecessary.
834 (WebCore::HTMLInputElement::restoreState): Changed because it takes a single
835 state and doesn't need to call findMatchingState, and also to no longer remove the last
836 character from the value when restoring state.
837 (WebCore::HTMLInputElement::parseMappedAttribute): Use form() instead of m_form.
838 (WebCore::HTMLInputElement::isSuccessfulSubmitButton): Use disabled() instead of
840 (WebCore::HTMLInputElement::setChecked): Use form() instead of m_form.
841 (WebCore::HTMLInputElement::preDispatchEventHandler): Ditto.
842 (WebCore::HTMLInputElement::defaultEventHandler): Ditto.
844 * html/HTMLSelectElement.h: Changed type to return a const AtomicString& instead
846 * html/HTMLSelectElement.cpp:
847 (WebCore::HTMLSelectElement::HTMLSelectElement): Call registerFormElementWithState.
848 This was formerly done by the HTML parser.
849 (WebCore::HTMLSelectElement::~HTMLSelectElement): Call deregisterFormElementWithState
851 (WebCore::HTMLSelectElement::type): Changed to return const AtomicString& instead
853 (WebCore::HTMLSelectElement::stateValue): Renamed from state and changed to no
854 longer include the name and type, formerly obtained by calling the base class's
855 HTMLGenericFormElement::state, and to build the string in a Vector<char> instead of
856 appending characters one at a time to a string.
857 (WebCore::HTMLSelectElement::restoreState): Changed because it takes a single
858 state and doesn't need to call findMatchingState.
859 (WebCore::HTMLSelectElement::defaultEventHandler): Use form() instead of m_form.
861 * html/HTMLTextAreaElement.h: Changed type to return a const AtomicString& instead
862 of a String. Removed maintainsState, state, and restoreState functions, and added
863 new stateValue and restoreState functions.
864 * html/HTMLTextAreaElement.cpp:
865 (WebCore::HTMLTextAreaElement::HTMLTextAreaElement): Call registerFormElementWithState.
866 This was formerly done by the HTML parser. Also use member initialization instead of
868 (WebCore::HTMLTextAreaElement::~HTMLTextAreaElement): Call deregisterFormElementWithState
870 (WebCore::HTMLTextAreaElement::type): Changed to return const AtomicString& instead
872 (WebCore::HTMLTextAreaElement::stateValue): Renamed from state and changed to no
873 longer include the name and type, formerly obtained by calling the base class's
874 HTMLGenericFormElement::state, and to no longer modify the value() string by
875 adding a ".", which is unnecessary.
876 (WebCore::HTMLTextAreaElement::restoreState): Changed because it takes a single
877 state and doesn't need to call findMatchingState, and also to no longer remove the last
878 character from the value when restoring state.
879 (WebCore::HTMLTextAreaElement::updateValue): Changed to const.
880 (WebCore::HTMLTextAreaElement::value): Ditto.
881 (WebCore::HTMLTextAreaElement::defaultValue): Ditto.
883 * html/HTMLFieldSetElement.h: Changed type to return a const AtomicString& instead
885 * html/HTMLFieldSetElement.cpp: (WebCore::HTMLFieldSetElement::type): Ditto.
886 * html/HTMLKeygenElement.h: Ditto.
887 * html/HTMLKeygenElement.cpp: (WebCore::HTMLKeygenElement::type): Ditto.
888 * html/HTMLLegendElement.h: Ditto.
889 * html/HTMLLegendElement.cpp: (WebCore::HTMLLegendElement::type):
890 * html/HTMLOptGroupElement.h: Ditto.
891 * html/HTMLOptGroupElement.cpp: (WebCore::HTMLOptGroupElement::type): Ditto.
892 * html/HTMLOptionElement.h: Ditto.
893 * html/HTMLOptionElement.cpp: (WebCore::HTMLOptionElement::type): Ditto.
895 * ksvg2/svg/SVGAnimationElement.cpp: (SVGAnimationElement::closeRenderer):
896 Added missing call to base class.
898 * rendering/render_form.h: Removed element() functions that cast to the
899 appropriate derived element class. They do make some bits of code slightly
900 more readable, but they also require including too many headers. Removed
901 the includes of HTMLInputElement.h, HTMLSelectElement.h, HTMLTextAreaElement.h,
902 and KWQLineEdit.h, and added an include of GraphicsTypes.h.
903 * rendering/render_form.cpp:
904 (WebCore::RenderFormElement::updateFromElement): Changed use of element()
905 to instead use node() and cast.
906 (WebCore::RenderFormElement::clicked): Ditto.
907 (WebCore::RenderLineEdit::selectionChanged): Ditto.
908 (WebCore::RenderLineEdit::returnPressed): Ditto.
909 (WebCore::RenderLineEdit::performSearch): Ditto.
910 (WebCore::RenderLineEdit::addSearchResult): Ditto.
911 (WebCore::RenderLineEdit::calcMinMaxWidth): Ditto.
912 (WebCore::RenderLineEdit::setStyle): Ditto.
913 (WebCore::RenderLineEdit::updateFromElement): Ditto.
914 (WebCore::RenderLineEdit::valueChanged): Ditto.
915 (WebCore::RenderFileButton::calcMinMaxWidth): Ditto.
916 (WebCore::RenderFileButton::updateFromElement): Ditto.
917 (WebCore::RenderFileButton::returnPressed): Ditto.
918 (WebCore::RenderFileButton::valueChanged): Ditto.
919 (WebCore::RenderSelect::updateFromElement): Ditto.
920 (WebCore::RenderSelect::layout): Ditto.
921 (WebCore::RenderSelect::valueChanged): Ditto.
922 (WebCore::RenderSelect::selectionChanged): Ditto.
923 (WebCore::RenderSelect::updateSelection): Ditto.
924 (WebCore::RenderTextArea::destroy): Ditto.
925 (WebCore::RenderTextArea::calcMinMaxWidth): Ditto.
926 (WebCore::RenderTextArea::setStyle): Ditto.
927 (WebCore::RenderTextArea::updateFromElement): Ditto.
928 (WebCore::RenderTextArea::valueChanged): Ditto.
929 (WebCore::RenderTextArea::selectionChanged): Ditto.
930 (WebCore::RenderSlider::updateFromElement): Ditto.
931 (WebCore::RenderSlider::valueChanged): Ditto.
933 2006-05-05 Matt Gough <matt@softchaos.com>
937 http://bugzilla.opendarwin.org/show_bug.cgi?id=8563
939 Test: fast/doctypes/005-case-preserving.html
941 The doctype object in the DOM is now usable by client code
942 as opposed to always being exposed as nil. Now also ensures that
943 the 'name' of the component preserves the case of the original html source.
944 (i.e HtMl -> HtMl not HTML)
947 Changes comment by docType() to say it may return 0 for html
948 * html/HTMLDocument.cpp:
949 (WebCore::parseDocTypeDeclaration):
950 (WebCore::HTMLDocument::determineParseMode):
951 Preserves the case of the name component
952 (WebCore::HTMLDocument::doctype):removed
953 * html/HTMLDocument.h:
954 (WebCore::HTMLDocument::doctype):removed
956 2006-05-05 Rob Buis <buis@kde.org>
960 Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8651:
961 [DOMHTMLSelectElement multiple] returns no when the select element is multiple
963 Correct the logic errors, which are clearly indicated by the changeset given
966 * bindings/objc/DOMHTML.mm:
967 (-[DOMHTMLLinkElement disabled]):
968 (-[DOMHTMLSelectElement disabled]):
969 (-[DOMHTMLSelectElement multiple]):
970 (-[DOMHTMLOptGroupElement disabled]):
971 (-[DOMHTMLOptionElement defaultSelected]):
972 (-[DOMHTMLOptionElement disabled]):
974 2006-05-04 Darin Adler <darin@apple.com>
976 Reviewed by Tim Omernick.
978 - fix storage leak I introduced yesterday
980 * platform/cg/GraphicsContextCG.cpp:
981 (WebCore::setCGFillColor): Added.
982 (WebCore::setCGStrokeColor): Added.
983 (WebCore::GraphicsContext::drawRect): Use setCGFillColor to avoid allocating
985 (WebCore::GraphicsContext::drawLine): Use setCGStrokeColor and setCGFillColor
986 to avoid allocating a CGColorRef object.
987 (WebCore::GraphicsContext::drawEllipse): Ditto.
988 (WebCore::GraphicsContext::drawArc): Ditto.
989 (WebCore::GraphicsContext::drawConvexPolygon): Ditto.
990 (WebCore::GraphicsContext::fillRect): Ditto.
992 2006-05-04 Justin Garcia <justin.garcia@apple.com>
997 (WebCore::Node::rootEditableElement):
998 Restored code to stop at the body tag. Editing shouldn't be allowed to
999 happen outside the body, so it needs to be the editable root even if the
1000 html element is contentEditable.
1001 * editing/ReplaceSelectionCommand.cpp:
1002 (WebCore::ReplaceSelectionCommand::shouldMergeEnd):
1003 Now takes in more information so it can be "the decider".
1004 (WebCore::ReplaceSelectionCommand::doApply):
1005 Merging two paragraphs will destroy the moved one's block styles. Perform
1006 the end merge backward (from content already in the document to just inserted
1007 content) if moving forward would move the paragraph that contained the start of
1008 the selection being pasted into, since we always want to preserve that paragraph's
1010 Moving backward in this case is also helpful because otherwise it would be
1011 difficult to remember the position where inserted content began (since merging
1012 would remove m_firstNodeInserted). That position is needed in order to select
1013 the replacement and to add smart replace whitespace.
1014 (WebCore::ReplaceSelectionCommand::removeEndBRIfNeeded):
1015 If [br, 0] is at the end of a block, the br is not necessarily collapsed
1016 in quirks mode. [br, 0] needs to also not be at the start of a block.
1018 * editing/ReplaceSelectionCommand.h:
1020 2006-05-04 Tim Omernick <timo@apple.com>
1024 <rdar://problem/4537606> Give Java WebKit plugin access to its own DOM element
1026 * bridge/mac/WebCoreFrameBridge.h:
1027 Added DOMElement parameter to -viewForJavaAppletWithFrame:attributeNames:attributeValues:baseURL:.
1029 * bridge/JavaAppletWidget.h:
1030 Constructor now takes the applet's element instead of its containing frame.
1032 * bridge/mac/JavaAppletWidget.mm:
1033 (JavaAppletWidget::JavaAppletWidget):
1034 Pass the applet's element to viewForJavaAppletWithFrame:.
1036 * rendering/RenderApplet.cpp:
1037 (WebCore::RenderApplet::createWidgetIfNecessary):
1038 Pass the element along to JavaAppletWidget.
1040 2006-05-04 Tim Omernick <timo@apple.com>
1042 Reviewed by John Sullivan.
1044 <rdar://problem/4480186> Give WebKit plugins access to their own DOM element
1046 * bridge/mac/WebCoreFrameBridge.h:
1047 Added DOMElement: parameter to -viewForPluginWithURL:attributeNames:attributueValues:MIMEType:
1049 * bridge/mac/FrameMac.h:
1050 * bridge/mac/FrameMac.mm:
1051 (WebCore::FrameMac::createPlugin):
1052 Added "element" parameter; wrap element in DOMElement and pass up to the bridge.
1055 Added "element" parameter to createPlugin().
1057 (WebCore::Frame::loadPlugin):
1058 Get the plugin's DOM element and pass to createPlugin().
1060 2006-05-04 Eric Seidel <eseidel@apple.com>
1064 Add drag & drop support to <input type="file">
1065 http://bugzilla.opendarwin.org/show_bug.cgi?id=8733
1067 Test: manual/input-type-file-drag-drop.html
1069 * kwq/KWQFileButton.mm:
1070 (-[WebFileChooserButton initWithWidget::]):
1071 (-[WebCoreFileButton initWithWidget:]):
1072 (-[WebCoreFileButton drawRect:]):
1073 (-[WebCoreFileButton updateLabel]):
1074 (-[WebCoreFileButton setFilename:]):
1075 (-[WebCoreFileButton changeFilename:]):
1076 (-[WebCoreFileButton chooseFilename:]):
1077 (validFilenameFromPasteboard):
1078 (-[WebCoreFileButton draggingEntered:]):
1079 (-[WebCoreFileButton draggingExited:]):
1080 (-[WebCoreFileButton performDragOperation:]):
1082 2006-05-04 Beth Dakin <bdakin@apple.com>
1086 Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8732
1087 Backgrounds with background-size and background-origin do not
1088 always lay out correctly
1090 * platform/cairo/ImageCairo.cpp:
1091 (WebCore::Image::drawTiled): We no longer need to scale the source
1092 point since it will now come in with the scale already taken into
1094 * platform/mac/ImageMac.mm:
1095 (WebCore::Image::drawTiled): Same as above.
1096 * rendering/RenderBox.cpp:
1097 (WebCore::cacluateBackgroundSize): Now calculate the background
1098 size in a helper method.
1099 (WebCore::RenderBox::paintBackgroundExtended): Calculate the
1100 background size before calculating cx, cy, cw, ch, sx, and sy so
1101 that they can all be calculated with the scaled image size taken
1104 2006-05-04 David Hyatt <hyatt@apple.com>
1106 Fix for 8693, crash when reloading PDF. Make sure to clear the truncator's
1111 * bridge/mac/WebCoreStringTruncator.h:
1112 * bridge/mac/WebCoreStringTruncator.mm:
1113 (+[WebCoreStringTruncator clear]):
1114 * platform/mac/WebTextRendererFactory.mm:
1115 (-[WebTextRendererFactory clearCaches]):
1117 2006-05-03 Darin Adler <darin@apple.com>
1121 - http://bugzilla.opendarwin.org/show_bug.cgi?id=8696
1122 another round of GraphicsContext improvements
1124 * WebCore.xcodeproj/project.pbxproj: Added GraphicsContextCG.cpp.
1125 * html/CanvasRenderingContext2D.cpp:
1126 (WebCore::CanvasRenderingContext2D::scale): Use new GraphicsContext function.
1127 (WebCore::CanvasRenderingContext2D::rotate): Ditto.
1128 (WebCore::CanvasRenderingContext2D::translate): Ditto.
1129 * kwq/KWQComboBox.mm: Added include (not sure if this is needed for this patch,
1130 but it's needed for one of my upcoming ones).
1132 * platform/GraphicsContext.h: Changed fillColor and setFillColor to use Color
1133 instead of RGBA32. Removed setColorFromFillColor and setColorFromPen. Added
1134 scale, rotate, and translate functions.
1135 * platform/GraphicsContext.cpp:
1136 (WebCore::GraphicsContext::setFillColor): Changed to use Color instead of RGBA32.
1137 (WebCore::GraphicsContext::fillColor): Ditto.
1139 * platform/GraphicsTypes.h: Moved HorizontalAlignment here.
1140 * platform/Widget.h: Removed HorizontalAlignment from here.
1142 * platform/cg/GraphicsContextCG.cpp: Added. Started as a copy of GraphicsContextMac.mm.
1143 (WebCore::GraphicsContext::drawRect): Rewrote to not rely on [NSGraphicsContext currentContext].
1144 (WebCore::GraphicsContext::drawLine): Ditto.
1145 (WebCore::GraphicsContext::drawEllipse): Ditto.
1146 (WebCore::GraphicsContext::drawArc): Ditto.
1147 (WebCore::GraphicsContext::drawConvexPolygon): Ditto.
1148 (WebCore::GraphicsContext::fillRect): Ditto.
1149 (WebCore::GraphicsContext::setLineWidth): Added check of paintingDisabled().
1150 (WebCore::GraphicsContext::setMiterLimit): Ditto.
1151 (WebCore::GraphicsContext::setAlpha): Ditto.
1152 (WebCore::GraphicsContext::clearRect): Ditto.
1153 (WebCore::GraphicsContext::strokeRect): Ditto.
1154 (WebCore::GraphicsContext::setLineCap): Ditto.
1155 (WebCore::GraphicsContext::setLineJoin): Ditto.
1156 (WebCore::GraphicsContext::clip): Ditto.
1157 (WebCore::GraphicsContext::scale): Added.
1158 (WebCore::GraphicsContext::rotate): Added.
1159 (WebCore::GraphicsContext::translate): Added.
1161 * platform/mac/GraphicsContextMac.mm: Moved most of this file into GraphicsContextCG.cpp.
1162 (WebCore::GraphicsContext::setCompositeOperation): Added check of paintingDisabled().
1164 * platform/mac/WebCoreSystemInterface.h: Added declarations so this header
1167 2006-05-03 Darin Adler <darin@apple.com>
1171 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8159
1172 REGRESSION: Clicking outside new text field focuses the field
1174 This bug has always been present for "content editable" HTML, but
1175 now affects <input type=text> as well. The problem is with the editing
1176 concept of a "deep equivalent". When computing the deep equivalent,
1177 the code can move from outside an editable area to inside. To fix this,
1178 I removed all use of the "deep equivalent" concept.
1180 * rendering/RenderBlock.cpp: (WebCore::RenderBlock::positionForCoordinates):
1181 Changed argument names from _x and _y to just x and y. When the element
1182 is the editable root, changed things so that clicks that are not within
1183 the element at all return positions before or after the element, rather than
1184 always choosing the closest point within the element. This gets us off on
1185 the right foot, by not choosing a position inside an editable root when you
1186 click outside that editable root. This code handles shadowParentNode as well,
1187 and also calls positionForCoordinates on children rather than calling
1188 positionForRenderer (which I believe is now a function that can be removed).
1190 * editing/VisiblePosition.h: Removed the deepEquivalent function.
1191 * editing/VisiblePosition.cpp:
1192 (WebCore::VisiblePosition::previousVisiblePosition): Removed use of the
1193 deepEquivalent function. Also, to make this function easier to understand
1194 I separated out the case where the start point is "in rendered content"
1195 and the case where it's not into two separate loops.
1196 (WebCore::VisiblePosition::nextVisiblePosition): Ditto.
1197 (WebCore::VisiblePosition::initDeepPosition): Removed use of the deepEquivalent
1198 function. Also added code to make sure that this work never turns a position
1199 outside an editable element into a position inside that editable element, or
1200 vice versa. Reorganized the code a bit.
1203 (WebCore::Position::upstream): Removed use of the deepEquivalent function.
1204 (WebCore::Position::downstream): Ditto.
1206 * editing/htmlediting.cpp:
1207 (WebCore::editingIgnoresContent): Changed to use isReplaced instead of isWidget
1208 and isImage to determine if editing should ignore content.
1209 (WebCore::firstInSpecialElement): Rewrote isFirstVisiblePositionInSpecialElement
1210 to have code to share with positionBeforeContainingSpecialElement. And changed
1211 to allow both the position just before a table and the position just inside a
1212 table to qualify. While this is slightly sloppy, the old code worked because
1213 of the "deep equivalent" technique. This change is needed to get the desired
1214 results even without that technique.
1215 (WebCore::lastInSpecialElement): Ditto.
1216 (WebCore::isFirstVisiblePositionInSpecialElement): Changed to use the new function.
1217 (WebCore::positionBeforeContainingSpecialElement): Ditto.
1218 (WebCore::isLastVisiblePositionInSpecialElement): Ditto.
1219 (WebCore::positionAfterContainingSpecialElement): Ditto.
1221 * dom/Node.cpp: (WebCore::Node::rootEditableElement): Rewrote to remove
1222 special case for body tag.
1226 * html/HTMLElement.cpp:
1227 (WebCore::HTMLElement::setOuterHTML): Added a FIXME about the fact
1228 that this won't merge neighboring text nodes the way setOuterText does.
1229 (WebCore::HTMLElement::setInnerText): Added a FIXME about the fact that
1230 this creates a text node even when setting to empty text.
1231 (WebCore::HTMLElement::setOuterText): Ditto.
1233 * editing/DeleteSelectionCommand.cpp: Removed some #if 1 and #if 0.
1234 * editing/ReplaceSelectionCommand.cpp: A little reformatting.
1235 * rendering/render_button.h: Tiny formatting tweak.
1237 2006-05-02 Adele Peterson <adele@apple.com>
1241 Fix for <rdar://problem/4523671>
1242 REGRESSION (NativeTextField): Auto-complete popup list doesn't appear at the correct location after scrolling page.
1244 * bindings/objc/DOMHTML.mm: (-[DOMHTMLInputElement _rectOnScreen]):
1245 Use the documentView to compute the correct rect for the element when the view is scrolled.
1247 2006-05-02 Justin Garcia <justin.garcia@apple.com>
1249 Reviewed by harrison
1251 <http://bugzilla.opendarwin.org/show_bug.cgi?id=8704>
1252 Fix a few end merge bugs
1253 <rdar://problem/4424044>
1254 REGRESSION: Extra line appears when typing
1256 * bridge/mac/WebCoreFrameBridge.mm:
1257 (-[WebCoreFrameBridge smartInsertForString:replacingRange:beforeString:afterString:]):
1258 Use renamed characterAfter.
1259 * editing/InsertParagraphSeparatorCommand.cpp:
1260 (WebCore::InsertParagraphSeparatorCommand::doApply):
1261 Regenerate a VisiblePosition that became stale during a text node split.
1262 Don't rebalance whitespace after the operation, 1) it has a bug that turns preserved
1263 newlines into nbsps, 2) I think it should only be done during serialization, not after
1264 every command (since editable regions now always have -webkit-nbsp-mode:space on them).
1265 Use a regular br for the placeholder as I think we can move away from -webkit-block-placeholders.
1267 * editing/RebalanceWhitespaceCommand.cpp: Added FIXMEs.
1268 * editing/ReplaceSelectionCommand.cpp:
1269 (WebCore::ReplaceSelectionCommand::shouldMergeStart): Removed FIXME.
1270 (WebCore::ReplaceSelectionCommand::shouldMergeEnd): Can now use rendering information.
1271 (WebCore::ReplaceSelectionCommand::doApply):
1272 Call shouldMergeEnd after the insertion so that it can use rendering information.
1273 Don't use positionAfterNode of the last node inserted to mark the position at the end
1274 of inserted content because canonicalization can send it into content that was already
1277 * editing/ReplaceSelectionCommand.h:
1278 * editing/VisiblePosition.cpp:
1279 (WebCore::VisiblePosition::characterAfter):
1280 Renamed. When two candidates are visually equivalent, the rightmost candidate will be
1281 the one inside the text node where the character will be.
1283 * editing/VisiblePosition.h:
1284 * editing/htmlediting.cpp:
1285 (WebCore::enclosingTableCell): Added.
1286 (WebCore::enclosingList):
1287 * editing/htmlediting.h:
1289 2006-05-02 David Hyatt <hyatt@apple.com>
1291 Partial fix for the crash in bugzilla bug 8088. There's a third crash
1292 even after fixing this though.
1296 * platform/mac/WebTextRenderer.mm:
1297 (WebCore::WidthMap::widths):
1298 (WebCore::extendWidthMap):
1299 * platform/mac/WebTextRendererFactory.mm:
1300 (-[WebTextRendererFactory clearCaches]):
1302 2006-05-02 Steve Falkenburg <sfalken@apple.com>
1306 * WebCore.vcproj/WebCore/WebCore.vcproj: defined NDEBUG in release build
1307 * bridge/win/FrameWin.cpp:
1308 (WebCore::FrameWin::FrameWin): turned on javascript.
1309 * kwq/KWQKHTMLSettings.h:
1310 (KHTMLSettings::KHTMLSettings): initialized settings to 0
1312 2006-05-02 David Hyatt <hyatt@apple.com>
1314 Make sure to updateLayout on all scrolling functions (in particular when
1315 setting scrollLeft/Top).
1319 fast/overflow/008,html added as a test case.
1322 (WebCore::Element::scrollIntoView):
1323 (WebCore::Element::scrollIntoViewIfNeeded):
1324 (WebCore::Element::setScrollLeft):
1325 (WebCore::Element::setScrollTop):
1327 2006-05-02 Anders Carlsson <andersca@mac.com>
1329 Reviewed by Dave Hyatt.
1331 http://bugzilla.opendarwin.org/show_bug.cgi?id=8688
1332 file URLs aren't being serialized correctly when using window.location
1334 * platform/KURL.cpp:
1336 Append "//" for file URLs.
1338 2006-05-01 David Hyatt <hyatt@apple.com>
1340 Convert WebTextRenderer to be a C++ class. Change the factory so
1341 that it uses pointer-based hashmaps instead of NSMutableDictionaries.
1342 Convert uses of malloc/free to new/delete so that they start using
1343 the fastMalloc/fastFree code.
1347 * bridge/mac/WebCoreStringTruncator.mm:
1350 * kwq/KWQComboBox.mm:
1351 (QComboBox::sizeHint):
1352 * kwq/KWQLineEdit.mm:
1353 (QLineEdit::sizeForCharacterWidth):
1354 * kwq/KWQListBox.mm:
1356 (groupLabelTextRenderer):
1357 (QListBox::sizeForNumberOfLines):
1358 (QListBox::clearCachedTextRenderers):
1359 (-[KWQTableView drawRow:clipRect:]):
1360 * platform/FontDataSet.h:
1361 * platform/mac/FontMac.mm:
1362 (WebCore::FontDataSet::~FontDataSet):
1363 (WebCore::FontDataSet::getRenderer):
1364 (WebCore::FontDataSet::invalidate):
1365 (WebCore::Font::ascent):
1366 (WebCore::Font::descent):
1367 (WebCore::Font::lineSpacing):
1368 (WebCore::Font::xHeight):
1369 (WebCore::Font::selectionRectForText):
1370 (WebCore::Font::drawText):
1371 (WebCore::Font::drawHighlightForText):
1372 (WebCore::Font::drawLineForText):
1373 (WebCore::Font::drawLineForMisspelling):
1374 (WebCore::Font::misspellingLineThickness):
1375 (WebCore::Font::floatWidth):
1376 (WebCore::Font::checkSelectionPoint):
1377 * platform/mac/WebCoreTextRenderer.mm:
1378 (WebCoreDrawTextAtPoint):
1379 (WebCoreTextFloatWidth):
1380 (WebCoreSetAlwaysUseATSU):
1381 * platform/mac/WebTextRenderer.h:
1382 (WebCore::WebTextRenderer::ascent):
1383 (WebCore::WebTextRenderer::descent):
1384 (WebCore::WebTextRenderer::lineSpacing):
1385 (WebCore::WebTextRenderer::lineGap):
1386 (WebCore::WebTextRenderer::misspellingLineThickness):
1387 (WebCore::WebTextRenderer::misspellingLinePatternWidth):
1388 (WebCore::WebTextRenderer::misspellingLinePatternGapWidth):
1389 * platform/mac/WebTextRenderer.mm:
1390 (WebCore::WebCoreInitializeFont):
1391 (WebCore::WebCoreInitializeTextRun):
1392 (WebCore::WebCoreInitializeEmptyTextStyle):
1393 (WebCore::WebCoreInitializeEmptyTextGeometry):
1394 (WebCore::widthForGlyph):
1395 (WebCore::overrideLayoutOperation):
1396 (WebCore::m_ATSUMirrors):
1397 (WebCore::WebTextRenderer::~WebTextRenderer):
1398 (WebCore::WebTextRenderer::xHeight):
1399 (WebCore::WebTextRenderer::drawRun):
1400 (WebCore::WebTextRenderer::floatWidthForRun):
1401 (WebCore::WebTextRenderer::drawLineForCharacters):
1402 (WebCore::WebTextRenderer::selectionRectForRun):
1403 (WebCore::WebTextRenderer::drawHighlightForRun):
1404 (WebCore::WebTextRenderer::drawLineForMisspelling):
1405 (WebCore::WebTextRenderer::pointToOffset):
1406 (WebCore::WebTextRenderer::setAlwaysUseATSU):
1407 (WebCore::getSmallCapsRenderer):
1408 (WebCore::findSubstituteFont):
1409 (WebCore::rendererForAlternateFont):
1410 (WebCore::computeWidthForSpace):
1411 (WebCore::setUpFont):
1412 (WebCore::CG_selectionRect):
1414 (WebCore::updateGlyphMapEntry):
1415 (WebCore::extendGlyphMap):
1416 (WebCore::extendWidthMap):
1417 (WebCore::initializeATSUStyle):
1418 (WebCore::createATSULayoutParameters):
1419 (WebCore::disposeATSULayoutParameters):
1420 (WebCore::addDirectionalOverride):
1421 (WebCore::ATSU_selectionRect):
1422 (WebCore::ATSU_draw):
1423 (WebCore::ATSU_pointToOffset):
1424 (WebCore::freeWidthMap):
1425 (WebCore::freeGlyphMap):
1426 (WebCore::glyphForCharacter):
1427 (WebCore::advanceWidthIterator):
1428 * platform/mac/WebTextRendererFactory.h:
1429 * platform/mac/WebTextRendererFactory.mm:
1430 (-[WebTextRendererFactory clearCaches]):
1431 (-[WebTextRendererFactory init]):
1432 (-[WebTextRendererFactory dealloc]):
1433 (-[WebTextRendererFactory rendererWithFont:]):
1435 2006-05-01 Justin Garcia <justin.garcia@apple.com>
1439 <http://bugzilla.opendarwin.org/show_bug.cgi?id=8653>
1440 Remove a use of hasMoreThanOneBlock, which uses info from the test rendering.
1442 * editing/DeleteSelectionCommand.cpp:
1443 (WebCore::DeleteSelectionCommand::initializePositionData):
1444 Removed code that stopped the merge if the end of the selection to delete
1445 was in a fully selected line, which was nonsense.
1447 (WebCore::DeleteSelectionCommand::mergeParagraphs):
1448 Deletion does a bad job of updating the endpoints of the selection as it removes
1449 content. If the endpoints have been flip flipped, bail.
1450 If deletion has removed everything from the block that contained the
1451 start of the selection to delete, we can't create a visible position inside
1452 that block to serve as a destination for the merge. So, we insert a placeholder
1453 at that position to prop the block open to let content in.
1455 * editing/ReplaceSelectionCommand.cpp:
1456 (WebCore::ReplaceSelectionCommand::doApply):
1457 Added an assert and two early returns for cases where we'll crash.
1458 Removed a use of !fragment.hasMoreThanOneBlock, which uses test rendering info
1459 and which was wrong.
1460 If we've already inserted content during the start merge, insertionPos will be
1461 the position just after that content, so inserting new content before insertionPos
1462 will reverse its order.
1464 2006-05-01 Mitz Pettel <opendarwin.org@mitzpettel.com>
1468 - manual test for http://bugzilla.opendarwin.org/show_bug.cgi?id=8658
1469 Assertion failure in -[WebPluginContainerCheck _isForbiddenFileLoad]
1470 (bridge is null) when clicking QuickTime object with href
1472 * manual-tests/plugin-controller-datasource.html: Added.
1473 * manual-tests/resources/orange.mov: Added.
1475 2006-04-30 Rob Buis <buis@kde.org>
1477 Reviewed by eseidel. Landed by eseidel.
1479 Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8651:
1480 CGContextSetLineDash: invalid dash array: emmited during WebKit tests
1482 Properly discard invalid stroke-dasharray properties like in
1483 invalid-css.svg. (Tests updated.)
1485 * ksvg2/css/SVGCSSParser.cpp:
1486 (WebCore::CSSParser::parseSVGStrokeDasharray):
1488 2006-04-28 David Hyatt <hyatt@apple.com>
1490 Make image buffer sizes in the loader more accurate, since we know we store
1491 buffers with 4 bytes per pixel. Double sizes to account for this. Also
1492 deal better with animated GIFs that may have thousands of frames by adding
1493 in a heuristic that will use the data size instead of a single frame RGBA32
1494 buffer size if it's larger.
1499 * loader/CachedImage.cpp:
1500 (WebCore::CachedImage::data):
1502 2006-04-28 Steve Falkenburg <sfalken@apple.com>
1506 No test necessary - fixing Win32 build, turned off C++ exceptions, turned off RTTI
1508 * WebCore.vcproj/WebCore/WebCore.vcproj:
1509 * bridge/win/FrameWin.cpp:
1510 (WebCore::FrameWin::~FrameWin):
1511 * bridge/win/PageWin.cpp:
1512 (WebCore::Page::Page):
1514 * platform/win/TemporaryLinkStubs.cpp:
1515 (FrameWin::saveDocumentState):
1517 (Path::boundingRect):
1519 2006-04-28 David Hyatt <hyatt@apple.com>
1521 Merge WebCoreTextRenderer into WebTextRenderer. Merge WebCoreTextRendererFactory
1522 into WebTextRendererFactory. Change all callers to refer to the concrete classes
1523 now. Change WebCoreTextRenderer.h to be the public API that WebKit uses when
1524 it calls in to WebCore. Clean up the exports to remove things WebKit no longer
1530 * WebCore.xcodeproj/project.pbxproj:
1531 * bridge/mac/WebCoreStringTruncator.mm:
1534 (+[WebCoreStringTruncator widthOfString:font:]):
1535 * kwq/KWQComboBox.mm:
1536 (QComboBox::sizeHint):
1537 * kwq/KWQLineEdit.mm:
1538 (QLineEdit::sizeForCharacterWidth):
1539 * kwq/KWQListBox.mm:
1541 (groupLabelTextRenderer):
1542 (QListBox::sizeForNumberOfLines):
1543 (-[KWQTableView drawRow:clipRect:]):
1545 * platform/FontDataSet.h:
1546 * platform/mac/FontMac.mm:
1547 (WebCore::FontDataSet::getWebCoreFont):
1548 (WebCore::FontDataSet::getRenderer):
1549 (WebCore::FontDataSet::determinePitch):
1550 * platform/mac/WebCoreTextRenderer.h:
1551 * platform/mac/WebCoreTextRendererFactory.mm:
1552 (-[WebCoreTextRendererFactory init]):
1553 * platform/mac/WebTextRenderer.h:
1554 * platform/mac/WebTextRenderer.mm:
1555 * platform/mac/WebTextRendererFactory.h:
1556 * platform/mac/WebTextRendererFactory.mm:
1557 (WebCoreInitializeFont):
1558 (WebCoreInitializeTextRun):
1559 (WebCoreInitializeEmptyTextStyle):
1560 (WebCoreInitializeEmptyTextGeometry):
1561 (-[WebTextRendererFactory clearCaches]):
1562 (+[WebTextRendererFactory createSharedFactory]):
1563 (+[WebTextRendererFactory sharedFactory]):
1564 (-[WebTextRendererFactory init]):
1566 2006-04-28 David Hyatt <hyatt@apple.com>
1568 Fix for 8586, move WebTextRenderer into WebCore.
1573 * WebCore.xcodeproj/project.pbxproj:
1574 * bridge/mac/WebCoreStringTruncator.mm:
1575 * platform/mac/WebCoreSystemInterface.h:
1576 * platform/mac/WebCoreSystemInterface.mm:
1577 * platform/mac/WebCoreTextRenderer.h:
1578 * platform/mac/WebCoreTextRendererFactory.mm:
1579 (+[WebCoreTextRendererFactory sharedFactory]):
1580 * platform/mac/WebTextRenderer.h: Added.
1581 * platform/mac/WebTextRenderer.mm: Added.
1583 (-[WebTextRenderer initWithFont:]):
1585 (-[WebTextRenderer drawLineForCharacters:yOffset:width:color:thickness:]):
1586 (-[WebTextRenderer drawLineForMisspelling:withWidth:]):
1587 (findSubstituteFont):
1594 (initializeATSUStyle):
1595 (createATSULayoutParameters):
1597 (addDirectionalOverride):
1599 (normalizeVoicingMarks):
1600 (advanceWidthIterator):
1601 (fillStyleWithAttributes):
1602 * platform/mac/WebTextRendererFactory.h: Added.
1603 * platform/mac/WebTextRendererFactory.mm: Added.
1604 (getAppDefaultValue):
1605 (getUserDefaultValue):
1606 (getLCDScaleParameters):
1608 (+[WebTextRendererFactory createSharedFactory]):
1609 (-[WebTextRendererFactory isFontFixedPitch:]):
1610 (-[WebTextRendererFactory fontWithFamily:traits:size:]):
1612 (-[WebTextRendererFactory cachedFontFromFamily:traits:size:]):
1614 2006-04-28 Eric Seidel <eseidel@apple.com>
1616 Fix by beth. Reviewed by darin. Landed by eseidel.
1618 Make hackish fix to avoid crash in Xcode and Filemaker.
1619 <rdar://problem/4059059> Crash in RenderFlow::detach (XCode Documentation Window)
1621 * bridge/mac/WebCoreFrameBridge.mm:
1622 (-[WebCoreFrameBridge didNotOpenURL:pageCache:]):
1624 2006-04-28 Alexey Proskuryakov <ap@nypop.com>
1628 - http://bugzilla.opendarwin.org/show_bug.cgi?id=5855
1629 REGRESSION: revert SGML comment parsing fix (comment parsing causes most of usbank.com page to be missing)
1631 * html/HTMLTokenizer.cpp:
1632 (WebCore::HTMLTokenizer::parseComment): Revert one change made for acid2,
1633 <http://weblogs.mozillazine.org/hyatt/acid6.txt>.
1635 2006-04-28 Darin Adler <darin@apple.com>
1639 - http://bugzilla.opendarwin.org/show_bug.cgi?id=8608
1640 make GraphicsContext more suitable for cross-platform use, step 2
1642 - Changed GraphicsContext to use NSGraphicsContext as little as possible.
1643 - Removed the printing flag from GraphicsContext.
1644 - Changed GraphicsContext to assume the NSGraphicsContext is always flipped,
1645 and got rid of parameters to pass the flipped boolean around.
1647 * WebCore.vcproj/WebCore/WebCore.vcproj: Add GraphicsTypes.h/cpp and remove
1648 CompositeOperator.h/cpp.
1649 * WebCore.xcodeproj/project.pbxproj: Ditto.
1651 * bridge/mac/FrameMac.mm: (WebCore::FrameMac::setDisplaysWithFocusAttributes):
1652 * bridge/mac/WebCoreFrameBridge.mm: (-[WebCoreFrameBridge drawRect:]):
1653 * html/CanvasPattern.cpp: (WebCore::patternCallback):
1654 * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::createDrawingContext):
1655 * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
1656 (WebCore::KRenderingDeviceContextQuartz::createGraphicsContext):
1657 * platform/mac/WidgetMac.mm: (WebCore::Widget::lockDrawingFocus):
1658 Update for changes to GraphicsContext constructor (no flipped or printing boolean).
1660 * html/CanvasRenderingContext2D.h: Added a Path to the context state. Changed the
1661 LineCap and LineJoin types to use the new ones in GraphicsTypes.h instead of defining
1662 types here in this class. Changed m_platformContextStrokeStyleIsPattern and
1663 m_platformContextFillStyleIsPattern to be named m_appliedStrokePattern and
1664 m_appliedFillPattern and moved them outside the __APPLE__ ifdefs. Removed the
1665 platformContext() function. Moved applyStrokePattern and applyFillPattern out of
1666 the __APPLE__ ifdef.
1668 * html/CanvasRenderingContext2D.cpp:
1669 (WebCore::CanvasRenderingContext2D::State::State): Moved the stroke pattern
1670 booleans out of Mac-specific ifdef.
1671 (WebCore::CanvasRenderingContext2D::save): Changed to use GraphicsContext instead
1672 of using CGContext directly.
1673 (WebCore::CanvasRenderingContext2D::restore): Ditto.
1674 (WebCore::CanvasRenderingContext2D::setStrokeStyle): Ditto.
1675 (WebCore::CanvasRenderingContext2D::setFillStyle): Ditto.
1676 (WebCore::CanvasRenderingContext2D::setLineWidth): Ditto.
1677 (WebCore::CanvasRenderingContext2D::lineCap): Ditto.
1678 (WebCore::CanvasRenderingContext2D::setLineCap): Ditto.
1679 (WebCore::CanvasRenderingContext2D::lineJoin): Ditto.
1680 (WebCore::CanvasRenderingContext2D::setLineJoin): Ditto.
1681 (WebCore::CanvasRenderingContext2D::setMiterLimit): Ditto.
1682 (WebCore::CanvasRenderingContext2D::shadowColor): Ditto.
1683 (WebCore::CanvasRenderingContext2D::setGlobalAlpha): Ditto.
1684 (WebCore::CanvasRenderingContext2D::setGlobalCompositeOperation): Ditto.
1685 (WebCore::CanvasRenderingContext2D::scale): Update since platformContext() function
1687 (WebCore::CanvasRenderingContext2D::rotate): Ditto.
1688 (WebCore::CanvasRenderingContext2D::translate): Ditto.
1689 (WebCore::CanvasRenderingContext2D::beginPath): Changed to use GraphicsContext instead
1690 of using CGContext directly.
1691 (WebCore::CanvasRenderingContext2D::closePath): Ditto.
1692 (WebCore::CanvasRenderingContext2D::moveTo): Ditto.
1693 (WebCore::CanvasRenderingContext2D::lineTo): Ditto.
1694 (WebCore::CanvasRenderingContext2D::quadraticCurveTo): Ditto.
1695 (WebCore::CanvasRenderingContext2D::bezierCurveTo): Ditto.
1696 (WebCore::CanvasRenderingContext2D::arcTo): Ditto.
1697 (WebCore::CanvasRenderingContext2D::arc): Ditto.
1698 (WebCore::CanvasRenderingContext2D::rect): Ditto.
1699 (WebCore::CanvasRenderingContext2D::fill): Changed to use the current path from this class
1700 instead of relying on the CGContext's current path.
1701 (WebCore::CanvasRenderingContext2D::stroke): Ditto.
1702 (WebCore::CanvasRenderingContext2D::clip): Changed to use the current path and use the
1703 GraphicsContext instead of using CGContext directly.
1704 (WebCore::CanvasRenderingContext2D::clearRect): Changed to use GraphicsContext instead
1705 of using CGContext directly.
1706 (WebCore::CanvasRenderingContext2D::fillRect): Update since platformContext() function
1708 (WebCore::CanvasRenderingContext2D::strokeRect): Ditto.
1709 (WebCore::CanvasRenderingContext2D::setShadow): Ditto.
1710 (WebCore::CanvasRenderingContext2D::applyShadow): Ditto.
1711 (WebCore::CanvasRenderingContext2D::drawImage): Ditto.
1712 (WebCore::CanvasRenderingContext2D::drawImageFromRect): Ditto.
1713 (WebCore::CanvasRenderingContext2D::createPattern): Ditto.
1714 (WebCore::CanvasRenderingContext2D::applyStrokePattern): Made a tiny bit of this function
1715 cross-platform. The bulk is still Mac-specific.
1716 (WebCore::CanvasRenderingContext2D::applyFillPattern): Ditto.
1718 * html/CanvasStyle.h: Changed to use GraphicsContext instead of CGContext. Now the
1719 platform-specific stuff is in the implementation, not the header.
1720 * html/CanvasStyle.cpp:
1721 (WebCore::CanvasStyle::applyStrokeColor): Moved the ifdefs inside the function, getting
1722 us one step closer to platform independence.
1723 (WebCore::CanvasStyle::applyFillColor): Ditto.
1725 * html/html_imageimpl.cpp:
1726 (WebCore::HTMLAreaElement::getRect): Update for changes to the Path class.
1727 (WebCore::HTMLAreaElement::getRegion): Ditto.
1730 (WebCore::Frame::paint): Change to check printing flag on the document, rather than on
1731 the GraphicsContext, since there is no printing flag for GraphicsContext any more.
1732 (WebCore::Frame::adjustPageHeight): Update for change to GraphicsContext constructor.
1734 * platform/GraphicsContext.h: Define a type called PlatformGraphicsContext so the
1735 platform-specific getter and constructor don't have to be ifdef'd. Added clearRect,
1736 strokeRect, setLineWidth, setLineCap, setLineJoin, setMiterLimit, setAlpha, setCompositeOperation,
1737 and clip functions. Removed the isForPrinting parameter from createGraphicsContextPrivate.
1738 * platform/GraphicsContext.cpp:
1739 (WebCore::GraphicsContextPrivate::GraphicsContextPrivate): Removed isForPrinting.
1740 (WebCore::GraphicsContext::createGraphicsContextPrivate): Ditto.
1741 * platform/mac/GraphicsContextMac.mm:
1742 (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
1743 Removed NSGraphicsContext.
1744 (WebCore::GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate):
1746 (WebCore::GraphicsContext::GraphicsContext): Removed constructor that
1747 takes an NSGraphicsContext. Removed the flipText and forPrinting parameters
1748 to the other constructor.
1749 (WebCore::GraphicsContext::savePlatformState): Removed NSGraphicsContext code.
1750 (WebCore::GraphicsContext::restorePlatformState): Ditto.
1751 (WebCore::GraphicsContext::drawRect): Updated assertion to more-precisely
1752 reflect the limitation of the current version of this function.
1753 (WebCore::GraphicsContext::setColorFromFillColor): Ditto.
1754 (WebCore::GraphicsContext::setColorFromPen): Ditto.
1755 (WebCore::GraphicsContext::drawLine): Updated assertion to more-precisely
1756 reflect the limitation of the current version of this function.
1757 (WebCore::setCompositeOperation):
1758 (WebCore::GraphicsContext::fillRect): Ditto.
1759 (WebCore::GraphicsContext::setLineWidth): Added.
1760 (WebCore::GraphicsContext::setMiterLimit): Added.
1761 (WebCore::GraphicsContext::setAlpha): Added.
1762 (WebCore::GraphicsContext::setCompositeOperation): Added.
1763 (WebCore::GraphicsContext::clearRect): Added.
1764 (WebCore::GraphicsContext::strokeRect): Added.
1765 (WebCore::GraphicsContext::setLineCap): Added.
1766 (WebCore::GraphicsContext::setLineJoin): Added.
1767 (WebCore::GraphicsContext::clip): Added.
1769 * platform/CompositeOperator.cpp: Removed.
1770 * platform/CompositeOperator.h: Removed.
1771 * platform/GraphicsTypes.cpp: Added. Includes CompositeOperator, LineCap, and LineJoin.
1772 * platform/GraphicsTypes.h: Added.
1774 * platform/Image.h: Changed include to GraphicsTypes.h from CompositeOperator.h.
1776 * platform/Path.h: Removed constructors that take a Rect and an array of points. Made
1777 the Path mutable. Changed the types for contains and boundingRect to be float-based
1778 instead of int-based. Changed translate to take a FloatSize instead of two integers.
1779 Added clear, moveTo, addLineTo, addQuadCurveTo, addBezierCurveTo, addArcTo, closeSubpath,
1780 addArc, addRect, addEllipse, and platformPath functions. Defined a PlatformPath type
1781 so we don't have to ifdef the header so much.
1782 * platform/cg/PathCG.cpp:
1783 (WebCore::Path::Path): Changed class to always have a mutable path.
1784 (WebCore::Path::operator=): Changed to make a mutable copy.
1785 (WebCore::Path::contains): Changed to take a FloatPoint instead of IntPoint.
1786 (WebCore::Path::translate): Changed to use a FloatSize instead of two ints.
1787 (WebCore::Path::boundingRect): Changed to return a FloatRect.
1788 (WebCore::Path::moveTo): Added.
1789 (WebCore::Path::addLineTo): Added.
1790 (WebCore::Path::addQuadCurveTo): Added.
1791 (WebCore::Path::addBezierCurveTo): Added.
1792 (WebCore::Path::addArcTo): Added.
1793 (WebCore::Path::closeSubpath): Added.
1794 (WebCore::Path::addArc): Added.
1795 (WebCore::Path::addRect): Added.
1796 (WebCore::Path::addEllipse): Added.
1797 (WebCore::Path::clear): Added.
1799 * platform/mac/ImageMac.mm:
1800 (WebCore::fillSolidColorInRect): Changed to take a GraphicsContext instead of
1802 (WebCore::Image::checkForSolidColor): Changed to use the new setCompositeOperation
1804 (WebCore::Image::draw): Changed to use the new PDF image and fillSolidColorInRect
1805 function that take GraphicsContext instead of CGContext.
1806 (WebCore::Image::drawTiled): Ditto.
1808 * platform/mac/PDFDocumentImage.h: Made most functions private. Changed to
1809 use GraphicsContext and FloatRect instead of CGContext and NSRect. Also
1810 removed the unused alpha and flipped booleans.
1811 * platform/mac/PDFDocumentImage.mm:
1812 (WebCore::PDFDocumentImage::bounds): Update for change in types.
1813 (WebCore::PDFDocumentImage::adjustCTM): Ditto.
1814 (WebCore::PDFDocumentImage::setCurrentPage): Ditto.
1815 (WebCore::PDFDocumentImage::draw): Ditto.
1817 * platform/win/TemporaryLinkStubs.cpp: Added lots of new stubs.
1819 * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paint): Changed to get
1820 printing boolean from document instead graphics context.
1821 * rendering/RenderBlock.cpp:
1822 (WebCore::RenderBlock::paintChildren): Ditto.
1823 (WebCore::RenderBlock::paintObject): Ditto.
1824 * rendering/RenderFlow.cpp: (WebCore::RenderFlow::paintLines): Ditto.
1825 * rendering/RenderHTMLCanvas.cpp: (WebCore::RenderHTMLCanvas::paint): Ditto.
1826 * rendering/RenderImage.cpp: (WebCore::RenderImage::paint): Ditto.
1827 * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintButton): Ditto.
1828 * rendering/render_list.cpp: (WebCore::RenderListMarker::paint): Ditto.
1829 * rendering/render_replaced.cpp: (WebCore::RenderWidget::paint): Ditto.
1831 2006-04-28 Mitz Pettel <opendarwin.org@mitzpettel.com>
1833 Reviewed by hyatt, landed by ap.
1835 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6769
1836 REGRESSION: Incomplete repaint when a cell's extra bottom margin grows
1838 Test: fast/repaint/table-extra-bottom-grow.html
1840 * rendering/RenderBlock.cpp:
1841 (WebCore::RenderBlock::overflowRect): Changed to not add the top/left overflow twice and
1842 allow the normal overflow height to overlap with the bottom extra height.
1843 * rendering/RenderTableRow.cpp:
1844 (WebCore::RenderTableRow::layout): Removed the code that resets the extra heights.
1845 * rendering/RenderTableSection.cpp:
1846 (WebCore::RenderTableSection::layoutRows): If the top extra height changed or the
1847 bottom extra height increased, just repaint the entire cell.
1849 2006-04-28 Eric Seidel <eseidel@apple.com>
1851 Reviewed by andersca.
1853 Remove KCanvasContainerQuartz, pushing all logic into KCanvasContainer.
1857 * kcanvas/KCanvasContainer.cpp:
1858 (WebCore::KCanvasContainer::canHaveChildren):
1859 (WebCore::KCanvasContainer::requiresLayer):
1860 (WebCore::KCanvasContainer::lineHeight):
1861 (WebCore::KCanvasContainer::baselinePosition):
1862 (WebCore::KCanvasContainer::calcMinMaxWidth):
1863 (WebCore::KCanvasContainer::layout):
1864 (WebCore::KCanvasContainer::paint):
1865 (WebCore::KCanvasContainer::setViewport):
1866 (WebCore::KCanvasContainer::viewport):
1867 (WebCore::KCanvasContainer::setViewBox):
1868 (WebCore::KCanvasContainer::viewBox):
1869 (WebCore::KCanvasContainer::setAlign):
1870 (WebCore::KCanvasContainer::align):
1871 (WebCore::KCanvasContainer::viewportTransform):
1872 (WebCore::KCanvasContainer::getAbsoluteRepaintRect):
1873 (WebCore::KCanvasContainer::absoluteTransform):
1874 (WebCore::KCanvasContainer::getAspectRatio):
1875 * kcanvas/KCanvasContainer.h:
1876 (WebCore::KCanvasContainer::renderName):
1877 * kcanvas/device/KRenderingDevice.h:
1878 * kcanvas/device/quartz/KCanvasResourcesQuartz.h:
1879 * kcanvas/device/quartz/KCanvasResourcesQuartz.mm:
1880 * kcanvas/device/quartz/KRenderingDeviceQuartz.h:
1881 * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
1882 (WebCore::KRenderingDeviceQuartz::createPaintServer):
1883 * ksvg2/svg/SVGAElement.cpp:
1884 (WebCore::SVGAElement::createRenderer):
1885 * ksvg2/svg/SVGGElement.cpp:
1886 (SVGGElement::createRenderer):
1887 * ksvg2/svg/SVGMarkerElement.cpp:
1888 (WebCore::SVGMarkerElement::createRenderer):
1889 * ksvg2/svg/SVGMaskElement.cpp:
1890 (WebCore::SVGMaskElement::createRenderer):
1891 * ksvg2/svg/SVGPatternElement.cpp:
1892 (WebCore::SVGPatternElement::createRenderer):
1893 * ksvg2/svg/SVGSVGElement.cpp:
1894 (WebCore::SVGSVGElement::createRenderer):
1895 * ksvg2/svg/SVGSwitchElement.cpp:
1896 (WebCore::SVGSwitchElement::createRenderer):
1897 * ksvg2/svg/SVGUseElement.cpp:
1898 (SVGUseElement::createRenderer):
1900 2006-04-27 Eric Seidel <eseidel@apple.com>
1902 Reviewed by andersca.
1904 Make WebCore accept any */*+xml type as XML.
1905 http://bugzilla.opendarwin.org/show_bug.cgi?id=5998
1906 <rdar://problem/4031511> XmlHttpRequest doesn't allow responses with Content-Type: application/soap+xml
1908 Test: http/tests/xmlhttprequest/supported-xml-content-types.html
1910 * dom/DOMImplementation.cpp:
1911 (WebCore::DOMImplementation::isXMLMIMEType):
1913 2006-04-27 Eric Seidel <eseidel@apple.com>
1915 * WebCore.vcproj/WebCore/WebCore.vcproj: Fix break from last checkin.
1917 2006-04-27 Geoffrey Garen <ggaren@apple.com>
1921 - Added global constructor autogeneration for the following,
1922 many of which are required by *.live.com: Node, Element, Range,
1923 CSSRule, CSSValue, CSSPrimitiveValue, CSSStyleDeclaration, Event,
1924 MutationEvent, NodeFilter
1928 - The autogenerator knows about the "Constructor" data type, which
1929 gets special treatment because it exists purely in the
1930 bindings. It also knows about the "GenerateConstructor" interface
1931 attribute, which does just that.
1933 - The window interface has many Constructor attributes
1935 - The hash table generator swizzles empty tables to tables with one
1936 empty bucket, to prevent crashes in Lookup::findEntry. (The old
1937 generator used to work this way, too.)
1939 - Window object property lookup gets special treatment to allow
1940 shadowing of its built-in global constructor properties. We'll
1941 need to expand this mechanism in the future and make it more
1942 flexible, but it works for now.
1944 * DerivedSources.make:
1945 * WebCore.vcproj/WebCore/WebCore.vcproj:
1946 * WebCore.xcodeproj/project.pbxproj:
1947 * bindings/js/kjs_css.cpp:
1949 * bindings/js/kjs_css.h:
1950 * bindings/js/kjs_window.cpp: Removed 'namedFrameGetter' and its use
1951 because they were bogus; added FIXME describing what they were
1953 (KJS::Window::getValueProperty):
1954 (KJS::Window::getOverridePropertySlot):
1955 (KJS::Window::getOwnPropertySlot):
1956 * bindings/js/kjs_window.h:
1958 * bindings/scripts/CodeGeneratorJS.pm:
1959 * css/CSSPrimitiveValue.idl:
1961 * css/CSSStyleDeclaration.idl: Added.
1966 * dom/MutationEvent.idl:
1968 * dom/NodeFilter.idl:
1970 * page/DOMWindow.idl:
1972 2006-04-27 Mitz Pettel <opendarwin.org@mitzpettel.com>
1976 <http://bugzilla.opendarwin.org/show_bug.cgi?id=8607>
1977 Automate repaint tests
1979 * manual-tests/backgroundSizeRepaint.html: Removed.
1980 * manual-tests/border-repaint-glitch.html: Removed.
1981 * manual-tests/bugzilla-3509.html: Removed.
1982 * manual-tests/bugzilla-5699.html: Removed.
1983 * manual-tests/bugzilla-6278.html: Removed.
1984 * manual-tests/bugzilla-6388.html: Removed.
1985 * manual-tests/bugzilla-6473.html: Removed.
1986 * manual-tests/bugzilla-7235.html: Removed.
1987 * manual-tests/inline-outline-repaint.html: Removed.
1988 * manual-tests/outline-repaint-glitch.html: Removed.
1989 * manual-tests/repaint-resized-overflow.html: Removed.
1990 * manual-tests/table-cell-move.html: Removed.
1992 2006-04-27 Justin Garcia <justin.garcia@apple.com>
1996 <http://bugzilla.opendarwin.org/show_bug.cgi?id=8624>
1997 Placeholders aren't always removed during paste
1998 <rdar://problem/4059807>
1999 Seed: Mail: pasting quoted content sometimes adds a phantom newline
2001 * editing/CompositeEditCommand.cpp: Added a FIXME.
2002 * editing/ReplaceSelectionCommand.cpp:
2003 (WebCore::ReplaceSelectionCommand::doApply):
2004 Removed two no-op setEndingSelection calls.
2005 Store away a br at the position where we'll start inserting content in case the
2006 br a) is made unnecessary by the insertion (it's collapsed away) b) was acting
2007 as a placeholder and should therefore be displaced by inserted content or c) was
2008 acting as a line break and, as a result of the insertion, is now acting as a
2010 Don't only store away brs that have the webkit-block-placeholder class on them.
2011 Any br that does any of the three things just mentioned should be removed.
2012 The linePlaceholder removal was run after the code that makes sure to interpret
2013 incoming brs strictly, and was negating that work in certain cases.
2015 (WebCore::ReplaceSelectionCommand::removeEndBRIfNeeded): Described above.
2016 * editing/ReplaceSelectionCommand.h:
2017 * editing/VisiblePosition.cpp:
2018 (WebCore::isEqualIgnoringAffinity):
2019 Added a workaround for 8622. We want this function to return true even if one of
2020 the two visible positions has been incorrectly canonicalized.
2022 2006-04-26 Tim Omernick <timo@apple.com>
2026 <rdar://problem/4068375> Flash inserted via innerHTML Fails to Show when CSS Display
2027 Style is Toggled via Javascript
2029 * html/html_objectimpl.cpp:
2030 (WebCore::HTMLObjectElement::setComplete):
2031 Set needWidgetUpdate when finished parsing, even if the object element is not in
2032 a document. That way, when the element attaches to a document, it will update its
2033 widget (creating the plug-in view if necessary). This is important when the object
2034 is being inserted via setInnerHTML, since the parsed nodes are not added to the
2035 document until the whole HTML string is parsed.
2037 2006-04-26 Geoffrey Garen <ggaren@apple.com>
2041 - Fixed http://bugzilla.opendarwin.org/post_bug.cgi
2042 REGRESSION (r14048): Google calendar not parsing
2044 * html/HTMLParser.cpp:
2045 (WebCore::HTMLParser::handleError): Rolling out grandparent NULL check
2046 because it caused this regression and there's no test case
2049 2006-04-26 Justin Garcia <justin.garcia@apple.com>
2053 <http://bugzilla.opendarwin.org/show_bug.cgi?id=8459>
2054 REGRESSION: Content lost during a delete/merge of whitespace:pre text
2056 * editing/CompositeEditCommand.cpp:
2057 (WebCore::CompositeEditCommand::prune):
2058 The function would prune a rendered leaf because it assumed that the
2059 first node passed to it would be a container.
2060 The old code ascended using the DOM tree, and would remove the <b> when
2061 pruning the <div> in <b><div></div>foo</b>. Now ascends using the render tree.
2063 2006-04-26 Geoffrey Garen <ggaren@apple.com>
2065 This time for sure. Fixed Windows build too.
2067 * WebCore.vcproj/WebCore/WebCore.vcproj:
2068 * WebCore.xcodeproj/project.pbxproj:
2070 2006-04-26 Geoffrey Garen <ggaren@apple.com>
2076 * bindings/js/kjs_dom.cpp:
2077 * bindings/js/kjs_domnode.h:
2079 2006-04-26 Geoffrey Garen <ggaren@apple.com>
2081 Reviewed by OMG DETHBAKIN.
2083 - Start autogenerating Node. This fixes many missing attributes in our
2084 DOM by making prototypes hold their relevant constants as properties.
2086 * DerivedSources.make:
2087 * WebCore.xcodeproj/project.pbxproj:
2088 * bindings/js/kjs_dom.cpp:
2089 (KJS::DOMEventTargetNode::DOMEventTargetNode):
2091 * bindings/js/kjs_dom.h:
2092 (KJS::DOMEventTargetNode::):
2093 * bindings/js/kjs_domnode.h: Had to break DOMNode into a separate
2094 header to avoid circular dependency in header includes. Gave it an
2095 old-school file name to keep distinguishing beteween old school and
2096 news school files easy.
2097 (KJS::DOMNode::impl):
2098 (KJS::DOMNode::classInfo):
2100 * bindings/js/kjs_window.cpp:
2101 (KJS::Window::getValueProperty):
2102 * bindings/scripts/CodeGeneratorJS.pm:
2103 * dom/DocumentType.idl:
2105 * dom/Node.idl: Added.
2107 * dom/ProcessingInstruction.idl:
2109 2006-04-26 Geoffrey Garen <ggaren@apple.com>
2113 Committing the project file change jhaygood suggesed in
2114 http://bugzilla.opendarwin.org/show_bug.cgi?id=8044
2115 WebKit Visual Studio 2005 project shouldn't use the SolutionDir
2117 Instead of his patch, I used the following commands:
2119 sed -e 's/$(SolutionDir)/$(ProjectDir)\\../g' Image\ Viewer/Image\
2120 Viewer.vcproj > Image\ Viewer/Image\ Viewer.vcproj_ && mv Image\
2121 Viewer/Image\ Viewer.vcproj_ Image\ Viewer/Image\ Viewer.vcproj
2123 sed -e 's/$(SolutionDir)/$(ProjectDir)\\../g'
2124 WebCore/WebCore.vcproj > WebCore/WebCore.vcproj_ && mv
2125 WebCore/WebCore.vcproj_ WebCore/WebCore.vcproj
2128 * WebCore.vcproj/WebCore/WebCore.vcproj:
2130 2006-04-25 Justin Garcia <justin.garcia@apple.com>
2132 Reviewed by harrison
2134 <http://bugzilla.opendarwin.org/show_bug.cgi?id=8583>
2135 Moving paste code around and some small fixes
2137 Moved code to make it easier to do the start merge after the fact,
2138 with moveParagraph, instead of in the middle of the paste operation.
2140 * editing/CompositeEditCommand.cpp:
2141 (WebCore::CompositeEditCommand::moveParagraph):
2142 * editing/ReplaceSelectionCommand.cpp:
2143 (WebCore::ReplaceSelectionCommand::ReplaceSelectionCommand):
2144 (WebCore::ReplaceSelectionCommand::shouldMergeStart):
2145 Moved code to make this decision to its own function. Moved special case
2146 checks to the top. Added m_forceMergeStart to override the special cases
2147 because moveParagraph uses ReplaceSelectionCommand and expects a merge.
2149 (WebCore::ReplaceSelectionCommand::shouldMergeEnd):
2150 No functional changes, just moved code here.
2151 (WebCore::ReplaceSelectionCommand::doApply):
2152 Do the end merge in the opposite direction. Merging two paragraphs destroys
2153 the moved one's block level styles, and we prefer to use the styles of the
2154 one that was in the document, not the one that's being pasted.
2156 * editing/ReplaceSelectionCommand.h:
2157 * editing/Selection.h:
2158 (WebCore::Selection::visibleStart): Added.
2159 (WebCore::Selection::visibleEnd): Added.
2160 * editing/htmlediting.cpp:
2161 (WebCore::enclosingList): Added.
2162 (WebCore::isMailBlockquote):
2163 Don't require a renderer so that this can be used on nodes in fragments.
2165 * editing/htmlediting.h:
2167 2006-04-25 Geoffrey Garen <ggaren@apple.com>
2171 - Removed special handling of attributes in the DOM. To match
2172 WinIE, we used to make all attributes available as properties of
2173 their elements in the DOM, but that has caused us more
2174 compatibility woes than it has solved, so, after talking with Darin
2175 and Maciej, I'm taking it out. (Firefox does not support it.)
2177 A layout test regression caused by this change led me to do the
2180 - Implemented DOM properties missing on EMBED elements: align, height,
2181 name, width, src, type. Since align, height, name, and width are
2182 common to all plugin elements, I factored them and some other common
2183 functionality out into a new abstract base class, HTMLPlugInElement.
2185 - Removed extraneous attribute-to-style mappings on EMBED elements:
2186 valign, border. Why they were there in the first place is a question
2187 for the ages. Neither FF nor IE supports them.
2189 * bindings/js/kjs_dom.cpp:
2190 (KJS::getRuntimeObject):
2191 * bindings/js/kjs_html.cpp:
2193 (KJS::JSHTMLElement::classInfo):
2194 (KJS::JSHTMLElement::accessors):
2195 (KJS::JSHTMLElement::embedGetter):
2196 (KJS::JSHTMLElement::embedSetter):
2197 * bindings/js/kjs_html.h:
2198 (KJS::JSHTMLElement::):
2199 * bindings/scripts/CodeGeneratorJS.pm:
2201 * html/html_objectimpl.cpp:
2202 (WebCore::HTMLPlugInElement::HTMLPlugInElement):
2203 (WebCore::HTMLPlugInElement::align):
2204 (WebCore::HTMLPlugInElement::setAlign):
2205 (WebCore::HTMLPlugInElement::height):
2206 (WebCore::HTMLPlugInElement::setHeight):
2207 (WebCore::HTMLPlugInElement::name):
2208 (WebCore::HTMLPlugInElement::setName):
2209 (WebCore::HTMLPlugInElement::width):
2210 (WebCore::HTMLPlugInElement::setWidth):
2211 (WebCore::HTMLPlugInElement::mapToEntry):
2212 (WebCore::HTMLPlugInElement::parseMappedAttribute):
2213 (WebCore::HTMLPlugInElement::checkDTD):
2214 (WebCore::HTMLAppletElement::HTMLAppletElement):
2215 (WebCore::HTMLAppletElement::~HTMLAppletElement):
2216 (WebCore::HTMLAppletElement::parseMappedAttribute):
2217 (WebCore::HTMLAppletElement::insertedIntoDocument):
2218 (WebCore::HTMLAppletElement::removedFromDocument):
2219 (WebCore::HTMLAppletElement::getInstance):
2220 (WebCore::HTMLAppletElement::closeRenderer):
2221 (WebCore::HTMLAppletElement::detach):
2222 (WebCore::HTMLEmbedElement::HTMLEmbedElement):
2223 (WebCore::HTMLEmbedElement::~HTMLEmbedElement):
2224 (WebCore::HTMLEmbedElement::getInstance):
2225 (WebCore::HTMLEmbedElement::mapToEntry):
2226 (WebCore::HTMLEmbedElement::parseMappedAttribute):
2227 (WebCore::HTMLEmbedElement::attach):
2228 (WebCore::HTMLEmbedElement::detach):
2229 (WebCore::HTMLEmbedElement::insertedIntoDocument):
2230 (WebCore::HTMLEmbedElement::removedFromDocument):
2231 (WebCore::HTMLEmbedElement::src):
2232 (WebCore::HTMLEmbedElement::setSrc):
2233 (WebCore::HTMLEmbedElement::type):
2234 (WebCore::HTMLEmbedElement::setType):
2235 (WebCore::HTMLObjectElement::HTMLObjectElement):
2236 (WebCore::HTMLObjectElement::~HTMLObjectElement):
2237 (WebCore::HTMLObjectElement::getInstance):
2238 (WebCore::HTMLObjectElement::parseMappedAttribute):
2239 (WebCore::HTMLObjectElement::rendererIsNeeded):
2240 (WebCore::HTMLObjectElement::attach):
2241 (WebCore::HTMLObjectElement::closeRenderer):
2242 (WebCore::HTMLObjectElement::detach):
2243 (WebCore::HTMLObjectElement::insertedIntoDocument):
2244 (WebCore::HTMLObjectElement::removedFromDocument):
2245 (WebCore::HTMLObjectElement::recalcStyle):
2246 * html/html_objectimpl.h:
2247 (WebCore::HTMLPlugInElement::endTagRequirement):
2248 (WebCore::HTMLAppletElement::tagPriority):
2249 (WebCore::HTMLEmbedElement::tagPriority):
2250 (WebCore::HTMLObjectElement::tagPriority):
2252 2006-04-25 Beth Dakin <bdakin@apple.com>
2256 Fix for <rdar://problem/4518632> getComputedStyle returns 'auto'
2257 for dimensions like 'margin-left'
2259 * css/CSSComputedStyleDeclaration.cpp:
2260 (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): For
2261 margin and padding, to match Firefox we now go to the renderer to
2262 get the property value instead of calling valueForLength() on the
2263 style attribute. valueForLength() will return the string 'auto' if
2264 that was what was specified in the CSS, or a percentage if it was
2265 specified as a percent. But to match Firefox, we always want to
2266 return a pixel value for margin and padding.
2268 2006-04-26 Mitz Pettel <opendarwin.org@mitzpettel.com>
2270 Reviewed by darin. Landed by eseidel.
2272 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8452
2273 mangleme(0x58c22e11): Random crashes
2275 Test: fast/frames/empty-cols-attribute.html
2277 * platform/StringImpl.cpp:
2278 (WebCore::StringImpl::toLengthArray): If the string is empty, return 0
2279 but set len to 1. This gives the same behavior you get if you don't specify
2280 the attribute at all, matching WinIE and Firefox. Previously, the empty
2281 string resulted in len being set to 0 (and a memory smasher in
2282 RenderFrameSet::layout()).
2283 * rendering/render_frames.cpp:
2284 (WebCore::RenderFrameSet::layout): Added an assert.
2286 2006-04-26 Oliver Hunt <ojh16@student.canterbury.ac.nz>
2288 Reviewed by eseidel. Landed by eseidel.
2290 * WebCore.xcodeproj/project.pbxproj:
2291 * kcanvas/KCanvasFilters.cpp:
2292 (WebCore::operator<<):
2293 * kcanvas/KCanvasFilters.h:
2294 (WebCore::KCComponentTransferFunction::KCComponentTransferFunction):
2295 * kcanvas/device/quartz/KCanvasFilterQuartz.h:
2296 * kcanvas/device/quartz/KCanvasFilterQuartz.mm:
2297 (WebCore::getVectorForChannel):
2298 (WebCore::genImageFromTable):
2299 (WebCore::filterForComponentFunc):
2300 (WebCore::setParametersForComponentFunc):
2301 (WebCore::getFilterForFunc):
2302 (WebCore::KCanvasFEComponentTransferQuartz::getFunctionFilter):
2303 (WebCore::KCanvasFEComponentTransferQuartz::getCIFilter):
2304 * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
2305 (WebCore::KRenderingDeviceQuartz::createFilterEffect):
2306 * kcanvas/device/quartz/filters/WKComponentMergeFilter.cikernel: Added.
2307 * kcanvas/device/quartz/filters/WKComponentMergeFilter.h: Added.
2308 * kcanvas/device/quartz/filters/WKComponentMergeFilter.m: Added.
2309 (+[WKComponentMergeFilter initialize]):
2310 (+[WKComponentMergeFilter filterWithName:]):
2311 (-[WKComponentMergeFilter init]):
2312 (-[WKComponentMergeFilter outputImage]):
2313 * kcanvas/device/quartz/filters/WKDiscreteTransferFilter.cikernel: Added.
2314 * kcanvas/device/quartz/filters/WKDiscreteTransferFilter.h: Added.
2315 * kcanvas/device/quartz/filters/WKDiscreteTransferFilter.m: Added.
2316 (+[WKDiscreteTransferFilter initialize]):
2317 (+[WKDiscreteTransferFilter filterWithName:]):
2318 (-[WKDiscreteTransferFilter init]):
2319 (-[WKDiscreteTransferFilter outputImage]):
2320 * kcanvas/device/quartz/filters/WKGammaTransferFilter.cikernel: Added.
2321 * kcanvas/device/quartz/filters/WKGammaTransferFilter.h: Added.
2322 * kcanvas/device/quartz/filters/WKGammaTransferFilter.m: Added.
2323 (+[WKGammaTransferFilter initialize]):
2324 (+[WKGammaTransferFilter filterWithName:]):
2325 (-[WKGammaTransferFilter init]):
2326 (-[WKGammaTransferFilter outputImage]):
2327 * kcanvas/device/quartz/filters/WKIdentityTransferFilter.h: Added.
2328 * kcanvas/device/quartz/filters/WKIdentityTransferFilter.m: Added.
2329 (+[WKIdentityTransferFilter initialize]):
2330 (+[WKIdentityTransferFilter filterWithName:]):
2331 (-[WKIdentityTransferFilter init]):
2332 (-[WKIdentityTransferFilter outputImage]):
2333 * kcanvas/device/quartz/filters/WKLinearTransferFilter.cikernel: Added.
2334 * kcanvas/device/quartz/filters/WKLinearTransferFilter.h: Added.
2335 * kcanvas/device/quartz/filters/WKLinearTransferFilter.m: Added.
2336 (+[WKLinearTransferFilter initialize]):
2337 (+[WKLinearTransferFilter filterWithName:]):
2338 (-[WKLinearTransferFilter init]):
2339 (-[WKLinearTransferFilter outputImage]):
2340 * kcanvas/device/quartz/filters/WKTableTransferFilter.cikernel: Added.
2341 * kcanvas/device/quartz/filters/WKTableTransferFilter.h: Added.
2342 * kcanvas/device/quartz/filters/WKTableTransferFilter.m: Added.
2343 (+[WKTableTransferFilter initialize]):
2344 (+[WKTableTransferFilter filterWithName:]):
2345 (-[WKTableTransferFilter init]):
2346 (-[WKTableTransferFilter outputImage]):
2347 * ksvg2/svg/SVGComponentTransferFunctionElement.cpp:
2348 (SVGComponentTransferFunctionElement::parseMappedAttribute):
2349 (SVGComponentTransferFunctionElement::transferFunction):
2351 2006-04-25 Eric Seidel <eseidel@apple.com>
2355 Make trunk match the branch. Now nodes are fully removed
2356 from the tree before calling detach. There is (thankfully) no
2357 good way to test this, as no one should depend on this behavior.
2358 This change was made are part of fixing:
2359 <rdar://problem/4427024> repro crash on www.formassembly.com in khtml::RenderBlock::addChildToFlow
2360 <rdar://problem/4233435> CrashTracer: 2698 crashes in Safari at com.apple.WebCore: khtml::RenderBlock::addChildToFlow + 156
2363 * dom/ContainerNode.cpp:
2364 (WebCore::ContainerNode::removeChildren):
2366 2006-04-25 Maciej Stachowiak <mjs@apple.com>
2370 - don't have a fini method, since trying to call it will actually call the subclass method
2371 and mess up the bridge count.
2373 * bridge/mac/WebCoreFrameBridge.mm:
2374 (-[WebCoreFrameBridge dealloc]):
2375 (-[WebCoreFrameBridge finalize]):
2377 2006-04-25 Steve Falkenburg <sfalkenburg@apple.com>
2379 Reviewed by eseidel.
2383 * platform/win/TemporaryLinkStubs.cpp:
2384 (KWQFileButton::setFrameGeometry):
2386 2006-04-25 Eric Seidel <eseidel@apple.com>
2390 Fix reproducible crash in html parser code.
2391 http://bugzilla.opendarwin.org/show_bug.cgi?id=7137
2393 Test: fast/parser/remove-current-node-parent.html
2395 * html/HTMLParser.cpp:
2396 (WebCore::HTMLParser::handleError):
2398 2006-04-25 Maciej Stachowiak <mjs@apple.com>
2402 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=8575
2403 New KWQFileButton leaks reported by buildbot
2405 * kwq/KWQFileButton.mm:
2406 (KWQFileButton::KWQFileButton): Add a missing release
2408 2006-04-24 David Hyatt <hyatt@apple.com>
2410 Fix for 8336, focus ring redrawing on top of itself. Make sure
2411 not to include empty rects when doing the focus ring drawing, since
2412 that results in a draw with no clip set.
2416 * platform/mac/GraphicsContextMac.mm:
2417 (WebCore::GraphicsContext::drawFocusRing):
2419 2006-04-24 Eric Seidel <eseidel@apple.com>
2423 Fix for 5th worst unresolved crasher:
2424 <rdar://problem/4129744> [REGRESSION]CrashTracer: ..400 crashes at com.apple.WebCore: DOM::NodeImpl::createRendererIfNeeded + 44
2426 Test: fast/dom/remove-style-element.html
2428 * dom/ContainerNode.cpp:
2429 (WebCore::ContainerNode::removeChildren):
2431 2006-04-24 Eric Seidel <eseidel@apple.com>
2435 Speculative fix for our 7th worst crasher.
2436 Also added ASSERTs to help us better understand the issue.
2437 <rdar://problem/4153404> CrashTracer: 2412 crashes in Safari at com.apple.WebCore: khtml::RenderStyle::RenderStyle[unified] + 44
2440 (WebCore::Document::recalcStyle):
2441 (WebCore::Document::setInPageCache):
2444 (WebCore::Element::recalcStyle):
2446 2006-04-24 Adele Peterson <adele@apple.com>
2450 Fix for <rdar://problem/4503438> REGRESSION (NativeTextField): Can't insert caret when
2451 selection is active in field (Business/Unit)
2453 * css/html4.css: Added -webkit-user-select:text for input elements.
2455 2006-04-24 Maciej Stachowiak <mjs@apple.com>
2459 - move some prematurely moved code back
2461 * bridge/mac/WebCoreFrameBridge.h:
2462 * bridge/mac/WebCoreFrameBridge.mm:
2463 (-[WebCoreFrameBridge fini]):
2465 2006-04-24 Maciej Stachowiak <mjs@apple.com>
2469 - move more code from WebFrameBridge to WebCoreFrameBridge
2471 * bridge/mac/WebCoreFrameBridge.h:
2472 * bridge/mac/WebCoreFrameBridge.mm:
2473 (-[WebCoreFrameBridge domain]):
2474 (-[WebCoreFrameBridge canTargetLoadInFrame:]):
2475 (-[WebCoreFrameBridge fini]):
2476 (-[WebCoreFrameBridge dealloc]):
2477 (-[WebCoreFrameBridge finalize]):
2480 (-[WebCoreFrameBridge isCharacterSmartReplaceExempt:isPreviousCharacter:]):
2481 (-[WebCoreFrameBridge _retrieveKeyboardUIModeFromPreferences:]):
2482 (-[WebCoreFrameBridge keyboardUIMode]):
2484 2006-04-24 Adele Peterson <adele@apple.com>
2488 Fix to send textFieldDidBeginEditing on the first editing change instead of on focus.
2489 This matches our old behavior.
2491 * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::dispatchFocusEvent):
2492 * rendering/RenderTextField.cpp: (WebCore::RenderTextField::subtreeHasChanged):
2494 2006-04-24 Beth Dakin <bdakin@apple.com>
2498 Fix for <rdar://problem/4513383> REGRESSION: Crash in
2499 WebCore::shouldEmitTabBeforeNode() when iterating through document
2502 * editing/TextIterator.cpp:
2503 (WebCore::shouldEmitTabBeforeNode): Need to nil-check the renderer.
2505 2006-04-23 Geoffrey Garen <ggaren@apple.com>
2509 * bindings/scripts/CodeGeneratorJS.pm: Removed confusing 'JS' prefix
2510 from string descriptions of DOM prototypes, so the prototype for, e.g.,
2511 Document serializes as 'Document,' not 'JSDocument.'
2513 2006-04-23 Geoffrey Garen <ggaren@apple.com>
2517 - Took the larger snippets of C++ in the code generator and broke
2518 them into HERE documents in the hopes of improving readability.
2520 * bindings/scripts/CodeGeneratorJS.pm: I indented variable names
2521 level with their corresponding HERE documents to clearly
2522 "sandwich" the HERE documents between opening and closing EOF
2525 2006-04-23 Maciej Stachowiak <mjs@apple.com>
2529 - push WebFileButton and WebStringTruncator code down to WebCore
2530 http://bugzilla.opendarwin.org/show_bug.cgi?id=8552
2533 * WebCore.xcodeproj/project.pbxproj:
2534 * bridge/mac/WebCoreFrameBridge.h:
2535 * bridge/mac/WebCoreStringTruncator.h: Added.
2536 * bridge/mac/WebCoreStringTruncator.mm: Added.
2539 (+[WebCoreStringTruncator widthOfString:font:]):
2540 * bridge/mac/WebCoreViewFactory.h:
2541 * kwq/KWQFileButton.h:
2542 * kwq/KWQFileButton.mm:
2543 (-[WebFileChooserButton initWithWidget::]):
2544 (-[WebCoreFileButton positionButton]):
2545 (-[WebCoreFileButton initWithWidget:]):
2546 (-[WebCoreFileButton initWithFrame:]):
2547 (-[WebCoreFileButton dealloc]):
2548 (-[WebCoreFileButton isFlipped]):
2549 (-[WebCoreFileButton drawRect:]):
2550 (-[WebCoreFileButton updateLabel]):
2551 (-[WebCoreFileButton setFilename:]):
2552 (-[WebCoreFileButton filename]):
2553 (-[WebCoreFileButton setFrameSize:]):
2554 (-[WebCoreFileButton bestVisualFrameSizeForCharacterCount:]):
2555 (-[WebCoreFileButton visualFrame]):
2556 (-[WebCoreFileButton setVisualFrame:]):
2557 (-[WebCoreFileButton baseline]):
2558 (-[WebCoreFileButton beginSheet]):
2559 (-[WebCoreFileButton chooseFilename:]):
2560 (-[WebCoreFileButton cancel]):
2561 (-[WebCoreFileButton chooseButtonPressed:]):
2562 (-[WebCoreFileButton mouseDown:]):
2563 (-[WebCoreFileButton acceptsFirstResponder]):
2564 (-[WebCoreFileButton becomeFirstResponder]):
2565 (-[WebCoreFileButton nextKeyView]):
2566 (-[WebCoreFileButton previousKeyView]):
2567 (-[WebCoreFileButton nextValidKeyView]):
2568 (-[WebCoreFileButton previousValidKeyView]):
2569 (-[WebCoreFileButton performClick]):
2570 (-[WebFileChooserButton initWithWidget:]):
2571 (-[WebFileChooserButton nextValidKeyView]):
2572 (-[WebFileChooserButton previousValidKeyView]):
2573 (-[WebFileChooserButton resignFirstResponder]):
2574 (KWQFileButton::KWQFileButton):
2575 (KWQFileButton::setFilename):
2576 (KWQFileButton::click):
2577 (KWQFileButton::sizeForCharacterWidth):
2578 (KWQFileButton::frameGeometry):
2579 (KWQFileButton::setFrameGeometry):
2580 (KWQFileButton::baselinePosition):
2581 (KWQFileButton::filenameChanged):
2583 2006-04-23 Maciej Stachowiak <mjs@apple.com>
2587 - remove WebCoreCookieAdapter, instead make mac implementation of
2588 CookieJar use Foundation directly.
2591 * WebCore.xcodeproj/project.pbxproj:
2592 * platform/mac/CookieJar.mm:
2594 (WebCore::setCookies):
2595 (WebCore::cookiesEnabled):
2596 * platform/mac/WebCoreCookieAdapter.h: Removed.
2597 * platform/mac/WebCoreCookieAdapter.m: Removed.
2599 2006-04-21 Rob Buis <buis@kde.org>
2601 Reviewed by hyatt. Landed by eseidel.
2603 Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8170:
2604 SVG CSS property values with extra items do not get treated
2605 as invalid (they should)
2607 Fixes the handling of invalid svg css properties similar
2608 to how invalid html css properties are handled, ie. discard
2609 the property if there are more values in the value list than
2612 Test: svg/custom/invalid-css.svg
2614 * ksvg2/css/SVGCSSParser.cpp:
2615 (WebCore::CSSParser::parseSVGValue):
2617 2006-04-23 Michael Emmel <mike.emmel@gmail.com>
2619 Reviewed by mjs. Landed by eseidel.
2621 http://bugzilla.opendarwin.org/show_bug.cgi?id=8517
2622 No test necessary, no functional change.
2624 * DerivedSources.make: use VPATH more consistently.
2626 2006-04-23 Jon Shier <jshier@iastate.edu>
2628 Reviewed by ggaren. Landed by eseidel.
2630 - Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8511
2631 onerror JS property does not register listener properly
2633 Test: fast/dom/onerror-img.html
2635 * bindings/js/kjs_dom.cpp:
2636 (KJS::DOMEventTargetNode::getValueProperty): changed khtmlErrorEvent to errorEvent.
2637 (KJS::DOMEventTargetNode::putValueProperty): ditto.
2638 * bindings/js/kjs_window.cpp:
2639 (KJS::Window::getValueProperty): ditto.
2641 * dom/EventNames.h: Removed khtmlError macro.
2643 2006-04-23 Eric Seidel <eseidel@apple.com>
2647 Reproducible crasher with <li value=1234567890 type=A>
2648 http://bugzilla.opendarwin.org/show_bug.cgi?id=8542
2650 Fixed our alphabetical list generation to match WinIE (not FireFox)
2651 Previously our alphabetical lists were completely wrong past 26 items.
2654 * fast/lists/alpha-list-wrap.html
2655 * fast/lists/li-style-alpha-huge-value-crash.html
2657 * rendering/render_list.cpp:
2658 (WebCore::toLetterString):
2659 (WebCore::toHebrew):
2660 (WebCore::RenderListMarker::calcMinMaxWidth):
2662 2006-04-22 Geoffrey Garen <ggaren@apple.com>
2666 - Finished autogeneration of Element
2668 * bindings/js/kjs_dom.cpp: Removed DOMElement class
2669 * bindings/js/kjs_dom.h: ditto
2670 * bindings/scripts/CodeGeneratorJS.pm: added support for special
2671 attribute lookup that elements do
2672 * dom/Element.idl: added new attribute,
2673 "IncludeAttributesInPropertyLookup," which tells the code generator
2674 to include HTML element attributes in property lookup
2676 2006-04-22 Michael Emmel <mike.emmel@gmail.com>
2680 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8529
2681 Extra Qaulification in header
2682 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8530
2683 Missing assert.h include
2685 * rendering/RenderObject.h: Removed erroneous RenderObject::
2686 prefix from a member function name.
2687 * rendering/RenderText.h: Removed erroneous RenderText::
2688 prefix from a member function name.
2690 * platform/Arena.cpp: Added <assert.h> to list of includes.
2691 * platform/KURL.cpp: Ditto.
2692 * platform/StringImpl.cpp: Ditto.
2693 * platform/image-decoders/jpeg/JPEGImageDecoder.cpp: Ditto.
2694 * platform/image-decoders/png/PNGImageDecoder.cpp: Ditto.
2696 2006-04-22 Darin Adler <darin@apple.com>
2700 2006-04-22 Maciej Stachowiak <mjs@apple.com>
2704 - push down a bunch of WebCoreFrameBridge code to C++ (plus some reformatting)
2706 * bridge/mac/WebCoreFrameBridge.mm:
2707 (-[WebCoreFrameBridge isDescendantOfFrame:]):
2708 (-[WebCoreFrameBridge traverseNextFrameStayWithin:]):
2709 (-[WebCoreFrameBridge nextFrameWithWrap:]):
2710 (-[WebCoreFrameBridge previousFrameWithWrap:]):
2711 (+[WebCoreFrameBridge bridgeForDOMDocument:]):
2712 (-[WebCoreFrameBridge parent]):
2713 (-[WebCoreFrameBridge addData:]):
2714 (-[WebCoreFrameBridge didNotOpenURL:pageCache:]):
2715 (-[WebCoreFrameBridge restoreDocumentState]):
2716 (-[WebCoreFrameBridge _stringWithDocumentTypeStringAndMarkupString:]):
2717 (-[WebCoreFrameBridge nodesFromList:]):
2718 (-[WebCoreFrameBridge markupStringFromNode:nodes:]):
2719 (-[WebCoreFrameBridge markupStringFromRange:nodes:]):
2720 (-[WebCoreFrameBridge rangeByExpandingSelectionWithGranularity:]):
2721 (-[WebCoreFrameBridge rangeByAlteringCurrentSelection:direction:granularity:]):
2722 (-[WebCoreFrameBridge alterCurrentSelection:direction:granularity:]):
2723 (-[WebCoreFrameBridge rangeByAlteringCurrentSelection:verticalDistance:]):
2724 (-[WebCoreFrameBridge alterCurrentSelection:verticalDistance:]):
2725 (-[WebCoreFrameBridge replaceMarkedTextWithText:]):
2726 (-[WebCoreFrameBridge replaceSelectionWithFragment:selectReplacement:smartReplace:matchStyle:]):
2727 (-[WebCoreFrameBridge increaseSelectionListLevel]):
2728 (-[WebCoreFrameBridge decreaseSelectionListLevel]):
2729 (-[WebCoreFrameBridge insertLineBreak]):
2730 (-[WebCoreFrameBridge insertParagraphSeparator]):
2731 (-[WebCoreFrameBridge insertParagraphSeparatorInQuotedContent]):
2732 (-[WebCoreFrameBridge insertText:selectInsertedText:]):
2733 (-[WebCoreFrameBridge deleteSelectionWithSmartDelete:]):
2734 (-[WebCoreFrameBridge ensureSelectionVisible]):
2735 (-[WebCoreFrameBridge RenderObject::nodeInfoAtPoint:allowShadowContent:]):
2737 (WebCore::Frame::nodeInfoAtPoint):
2738 (WebCore::Frame::hasSelection):
2739 (WebCore::Frame::documentTypeString):
2741 * page/FrameTree.cpp:
2742 (WebCore::FrameTree::traverseNextWithWrap):
2743 (WebCore::FrameTree::traversePreviousWithWrap):
2744 (WebCore::FrameTree::deepLastChild):
2747 2006-04-22 Beth Dakin <bdakin@apple.com>
2751 Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=6141
2752 DOMCSSPrimitiveValue is always returning values in pixels when
2753 using getComputedStyle:
2755 getFloatValue() took a unit type as a parameter, ignored it, and
2756 returned m_value.num. This patch writes a second version of the
2757 function that actually converts m_value.num to the specified unites
2758 before returning it. Where a conversion is not required, I removed
2759 the unit type from the caller so that it would go directly to the
2760 inline version of the function.
2762 * css/css_valueimpl.cpp:
2763 (WebCore::CSSPrimitiveValue::computeLengthFloat): Remove type
2764 parameter since a conversion is not needed.
2765 (WebCore::scaleFactorForConversion): Helper function for
2767 (WebCore::CSSPrimitiveValue::getFloatValue): This version of
2768 getFloatValue() takes a unit type parameter and converts
2770 * css/css_valueimpl.h:
2771 (WebCore::CSSPrimitiveValue::getFloatValue): This version does not
2772 take a parameter and just returns m_value.num.
2773 * css/cssparser.cpp:
2774 (WebCore::BorderImageParseContext::commitBorderImage): Remove type
2775 parameter since a conversion is not needed.
2776 * css/cssstyleselector.cpp:
2777 (WebCore::convertToLength): Same.
2778 (WebCore::CSSStyleSelector::applyProperty): Same.
2779 (WebCore::CSSStyleSelector::mapBackgroundSize): Same.
2780 (WebCore::CSSStyleSelector::mapBackgroundXPosition): Same.
2781 (WebCore::CSSStyleSelector::mapBackgroundYPosition): Same.
2782 * editing/ApplyStyleCommand.cpp:
2783 (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange): Same.
2784 * ksvg2/css/SVGCSSStyleSelector.cpp:
2785 (WebCore::CSSStyleSelector::applySVGProperty): Same.
2786 * ksvg2/misc/KCanvasRenderingStyle.cpp:
2787 (WebCore::KSVGPainterFactory::cssPrimitiveToLength): Same.
2789 2006-04-21 Geoffrey Garen <ggaren@apple.com>
2793 - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=8509
2794 javascript:document.importNode(null)
2797 (WebCore::Document::importNode): Throw an error if the node is null.
2798 This happens when the object provided in the JavaScript call is not
2800 (WebCore::Document::adoptNode): Set the DOM exception code in all error
2801 cases instead of just a few, because that's what the spec requires.
2803 2006-04-21 Geoffrey Garen <ggaren@apple.com>
2807 - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=8510
2808 submit event doesn't bubble - it's supposed to.
2810 * html/HTMLElement.cpp:
2811 (WebCore::HTMLElement::parseMappedAttribute): Added recognition for the
2812 onsubmit attribute, so elements can use it
2813 * html/HTMLFormElement.cpp:
2814 (WebCore::HTMLFormElement::prepareSubmit): Changed bubbling attribute
2817 2006-04-21 Geoffrey Garen <ggaren@apple.com>
2821 - Fixed: error event does not bubble
2823 I discovered this bug while working on the "submit event does not
2824 bubble" bug. The DOM spec says the event should bubble, and that's how
2825 it works in Firefox.
2827 The DOM Spec also says that the error event is "valid for
2828 OBJECT elements, BODY elements, and FRAMESET element." But it doesn't
2829 say "valid ONLY." Firefox supports it on all elements and web
2830 developers tend to think it will work for things like <img> and
2831 <script>, so I went whole hog here.
2833 * html/HTMLElement.cpp:
2834 (WebCore::HTMLElement::parseMappedAttribute): Make onerror a mapped
2835 attribute for all elements, so containing elements can register for
2837 * html/HTMLTokenizer.cpp:
2838 (WebCore::HTMLTokenizer::notifyFinished): make onerror bubble
2839 * html/html_headimpl.cpp:
2840 (WebCore::HTMLScriptElement::parseMappedAttribute): Remove special
2841 case for onerror because HTMLElement will take care of it
2842 (WebCore::HTMLScriptElement::notifyFinished): make onerror bubble
2843 * html/html_imageimpl.cpp:
2844 (WebCore::HTMLImageElement::parseMappedAttribute): Remove special
2845 case for onerror because HTMLElement will take care of it
2847 2006-04-21 Adele Peterson <adele@apple.com>
2849 Test for: http://bugzilla.opendarwin.org/show_bug.cgi?id=8181
2850 REGRESSION: After tabbing in page's field, attempting to tab from Google toolbar search to page fails on first try
2852 * manual-tests/tabbing-input-google.html: Added.
2854 2006-04-21 Kevin M. Ollivier <kevino@theolliviers.com>
2858 - http://bugzilla.opendarwin.org/show_bug.cgi?id=8507
2859 Compilation fixes for building on gcc 4.0.2, and without precomp headers
2861 * platform/Cursor.h: Created a fallback case that typedefs PlatformCursor
2862 to void * if it isn't defined to anything else. (Useful to help get new ports
2863 initially compiling.)
2865 * bindings/js/kjs_window.cpp:
2866 * rendering/RenderTextField.cpp:
2867 * rendering/RenderBox.cpp:
2868 Add missing headers to resolve issues when compiling without precompiled
2871 * rendering/RenderText.h: Declare the InlineTextBox class before
2872 friend declaration to resolve compilation issues with gcc 4.0.2.
2874 2006-04-21 Adele Peterson <adele@apple.com>
2878 Fix for: http://bugzilla.opendarwin.org/show_bug.cgi?id=8213
2879 REGRESSION: Can't tab out of text field if iframe comes after it
2881 Test: fast/forms/tabbing-input-iframe.html
2883 * bridge/mac/FrameMac.mm: (WebCore::FrameMac::nextKeyViewInFrame):
2884 If the next focusable node is a RenderWidget without a view, then continue in the loop. We used to break out in this case.
2885 I also made some formatting changes and reorganized the function to make it easier to read.
2887 2006-04-21 Adele Peterson <adele@apple.com>
2891 Fix for: http://bugzilla.opendarwin.org/show_bug.cgi?id=8496
2892 REGRESSION: Dragging to select text around a text field causes the text field to scroll.
2894 Test: manual-tests/text-field-autoscroll.html
2896 * bridge/mac/FrameMac.mm: (WebCore::FrameMac::handleMouseMoveEvent): Start the frame's autoscroll timer
2897 even when we're calling over the bridge to handle the autoscroll.
2898 * page/Frame.cpp: (WebCore::Frame::stopAutoscrollTimer): Clear out pointer to layer.
2900 2006-04-21 Geoffrey Garen <ggaren@apple.com>
2904 * WebCore.vcproj/WebCore/WebCore.vcproj:
2906 2006-04-21 Geoffrey Garen <ggaren@apple.com>
2908 - Futile attempt to fix Windows build.
2910 * WebCore.vcproj/WebCore/WebCore.vcproj:
2912 2006-04-20 Geoffrey Garen <ggaren@apple.com>
2916 - Added autogeneration of JS bindings for CSSRule, CSSValue,
2917 Event, and NodeFilter.
2919 - Made related prototype objects hold the relevant constants, to
2920 match Mozilla and the DOM 2 spec. (Previously, only the related
2921 constructor objects held those constants, in accordance with the
2924 - Fixed up remaining Windows build issues.
2926 * DerivedSources.make: Added new autogenerated files
2927 * WebCore.xcodeproj/project.pbxproj: ditto
2928 * bindings/js/kjs_css.cpp:
2929 (KJS::DOMCSSRule::classInfo):
2930 (KJS::DOMCSSRule::getOwnPropertySlot): scope call to classInfo()
2931 because it's virtual and DOMCSSRule has a derrived class now.
2932 (KJS::DOMCSSRule::put): ditto
2933 (KJS::DOMCSSRuleFunc::callAsFunction):
2935 * bindings/js/kjs_css.h:
2936 * bindings/js/kjs_events.cpp:
2938 * bindings/js/kjs_events.h:
2939 * bindings/js/kjs_html.cpp:
2940 (KJS::OptionConstructorImp::OptionConstructorImp):
2941 * bindings/js/kjs_traversal.cpp:
2943 * bindings/js/kjs_traversal.h:
2944 * bindings/js/kjs_window.cpp:
2945 (KJS::Window::getValueProperty): added CSSValue global object
2946 * bindings/js/kjs_window.h:
2948 * bindings/scripts/CodeGeneratorJS.pm: Changed generator to write
2949 constants to prototype objects (previously only wrote constants to
2950 constructor objects)
2951 * css/CSSPrimitiveValue.idl: Removed LegacyParent since CSSValue now
2953 * css/CSSRule.idl: Added.
2954 * css/CSSValue.idl: Added.
2955 * css/css_ruleimpl.h:
2956 (WebCore::CSSRule::):
2957 * css/css_valueimpl.h:
2958 * dom/Event.idl: Added.
2959 * dom/MutationEvent.idl: Removed LegacyParent since Event now exists
2961 * dom/NodeFilter.idl: Added.
2962 * dom/UIEvent.idl: Removed LegacyParent since event now exists in IDL
2963 * dom/dom2_eventsimpl.h:
2966 2006-04-21 Darin Adler <darin@apple.com>
2968 - one more attempt to fix Windows build
2970 * platform/cairo/GraphicsContextCairo.cpp:
2971 (WebCore::GraphicsContext::fillRect): Update to use Color and match
2972 the similar function on GraphicsContextMac.
2974 2006-04-21 Beth Dakin <bdakin@apple.com>
2978 Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8495
2979 REGRESSION: Sidebar on cnn.com is hosed
2981 * platform/mac/ImageMac.mm:
2982 (WebCore::Image::drawTiled): Use the size of the destination rect,
2983 not the oneTileRect in the no-pattern case.
2984 * rendering/RenderBox.cpp:
2985 (WebCore::RenderBox::paintBackgroundExtended): Initialize
2986 scaledWidth and scaledHeight to the appropriate value (was wrong in
2987 scroll case), adjust position at appropriate times, and take out
2988 no-repeat clause for now since we don't have enough test cases yet
2989 to be sure we won't cause massive regressions.
2991 2006-04-21 Darin Adler <darin@apple.com>
2993 - attempt to fix Windows build after my last check-in
2995 * WebCore.vcproj/Image Viewer/ImageView.cpp: Changed calls to use the
2996 new IntRect-based API.
2998 * html/CanvasPattern.cpp: (WebCore::CanvasPattern::CanvasPattern):
2999 Put appropriate ifdefs around the m_platformImage initializer.
3001 * page/Frame.cpp: Make Frame::adjustPageHeight Mac-OS-X-only for now
3002 since it's used for printing and we don't have printing going on any
3003 other platforms yet.
3005 * platform/cairo/GraphicsContextCairo.cpp: Take out constructor that
3006 takes only the "for printing" boolean for now.
3008 * platform/cairo/ImageCairo.cpp: Include the GraphicsContext.h header.
3010 * platform/win/TemporaryLinkStubs.cpp: (GraphicsContext::setShadow):
3011 Fix up this stub and remove the GraphicsContext empty constructor stub.
3013 2006-04-21 Darin Adler <darin@apple.com>
3017 * WebCore.xcodeproj/project.pbxproj: Replaced absolute path on my system
3018 with a build-result-relative path; also removed some source files from the
3019 list of resources to install!
3021 2006-04-20 Darin Adler <darin@apple.com>
3025 - make <canvas> element and related API behave more like the draft of
3026 the WhatWG Web Application specification, checking parameter validity
3027 and raising exceptions
3028 - changed HTMLCanvasElement bindings to be auto-generated, fixing all
3029 issues so we can generate bindings for classes drived from HTMLElement
3030 - change GraphicsContext API to use IntRect/Point/Size in more cases
3031 - change GraphicsContext so it is closer to truly wrapping a graphics
3032 context rather than representing the current NSGraphicsContext; there
3033 are still some things like text and rectangle fills that are tied to
3034 NSGraphicsContext, but we're most of the way there
3035 - removed Brush class since it just amounted to a color, using an RGBA32
3036 instead where we used to use a Brush
3038 * DerivedSources.make: Added JSHTMLCanvasElement.h.
3039 * WebCore.xcodeproj/project.pbxproj: Added new files.
3041 * bindings/js/JSCanvasRenderingContext2DBase.h: Added toJS.
3042 * bindings/js/JSCanvasRenderingContext2DBase.cpp:
3043 (WebCore::JSCanvasRenderingContext2DBaseProtoFunc::callAsFunction):
3044 Added exception code handling for strokeRect, drawImage, and createPattern.
3045 Added version of createPattern that takes a canvas. Use TYPE_MISMATCH_ERR
3046 instead of JavaScript TypeError when parameter is neither an image or canvas
3047 element. Adapt for new HTMLCanvasElement binding.
3048 (WebCore::toJS): Added. Converts context object to JS wrapper.
3050 * bindings/js/JSHTMLElementWrapperFactory.h: Added.
3051 * bindings/js/JSHTMLElementWrapperFactory.cpp: Added. Creates a JavaScript
3052 wrapper for an arbitrary HTML element. Better than putting this all in the
3053 DOM node class toJS function.
3055 * bindings/js/JSXMLSerializer.cpp: Tweaked to make it build.
3056 * bindings/js/kjs_dom.cpp: (KJS::toJS): Changed to call the
3057 JSHTMLElementWrapperFactory function createJSWrapper, instead
3058 of always creating a JSHTMLElement.
3060 * bindings/js/kjs_html.h: Removed canvas-related stuff. Added HTMLElement
3062 * bindings/js/kjs_html.cpp:
3063 (KJS::JSHTMLElement::classInfo): Removed canvas element.
3064 (KJS::JSHTMLElement::accessors): Ditto.
3065 (KJS::JSHTMLElementProtoFunc::callAsFunction): Added, to help the auto-binding
3066 machiner cope with HTMLElement.
3067 (KJS::HTMLElementFunction::callAsFunction): Removed canvas element.
3069 * bindings/scripts/CodeGeneratorJS.pm: Added types needed for HTMLCanvasElement.
3071 * bridge/mac/FrameMac.mm: (WebCore::FrameMac::setDisplaysWithFocusAttributes):
3072 Changed to create a GraphicsContext with the new constructor that takes
3074 * bridge/mac/WebCoreFrameBridge.mm: (-[WebCoreFrameBridge drawRect:]):
3075 Changed to create a GraphicsContext with the new constructor that takes
3076 a NSGraphicsContext.
3077 * page/Frame.cpp: (WebCore::Frame::adjustPageHeight): Changed to create a
3078 GraphicsContext with the new constructor that takes a CGContextRef.
3080 * editing/SelectionController.cpp: (WebCore::SelectionController::paintCaret):
3081 Eliminated a use of obsolete class Brush.
3083 * html/CanvasPattern.h:
3084 * html/CanvasPattern.cpp:
3085 (WebCore::CanvasPattern::parseRepetitionType): Added. Parses a repetition
3086 type. Different from the old logic in that it is case-sensitive and rejects
3087 anything other than null, empty string, or the four repeat types.
3088 (WebCore::CanvasPattern::CanvasPattern): Added constructor that takes
3089 a CGImageRef. Changed constructor to take two booleans instead of the repetition
3090 type string. It's the caller's responsibility to parse the string.
3091 (WebCore::CanvasPattern::~CanvasPattern): Release the CGImage.
3092 (WebCore::patternCallback): Handle the CGImage case. Also changed the code
3093 to create a GraphicsContext as needed and call the image drawing code with that.
3094 (WebCore::CanvasPattern::createPattern): Handle both the image element case and
3095 the canvas element case.
3097 * html/CanvasRenderingContext2D.h:
3098 * html/CanvasRenderingContext2D.cpp:
3099 (WebCore::CanvasRenderingContext2D::State::State): Change line cap, line join,
3100 and global composite to store enum values instead of strings.
3101 (WebCore::CanvasRenderingContext2D::setLineWidth): Do nothing if width is NaN
3103 (WebCore::CanvasRenderingContext2D::lineCap): Return a string based on a
3104 stored enum, rather than returning a stored string.
3105 (WebCore::CanvasRenderingContext2D::setLineCap): Do nothing if the string is
3106 not one of the standard line cap types. Also case sensitive and stores enum
3107 rather than the string.
3108 (WebCore::CanvasRenderingContext2D::lineJoin): Return a string based on a
3109 stored enum, rather than returning a stored string.
3110 (WebCore::CanvasRenderingContext2D::setLineJoin): Do nothing if the string is
3111 not one of the standard line join types. Also case sensitive and stores enum
3112 rather than the string.
3113 (WebCore::CanvasRenderingContext2D::setMiterLimit): Do nothing if limit is NaN
3115 (WebCore::CanvasRenderingContext2D::setGlobalAlpha): Do nothing if alpha is NaN
3117 (WebCore::CanvasRenderingContext2D::globalCompositeOperation): Return a string
3118 based on a stored enum, rather than returning a stored string.
3119 (WebCore::CanvasRenderingContext2D::setGlobalCompositeOperation): Do nothing if
3120 the string is not one of the standard compositing modes. Also case sensitive and
3121 stores enum rather than the string.
3122 (WebCore::CanvasRenderingContext2D::arcTo): Generate INDEX_SIZE_ERR exception
3123 if radius is NaN or <= 0.
3124 (WebCore::CanvasRenderingContext2D::arc): Ditto.
3125 (WebCore::CanvasRenderingContext2D::rect): Generate INDEX_SIZE_ERR exception
3126 if width or height is NaN or <= 0.
3127 (WebCore::CanvasRenderingContext2D::clearRect): Ditto.
3128 (WebCore::CanvasRenderingContext2D::fillRect): Ditto.
3129 (WebCore::CanvasRenderingContext2D::strokeRect): Ditto, same for line width.
3130 Changed the case where the line width is not specified to share code with the
3132 (WebCore::size): Renamed from imageSize, since C++ overloads based on parameter
3134 (WebCore::CanvasRenderingContext2D::drawImage): Generate INDEX_SIZE_ERR exception
3135 if the source rect is not entirely inside the image rect, or if the width or height
3136 of either the source or destination rect is NaN or <= 0. Changed image drawing
3137 code to be platform-independent for the image element case, but not yet for the
3139 (WebCore::CanvasRenderingContext2D::drawImageFromRect): Change code to parse the
3140 composite operation to use the new code shared with Image.
3141 (WebCore::CanvasRenderingContext2D::createPattern): Added code to parse the
3142 repetition type separately before creating the pattern. Added an overload for
3144 (WebCore::CanvasRenderingContext2D::drawingContext): Changed to return a
3146 (WebCore::CanvasRenderingContext2D::platformContext): Added. Now does what
3147 drawingContext used to do.
3149 * html/CanvasRenderingContext2D.idl: Added exception declarations as needed
3152 * html/HTMLCanvasElement.h:
3153 * html/HTMLCanvasElement.cpp:
3154 (WebCore::HTMLCanvasElement::HTMLCanvasElement): Changed m_drawingContext
3155 to be a GraphicsContext instead of a CGContextRef.
3156 (WebCore::HTMLCanvasElement::~HTMLCanvasElement): Ditto.
3157 (WebCore::HTMLCanvasElement::getContext): Removed special cases for null
3158 and empty string. Only give a 2D graphics context if the string is "2d".
3159 (WebCore::HTMLCanvasElement::reset): Updated for change to GraphicsContext
3161 (WebCore::HTMLCanvasElement::paint): Ditto.
3162 (WebCore::HTMLCanvasElement::createDrawingContext): Changed to create a
3163 GraphicsContext* instead of a CGContextRef.
3164 (WebCore::HTMLCanvasElement::drawingContext): Changed to return a
3165 GraphicsContext* instead of a CGContextRef.
3166 (WebCore::HTMLCanvasElement::createPlatformImage): Updated for changes above.
3168 * html/HTMLCanvasElement.idl: Added.
3170 * html/HTMLParser.h:
3171 * html/HTMLParser.cpp:
3172 (WebCore::HTMLParser::canvasCreateErrorCheck): Added. An attempt to implement the
3173 fallback behavior for canvas elements when JavaScript is off.
3174 (WebCore::HTMLParser::getNode): Sorted list of functions. Added case for canvas.
3176 * html/html_imageimpl.h:
3177 * html/html_imageimpl.cpp:
3178 (WebCore::HTMLImageElement::HTMLImageElement): Changed m_compositeOperator to be
3179 an enum instead of a string.
3180 (WebCore::HTMLImageElement::parseMappedAttribute): Parse the enum here.
3182 * kcanvas/KCanvasResources.h:
3183 * kcanvas/KCanvasResources.cpp: (WebCore::KCanvasMarker::draw): Changed to take a
3184 GraphicsContext parameter.
3186 * kcanvas/RenderPath.h: Added GraphicsContext parameter to drawMarkersIfNeeded.
3188 * kcanvas/RenderPath.cpp: (WebCore::RenderPath::paint):
3189 * kcanvas/RenderSVGImage.cpp: (WebCore::RenderSVGImage::paint):
3190 * kcanvas/RenderSVGText.cpp: (WebCore::RenderSVGText::paint):
3191 Changed to generate and use an appropriate GraphicsContext.
3193 * kcanvas/device/quartz/KCanvasItemQuartz.h: Added GraphicsContext parameter to
3194 drawMarkersIfNeeded.
3195 * kcanvas/device/quartz/KCanvasItemQuartz.mm:
3196 (WebCore::DrawMarkersData::DrawMarkersData): Added GraphicsContext*.
3197 (WebCore::drawMarkerWithData): Pass along a GraphicsContext*.
3198 (WebCore::drawStartAndMidMarkers): Ditto.
3199 (WebCore::KCanvasItemQuartz::drawMarkersIfNeeded): Pass a long a GraphicsContext*.
3201 * kcanvas/device/KRenderingDevice.h: Added a pure virtual createGraphicsContext
3202 to bridge back to a GraphicsContext. Long term that class will replace this one.
3203 * kcanvas/device/quartz/KRenderingDeviceQuartz.h:
3204 * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
3205 (WebCore::KRenderingDeviceContextQuartz::createGraphicsContext): Added.
3207 * ksvg2/svg/SVGMaskElement.cpp: (WebCore::SVGMaskElement::drawMaskerContent):
3208 Create and pass a GraphicsContext -- old code used the default constructor for
3209 GraphicsContext which meant "current context", and that no longer exists.
3210 * ksvg2/svg/SVGPatternElement.cpp:
3211 (WebCore::SVGPatternElement::drawPatternContentIntoTile): Ditto.
3213 * platform/Brush.h: Removed.
3214 * platform/CompositeOperator.h: Added.
3215 * platform/CompositeOperator.cpp: Added.
3217 * platform/Font.h: Changed calls to use IntPoint instead of pairs of ints.
3218 Also removed the const from all the uses of GraphicsContext*.
3220 * platform/GraphicsContext.h: Eliminated default constructor and constructor
3221 that takes only a boolean. Replaced with constructors that take platform
3222 graphics contexts only. Replaced brush-related calls with fill color calls.
3223 Replaced use of Brush with use of Color. Changed Image::CompositeOperator to
3224 just plain CompositeOperator. Changed tuples of ints into IntRect and IntPoint.
3225 Moved setFocusRingClip and clearFocusRingClip out of ifdefs. Removed unused
3226 getCompositeOperation and string-based setCompositeOperation. Moved
3227 currentCGContext and the other setCompositeOperation out of the GraphicsContext
3228 class and made them global functions. Fixed platformContext so it won't always
3229 return the CGContextRef of the current NSGraphicsContext. Instead, it will
3230 return the appropriate CGContextRef for the GraphicsContext. This eliminates
3231 the need to use void* for the image-drawing functions.
3233 * platform/GraphicsContext.cpp:
3234 (WebCore::GraphicsContextState::GraphicsContextState): Replaced Brush with
3236 (WebCore::GraphicsContext::setFillColor): Renamed from setBrush.
3237 (WebCore::GraphicsContext::fillColor): Renamed from brush.
3238 (WebCore::GraphicsContext::drawImage): Changed to use IntRect.
3239 (WebCore::GraphicsContext::drawTiledImage): Moved here from GraphicsContextMac.mm.
3240 (WebCore::GraphicsContext::drawText): Changed to use IntPoint.
3241 (WebCore::GraphicsContext::drawHighlightForText): Ditto.
3242 (WebCore::GraphicsContext::drawLineForText): Ditto.
3243 (WebCore::GraphicsContext::drawLineForMisspelling): Ditto.
3245 * platform/Image.h: Removed CompositeOperator and related functions.
3246 Removed void* context parameters from draw functions.
3248 * platform/Image.cpp: Removed compositeOperatorFromString.
3250 * platform/Widget.h: Added a GraphicsContext* return value from lockDrawingFocus
3251 that you pass back to unlockDrawingFocus (for deletion).
3253 * platform/mac/FontMac.mm:
3254 (WebCore::Font::selectionRectForText): Changed parameter to point and removed
3255 const on GraphicsContext* parameter.
3256 (WebCore::Font::drawText): Ditto.
3257 (WebCore::Font::drawHighlightForText): Ditto.
3258 (WebCore::Font::drawLineForText): Ditto.
3259 (WebCore::Font::drawLineForMisspelling): Ditto.
3260 (WebCore::Font::misspellingLineThickness): Removed const.
3262 * platform/mac/GraphicsContextMac.mm:
3263 (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
3264 Added fields to store a CGContextRef and an NSGraphicsContext.
3265 (WebCore::GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate):
3266 Release both the CGContextRef and the NSGraphicsContext.
3267 (WebCore::GraphicsContext::GraphicsContext): Implement to set up both the
3268 CGContextRef and the NSGraphicsContext in one case, and only the CGContextRef
3270 (WebCore::GraphicsContext::savePlatformState): Implement for the CGContext-only
3272 (WebCore::GraphicsContext::restorePlatformState): Ditto.
3273 (WebCore::GraphicsContext::drawRect): Assert that the NS context is present
3275 (WebCore::GraphicsContext::setColorFromFillColor): Renamed from
3277 (WebCore::GraphicsContext::setColorFromPen): Added assertion.
3278 (WebCore::GraphicsContext::drawLine): Added assertion.
3279 (WebCore::GraphicsContext::drawEllipse): Get CGContext from the platformContext
3280 function instead of currentCGContext, and changed to use fillColor.
3281 (WebCore::GraphicsContext::drawArc): Ditto.
3282 (WebCore::GraphicsContext::drawConvexPolygon): Ditto.
3283 (WebCore::setCompositeOperation): Changed to global function and also changed
3284 to do the work here -- no need to use WebCoreImageRendererFactory.
3285 (WebCore::GraphicsContext::drawImage): Move most of this into GraphicsContext.cpp.
3286 Remove the void* context parameter. Changed to take rects instead of separate coordinates.
3287 (WebCore::GraphicsContext::fillRect): Changed to take color instead of Brush.
3288 (WebCore::GraphicsContext::addClip): Added assertion.
3289 (WebCore::GraphicsContext::addRoundedRectClip): Get CGContextRef from the platformContext
3290 function instead of currentCGContext.
3291 (WebCore::GraphicsContext::createRenderingDeviceContext): Ditto.
3292 (WebCore::GraphicsContext::beginTransparencyLayer): Ditto.
3293 (WebCore::GraphicsContext::endTransparencyLayer): Ditto.
3294 (WebCore::GraphicsContext::setShadow): Change to take size instead of x,y. Also get
3295 CGCOntextRef from the platformContext function instead of currentCGContext.
3296 (WebCore::GraphicsContext::clearShadow): Get CGContextRef from the platformContext
3297 function instead of currentCGContext.
3298 (WebCore::GraphicsContext::platformContext): Added. Returns m_data->m_cgContext.
3300 * platform/mac/ImageMac.mm:
3301 (WebCore::fillSolidColorInRect): Updated for change in CompositeOperator type.
3302 (WebCore::Image::checkForSolidColor): Ditto.
3303 (WebCore::Image::draw): Removed void* context parameter and replaced it with
3304 a GraphicsContext* parameter. Renamed from drawInRect.
3305 (WebCore::Image::drawTiled): Ditto. Renamed from tileInRect and scaleAndTileInRect.
3307 * platform/mac/PDFDocumentImage.h: Updated for change in CompositeOperator type.
3308 * platform/mac/PDFDocumentImage.mm: (WebCore::PDFDocumentImage::draw): Ditto.
3310 * platform/mac/WidgetMac.mm:
3311 (WebCore::Widget::lockDrawingFocus): Changed to return a GraphicsContext*.
3312 (WebCore::Widget::unlockDrawingFocus): Changed to take a GraphicsContext*.
3314 * rendering/InlineTextBox.cpp:
3315 (WebCore::InlineTextBox::selectionRect): Changed to pass IntPoint.
3316 (WebCore::InlineTextBox::paint): Changed to pass IntSize.
3317 (WebCore::InlineTextBox::paintSelection): More of the same.
3318 (WebCore::InlineTextBox::paintMarkedTextBackground): Ditto.
3319 (WebCore::InlineTextBox::paintDecoration): Ditto.
3320 (WebCore::InlineTextBox::paintSpellingMarker): Ditto.
3321 (WebCore::InlineTextBox::paintTextMatchMarker): Ditto.
3322 (WebCore::InlineTextBox::paintMarkedTextUnderline): Ditto.
3323 (WebCore::InlineTextBox::positionForOffset): Ditto.
3324 * rendering/RenderBlock.cpp:
3325 (WebCore::RenderBlock::fillHorizontalSelectionGap): Ditto.
3326 (WebCore::RenderBlock::fillVerticalSelectionGap): Ditto.
3327 (WebCore::RenderBlock::fillLeftSelectionGap): Ditto.
3328 (WebCore::RenderBlock::fillRightSelectionGap): Ditto.
3329 * rendering/RenderBox.cpp:
3330 (WebCore::RenderBox::paintBackgroundExtended): Ditto.
3331 (WebCore::RenderBox::outlineBox): Ditto.
3332 * rendering/RenderImage.cpp:
3333 (WebCore::RenderImage::paint): Ditto.
3334 * rendering/RenderLayer.cpp:
3335 (WebCore::setClip): Take out ifdefs. We'll do that inside GraphicsContext instead.
3336 (WebCore::restoreClip): Ditto.
3337 * rendering/RenderObject.cpp:
3338 (WebCore::RenderObject::drawBorder): More of the same.
3339 (WebCore::RenderObject::paintBorderImage): Ditto.
3340 * rendering/render_line.cpp:
3341 (WebCore::InlineFlowBox::paintDecorations): Ditto.
3342 (WebCore::EllipsisBox::paint): Ditto.
3343 * rendering/render_list.cpp:
3344 (WebCore::RenderListMarker::paint): Ditto.
3346 * rendering/render_frames.cpp: (WebCore::RenderFrameSet::userResize): Set up a graphics
3347 context by calling lockDrawingFocus. Also changed a color here to be a constant.
3349 * platform/cairo/GraphicsContextCairo.cpp:
3350 (WebCore::GraphicsContext::drawImage): Update for parameter type changes.
3351 (WebCore::GraphicsContext::drawScaledAndTiledImage):
3352 (WebCore::GraphicsContext::setFocusRingClip):
3353 (WebCore::GraphicsContext::clearFocusRingClip):
3354 * platform/cairo/ImageCairo.cpp:
3355 (WebCore::setCompositingOperation):
3356 (WebCore::Image::tileInRect):
3357 (WebCore::Image::scaleAndTileInRect):
3359 2006-04-20 Mitz Pettel <opendarwin.org@mitzpettel.com>
3364 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8276
3365 REGRESSION (NativeTextField): Pasting a Finder item into a text field results in
3366 a file: URL being pasted instead of just the file name
3367 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8283
3368 REGRESSION: File's path doesn't appear after dragging file into input field
3370 * bridge/mac/WebCoreFrameBridge.h:
3371 * bridge/mac/WebCoreFrameBridge.mm:
3372 (-[WebCoreFrameBridge isDragCaretRichlyEditable]): Added.
3373 * manual-tests/plain-text-paste.html: Added.
3374 * manual-tests/resources/plain-text-paste: Added.
3375 * manual-tests/resources/plain-text-paste/1.textClipping: Added.
3376 * manual-tests/resources/plain-text-paste/2.textClipping: Added.
3377 * manual-tests/resources/plain-text-paste/3.gif: Added.
3378 * manual-tests/resources/plain-text-paste/4.txt: Added.
3379 * manual-tests/resources/plain-text-paste/5.webloc: Added.
3381 2006-04-20 Darin Adler <darin@apple.com>
3385 - WebCore part of http://bugzilla.opendarwin.org/show_bug.cgi?id=8505
3386 eliminate WebCoreGraphics bridge, demonstrate new SystemInterface technique
3388 * platform/mac/WebCoreGraphicsBridge.h: Removed.
3389 * platform/mac/WebCoreGraphicsBridge.m: Removed.
3390 * platform/mac/WebCoreSystemInterface.h: Added.
3391 * platform/mac/WebCoreSystemInterface.mm: Added.
3393 * WebCore.exp: Add new SystemInterface globals, remove WebCoreGraphicsBridge.
3395 * WebCore.xcodeproj/project.pbxproj: Updated for removed and added files.
3398 * bridge/mac/FrameMac.mm: Removed unneeded include of WebCoreGraphicsBridge.h.
3400 * platform/mac/ClipboardMac.mm: (WebCore::ClipboardMac::setDragImage):
3401 Moved code from WebGraphicsBridge here, using WebCoreSystemInterface so we can
3402 call wkSetDragImage.
3404 * platform/mac/GraphicsContextMac.mm: (WebCore::GraphicsContext::drawFocusRing):
3405 Moved code from WebGraphicsBridge here, using WebCoreSystemInterface so we can
3406 call wkDrawFocusRing.
3408 * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintTextField):
3409 Call wkDrawBezeledTextFieldCell from WebCoreSystemInterface instead of using
3410 WebGraphicsBridge to do the same thing.
3412 2006-04-20 Adele Peterson <adele@apple.com>
3416 Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8273
3417 REGRESSION: Read only input text field renders at the wrong height when value attribute is not present
3419 Test: fast/forms/input-readonly-empty.html
3421 * rendering/RenderBlock.h: Added hasLineIfEmpty.
3422 * rendering/RenderBlock.cpp:
3423 (WebCore::RenderBlock::hasLineIfEmpty): Added. Checks for rootEditableElement as well as
3424 a shadowNode who has an input element as a parent.
3425 (WebCore::RenderBlock::getBaselineOfLastLineBox): Calls hasLineIfEmpty instead of just checking for the rootEditableElement.
3426 * rendering/bidi.cpp: (WebCore::RenderBlock::layoutInlineChildren): ditto.
3428 2006-04-20 Darin Adler <darin@apple.com>
3430 Reviewed by Timothy.
3432 Removed TO_NODE_OFFSET and TO_NODE_ADDRESS macros. These can just be done inline with pointer math.
3434 * platform/DeprecatedString.cpp:
3438 2006-04-19 Adele Peterson <adele@apple.com>
3440 Rubber-stamped by Darin.
3442 Removed optimizations recently added in setInnerHTML and setInnerText. The setInnerHTML change broke a first-letter style test.
3443 The setInnerText change caused an empty text node to get added when setting inner text to an empty string. The bug that this
3444 change went in with remains fixed.
3446 * html/HTMLElement.cpp:
3447 (WebCore::HTMLElement::setInnerHTML):
3448 (WebCore::HTMLElement::setInnerText):
3450 2006-04-19 Mitz Pettel <opendarwin.org@mitzpettel.com>
3454 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6770
3455 REGRESSION: Incomplete repaint when block with clipping grows
3457 * manual-tests/repaint-resized-overflow.html: Added.
3458 * rendering/RenderLayer.cpp:
3459 (WebCore::RenderLayer::RenderLayer):
3460 (WebCore::RenderLayer::computeRepaintRects): Set the m_repaintOverflowOnResize
3461 flag to true if our object itself needs layout or if we're an overflow
3462 and have a normal child that needs layout, in which case if we end up
3463 resizing it will be because of the child, and that child might have not repainted
3464 itself correctly during its own layout.
3465 (WebCore::RenderLayer::updateLayerPositions): Do a full repaint if
3466 m_repaintOverflowOnResize is set and we resized but didn't move.
3467 * rendering/RenderLayer.h:
3469 2006-04-19 Mitz Pettel <opendarwin.org@mitzpettel.com>
3473 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8352
3474 CSS text-shadow does not repaint completely when changed
3476 * manual-tests/dynamic-shadow.html: Added.
3477 * rendering/render_style.cpp:
3478 (WebCore::RenderStyle::diff): Changed to&nb