Changeset 93439 in webkit
- Timestamp:
- Aug 19, 2011 2:37:27 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 16 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r93437 r93439 1 2011-08-19 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r93425. 4 http://trac.webkit.org/changeset/93425 5 https://bugs.webkit.org/show_bug.cgi?id=66591 6 7 "The newly-added ASSERT is being triggered on several bots" 8 (Requested by jchaffraix on #webkit). 9 10 * fast/css/link-disabled-attr-expected.txt: 11 * fast/css/stylesheet-enable-first-alternate-expected.txt: Removed. 12 * fast/css/stylesheet-enable-first-alternate-on-load-expected.txt: Removed. 13 * fast/css/stylesheet-enable-first-alternate-on-load.html: Removed. 14 * fast/css/stylesheet-enable-first-alternate.html: Removed. 15 * fast/css/stylesheet-enable-second-alternate-expected.txt: Removed. 16 * fast/css/stylesheet-enable-second-alternate-on-load-expected.txt: Removed. 17 * fast/css/stylesheet-enable-second-alternate-on-load.html: Removed. 18 * fast/css/stylesheet-enable-second-alternate.html: Removed. 19 * http/tests/css/link-css-disabled-value-with-slow-loading-sheet-expected.txt: Removed. 20 * http/tests/css/link-css-disabled-value-with-slow-loading-sheet-in-error-expected.txt: Removed. 21 * http/tests/css/link-css-disabled-value-with-slow-loading-sheet-in-error.html: Removed. 22 * http/tests/css/link-css-disabled-value-with-slow-loading-sheet.html: Removed. 23 * http/tests/css/resources/link-css-disabled-value-with-slow-loading-sheet-in-error.js: Removed. 24 * http/tests/css/resources/link-css-disabled-value-with-slow-loading-sheet.js: Removed. 25 * http/tests/css/resources/slow-loading-sheet-in-error.php: Removed. 26 * http/tests/css/resources/slow-loading-sheet.php: Removed. 27 1 28 2011-08-19 Victoria Kirst <vrk@chromium.org> 2 29 -
trunk/LayoutTests/fast/css/link-disabled-attr-expected.txt
r93425 r93439 16 16 FAIL link.disabled should be true. Was false. 17 17 PASS link.sheet is non-null. 18 PASS getComputedStyle(console).backgroundColor is 'rgb(0, 128, 0)' 18 FAIL getComputedStyle(console).backgroundColor should be rgb(0, 128, 0). Was rgba(0, 0, 0, 0). 19 19 FAIL link.disabled should be true. Was false. 20 FAIL getComputedStyle(console).backgroundColor should be rgba(0, 0, 0, 0). Was rgb(0, 128, 0). 20 PASS getComputedStyle(console).backgroundColor is originalBG 21 21 PASS link.disabled is false 22 PASS getComputedStyle(console).backgroundColor is 'rgb(0, 128, 0)' 22 FAIL getComputedStyle(console).backgroundColor should be rgb(0, 128, 0). Was rgba(0, 0, 0, 0). 23 23 PASS getComputedStyle(console).backgroundColor is originalBG 24 24 PASS successfullyParsed is true -
trunk/Source/WebCore/ChangeLog
r93438 r93439 1 2011-08-19 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r93425. 4 http://trac.webkit.org/changeset/93425 5 https://bugs.webkit.org/show_bug.cgi?id=66591 6 7 "The newly-added ASSERT is being triggered on several bots" 8 (Requested by jchaffraix on #webkit). 9 10 * html/HTMLLinkElement.cpp: 11 (WebCore::HTMLLinkElement::HTMLLinkElement): 12 (WebCore::HTMLLinkElement::setDisabled): 13 (WebCore::HTMLLinkElement::sheetLoaded): 14 (WebCore::HTMLLinkElement::disabled): 15 * html/HTMLLinkElement.h: 16 (WebCore::HTMLLinkElement::isEnabledViaScript): 17 1 18 2011-08-18 Adrienne Walker <enne@google.com> 2 19 -
trunk/Source/WebCore/html/HTMLLinkElement.cpp
r93425 r93439 57 57 , m_sizes(DOMSettableTokenList::create()) 58 58 , m_loading(false) 59 , m_ scriptState(Unset)59 , m_isEnabledViaScript(false) 60 60 , m_createdByParser(createdByParser) 61 61 , m_isInShadowTree(false) … … 86 86 void HTMLLinkElement::setDisabled(bool disabled) 87 87 { 88 bool wasEnabledViaScript = isEnabledViaScript();89 setIsEnabledViaScript(!disabled);90 91 88 if (!m_sheet) 92 89 return; 93 90 94 91 bool wasDisabled = m_sheet->disabled(); 95 if (wasDisabled == disabled) { 96 if (wasEnabledViaScript != isEnabledViaScript()) 97 document()->styleSelectorChanged(DeferRecalcStyle); 98 return; 99 } 92 if (wasDisabled == disabled) 93 return; 100 94 101 95 m_sheet->setDisabled(disabled); 96 m_isEnabledViaScript = !disabled; 102 97 103 98 // If we change the disabled state while the sheet is still loading, then we have to … … 126 121 if (!disabled) 127 122 process(); 128 129 ASSERT(areDisabledAndScriptStatesConsistent());130 123 } 131 124 … … 367 360 bool HTMLLinkElement::sheetLoaded() 368 361 { 369 // Migrate the disabled information before removePendingSheet is called370 // as it will start a recalStyleSelector which needs this information.371 if (m_scriptState != Unset) {372 ASSERT(!m_loading);373 // FIXME: We should ASSERT that it was set for stylesheets only, but374 // currently we allow setDisabled to be called regardless of the <link> rel.375 setDisabled(m_scriptState == DisabledViaScript);376 }377 378 362 if (!isLoading()) { 379 363 removePendingSheet(); 380 364 return true; 381 365 } 382 383 366 return false; 384 367 } … … 463 446 bool HTMLLinkElement::disabled() const 464 447 { 465 ASSERT(areDisabledAndScriptStatesConsistent()); 466 467 if (!m_sheet) { 468 // FF disagrees with the CSS OM spec and always has an associated stylesheet for alternate sheet (regardless of whether 469 // the resource is fetched). As we store the enabled state in m_scriptState while loading, return this information to be 470 // consistent with FF. sheetLoaded() is called at the end of any transfer (whether it was in error or not) so m_scriptState 471 // will be transfered back into our stylesheet and the disabled() value should always be consistent. 472 if (isLoading() && m_scriptState != Unset) 473 return m_scriptState == DisabledViaScript; 474 475 return false; 476 } 477 478 return m_sheet->disabled(); 448 return m_sheet && m_sheet->disabled(); 479 449 } 480 450 … … 489 459 } 490 460 491 #ifndef NDEBUG492 bool HTMLLinkElement::areDisabledAndScriptStatesConsistent() const493 {494 if (!m_relAttribute.m_isStyleSheet)495 return true;496 497 // During loading, m_scriptState holds the temporary value for sheet()->disabled()498 // so it can have any values (same for sheet()->disabled()).499 if (isLoading())500 return true;501 502 if (m_scriptState == Unset)503 return true;504 505 bool isDisabledViaScript = m_scriptState == DisabledViaScript;506 return isDisabledViaScript == sheet()->disabled();507 }508 #endif509 510 461 } // namespace WebCore -
trunk/Source/WebCore/html/HTMLLinkElement.h
r93425 r93439 58 58 // FIXME: This should be renamed isStyleSheetLoading as this is only used for stylesheets. 59 59 bool isLoading() const; 60 bool isEnabledViaScript() const { return m_ scriptState ==EnabledViaScript; }60 bool isEnabledViaScript() const { return m_isEnabledViaScript; } 61 61 bool disabled() const; 62 62 void setDisabled(bool); … … 86 86 virtual bool isURLAttribute(Attribute*) const; 87 87 88 private: 88 89 virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const; 89 90 … … 97 98 HTMLLinkElement(const QualifiedName&, Document*, bool createdByParser); 98 99 99 void setIsEnabledViaScript(bool enabled) { m_scriptState = enabled ? EnabledViaScript : DisabledViaScript; }100 #ifndef NDEBUG101 bool areDisabledAndScriptStatesConsistent() const;102 #endif103 104 100 LinkLoader m_linkLoader; 105 101 CachedResourceHandle<CachedCSSStyleSheet> m_cachedSheet; … … 111 107 LinkRelAttribute m_relAttribute; 112 108 bool m_loading; 113 enum EnabledViaScriptState { Unset, EnabledViaScript, DisabledViaScript }; 114 EnabledViaScriptState m_scriptState; 109 bool m_isEnabledViaScript; 115 110 bool m_createdByParser; 116 111 bool m_isInShadowTree; 117 112 118 113 PendingSheetType m_pendingSheetType; 119 114 };
Note: See TracChangeset
for help on using the changeset viewer.