Dynamic DOM Model for Accurate JavaScript Code Editing

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current developer tools, such as IDEs, cannot accurately provide code completion, refactoring, or other productivity features for JavaScript code manipulating the Document Object Model (DOM) due to the dynamic interrelationship between HTML and JavaScript, as they rely on static DOM representations before code execution.

Innovation Solution

A method and apparatus for dynamic DOM aware code editing that creates a DOM model to record changes in HTML and JavaScript files, allowing for live analysis and storage of changes, enabling features like code hinting, error highlighting, and refactoring during code development.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If static DOM representation is used for code editing assistance, then device complexity is reduced, but code completion accuracy and productivity features deteriorate due to inability to reflect dynamic JavaScript changes

Engineering Contradiction:
Improvecode completion accuracyVSAvoidDOM model complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent performs preliminary analysis of JavaScript code to predict DOM changes before execution. The system analyzes JavaScript statements, identifies DOM manipulation operations, and pre-computes the resulting DOM state, enabling accurate code completion hints to be provided during editing without waiting for actual code execution.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent creates a copy of the DOM structure (DOM model) that can be manipulated independently from the actual running DOM. This copied model is updated based on analyzed JavaScript code, allowing the editor to provide accurate assistance based on the predicted DOM state without affecting the actual application performance or complexity.

Inventive Principle:
Principle #26Copying

2Productivity

If dynamic DOM analysis is implemented to improve code editing assistance, then code completion and refactoring capabilities improve, but processing time and system resource consumption increase

Engineering Contradiction:
Improvedeveloper productivityVSAvoidcode analysis time
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The patent applies partial analysis by focusing only on the specific JavaScript statements that affect the DOM, rather than analyzing the entire codebase. The system identifies and analyzes only the relevant DOM manipulation operations needed to provide code completion assistance, reducing unnecessary processing time and resource consumption.

Inventive Principle:
Principle #16Partial or excessive action

Solution Approach 2:

The patent skips detailed analysis of code paths that do not directly impact the current editing context. The system rapidly processes through irrelevant JavaScript code and focuses computational resources only on the specific DOM manipulations relevant to the developer's current work, thereby reducing overall analysis time.

Inventive Principle:
Principle #21Skipping (Rushing through)

3Ease of manufacture

If static HTML DOM is used for auto-complete features, then implementation simplicity is maintained, but code completion hints become poor and incomplete for dynamic JavaScript operations

Engineering Contradiction:
Improveimplementation simplicityVSAvoiddynamic DOM state information
Core Design Contradiction:
Ease of manufactureVSLoss of information

Solution Approach 1:

The patent introduces an intermediary DOM model that bridges the static HTML DOM and the dynamic JavaScript operations. This intermediary model captures the dynamic state of the DOM as predicted by JavaScript analysis, allowing auto-complete features to access accurate dynamic information without requiring complex direct integration between the editor and running JavaScript.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS9128723B2Method and apparatus for dynamic document object model (DOM) aware code editing
Publication Date: 2015.09.08 ADOBE INC
  • US9128723B2 patent drawing
  • US9128723B2 patent drawing
  • US9128723B2 patent drawing

AI summary

A computer implemented method and apparatus for dynamic Document Object Model (DOM) aware code editing. The method comprising storing, in a DOM model, a plurality of Document Object Model (DOM) elements in one or more HyperText Markup Language (HTML) files for a project; and storing, in the DOM model at least one modification to the DOM that results from execution of one or more JavaScript code files for the project, wherein during JavaScript code editing, the at least one modification to the DOM identifies an interaction between the JavaScript code and the DOM elements.