| Summary: | [Mac] Rewrite WebHTMLConverter::_computedStringForNode in C++ | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Ryosuke Niwa <rniwa> | ||||||
| Component: | HTML Editing | Assignee: | Ryosuke Niwa <rniwa> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | andersca, enrica, kling, koivisto, sam | ||||||
| Priority: | P2 | ||||||||
| Version: | 528+ (Nightly build) | ||||||||
| Hardware: | Mac (Intel) | ||||||||
| OS: | Unspecified | ||||||||
| Bug Depends on: | |||||||||
| Bug Blocks: | 130227, 130284 | ||||||||
| Attachments: |
|
||||||||
|
Description
Ryosuke Niwa
2014-03-14 16:54:02 PDT
Created attachment 226781 [details]
Cleanup
This reduces the runtime from 25-26s to 21-22s (another 20% improvement). Comment on attachment 226781 [details] Cleanup View in context: https://bugs.webkit.org/attachment.cgi?id=226781&action=review > Source/WebCore/platform/mac/HTMLConverter.mm:631 > + if (RefPtr<CSSValue> value = computedStylePropertyForElement(element, propertyName)) { > + String result; > + if (stringFromCSSValue(*value, result)) > + return result; > + } > + > + if (RefPtr<CSSValue> value = computedStylePropertyForElement(element, propertyName)) { > + String result; > + if (value->isInheritedValue()) > + inherit = true; > + else if (stringFromCSSValue(*value, result)) > + return result; > + } Why are we calling computedStylePropertyForElement(element, propertyName) twice here? > Source/WebCore/platform/mac/HTMLConverter.mm:720 > + if (Node* parent = node.parentNode()) This is really a ContainerNode*. > Source/WebCore/platform/mac/HTMLConverter.mm:733 > + if (!result.length()) I'd use isEmpty() here. Comment on attachment 226781 [details] Cleanup View in context: https://bugs.webkit.org/attachment.cgi?id=226781&action=review > Source/WebCore/platform/mac/HTMLConverter.mm:631 > + if (RefPtr<CSSValue> value = computedStylePropertyForElement(element, propertyName)) { > + String result; > + if (stringFromCSSValue(*value, result)) > + return result; > + } > + > + if (RefPtr<CSSValue> value = computedStylePropertyForElement(element, propertyName)) { > + String result; > + if (value->isInheritedValue()) > + inherit = true; > + else if (stringFromCSSValue(*value, result)) > + return result; > + } Why are we calling computedStylePropertyForElement(element, propertyName) twice here? > Source/WebCore/platform/mac/HTMLConverter.mm:720 > + if (Node* parent = node.parentNode()) This is really a ContainerNode*. > Source/WebCore/platform/mac/HTMLConverter.mm:733 > + if (!result.length()) I'd use isEmpty() here. Comment on attachment 226781 [details] Cleanup View in context: https://bugs.webkit.org/attachment.cgi?id=226781&action=review >>> Source/WebCore/platform/mac/HTMLConverter.mm:631 >>> + } >> >> Why are we calling computedStylePropertyForElement(element, propertyName) twice here? > > Why are we calling computedStylePropertyForElement(element, propertyName) twice here? Oops, the second is supposed to be calling computedStylePropertyForElement. Created attachment 226959 [details]
Fixed the bug
Committed r165761: <http://trac.webkit.org/changeset/165761> |