Skip to content

Allow choosing the box model in Node::getPosition() method - #726

Closed
aprat84 wants to merge 2 commits into
chrome-php:1.15from
aprat84:dom-node-position-box-model
Closed

Allow choosing the box model in Node::getPosition() method#726
aprat84 wants to merge 2 commits into
chrome-php:1.15from
aprat84:dom-node-position-box-model

Conversation

@aprat84

@aprat84 aprat84 commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

When rendering single page documents, this method would be so handy, but it only measures the content-box, so the element padding is omitted.

For this task, and potentially other tasks, it would be useful to be able to chose the box model.

Default to content, so it is backwards compatible!

PD: Ideally, a getBoxModel method could be added, deprecating the getPosition, and return measures for every box model the devtools API returns.

{
"require": {
"php": "^7.4",
"php": "^7.4|^8.0",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is incorrect. PHPStan MUST be run on PHP 7.4 only.

@GrahamCampbell

Copy link
Copy Markdown
Member

I've applied some corrections, and merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants