-
Notifications
You must be signed in to change notification settings - Fork 46.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix and update attribute-behavior fixture #26114
Changes from all commits
ab71467
d0032ab
0de4cde
587810d
9a2f7f7
dfb5f26
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -237,6 +237,8 @@ function getRenderedAttributeValue( | |
return document.createElementNS('http://www.w3.org/2000/svg', 'svg'); | ||
} else if (containerTagName === 'document') { | ||
return document.implementation.createHTMLDocument(''); | ||
} else if (containerTagName === 'head') { | ||
return document.implementation.createHTMLDocument('').head; | ||
} else { | ||
return document.createElement(containerTagName); | ||
} | ||
|
@@ -282,12 +284,12 @@ function getRenderedAttributeValue( | |
try { | ||
let container = createContainer(); | ||
renderer.render(react.createElement(tagName, baseProps), container); | ||
defaultValue = read(container.firstChild); | ||
defaultValue = read(container.lastChild); | ||
canonicalDefaultValue = getCanonicalizedValue(defaultValue); | ||
|
||
container = createContainer(); | ||
renderer.render(react.createElement(tagName, props), container); | ||
result = read(container.firstChild); | ||
result = read(container.lastChild); | ||
canonicalResult = getCanonicalizedValue(result); | ||
didWarn = _didWarn; | ||
didError = false; | ||
|
@@ -308,6 +310,12 @@ function getRenderedAttributeValue( | |
); | ||
container = createContainer(); | ||
container.innerHTML = html; | ||
} else if (containerTagName === 'head') { | ||
const html = serverRenderer.renderToString( | ||
react.createElement(tagName, props) | ||
); | ||
container = createContainer(); | ||
container.innerHTML = html; | ||
} else { | ||
const html = serverRenderer.renderToString( | ||
react.createElement( | ||
|
@@ -764,7 +772,7 @@ class App extends React.Component { | |
ReactDOMStable: | ||
'https://unpkg.com/react-dom@latest/umd/react-dom.development.js', | ||
ReactDOMServerStable: | ||
'https://unpkg.com/react-dom@latest/umd/react-dom-server.browser.development.js', | ||
'https://unpkg.com/react-dom@latest/umd/react-dom-server-legacy.browser.development.js', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What caused this change? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh odd, I thought that was already the case. sounds good |
||
ReactNext: '/react.development.js', | ||
ReactDOMNext: '/react-dom.development.js', | ||
ReactDOMServerNext: '/react-dom-server-legacy.browser.development.js', | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consistent with how we read the value of server-rendered markup.
firstChild
returns the DOCTYPE now if we render into adocument
on the client.